/* ── Fathom — Shared Styles ── */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/static/fonts/inter-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/static/fonts/fira-code-latin.woff2) format('woff2');
}

/* ── Design Tokens ─────────────────────────────────────────────────
 *
 * All spacing, typography, radius, shadow, and transition values
 * should reference tokens from :root. Avoid hardcoding values.
 *
 * Spacing:     var(--space-{1..12})     4px base scale
 * Typography:  var(--text-{xs..3xl})    rem-based type scale
 * Radius:      var(--radius-{sm..full}) component corner scale
 * Shadows:     var(--shadow-{sm..lg})   elevation system
 * Transitions: var(--duration-{fast,base,slow}) + var(--ease-out)
 *
 * Colors are already tokenized (--bg, --text, --accent, --sev-*, etc.)
 * See dashboard-grid.css for the reference implementation.
 */
:root {
  --bg: #0f1923;
  --bg-deep: #0b1420;
  --bg-surface: #111b2b;
  --panel: #162233;
  --panel-alt: #111b2b;
  --border: #243447;
  --border-dim: #141e32;
  --text: #d4dce6;
  --text-dim: #7a8a9e;
  --text-muted: #384560;
  --accent: #5b8af0;
  --accent-hover: #4a75d4;
  --accent-dim: rgba(91,138,240,0.08);
  --accent-cyan: #32b8c6;
  --accent-green: #3aad6b;
  --accent-rose: #c75070;
  --accent-amber: #e5a035;
  --accent-red: #ee5555;
  --accent-rgb: 91,138,240;
  --accent-cyan-rgb: 50,184,198;
  --accent-green-rgb: 58,173,107;
  --accent-amber-rgb: 229,160,53;
  --accent-red-rgb: 238,85,85;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-success: #22c55e;
  --sev-critical: #ef4444;
  --sev-high: #f59e0b;
  --sev-medium: #c9a84c;
  --sev-low: #22c55e;
  --sev-info: #7a8a9e;
  --font-mono: 'Fira Code','Cascadia Code','Consolas','Courier New', monospace;
  --font-ui: 'Inter','Segoe UI', system-ui, -apple-system, sans-serif;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 56px;
  --topbar-height: 44px;

  /* ── Spacing scale (4px base) ──────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Typography scale ──────────────────────────────── */
  --text-xs: 0.68rem;    /* 9.5px — micro labels */
  --text-sm: 0.78rem;    /* 10.9px — secondary text, table cells */
  --text-base: 0.88rem;  /* 12.3px — body text */
  --text-md: 1rem;       /* 14px — default */
  --text-lg: 1.15rem;    /* 16.1px — section titles */
  --text-xl: 1.4rem;     /* 19.6px — page titles */
  --text-2xl: 1.8rem;    /* 25.2px — hero numbers */
  --text-3xl: 2.4rem;    /* 33.6px — dashboard stats */

  /* ── Border radius scale ───────────────────────────── */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* ── Shadows ───────────────────────────────────────── */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 12px rgba(91,138,240,0.12);

  /* ── Transitions ───────────────────────────────────── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 120ms;
  --duration-base: 180ms;
  --duration-slow: 300ms;

  /* ── Z-index layers ────────────────────────────────── */
  --z-dropdown: 100;
  --z-modal: 200;
  --z-toast: 300;
  --z-tooltip: 400;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Alpine cloak ── */
[x-cloak] { display: none !important; }

/* ── HTMX indicator ── */
.htmx-indicator { opacity: 0; transition: opacity 0.2s ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ══════════════════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════════════════ */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
.sidebar {
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-deep);
  border-right: 1px solid var(--border-dim);
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  flex-shrink: 0;
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}
/* Pre-Alpine collapsed state (prevents flash) */
html.sidebar-collapsed-init .sidebar {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}
html.sidebar-collapsed-init .sidebar .sidebar-label,
html.sidebar-collapsed-init .sidebar .brand-text,
html.sidebar-collapsed-init .sidebar .sidebar-chevron,
html.sidebar-collapsed-init .sidebar .sidebar-version,
html.sidebar-collapsed-init .sidebar .sidebar-footer-link {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

/* ── Brand ── */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 14px;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}
.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  overflow: hidden;
  min-width: 0;
}
.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 5px;
  background: var(--bg-deep);
  border: 1.5px solid rgba(212,220,230,0.22);
  font-size: 0.62em;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5), 0 0 20px rgba(0,0,0,0.25);
  text-shadow: 0 0 8px rgba(0,0,0,0.7);
  position: relative;
  flex-shrink: 0;
}
.brand-icon::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, transparent 40%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}
.brand-text {
  font-size: 0.92em;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.15s;
}
.sidebar.collapsed .brand-text {
  opacity: 0;
  width: 0;
  pointer-events: none;
}
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.sidebar-toggle svg {
  width: 14px;
  height: 14px;
}
.sidebar-toggle:hover {
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
}
.sidebar.collapsed .sidebar-toggle {
  margin: 0 auto;
}

