/* ═══════════════════════════════════════════════════════════════════
   APEX CLOUD — Core Glassmorphism Design System
   Ultra-luxury cyber-glass aesthetic
   ═══════════════════════════════════════════════════════════════════ */

/* ── RESET & ROOT ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Accent palette */
  --accent:        #3b82f6;
  --accent-2:      #06b6d4;
  --accent-3:      #8b5cf6;
  --accent-glow:   rgba(59,130,246,0.45);
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --pink:          #ec4899;

  /* Glass layers */
  --glass-bg:      rgba(255,255,255,0.04);
  --glass-bg-2:    rgba(255,255,255,0.07);
  --glass-bg-3:    rgba(255,255,255,0.10);
  --glass-border:  rgba(255,255,255,0.10);
  --glass-border-2:rgba(255,255,255,0.15);
  --glass-shadow:  0 24px 80px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.08) inset;

  /* Typography */
  --txt:           #f1f5f9;
  --txt-2:         #94a3b8;
  --txt-3:         #475569;
  --txt-4:         #334155;

  /* Base */
  --base:          #040812;
  --base-2:        #070d1a;
  --base-3:        #0d1528;

  /* Radius */
  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-xl:   32px;
  --r-pill: 9999px;

  /* Transitions */
  --t-fast:   0.15s cubic-bezier(0.4,0,0.2,1);
  --t-mid:    0.3s  cubic-bezier(0.4,0,0.2,1);
  --t-spring: 0.5s  cubic-bezier(0.34,1.56,0.64,1);
}

[data-theme="light"] {
  --glass-bg:       rgba(255,255,255,0.65);
  --glass-bg-2:     rgba(255,255,255,0.75);
  --glass-bg-3:     rgba(255,255,255,0.85);
  --glass-border:   rgba(0,0,0,0.08);
  --glass-border-2: rgba(0,0,0,0.12);
  --glass-shadow:   0 24px 80px rgba(0,0,0,0.12), 0 1px 0 rgba(255,255,255,0.9) inset;
  --txt:            #0f172a;
  --txt-2:          #475569;
  --txt-3:          #94a3b8;
  --base:           #e2e8f0;
  --base-2:         #f1f5f9;
  --base-3:         #f8fafc;
}

html, body {
  height: 100%; min-height: 100vh;
  background: var(--base);
  color: var(--txt);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  cursor: none;
  overflow-x: hidden;
}

/* ── CURSOR ── */
#cursor {
  position: fixed; top: 0; left: 0; z-index: 99999;
  width: 36px; height: 36px;
  border: 1.5px solid rgba(59,130,246,0.6);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%,-50%);
  transition: width var(--t-fast), height var(--t-fast),
              border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  mix-blend-mode: normal;
}
#cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 100000;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%,-50%);
  transition: width var(--t-fast), height var(--t-fast), background var(--t-fast);
}
#cursor.hovering {
  width: 56px; height: 56px;
  background: rgba(59,130,246,0.08);
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(59,130,246,0.2);
}
#cursor-dot.hovering {
  width: 4px; height: 4px;
  background: #fff;
}

/* ── BACKGROUND CANVAS ── */
#bg-canvas, #particles {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
}
#bg-canvas { z-index: 0; }
#particles  { z-index: 1; }

/* ── AURORA BLOOMS ── */
.aurora {
  position: fixed; z-index: 1; border-radius: 50%;
  pointer-events: none; filter: blur(80px);
  animation: aurora-drift 16s ease-in-out infinite alternate;
}
.aurora-1 {
  width: 700px; height: 500px;
  top: -150px; left: -200px;
  background: radial-gradient(ellipse, rgba(59,130,246,0.18) 0%, transparent 70%);
  animation-delay: 0s;
}
.aurora-2 {
  width: 600px; height: 600px;
  top: 20%; right: -150px;
  background: radial-gradient(ellipse, rgba(139,92,246,0.15) 0%, transparent 70%);
  animation-delay: -5s;
}
.aurora-3 {
  width: 500px; height: 400px;
  bottom: -100px; left: 30%;
  background: radial-gradient(ellipse, rgba(6,182,212,0.12) 0%, transparent 70%);
  animation-delay: -10s;
}
.aurora-4 {
  width: 400px; height: 400px;
  bottom: 10%; right: 20%;
  background: radial-gradient(ellipse, rgba(236,72,153,0.1) 0%, transparent 70%);
  animation-delay: -3s;
}
@keyframes aurora-drift {
  0%   { transform: translate(0,0) scale(1); }
  33%  { transform: translate(30px,-20px) scale(1.05); }
  66%  { transform: translate(-20px,15px) scale(0.98); }
  100% { transform: translate(10px,10px) scale(1.02); }
}

