/* ============================================================================
   NNGF C2 — Northern Shield Command Console
   Themeable design system. LIGHT by default (nnpc-matched), DARK via
   :root[data-theme="dark"]. Surfaces/lines/inks/glass are tokenized and flip
   between themes; semantic accents (emerald/amber/red/sky) stay constant.
   ========================================================================== */

:root {
  /* ---------- LIGHT (default) ---------- */
  --bg-0:  #e9f2f8;
  --bg-1:  #eef6fb;
  --bg-2:  #f4fbff;
  --bg-stop: #f4fbff;
  --bg-grad-1: rgba(47, 157, 104, 0.14);
  --bg-grad-2: rgba(224, 168, 62, 0.16);

  --panel:       rgba(255, 255, 255, 0.94);
  --panel-2:     rgba(247, 251, 255, 0.97);
  --panel-3:     rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --glass-blur:  16px;

  --sidebar-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 255, 0.97));
  --topbar-bg:    rgba(255, 255, 255, 0.82);
  --hero-grad:    linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(243, 251, 255, 0.95));
  --map-bg:       radial-gradient(1000px 720px at 50% 40%, #eef5f0 0%, #e2ebe6 82%);
  --overlay-strong:  rgba(255, 255, 255, 0.9);
  --overlay-stronger: rgba(255, 255, 255, 0.96);
  --toast-crit-bg:   rgba(253, 240, 239, 0.97);
  --thumb-bg:  #e8f0ec;
  --video-bg:  #05090a;            /* video letterbox: dark in BOTH themes */
  --video-scrim: rgba(4, 9, 6, 0.72);
  --input-bg:  #ffffff;
  --raise:       rgba(19, 33, 51, 0.045);
  --raise-hover: rgba(47, 157, 104, 0.09);
  --row-hover:   rgba(47, 157, 104, 0.07);
  --sink:        rgba(19, 33, 51, 0.1);
  --crest-inset: rgba(255, 255, 255, 0.35);
  --crest-shadow: 0 6px 16px rgba(13, 31, 52, 0.22);

  --line:      rgba(29, 57, 88, 0.14);
  --line-2:    rgba(29, 57, 88, 0.22);
  --line-soft: rgba(29, 57, 88, 0.08);

  --ink:     #132133;
  --ink-dim: #33475f;
  --muted:   rgba(37, 58, 83, 0.72);
  --faint:   #5c6b7d;

  --emerald:       #1f8a52;
  --emerald-2:     #0f7d49;
  --emerald-dim:   #0b6a3a;
  --emerald-bright:#2f9d68;
  --amber:  #9a6b0f;
  --gold:   #b8860b;
  --red:    #dc2626;
  --red-2:  #c0271f;
  --red-ink:#8a1f16;
  --sky:    #2166b8;
  --violet: #6d5cd6;
  --ink-on-accent: #ffffff;
  --link-hover: #0b6a3a;
  --selection: rgba(47, 157, 104, 0.18);

  --nav-on-ink: #0b3d28;
  --nav-on-bg:  linear-gradient(100deg, rgba(47, 157, 104, 0.18) 0%, rgba(47, 157, 104, 0.04) 100%);

  --glow-emerald: 0 0 10px rgba(47, 157, 104, 0.3);
  --glow-red:     0 0 10px rgba(220, 38, 38, 0.3);
  --shadow:    0 18px 34px rgba(13, 31, 52, 0.12);
  --shadow-sm: 0 10px 24px rgba(13, 31, 52, 0.1);
  --emerald-btn-shadow: 0 8px 20px rgba(11, 106, 58, 0.24);

  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --ease: 220ms cubic-bezier(0.22, 0.61, 0.36, 1);

  --sans:    'Plus Jakarta Sans', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --display: 'Sora', 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono:    'DM Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;
}