/* ── Nav icons (shared) ── */
.nav-i {
  width: 15px;
  height: 15px;
  min-width: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
  transition: opacity 0.15s;
}

/* ── Primary nav list ── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

/* ── Nav links ── */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 14px;
  height: 36px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.84em;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  margin: 1px 8px 1px 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  overflow: hidden;
}
.sidebar-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.035);
}
.sidebar-link:hover .nav-i { opacity: 0.75; }
.sidebar-link.active {
  color: var(--text);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}
.sidebar-link.active .nav-i { opacity: 1; }

.sidebar-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.65em;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Secondary links (slightly dimmer default state) */
.sidebar-link-secondary {
  color: var(--text-muted);
  font-size: 0.82em;
}
.sidebar-link-secondary:hover { color: var(--text-dim); }
.sidebar-link-secondary.active { color: var(--text); }

/* ── Labels (collapse hide) ── */
.sidebar-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.12s;
}
.sidebar.collapsed .sidebar-label {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

/* ── Section separator ── */
.sidebar-sep {
  height: 1px;
  background: var(--border-dim);
  margin: 6px 14px;
}

/* ── Security group (expandable) ── */
.sidebar-group {
  margin: 1px 0;
}
.sidebar-group-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 14px;
  height: 36px;
  width: calc(100% - 8px);
  color: var(--text-dim);
  background: none;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  margin: 0 8px 0 0;
  font-size: 0.84em;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  overflow: hidden;
}
.sidebar-group-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.035);
}
.sidebar-group-btn:hover .nav-i { opacity: 0.75; }
.sidebar-group-btn.active {
  color: var(--text);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}
.sidebar-group-btn.active .nav-i { opacity: 1; }

/* Push chevron to the right */
.sidebar-chevron {
  width: 12px;
  height: 12px;
  min-width: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.35;
  margin-left: auto;
  transition: transform 0.2s, opacity 0.15s;
  flex-shrink: 0;
}
.sidebar-chevron.open { transform: rotate(180deg); }
.sidebar-group-btn:hover .sidebar-chevron { opacity: 0.6; }
.sidebar.collapsed .sidebar-chevron { display: none; }

/* Sub-items */
.sidebar-sub {
  overflow: hidden;
}
.sidebar-sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 30px;
  height: 32px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.81em;
  font-weight: 500;
  white-space: nowrap;
  border-left: 2px solid transparent;
  border-radius: 0 5px 5px 0;
  margin: 1px 8px 1px 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  overflow: hidden;
}
.sidebar-sublink:hover {
  color: var(--text-dim);
  background: rgba(255,255,255,0.025);
}
.sidebar-sublink:hover .nav-i { opacity: 0.65; }
.sidebar-sublink.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}
.sidebar-sublink.active .nav-i { opacity: 1; }

