/* ==========================================================================
   Sakina v2 — design system aligned with Hasm (حَسم) and the Saudi DGA Platforms Code
   Layout: collapsible side rail (inline-start) + sticky top bar + 12-col content grid.
   Fonts: Readex Pro (display, headings — never numbers) · IBM Plex Sans Arabic (body + tabular
   digits) · IBM Plex Mono (codes). All self-hosted. Colours: OKLCH-tuned green-grey neutrals,
   one accent, semantic status colours, colour-blind-safe chart series.
   ========================================================================== */

@font-face { font-family: "Plex Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Plex Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Plex Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Plex Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Plex Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212; }
@font-face { font-family: "Plex Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212; }
@font-face { font-family: "Plex Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212; }
@font-face { font-family: "Plex Arabic"; src: url("/static/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2212; }
@font-face { font-family: "Readex"; src: url("/static/fonts/readex-pro-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Readex"; src: url("/static/fonts/readex-pro-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Readex"; src: url("/static/fonts/readex-pro-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: "Readex"; src: url("/static/fonts/readex-pro-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: "Plex Mono"; src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/static/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  /* neutrals (green-grey, shared with Hasm) */
  --paper: #F1F4F2; --surface: #FFFFFF; --raise: #F8FAF9; --sunk: #E9EEEB; --hover: #EEF2EF;
  --ink: #15211C; --ink-2: #34433D; --muted: #5E6E67; --faint: #8A9892;
  --line: #D9E0DC; --line-2: #E6EBE8;
  /* brand */
  --acc: #0A7553; --acc-2: #0B8A61; --acc-soft: #DDEFE6; --acc-ink: #FFFFFF; --acc-line: #A9D6C1;
  --gold: #B7860B; --gold-soft: #F6EDD3;
  /* status (DGA-aligned) */
  --ok: #067647; --ok-soft: #DCF3E6; --warn: #B54708; --warn-soft: #FCEBD9; --bad: #C4271B; --bad-soft: #FBE3E0; --info: #1D5FBF; --info-soft: #E1ECFB;
  /* chart series: teal, gold, blue, lavender, grey (colour-blind-safe order) */
  --s1: #0A7553; --s2: #C9961A; --s3: #3E6FB0; --s4: #8E5BA8; --s5: #A5B1AB; --grid: #E8EDEA; --axis: #C5CEC9;
  /* type */
  --f-body: "Plex Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --f-display: "Readex", "Plex Arabic", system-ui, sans-serif;
  --f-mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  /* shape & depth */
  --r-xs: 4px; --r-s: 8px; --r-m: 12px; --r-l: 16px;
  --sh-1: 0 1px 2px rgba(16, 33, 26, .05);
  --sh-pop: 0 12px 32px rgba(16, 33, 26, .14), 0 2px 6px rgba(16, 33, 26, .06);
  --rail: 264px; --rail-min: 76px; --top-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1); --t-fast: 140ms; --t-mid: 220ms;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1311; --surface: #141C19; --raise: #18211D; --sunk: #0A0F0D; --hover: #1C2622;
    --ink: #E3EAE6; --ink-2: #C0CBC5; --muted: #8C9A93; --faint: #6B7973;
    --line: #26322D; --line-2: #1F2925;
    --acc: #3DBB8C; --acc-2: #55CB9E; --acc-soft: #12352A; --acc-ink: #04150F; --acc-line: #23644B;
    --gold: #E3B54A; --gold-soft: #3A2E12;
    --ok: #4CCB8B; --ok-soft: #123322; --warn: #F0A050; --warn-soft: #3B2512; --bad: #F2857A; --bad-soft: #3F1A17; --info: #7EAEF5; --info-soft: #172843;
    --s1: #3DBB8C; --s2: #E3B54A; --s3: #7DA3E0; --s4: #C092D6; --s5: #5F6C66; --grid: #202B27; --axis: #34423C;
    --sh-1: none; --sh-pop: 0 16px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D1311; --surface: #141C19; --raise: #18211D; --sunk: #0A0F0D; --hover: #1C2622;
  --ink: #E3EAE6; --ink-2: #C0CBC5; --muted: #8C9A93; --faint: #6B7973;
  --line: #26322D; --line-2: #1F2925;
  --acc: #3DBB8C; --acc-2: #55CB9E; --acc-soft: #12352A; --acc-ink: #04150F; --acc-line: #23644B;
  --gold: #E3B54A; --gold-soft: #3A2E12;
  --ok: #4CCB8B; --ok-soft: #123322; --warn: #F0A050; --warn-soft: #3B2512; --bad: #F2857A; --bad-soft: #3F1A17; --info: #7EAEF5; --info-soft: #172843;
  --s1: #3DBB8C; --s2: #E3B54A; --s3: #7DA3E0; --s4: #C092D6; --s5: #5F6C66; --grid: #202B27; --axis: #34423C;
  --sh-1: none; --sh-pop: 0 16px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font: 400 15px/1.7 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; line-height: 1.35; margin: 0; text-wrap: balance; }
code, .mono { font-family: var(--f-mono); font-size: .88em; }
::selection { background: var(--acc-soft); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: var(--r-xs); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--acc); color: var(--acc-ink); padding: 8px 14px; border-radius: var(--r-s); }
.skip:focus { top: 12px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] svg.i.flip { transform: scaleX(-1); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns var(--t-mid) var(--ease); }
.shell.collapsed { grid-template-columns: var(--rail-min) minmax(0, 1fr); }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; background: var(--surface); border-inline-end: 1px solid var(--line); overflow: hidden; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; min-height: 52px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--acc); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; }
.brand b { font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; display: block; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.35; white-space: nowrap; }
.nav-group { font-size: 11.5px; color: var(--faint); padding: 14px 12px 4px; letter-spacing: 0; white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-s); color: var(--ink-2); font-weight: 500; white-space: nowrap; position: relative; text-decoration: none; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--acc-soft); color: var(--acc); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acc); }
.nav a .kbd { margin-inline-start: auto; opacity: 0; transition: opacity var(--t-fast); }
.nav a:hover .kbd, .nav a:focus-visible .kbd { opacity: 1; }
.rail-foot { margin-top: auto; display: grid; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-s); min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--acc-soft); color: var(--acc); border: 1px solid var(--acc-line); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 14px; flex: none; }
.me div { min-width: 0; }
.me b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collapsed .brand > div, .collapsed .nav a span, .collapsed .nav a .kbd, .collapsed .nav-group, .collapsed .me div, .collapsed .rail-foot .lbl { display: none; }
.collapsed .nav a { justify-content: center; padding-inline: 0; }
.collapsed .brand { justify-content: center; padding-inline: 0; }
.collapsed .me { justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 25; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding-inline: 28px; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--muted); }
.crumbs b { color: var(--ink); font-family: var(--f-display); font-weight: 500; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--muted); }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.search-btn { display: inline-flex; align-items: center; gap: 10px; min-width: 260px; height: 38px; padding-inline: 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color var(--t-fast); }
.search-btn:hover { border-color: var(--faint); }
.search-btn .kbd { margin-inline-start: auto; }
.kbd { font-family: var(--f-mono); font-size: 11px; line-height: 1; padding: 4px 6px; border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--raise); color: var(--muted); direction: ltr; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: var(--r-s); border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--hover); border-color: var(--line); }
.content { padding: 24px 28px 64px; display: grid; gap: 22px; width: 100%; max-width: 1480px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.page-head .tools { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.section-title h2 { font-size: 18px; font-weight: 500; }
.section-title span { color: var(--muted); font-size: 13px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.primary:hover { background: var(--acc-2); border-color: var(--acc-2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.field > span { font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
input, select, textarea { height: 38px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 12px; color: var(--ink); min-width: 0; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
textarea { height: auto; padding: 10px 12px; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--acc); padding: 0; }
input[type="search"] { padding-inline-start: 34px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; inset-inline-start: 10px; top: 10px; color: var(--muted); pointer-events: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line-2); }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
.seg.status button[aria-pressed="true"][data-v="met"] { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.seg.status button[aria-pressed="true"][data-v="not_met"] { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--acc-line); background: var(--acc-soft); color: var(--acc); font-size: 13px; font-weight: 500; cursor: pointer; }
.chip svg { width: 14px; height: 14px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px; box-shadow: var(--sh-1); min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.card-h { display: flex; align-items: flex-start; gap: 10px; }
.card-h > div { min-width: 0; flex: 1; }
.card-h h3 { font-size: 15.5px; font-weight: 500; }
.card-h p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.card-h .act { display: flex; gap: 4px; flex: none; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card.flush > .card-h { padding: 16px 20px 12px; }

/* KPI tiles */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px 12px; display: grid; gap: 2px; box-shadow: var(--sh-1); min-width: 0; overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-height: 24px; }
.kpi-top .info { margin-inline-start: auto; width: 24px; height: 24px; border-radius: 6px; border: 0; background: transparent; color: var(--faint); cursor: pointer; display: grid; place-items: center; }
.kpi-top .info:hover { background: var(--hover); color: var(--ink); }
.kpi-top .info svg { width: 15px; height: 15px; }
.kpi-mid { display: flex; align-items: flex-end; gap: 10px; }
.kpi .v { font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .v small { font-size: 13px; font-weight: 400; color: var(--muted); margin-inline-start: 4px; letter-spacing: 0; }
.kpi .spark { margin-inline-start: auto; width: 96px; height: 34px; flex: none; }
.kpi .spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.kpi-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; direction: ltr; }
.delta.good { color: var(--ok); background: var(--ok-soft); }
.delta.bad { color: var(--bad); background: var(--bad-soft); }
.delta.flat { color: var(--muted); background: var(--sunk); }
.tbar { position: relative; height: 4px; border-radius: 2px; background: var(--grid); margin-top: 8px; }
.tbar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 2px; }
.tbar u { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--ink-2); }
.kpi.st-ok .tbar i { background: var(--ok); } .kpi.st-warn .tbar i { background: var(--warn); } .kpi.st-bad .tbar i { background: var(--bad); } .kpi .tbar i { background: var(--s1); }
.kpi .flag { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 100%; height: 3px; }
.kpi.st-ok .flag { background: var(--ok); } .kpi.st-warn .flag { background: var(--warn); } .kpi.st-bad .flag { background: var(--bad); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid var(--line); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.pill.info { color: var(--acc); background: var(--acc-soft); border-color: transparent; }
.pill.mute { color: var(--muted); background: var(--sunk); border-color: transparent; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-m); background: var(--info-soft); color: var(--ink); font-size: 13.5px; border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.banner svg { color: var(--info); margin-top: 2px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow: auto; max-height: 620px; border-top: 1px solid var(--line-2); }
.card:not(.flush) .tbl-wrap { border: 1px solid var(--line-2); border-radius: var(--r-m); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--raise); text-align: start; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 0; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl th button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 4px; width: 100%; padding: 10px 14px; cursor: pointer; }
.tbl th button:hover { color: var(--ink); }
.tbl th button:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.tbl th[aria-sort="ascending"] button::after { content: "↑"; font-size: 11px; color: var(--acc); }
.tbl th[aria-sort="descending"] button::after { content: "↓"; font-size: 11px; color: var(--acc); }
.tbl th.n, .tbl td.n { text-align: end; }
.tbl th.n button { justify-content: flex-end; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.ref td { background: var(--raise); color: var(--muted); font-size: 12.5px; }
.tbl td.bad { color: var(--bad); font-weight: 600; } .tbl td.ok { color: var(--ok); }
.tbl .mini { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--grid); vertical-align: middle; margin-inline-end: 8px; overflow: hidden; }
.tbl .mini i { display: block; height: 100%; background: var(--s1); border-radius: 3px; }
.tbl .q { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.tbl-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 16px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line-2); }
.density-compact .tbl td { padding-block: 6px; } .density-compact .tbl th button { padding-block: 7px; }

/* ---------- charts ---------- */
.chart { position: relative; min-height: 220px; }
.chart.short { min-height: 160px; }
.chart svg { display: block; width: 100%; height: auto; direction: ltr; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.chart .grid-l { stroke: var(--grid); }
.chart .ref { stroke: var(--ink-2); stroke-dasharray: 4 3; opacity: .55; }
.tip { position: absolute; pointer-events: none; z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--sh-pop); padding: 8px 10px; font-size: 12.5px; white-space: nowrap; display: none; min-width: 120px; }
.tip .t { color: var(--muted); margin-bottom: 4px; font-size: 12px; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 42%) 1fr 74px; gap: 10px; align-items: center; font-size: 12.5px; }
.hbar .lb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar .tr { height: 10px; background: var(--grid); border-radius: 5px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; border-radius: 5px; }
.hbar .vl { font-variant-numeric: tabular-nums; text-align: end; color: var(--ink-2); }
.funnel { display: grid; gap: 8px; }
.fstep { display: grid; grid-template-columns: 128px 1fr; gap: 10px; align-items: center; font-size: 13px; }
.fstep small { display: block; color: var(--muted); font-size: 11.5px; }
.fstep .bar { height: 30px; border-radius: var(--r-s); background: var(--grid); position: relative; overflow: hidden; }
.fstep .bar i { display: block; height: 100%; border-radius: var(--r-s); }
.fstep .bar b { position: absolute; inset-block: 0; inset-inline-start: 10px; display: flex; align-items: center; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.pyr { display: grid; gap: 6px; font-size: 12px; }
.pyr .r { display: grid; grid-template-columns: 1fr 58px 1fr; gap: 8px; align-items: center; }
.pyr .m, .pyr .f { height: 14px; display: flex; }
.pyr .m { justify-content: flex-start; } .pyr .f { justify-content: flex-end; }
.pyr i { height: 100%; border-radius: 4px; }
.pyr .b { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.bullet { display: grid; gap: 6px; }
.bullet .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.bullet .row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.bullet .trk { position: relative; height: 8px; border-radius: 4px; background: var(--grid); }
.bullet .trk i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 4px; }
.bullet .trk u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .65; }
.bullet small { color: var(--muted); font-size: 12px; line-height: 1.55; }
.matrix { display: grid; gap: 3px; font-size: 11.5px; }
.matrix .cell { height: 34px; border-radius: 6px; display: grid; place-items: center; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.matrix .hd { color: var(--muted); text-align: center; align-self: end; line-height: 1.3; }
.matrix .rh { color: var(--muted); align-self: center; text-align: end; padding-inline-end: 4px; }

/* ---------- alerts ---------- */
.alerts { display: grid; gap: 2px; max-height: 470px; overflow: auto; margin-inline: -8px; }
.alert { display: grid; grid-template-columns: 10px 1fr auto; gap: 2px 10px; align-items: start; padding: 10px 8px; border-radius: var(--r-s); font-size: 13px; cursor: pointer; }
.alert:hover { background: var(--hover); }
.alert .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--warn); }
.alert.critical .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); } .alert.medium .dot { background: var(--faint); }
.alert b { font-weight: 600; }
.alert small { grid-column: 2 / -1; color: var(--muted); font-size: 12px; }
.alert .v { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; direction: ltr; }