/* ── GLASS UTILITIES ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border-2);
  box-shadow: var(--glass-shadow);
}
.glass-sm {
  background: var(--glass-bg-2);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.06) inset;
  border-radius: var(--r-lg);
  transition: transform var(--t-mid), box-shadow var(--t-mid), border-color var(--t-mid);
}
.glass-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59,130,246,0.2);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(59,130,246,0.1), 0 1px 0 rgba(255,255,255,0.08) inset;
}

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(4,8,18,0.7);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--glass-border);
}
[data-theme="light"] .topbar { background: rgba(241,245,249,0.75); }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--txt);
  text-decoration: none;
}
.brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(59,130,246,0.5);
}
.brand-icon svg { color: #fff; }

/* ── THEME SWITCHER ── */
.theme-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 14px;
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border-2);
  border-radius: var(--r-pill);
  cursor: none;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--txt-2);
  transition: all var(--t-mid);
}
.theme-btn:hover { border-color: rgba(59,130,246,0.4); color: var(--txt); }
.theme-orb {
  width: 16px; height: 16px; border-radius: 50%;
  background: conic-gradient(from 0deg, #3b82f6, #8b5cf6, #ec4899, #06b6d4, #10b981, #3b82f6);
  animation: spin-orb 4s linear infinite;
  flex-shrink: 0;
}
@keyframes spin-orb { to { transform: rotate(360deg); } }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; letter-spacing: 0.03em;
  cursor: none; border: none; outline: none;
  transition: all var(--t-mid);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(59,130,246,0.4), 0 1px 0 rgba(255,255,255,0.2) inset;
}
.btn-primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 32px rgba(59,130,246,0.6), 0 0 0 1px rgba(255,255,255,0.1), 0 1px 0 rgba(255,255,255,0.25) inset;
}
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-ghost {
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border-2);
  color: var(--txt-2);
}
.btn-ghost:hover { border-color: rgba(59,130,246,0.35); color: var(--txt); background: var(--glass-bg-3); }
.btn-danger {
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.4); }
.btn-success {
  background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25);
  color: var(--success);
}
.btn-success:hover { background: rgba(16,185,129,0.22); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }
.btn-full { width: 100%; }

/* ── FLOATING LABEL INPUT ── */
.field {
  position: relative;
  margin-bottom: 20px;
}
.field-label {
  position: absolute;
  top: 16px; left: 16px;
  font-size: 13px; font-weight: 500;
  color: var(--txt-3);
  pointer-events: none;
  transition: all var(--t-mid);
  transform-origin: left top;
}
.field-input {
  width: 100%;
  padding: 22px 16px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border-2);
  border-radius: var(--r-md);
  color: var(--txt);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: all var(--t-mid);
  appearance: none;
}
.field-input:focus, .field-input:not(:placeholder-shown) { padding-top: 26px; padding-bottom: 6px; }
.field-input:focus { border-color: rgba(59,130,246,0.5); background: rgba(59,130,246,0.04); }
.field-input:focus ~ .field-label,
.field-input:not(:placeholder-shown) ~ .field-label {
  top: 7px; font-size: 10px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--accent);
}
.field-input::placeholder { color: transparent; }
.field-line {
  position: absolute; bottom: 0; left: 16px; right: 16px;
  height: 2px; border-radius: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-mid);
  box-shadow: 0 0 8px var(--accent-glow);
}
.field-input:focus ~ .field-line { transform: scaleX(1); }
.field-pw-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: none;
  color: var(--txt-3); padding: 6px;
  transition: color var(--t-fast);
  display: flex; align-items: center;
}
.field-pw-toggle:hover { color: var(--txt); }

/* ── PASSWORD STRENGTH ── */
.pw-strength { margin-top: 8px; }
.pw-strength-bar {
  height: 3px; background: rgba(255,255,255,0.07); border-radius: 2px; overflow: hidden;
}
.pw-strength-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.4s ease, background 0.4s ease;
  background: var(--danger);
  box-shadow: 0 0 6px currentColor;
}
.pw-strength-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  margin-top: 5px; transition: color 0.4s ease;
  color: var(--txt-3);
}

/* ── TOGGLE SWITCH ── */
.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  width: 42px; height: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border-2);
  border-radius: var(--r-pill);
  position: relative; transition: all var(--t-mid);
}
.toggle input:checked ~ .toggle-track {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 0 12px rgba(59,130,246,0.5);
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform var(--t-spring);
}
.toggle input:checked ~ .toggle-track .toggle-thumb { transform: translateX(18px); }
.toggle-label { font-size: 13px; font-weight: 500; color: var(--txt-2); }

