/* ORCA CTI — "Deep Signal" Theme (Light)
   A clean intelligence-desk look — white surfaces, soft slate borders, one
   blue signal accent standing in for the abyss glow the dark variant used.
   Every other hue on screen still carries a fixed, standardized meaning
   (TLP 2.0 classification, CVSS/Kent severity) rather than decoration. */
/* IBM Plex Sans/Mono, self-hosted (scripts/vendor-fonts.py) — no request to
   Google Fonts leaves the visitor's browser, and it satisfies CSP font-src 'self'. */
@import url('../vendor/fonts/ibm-plex.css');

:root {
  color-scheme: light;
  --bg-main: #f3f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: #e4e9f0;
  --signal: #2563eb;
  --signal-dim: #bfdbfe;
}

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: #1e293b;
  overflow-x: hidden;
  color-scheme: light;
}

code, pre, .font-mono {
  font-family: 'IBM Plex Mono', monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Card surfaces: hairline border by default, no default glow. Depth comes
   from a soft shadow and a slightly darker border on hover, not glow. */
.cyber-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cyber-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.cyber-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* TLP 2.0 Badge Colors — standardized, never decorative */
.tlp-red { background: #fee2e2; color: #b91c1c; border: 1px solid #ef4444; }
.tlp-amber-strict { background: #fef3c7; color: #92400e; border: 1px solid #d97706; }
.tlp-amber { background: #fef3c7; color: #b45309; border: 1px solid #f59e0b; }
.tlp-green { background: #dcfce7; color: #15803d; border: 1px solid #10b981; }
.tlp-clear { background: #f1f5f9; color: #475569; border: 1px solid #94a3b8; }

/* Pyramid of Pain Levels — same hexes reused by the dashboard chart for consistency */
.pyramid-ttp { background: #fee2e2; color: #b91c1c; border: 1px solid #ef4444; }
.pyramid-tool { background: #ffedd5; color: #c2410c; border: 1px solid #f97316; }
.pyramid-artifact { background: #fef9c3; color: #a16207; border: 1px solid #eab308; }
.pyramid-domain { background: #dcfce7; color: #15803d; border: 1px solid #10b981; }
.pyramid-ip { background: #ccfbf1; color: #0f766e; border: 1px solid #14b8a6; }
.pyramid-hash { background: #f3e8ff; color: #7e22ce; border: 1px solid #a855f7; }

/* Collapsible sidebar sections — click header to toggle; state in localStorage.
   Preserves the original label typography (uppercase micro-caps) and adds a
   chevron on the right that rotates 90° when collapsed. */
.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--sidebar-label, #7c88a0);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.sidebar-section-toggle:hover { color: var(--sidebar-hover-text, #0f172a); background: var(--sidebar-hover-bg, transparent); }
.sidebar-chevron {
  font-size: 9px;
  transition: transform 0.18s ease;
  opacity: 0.7;
}
.sidebar-section.is-collapsed .sidebar-chevron { transform: rotate(-90deg); }
.sidebar-section.is-collapsed > nav { display: none; }

/* The inner scroll container: hide the native scrollbar visually but keep it
   functional (mouse-wheel + touch still work). */
.sidebar-scroll { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.35) transparent; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.35); border-radius: 3px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }

/* Sidebar Navigation — a dossier-tab metaphor: icons stay neutral until the
   section is open, then the tab and its icon pick up the one signal color. */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #55606e;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
  user-select: none;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.nav-item.active {
  background: #eff6ff;
  color: var(--signal);
  border-left: 3px solid var(--signal);
  font-weight: 600;
}
.nav-item.active i {
  color: var(--signal) !important;
}

/* Vis.js Graph Canvas Container */
#network-canvas {
  width: 100%;
  height: 680px;
  background: radial-gradient(circle at center, #ffffff 0%, #eef1f6 100%);
  border-radius: 10px;
  outline: none;
}

/* MITRE ATT&CK Matrix styling */
.mitre-tactic-col {
  min-width: 170px;
  max-width: 190px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  flex-shrink: 0;
}
.mitre-tech-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.mitre-tech-card:hover {
  border-color: var(--signal);
  background: #eff6ff;
  transform: translateY(-1px);
}
.mitre-tech-card.highlighted {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.08);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.25);
}

/* Diamond Model Visual Container */
.diamond-wrapper {
  position: relative;
  width: 440px;
  height: 440px;
  margin: 0 auto;
}
.diamond-node {
  position: absolute;
  width: 130px;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.12);
}
.diamond-node:hover {
  transform: scale(1.08);
}
.diamond-top { top: 10px; left: 155px; background: #fee2e2; border: 1px solid #ef4444; color: #b91c1c; }
.diamond-left { top: 165px; left: 10px; background: #fef3c7; border: 1px solid #f59e0b; color: #b45309; }
.diamond-right { top: 165px; right: 10px; background: #eff6ff; border: 1px solid var(--signal); color: var(--signal); }
.diamond-bottom { bottom: 10px; left: 155px; background: #f3e8ff; border: 1px solid #a855f7; color: #7e22ce; }

/* Sonar ping — the app's one live-signal motif, echoing ORCA's echolocation.
   Used wherever something is genuinely real-time, never as ambient decoration. */
.sonar-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal);
  flex-shrink: 0;
}
.sonar-dot::before,
.sonar-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--signal);
  animation: sonar-ping 2.4s cubic-bezier(0.2, 0.7, 0.4, 1) infinite;
}
.sonar-dot::after {
  animation-delay: 1.2s;
}
@keyframes sonar-ping {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(4.5); opacity: 0; }
}

/* Legacy alias kept for any residual usage */
.pulse-live { animation: pulse-glow 2s infinite ease-in-out; }
@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.95); }
}

/* Live external source badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #eff6ff;
  color: var(--signal);
  border: 1px solid #93c5fd;
}
.live-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  animation: pulse-glow 1.4s infinite ease-in-out;
}
.source-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  font-size: 11px;
}
.source-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Skeleton loading shimmer */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #eef1f6;
  border-radius: 6px;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: skeleton-shimmer 1.4s infinite;
}
@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 320px;
  max-width: calc(100vw - 40px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px -6px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  color: #1e293b;
  animation: toast-in 0.25s ease-out;
}
.toast.toast-success { border-color: rgba(16, 185, 129, 0.5); }
.toast.toast-error { border-color: rgba(239, 68, 68, 0.5); }
.toast.toast-info { border-color: rgba(10, 166, 135, 0.5); }
.toast .toast-icon { margin-top: 1px; }
.toast.toast-success .toast-icon { color: #15803d; }
.toast.toast-error .toast-icon { color: #b91c1c; }
.toast.toast-info .toast-icon { color: var(--signal); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.toast-out {
  animation: toast-out 0.2s ease-in forwards;
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

/* Dashboard hero stat — the single "opening moment": the live signal count,
   the most characteristic first thing an analyst wants to see. */
.hero-stat {
  background: linear-gradient(155deg, #eff6ff 0%, var(--bg-card) 60%);
  border: 1px solid var(--signal-dim);
}
.hero-stat .hero-value {
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* World heat map (jsvectormap) — tuned to sit on a white card */
.jvm-world-map-container {
  background: transparent !important;
}
.jvm-tooltip {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  font-family: 'IBM Plex Sans', sans-serif !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
}
.jvm-zoom-btn {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.jvm-zoom-btn:hover {
  background: #f1f5f9 !important;
}
/* Regions with no value in the active series compute to fill="undefined"
   (jsVectorMap has no public API to pre-seed every region code at 0) —
   override that literal attribute to a neutral "no data" tint. */
/* jsvectormap.min.css loads after Tailwind and sets .jvm-container
   {height:100%}, overriding h-[380px]: the map then filled the whole card
   and pushed the legend row outside it. The id selector wins. */
#world-heat-map { height: 380px; }

#world-heat-map svg path[fill="undefined"] {
  fill: #e2e8f0;
}

/* Sector treemap legend chip */
.sector-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #475569;
}
.sector-legend-chip .swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Auto-scroll for long data tables (>20 rows) — see initTableScroll() in
   app.js. The wrapper caps height and scrolls vertically; the header stays
   pinned so column meaning is never lost while scrolling a long section. */
.table-scroll.is-scroll {
  max-height: 62vh;
  overflow-y: auto;
}
.table-scroll.is-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #ffffff;
}

/* Non-table info boxes opted in with [data-scroll-rows] (see sweepTableScroll)
   — scroll vertically once they exceed the row threshold so a box never
   pushes the page out of view. */
.rows-scroll {
  max-height: 62vh;
  overflow-y: auto;
}

/* ============================================================================
   THEME SYSTEM — light (default) + switchable dark, "Intelligence Console"
   The app's markup uses a fixed set of repurposed slate tokens for structure;
   dark mode re-points those tokens (and the semantic families) under
   [data-theme="dark"]. Light mode keeps a soft light-gray command rail.
   ============================================================================ */

:root {
  /* structural (used by styles.css components) */
  --bg-main: #f3f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: #e6eaf1;
  --text-primary: #1e293b;
  --table-hover: #f6f8fc;
  --card-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.03);
  --card-shadow-hover: 0 4px 16px -4px rgba(16,24,40,0.10);
  /* command rail — soft light gray in light mode (low contrast) */
  --sidebar-bg: #eef1f6;
  --sidebar-border: #e2e8f0;
  --sidebar-label: #7c88a0;
  --sidebar-item: #4a5568;
  --sidebar-icon: #94a3b8;
  --sidebar-hover-bg: #e3e8f0;
  --sidebar-hover-text: #0f172a;
  --sidebar-active-bg: rgba(37,99,235,0.10);
  --sidebar-active-text: #1d4ed8;
  --sidebar-active-icon: #2563eb;
  --sidebar-active-border: #2563eb;
  --sidebar-user: #0f172a;
  --topbar-bg: rgba(255,255,255,0.90);
  --topbar-border: var(--border-color);
}

html[data-theme="dark"] {
  --bg-main: #0a0f1c;
  --bg-card: #121a2b;
  --bg-card-hover: #16203a;
  --border-color: #223049;
  --text-primary: #e6ebf3;
  --table-hover: #16203a;
  --card-shadow: 0 1px 2px rgba(0,0,0,0.30);
  --card-shadow-hover: 0 6px 20px -6px rgba(0,0,0,0.50);
  --sidebar-bg: #0b1220;
  --sidebar-border: #1c2740;
  --sidebar-label: #5b6b86;
  --sidebar-item: #9aa7bd;
  --sidebar-icon: #6b7a94;
  --sidebar-hover-bg: rgba(255,255,255,0.055);
  --sidebar-hover-text: #f1f5f9;
  --sidebar-active-bg: linear-gradient(90deg, rgba(37,99,235,0.22), rgba(37,99,235,0.06));
  --sidebar-active-text: #ffffff;
  --sidebar-active-icon: #60a5fa;
  --sidebar-active-border: #3b82f6;
  --sidebar-user: #e6ebf3;
  --topbar-bg: rgba(13,19,32,0.85);
  --topbar-border: #1c2740;
}

/* ---- Typography polish ---- */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.006em;
  background: var(--bg-main);
  color: var(--text-primary);
}
h1 { letter-spacing: -0.02em; }
h2, h3 { letter-spacing: -0.01em; }

/* ---- Command-rail sidebar (theme-aware) ---- */
#app-sidebar { background: var(--sidebar-bg) !important; border-right: 1px solid var(--sidebar-border) !important; }
#app-sidebar .uppercase { color: var(--sidebar-label) !important; letter-spacing: 0.12em; font-size: 9.5px; }
#app-sidebar .nav-item { color: var(--sidebar-item); border-radius: 8px; margin: 1px 0; border-left: 3px solid transparent; }
#app-sidebar .nav-item i { color: var(--sidebar-icon) !important; transition: color .15s ease; }
#app-sidebar .nav-item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-hover-text); }
#app-sidebar .nav-item:hover i { color: var(--sidebar-hover-text) !important; }
#app-sidebar .nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); border-left: 3px solid var(--sidebar-active-border); }
#app-sidebar .nav-item.active i { color: var(--sidebar-active-icon) !important; }
#app-sidebar .border-t { border-color: var(--sidebar-border) !important; }
#app-sidebar #sidebar-user-name { color: var(--sidebar-user) !important; }
#app-sidebar #sidebar-user-role, #app-sidebar .text-slate-400 { color: var(--sidebar-label) !important; }
#app-sidebar .w-6.h-6.rounded-full { background: rgba(37,99,235,0.14) !important; color: #2563eb !important; }

/* ---- Topbar ---- */
header.h-16 { background: var(--topbar-bg); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--topbar-border); }

/* ---- Cards ---- */
.cyber-card { border-radius: 12px; box-shadow: var(--card-shadow); }
.cyber-card:hover { box-shadow: var(--card-shadow-hover); }
.cyber-card .text-2xl.font-black, .cyber-card .text-3xl.font-black { letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---- Interactions ---- */
button { transition: background-color .15s ease, box-shadow .15s ease, transform .05s ease; }
button:active { transform: translateY(0.5px); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid rgba(59,130,246,0.6); outline-offset: 2px; border-radius: 6px;
}
input:not([type=checkbox]):not([type=radio]), select, textarea { transition: border-color .15s ease, box-shadow .15s ease; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(59,130,246,0.16); }
table thead th { font-weight: 600; letter-spacing: 0.01em; }
table tbody tr { transition: background-color .12s ease; }
table tbody tr:hover { background: var(--table-hover); }
#classification-edge { height: 2px !important; }

/* ---- Theme toggle button ---- */
#theme-toggle { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }

/* ============================================================================
   DARK MODE — re-point the structural slate tokens + semantic families.
   ============================================================================ */
html[data-theme="dark"] {
  /* Surfaces */
  --_s950:#0b1120; --_s900:#121a2b; --_s800:#1e293b; --_s700:#334155;
}
html[data-theme="dark"] .bg-slate-950,
html[data-theme="dark"] .bg-slate-950\/80,
html[data-theme="dark"] .bg-slate-950\/60,
html[data-theme="dark"] .bg-slate-950\/50 { background-color: #0b1120 !important; }
html[data-theme="dark"] .bg-slate-900,
html[data-theme="dark"] .bg-slate-900\/95,
html[data-theme="dark"] .bg-slate-900\/90,
html[data-theme="dark"] .bg-slate-900\/80,
html[data-theme="dark"] .bg-slate-900\/70,
html[data-theme="dark"] .bg-slate-900\/60,
html[data-theme="dark"] .bg-slate-900\/40 { background-color: #121a2b !important; }
html[data-theme="dark"] .bg-slate-800,
html[data-theme="dark"] .bg-slate-800\/60,
html[data-theme="dark"] .bg-slate-800\/40,
html[data-theme="dark"] .bg-slate-800\/30 { background-color: #1e293b !important; }
html[data-theme="dark"] .bg-slate-700 { background-color: #334155 !important; }
html[data-theme="dark"] .bg-white { background-color: #121a2b !important; }
/* …except behind the MFA QR code: scanners need dark modules on white. */
#mfa-qr-container, #mfa-qr-container img { background-color: #fff !important; }

/* Text */
html[data-theme="dark"] .text-slate-200 { color: #e6ebf3 !important; }
html[data-theme="dark"] .text-slate-300 { color: #cbd5e1 !important; }
html[data-theme="dark"] .text-slate-400 { color: #9aa7bd !important; }
html[data-theme="dark"] .text-slate-500 { color: #7c8aa3 !important; }
html[data-theme="dark"] .text-slate-600 { color: #64748b !important; }
html[data-theme="dark"] .text-slate-700 { color: #94a3b8 !important; }
html[data-theme="dark"] .text-slate-950 { color: #f1f5f9 !important; }

/* Borders */
html[data-theme="dark"] .border-slate-700, html[data-theme="dark"] .border-slate-700\/80, html[data-theme="dark"] .border-slate-700\/70 { border-color: #223049 !important; }
html[data-theme="dark"] .border-slate-800, html[data-theme="dark"] .border-slate-800\/80, html[data-theme="dark"] .border-slate-800\/60 { border-color: #172033 !important; }
html[data-theme="dark"] .border-slate-600 { border-color: #334155 !important; }

/* Component surfaces that use CSS vars already flip automatically (cards,
   inputs via bg-slate-950, skeleton, etc.). A few extras: */
html[data-theme="dark"] .skeleton { background: #16203a; }
html[data-theme="dark"] .toast { background: #121a2b; border-color: #223049; color: #e6ebf3; }
html[data-theme="dark"] .hero-stat { background: linear-gradient(155deg, #16233f 0%, var(--bg-card) 60%); border-color: rgba(59,130,246,0.35); }
html[data-theme="dark"] .source-pill { background: #0f1830; border-color: #223049; }
html[data-theme="dark"] #network-canvas { background: radial-gradient(circle at center, #121a2b 0%, #0a0f1c 100%); }
html[data-theme="dark"] .mitre-tech-card { background: #0f1830; border-color: #223049; }
html[data-theme="dark"] .mitre-tech-card:hover { background: #16233f; border-color: #3b82f6; }
html[data-theme="dark"] .mitre-tactic-col { background: var(--bg-card); border-color: var(--border-color); }
html[data-theme="dark"] .jvm-tooltip { background: #121a2b !important; border-color: #223049 !important; color: #e6ebf3 !important; }
html[data-theme="dark"] #world-heat-map svg path[fill="undefined"],
html[data-theme="dark"] #world-heat-map svg path[fill="#e2e8f0"] { fill: #1e293b; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0b1120; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2a3752; }

/* Semantic families in dark: dark translucent fills + lighter text so both
   badges (fill+text) and standalone colored text stay legible. */
html[data-theme="dark"] .text-signal-400, html[data-theme="dark"] .text-signal-300,
html[data-theme="dark"] .text-blue-400, html[data-theme="dark"] .text-blue-300 { color: #60a5fa !important; }
html[data-theme="dark"] .text-sky-400, html[data-theme="dark"] .text-sky-300 { color: #38bdf8 !important; }
html[data-theme="dark"] .text-red-400, html[data-theme="dark"] .text-red-300 { color: #f87171 !important; }
html[data-theme="dark"] .text-rose-400, html[data-theme="dark"] .text-rose-300 { color: #fb7185 !important; }
html[data-theme="dark"] .text-amber-400, html[data-theme="dark"] .text-amber-300,
html[data-theme="dark"] .text-yellow-400, html[data-theme="dark"] .text-yellow-300 { color: #fbbf24 !important; }
html[data-theme="dark"] .text-emerald-400, html[data-theme="dark"] .text-emerald-300,
html[data-theme="dark"] .text-teal-400, html[data-theme="dark"] .text-teal-300 { color: #34d399 !important; }
html[data-theme="dark"] .text-indigo-400, html[data-theme="dark"] .text-indigo-300 { color: #818cf8 !important; }
html[data-theme="dark"] .text-purple-400, html[data-theme="dark"] .text-purple-300 { color: #c084fc !important; }

html[data-theme="dark"] .bg-signal-950, html[data-theme="dark"] .bg-blue-950 { background-color: rgba(59,130,246,0.16) !important; }
html[data-theme="dark"] .bg-sky-950 { background-color: rgba(56,189,248,0.16) !important; }
html[data-theme="dark"] .bg-red-950 { background-color: rgba(239,68,68,0.16) !important; }
html[data-theme="dark"] .bg-rose-950 { background-color: rgba(244,63,94,0.16) !important; }
html[data-theme="dark"] .bg-amber-950, html[data-theme="dark"] .bg-yellow-950 { background-color: rgba(245,158,11,0.15) !important; }
html[data-theme="dark"] .bg-emerald-950, html[data-theme="dark"] .bg-teal-950 { background-color: rgba(16,185,129,0.15) !important; }
html[data-theme="dark"] .bg-indigo-950 { background-color: rgba(99,102,241,0.16) !important; }
html[data-theme="dark"] .bg-purple-950 { background-color: rgba(168,85,247,0.16) !important; }

html[data-theme="dark"] .border-signal-800, html[data-theme="dark"] .border-blue-800 { border-color: rgba(59,130,246,0.35) !important; }
html[data-theme="dark"] .border-red-800 { border-color: rgba(239,68,68,0.35) !important; }
html[data-theme="dark"] .border-amber-800, html[data-theme="dark"] .border-yellow-800 { border-color: rgba(245,158,11,0.35) !important; }
html[data-theme="dark"] .border-emerald-800, html[data-theme="dark"] .border-teal-800 { border-color: rgba(16,185,129,0.35) !important; }
html[data-theme="dark"] .border-indigo-800 { border-color: rgba(99,102,241,0.35) !important; }
html[data-theme="dark"] .border-purple-800 { border-color: rgba(168,85,247,0.35) !important; }
html[data-theme="dark"] .border-sky-800 { border-color: rgba(56,189,248,0.35) !important; }

/* ---- Panorama dashboards (dataviz tokens; validated vs card surfaces) ---- */
:root { --viz-1: #2a78d6; --viz-track: #eef2f7; --viz-grid: #e5e7eb; --viz-muted: #6b7280; --viz-label: #475569; }
html[data-theme="dark"] { --viz-1: #3987e5; --viz-track: #1c2740; --viz-grid: #223049; --viz-muted: #8b95a8; --viz-label: #b6c0d2; }
.panorama-bar-row { display: grid; grid-template-columns: minmax(0, 11rem) 1fr 4.5rem; align-items: center; gap: 0.6rem; font-size: 11px; }
.panorama-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--viz-label); }
.panorama-bar-track { height: 10px; background: var(--viz-track); border-radius: 4px; overflow: hidden; }
.panorama-bar-fill { display: block; height: 100%; background: var(--viz-1); border-radius: 0 4px 4px 0; }
.panorama-bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-primary, #0f172a); font-weight: 600; }
.panorama-bar-row:hover .panorama-bar-fill { filter: brightness(1.12); }
@media (max-width: 480px) { .panorama-bar-row { grid-template-columns: minmax(0, 7rem) 1fr 3.8rem; } }