/* Collapsed sidebar: show sub-items as regular links (tooltips via title attr) */
.sidebar.collapsed .sidebar-sublink {
  padding: 0 0 0 14px;
  height: 36px;
  justify-content: center;
}
.sidebar.collapsed .sidebar-group-btn {
  justify-content: center;
  padding: 0;
  width: var(--sidebar-collapsed-width);
  margin: 0;
}

/* Sub-group separator */
.sidebar-sub-sep {
  height: 1px;
  background: var(--border-dim);
  margin: 4px 14px;
}

/* ── Admin section ── */
.sidebar-admin {
  flex-shrink: 0;
  padding-bottom: 2px;
}
.sidebar-admin-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 14px;
  height: 34px;
  width: calc(100% - 8px);
  color: var(--text-muted);
  background: none;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  margin: 0 8px 0 0;
  font-size: 0.8em;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  overflow: hidden;
}
.sidebar-admin-btn:hover {
  color: var(--text-dim);
  background: rgba(255,255,255,0.025);
}
.sidebar-admin-btn:hover .nav-i { opacity: 0.65; }
.sidebar-admin-btn.active {
  color: var(--text);
  border-left-color: var(--accent);
  background: var(--accent-dim);
}
.sidebar.collapsed .sidebar-admin-btn {
  justify-content: center;
  padding: 0;
  width: var(--sidebar-collapsed-width);
  margin: 0;
}
.sidebar-sub-admin .sidebar-sublink {
  padding-left: 26px;
}

/* ── Footer ── */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border-dim);
  flex-shrink: 0;
  gap: 8px;
  overflow: hidden;
}
.sidebar-footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75em;
  font-weight: 500;
  opacity: 0.7;
  transition: color 0.15s, opacity 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-footer-link:hover { color: var(--text-dim); opacity: 1; }
.sidebar-version {
  font-size: 0.68em;
  font-weight: 400;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 1;
  transition: opacity 0.12s;
}
.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 10px 0;
}
.sidebar.collapsed .sidebar-footer-link,
.sidebar.collapsed .sidebar-version {
  display: none;
}

/* ── Mobile overlay ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 40;
  backdrop-filter: blur(2px);
}

/* ══════════════════════════════════════════════════════
   MAIN AREA
══════════════════════════════════════════════════════ */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 0 12px;
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-dim);
  z-index: 10;
  flex-shrink: 0;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Mobile hamburger — hidden on desktop */
.topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.topbar-hamburger svg { width: 16px; height: 16px; }
.topbar-hamburger:hover { color: var(--text); background: rgba(255,255,255,0.04); }

/* ── Hierarchy breadcrumb ── */
.hierarchy-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8em;
  font-weight: 500;
}
.hier-segment {
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  cursor: default;
  white-space: nowrap;
}
.hier-segment.hier-active {
  color: var(--accent);
  background: var(--accent-dim);
}
.hier-sep {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  opacity: 0.35;
}
.hier-sep svg { width: 12px; height: 12px; }

/* ── New Scan button ── */
.topbar-new-scan {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(91,138,240,0.12);
  border: 1px solid rgba(91,138,240,0.35);
  border-radius: 5px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.topbar-new-scan svg { width: 13px; height: 13px; stroke-width: 2; }
.topbar-new-scan:hover {
  background: rgba(91,138,240,0.2);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(91,138,240,0.15);
}

/* ── User group ── */
.topbar-user-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.topbar-icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.topbar-icon-btn.active { color: var(--accent); }
.topbar-icon-btn .nav-i { width: 14px; height: 14px; opacity: 0.55; }
.topbar-icon-btn:hover .nav-i { opacity: 0.85; }
.topbar-icon-btn.active .nav-i { opacity: 1; color: var(--accent); }

.topbar-user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-dim);
  border-radius: 5px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8em;
  font-family: var(--font-mono);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s, border-color 0.15s;
}
.topbar-user-chip:hover { color: var(--text); border-color: var(--border); }
.topbar-user-chip.active { color: var(--accent); border-color: rgba(91,138,240,0.3); }
.topbar-user-chip .nav-i { opacity: 0.4; width: 13px; height: 13px; }
.topbar-user-chip:hover .nav-i { opacity: 0.7; }