/* ── STATUS INDICATORS ── */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  position: relative;
}
.status-dot::after {
  content: ''; position: absolute; inset: -3px;
  border-radius: 50%; animation: pulse-dot 2.5s ease-in-out infinite;
}
.status-online  { background: var(--success); }
.status-online::after  { background: rgba(16,185,129,0.3); }
.status-offline { background: var(--txt-3); }
.status-offline::after { display: none; }
.status-warn    { background: var(--warning); }
.status-warn::after    { background: rgba(245,158,11,0.3); }
@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(2); opacity: 0; }
}

/* ── BADGES / PILLS ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
}
.badge-blue   { background: rgba(59,130,246,0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.badge-green  { background: rgba(16,185,129,0.12);  color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-amber  { background: rgba(245,158,11,0.12);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-red    { background: rgba(239,68,68,0.12);   color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.badge-purple { background: rgba(139,92,246,0.12);  color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.badge-pink   { background: rgba(236,72,153,0.12);  color: #f472b6; border: 1px solid rgba(236,72,153,0.25); }
.badge-ghost  { background: var(--glass-bg-2); color: var(--txt-2); border: 1px solid var(--glass-border); }

/* ── HOLO BADGE ── */
.holo-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(139,92,246,0.08));
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  color: #93c5fd;
  box-shadow: 0 0 20px rgba(59,130,246,0.15), 0 1px 0 rgba(255,255,255,0.06) inset;
}
.holo-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%,100% { box-shadow: 0 0 4px var(--accent); }
  50%      { box-shadow: 0 0 14px var(--accent), 0 0 28px rgba(59,130,246,0.4); }
}

/* ── MODALS ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-mid);
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal-box {
  width: 100%; max-width: 520px;
  background: rgba(7,13,26,0.95);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--glass-border-2);
  border-radius: var(--r-xl);
  box-shadow: 0 40px 100px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.03);
  padding: 32px;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--t-spring);
}
.modal-backdrop.open .modal-box { transform: scale(1) translateY(0); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--txt); }
.modal-sub   { font-size: 13px; color: var(--txt-2); margin-top: 4px; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg-2); border: 1px solid var(--glass-border);
  border-radius: 8px; cursor: none; color: var(--txt-2);
  transition: all var(--t-fast);
}
.modal-close:hover { color: var(--txt); background: var(--glass-bg-3); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 28px; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 99000;
  min-width: 260px; max-width: 400px;
  padding: 14px 18px;
  background: rgba(7,13,26,0.95);
  border: 1px solid var(--glass-border-2);
  border-radius: var(--r-md);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 500;
  color: var(--txt);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity var(--t-mid), transform var(--t-spring);
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.toast-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.toast-success .toast-icon { background: rgba(16,185,129,0.15); color: var(--success); }
.toast-error   .toast-icon { background: rgba(239,68,68,0.15);  color: var(--danger);  }
.toast-info    .toast-icon { background: rgba(59,130,246,0.15);  color: var(--accent);  }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── SELECT / INPUT RESET ── */
select, input, textarea { font-family: inherit; color: var(--txt); }
select {
  appearance: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border-2);
  border-radius: var(--r-md);
  padding: 10px 36px 10px 14px;
  color: var(--txt); font-size: 13px;
  outline: none; cursor: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--t-fast);
}
select:focus { border-color: rgba(59,130,246,0.5); outline: none; }
select option { background: #0d1528; color: var(--txt); }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border-2), transparent);
  margin: 20px 0;
}

/* ── TABLE ── */
.apex-table { width: 100%; border-collapse: collapse; }
.apex-table th {
  padding: 10px 16px; text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--txt-3);
  border-bottom: 1px solid var(--glass-border);
}
.apex-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px; color: var(--txt-2);
  vertical-align: middle;
}
.apex-table tr:hover td { background: rgba(255,255,255,0.02); }
.apex-table tr:last-child td { border-bottom: none; }

/* ── METRIC CARD ── */
.metric-card {
  padding: 20px 22px;
  position: relative; overflow: hidden;
}
.metric-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--txt-3); margin-bottom: 10px;
}
.metric-value {
  font-size: 32px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--txt); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric-sub { font-size: 11px; color: var(--txt-3); margin-top: 6px; }