/* ---------- readiness ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.lane { background: var(--sunk); border-radius: var(--r-l); padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 200px; border: 1px solid var(--line-2); }
.lane-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; font-weight: 600; font-size: 13.5px; }
.lane-h span { margin-inline-start: auto; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; display: grid; gap: 8px; cursor: pointer; transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); text-align: start; }
.tile:hover { border-color: var(--acc-line); box-shadow: var(--sh-pop); transform: translateY(-1px); }
.tile b { font-size: 13.5px; font-weight: 600; }
.tile small { color: var(--muted); font-size: 12px; }
.tile .row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.ring { --p: 0; --c: var(--s1); width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--grid) 0); display: grid; place-items: center; flex: none; }
.ring::after { content: attr(data-label); width: 36px; height: 36px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.ring.lg { width: 76px; height: 76px; }
.ring.lg::after { width: 62px; height: 62px; font-size: 15px; }
.progress { height: 6px; background: var(--grid); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--s1); border-radius: 3px; }
.crit-domain { display: grid; gap: 8px; }
.crit-domain h4 { font-size: 13.5px; font-weight: 500; color: var(--muted); margin: 8px 0 0; display: flex; gap: 8px; align-items: center; }
.crit-domain h4 span { margin-inline-start: auto; font-family: var(--f-body); font-variant-numeric: tabular-nums; }
.crit { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); transition: border-color var(--t-fast); }
.crit:hover { border-color: var(--faint); }
.crit code { font-size: 11.5px; color: var(--muted); }
.crit .lbl { font-weight: 500; font-size: 14px; }
.crit .ev { grid-column: 2 / -1; }
.crit .ev input { width: 100%; height: 34px; font-size: 13px; background: var(--raise); }
.crit .meta { grid-column: 2 / -1; font-size: 11.5px; color: var(--muted); }
.timeline { display: grid; gap: 14px; position: relative; padding-inline-start: 18px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline .ev { position: relative; font-size: 13.5px; }
.timeline .ev::before { content: ""; position: absolute; inset-inline-start: -18px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--acc); }
.timeline .ev small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.15fr); background: var(--paper); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 88px); gap: 28px; }
.auth-form form { width: min(400px, 100%); display: grid; gap: 16px; }
.auth-form h1 { font-size: 28px; font-weight: 700; }
.auth-form .lead { color: var(--muted); margin: 0; }
.auth-form .err { color: var(--bad); font-size: 13.5px; min-height: 1.3em; }
.auth-form .btn { height: 44px; font-size: 15px; }
.auth-art { position: relative; overflow: hidden; margin: 14px; border-radius: 24px; background: radial-gradient(120% 90% at 85% 0%, #128a62 0%, #0A7553 35%, #064a35 100%); color: #EAF5EF; padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.auth-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; pointer-events: none; }
.auth-art > * { position: relative; }
.auth-art h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 700; line-height: 1.3; max-width: 17ch; }
.auth-art p { max-width: 48ch; opacity: .85; margin: 12px 0 0; }
.auth-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.auth-stats div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r-m); padding: 12px 14px; backdrop-filter: blur(6px); }
.auth-stats b { display: block; font-size: 15px; font-weight: 600; }
.auth-stats span { font-size: 12.5px; opacity: .8; }
.auth .brand b { color: var(--ink); }
.qr { width: 184px; height: 184px; background: #fff; border-radius: var(--r-m); padding: 8px; border: 1px solid var(--line); }
.secret { font-family: var(--f-mono); font-size: 12.5px; direction: ltr; background: var(--sunk); padding: 8px 10px; border-radius: var(--r-s); word-break: break-all; user-select: all; }
.otp { letter-spacing: .5em; font-family: var(--f-mono); font-size: 20px; text-align: center; height: 50px; direction: ltr; }

/* ---------- dialogs: modal, drawer, command palette ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(6, 14, 11, .45); backdrop-filter: blur(2px); }
.modal { width: min(560px, calc(100vw - 32px)); margin: 10vh auto auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-pop); }
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; inset-inline-start: auto; margin: 0; height: 100vh; width: min(560px, 100vw); background: var(--surface); border-inline-start: 1px solid var(--line); box-shadow: var(--sh-pop); display: flex; flex-direction: column; }
.drawer[open] { display: flex; }
.dlg-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.dlg-h h2 { font-size: 17px; font-weight: 500; }
.dlg-h p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.dlg-h .x { margin-inline-start: auto; }
.dlg-b { padding: 18px 20px; display: grid; gap: 14px; overflow: auto; flex: 1; align-content: start; }
.dlg-f { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--raise); border-radius: 0 0 var(--r-l) var(--r-l); flex-wrap: wrap; }
.drawer .dlg-f { border-radius: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.form-grid .wide { grid-column: 1 / -1; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.palette { width: min(620px, calc(100vw - 32px)); margin: 12vh auto auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-pop); overflow: hidden; }
.palette .pi { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line-2); }
.palette .pi input { border: 0; height: 54px; flex: 1; font-size: 16px; background: transparent; box-shadow: none; padding: 0; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.palette li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-s); cursor: pointer; font-size: 14px; }
.palette li small { color: var(--muted); margin-inline-start: auto; font-size: 12px; }
.palette li[aria-selected="true"] { background: var(--acc-soft); color: var(--acc); }
.palette .grp { padding: 10px 12px 4px; font-size: 11.5px; color: var(--faint); cursor: default; }
.palette .grp:hover { background: none; }
.palette .hint { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); background: var(--raise); }
#toasts { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; }
[dir="rtl"] #toasts { transform: translateX(50%); }
.toast { display: flex; align-items: center; gap: 12px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-m); font-size: 13.5px; max-width: min(520px, calc(100vw - 32px)); box-shadow: var(--sh-pop); }
.toast.bad { background: var(--bad); color: #fff; }
.toast button { background: transparent; border: 0; color: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 13.5px; display: grid; justify-items: center; gap: 8px; }
.empty svg { width: 34px; height: 34px; color: var(--faint); }
.skel { background: linear-gradient(90deg, var(--grid) 0%, var(--raise) 50%, var(--grid) 100%); background-size: 200% 100%; border-radius: var(--r-m); }
.skel.kpi-s { height: 118px; } .skel.card-s { height: 300px; }
.err { color: var(--bad); font-size: 13px; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .skel { animation: shimmer 1.3s linear infinite; }
  @keyframes shimmer { to { background-position: -200% 0; } }
  .rise { animation: rise var(--t-mid) var(--ease) both; }
  .rise:nth-child(2) { animation-delay: 30ms; } .rise:nth-child(3) { animation-delay: 60ms; } .rise:nth-child(4) { animation-delay: 90ms; }
  .rise:nth-child(5) { animation-delay: 120ms; } .rise:nth-child(6) { animation-delay: 150ms; } .rise:nth-child(n+7) { animation-delay: 180ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
  .hbar .tr i, .fstep .bar i, .progress i, .tbar i, .bullet .trk i { transition: width .6s var(--ease); }
  dialog[open], dialog[open]::backdrop { transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease), overlay var(--t-mid) allow-discrete, display var(--t-mid) allow-discrete; }
  @starting-style { dialog[open] { opacity: 0; } dialog[open].modal, dialog[open].palette { transform: translateY(8px) scale(.98); } dialog[open]::backdrop { opacity: 0; } }
  @starting-style { [dir="rtl"] dialog[open].drawer { transform: translateX(-40px); } [dir="ltr"] dialog[open].drawer { transform: translateX(40px); } }
  .toast { animation: toastIn var(--t-mid) var(--ease); }
  @keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
  ::view-transition-old(content), ::view-transition-new(content) { animation-duration: 180ms; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.content { view-transition-name: content; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .c3, .c4 { grid-column: span 6; } .c5, .c7, .c8 { grid-column: span 12; } }
@media (max-width: 960px) {
  .c6, .c4, .c3 { grid-column: 1 / -1; }
  .search-btn { min-width: 0; } .search-btn .lbl, .search-btn .kbd { display: none; }
  .board { grid-template-columns: repeat(4, minmax(240px, 80vw)); }
}
@media (max-width: 860px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .rail { position: fixed; inset-block: 0; inset-inline-start: 0; width: 282px; transform: translateX(110%); transition: transform var(--t-mid) var(--ease); box-shadow: var(--sh-pop); }
  [dir="ltr"] .rail { transform: translateX(-110%); }
  .rail.open { transform: none !important; }
  .collapsed .brand > div, .collapsed .nav a span, .collapsed .nav-group, .collapsed .me div { display: revert; }
  .top, .content { padding-inline: 16px; }
  .page-head h1 { font-size: 22px; }
  .kpis { gap: 10px; }
  .kpi .v { font-size: 24px; } .kpi .spark { width: 64px; }
  .form-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 260px; order: -1; }
  .auth-stats { grid-template-columns: 1fr 1fr 1fr; }
  .hbar { grid-template-columns: minmax(90px, 40%) 1fr 64px; }
  .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 10px; }
}
@media (min-width: 861px) { .menu-only { display: none !important; } }

/* ---------- print: board report ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 11px; }
  .rail, .top, .tools, .card-h .act, .kpi-top .info, #toasts, .no-print { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
  .grid { gap: 10px; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* ---- v2.1: smart pickers and reference lists ---- */