:root[data-theme="dark"] {
  /* ---------- DARK ---------- */
  --bg-0:  #05090a;
  --bg-1:  #081210;
  --bg-2:  #0b1a15;
  --bg-stop: #071410;
  --bg-grad-1: rgba(47, 157, 104, 0.16);
  --bg-grad-2: rgba(224, 168, 62, 0.10);

  --panel:       rgba(13, 26, 21, 0.72);
  --panel-2:     rgba(20, 36, 29, 0.66);
  --panel-3:     rgba(9, 18, 14, 0.85);
  --panel-solid: #0f1d18;

  --sidebar-grad: linear-gradient(180deg, rgba(11, 24, 19, 0.86), rgba(7, 15, 12, 0.9));
  --topbar-bg:    rgba(8, 16, 13, 0.7);
  --hero-grad:    linear-gradient(140deg, rgba(17, 32, 26, 0.9), rgba(10, 20, 16, 0.82));
  --map-bg:       radial-gradient(1000px 720px at 50% 40%, #0d1f18 0%, #060f0a 82%);
  --overlay-strong:   rgba(7, 15, 11, 0.82);
  --overlay-stronger: rgba(7, 15, 11, 0.94);
  --toast-crit-bg:    rgba(46, 12, 12, 0.95);
  --thumb-bg:  #070f0a;
  --input-bg:  rgba(0, 0, 0, 0.28);
  --raise:       rgba(255, 255, 255, 0.03);
  --raise-hover: rgba(255, 255, 255, 0.05);
  --row-hover:   rgba(47, 157, 104, 0.06);
  --sink:        rgba(0, 0, 0, 0.4);
  --crest-inset: rgba(255, 255, 255, 0.12);
  --crest-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);

  --line:      rgba(120, 190, 158, 0.14);
  --line-2:    rgba(120, 190, 158, 0.24);
  --line-soft: rgba(120, 190, 158, 0.08);

  --ink:     #e9f5ee;
  --ink-dim: #b3ccbf;
  --muted:   #7f9d8e;
  --faint:   #5f7a6c;

  --emerald:       #2f9d68;
  --emerald-2:     #38d08a;
  --emerald-dim:   #1f6f4a;
  --emerald-bright:#38d08a;
  --amber:  #e0a83e;
  --gold:   #d9a441;
  --red:    #f0564f;
  --red-2:  #ff7a72;
  --red-ink:#f7c2bf;
  --sky:    #4aa3e0;
  --violet: #9b8cff;
  --link-hover: #6fe6ac;
  --selection: rgba(56, 208, 138, 0.28);

  --nav-on-ink: #ffffff;
  --nav-on-bg:  linear-gradient(100deg, rgba(47, 157, 104, 0.28) 0%, rgba(47, 157, 104, 0.04) 100%);

  --glow-emerald: 0 0 16px rgba(56, 208, 138, 0.45);
  --glow-red:     0 0 16px rgba(240, 86, 79, 0.5);
  --shadow:    0 18px 44px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.3);
  --emerald-btn-shadow: 0 8px 20px rgba(31, 111, 74, 0.28);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 82% -12%, var(--bg-grad-1) 0, transparent 60%),
    radial-gradient(900px 520px at 8% -20%, var(--bg-grad-2) 0, transparent 62%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-0) 58%, var(--bg-stop) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 240ms ease, color 240ms ease;
}
a { color: var(--emerald-2); text-decoration: none; }
a:hover { color: var(--link-hover); }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.mono  { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: 11px; }
::selection { background: var(--selection); }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }

/* ============================================================================ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  background: linear-gradient(130deg, var(--emerald) 0%, var(--emerald-dim) 100%);
  color: var(--ink-on-accent) !important;
  font-family: var(--sans); font-weight: 700; font-size: 14px; letter-spacing: 0.01em; cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), filter var(--ease);
  box-shadow: var(--emerald-btn-shadow);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--raise); color: var(--ink) !important; border-color: var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: var(--raise-hover); border-color: var(--emerald); }
.btn.wide { width: 100%; }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.danger { background: linear-gradient(130deg, var(--red) 0%, #a5322d 100%); box-shadow: 0 8px 20px rgba(165, 50, 45, 0.28); }

/* Theme toggle */
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--raise);
  color: var(--ink-dim); cursor: pointer; transition: all var(--ease); padding: 0;
}
.theme-toggle:hover { border-color: var(--emerald); color: var(--emerald-2); background: var(--raise-hover); }
.theme-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.theme-toggle .ico-sun { display: none; }
.theme-toggle .ico-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

/* ============================================================================ Pills / tags */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; border: 1px solid var(--line-2); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.pill.up   { background: rgba(47, 157, 104, 0.14); color: var(--emerald-2); border-color: rgba(47, 157, 104, 0.4); }
.pill.down { background: rgba(240, 86, 79, 0.14);  color: var(--red-2);     border-color: rgba(240, 86, 79, 0.4); }
.pill.warn { background: rgba(224, 168, 62, 0.16); color: var(--amber);     border-color: rgba(224, 168, 62, 0.4); }
.tag { font-family: var(--mono); font-size: 11px; color: var(--amber); border: 1px solid rgba(224, 168, 62, 0.4);
  border-radius: 6px; padding: 1px 7px; background: rgba(224, 168, 62, 0.1); letter-spacing: 0.03em; }
.chip { display: inline-block; background: var(--raise); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 2px 11px; font-size: 12px; margin: 0 5px 5px 0; color: var(--ink-dim); }