.topbar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.topbar-logout:hover { color: var(--color-danger); background: rgba(239,68,68,0.06); }
.topbar-logout .nav-i { width: 14px; height: 14px; opacity: 0.5; }
.topbar-logout:hover .nav-i { opacity: 1; }

/* ── Dev/Demo badges (topbar) ── */
.dev-badge {
  padding: 2px 7px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 3px;
  color: #c9a84c;
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.demo-badge {
  padding: 2px 7px;
  background: rgba(91,138,240,0.1);
  border: 1px solid rgba(91,138,240,0.2);
  border-radius: 3px;
  color: var(--accent);
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* ── Main content area ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Content wrapper (child templates) ── */
.ms-content {
  padding: 24px;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar:not(.mobile-open) {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
  }
  .sidebar:not(.mobile-open) .sidebar-label,
  .sidebar:not(.mobile-open) .brand-text,
  .sidebar:not(.mobile-open) .sidebar-chevron,
  .sidebar:not(.mobile-open) .sidebar-version,
  .sidebar:not(.mobile-open) .sidebar-footer-link {
    opacity: 0;
    width: 0;
    pointer-events: none;
  }
  .sidebar:not(.mobile-open) .sidebar-brand {
    justify-content: center;
    padding: 0;
  }
  .sidebar:not(.mobile-open) .sidebar-toggle { display: none; }
  .sidebar:not(.mobile-open) .sidebar-group-btn,
  .sidebar:not(.mobile-open) .sidebar-admin-btn {
    justify-content: center;
    padding: 0;
    width: var(--sidebar-collapsed-width);
    margin: 0;
  }
  .sidebar:not(.mobile-open) .sidebar-footer {
    justify-content: center;
    padding: 10px 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    width: var(--sidebar-width) !important;
    min-width: var(--sidebar-width) !important;
    z-index: 60;
  }
  .sidebar .sidebar-label,
  .sidebar .brand-text,
  .sidebar .sidebar-chevron,
  .sidebar .sidebar-version,
  .sidebar .sidebar-footer-link {
    opacity: 1 !important;
    width: auto !important;
    pointer-events: auto !important;
  }
  .sidebar .sidebar-brand {
    justify-content: space-between !important;
    padding: 0 12px 0 14px !important;
  }
  .sidebar .sidebar-toggle { display: flex !important; }
  .sidebar .sidebar-group-btn,
  .sidebar .sidebar-admin-btn {
    justify-content: flex-start !important;
    padding: 0 12px 0 14px !important;
    width: calc(100% - 8px) !important;
    margin: 0 8px 0 0 !important;
  }
  .sidebar .sidebar-footer {
    justify-content: space-between !important;
    padding: 10px 14px !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-backdrop { display: block; }
  .topbar-hamburger { display: flex; }
  .topbar-toggle { display: none; }
}

/* ══════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel-alt);
  color: var(--text);
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); background: var(--bg-surface); }
.btn-primary { border-color: var(--accent); background: rgba(91,138,240,0.12); color: var(--accent); }
.btn-primary:hover { background: rgba(91,138,240,0.2); }
.btn-danger { border-color: var(--color-danger); color: var(--color-danger); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-success { border-color: var(--color-success); color: var(--color-success); }
.btn-success:hover { background: rgba(34,197,94,0.1); }
.btn-sm { padding: 4px 10px; font-size: 0.82em; }

/* ══════════════════════════════════════════════════════
   PANELS
══════════════════════════════════════════════════════ */
.panel {
  background: var(--panel);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  margin-bottom: 16px;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-dim);
}
.panel-header h2 {
  font-size: 0.88em;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.panel-body { padding: 16px; }

/* ══════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════ */
.ms-table { width: 100%; border-collapse: collapse; font-size: 0.85em; }
.ms-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.ms-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-dim);
}
.ms-table tr:last-child td { border-bottom: none; }
.ms-table tr:hover td { background: rgba(91,138,240,0.02); }
.ms-table .mono { font-family: var(--font-mono); font-size: 0.92em; }
.ms-table .dim { color: var(--text-dim); }
.ms-table.sortable th[data-sort] { cursor: pointer; transition: color 0.15s; }
.ms-table.sortable th[data-sort]:hover { color: var(--text-dim); }
.ms-table.sortable th.sort-active { color: var(--accent); }

/* ══════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════ */
.ms-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 0.85em;
  z-index: 2000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.ms-toast.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ms-toast.error { border-left-color: var(--color-danger); }

/* ══════════════════════════════════════════════════════
   CONFIRM MODAL
══════════════════════════════════════════════════════ */
.ms-confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease;
}
.ms-confirm-overlay.visible { opacity: 1; pointer-events: auto; }
.ms-confirm-box {
  background: var(--color-surface, #1e1e2e);
  border: 1px solid var(--color-border, #333);
  border-radius: 10px;
  padding: 24px 28px;
  min-width: 340px; max-width: 440px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.ms-confirm-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text, #cdd6f4);
  margin-bottom: 20px;
}
.ms-confirm-actions {
  display: flex; gap: 10px;
  justify-content: flex-end;
}

/* ══════════════════════════════════════════════════════
   FORM INPUTS
══════════════════════════════════════════════════════ */
.ms-input {
  padding: 7px 10px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.9em;
}
.ms-input:focus { border-color: var(--accent); outline: none; }

.role-select {
  padding: 3px 6px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.8em;
  cursor: pointer;
}
.role-select:focus { border-color: var(--accent); outline: none; }
.role-select.role-superadmin { border-color: var(--color-danger); color: var(--color-danger); }
.role-select.role-admin { border-color: var(--accent); color: var(--accent); }
.role-select.role-analyst { border-color: var(--color-success); color: var(--color-success); }
.role-select.role-viewer { border-color: var(--text-dim); color: var(--text-dim); }

/* ══════════════════════════════════════════════════════
   SHARED COMPONENTS — Modal, Alert, Empty, Skeleton,
   Toolbar, Pagination, Bulk Actions
══════════════════════════════════════════════════════ */

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-sm { width: 420px; }
.modal-md { width: 480px; }
.modal-lg { width: 560px; }
.modal-wide { width: 640px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-dim);
}
.modal-header h2 {
  font-size: var(--text-md);
  font-weight: 600;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: var(--text-xl);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: var(--space-5); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-dim);
}
.form-field { margin-bottom: 14px; }
.form-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.input-full { width: 100%; box-sizing: border-box; }

