/* ==========================================================================
   PantauCVE design system
   Every colour is a semantic token. Text tokens are always paired with the
   surface they sit on, and each pair meets WCAG AA (≥ 4.5:1) in both themes.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-subtle: #f9fafb;
  --surface-hover: #f3f4f6;
  --surface-active: #eceef2;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  /* Text */
  --text: #101828;
  --text-secondary: #475467;
  --text-tertiary: #667085;
  --text-on-accent: #ffffff;
  /* Accent */
  --accent: #1b5fa8;
  --accent-hover: #154c87;
  --accent-subtle: #e8f1fb;
  --accent-text: #134a85;
  --accent-border: #b9d4f1;
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  /* Semantic */
  --crit-fg: #b42318; --crit-bg: #fef3f2; --crit-bd: #fecdca;
  --high-fg: #b54708; --high-bg: #fff1e3; --high-bd: #fbc995;
  --med-fg: #93370d;  --med-bg: #fffaeb;  --med-bd: #fedf89;
  --low-fg: #1849a9;  --low-bg: #eff8ff;  --low-bd: #b2ddff;
  --neutral-fg: #344054; --neutral-bg: #f2f4f7; --neutral-bd: #e4e7ec;
  --ok-fg: #067647;   --ok-bg: #ecfdf3;   --ok-bd: #abefc6;
  --kev-fg: #ffffff;  --kev-bg: #b42318;
  /* Data visualisation */
  --c-critical: #e5484d;
  --c-high: #e5600a;
  --c-medium: #c27c0e;
  --c-low: #3e63dd;
  --c-kev: #8e4ec6;
  --c-new: #2a78c8;
  --c-fixed: #12a594;
  --c-grid: #eaecf0;
  --c-axis: #667085;
  /* Shape */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -4px rgba(16, 24, 40, .14), 0 4px 8px -2px rgba(16, 24, 40, .06);
  --font: "Inter", "InterVariable", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c10; --surface: #121419; --surface-subtle: #16191f; --surface-hover: #1c2028; --surface-active: #232832;
    --border: #252a33; --border-strong: #343a46;
    --text: #edeef2; --text-secondary: #b4bac6; --text-tertiary: #8d94a3;
    --accent: #2a6fbf; --accent-hover: #3a80d0; --accent-subtle: rgba(108, 180, 238, .14); --accent-text: #9ccbf5; --accent-border: rgba(108, 180, 238, .42);
    --ring: 0 0 0 2px var(--surface), 0 0 0 4px #6cb4ee;
    --crit-fg: #ff9a96; --crit-bg: rgba(229, 72, 77, .14); --crit-bd: rgba(229, 72, 77, .35);
    --high-fg: #ffab6e; --high-bg: rgba(247, 107, 21, .14); --high-bd: rgba(247, 107, 21, .35);
    --med-fg: #f5cf73; --med-bg: rgba(226, 163, 54, .14); --med-bd: rgba(226, 163, 54, .35);
    --low-fg: #a3b8ff; --low-bg: rgba(62, 99, 221, .18); --low-bd: rgba(62, 99, 221, .4);
    --neutral-fg: #c4c9d4; --neutral-bg: rgba(255, 255, 255, .06); --neutral-bd: rgba(255, 255, 255, .1);
    --ok-fg: #6ee7b7; --ok-bg: rgba(18, 165, 148, .15); --ok-bd: rgba(18, 165, 148, .38);
    --kev-fg: #ffffff; --kev-bg: #c4302b;
    --c-critical: #f2555a; --c-high: #ff802b; --c-medium: #f0b44a; --c-low: #6e8cff; --c-kev: #b07ce8; --c-new: #6cb4ee; --c-fixed: #2cc5b0;
    --c-grid: #22262e; --c-axis: #8d94a3;
    --shadow-sm: none; --shadow: none; --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c10; --surface: #121419; --surface-subtle: #16191f; --surface-hover: #1c2028; --surface-active: #232832;
  --border: #252a33; --border-strong: #343a46;
  --text: #edeef2; --text-secondary: #b4bac6; --text-tertiary: #8d94a3;
  --accent: #2a6fbf; --accent-hover: #3a80d0; --accent-subtle: rgba(108, 180, 238, .14); --accent-text: #9ccbf5; --accent-border: rgba(108, 180, 238, .42);
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px #6cb4ee;
  --crit-fg: #ff9a96; --crit-bg: rgba(229, 72, 77, .14); --crit-bd: rgba(229, 72, 77, .35);
  --high-fg: #ffab6e; --high-bg: rgba(247, 107, 21, .14); --high-bd: rgba(247, 107, 21, .35);
  --med-fg: #f5cf73; --med-bg: rgba(226, 163, 54, .14); --med-bd: rgba(226, 163, 54, .35);
  --low-fg: #a3b8ff; --low-bg: rgba(62, 99, 221, .18); --low-bd: rgba(62, 99, 221, .4);
  --neutral-fg: #c4c9d4; --neutral-bg: rgba(255, 255, 255, .06); --neutral-bd: rgba(255, 255, 255, .1);
  --ok-fg: #6ee7b7; --ok-bg: rgba(18, 165, 148, .15); --ok-bd: rgba(18, 165, 148, .38);
  --kev-fg: #ffffff; --kev-bg: #c4302b;
  --c-critical: #f2555a; --c-high: #ff802b; --c-medium: #f0b44a; --c-low: #6e8cff; --c-kev: #b07ce8; --c-new: #6cb4ee; --c-fixed: #2cc5b0;
  --c-grid: #22262e; --c-axis: #8d94a3;
  --shadow-sm: none; --shadow: none; --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01";
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:where(code, .mono) { font-family: var(--mono); font-size: 12.5px; }
h1.mono { font-size: 22px; letter-spacing: -.01em; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 30px; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 14.5px; line-height: 22px; font-weight: 600; letter-spacing: -.005em; }
h3 { font-size: 12px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .06em; }
td, .kpi-value { font-variant-numeric: tabular-nums; }
::selection { background: var(--accent-subtle); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--text-tertiary); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.2; }
.brand-tag { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-tertiary); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); padding: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px;
  color: var(--text-secondary); font-weight: 500; font-size: 13.5px;
}
.nav a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-subtle); color: var(--accent-text); font-weight: 600; }
.nav a.active svg { color: var(--accent-text); }
.nav svg { width: 17px; height: 17px; flex: none; color: var(--text-tertiary); }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--kev-bg); color: var(--kev-fg); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