/* ============================================================================ Console shell */
body.console { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px 16px;
  background: var(--sidebar-grad); border-right: 1px solid var(--line); backdrop-filter: blur(var(--glass-blur)); overflow-y: auto; }

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 6px; }
.crest, .crest.sm { display: inline-grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(150deg, var(--emerald) 0%, #123a28 100%); border: 1px solid rgba(56, 208, 138, 0.4);
  color: #f4fff9; font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: 0.06em;
  box-shadow: inset 0 1px 0 var(--crest-inset), var(--crest-shadow); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: 0.02em; color: var(--ink); }
.brand-sub  { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; margin-top: 2px; }

.scope-pill { margin: 14px 6px 6px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(47, 157, 104, 0.08); display: flex; align-items: center; gap: 9px; }
.scope-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald-bright); box-shadow: var(--glow-emerald); flex: 0 0 auto; }
.scope-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.scope-copy strong { font-size: 12px; color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-copy span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; }
.nav-group { margin-bottom: 6px; }
.nav-group-title { padding: 6px 10px 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--faint); }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--ink-dim); font-size: 13.5px; font-weight: 500; position: relative;
  transition: background var(--ease), color var(--ease), transform var(--ease); }
.nav-item:hover { background: var(--raise-hover); color: var(--ink); text-decoration: none; transform: translateX(2px); }
.nav-item.on { background: var(--nav-on-bg); color: var(--nav-on-ink); font-weight: 700; }
.nav-item.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--emerald-bright); box-shadow: var(--glow-emerald); }
.nav-ico { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; color: var(--emerald-2); }
.nav-ico svg { width: 18px; height: 18px; fill: currentColor; }
.nav-item:not(.on) .nav-ico { color: var(--muted); }
.nav-item .nav-badge { margin-left: auto; font-family: var(--mono); font-size: 10.5px; padding: 1px 7px; border-radius: 999px;
  background: rgba(240, 86, 79, 0.18); color: var(--red-2); border: 1px solid rgba(240, 86, 79, 0.4); }

.posture-rail { margin: 16px 6px 0; padding: 13px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.posture-rail .rail-title { margin: 0 0 10px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.rail-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12.5px; }
.rail-item:last-child { margin-bottom: 0; }
.rail-item span { color: var(--muted); }
.rail-item strong { color: var(--emerald-2); font-family: var(--mono); font-weight: 500; font-size: 12px; }
.rail-item strong.warn { color: var(--amber); }
.rail-item strong.crit { color: var(--red-2); }

.sidebar-foot { margin-top: 14px; padding: 0 6px; }
.sidebar-logout { margin-top: 12px; }
.sidebar-logout button { width: 100%; height: 40px; border-radius: 11px; border: 1px solid rgba(240, 86, 79, 0.34);
  background: rgba(240, 86, 79, 0.08); color: var(--red-ink); font-family: var(--sans); font-size: 13px; font-weight: 700; cursor: pointer; transition: all var(--ease); }
.sidebar-logout button:hover { background: rgba(240, 86, 79, 0.16); border-color: rgba(240, 86, 79, 0.5); }
.site-badge { display: inline-block; font-family: var(--mono); font-size: 10.5px; color: var(--amber);
  border: 1px solid rgba(224, 168, 62, 0.4); border-radius: 6px; padding: 1px 8px; margin-bottom: 5px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 26px; height: 66px; background: var(--topbar-bg); border-bottom: 1px solid var(--line); backdrop-filter: blur(var(--glass-blur)); }
.page-heading { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.page-title { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.page-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid rgba(47, 157, 104, 0.4); background: rgba(47, 157, 104, 0.1); font-size: 12px; color: var(--ink-dim); }
.live-indicator::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-bright); box-shadow: var(--glow-emerald); animation: livePulse 2.4s ease-in-out infinite; }
.live-indicator.offline { border-color: rgba(240, 86, 79, 0.4); background: rgba(240, 86, 79, 0.1); }
.live-indicator.offline::before { background: var(--red); box-shadow: var(--glow-red); animation: none; }
.clock { color: var(--ink-dim); font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em; }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.who-name { font-size: 13px; font-weight: 600; }
.who-role { font-size: 10.5px; color: var(--amber); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.content { padding: 26px; }
.content > * { animation: liftIn 520ms var(--ease) both; }

@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes liftIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .content > *, .reveal { animation: none !important; transition: none !important; } }

/* ============================================================================ Hero panel */
.hero-panel { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px;
  padding: 24px; margin-bottom: 22px; border-radius: var(--radius-xl); border: 1px solid rgba(224, 168, 62, 0.3);
  background: radial-gradient(600px 300px at 100% 0%, rgba(47, 157, 104, 0.12), transparent 70%), var(--hero-grad); box-shadow: var(--shadow-sm); }
.hero-panel::after { content: ''; position: absolute; right: -110px; bottom: -130px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 208, 138, 0.12), transparent 70%); pointer-events: none; }
.hero-eyebrow { margin: 0; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); font-weight: 700; }
.hero-panel h1 { margin: 10px 0 8px; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.12; text-wrap: balance; color: var(--ink); }
.hero-copy { margin: 0; color: var(--ink-dim); max-width: 62ch; line-height: 1.6; }
.hero-chipset { display: grid; gap: 10px; align-content: center; }
.hero-chip { border-radius: 13px; border: 1px solid var(--line-2); padding: 11px 13px; background: var(--raise); }
.hero-chip span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.hero-chip strong { display: block; margin-top: 5px; font-size: 15px; color: var(--ink); font-family: var(--mono); }