/* ── Alert banners ── */
.alert {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}
.alert svg { flex-shrink: 0; }
.alert .btn { margin-left: auto; flex-shrink: 0; }
.alert-danger {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--sev-critical);
}
.alert-warning {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
}
.alert-success {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--color-success);
}
.alert-info {
  background: rgba(91, 138, 240, 0.06);
  border: 1px solid rgba(91, 138, 240, 0.2);
  color: var(--accent);
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-dim);
}
.empty-icon {
  width: 48px;
  height: 48px;
  opacity: 0.25;
  margin-bottom: var(--space-4);
}
.empty-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-2);
}
.empty-body {
  font-size: var(--text-sm);
  color: var(--text-dim);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}
.empty-cta {
  margin-top: var(--space-4);
}

/* ── Loading skeleton ── */
.skeleton-table {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}
.skeleton-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
}
.skeleton-cell {
  height: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--border-dim) 25%, rgba(91,138,240,0.06) 50%, var(--border-dim) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.sk-w1 { width: 80px; }
.sk-w2 { width: 120px; }
.sk-w3 { width: 160px; }
.sk-w4 { width: 200px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.loading-text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Data toolbar ── */
.data-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.data-toolbar-search {
  padding: var(--space-1) var(--space-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  width: 220px;
}
.data-toolbar-search:focus {
  border-color: var(--accent);
  outline: none;
}
.filter-group {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}
.filter-group label {
  font-size: var(--text-xs);
  color: var(--text-dim);
  white-space: nowrap;
}
.filter-group select {
  padding: var(--space-1) var(--space-2);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}
.toolbar-count {
  font-size: var(--text-sm);
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-left: auto;
  white-space: nowrap;
}
.clear-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  border-color: var(--border);
}
.clear-filters:hover {
  color: var(--sev-critical);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-dim);
}
.pagination-left,
.pagination-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 120px;
}
.pagination-right { justify-content: flex-end; }
.pagination-center {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.page-info {
  font-size: var(--text-sm);
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.perpage-label {
  font-size: var(--text-sm);
  color: var(--text-dim);
}
.perpage-select {
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}

/* ── Bulk action bar ── */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: rgba(91, 138, 240, 0.06);
  border: 1px solid rgba(91, 138, 240, 0.2);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
}
.bulk-count {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
}
.bulk-check {
  accent-color: var(--accent);
  width: auto;
  min-width: auto;
  margin: 0;
  cursor: pointer;
}

/* ── Editable field ── */
.editable-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: var(--text-base);
  min-width: 80px;
}
.editable-icon {
  opacity: 0.25;
  flex-shrink: 0;
  transition: opacity var(--duration-fast);
}
.editable-val:hover {
  border-color: var(--border);
  background: rgba(91, 138, 240, 0.04);
}
.editable-val:hover .editable-icon {
  opacity: 0.7;
}
.editable-input {
  padding: 3px 6px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  min-width: 160px;
}
.editable-input:focus { outline: none; }

