/* ============================================================================
   OneGate Travel — design system of the internal admin console and the bank
   portal (spec §14.7, §14.8). The bank portal serves an identical copy of this
   file from /bank/css/style.css.

   It is the design's own system (shared/css/ui.css in the mock) carried over
   component by component, with three differences the consoles need:
     - no inline styles anywhere: the CSP is style-src 'self', so every size or
       colour the mock painted from markup is a class here (.w37, .p-AIR, …);
     - icons are inline SVG (.ic), not an icon font;
     - a dark theme: every colour is a token, redefined under [data-theme=dark].
   Fonts are self-hosted files the owner drops into /admin/fonts (and
   /bank/fonts); until they exist the system stack below is what renders.
   ============================================================================ */
@font-face { font-family: 'Quicksand'; src: url('../fonts/quicksand.woff2') format('woff2'); font-weight: 500 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Nunito Sans'; src: url('../fonts/nunito-sans.woff2') format('woff2'); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono.woff2') format('woff2'); font-weight: 400 500; font-style: normal; font-display: swap; }

:root {
  --navy: #0B2452; --navy-2: #1A3C78;
  --sky: #5BA4E8; --brand: #2E7BD6; --brand-hover: #2368BB;
  --sky-soft: #E6F1FC; --sky-softer: #F3F8FE;
  --sun: #FF9A3C; --sun-soft: #FFF1E0; --sun-ink: #6E3A00;
  --bg: #F4F8FC; --surface: #FFFFFF; --surface-2: #F8FAFD;
  --line: #E2EAF4; --line-strong: #C7D4E5;
  --ink: #0F2140; --ink-2: #3D4F6D; --muted: #64748E;
  --head: #0B2452;                         /* headings and figures: navy on light, near-white on dark */
  --pri: #0B2452; --pri-hover: #1A3C78; --on-pri: #FFFFFF;   /* the primary button and the selected tab */
  --ok: #0B7D60; --ok-soft: #DCF5EC;
  --warn: #A85400; --warn-soft: #FFEEDA;
  --bad: #C03535; --bad-soft: #FDE5E5; --bad-line: #F0C2C2;
  --info: #2368BB; --info-soft: #E6F1FC; --info-ink: #173A6B;
  --neutral-soft: #EDF2F8;
  --top-bg: rgba(244, 248, 252, .88);
  --scrim: rgba(11, 36, 82, .42);
  --tint: #FFFFFF;                         /* what a product colour is mixed into for its soft chip */
  --p-flight: #2E7BD6; --p-hotel: #7A63C8; --p-esim: #1596AB; --p-rail: #D0702A; --p-insurance: #C94C78;
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --shadow-1: 0 1px 2px rgba(11, 36, 82, .04), 0 6px 20px rgba(11, 36, 82, .05);
  --shadow-2: 0 24px 60px rgba(11, 36, 82, .2);
  --shadow-pri: 0 6px 16px rgba(11, 36, 82, .22);
  --side-w: 264px;
  --t-fast: 150ms; --t: 240ms;
  --sans: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --display: 'Quicksand', 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --code: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'Cascadia Code', Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sky-soft: #142B4F; --sky-softer: #13233F;
    --brand: #5BA4E8; --brand-hover: #A9CFF5;
    --sun-soft: #2E2110; --sun-ink: #FFD9A8;
    --bg: #081326; --surface: #0F1D36; --surface-2: #13233F;
    --line: #223556; --line-strong: #31486F;
    --ink: #E8EEF8; --ink-2: #B4C2D8; --muted: #8C9CB6;
    --head: #E8EEF8;
    --pri: #5BA4E8; --pri-hover: #7DB8EF; --on-pri: #081326;
    --ok: #4FD1A5; --ok-soft: #0E2A24;
    --warn: #FFB466; --warn-soft: #2E2110;
    --bad: #F58A8A; --bad-soft: #2E1517; --bad-line: #532528;
    --info: #A9CFF5; --info-soft: #142B4F; --info-ink: #CFE3F9;
    --neutral-soft: #1A2C4C;
    --top-bg: rgba(8, 19, 38, .88);
    --scrim: rgba(0, 0, 0, .6);
    --tint: #0F1D36;
    --p-flight: #6FB1F0; --p-hotel: #A795EA; --p-esim: #47C2D6; --p-rail: #F0A064; --p-insurance: #EE86AB;
    --shadow-1: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-2: 0 24px 60px rgba(0, 0, 0, .6);
    --shadow-pri: 0 6px 16px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --sky-soft: #142B4F; --sky-softer: #13233F;
  --brand: #5BA4E8; --brand-hover: #A9CFF5;
  --sun-soft: #2E2110; --sun-ink: #FFD9A8;
  --bg: #081326; --surface: #0F1D36; --surface-2: #13233F;
  --line: #223556; --line-strong: #31486F;
  --ink: #E8EEF8; --ink-2: #B4C2D8; --muted: #8C9CB6;
  --head: #E8EEF8;
  --pri: #5BA4E8; --pri-hover: #7DB8EF; --on-pri: #081326;
  --ok: #4FD1A5; --ok-soft: #0E2A24;
  --warn: #FFB466; --warn-soft: #2E2110;
  --bad: #F58A8A; --bad-soft: #2E1517; --bad-line: #532528;
  --info: #A9CFF5; --info-soft: #142B4F; --info-ink: #CFE3F9;
  --neutral-soft: #1A2C4C;
  --top-bg: rgba(8, 19, 38, .88);
  --scrim: rgba(0, 0, 0, .6);
  --tint: #0F1D36;
  --p-flight: #6FB1F0; --p-hotel: #A795EA; --p-esim: #47C2D6; --p-rail: #F0A064; --p-insurance: #EE86AB;
  --shadow-1: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-2: 0 24px 60px rgba(0, 0, 0, .6);
  --shadow-pri: 0 6px 16px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: var(--code); font-size: .88em; }