.metric-icon {
  position: absolute; right: 18px; top: 18px;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.metric-glow {
  position: absolute; bottom: -20px; right: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  filter: blur(30px); opacity: 0.2;
}

/* ── SIDEBAR LAYOUT ── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: rgba(4,8,18,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 500; overflow-y: auto;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--glass-border);
}
.sidebar-profile {
  margin: 16px;
  padding: 12px 14px;
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  display: flex; align-items: center; gap: 11px;
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.sidebar-name { font-size: 13px; font-weight: 600; color: var(--txt); }
.sidebar-role { font-size: 11px; color: var(--txt-3); }
.nav-section-label {
  padding: 16px 20px 6px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--txt-4);
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 16px; margin: 2px 8px;
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 500;
  color: var(--txt-2); cursor: none;
  transition: all var(--t-fast);
  text-decoration: none;
}
.nav-item:hover { background: var(--glass-bg-2); color: var(--txt); }
.nav-item.active {
  background: rgba(59,130,246,0.12);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,0.18);
}
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px;
  padding: 0 5px;
  background: rgba(59,130,246,0.2);
  border-radius: var(--r-pill);
  font-size: 10px; font-weight: 700;
  color: #93c5fd;
  display: flex; align-items: center; justify-content: center;
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: 256px;
  padding: 80px 32px 40px;
  min-height: 100vh;
  flex: 1;
  position: relative; z-index: 2;
}

/* ── SECTION ── */
.section { display: none; }
.section.active { display: block; animation: fadeUp 0.3s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PAGE TITLE ── */
.page-title {
  font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--txt); margin-bottom: 6px;
}
.page-sub { font-size: 13px; color: var(--txt-3); margin-bottom: 28px; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.grid-6 { display: grid; grid-template-columns: repeat(6,1fr); gap: 14px; }
@media (max-width: 1280px) { .grid-6 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 900px)  { .grid-6 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px)  { .grid-6 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr; } }

/* ── CHART CONTAINER ── */
.chart-wrap {
  position: relative;
  height: 220px;
}
#chart, #portal-chart {
  width: 100%; height: 100%; display: block;
}
.chart-tooltip {
  position: absolute; top: 10px; left: 10px;
  background: rgba(7,13,26,0.96);
  border: 1px solid var(--glass-border-2);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 12px; color: var(--txt);
  pointer-events: none; display: none;
  backdrop-filter: blur(12px);
  min-width: 150px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ── ACTIVITY STREAM ── */
.activity-row {
  display: grid;
  grid-template-columns: 130px 85px 120px 1fr;
  align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 12px;
  transition: background var(--t-fast);
  animation: slideIn 0.25s ease;
}
.activity-row:hover { background: rgba(255,255,255,0.02); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.act-ts    { font-size: 11px; color: var(--txt-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-type  { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.act-code  { font-size: 12px; font-weight: 600; color: var(--txt); }
.act-detail{ font-size: 11px; color: var(--txt-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── NODE CARD ── */
.node-card {
  padding: 14px 16px;
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  transition: all var(--t-mid);
  animation: fadeUp 0.3s ease;
}
.node-card:hover { border-color: rgba(59,130,246,0.2); }
.node-ip { font-size: 10px; color: var(--txt-3); font-family: 'JetBrains Mono', monospace; margin-top: 4px; }
.node-device { font-size: 10px; color: var(--txt-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── PROGRESS BAR ── */
.progress-wrap { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ── COUNTDOWN ── */
.countdown-grid {
  display: flex; gap: 12px;
}
.cd-unit {
  flex: 1; text-align: center;
  padding: 14px 8px;
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
}
.cd-value {
  font-size: 28px; font-weight: 800;
  color: var(--txt); letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: block;
}
.cd-label { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt-3); }

/* ── API KEY DISPLAY ── */
.apikey-box {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--txt-2);
}
.apikey-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── CHECKLIST ── */
.check-list { display: flex; flex-direction: column; gap: 12px; }
.check-item { display: flex; align-items: center; gap: 11px; }
.check-icon {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--success);
  box-shadow: 0 0 10px rgba(16,185,129,0.2);
}
.check-text { font-size: 13px; color: var(--txt-2); }

/* ── SHINE TEXT ── */
.shine {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), #a78bfa, var(--accent));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine-move 3s linear infinite;
}
@keyframes shine-move { to { background-position: -300% 0; } }

/* ── VERSION PILL ── */
.version-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.08em; color: var(--txt-3);
}
.version-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px var(--success); }

/* ── PLAN BADGE ── */
.plan-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  border: 1px solid;
}

/* ── MISC ── */
.mono { font-family: 'JetBrains Mono', monospace; }
.text-muted { color: var(--txt-3); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 10px; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex   { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.ai-center { align-items: center; }
.jc-between { justify-content: space-between; }
.jc-center { justify-content: center; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.p-0   { padding: 0; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.relative { position: relative; }
.section-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--txt-3);
  margin-bottom: 12px;
}

/* ── LIVE REAL-TIME TOKEN TELEMETRY CAPSULE & BANNER ── */
.token-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9999px;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
  cursor: pointer;
  user-select: none;
}
.token-live-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.25);
}
.token-live-badge.optimal {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}
.token-live-badge.armed {
  background: rgba(6, 182, 212, 0.08);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}
.token-live-badge.recharging {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}
.token-live-badge.starving {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}
.token-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 1.5s infinite;
}
.token-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--txt-2);
}
.token-val {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  min-width: 26px;
  text-align: center;
}
.token-status-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.spin-anim {
  animation: spin 0.6s linear;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