.combo { display: grid; gap: 6px; }
.combo-in { position: relative; }
.combo-in > svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.combo-in input { width: 100%; padding-inline-start: 34px; padding-inline-end: 38px; }
.combo-x { position: absolute; inset-inline-end: 2px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; }
.combo-x svg { width: 14px; height: 14px; }
.combo-list { list-style: none; margin: 0; padding: 4px; max-height: 288px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); box-shadow: var(--sh-pop); }
.combo-list:not([hidden]) { animation: combo-in var(--t-fast) var(--ease); }
@keyframes combo-in { from { opacity: 0; transform: translateY(-4px); } }
.combo-list li[role="option"] { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: var(--r-s); cursor: pointer; font-size: 14px; }
.combo-list li small { color: var(--muted); font-size: 12px; }
.combo-list li em, .cap { margin-inline-start: auto; font-style: normal; font-size: 11px; color: var(--gold); background: var(--gold-soft); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.cap { margin-inline-start: 8px; }
.combo-list li[aria-selected="true"] { background: var(--acc-soft); color: var(--acc); }
.combo-list li[aria-selected="true"] small { color: inherit; opacity: .8; }
.combo-list .grp { padding: 9px 10px 3px; font-size: 11.5px; color: var(--faint); }
.combo-list .none { padding: 12px 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.derived { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: var(--r-s); background: var(--sunk); border: 1px dashed var(--line); color: var(--ink); font-size: 14px; }
.derived svg { width: 16px; height: 16px; color: var(--acc); flex: none; }
.derived small { margin-inline-start: auto; color: var(--muted); font-size: 11.5px; }
.warn-t { color: var(--warn) !important; }
.similar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--warn); }
.similar:empty { display: none; }
.similar .chip { height: 26px; font-size: 12.5px; border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.used { margin: 10px 0 4px; padding-inline-start: 20px; max-height: 240px; overflow: auto; line-height: 1.8; }
.nm { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.lists-geo { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 16px; align-items: start; }
.reg-pane { position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow: auto; }
.reg-list { display: grid; gap: 2px; padding: 0 8px 8px; }
.reg { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 1px; text-align: start; border: 0; background: transparent; padding: 8px 10px; border-radius: var(--r-s); cursor: pointer; color: var(--ink); transition: background var(--t-fast); }
.reg .code { grid-row: 1 / 3; align-self: center; font-family: var(--f-mono); font-size: 11px; color: var(--muted); direction: ltr; min-width: 40px; }
.reg b { font-weight: 600; font-size: 14px; }
.reg small { color: var(--muted); font-size: 12px; }
.reg:hover { background: var(--hover); }
.reg.on { background: var(--acc-soft); color: var(--acc); }
.reg.on small, .reg.on .code { color: inherit; opacity: .85; }
.reg.off { opacity: .55; }
.geo-main { display: grid; gap: 12px; min-width: 0; }
.geo-main .search-wrap { flex: 1 1 280px; }
.geo-main .search-wrap input { width: 100%; }
@media (max-width: 900px) {
  .lists-geo { grid-template-columns: 1fr; }
  .reg-pane { position: static; max-height: none; }
  .reg-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
/* no horizontal page scroll on phones: wide tables scroll inside their card */
.content > *, .card, .page-head > *, .page-head .tools > * { min-width: 0; max-width: 100%; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: none; }
@media (max-width: 640px) { .page-head .tools { margin-inline-start: 0; width: 100%; } .page-head .search-wrap { flex: 1 1 100%; } .page-head .search-wrap input { width: 100%; } }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- v2.2: activation-first dashboard ---- */
.kpi.click { cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.kpi.click:hover { border-color: var(--acc-line); box-shadow: var(--sh-pop); }
.kpi.click:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.kpi-more { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--acc); opacity: 0; transition: opacity var(--t-fast); margin-top: 2px; }
.kpi-more svg { width: 12px; height: 12px; }
.kpi.click:hover .kpi-more, .kpi.click:focus-visible .kpi-more { opacity: 1; }
@media (hover: none) { .kpi-more { opacity: 1; } }
.bad-t { color: var(--bad); font-weight: 500; }
.timeline { list-style: none; margin: 0; padding: 0 4px; display: grid; gap: 0; max-height: 420px; overflow: auto; }
.timeline li { position: relative; display: grid; grid-template-columns: 112px 1fr; column-gap: 14px; padding: 10px 0 10px; border-bottom: 1px dashed var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { grid-row: 1 / 3; font-size: 13px; font-weight: 600; color: var(--acc); font-variant-numeric: tabular-nums; display: grid; }
.timeline .when small { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.timeline b { font-size: 14px; font-weight: 600; }
.timeline li > small { color: var(--muted); font-size: 12px; }
.timeline li.late .when, .timeline li.late > small { color: var(--bad); }
.timeline li.none .when { color: var(--warn); }
.timeline li.done { grid-template-columns: 1fr; color: var(--ok); }
.nw { white-space: nowrap; }
.rail .brand b { font-size: 15px; line-height: 1.35; }
.auth-form .brand b { font-size: 17px; }
