/* ═══ Smartentre Admin ══════════════════════════════════════════════════════
   One stylesheet, no build step. Tokens follow the site (assets/css/site.css):
   Manrope, the cyan accent, the same ink and surfaces. Light and dark are
   both designed: the OS setting applies unless the theme toggle sets
   data-theme on <html>. No inline styles anywhere (CSP style-src 'self').
   ═════════════════════════════════════════════════════════════════════════ */

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  color-scheme: light;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #ECEFF3;
  --surface-3: #E2E6EC;
  --text: #0E1116;
  --text-2: #454C5A;
  --muted: #5F6676;
  --border: rgba(14, 17, 22, 0.10);
  --border-strong: rgba(14, 17, 22, 0.22);
  --accent: #4FD8E8;
  --accent-text: #0A7B90;
  --accent-soft: rgba(79, 216, 232, 0.16);
  --on-accent: #06070A;
  --focus: #0A7B90;
  --sidebar: #0A0C10;
  --sidebar-2: #13161C;
  --sidebar-text: #E8EBF0;
  --sidebar-muted: #9AA2B0;
  --shadow: 0 1px 2px rgba(14, 17, 22, 0.05), 0 8px 24px -16px rgba(14, 17, 22, 0.25);
  /* status (fixed, never themed): icon + label always accompany them */
  --good: #0CA30C;
  --warning: #FAB219;
  --serious: #EC835A;
  --critical: #D03B3B;
  --good-soft: rgba(12, 163, 12, 0.12);
  --warning-soft: rgba(250, 178, 25, 0.18);
  --serious-soft: rgba(236, 131, 90, 0.16);
  --critical-soft: rgba(208, 59, 59, 0.12);
  --info-soft: rgba(42, 120, 214, 0.12);
  --info: #2A78D6;
  --good-text: #087008;
  --critical-text: #A82A2A;
  /* charts: validated pair (light surface) */
  --series-1: #0891A8;
  --series-2: #EB6834;
  --grid: rgba(14, 17, 22, 0.08);
  --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0A0C10; --surface: #13161C; --surface-2: #1B1F27; --surface-3: #232833;
    --text: #E8EBF0; --text-2: #C2C8D3; --muted: #9AA2B0;
    --border: rgba(232, 235, 240, 0.10); --border-strong: rgba(232, 235, 240, 0.22);
    --accent-text: #4FD8E8; --accent-soft: rgba(79, 216, 232, 0.14); --focus: #4FD8E8;
    --sidebar: #07080B; --sidebar-2: #13161C;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -16px rgba(0, 0, 0, 0.7);
    --good-text: #4CC94C; --critical-text: #F07A7A; --info: #5598E7;
    --series-1: #18A3B8; --series-2: #D95926; --grid: rgba(232, 235, 240, 0.08);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0C10; --surface: #13161C; --surface-2: #1B1F27; --surface-3: #232833;
  --text: #E8EBF0; --text-2: #C2C8D3; --muted: #9AA2B0;
  --border: rgba(232, 235, 240, 0.10); --border-strong: rgba(232, 235, 240, 0.22);
  --accent-text: #4FD8E8; --accent-soft: rgba(79, 216, 232, 0.14); --focus: #4FD8E8;
  --sidebar: #07080B; --sidebar-2: #13161C;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -16px rgba(0, 0, 0, 0.7);
  --good-text: #4CC94C; --critical-text: #F07A7A; --info: #5598E7;
  --series-1: #18A3B8; --series-2: #D95926; --grid: rgba(232, 235, 240, 0.08);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 750; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: 0.95rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sprite { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.sub.warn { color: var(--critical-text); }
