:root {
  --bg-dark: #040810;
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-bg-hover: rgba(22, 33, 56, 0.75);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hover: rgba(52, 211, 153, 0.45);
  --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.22);
  
  --accent-teal: #10b981;
  --accent-cyan: #06b6d4;
  --accent-emerald: #34d399;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --status-online: #34d399;
  --status-warning: #fbbf24;
  --status-offline: #f87171;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
}

body {
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* 5 Ambient Travelling Light Orbs (Corner & Screen Travelling Flames) */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}

.orb-1 {
  top: -120px;
  left: -120px;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.45), rgba(16, 185, 129, 0.12));
  animation: float1 20s ease-in-out infinite alternate;
}

.orb-2 {
  bottom: -160px;
  right: -120px;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.4), rgba(15, 23, 42, 0.25));
  animation: float2 24s ease-in-out infinite alternate;
}

.orb-3 {
  top: 15%;
  right: 15%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.35), rgba(6, 182, 212, 0.08));
  animation: float3 26s ease-in-out infinite alternate;
}

.orb-4 {
  bottom: 20%;
  left: 20%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.4), rgba(52, 211, 153, 0.1));
  animation: float4 30s ease-in-out infinite alternate;
}

.orb-5 {
  top: 45%;
  left: 45%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.32), rgba(16, 185, 129, 0.12));
  animation: float5 28s ease-in-out infinite alternate;
}

@keyframes float1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(120px, 80px) scale(1.12); }
  100% { transform: translate(-40px, 140px) scale(0.92); }
}

@keyframes float2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-140px, -90px) scale(1.18); }
  100% { transform: translate(60px, -60px) scale(0.88); }
}

@keyframes float3 {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-180px, 120px) scale(1.1); }
  66% { transform: translate(-300px, -80px) scale(0.9); }
  100% { transform: translate(-80px, -150px) scale(1.05); }
}

@keyframes float4 {
  0% { transform: translate(0, 0) scale(0.9); }
  33% { transform: translate(220px, -140px) scale(1.15); }
  66% { transform: translate(140px, 100px) scale(1.0); }
  100% { transform: translate(-60px, -200px) scale(0.95); }
}

@keyframes float5 {
  0% { transform: translate(-100px, -100px) scale(1); }
  50% { transform: translate(150px, 120px) scale(1.14); }
  100% { transform: translate(-150px, 80px) scale(0.86); }
}

/* Glass Panels & Utility Cards */
.glass, .glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37), var(--glass-highlight);
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-hover:hover, .glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 40px 0 rgba(52, 211, 153, 0.15), var(--glass-highlight);
}

/* Layout Structure */
.app-layout {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* Sidebar Navigation */
.sidebar {
  width: 270px;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  border-right: 1px solid var(--glass-border);
  background: rgba(8, 14, 26, 0.55);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 8px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: #040810;
  box-shadow: 0 0 25px rgba(52, 211, 153, 0.5);
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-main);
}

.brand-text p {
  font-size: 11px;
  color: var(--accent-emerald);
  font-weight: 600;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-radius: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.25s ease;
}

.nav-item.active a, .nav-item a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--glass-highlight);
}

.nav-item.active a {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.25), rgba(6, 182, 212, 0.08));
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--accent-emerald);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2), var(--glass-highlight);
}

/* Main Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Topbar Header */
.topbar {
  height: 80px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(8, 14, 26, 0.4);
  backdrop-filter: blur(25px);
}

.search-box input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 20px;
  color: #fff;
  width: 340px;
  outline: none;
  font-size: 13px;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--accent-emerald);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Buttons */
.btn-action {
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  color: #040810;
  border: none;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(52, 211, 153, 0.35);
  transition: all 0.25s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(52, 211, 153, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Page Content */
.content {
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
}

/* KPI Cards Row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.kpi-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kpi-title {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-emerald);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 14px currentColor;
}
.status-dot.online { background: var(--status-online); color: var(--status-online); }
.status-dot.offline { background: var(--status-offline); color: var(--status-offline); }
.status-dot.warning { background: var(--status-warning); color: var(--status-warning); }

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.media-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.media-preview {
  height: 155px;
  background-size: cover;
  background-position: center;
  position: relative;
  border-bottom: 1px solid var(--glass-border);
}

.media-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(4, 8, 16, 0.75);
  backdrop-filter: blur(12px);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--accent-emerald);
}

.media-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.media-name {
  font-size: 14px;
  font-weight: 700;
}

.media-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Tables */
.devices-table, .data-table {
  width: 100%;
  border-collapse: collapse;
}

.devices-table th, .devices-table td,
.data-table th, .data-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
  font-size: 14px;
}

.devices-table th, .data-table th {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}

/* Status Pills & Badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
}

.pill-online {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.2);
}

.pill-offline {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.pill-badge {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

/* Form Inputs & Selects */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 18px;
  color: #fff;
  outline: none;
  font-size: 14px;
  transition: all 0.2s ease;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.2);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 8, 16, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  padding: 32px;
}