.user-box { margin-top: auto; position: relative; border-top: 1px solid var(--border); padding-top: 12px; }
.user-btn {
  width: 100%; height: auto; justify-content: flex-start; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px;
  background: transparent; border: 0; box-shadow: none; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.user-btn:hover { background: var(--surface-hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-subtle); color: var(--accent-text); font-weight: 700; font-size: 12.5px; }
.user-meta { min-width: 0; flex: 1; line-height: 1.3; }
.user-name { font-weight: 600; font-size: 13px; color: var(--text); }
.user-role { font-size: 12px; color: var(--text-tertiary); }
.user-btn svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.menu {
  position: absolute; z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.user-box .menu { bottom: calc(100% + 6px); left: 0; right: 0; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head .user-role { overflow-wrap: anywhere; }
.menu button, .menu a {
  width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px;
  border: 0; background: transparent; box-shadow: none; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--surface-hover); text-decoration: none; }
.menu svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.menu .danger-item { color: var(--crit-fg); }
.menu .danger-item svg { color: var(--crit-fg); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--border);
}
.search { position: relative; flex: 1; max-width: 560px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-tertiary); pointer-events: none; }
.search input { width: 100%; height: 36px; padding-left: 36px; padding-right: 48px; background: var(--surface); }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
kbd { font: 600 11px var(--font); color: var(--text-tertiary); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface-subtle); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sync-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.sync-chip .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--c-fixed); }
.sync-chip.running .pulse { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.icon-btn { width: 36px; height: 36px; padding: 0; }
.menu-toggle { display: none; }
.content { padding: 28px 32px 64px; width: 100%; max-width: 1440px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin-top: 4px; color: var(--text-secondary); max-width: 70ch; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-tertiary); margin-bottom: 8px; }
.crumbs a { color: var(--text-secondary); font-weight: 500; }
.meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; color: var(--text-secondary); font-size: 13px; }
.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }

/* ---------- Layout helpers ---------- */
.grid { display: grid; gap: 16px; align-items: start; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.muted { color: var(--text-secondary); }
.faint { color: var(--text-tertiary); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.ellipsis { max-width: 280px; }
td.col-main { max-width: 0; width: 42%; min-width: 240px; }
td.col-comp { max-width: 260px; }
td.col-main .cell-sub, td.col-comp .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.cell-title { color: var(--text); }
a.cell-title:hover { color: var(--accent-text); }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); min-height: 54px; }
.card-head .sub { color: var(--text-tertiary); font-size: 12.5px; margin-top: 1px; }
.card-head a { font-size: 13px; font-weight: 500; }
.card-body { padding: 18px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; color: inherit; position: relative; overflow: hidden; }
a.kpi:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-subtle); }
.kpi-label svg { width: 15px; height: 15px; }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.kpi-value { font-size: 28px; line-height: 32px; font-weight: 650; letter-spacing: -.02em; color: var(--text); }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--text-tertiary); letter-spacing: 0; margin-left: 2px; }
.kpi-hint { font-size: 12px; color: var(--text-tertiary); }
.kpi.is-critical .kpi-value { color: var(--crit-fg); }
.kpi.is-high .kpi-value { color: var(--high-fg); }
.kpi.is-kev::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--kev-bg); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--text-tertiary); }
.dot.critical { background: var(--c-critical); } .dot.high { background: var(--c-high); } .dot.medium { background: var(--c-medium); } .dot.low { background: var(--c-low); } .dot.kev { background: var(--c-kev); }
.dot.online { background: #17b26a; box-shadow: 0 0 0 3px rgba(23, 178, 106, .18); }
.dot.offline { background: #f04438; box-shadow: 0 0 0 3px rgba(240, 68, 56, .18); }
.dot.pending { background: #f79009; box-shadow: 0 0 0 3px rgba(247, 144, 9, .18); }
.dot.manual { background: var(--text-tertiary); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; border: 1px solid transparent;
}
.sev-critical { background: var(--crit-bg); color: var(--crit-fg); border-color: var(--crit-bd); }
.sev-high { background: var(--high-bg); color: var(--high-fg); border-color: var(--high-bd); }
.sev-medium { background: var(--med-bg); color: var(--med-fg); border-color: var(--med-bd); }
.sev-low { background: var(--low-bg); color: var(--low-fg); border-color: var(--low-bd); }
.sev-unknown, .sev-none, .b-neutral { background: var(--neutral-bg); color: var(--neutral-fg); border-color: var(--neutral-bd); }
.b-kev { background: var(--kev-bg); color: var(--kev-fg); }
.b-ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.b-accent { background: var(--accent-subtle); color: var(--accent-text); border-color: var(--accent-border); }
.b-outline { background: var(--surface); color: var(--text-secondary); border-color: var(--border); }
.st-open { background: var(--crit-bg); color: var(--crit-fg); border-color: var(--crit-bd); }
.st-acknowledged { background: var(--med-bg); color: var(--med-fg); border-color: var(--med-bd); }
.st-ignored { background: var(--neutral-bg); color: var(--neutral-fg); border-color: var(--neutral-bd); }
.st-fixed { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.chips { display: inline-flex; gap: 4px; }
.chip { min-width: 30px; height: 22px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 650; display: inline-grid; place-items: center; border: 1px solid transparent; }
.chip.zero { background: transparent; color: var(--text-tertiary); border-color: var(--border); font-weight: 500; }

/* ---------- Buttons ---------- */
button, .btn {
  font: inherit; font-size: 13.5px; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, color .12s;
}
button:hover, .btn:hover { background: var(--surface-hover); text-decoration: none; }
button:active, .btn:active { background: var(--surface-active); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--crit-fg); }
button.danger:hover { background: var(--crit-bg); border-color: var(--crit-bd); }
button.danger.solid { background: #d92d20; border-color: #d92d20; color: #fff; }
button.danger.solid:hover { background: #b42318; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-secondary); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
button.sm, .btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
button svg, .btn svg { width: 16px; height: 16px; flex: none; }
button.sm svg, .btn.sm svg { width: 14px; height: 14px; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Forms ---------- */
input, select, textarea {
  font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 8px; height: 36px; padding: 0 11px; min-width: 0; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s;
}
select { padding-right: 30px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%), linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { height: auto; min-height: 88px; padding: 9px 11px; width: 100%; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-tertiary); }
input:hover, select:hover, textarea:hover { border-color: var(--text-tertiary); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; box-shadow: none; accent-color: var(--accent); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 550; color: var(--text); }
.field > input, .field > select { width: 100%; }
.hint { font-size: 12.5px; font-weight: 400; color: var(--text-tertiary); line-height: 1.45; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--text); font-weight: 450; }
.check.block { display: flex; align-items: flex-start; }
.check.block input { margin-top: 2px; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 550; color: var(--text-secondary); }
.switch input { appearance: none; width: 36px; height: 20px; min-height: 0; border-radius: 99px; background: var(--border-strong); border: 0; position: relative; transition: background .15s; box-shadow: none; padding: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.toolbar .search-field { position: relative; flex: 1 1 260px; max-width: 380px; }
.toolbar .search-field svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-tertiary); pointer-events: none; }
.toolbar .search-field input { width: 100%; padding-left: 32px; }
.toolbar select, .toolbar input { height: 32px; font-size: 13px; }
.toolbar .btn, .toolbar button { height: 32px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-hover); border-radius: 8px; border: 1px solid var(--border); }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; box-shadow: none; font-size: 12.5px; font-weight: 550; color: var(--text-secondary); }
.seg button:hover { background: transparent; color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 0 0 1px var(--border); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; font-weight: 550; color: var(--text-tertiary); background: var(--surface-subtle); white-space: nowrap; height: 40px; padding-top: 0; padding-bottom: 0; }
tbody tr { transition: background .08s; }
tbody tr:hover { background: var(--surface-subtle); }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
td.tight, th.tight { width: 1%; white-space: nowrap; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--text-tertiary); margin-top: 1px; }
.num-strong { font-weight: 650; color: var(--text); }
.empty { padding: 56px 24px; text-align: center; color: var(--text-secondary); }
.empty-icon { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-hover); color: var(--text-tertiary); }
.empty-icon svg { width: 22px; height: 22px; }
.empty h2 { color: var(--text); margin-bottom: 4px; }
.empty p { max-width: 46ch; margin: 0 auto; }
.empty .btn, .empty button { margin-top: 16px; }
.empty.compact { padding: 28px 20px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-secondary); }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 8px 16px; background: var(--accent-subtle); border-bottom: 1px solid var(--accent-border); flex-wrap: wrap; color: var(--accent-text); font-weight: 600; font-size: 13px; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-hover), var(--surface-active), var(--surface-hover)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton + .skeleton { margin-top: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 2px; color: var(--text-secondary); font-weight: 550; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tab-count { font-size: 11.5px; font-weight: 600; background: var(--surface-hover); color: var(--text-secondary); padding: 1px 7px; border-radius: 99px; }

/* ---------- Callouts ---------- */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13.5px; }
.callout > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.callout-title { font-weight: 600; color: var(--text); }
.callout-body { color: var(--text-secondary); margin-top: 2px; }
.callout ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-secondary); }
.callout a { font-weight: 600; }
.callout.info { background: var(--accent-subtle); border-color: var(--accent-border); }
.callout.info > svg { color: var(--accent-text); }
.callout.warn { background: var(--med-bg); border-color: var(--med-bd); }
.callout.warn > svg { color: var(--med-fg); }
.callout.danger { background: var(--crit-bg); border-color: var(--crit-bd); }
.callout.danger > svg { color: var(--crit-fg); }
.callouts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.code-block { position: relative; background: #0d1117; color: #e6edf3; border-radius: var(--radius); padding: 14px 84px 14px 16px; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid #30363d; }
.code-block .copy { position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 10px; font-size: 12px; background: #21262d; border-color: #30363d; color: #e6edf3; box-shadow: none; }
.code-block .copy:hover { background: #30363d; }
details > summary { cursor: pointer; color: var(--text-secondary); font-weight: 500; font-size: 13px; }
details > summary:hover { color: var(--text); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--text-tertiary); }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.bar { height: 6px; background: var(--surface-active); border-radius: 99px; overflow: hidden; display: flex; min-width: 80px; }
.bar span { display: block; height: 100%; }
.bar .critical { background: var(--c-critical); } .bar .high { background: var(--c-high); } .bar .medium { background: var(--c-medium); } .bar .low { background: var(--c-low); } .bar .fill { background: var(--accent); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list li.clickable { cursor: pointer; }
.list li.clickable:hover { background: var(--surface-subtle); }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-secondary); line-height: 1.65; }
.refs { margin: 0; padding-left: 18px; }
.refs li { overflow-wrap: anywhere; margin-bottom: 6px; color: var(--text-secondary); }
.eco-row + .eco-row { margin-top: 14px; }
.eco-row .row { margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.eco-row b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Charts ---------- */
.trend-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 16px 20px 0; }
.trend-head .sub { color: var(--text-tertiary); font-size: 12.5px; margin-top: 2px; }
.trend-series { display: flex; gap: 4px; flex-wrap: wrap; padding: 12px 14px 0; }
.series-btn {
  height: auto; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 3px; padding: 8px 12px; min-width: 116px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; box-shadow: none; text-align: left;
}
.series-btn:hover { background: var(--surface-subtle); border-color: var(--border); }
.series-btn.on { background: var(--surface-subtle); border-color: var(--border); }
.series-btn:not(.on) .s-value, .series-btn:not(.on) .s-label, .series-btn:not(.on) .delta { color: var(--text-tertiary); }
.series-btn:not(.on) .s-swatch { opacity: .4; }
.s-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.s-swatch { width: 12px; height: 3px; border-radius: 2px; }
.s-swatch.dashed { background: repeating-linear-gradient(90deg, var(--c-kev) 0 4px, transparent 4px 6px) !important; }
.s-value { display: flex; align-items: baseline; gap: 8px; font-size: 20px; line-height: 26px; font-weight: 650; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--crit-fg); }
.delta.down { color: var(--ok-fg); }
.delta.flat { color: var(--text-tertiary); }
.chart-box { position: relative; padding: 4px 16px 0 8px; touch-action: pan-y; }
.chart-box svg { display: block; width: 100%; overflow: visible; user-select: none; }
.chart-box text { fill: var(--c-axis); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.grid-line { stroke: var(--c-grid); stroke-width: 1; }
.base-line { stroke: var(--border-strong); stroke-width: 1; }
.crosshair { stroke: var(--text-tertiary); stroke-width: 1; stroke-dasharray: 3 3; }
.hover-dot { stroke: var(--surface); stroke-width: 2; }
.series-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.series-line.dashed { stroke-dasharray: 5 4; stroke-width: 1.75; }
.chart-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.chart-label h3 { margin: 0; }
.chart-tip {
  position: absolute; top: 4px; z-index: 5; pointer-events: none; min-width: 180px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 12.5px; color: var(--text);
}
.tip-date { font-weight: 600; margin-bottom: 4px; color: var(--text); }
.tip-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; color: var(--text-secondary); line-height: 1.85; }
.tip-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.tip-row span { display: inline-flex; align-items: center; gap: 7px; }
.tip-row .s-swatch { width: 8px; height: 8px; border-radius: 2px; }
.chart-tip hr { margin: 6px 0; }
.stroke-critical { stroke: var(--c-critical); } .fill-critical { fill: var(--c-critical); } .stop-critical { stop-color: var(--c-critical); } .bg-critical { background: var(--c-critical); }
.stroke-high { stroke: var(--c-high); } .fill-high { fill: var(--c-high); } .stop-high { stop-color: var(--c-high); } .bg-high { background: var(--c-high); }
.stroke-medium { stroke: var(--c-medium); } .fill-medium { fill: var(--c-medium); } .stop-medium { stop-color: var(--c-medium); } .bg-medium { background: var(--c-medium); }
.stroke-low { stroke: var(--c-low); } .fill-low { fill: var(--c-low); } .stop-low { stop-color: var(--c-low); } .bg-low { background: var(--c-low); }
.stroke-kev { stroke: var(--c-kev); } .fill-kev { fill: var(--c-kev); } .stop-kev { stop-color: var(--c-kev); } .bg-kev { background: var(--c-kev); }
.fill-new { fill: var(--c-new); } .bg-new { background: var(--c-new); }
.fill-fixed { fill: var(--c-fixed); } .bg-fixed { background: var(--c-fixed); }
.stroke-grid { stroke: var(--c-grid); }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut-wrap svg { width: 148px; height: 148px; flex: none; }
.donut-total { fill: var(--text); font-weight: 700; font-size: 26px; font-family: var(--font); }
.donut-label { fill: var(--text-tertiary); font-size: 11px; font-family: var(--font); }
.sev-rows { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 170px; }
.sev-rows a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; margin: 0 -8px; border-radius: 7px; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.sev-rows a:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
.sev-rows b { margin-left: auto; color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .s-swatch { width: 8px; height: 8px; border-radius: 2px; }

.onboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.onboard .card { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.step-num { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-subtle); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.onboard p { color: var(--text-secondary); flex: 1; }
.onboard .btn { align-self: flex-start; margin-top: 8px; }

/* ---------- Modal, toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(10, 12, 16, .5); backdrop-filter: blur(2px); animation: fade .12s ease-out; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: rise .16s ease-out; }
.modal.wide { width: min(780px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 0; }
.modal-head p { color: var(--text-secondary); margin-top: 4px; font-size: 13.5px; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-subtle); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px) scale(.99); } }
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 11px 14px; border-radius: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500; animation: rise .16s ease-out; }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--ok-fg); }
.toast.err svg { color: var(--crit-fg); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 96px); }
.auth-form { width: 100%; max-width: 380px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { font-size: 26px; line-height: 34px; }
.auth-form .lead { color: var(--text-secondary); margin-top: 6px; }
.auth-form button.primary { height: 40px; width: 100%; }
.link-btn { background: none; border: 0; box-shadow: none; padding: 0; height: auto; color: var(--accent-text); font-weight: 550; font-size: 13.5px; }
.link-btn:hover { background: none; text-decoration: underline; }
.link-btn:disabled { color: var(--text-tertiary); text-decoration: none; opacity: 1; }
.auth .brand { padding: 0 0 28px; }
.auth-err { color: var(--crit-fg); font-size: 13px; font-weight: 500; min-height: 18px; }
.code-input { height: 52px; text-align: center; font: 600 24px/1 var(--mono); letter-spacing: .5em; padding-left: .5em; }
.auth-art {
  /* Hero artwork: the illustration's subject sits on its right half, so anchor it there. */
  background: url('/branding/login-hero') 72% center / cover no-repeat, #0b2f5c;
}
.auth-art h2 { font-size: 28px; line-height: 36px; font-weight: 650; letter-spacing: -.02em; color: #fff; max-width: 20ch; }
.auth-art p { color: #d3e3f5; margin-top: 12px; max-width: 46ch; }
.auth-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.auth-stats div { border-top: 1px solid rgba(255, 255, 255, .22); padding-top: 12px; font-size: 12.5px; color: #d3e3f5; }
.auth-stats b { display: block; font-size: 20px; color: #fff; font-weight: 650; }

/* ---------- Printable report (always light) ---------- */
.report {
  --surface: #fff; --surface-subtle: #f9fafb; --surface-hover: #f3f4f6; --border: #e4e7ec; --border-strong: #d0d5dd;
  --text: #101828; --text-secondary: #475467; --text-tertiary: #667085; --accent: #1b5fa8; --accent-text: #134a85;
  --crit-fg: #b42318; --crit-bg: #fef3f2; --crit-bd: #fecdca; --high-fg: #b54708; --high-bg: #fff1e3; --high-bd: #fbc995;
  --med-fg: #93370d; --med-bg: #fffaeb; --med-bd: #fedf89; --low-fg: #1849a9; --low-bg: #eff8ff; --low-bd: #b2ddff;
  --neutral-fg: #344054; --neutral-bg: #f2f4f7; --neutral-bd: #e4e7ec; --ok-fg: #067647; --ok-bg: #ecfdf3; --ok-bd: #abefc6;
  --kev-fg: #fff; --kev-bg: #b42318; color-scheme: light;
  max-width: 980px; margin: 0 auto; padding: 48px 56px; background: #fff; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.report h1 { font-size: 26px; line-height: 34px; }
.report h2 { font-size: 16px; margin: 32px 0 10px; }
.report p { color: var(--text-secondary); line-height: 1.65; }
.report table { margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; }
.report th { background: #f9fafb; }
.report td, .report th { padding: 8px 12px; font-size: 12.5px; }
.report tbody tr:hover { background: transparent; }
.report .kpis { grid-template-columns: repeat(5, 1fr); margin-top: 16px; }
.report .card { box-shadow: none; }
.report-brand { justify-content: flex-end; text-align: left; line-height: 1.25; margin-bottom: 4px; }
.report-brand .brand-mark { width: 36px; height: 36px; }
.report-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

@media print {
  :root, :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --surface-subtle: #f9fafb; --surface-hover: #f3f4f6; --border: #d0d5dd; --border-strong: #98a2b3;
    --text: #101828; --text-secondary: #344054; --text-tertiary: #475467; --accent-text: #134a85; --accent-subtle: #e8f1fb; --accent-border: #b9d4f1;
    --crit-fg: #b42318; --crit-bg: #fef3f2; --crit-bd: #fecdca; --med-fg: #93370d; --med-bg: #fffaeb; --med-bd: #fedf89;
    --neutral-fg: #344054; --neutral-bg: #f2f4f7; --neutral-bd: #d0d5dd; --ok-fg: #067647; --ok-bg: #ecfdf3; --ok-bd: #abefc6;
    color-scheme: light;
  }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .code-block { background: #f6f8fa !important; color: #101828 !important; border-color: #d0d5dd !important; padding-right: 16px; }
  .code-block .copy, .guide-nav, .page-head .actions { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; }
  .side, .topbar, .no-print, #toasts { display: none !important; }
  .layout { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .report { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .report tr { break-inside: avoid; }
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-21, .g-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; width: 272px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(10, 12, 16, .4); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .search kbd, .sync-text { display: none; }
  .sync-chip { padding: 0 10px; }
  .content { padding: 20px 16px 56px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav a { height: 44px; }
  .g-2, .form-grid, .onboard { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .toolbar .search-field { max-width: none; flex-basis: 100%; }
  .hide-sm { display: none; }
  .report { padding: 24px; }
  .report .kpis { grid-template-columns: repeat(2, 1fr); }
  button, .btn, input, select { min-height: 40px; }
  .seg button, .series-btn, .link-btn { min-height: 0; }
  .seg button { height: 32px; }
}

.toast .toast-action { margin-left: 8px; height: 28px; padding: 0 10px; font-size: 12.5px; }
.badge.overdue { background: var(--crit-bg); color: var(--crit-fg); border-color: var(--crit-bd); }
.crumbs [aria-current] { color: var(--text); font-weight: 500; }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 64px; }
.pw-wrap .link-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12.5px; }

/* ---------- Install guide ---------- */
.guide-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.guide-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.guide-nav a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; }
.guide-nav a:hover { background: var(--surface); border-color: var(--border); text-decoration: none; }
.guide-nav a.on { background: var(--surface); border-color: var(--accent-border); box-shadow: inset 3px 0 0 var(--accent); }
.guide { list-style: none; margin: 16px 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.guide-step { display: flex; gap: 14px; align-items: flex-start; }
.guide-step .step-num { margin: 0; flex: none; }
.mt-sm { margin-top: 6px; }
.card-body > .callout { margin-top: 16px; }
@media (max-width: 960px) { .guide-layout { grid-template-columns: minmax(0, 1fr); } .guide-nav { position: static; flex-direction: row; overflow-x: auto; } .guide-nav a { min-width: 170px; } }
@media print { .guide-layout { display: block; } }

.sticky-col { position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .12); }
thead .sticky-col { background: var(--surface-subtle); }
tbody tr:hover .sticky-col { background: var(--surface-subtle); }
.updates-table td.col-comp { max-width: 300px; }
.updates-table td.col-comp .cell-sub { white-space: normal; }
.print-only { display: none; }
@media print { .print-only { display: block; } }
@media (max-width: 1599px) { .hide-lg { display: none; } }

/* ---------- Branding settings ---------- */
.hero-preview { width: 100%; max-width: 560px; aspect-ratio: 4 / 5; border-radius: var(--radius); border: 1px solid var(--border); background: url('/branding/login-hero') 72% center / cover no-repeat, var(--surface-hover); }
.hero-preview.wide { aspect-ratio: 16 / 9; max-width: none; }

/* ==========================================================================
   Animated sign-in (email → password → email code)
   ========================================================================== */
.signin { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.signin .auth-panel { position: relative; overflow: hidden; }
.signin .auth-panel::before {
  content: ""; position: absolute; width: 520px; height: 520px; left: -180px; top: -160px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(108, 180, 238, .22), transparent 65%); animation: si-drift 14s ease-in-out infinite alternate;
}
.signin .auth-form { position: relative; gap: 18px; }
.signin .brand { padding: 0 0 12px; }
.signin .brand-name { font-size: 16px; }
.si-cve { color: var(--accent-text); font-weight: 700; }
.si-mark { width: 40px; height: 40px; overflow: visible; flex: none; }
.si-gear { transform-origin: 32px 32px; animation: si-spin-in 1.4s cubic-bezier(.2, .8, .2, 1) both; }
.si-disc, .si-shield { transform-origin: 32px 32px; animation: si-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.si-disc { animation-delay: .55s; } .si-shield { animation-delay: .75s; }
.si-check { stroke-dasharray: 14; stroke-dashoffset: 14; animation: si-draw .45s 1.05s ease-out forwards; }

.si-reveal { opacity: 0; transform: translateY(14px); animation: si-rise .7s cubic-bezier(.2, .7, .2, 1) forwards; }
.si-reveal.si-d0 { animation-delay: .15s; } .si-reveal.si-d1 { animation-delay: .26s; } .si-reveal.si-d2 { animation-delay: .38s; }

.si-flow { display: flex; flex-direction: column; gap: 16px; }
.si-progress { display: flex; gap: 6px; }
.si-progress span { height: 4px; width: 22px; border-radius: 4px; background: var(--border); transition: width .45s cubic-bezier(.2, .8, .2, 1), background .45s; }
.si-progress span.on { width: 44px; background: linear-gradient(90deg, var(--accent), #6cb4ee); }
.si-step { display: flex; flex-direction: column; gap: 16px; }
.si-step[hidden] { display: none; }
.si-step h1 { font-size: 26px; line-height: 34px; }
.si-step .lead { color: var(--text-secondary); margin-top: 4px; }
.si-step.enter { animation: si-step-in .55s cubic-bezier(.2, .8, .2, 1) both; }
.si-step.leave { animation: si-step-out .3s ease-in both; }
.si-step.enter.back { animation-name: si-step-in-back; }
.si-step.leave.back { animation-name: si-step-out-back; }
.si-step.enter .si-stagger { animation: si-rise .55s cubic-bezier(.2, .8, .2, 1) both; }
.si-step.enter .si-stagger.si-d0 { animation-delay: .12s; } .si-step.enter .si-stagger.si-d1 { animation-delay: .2s; } .si-step.enter .si-stagger.si-d2 { animation-delay: .28s; }
.si-step.shake { animation: si-shake .42s cubic-bezier(.36, .07, .19, .97) both; }
.si-pop { animation: si-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.signin .auth-err { margin-top: -8px; }

.si-input { position: relative; display: block; }
.si-input input { width: 100%; height: 44px; border-radius: 10px; }
.si-input::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), #6cb4ee); transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.si-input:focus-within::after { transform: scaleX(1); }

.signin button.si-btn {
  position: relative; overflow: hidden; height: 46px; width: 100%; border-radius: 10px; font-size: 14.5px; border: 0;
  background: linear-gradient(135deg, #2a78c8, var(--accent) 55%, #134a85); box-shadow: 0 8px 20px -8px rgba(27, 95, 168, .6);
  transition: transform .15s, box-shadow .2s;
}
.signin button.si-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(27, 95, 168, .7); background: linear-gradient(135deg, #2a78c8, var(--accent) 55%, #134a85); }
.signin button.si-btn:disabled { opacity: 1; cursor: progress; }
.si-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); }
.si-btn:hover::after { animation: si-sheen .9s ease; }
.si-spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: si-rot .8s linear infinite; }
.si-btn.loading .si-label { display: none; }
.si-btn.loading .si-spinner { display: block; }

.si-chip {
  align-self: flex-start; height: auto; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; margin-top: -8px;
  border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface-subtle); box-shadow: none; font-size: 13.5px; font-weight: 500;
}
.si-chip .avatar { width: 26px; height: 26px; font-size: 12px; }
.si-change { color: var(--accent-text); font-weight: 600; font-size: 12.5px; margin-left: 4px; }

.si-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-subtle); color: var(--accent-text); animation: si-pop .55s .1s cubic-bezier(.3, 1.6, .5, 1) both; }
.si-icon svg { width: 26px; height: 26px; }
.si-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.si-otp input { height: 56px; padding: 0; text-align: center; font: 600 22px var(--mono); border-radius: 12px; }
.si-step.enter .si-otp input { animation: si-digit-in .45s cubic-bezier(.3, 1.5, .5, 1) both; }
.si-otp input:nth-child(1) { animation-delay: .15s; } .si-otp input:nth-child(2) { animation-delay: .2s; } .si-otp input:nth-child(3) { animation-delay: .25s; }
.si-otp input:nth-child(4) { animation-delay: .3s; } .si-otp input:nth-child(5) { animation-delay: .35s; } .si-otp input:nth-child(6) { animation-delay: .4s; }
.si-otp input.filled { border-color: var(--accent); background: var(--accent-subtle); animation: si-tick .25s ease; }
.si-done { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); animation: si-pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.si-done svg { width: 52px; height: 52px; fill: none; stroke: #12a594; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.si-done circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: si-draw .6s .15s ease-out forwards; }
.si-done path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: si-draw .4s .65s ease-out forwards; }

/* Right-hand scene */
.si-scene { position: relative; overflow: hidden; background: #071a36; isolation: isolate; padding: 0; display: block; }
.si-bg { position: absolute; inset: -4%; background: url('/branding/login-hero') 70% center / cover no-repeat; animation: si-kenburns 24s ease-in-out infinite alternate; will-change: transform; }
.si-tint { position: absolute; inset: 0; background: linear-gradient(200deg, rgba(27, 95, 168, .15), rgba(5, 18, 40, .55) 70%), linear-gradient(0deg, rgba(5, 18, 40, .88), transparent 45%); }
.si-particles { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; }
.si-scan { position: absolute; left: 0; right: 0; height: 140px; top: -140px; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(108, 180, 238, .1) 70%, rgba(108, 180, 238, .55) 98%, transparent); animation: si-scan 5.5s cubic-bezier(.45, .05, .55, .95) infinite; }
.si-scan::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: rgba(170, 215, 250, .9); box-shadow: 0 0 18px 4px rgba(108, 180, 238, .6); }
.si-cards { position: absolute; inset: 0; }
.si-card {
  position: absolute; width: 290px; padding: 14px 16px; border-radius: 14px; color: #fff; font-size: 13px;
  background: rgba(12, 32, 64, .42); border: 1px solid rgba(160, 205, 245, .28); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .12);
  opacity: 0; transform: translateY(18px) scale(.97); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
}
.si-card.show { opacity: 1; transform: none; }
.si-c1 { top: 11%; left: 8%; } .si-c2 { top: 31%; right: 7%; } .si-c3 { top: 53%; left: 12%; }
.si-row { display: flex; align-items: center; gap: 10px; }
.si-between { justify-content: space-between; }
.si-mt { margin-top: 6px; }
.si-k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #a9c6e8; font-weight: 600; }
.si-v { font-weight: 600; font-size: 13px; color: #fff; }
.si-sub { color: #c3d7ee; font-size: 12px; margin-top: 2px; }
.si-bar { height: 5px; background: rgba(255, 255, 255, .14); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.si-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6cb4ee, #fff); border-radius: inherit; transition: width .25s linear; }
.si-pill { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.si-pill.crit { background: rgba(242, 85, 90, .22); color: #ffb4b6; border: 1px solid rgba(242, 85, 90, .5); }
.si-pill.kev { background: #c4302b; color: #fff; }
.si-pill.ok { background: rgba(44, 197, 176, .2); color: #8ff0e1; border: 1px solid rgba(44, 197, 176, .45); }
.si-pulse { width: 10px; height: 10px; border-radius: 50%; background: #f2555a; animation: si-ping 1.6s ease-out infinite; flex: none; }
.si-tick { width: 22px; height: 22px; border-radius: 50%; background: rgba(44, 197, 176, .25); display: grid; place-items: center; flex: none; }
.si-tick svg { width: 13px; height: 13px; stroke: #8ff0e1; stroke-width: 3; fill: none; stroke-dasharray: 20; stroke-dashoffset: 20; }
.si-card.show .si-tick svg { animation: si-draw .5s .3s ease-out forwards; }
.si-caption { position: absolute; left: 48px; right: 48px; bottom: 40px; color: #fff; }
.si-caption h2 { margin: 0; font-size: 26px; line-height: 34px; letter-spacing: -.02em; font-weight: 650; max-width: 22ch; color: #fff; }
.si-caption p { margin: 8px 0 0; color: #c3d7ee; max-width: 48ch; }
.si-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.si-sources span { font-size: 12px; font-weight: 600; color: #dbe9f8; padding: 4px 10px; border-radius: 99px; border: 1px solid rgba(160, 205, 245, .3); background: rgba(12, 32, 64, .35); }

@keyframes si-rise { to { opacity: 1; transform: none; } }
@keyframes si-spin-in { from { transform: rotate(-180deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes si-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes si-draw { to { stroke-dashoffset: 0; } }
@keyframes si-drift { to { transform: translate(120px, 90px); } }
@keyframes si-sheen { to { transform: translateX(120%); } }
@keyframes si-rot { to { transform: rotate(360deg); } }
@keyframes si-kenburns { from { transform: scale(1.04); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
@keyframes si-scan { 0% { top: -140px; } 100% { top: 100%; } }
@keyframes si-ping { 0% { box-shadow: 0 0 0 0 rgba(242, 85, 90, .7); } 100% { box-shadow: 0 0 0 12px rgba(242, 85, 90, 0); } }
@keyframes si-step-in { from { opacity: 0; transform: translateX(36px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes si-step-out { to { opacity: 0; transform: translateX(-28px); filter: blur(4px); } }
@keyframes si-step-in-back { from { opacity: 0; transform: translateX(-36px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes si-step-out-back { to { opacity: 0; transform: translateX(28px); filter: blur(4px); } }
@keyframes si-digit-in { from { opacity: 0; transform: translateY(10px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes si-tick { 50% { transform: scale(1.08); } }
@keyframes si-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }

@media (prefers-reduced-motion: reduce) {
  .signin *, .signin *::before, .signin *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .si-scan, .si-particles { display: none; }
}
@media (max-width: 960px) { .signin { grid-template-columns: 1fr; } .si-scene { display: none; } }