.hint { color: var(--muted); font-size: 0.82rem; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; }
.icon-lg { width: 36px; height: 36px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ── Shell ────────────────────────────────────────────────────────────── */
body.has-nav { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  background: var(--sidebar); color: var(--sidebar-text); padding: 18px 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 750; font-size: 1.02rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.brand-sub { color: var(--sidebar-muted); font-weight: 600; }
.sidebar > .brand { padding: 4px 8px 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { color: var(--sidebar-muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 14px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--sidebar-text); font-weight: 560; font-size: 0.93rem; }
.nav-link .icon { color: var(--sidebar-muted); }
.nav-link:hover { background: var(--sidebar-2); text-decoration: none; }
.nav-link.is-active { background: var(--sidebar-2); box-shadow: inset 3px 0 0 var(--accent); }
.nav-link.is-active .icon { color: var(--accent); }
.sidebar-foot { border-top: 1px solid rgba(232, 235, 240, 0.10); padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sidebar-2); color: var(--accent); font-weight: 750; flex: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-name { font-weight: 650; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-role { color: var(--sidebar-muted); font-size: 0.76rem; }
.sidebar-actions { display: flex; gap: 2px; }
.sidebar-actions form { margin: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; cursor: pointer; }
.sidebar .icon-btn { color: var(--sidebar-muted); }
.icon-btn:hover { background: var(--sidebar-2); color: var(--sidebar-text); }
.topbar { display: none; }
.main { padding: 28px 32px 56px; max-width: 1360px; width: 100%; display: flex; flex-direction: column; gap: 20px; }
body.no-nav .main { margin: 0 auto; }

@media (max-width: 960px) {
  body.has-nav { display: block; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; background: var(--sidebar); color: var(--sidebar-text); padding: 8px 12px; }
  .topbar .icon-btn { color: var(--sidebar-text); }
  .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 272px; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.4); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.45); }
  .main { padding: 18px 16px 48px; }
}

/* ── Page head, cards, layouts ────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.86rem; font-weight: 600; margin-bottom: 6px; }
.back .icon { width: 16px; height: 16px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.card > h2 { margin-bottom: 12px; }
.card-flush { padding: 0; overflow: hidden; }
.card-accent { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }
.card-accent .stack { margin-top: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head .muted { font-size: 0.84rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.layout-tool { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1180px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .layout-tool { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1040px) { .grid-2, .layout-aside { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ── Flash, badges, chips ─────────────────────────────────────────────── */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); font-weight: 550; }
.flash .icon { margin-top: 2px; }
.flash-success { border-color: var(--good); background: var(--good-soft); }
.flash-success .icon { color: var(--good-text); }
.flash-error { border-color: var(--critical); background: var(--critical-soft); }
.flash-error .icon { color: var(--critical-text); }
.flash-info { border-color: var(--info); background: var(--info-soft); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 0.78rem; font-weight: 650; background: var(--surface-2); color: var(--text); white-space: nowrap; vertical-align: middle; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge-good { background: var(--good-soft); } .badge-good .badge-dot { background: var(--good); }
.badge-warning { background: var(--warning-soft); } .badge-warning .badge-dot { background: var(--warning); }
.badge-serious { background: var(--serious-soft); } .badge-serious .badge-dot { background: var(--serious); }
.badge-critical { background: var(--critical-soft); } .badge-critical .badge-dot { background: var(--critical); }
.badge-accent { background: var(--accent-soft); } .badge-accent .badge-dot { background: var(--accent); }
.badge-info { background: var(--info-soft); } .badge-info .badge-dot { background: var(--info); }
.badge-muted { color: var(--muted); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); font-size: 0.76rem; font-weight: 600; color: var(--text-2); vertical-align: middle; }
.chip-soft { background: transparent; border: 1px solid var(--border-strong); }
.chip-danger { background: var(--critical-soft); color: var(--critical-text); }
.enroll { margin-right: 4px; }