.ic { width: 18px; height: 18px; flex: none; display: block; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono.code-face { font-family: var(--code); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.offscreen { position: absolute; left: -9999px; top: 0; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: var(--r); z-index: 200; }
.skip:focus { left: 8px; }
.link { color: var(--brand-hover); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ── Shell ─────────────────────────────────────────── */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; }
.brand { display: grid; justify-items: center; gap: 10px; padding: 22px 18px 14px; text-align: center; }
.brand img { display: block; height: auto; background: #fff; border-radius: 12px; }
.app-chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 5px 14px; border-radius: 99px; background: var(--sky-soft); color: var(--head); font: 700 14px var(--display); }
.app-chip small { font: 400 12.5px var(--sans); color: var(--ink-2); }
.side nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-h { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 16px 12px 6px; }
.nav-i { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r); font-weight: 600; color: var(--ink-2); min-height: 40px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.nav-i .ic { color: var(--muted); width: 19px; height: 19px; transition: color var(--t-fast); }
.nav-i:hover { background: var(--sky-softer); color: var(--head); }
.nav-i[aria-current="page"], .nav-i.active { background: var(--sky-soft); color: var(--head); font-weight: 800; }
.nav-i[aria-current="page"] .ic, .nav-i.active .ic { color: var(--brand); }
.nav-i.open { color: var(--head); font-weight: 800; }
.nav-i.sub { padding-left: 26px; min-height: 36px; font-size: 13.5px; }
.nav-i.sub .ic { width: 17px; height: 17px; }
.nav-b { margin-left: auto; font: 700 12px var(--sans); font-style: normal; font-variant-numeric: tabular-nums; padding: 1px 8px; border-radius: 99px; background: var(--neutral-soft); color: var(--ink-2); }
.nav-i[aria-current="page"] .nav-b, .nav-i.active .nav-b { background: var(--surface); color: var(--brand-hover); }
.side-foot { padding: 10px 12px 14px; border-top: 1px solid var(--line); }
.side-foot .nav-i { font-size: 13.5px; font-weight: 600; color: var(--muted); min-height: 36px; padding: 7px 12px; cursor: default; }
.side-foot .nav-i:hover { background: none; color: var(--muted); }
.sdot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #17A57F; box-shadow: 0 0 0 3px var(--ok-soft); }
.sdot.warn { background: var(--sun); box-shadow: 0 0 0 3px var(--warn-soft); }
.sdot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.sdot.off { background: #9AA9BF; box-shadow: 0 0 0 3px var(--neutral-soft); }

.wrap { margin-left: var(--side-w); min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: 64px; background: var(--top-bg); backdrop-filter: blur(10px); display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-6); }
.search { flex: 1; max-width: 460px; position: relative; display: block; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); padding: 0 16px 0 42px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px var(--sky-soft); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.top-r form { margin: 0; display: flex; }
.pop-anchor { position: relative; }
.user { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 6px; margin-left: var(--s-2); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; }
.user b { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.user small { color: var(--muted); font-size: 12.5px; white-space: nowrap; display: block; }
.avatar { width: 34px; height: 34px; border-radius: 12px; background: var(--sky-soft); color: var(--head); display: grid; place-items: center; font: 700 12.5px var(--display); flex: none; }
.user .avatar { border-radius: 50%; background: var(--navy); color: #fff; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; border-radius: 16px; }
.avatar.xs { width: 24px; height: 24px; font-size: 11px; border-radius: 8px; }
.langsw { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; gap: 2px; }
.langsw a { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 9px; height: 32px; display: grid; place-items: center; border-radius: 99px; transition: background var(--t-fast), color var(--t-fast); }
.langsw a:hover { color: var(--head); }
.langsw a.on { background: var(--pri); color: var(--on-pri); }
.icon-btn.menu-btn { display: none; }
main { padding: 8px var(--s-6) 56px; flex: 1; max-width: 1520px; width: 100%; }
main:focus { outline: none; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); flex-wrap: wrap; }
.page-h h1 { font: 700 28px/1.2 var(--display); color: var(--head); letter-spacing: -.01em; text-wrap: balance; }
.page-h h1.with-avatar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-h p { color: var(--muted); margin-top: 4px; max-width: 80ch; }
.page-a { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.page-a form { margin: 0; display: flex; gap: var(--s-2); align-items: center; }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; margin-bottom: 8px; }
.crumb a { color: var(--brand-hover); font-weight: 600; }
.crumb a:hover { text-decoration: underline; }
.crumb .ic { width: 12px; height: 12px; }

/* ── Buttons ───────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--head); font-weight: 700; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast); }
.btn:hover { border-color: var(--sky); background: var(--sky-softer); }
.btn:active { transform: translateY(1px); }
.btn.pri { background: var(--pri); border-color: var(--pri); color: var(--on-pri); box-shadow: var(--shadow-pri); }
.btn.pri:hover { background: var(--pri-hover); border-color: var(--pri-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-hover); padding: 0 8px; }
.btn.ghost:hover { background: var(--sky-soft); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.sm .ic { width: 16px; height: 16px; }
.btn.block { width: 100%; }
.btn.tall { height: 46px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.copied { background: var(--ok); border-color: var(--ok); color: #fff; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid transparent; background: transparent; border-radius: var(--r); color: var(--ink-2); position: relative; transition: background var(--t-fast); }
.icon-btn:hover { background: var(--sky-soft); color: var(--head); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn.copied { background: var(--ok); color: #fff; }
.top .icon-btn { background: var(--surface); border-color: var(--line); border-radius: 50%; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--sun); border: 2px solid var(--surface); }

/* ── Surfaces ──────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card.clip { overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 18px 20px 12px; flex-wrap: wrap; }
.card-h h2 { font: 700 17px/1.3 var(--display); color: var(--head); }
.card-h p { font-size: 13.5px; color: var(--muted); }
.card-h form { margin: 0; }
.card-b { padding: 20px; }
.card-h + .card-b { padding-top: 4px; }
.card-b.tight { padding-top: 8px; padding-bottom: 8px; }
.card-h + .card-b.tight { padding-top: 6px; }
.card-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.card-f .row { flex-wrap: nowrap; }
.card-f .pg-n { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.grid { display: grid; gap: var(--s-4); }
.g-kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); align-content: start; }
.row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.end { justify-content: flex-end; }
.sp { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.push { margin-left: auto; }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi-l { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.kpi-l .ic { width: 34px; height: 34px; padding: 8px; border-radius: 12px; background: var(--sky-soft); color: var(--brand); }
.kpi-v { font: 700 28px/1.2 var(--display); color: var(--head); font-variant-numeric: tabular-nums; margin-top: 12px; letter-spacing: -.01em; }
.kpi-v small { font: 600 15px var(--sans); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi-v.pos { color: var(--ok); }
.kpi-v.warn { color: var(--warn); }
.kpi-d { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--muted); min-height: 20px; flex-wrap: wrap; }
.kpi-more { margin-top: 6px; display: grid; gap: 1px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-more b { color: var(--ink-2); font-weight: 700; }
/* the first figure of every page is the headline: navy, with the ring from the logo */
.g-kpi .kpi:first-child { background: linear-gradient(135deg, #0B2452 0%, #1A3C78 100%); border-color: #0B2452; color: #fff; box-shadow: 0 12px 28px rgba(11, 36, 82, .25); }
.g-kpi .kpi:first-child::after { content: ''; position: absolute; right: -48px; top: -48px; width: 116px; height: 116px; border-radius: 50%; border: 9px solid rgba(91, 164, 232, .22); pointer-events: none; }
.g-kpi .kpi:first-child .kpi-l, .g-kpi .kpi:first-child .kpi-d, .g-kpi .kpi:first-child .kpi-v small, .g-kpi .kpi:first-child .kpi-more { color: #C9DCF5; }
.g-kpi .kpi:first-child .kpi-v, .g-kpi .kpi:first-child .kpi-more b { color: #fff; }
.g-kpi .kpi:first-child .kpi-l .ic { background: rgba(255, 255, 255, .14); color: #fff; }

/* ── Labels ────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; font: 700 12.5px var(--sans); padding: 2px 10px; border-radius: 99px; background: var(--neutral-soft); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.ok::before, .badge.warn::before, .badge.bad::before, .badge.info::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
/* order status → tone (the status code is the class, the wording is translated in the template) */
.badge.st-ISSUED { background: var(--ok-soft); color: var(--ok); }
.badge.st-DRAFT, .badge.st-PENDING_ISSUE, .badge.st-REFUNDED, .badge.st-PARTIALLY_REFUNDED { background: var(--warn-soft); color: var(--warn); }
.badge.st-EXPIRED { background: var(--bad-soft); color: var(--bad); }
.badge.st-ISSUED::before, .badge.st-DRAFT::before, .badge.st-PENDING_ISSUE::before, .badge.st-REFUNDED::before, .badge.st-PARTIALLY_REFUNDED::before, .badge.st-EXPIRED::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-AIR { --c: var(--p-flight); } .p-HOTEL { --c: var(--p-hotel); } .p-ESIM { --c: var(--p-esim); } .p-RAIL { --c: var(--p-rail); } .p-INSURANCE { --c: var(--p-insurance); }
.p-COMMON { --c: var(--ink-2); }
.ptag { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ptag .ic { color: var(--c, var(--brand)); width: 17px; height: 17px; }
.ptag.box { padding: 3px 12px 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--c, var(--brand)) 11%, var(--tint)); color: var(--ink); }
.ptags { display: flex; gap: 5px; flex-wrap: wrap; }
.pico { width: 30px; height: 30px; border-radius: 10px; display: inline-grid; place-items: center; flex: none; color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 11%, var(--tint)); }
.pico .ic { width: 17px; height: 17px; }
.code, .key { font-family: var(--code); }
.code { font-size: 12.5px; background: var(--sky-softer); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px 8px; overflow-wrap: anywhere; }
.mth { display: inline-block; min-width: 46px; text-align: center; font: 500 11px var(--code); padding: 3px 6px; border-radius: 6px; background: var(--sky-soft); color: var(--brand-hover); margin-right: 8px; }
.mth.m-GET { background: var(--ok-soft); color: var(--ok); }
.mth.m-DELETE { background: var(--bad-soft); color: var(--bad); }
.mth + .mono, .path { font-family: var(--code); font-size: 12.5px; }
.up { display: flex; align-items: center; gap: 7px; font-size: 13.5px; padding: 1px 0; }
.up .mono { font-family: var(--code); font-size: 12px; color: var(--ink-2); }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step > span { width: 28px; height: 28px; border-radius: 50%; background: var(--sky-soft); color: var(--brand-hover); display: grid; place-items: center; font: 700 13px var(--display); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c, var(--brand)); }

/* ── Tables ────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after { content: "↕"; opacity: .35; margin-left: 6px; font-size: 10px; }
th[data-sort][aria-sort="ascending"]::after { content: "↑"; opacity: .95; color: var(--brand); }
th[data-sort][aria-sort="descending"]::after { content: "↓"; opacity: .95; color: var(--brand); }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td.ws, td .ws { white-space: normal; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--t-fast); }
tr.click { cursor: pointer; position: relative; }
tr.click:hover { background: var(--sky-softer); }
/* the whole row opens what its first link opens, without script */
tr.click a.row-link::after { content: ''; position: absolute; inset: 0; }
td.r, th.r { text-align: right; }
td.c, th.c { text-align: center; }
td small, .cell-sub { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
td b { font-weight: 700; }
td b.strong { font-weight: 600; }
tr.group td { background: var(--surface-2); font-weight: 600; font-size: 12.5px; padding-top: 9px; padding-bottom: 9px; }
tfoot td { font-weight: 800; background: var(--surface-2); border-top: 1px solid var(--line-strong); border-bottom: 0; color: var(--head); }
.cell-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-id b { font-weight: 700; display: block; }
.cell-id b.mono { font-weight: 500; font-family: var(--code); font-size: 13px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
td.c > .ic { color: var(--ok); margin: 0 auto; }
.tabs { margin-bottom: 0; }
main > .tabs { margin-bottom: var(--s-4); }
td.actions form { display: inline-flex; margin: 0; }
td.actions { text-align: right; }
td.actions > * + * { margin-left: 6px; }
.empty { text-align: center; padding: 40px var(--s-4); color: var(--muted); }
td.empty { white-space: normal; }

/* ── Toolbar, forms ────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: var(--s-2); padding: 16px 20px; flex-wrap: wrap; margin: 0; }
.toolbar .search { max-width: 300px; }
.toolbar .search.wide { max-width: 340px; }
.toolbar .search input { height: 38px; background: var(--surface-2); }
.seg { display: inline-flex; background: var(--neutral-soft); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button, .seg a { border: 0; background: transparent; height: 32px; padding: 0 13px; border-radius: 9px; font-weight: 600; color: var(--ink-2); font-size: 13.5px; display: inline-flex; align-items: center; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast); }
.seg button:hover, .seg a:hover { color: var(--head); }
.seg button[aria-pressed="true"], .seg button.on, .seg a.on { background: var(--surface); color: var(--head); font-weight: 800; box-shadow: 0 1px 3px rgba(11, 36, 82, .14); }
.field { display: grid; gap: 6px; align-content: start; }
.field label, .lbl { font-size: 13.5px; font-weight: 700; color: var(--ink); display: block; }
.field .hint, .hint { font-size: 13px; color: var(--muted); }
.inp, select.inp, textarea.inp { height: 42px; width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); padding: 0 13px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.inp:hover { border-color: var(--sky); }
.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--sky-soft); }
.inp.sm { height: 36px; font-size: 13.5px; padding: 0 10px; border-radius: 10px; }
.inp.mono { font-family: var(--code); font-size: 13.5px; }
.inp:disabled { opacity: .5; background: var(--surface-2); cursor: not-allowed; }
.inp[readonly], .inp.locked { background: var(--surface-2); color: var(--ink-2); }
select.inp.locked { pointer-events: none; }
.inp.w-auto { width: auto; }
.inp.w130 { width: 130px; } .inp.w150 { width: 150px; } .inp.w160 { width: 160px; } .inp.w180 { width: 180px; } .inp.w190 { width: 190px; } .inp.w210 { width: 210px; }
.inp::placeholder { color: var(--muted); }
.err { color: var(--bad); font-size: 13px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.fs { border: 0; padding: 0; margin: 0 0 var(--s-6); min-width: 0; }
.fs:last-of-type { margin-bottom: 0; }
.fs legend { font: 700 16px var(--display); color: var(--head); padding: 0; margin-bottom: var(--s-4); display: flex; align-items: center; gap: 10px; }
.fs legend span { width: 28px; height: 28px; border-radius: 50%; background: var(--pri); color: var(--on-pri); display: grid; place-items: center; font: 700 13px var(--display); }
.fs .note { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--s-2); }
.tile { position: relative; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 10px 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; transition: border-color var(--t-fast), background var(--t-fast); }
.tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; width: 100%; height: 100%; }
.tile:hover { border-color: var(--sky); }
.tile:has(input:checked) { border-color: var(--brand); background: var(--sky-soft); box-shadow: inset 0 0 0 1px var(--brand); color: var(--head); }
.tile:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.tile .ic { color: var(--c, var(--ink-2)); }
.tile.plain { font-family: var(--code); font-size: 12.5px; font-weight: 500; }
.switch { position: relative; width: 42px; height: 24px; display: inline-block; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; width: 100%; height: 100%; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background var(--t-fast); }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11, 36, 82, .25); transition: transform var(--t-fast); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
form.inline { display: inline-flex; gap: var(--s-2); align-items: center; margin: 0; flex-wrap: wrap; }
.filters { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin: 0; }
.filters label { font-size: 13px; color: var(--muted); font-weight: 600; }
details.more { border-top: 1px solid var(--line); padding-top: 12px; }
details.more > summary { display: flex; align-items: baseline; gap: 9px; cursor: pointer; font-weight: 700; color: var(--brand-hover); list-style: none; font-size: 13.5px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ''; width: 0; height: 0; border: 4px solid transparent; border-left-color: currentColor; transition: transform var(--t-fast); transform-origin: 2px 50%; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > summary .hint { font-weight: 400; }
details.more > .form-grid { margin-top: 14px; }

/* ── In-page tabs ──────────────────────────────────── */
.tabs { display: flex; gap: 6px; margin-bottom: var(--s-4); overflow-x: auto; padding-bottom: 2px; }
.tabs button, .tabs a { border: 0; background: transparent; padding: 9px 16px; border-radius: 99px; font-weight: 600; color: var(--ink-2); white-space: nowrap; display: flex; gap: 8px; align-items: center; transition: background var(--t-fast), color var(--t-fast); }
.tabs button:hover, .tabs a:hover { background: var(--sky-soft); color: var(--head); }
.tabs button[aria-selected="true"], .tabs button.on, .tabs a.on { background: var(--pri); color: var(--on-pri); font-weight: 700; }
.tabs em { font: 700 12px var(--sans); font-style: normal; font-variant-numeric: tabular-nums; background: var(--neutral-soft); border-radius: 99px; padding: 0 7px; color: var(--ink-2); }
.tabs .on em, .tabs [aria-selected="true"] em { background: rgba(255, 255, 255, .2); color: inherit; }

/* ── Data bits ─────────────────────────────────────── */
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-4); margin: 0; }
.dl.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dl.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dl dt { font-size: 13px; color: var(--muted); }
.dl dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.dl dd a { color: var(--brand-hover); text-decoration: underline; text-underline-offset: 3px; }
.dl dd small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding: 10px 0; border-bottom: 1px dashed var(--line-strong); }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--ink-2); }
.kv > :last-child { text-align: right; }
.kv.total { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 800; color: var(--head); padding-top: 12px; margin-top: 2px; }
.kv.total > span:first-child { color: var(--head); }
.meter { height: 8px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; display: block; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--brand)); }
.hbar { display: grid; grid-template-columns: minmax(96px, 136px) 1fr auto; align-items: center; gap: var(--s-3); padding: 8px 0; font-size: 13.5px; }
.hbar .num { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.share { display: flex; align-items: center; gap: var(--s-2); min-width: 150px; }
.share .meter { flex: 1; }
.share .num { font-size: 12.5px; width: 44px; text-align: right; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li, .list > div { display: flex; align-items: center; gap: var(--s-3); padding: 13px 20px; border-bottom: 1px solid var(--line); }
.card-h + .list > :first-child { border-top: 1px solid var(--line); }
.list > :last-child { border-bottom: 0; }
.list b { font-weight: 700; display: block; }
.list b.num { display: inline; white-space: nowrap; }
.list small { color: var(--muted); font-size: 13px; display: block; }
.list > li > .ic { width: 36px; height: 36px; padding: 9px; border-radius: 12px; background: var(--sky-soft); color: var(--brand); }
.list > li.warn > .ic { background: var(--warn-soft); color: var(--warn); }
.list > li.bad > .ic { background: var(--bad-soft); color: var(--bad); }
.list > li.ok > .ic { background: var(--ok-soft); color: var(--ok); }
.list > li.empty { justify-content: center; }
.alert { display: flex; gap: var(--s-3); padding: 14px 16px; border-radius: var(--r); background: var(--sun-soft); color: var(--sun-ink); align-items: flex-start; }
.alert.info { background: var(--info-soft); color: var(--info-ink); }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert .ic { margin-top: 1px; width: 20px; height: 20px; color: var(--sun); }
.alert.info .ic { color: var(--brand); }
.alert.bad .ic { color: var(--bad); }
.alert b { font-weight: 800; }
.alert .btn { margin-left: auto; flex: none; }
.banner, .flash { display: flex; gap: var(--s-3); align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash .ic { width: 20px; height: 20px; }
pre.snip { margin: 0; background: #0B2452; color: #DCE8F8; border-radius: var(--r); padding: var(--s-4); font: 400 12.5px/1.65 var(--code); overflow-x: auto; }

/* width steps for meters: the CSP forbids the inline width the mock uses, so the share is a class */
.w0{width:0}.w1{width:1%}.w2{width:2%}.w3{width:3%}.w4{width:4%}.w5{width:5%}.w6{width:6%}.w7{width:7%}.w8{width:8%}.w9{width:9%}
.w10{width:10%}.w11{width:11%}.w12{width:12%}.w13{width:13%}.w14{width:14%}.w15{width:15%}.w16{width:16%}.w17{width:17%}.w18{width:18%}.w19{width:19%}
.w20{width:20%}.w21{width:21%}.w22{width:22%}.w23{width:23%}.w24{width:24%}.w25{width:25%}.w26{width:26%}.w27{width:27%}.w28{width:28%}.w29{width:29%}
.w30{width:30%}.w31{width:31%}.w32{width:32%}.w33{width:33%}.w34{width:34%}.w35{width:35%}.w36{width:36%}.w37{width:37%}.w38{width:38%}.w39{width:39%}
.w40{width:40%}.w41{width:41%}.w42{width:42%}.w43{width:43%}.w44{width:44%}.w45{width:45%}.w46{width:46%}.w47{width:47%}.w48{width:48%}.w49{width:49%}
.w50{width:50%}.w51{width:51%}.w52{width:52%}.w53{width:53%}.w54{width:54%}.w55{width:55%}.w56{width:56%}.w57{width:57%}.w58{width:58%}.w59{width:59%}
.w60{width:60%}.w61{width:61%}.w62{width:62%}.w63{width:63%}.w64{width:64%}.w65{width:65%}.w66{width:66%}.w67{width:67%}.w68{width:68%}.w69{width:69%}
.w70{width:70%}.w71{width:71%}.w72{width:72%}.w73{width:73%}.w74{width:74%}.w75{width:75%}.w76{width:76%}.w77{width:77%}.w78{width:78%}.w79{width:79%}
.w80{width:80%}.w81{width:81%}.w82{width:82%}.w83{width:83%}.w84{width:84%}.w85{width:85%}.w86{width:86%}.w87{width:87%}.w88{width:88%}.w89{width:89%}
.w90{width:90%}.w91{width:91%}.w92{width:92%}.w93{width:93%}.w94{width:94%}.w95{width:95%}.w96{width:96%}.w97{width:97%}.w98{width:98%}.w99{width:99%}.w100{width:100%}

/* ── Charts (server-rendered SVG: geometry in attributes, colour here) ── */
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .ax { fill: var(--muted); font: 400 11.5px var(--sans); font-variant-numeric: tabular-nums; }
.chart .ax.y { text-anchor: end; }
.chart .ax.x { text-anchor: middle; }
.chart .area { fill: var(--brand); opacity: .1; }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; }
.chart .line.dash { stroke: var(--ok); stroke-dasharray: 5 4; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--brand); }
.chart .sl { fill: var(--c, var(--brand)); transition: opacity var(--t-fast); }
.chart g:hover > .sl { opacity: .78; }
.chart-empty { padding: 60px 12px; text-align: center; color: var(--muted); }
.legend { display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: var(--s-2); }
.legend > span { display: inline-flex; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--c, var(--brand)); }
.legend i.dash { height: 0; border-top: 2px dashed var(--ok); background: none; width: 14px; border-radius: 0; }
.legend b { margin-left: 6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.donut { display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap; }
.donut svg { width: 148px; height: 148px; flex: none; }
.donut .arc { fill: none; stroke: var(--c, var(--brand)); stroke-width: 18; }
.donut .ring { fill: none; stroke: var(--neutral-soft); stroke-width: 18; }
.donut .donut-v { font: 700 19px var(--display); fill: var(--head); text-anchor: middle; }
.donut .donut-s { font: 400 11px var(--sans); fill: var(--muted); text-anchor: middle; }
.donut .legend { flex-direction: column; gap: 8px; margin: 0; flex: 1; min-width: 150px; }
.donut .legend div { display: flex; justify-content: space-between; gap: var(--s-3); }
.donut .legend div > span:first-child { display: inline-flex; align-items: center; }
.minibar { display: block; width: 100%; max-width: 220px; height: 16px; }
.minibar .track { fill: var(--neutral-soft); }
.minibar .fill { fill: var(--c, var(--brand)); }

/* flow: sources → our API → clients */
.flow { display: grid; grid-template-columns: 1fr auto 1.1fr auto 1fr; gap: var(--s-4); align-items: center; }
.flow-col { display: grid; gap: 6px; }
.flow-n { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.flow-n .ic { color: var(--muted); }
.flow-core { border-radius: var(--r-lg); background: linear-gradient(135deg, #0B2452, #1A3C78); color: #fff; padding: var(--s-5) var(--s-4); text-align: center; position: relative; overflow: hidden; box-shadow: 0 14px 30px rgba(11, 36, 82, .25); }
.flow-core::after { content: ''; position: absolute; right: -40px; bottom: -50px; width: 150px; height: 150px; border-radius: 50%; border: 12px solid rgba(91, 164, 232, .25); }
.flow-core b { font: 700 19px/1.2 var(--display); display: block; }
.flow-core small { color: #C9DCF5; }
.flow-core .ptags { justify-content: center; margin-top: var(--s-3); position: relative; z-index: 1; }
.flow-core .pico { background: rgba(255, 255, 255, .14); color: #fff; }
.flow-arrow { color: var(--sky); }
.flow-arrow .ic { width: 24px; height: 24px; }
.flow h3 { font: 700 13.5px var(--display); color: var(--muted); margin-bottom: 8px; }

/* ── Drawer, modal, popover ────────────────────────── */
.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(2px); z-index: 90; opacity: 0; pointer-events: none; transition: opacity var(--t); border: 0; padding: 0; width: 100%; cursor: default; display: block; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; inset: 0 0 0 auto; width: min(580px, 100vw); background: var(--surface); z-index: 100; box-shadow: var(--shadow-2); border-radius: 24px 0 0 24px;
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--t) cubic-bezier(.2, .7, .2, 1); visibility: hidden; overflow: hidden; }
.drawer.wide { width: min(760px, 100vw); }
.drawer.xwide { width: min(920px, 100vw); }
.drawer.on { transform: none; visibility: visible; }
.drawer > form { display: flex; flex-direction: column; flex: 1; min-height: 0; margin: 0; }
.dr-h { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); padding: 22px 26px 16px; border-bottom: 1px solid var(--line); }
.dr-h h2 { font: 700 21px/1.25 var(--display); color: var(--head); overflow-wrap: anywhere; }
.dr-h p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.dr-h .tabs { margin: 14px 0 0; }
.dr-b { flex: 1; overflow-y: auto; padding: 22px 26px; background: var(--bg); }
.dr-f { padding: 14px 26px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: var(--s-2); background: var(--surface); flex-wrap: wrap; }
.dr-f form { margin: 0; }
.modal { position: fixed; left: 50%; top: 50%; width: min(500px, calc(100vw - 32px)); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-2); z-index: 110; overflow: hidden;
  transform: translate(-50%, -48%) scale(.98); opacity: 0; visibility: hidden; transition: transform var(--t), opacity var(--t); }
.modal.wide { width: min(720px, calc(100vw - 32px)); }
.modal.on { transform: translate(-50%, -50%); opacity: 1; visibility: visible; }
.modal .dr-b { background: var(--surface); max-height: calc(100dvh - 230px); overflow-y: auto; }
.modal .dr-b p { color: var(--ink-2); }
.keybox { display: flex; align-items: center; gap: var(--s-2); background: #0B2452; color: #A8E6CF; border-radius: var(--r); padding: 14px; font: 500 12.5px var(--code); overflow-wrap: anywhere; margin-top: var(--s-4); }
.keybox .key { min-width: 0; overflow-wrap: anywhere; font-size: inherit; }
.keybox .icon-btn { color: #fff; margin-left: auto; flex: none; }
.keybox .icon-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.keybox .icon-btn.copied { background: #17A57F; }
.keybox-who { margin-top: var(--s-3); font-size: 13px; color: var(--muted); }
.pop { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); z-index: 60; max-height: 440px; overflow-y: auto; }
.pop.right { left: auto; right: 0; width: 360px; }
.pop-h { padding: 14px 18px 10px; font: 700 15px var(--display); color: var(--head); }
.pop-i { display: flex; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: flex-start; transition: background var(--t-fast); }
.pop-i:hover, .pop-i:focus-visible { background: var(--sky-softer); }
.pop-i .ic { width: 34px; height: 34px; padding: 8px; border-radius: 12px; background: var(--sky-soft); color: var(--brand); }
.pop-i.warn .ic { background: var(--warn-soft); color: var(--warn); }
.pop-i.bad .ic { background: var(--bad-soft); color: var(--bad); }
.pop-i b { display: block; font-weight: 700; }
.pop-i small { color: var(--muted); font-size: 13px; }
.pop .empty { padding: 24px var(--s-4); }

/* ── Folding blocks (one client's rules inside a source drawer) ── */
details.fold { overflow: hidden; }
details.fold > summary { display: flex; align-items: center; gap: var(--s-2); padding: 13px 20px; cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ''; width: 0; height: 0; border: 5px solid transparent; border-left-color: var(--muted); transition: transform var(--t-fast); transform-origin: 3px 50%; }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold[open] > summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
details.fold > summary:hover { background: var(--sky-softer); }
.fold-form { padding: 16px 20px; border-top: 1px solid var(--line); background: var(--surface-2); display: grid; gap: var(--s-3); margin: 0; }
label.field { margin: 0; }
td.r > .ic { margin-left: auto; }
.page-h .mono { font-family: var(--code); font-size: 22px; overflow-wrap: anywhere; }
.dr-h h2.mono { font-family: var(--code); font-size: 17px; }

/* ── Sign-in pages ─────────────────────────────────── */
body.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, var(--sky-soft) 0%, var(--bg) 55%, var(--sky-soft) 100%); }
.login-card { width: min(960px, 100%); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--surface); border-radius: 28px; overflow: hidden; box-shadow: 0 30px 80px rgba(11, 36, 82, .18); }
.login-side { position: relative; overflow: hidden; padding: 44px 40px; color: #fff; background: linear-gradient(150deg, #0B2452 0%, #1A3C78 60%, #2E6FC4 100%); display: flex; flex-direction: column; justify-content: flex-end; gap: 18px; min-height: 560px; }
.login-side::before { content: ''; position: absolute; right: -90px; top: -90px; width: 320px; height: 320px; border-radius: 50%; border: 26px solid rgba(91, 164, 232, .22); }
.login-side::after { content: ''; position: absolute; left: -60px; top: 120px; width: 460px; height: 120px; border-radius: 50%; border-top: 3px dashed rgba(255, 255, 255, .28); transform: rotate(-18deg); }
.login-side .app-chip { align-self: flex-start; background: rgba(255, 255, 255, .14); color: #fff; }
.login-side .app-chip small { color: #C9DCF5; }
.login-side h2 { font: 700 30px/1.2 var(--display); letter-spacing: -.01em; text-wrap: balance; position: relative; }
.login-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: #DCE8F8; position: relative; }
.login-side li { display: flex; gap: 10px; align-items: center; }
.login-side li .ic { color: #5BA4E8; width: 20px; height: 20px; }
.login-form { padding: 40px 48px; display: grid; gap: 6px; align-content: center; justify-items: start; }
.login-form img { margin: 0 0 10px -6px; background: #fff; border-radius: 12px; display: block; height: auto; }
.login-form h1 { font: 700 26px/1.2 var(--display); color: var(--head); }
.login-form form { width: 100%; display: grid; gap: 16px; margin: 20px 0 14px; }
.login-form .inp { height: 46px; }
.login-form .flash { width: 100%; margin-top: 12px; }
.login-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); background: var(--sky-softer); border-radius: var(--r); padding: 10px 12px; width: 100%; margin-bottom: 8px; }
.login-note .ic { color: var(--brand); margin-top: 1px; }

/* ── Table pager (built by the console script beside a paged table) ── */
.pager { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); color: var(--muted); font-size: 13.5px; flex-wrap: wrap; }
.pager-info { font-variant-numeric: tabular-nums; }
.pager .grow { flex: 1; }
.pager-n { font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 0 4px; }
.pg { height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--head); border-radius: 10px; font-weight: 700; font-size: 13.5px; transition: background var(--t-fast), border-color var(--t-fast); }
.pg:hover:not(:disabled) { border-color: var(--sky); background: var(--sky-softer); }
.pg:disabled { opacity: .45; cursor: not-allowed; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1220px) { .g-2-1, .g-3 { grid-template-columns: 1fr; } }
@media (max-width: 1023px) {
  .side { transform: translateX(-100%); transition: transform var(--t); box-shadow: var(--shadow-2); z-index: 95; }
  .side.on { transform: none; }
  .wrap { margin-left: 0; }
  .icon-btn.menu-btn { display: inline-grid; }
  .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-1-1 { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; } .flow-arrow { transform: rotate(90deg); justify-self: center; }
  .drawer { border-radius: 0; }
  .top .langsw { display: none; }
}
@media (max-width: 760px) {
  .login-card { grid-template-columns: 1fr; } .login-side { min-height: 0; padding: 28px; } .login-side ul { display: none; } .login-form { padding: 28px; }
}
@media (max-width: 640px) {
  main { padding: 4px var(--s-4) 40px; }
  .top { padding: 0 var(--s-4); }
  .user div { display: none; } .user { padding: 4px; }
  .form-grid, .form-grid.three, .dl.two, .dl.three { grid-template-columns: 1fr; }
  .page-h h1 { font-size: 23px; }
  .pop.right { width: min(360px, calc(100vw - 32px)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }
@media print {
  .side, .top, .scrim, .page-a, .toolbar, .pager, .card-f { display: none !important; }
  .wrap { margin-left: 0; }
  .card { box-shadow: none; }
}

/* ---- client page: which source serves a product, and the owner's switch per source ---- */
.src-now { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; font-weight: 500; flex-wrap: wrap; vertical-align: middle; }
.src-switches { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: flex-end; }
.src-sw { display: inline-flex; align-items: center; gap: 8px; }
.src-sw.off { opacity: .6; }
.src-sw .switch input:disabled { cursor: not-allowed; }
.src-rules { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; vertical-align: middle; }