/* ============================================================================ Cards & grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px;
  backdrop-filter: blur(calc(var(--glass-blur) - 4px)); box-shadow: var(--shadow-sm);
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease); }
.card:hover { border-color: var(--line-2); }
.card-h { font-size: 14px; margin: 0 0 16px; color: var(--ink); font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-h::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(var(--emerald-2), var(--emerald-dim)); }
.card-h .h-meta { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--muted); font-family: var(--mono); }
.grid-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-cards.six { grid-template-columns: repeat(6, 1fr); }
.section-head { margin: 0 0 4px; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: 18px; }

.card.stat { position: relative; overflow: hidden; text-align: left; border-top: 3px solid rgba(47, 157, 104, 0.5); }
.card.stat::after { content: ''; position: absolute; right: -32px; top: -32px; width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 208, 138, 0.12), transparent 70%); pointer-events: none; }
.stat-num { font-family: var(--mono); font-weight: 500; font-size: clamp(1.5rem, 1rem + 1.6vw, 2rem); font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em; line-height: 1.1; color: var(--ink); }
.stat-num.amber { color: var(--amber); }
.stat-num.green { color: var(--emerald-2); }
.stat-num.red   { color: var(--red-2); }
.stat-num.sky   { color: var(--sky); }
.stat-label { color: var(--muted); font-size: 11.5px; margin-top: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-foot { margin-top: 10px; font-size: 12px; color: var(--ink-dim); }
.card.stat { --stat-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 13h4v8H3zM10 9h4v12h-4zM17 5h4v16h-4z'/%3E%3C/svg%3E"); --stat-tint: rgba(47,157,104,0.9); --stat-bg: rgba(47,157,104,0.14); }
.card.stat > .stat-badge { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px; background: var(--stat-bg); display: grid; place-items: center; z-index: 1; }
.card.stat > .stat-badge::before { content: ''; width: 18px; height: 18px; background: var(--stat-tint); -webkit-mask: var(--stat-ico) no-repeat center / contain; mask: var(--stat-ico) no-repeat center / contain; }
.stat-drones     { --stat-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h5v5l-2.5 2.5L12 12l.5-.5L15 9V4h5v5l-3.5 3.5L15 14l-2 2-2-2-1.5-1.5L4 9V4Zm3 12h10v2H7v-2Zm4 3h2v2h-2v-2Z'/%3E%3C/svg%3E"); --stat-tint: rgba(31,138,82,0.95); --stat-bg: rgba(47,157,104,0.14); border-top-color: rgba(47,157,104,0.5); }
.stat-incidents  { --stat-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 1 21h22L12 2Zm0 5 7.5 13h-15L12 7Zm-1 4h2v4h-2v-4Zm0 6h2v2h-2v-2Z'/%3E%3C/svg%3E"); --stat-tint: rgba(154,107,15,0.95); --stat-bg: rgba(224,168,62,0.16); border-top-color: rgba(224,168,62,0.5); }
.stat-detections { --stat-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5C5 5 1 12 1 12s4 7 11 7 11-7 11-7-4-7-11-7Zm0 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10Zm0-2.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z'/%3E%3C/svg%3E"); --stat-tint: rgba(192,39,31,0.9); --stat-bg: rgba(240,86,79,0.12); border-top-color: rgba(240,86,79,0.45); }
.stat-coverage   { --stat-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5 7 13 7 13s7-8 7-13a7 7 0 0 0-7-7Zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5Z'/%3E%3C/svg%3E"); --stat-tint: rgba(47,127,208,0.9); --stat-bg: rgba(47,127,208,0.12); border-top-color: rgba(47,127,208,0.45); }
.stat-link       { --stat-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3C7 3 2.7 5 0 8l2 2c2.2-2.4 6-4 10-4s7.8 1.6 10 4l2-2C21.3 5 17 3 12 3Zm0 6c-3 0-5.7 1.2-7.6 3.2l2 2C7.7 12.9 9.7 12 12 12s4.3.9 5.6 2.2l2-2C17.7 10.2 15 9 12 9Zm0 6c-1.4 0-2.6.6-3.5 1.5L12 20l3.5-3.5C14.6 15.6 13.4 15 12 15Z'/%3E%3C/svg%3E"); --stat-tint: rgba(31,138,82,0.95); --stat-bg: rgba(47,157,104,0.14); border-top-color: rgba(47,157,104,0.5); }
.stat-status     { --stat-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5 3.4 9.7 8 11 4.6-1.3 8-6 8-11V5l-8-3Zm-1.2 13L7 11.2l1.4-1.4 2.4 2.4 4.8-4.8L17 8.8 10.8 15Z'/%3E%3C/svg%3E"); --stat-tint: rgba(154,107,15,0.95); --stat-bg: rgba(224,168,62,0.16); border-top-color: rgba(224,168,62,0.5); }
.stat-users      { --stat-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 11a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm7 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm-7 2c-3 0-7 1.5-7 4.2V20h11v-2.8C13 15.5 12 13 9 13Zm7 .3c.9.8 1.5 1.9 1.5 3.9V20H22v-2.5c0-2.4-3.2-4-6-4.2Z'/%3E%3C/svg%3E"); --stat-tint: rgba(47,127,208,0.9); --stat-bg: rgba(47,127,208,0.12); border-top-color: rgba(47,127,208,0.45); }
.stat-audit      { --stat-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l5 5v15H6V2Zm8 1.5V8h4.5L14 3.5ZM8 12h8v1.6H8V12Zm0 4h8v1.6H8V16Zm0-8h4v1.6H8V8Z'/%3E%3C/svg%3E"); --stat-tint: rgba(109,92,214,0.9); --stat-bg: rgba(109,92,214,0.12); border-top-color: rgba(109,92,214,0.45); }

.kv { width: 100%; border-collapse: collapse; }
.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 14px 8px 0; vertical-align: top; width: 96px; font-size: 13px; }
.kv td { padding: 8px 0; font-size: 14px; }

.perms { margin-top: 14px; }
.perms summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.perms summary:hover { color: var(--ink); }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.perm { background: var(--raise); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 11px; color: var(--muted); font-family: var(--mono); }

.milestones { list-style: none; margin: 0; padding: 0; }
.milestones li { padding: 8px 0 8px 26px; position: relative; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line-soft); }
.milestones li:last-child { border-bottom: 0; }
.milestones li::before { content: '○'; position: absolute; left: 2px; color: var(--line-2); }
.milestones li.done { color: var(--ink-dim); }
.milestones li.done::before { content: '●'; color: var(--emerald-2); }

.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line-2);
  position: sticky; top: 0; background: var(--panel-solid); text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
table.data tr:hover td { background: var(--row-hover); }
table.data td.mono, table.data .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ============================================================================ Enterprise dashboard components */
/* Posture band */
.posture-band { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.posture-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; border: 1px solid; }
.posture-badge::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.posture-badge.ok   { color: var(--emerald-2); border-color: rgba(47,157,104,0.4); background: rgba(47,157,104,0.1); }
.posture-badge.warn { color: var(--amber);     border-color: rgba(224,168,62,0.4); background: rgba(224,168,62,0.12); }
.posture-badge.crit { color: var(--red-2);      border-color: rgba(240,86,79,0.45); background: rgba(240,86,79,0.12); }