/* ══════════════════════════════════════════════════════
   STATUS BADGES
══════════════════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}
.badge-running { background: rgba(91,138,240,0.12); color: var(--accent); }
.badge-completed { background: rgba(34,197,94,0.12); color: var(--color-success); }
.badge-failed { background: rgba(239,68,68,0.12); color: var(--color-danger); }
.badge-stopped { background: rgba(100,116,139,0.12); color: var(--text-dim); }
.badge-interrupted { background: rgba(245,158,11,0.12); color: var(--color-warning); }
.badge-pending { background: rgba(100,116,139,0.12); color: var(--text-dim); }

/* ══════════════════════════════════════════════════════
   VAPORWAVE THEME
══════════════════════════════════════════════════════ */
[data-theme="Vaporwave"] .sidebar {
  border-right-color: var(--accent);
  box-shadow: 1px 0 20px rgba(255,46,204,0.1), 1px 0 6px rgba(0,255,238,0.06);
}
[data-theme="Vaporwave"] .topbar {
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 20px rgba(255,46,204,0.12), 0 1px 6px rgba(0,255,238,0.06);
}
[data-theme="Vaporwave"] .brand-text {
  text-shadow: 0 0 12px rgba(255,46,204,0.6), 0 0 30px rgba(255,46,204,0.2);
}
[data-theme="Vaporwave"] .brand-icon {
  box-shadow: 0 0 10px rgba(0,255,238,0.4), 0 0 25px rgba(0,255,238,0.15);
}
[data-theme="Vaporwave"] .sidebar-link.active {
  text-shadow: 0 0 8px rgba(0,255,238,0.4);
}
[data-theme="Vaporwave"] .sidebar-link:hover {
  text-shadow: 0 0 6px rgba(255,46,204,0.35);
}
[data-theme="Vaporwave"] .sidebar-sublink.active {
  text-shadow: 0 0 8px rgba(0,255,238,0.4);
}
[data-theme="Vaporwave"] .hier-segment.hier-active {
  text-shadow: 0 0 8px rgba(0,255,238,0.5);
  box-shadow: 0 0 8px rgba(0,255,238,0.08);
}
[data-theme="Vaporwave"] .topbar-new-scan {
  box-shadow: 0 0 10px rgba(255,46,204,0.2), 0 0 24px rgba(255,46,204,0.06);
}
[data-theme="Vaporwave"] .topbar-new-scan:hover {
  box-shadow: 0 0 16px rgba(255,46,204,0.35), 0 0 36px rgba(255,46,204,0.1);
}
[data-theme="Vaporwave"] .sidebar-version {
  text-shadow: 0 0 6px rgba(0,255,238,0.4);
}
[data-theme="Vaporwave"] .panel {
  box-shadow: 0 0 1px rgba(255,46,204,0.2), 0 2px 12px rgba(0,0,0,0.4);
}
[data-theme="Vaporwave"] .panel:hover {
  box-shadow: 0 0 8px rgba(255,46,204,0.15), 0 0 20px rgba(0,255,238,0.06), 0 2px 12px rgba(0,0,0,0.4);
}
[data-theme="Vaporwave"] .btn-primary,
[data-theme="Vaporwave"] .btn[class*="primary"] {
  box-shadow: 0 0 10px rgba(255,46,204,0.25), 0 0 30px rgba(255,46,204,0.08);
}
[data-theme="Vaporwave"] .btn-primary:hover,
[data-theme="Vaporwave"] .btn[class*="primary"]:hover {
  box-shadow: 0 0 16px rgba(255,46,204,0.4), 0 0 40px rgba(255,46,204,0.12);
}
[data-theme="Vaporwave"] .ms-toast {
  box-shadow: 0 0 16px rgba(255,46,204,0.3), 0 4px 20px rgba(0,0,0,0.5);
}
[data-theme="Vaporwave"] input:focus,
[data-theme="Vaporwave"] select:focus,
[data-theme="Vaporwave"] textarea:focus {
  box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(255,46,204,0.2);
}
[data-theme="Vaporwave"] .preset-card.preset-active {
  box-shadow: 0 0 12px rgba(255,46,204,0.3), 0 0 30px rgba(0,255,238,0.1);
}
[data-theme="Vaporwave"] .wg-gauge-num {
  filter: drop-shadow(0 0 4px rgba(0,255,238,0.5));
}
[data-theme="Vaporwave"] ::selection {
  background: rgba(255,46,204,0.3);
  color: #fff;
}