/* ── Buttons & forms ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: 0.9rem; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--text); background: var(--surface-2); }
.btn:hover { text-decoration: none; background: var(--surface-3); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: #3cc9da; }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--critical); color: #fff; }
.btn-danger:hover { background: #b52f2f; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 0.84rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
form.is-busy button[type="submit"] { opacity: 0.7; cursor: progress; }
.btn .spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form { display: flex; flex-direction: column; gap: 14px; }
.form > h2 { margin: 6px 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid, .form-grid-4 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 0.8rem; font-weight: 650; color: var(--text-2); }
.req { color: var(--critical-text); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 38px; width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.inline-form select { width: auto; flex: 1; min-width: 180px; }
.field-inline { display: flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; }
.field-inline .label { white-space: nowrap; }
.field-inline select, .field-inline input { width: auto; max-width: 100%; min-width: 0; }
.field-inline.grow { flex: 1; min-width: 200px; }
.field-inline.grow input { width: 100%; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filters-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; max-width: 100%; }
.range input { width: auto; min-width: 0; flex: 1 1 130px; min-height: 32px; padding: 4px 8px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg-item { padding: 5px 12px; border-radius: 6px; color: var(--text-2); font-weight: 650; font-size: 0.84rem; white-space: nowrap; }
.seg-item:hover { text-decoration: none; color: var(--text); }
.seg-item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tabs-bar { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tab-link { padding: 8px 12px; color: var(--text-2); font-weight: 650; font-size: 0.88rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab-link:hover { text-decoration: none; color: var(--text); }
.tab-link.is-active { color: var(--text); border-bottom-color: var(--accent); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: 0.74rem; text-align: center; color: var(--muted); }

.tabs .tab-list { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tabs .tab { border: 0; background: transparent; font: inherit; font-weight: 700; padding: 8px 12px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; }
.tabs .tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: flex; flex-direction: column; gap: 14px; }
.tabs:not(.is-ready) .tab-list { display: none; }
.tabs:not(.is-ready) .tab-panel + .tab-panel { border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 14px; }
.tabs.is-ready .tab-panel[hidden] { display: none; }

/* ── KPI ─────────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.kpi-grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-height: 128px; overflow: hidden; }
.kpi-label { color: var(--text-2); font-size: 0.84rem; font-weight: 650; }
.kpi-value { font-size: 1.9rem; font-weight: 750; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.15; }
.kpi-value-sm { font-size: 1.2rem; margin-top: 10px; }
.kpi-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-top: 8px; }
.kpi.has-spark .kpi-foot { max-width: calc(100% - 100px); }
.kpi-sub { color: var(--muted); font-size: 0.8rem; }
.delta { font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.delta-good { color: var(--good-text); }
.delta-bad { color: var(--critical-text); }
.delta-flat { color: var(--muted); }
.viz-spark { position: absolute; right: 14px; bottom: 14px; width: 96px; height: 28px; overflow: visible; }
.viz-spark-line { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; opacity: 0.6; }
meter.budget { width: 100%; height: 8px; margin-top: 12px; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th { text-align: left; font-size: 0.76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-compact td, .table-compact th { padding: 7px 10px; }
.card .table th { background: transparent; }
.empty { color: var(--muted); padding: 10px 0; }
td.empty { text-align: center; padding: 28px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: var(--muted); min-height: 220px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; }
.pager-info { color: var(--muted); font-size: 0.86rem; }
.data-table { margin-top: 10px; }
.data-table summary { cursor: pointer; color: var(--muted); font-size: 0.84rem; font-weight: 650; }
.data-table .table { margin-top: 8px; }
.data-table table { display: block; max-height: 280px; overflow-y: auto; }

/* ── Charts ───────────────────────────────────────────────────────────── */
.chart-scroll { overflow-x: auto; }
.viz { display: block; max-width: 100%; height: auto; }
.viz-line { min-width: 440px; }
.viz-bars { min-width: 300px; }
.viz text { font-family: var(--font); }
.viz-grid { stroke: var(--grid); stroke-width: 1; }
.viz-axis { stroke: var(--border-strong); stroke-width: 1; }
.viz-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-label { fill: var(--text-2); font-size: 12px; font-weight: 600; }
.viz-value { fill: var(--text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-line-1, .viz-line-2 { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line-1 { stroke: var(--series-1); }
.viz-line-2 { stroke: var(--series-2); }
.viz-area-1 { fill: var(--series-1); opacity: 0.10; }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-dot-1 { fill: var(--series-1); }
.viz-dot-2 { fill: var(--series-2); }
.viz-bar-1 { fill: var(--series-1); }
.viz-track { stroke: var(--grid); stroke-width: 1; }
.viz-hit { fill: transparent; }
.viz-cross { stroke: var(--border-strong); stroke-width: 1; opacity: 0; }
.viz-hdot { opacity: 0; }
.viz-col:hover .viz-cross, .viz-col:hover .viz-hdot { opacity: 1; }
.viz-bar-row:hover .viz-bar-1 { opacity: 0.85; }
.viz-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; white-space: pre-line; box-shadow: var(--shadow); max-width: 260px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; list-style: none; margin: -4px 0 8px; padding: 0; font-size: 0.82rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 3px; border-radius: 2px; }
.swatch-1 { background: var(--series-1); }
.swatch-2 { background: var(--series-2); }

/* ── Courses ──────────────────────────────────────────────────────────── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.course-card { display: flex; flex-direction: column; gap: 6px; }
.course-card-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.course-card h2 { font-size: 1.1rem; }
.course-card h2 a { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.stats dt { color: var(--muted); font-size: 0.76rem; font-weight: 600; }
.stats dd { margin: 2px 0 0; font-weight: 750; font-size: 1.05rem; }
.course-card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); font-size: 0.82rem; }
.locale { font-family: var(--mono); font-size: 0.74rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; border: 1px dashed var(--border-strong); color: var(--muted); }
.locale.is-on { border-style: solid; border-color: var(--good); color: var(--good-text); background: var(--good-soft); }
.outline { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.outline ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.task { margin-top: 6px; font-size: 0.86rem; color: var(--accent-text); font-weight: 600; }
.danger-zone { border-color: var(--critical-soft); }
.category-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ── Insights: drop-off and funnel ─────────────────────────────────────── */
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 14px; }
@media (max-width: 760px) { .stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.insights { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; }
.insights li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.table tr.is-hot td { background: var(--critical-soft); }
.table tr.paywall td { background: var(--warning-soft); color: var(--text-2); font-size: 0.8rem; font-weight: 700; text-align: center; padding: 5px; letter-spacing: 0.02em; }
.stall-cell { white-space: nowrap; }
.stall-cell meter { width: 90px; height: 8px; vertical-align: middle; }
.dropoff + .hint, .card > .hint { margin-top: 10px; }

/* ── Detail pages ─────────────────────────────────────────────────────── */
.meta { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 0.9rem; }
.meta dt { color: var(--muted); font-weight: 600; }
.meta dd { margin: 0; word-break: break-word; }
@media (max-width: 520px) { .meta { grid-template-columns: minmax(0, 1fr); gap: 2px; } .meta dd { margin-bottom: 8px; } }
.row-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.row-item:last-of-type { border-bottom: 0; }
.row-item form { margin: 0; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { padding-left: 14px; border-left: 2px solid var(--border-strong); font-size: 0.9rem; }
.quote { margin: 14px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); white-space: normal; }
.ai-score { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.score { display: inline-block; font-weight: 800; font-variant-numeric: tabular-nums; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); }
.score-4, .score-5 { background: var(--good-soft); color: var(--good-text); }
.score-1, .score-2 { background: var(--critical-soft); color: var(--critical-text); }
.needs { margin: 10px 0; padding-left: 20px; }
.draft { margin-top: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.draft-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--border); }
.draft-body { padding: 12px 14px; font-size: 0.92rem; }
.draft-subject { font-weight: 700; margin-bottom: 8px; }
.popover { position: relative; }
.popover > summary { list-style: none; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: min(360px, calc(100vw - 32px)); }
.issue { font-size: 0.84rem; }
.issue-fail { color: var(--critical-text); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; }
.check-ok .icon { color: var(--good-text); }
.check-warn .icon { color: var(--warning); }
.check-fail .icon { color: var(--critical-text); }
.link { font-weight: 650; font-size: 0.88rem; }
details summary.link { cursor: pointer; display: inline; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 0.8rem; margin: 6px 0 0; max-height: 420px; overflow: auto; }

/* ── AI ───────────────────────────────────────────────────────────────── */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.tool-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.tool-card.is-disabled { opacity: 0.55; }
.tool-card p { font-size: 0.88rem; }
.tool-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.tool-icon .icon { width: 22px; height: 22px; }
.result { min-height: 320px; }
.save-outline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.save-outline .grow { flex: 1 1 100%; }
.outline-result h3 { font-size: 1.2rem; }
.outline-result .lead { color: var(--text-2); margin: 4px 0 12px; }
.outline-result > ul { margin: 6px 0 14px; }
.prose { line-height: 1.65; }
.prose > * + * { margin-top: 0.8em; }
.prose h2, .prose h3, .prose h4, .prose h5 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: 0.25em; }
.prose blockquote { margin-left: 0; padding-left: 12px; border-left: 3px solid var(--accent); color: var(--text-2); }
.prose pre { background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); }
.seo-table td { min-width: 120px; }
.chat { display: flex; flex-direction: column; gap: 14px; }
.chat-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 0; text-align: center; color: var(--text-2); }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 760px; }
.suggestions form { margin: 0; }
@media (max-width: 640px) { .suggestions { grid-template-columns: minmax(0, 1fr); } }
.suggestion { width: 100%; text-align: left; font: inherit; font-size: 0.9rem; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.suggestion:hover { border-color: var(--accent); }
.messages { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; flex-direction: column; max-width: 860px; }
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-user .bubble { background: var(--accent-soft); border: 1px solid transparent; }
.bubble { padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.msg-meta { color: var(--muted); font-size: 0.74rem; margin-top: 4px; }
.composer { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--border); padding-top: 14px; }
.composer textarea { flex: 1; }
.history-item summary { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.history-item summary::-webkit-details-marker { display: none; }
.history-title { font-weight: 700; }
.history-body { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }

/* ── Auth & error pages ───────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 50%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-card .brand { color: var(--text); }
.auth-card .brand-sub { color: var(--muted); }
.auth-card h1 { font-size: 1.4rem; margin-top: 6px; }
.auth-foot { font-size: 0.84rem; }
.mfa-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 0.92rem; color: var(--text-2); }
.qr { margin: 10px 0 6px; display: inline-block; padding: 10px; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.qr img { display: block; width: 200px; height: 200px; }
.mfa-secret { display: block; margin-top: 6px; padding: 8px 10px; font-size: 0.95rem; letter-spacing: 0.06em; word-break: break-all; }
.code-input { font-size: 1.6rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.error-page { text-align: center; padding: 64px 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--accent-text); line-height: 1; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .sidebar, .topbar, .filters, .actions, form { display: none !important; } body.has-nav { display: block; } }