/* Horizontal bar chart rows */
.bars { display: grid; gap: 11px; margin-top: 4px; }
.bar-row { display: grid; grid-template-columns: 116px 1fr auto; align-items: center; gap: 12px; font-size: 12.5px; }
.bar-row .bl { color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.bar-track { height: 9px; background: var(--sink); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--emerald), var(--emerald-bright)); min-width: 2px; transition: width var(--ease); }
.bar-fill.amber { background: linear-gradient(90deg, #b9791a, var(--amber)); }
.bar-fill.red   { background: linear-gradient(90deg, #a5322d, var(--red)); }
.bar-fill.sky   { background: linear-gradient(90deg, #2565b0, var(--sky)); }
.bar-fill.violet{ background: linear-gradient(90deg, #4b3bb0, var(--violet)); }
.bar-fill.muted { background: linear-gradient(90deg, var(--faint), var(--muted)); }
.bar-row .bv { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); font-size: 12px; min-width: 26px; text-align: right; }

/* Donut (conic) */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { --p: 0; --c: var(--emerald); width: 108px; height: 108px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--sink) 0); display: grid; place-items: center; position: relative; }
.donut::before { content: ''; position: absolute; inset: 13px; border-radius: 50%; background: var(--panel); }
.donut .donut-c { position: relative; text-align: center; line-height: 1.1; }
.donut .donut-c b { display: block; font-family: var(--mono); font-size: 20px; color: var(--ink); }
.donut .donut-c span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.legend { display: grid; gap: 8px; font-size: 12.5px; }
.legend .lg-row { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.legend .lg-v { margin-left: auto; font-family: var(--mono); color: var(--ink); }

/* Gauge ring (e.g., MFA %) */
.gauge { --p: 0; --c: var(--emerald); width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 3.6deg), var(--sink) 0); display: grid; place-items: center; position: relative; }
.gauge::before { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--panel); }
.gauge b { position: relative; font-family: var(--mono); font-size: 18px; color: var(--ink); }

/* Segmented funnel bar */
.funnel { display: flex; height: 14px; border-radius: 8px; overflow: hidden; margin: 10px 0; border: 1px solid var(--line); }
.funnel span { display: block; height: 100%; }
.funnel .f-pending  { background: rgba(224,168,62,0.6); }
.funnel .f-verified { background: var(--emerald); }
.funnel .f-dismissed{ background: var(--sink); }
.funnel-key { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.funnel-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* Compact metric rows */
.metrics { display: grid; gap: 0; }
.metric { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.metric:last-child { border-bottom: 0; }
.metric .m-l { color: var(--muted); }
.metric .m-v { font-family: var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.metric .m-v.green { color: var(--emerald-2); } .metric .m-v.amber { color: var(--amber); } .metric .m-v.red { color: var(--red-2); }

/* Activity feed */
.feed { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; max-height: 340px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.feed li:last-child { border-bottom: 0; }
.feed .f-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--emerald-bright); }
.feed .f-dot.amber { background: var(--amber); } .feed .f-dot.red { background: var(--red); } .feed .f-dot.sky { background: var(--sky); }
.feed .f-body { min-width: 0; }
.feed .f-act { color: var(--ink); font-weight: 600; }
.feed .f-meta { color: var(--muted); display: block; margin-top: 1px; }
.feed .f-time { color: var(--faint); font-family: var(--mono); font-size: 11px; white-space: nowrap; }

/* Integrity / status tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: var(--panel-2); }
.tile .t-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .t-l { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tile .t-v { font-family: var(--mono); font-size: 18px; color: var(--ink); margin-top: 6px; }
.tile .t-s { font-size: 11.5px; margin-top: 4px; color: var(--ink-dim); }
.badge-ok { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(47,157,104,0.14); color: var(--emerald-2); border: 1px solid rgba(47,157,104,0.4); text-transform: uppercase; letter-spacing: 0.04em; }
.badge-warn { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(224,168,62,0.16); color: var(--amber); border: 1px solid rgba(224,168,62,0.4); text-transform: uppercase; letter-spacing: 0.04em; }
.badge-crit { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(240,86,79,0.14); color: var(--red-2); border: 1px solid rgba(240,86,79,0.45); text-transform: uppercase; letter-spacing: 0.04em; }

/* ============================================================================ Live map */
.content:has(.map-wrap) { padding: 0; }
.map-wrap { display: grid; grid-template-columns: 1fr 320px; height: calc(100vh - 66px); }
.map-stage { position: relative; overflow: hidden; background: var(--map-bg); }
#map-canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.map-hud { position: absolute; top: 16px; left: 16px; background: var(--overlay-strong); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 12px 14px; backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); }
.hud-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 13px; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 8px currentColor; }
.conn-dot.online { background: var(--emerald-bright); color: var(--emerald-bright); }
.conn-dot.connecting { background: var(--amber); color: var(--amber); }
.conn-dot.offline { background: var(--red); color: var(--red); }
.map-legend { position: absolute; bottom: 16px; left: 16px; display: flex; gap: 16px; align-items: center; background: var(--overlay-strong);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 14px; backdrop-filter: blur(6px); font-size: 12px; }
.map-legend i.lg { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg.ok { background: var(--emerald-bright); } .lg.warn { background: var(--red); } .lg.site { background: var(--amber); }
.lg.nofly { background: transparent; border: 1px solid var(--red); }

.track-panel { border-left: 1px solid var(--line); background: var(--panel-3); display: flex; flex-direction: column; min-height: 0; backdrop-filter: blur(var(--glass-blur)); }
.track-head { display: flex; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.track-list { overflow-y: auto; flex: 1; padding: 10px; }
.track-empty { text-align: center; padding: 44px 12px; font-size: 13px; color: var(--muted); }
.track { padding: 11px 13px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; margin-bottom: 6px; transition: background var(--ease), border-color var(--ease); }
.track:hover { background: var(--panel-2); }
.track.on { background: var(--panel-2); border-color: var(--emerald); }
.track-top { display: flex; justify-content: space-between; align-items: center; }
.track-id { font-weight: 600; font-size: 13px; font-family: var(--mono); }
.track-mode { font-size: 11px; color: var(--amber); font-family: var(--mono); }
.track-bar { height: 5px; background: var(--sink); border-radius: 3px; margin: 8px 0 5px; overflow: hidden; }
.track-fill { display: block; height: 100%; background: var(--emerald-bright); }
.track-fill.low { background: var(--red); }
.track-fill.breach { background: var(--red); }
.track-meta { color: var(--muted); font-size: 12px; }
.track.breach { border-color: var(--red); }
.track-cmd, .cmd-bar { border-top: 1px solid var(--line); padding: 14px 16px; }
.brk { color: var(--red); }
.cmd-sel { margin-bottom: 8px; }
.cmd-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cbtn { background: var(--raise); border: 1px solid var(--line-2); color: var(--ink); border-radius: 9px; padding: 9px; font-size: 13px; font-family: var(--mono); cursor: pointer; transition: all var(--ease); }
.cbtn:hover:not(:disabled) { background: var(--emerald); border-color: var(--emerald-2); color: var(--ink-on-accent); }
.cbtn.goto:hover:not(:disabled) { background: var(--sky); border-color: var(--sky); color: #fff; }
.cbtn.danger:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #fff; }
.cbtn.ok:hover:not(:disabled) { background: var(--emerald); border-color: var(--emerald-2); color: var(--ink-on-accent); }
.cbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.goto-hint { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); background: rgba(74, 163, 224, 0.16);
  border: 1px solid var(--sky); color: var(--ink); padding: 9px 18px; border-radius: 10px; font-size: 13px; backdrop-filter: blur(4px); }
.goto-hint.hidden { display: none; }

.toasts { position: absolute; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 9px; align-items: flex-end; z-index: 20; }
.toast { max-width: 340px; padding: 11px 15px; border-radius: 11px; font-size: 13px; border: 1px solid var(--line-2);
  background: var(--overlay-stronger); color: var(--ink); opacity: 0; transform: translateY(8px); transition: 0.25s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.crit { border-color: var(--red); background: var(--toast-crit-bg); }
.toast.ok { border-color: var(--emerald); }
.toast.info { border-color: var(--sky); }

/* ============================================================================ Detections */
.det-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.det-tabs { display: flex; gap: 7px; }
.det-tab { padding: 8px 15px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--muted); font-size: 13px; transition: all var(--ease); }
.det-tab:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.det-tab.on { background: linear-gradient(130deg, var(--emerald), var(--emerald-dim)); color: var(--ink-on-accent); border-color: var(--emerald-2); }
.det-tab .cnt { font-family: var(--mono); font-size: 11px; opacity: 0.85; margin-left: 5px; }
.det-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.det-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform var(--ease), border-color var(--ease); }
.det-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.det-card.status-verified { border-color: var(--emerald); }
.det-card.status-dismissed { opacity: 0.55; }
.det-thumb { position: relative; height: 156px; background: var(--thumb-bg); display: grid; place-items: center; }
.det-thumb img { width: 100%; height: 100%; object-fit: cover; }
.det-noimg { color: var(--muted); font-size: 12px; }
.det-conf { position: absolute; top: 9px; right: 9px; font-family: var(--mono); font-size: 12px; padding: 2px 9px; border-radius: 7px; background: var(--overlay-strong); border: 1px solid var(--line); }
.det-conf.high { color: #fff; background: var(--red); border-color: var(--red); } .det-conf.mid { color: var(--amber); } .det-conf.low { color: var(--muted); }
.det-hi { position: absolute; top: 9px; left: 9px; font-family: var(--mono); font-size: 10px; background: var(--red); color: #fff; padding: 2px 7px; border-radius: 6px; box-shadow: var(--glow-red); }
.det-body { padding: 14px; }
.det-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.det-type { font-family: var(--mono); font-size: 11px; padding: 2px 9px; border-radius: 6px; background: var(--raise); border: 1px solid var(--line-2); }
.det-type.type-weapon { color: var(--red); border-color: rgba(240, 86, 79, 0.5); }
.det-type.type-face { color: var(--sky); border-color: rgba(74, 163, 224, 0.5); }
.det-status { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.det-label { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.det-meta { color: var(--muted); font-size: 12px; }
.det-ts { margin-top: 2px; }
.det-actions { display: flex; gap: 8px; margin-top: 14px; }
.det-actions .cbtn { flex: 1; }

/* ============================================================================ Incidents */
.inc-wrap { display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
.inc-list-col { display: flex; flex-direction: column; }
.inc-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 700; }
.inc-new { display: flex; flex-direction: column; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.inc-new.hidden { display: none; }
.inc-new select, .inc-new input, .inc-new textarea { background: var(--input-bg); border: 1px solid var(--line-2); color: var(--ink); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.inc-new .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.inc-list { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; }
.inc-row { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; transition: background var(--ease), border-color var(--ease); }
.inc-row:hover { background: var(--panel-2); text-decoration: none; }
.inc-row.on { border-color: var(--emerald-2); }
.inc-row-top { display: flex; justify-content: space-between; align-items: center; }
.inc-ref { font-size: 12px; color: var(--ink); font-family: var(--mono); }
.inc-row-mid { font-size: 14px; text-transform: capitalize; margin: 4px 0; }
.sev { font-family: var(--mono); font-size: 10px; text-transform: uppercase; padding: 1px 8px; border-radius: 6px; }
.sev.cr { background: var(--red); color: #fff; box-shadow: var(--glow-red); } .sev.hi { color: var(--red); border: 1px solid var(--red); }
.sev.md { color: var(--amber); border: 1px solid var(--line-2); } .sev.lo { color: var(--muted); border: 1px solid var(--line-2); }
.inc-status { font-family: var(--mono); font-size: 11px; padding: 1px 9px; border-radius: 6px; background: var(--raise); border: 1px solid var(--line-2); text-transform: capitalize; }
.inc-status.s-assigned, .inc-status.s-enroute { color: var(--amber); }
.inc-status.s-onscene { color: var(--sky); }
.inc-status.s-resolved, .inc-status.s-closed { color: var(--emerald-2); }
.inc-detail-head { display: flex; justify-content: space-between; align-items: flex-start; }
.inc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 9px 0 9px 22px; border-left: 2px solid var(--line-2); margin-left: 4px; }
.tl-dot { position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--emerald-bright); box-shadow: var(--glow-emerald); }
.tl-type { font-weight: 600; font-size: 13px; text-transform: capitalize; margin-right: 8px; }
.tl-ts { display: block; color: var(--muted); font-size: 12px; }
.sos-card { width: min(440px, 94vw); }
.sos-loc { margin: -4px 0 2px; }

/* ============================================================================ Video wall */
.vw-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.video-wall { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.vtile { position: relative; aspect-ratio: 16/9; background: var(--video-bg); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.vtile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.vtile-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: #8fae9f; }
.vtile.is-live .vtile-off { display: none; }
.vtile-hud { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(var(--video-scrim), transparent); padding: 5px 9px; border-radius: 8px; font-size: 13px; color: #eef5f1; }
.vt-dot { width: 8px; height: 8px; border-radius: 50%; background: #8fae9f; }
.vt-dot.on { background: var(--emerald-bright); box-shadow: var(--glow-emerald); }
.vtile-ctl { position: absolute; bottom: 10px; right: 10px; display: flex; gap: 6px; opacity: 0; transition: 0.2s; }
.vtile:hover .vtile-ctl { opacity: 1; }
.vtile-ctl .cbtn { padding: 6px 10px; }
.vt-flash { position: absolute; bottom: 10px; left: 10px; background: var(--overlay-stronger); border: 1px solid var(--emerald); color: var(--ink);
  padding: 6px 11px; border-radius: 8px; font-size: 12px; opacity: 0; transition: 0.2s; }
.vt-flash.show { opacity: 1; }

/* ============================================================================ Federation / coverage */
.state-grid { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.state-chip { font-size: 12px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); transition: all var(--ease); }
.state-chip.on { border-color: var(--emerald-2); color: var(--emerald-2); background: rgba(47, 157, 104, 0.12); }

/* ============================================================================ Auth fallback (real auth uses auth.css) */
.auth-body { display: grid; place-items: center; min-height: 100vh; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--muted); }
.auth-form input { background: var(--input-bg); border: 1px solid var(--line-2); color: var(--ink); border-radius: 9px; padding: 12px 13px; font-size: 15px; font-family: inherit; transition: border-color var(--ease), box-shadow var(--ease); }
.auth-form input:focus { outline: none; border-color: var(--emerald-2); box-shadow: 0 0 0 3px rgba(47, 157, 104, 0.16); }
.auth-form input.otp { letter-spacing: 8px; text-align: center; font-family: var(--mono); font-size: 22px; }
.alert.error { background: rgba(240, 86, 79, 0.12); border: 1px solid var(--red); color: var(--red-ink); padding: 10px 13px; border-radius: 9px; font-size: 13px; }
.linkbtn { background: none; border: none; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: 13px; }
.inline { display: inline; }
.inline-center { display: block; text-align: center; margin-top: 12px; }

/* ============================================================================ Responsive */
@media (max-width: 1200px) {
  .grid-cards.six { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  body.console { grid-template-columns: 72px 1fr; }
  .brand-txt, .brand-sub, .scope-copy, .nav-group-title, .posture-rail, .nav-label { display: none; }
  .sidebar { padding: 18px 8px; align-items: center; }
  .scope-pill { justify-content: center; padding: 8px; }
  .nav-item { justify-content: center; padding: 11px 8px; }
  .nav-item.on::before { top: 6px; bottom: 6px; }
  .sidebar-logout button { font-size: 0; height: 40px; }
  .grid-cards, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-panel { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-cards.six { grid-template-columns: repeat(2, 1fr); }
  .map-wrap { grid-template-columns: 1fr; height: auto; }
  .map-stage { height: 56vh; } .track-panel { border-left: none; border-top: 1px solid var(--line); }
  .inc-wrap { grid-template-columns: 1fr; }
  .video-wall { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body.console { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; overflow-x: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .grid-cards, .grid-cards.six { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .bar-row { grid-template-columns: 92px 1fr auto; }
}