/* ══════════════════════════════════════════════════════
   SHARED PAGE PATTERNS (used across all data pages)
══════════════════════════════════════════════════════ */

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.page-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.page-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── Summary cards row ── */
.summary-cards {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}
.summary-card {
  flex: 1;
  min-width: 100px;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.summary-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
.summary-card-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.1;
}
.summary-card-label {
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-1);
}

/* ── Data card (detail panels, baseline cards, etc.) ── */
.data-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.data-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}
.data-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-dim);
}
.data-card-header h2 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}
.data-card-body {
  padding: var(--space-4);
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.filter-select {
  padding: var(--space-1) var(--space-2);
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--duration-fast);
}
.filter-select:focus {
  border-color: var(--accent);
  outline: none;
}
.filter-search {
  padding: var(--space-1) var(--space-3);
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  min-width: 200px;
  transition: border-color var(--duration-fast);
}
.filter-search:focus {
  border-color: var(--accent);
  outline: none;
}
.filter-search::placeholder {
  color: var(--text-muted);
}

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: var(--space-4);
}
.tab-btn {
  padding: var(--space-2) var(--space-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.tab-btn:hover {
  color: var(--text);
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Empty state: see shared component block above (empty-state, empty-icon, empty-title, empty-body) */

/* ── Loading state ── */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ── Severity indicators (shared) ── */
.sev-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.sev-critical { background: var(--sev-critical); }
.sev-high     { background: var(--sev-high); }
.sev-medium   { background: var(--sev-medium); }
.sev-low      { background: var(--sev-low); }
.sev-info     { background: var(--sev-info); }

/* ── Status dot (inline) ── */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  margin-right: var(--space-1);
}
.status-online  { background: var(--color-success); }
.status-offline { background: var(--text-muted); }
.status-warning { background: var(--color-warning); }
.status-error   { background: var(--color-danger); }

/* ── On-Demand Scan Workflow ── */
.on-demand-page {
  max-width: 1440px;
  margin: 0 auto;
}

.scan-upload-card {
  max-width: 640px;
  margin: var(--space-8) auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.scan-upload-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.scan-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  color: var(--text-dim);
  transition: border-color var(--duration-base) var(--ease-out),
              background var(--duration-base) var(--ease-out);
}

.scan-dropzone.dragging,
.scan-dropzone.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.od-scan-controls {
  margin: var(--space-4) 0 var(--space-3);
  gap: var(--space-4);
}

.od-project-create-row {
  display: flex;
  gap: var(--space-2);
}

.od-new-project-input {
  min-width: 160px;
}

.od-nowrap {
  white-space: nowrap;
}

.od-skip-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  cursor: pointer;
  padding: var(--space-2) 0;
  font-size: var(--text-base);
  text-transform: none;
  font-weight: 400;
  color: var(--text);
}

.od-skip-checkbox {
  width: auto;
  min-width: auto;
  margin: 0;
}

.od-file-controls {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
}

.od-library-panel {
  flex-direction: column;
}

.od-presets-loading,
.od-presets-empty {
  text-align: center;
  padding: var(--space-4);
  color: var(--text-dim);
}

.od-upload-wrap {
  width: 100%;
}

.od-upload-icon {
  font-size: var(--text-lg);
  margin-right: var(--space-2);
}

.od-upload-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-left: var(--space-2);
}

.od-upload-input {
  display: none;
}

.od-upload-status {
  margin-top: var(--space-2);
  font-size: var(--text-base);
  color: var(--text-dim);
}

.od-upload-trimmed {
  color: var(--color-warning);
}

.od-upload-error {
  color: var(--color-danger);
}

.od-compare-col {
  width: 30px;
}

.od-loading-cell {
  text-align: center;
  padding: var(--space-5);
}

.od-run-id {
  font-size: var(--text-sm);
  color: var(--text-dim);
}

.od-run-header-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.od-run-info {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-dim);
}

.od-run-live-row {
  margin-top: var(--space-2);
}

.od-run-live-link {
  color: var(--accent-cyan);
  font-size: var(--text-base);
  text-decoration: none;
}

.od-run-live-link:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════
   GLOBAL — Pending approval badge (topbar)
══════════════════════════════════════════════════════ */
.pending-badge-wrap {
  position: relative;
  display: inline-flex;
}
.pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72em;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  text-decoration: none;
  cursor: pointer;
  animation: pending-badge-glow 2s ease-in-out infinite;
}
.pending-badge:hover { background: rgba(245, 158, 11, 0.25); }
@keyframes pending-badge-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.pending-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 200;
  overflow: hidden;
}
.pending-dropdown-header {
  padding: 8px 12px;
  font-size: 0.72em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-dim);
}
.pending-dropdown-item {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.pending-dropdown-ip {
  display: block;
  font-size: 0.82em;
  font-family: var(--font-mono);
  color: var(--text);
}
.pending-dropdown-meta {
  display: block;
  font-size: 0.72em;
  color: var(--text-muted);
}
.pending-dropdown-viewall {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 0.78em;
  color: var(--accent);
  text-decoration: none;
  border-top: 1px solid var(--border-dim);
}
.pending-dropdown-viewall:hover { background: var(--bg-deep); }
