/*
  ============================================================
  SWX Ops Console — COMPONENT LAYER (canonical)
  ============================================================
  The shared component vocabulary for every Ops Console page:
  shell, sidebar (.sb*), top bar (.top/.crumb/.search/.ic-btn),
  page head, KPIs, cards, tables, pills, tags, feed, etc.

  Extracted verbatim from the self-contained Ops Console build so
  there is ONE source of truth. It consumes the SWX design-system
  TOKENS (color, type, spacing, radii, motion) — link the design
  system's styles.css BEFORE this file. Pairs with:
    - swx-console-chrome.js  (injects sidebar + top bar)
    - swx-console-align.css  (reconciles legacy tool markup)
    - swx-metrics.js         (shared count definitions)
  ============================================================
*/

/* ===== OPS CONSOLE COMPONENT LAYER · ops.css ===== */
/* ============================================================================
   SWX GLOBAL — OPS CONSOLE (internal back-office)
   Built on the SWX foundation tokens. Extends the Portal kit vocabulary.
   ============================================================================ */
/* tokens inlined above (colors_and_type.css) */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-sans); font-size: var(--fs-14); line-height: 1.45; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-7); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-6); }

/* ---------- Utilities ---------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.gap-5 { gap: 20px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.grow { flex: 1; } .mlauto { margin-left: auto; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--fg-muted); } .subtle { color: var(--fg-subtle); } .faint { color: var(--fg-faint); }
.eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-muted); font-weight: 500; }
.up { text-transform: uppercase; }
.tnum { font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); } .crit { color: var(--crit); } .warn { color: #C97A00; }
.hide { display: none; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow-y: auto; }

/* ---------- Top-nav shell (variant) ---------- */
.shell-top { display: flex; flex-direction: column; min-height: 100vh; }
.main-top { min-width: 0; flex: 1; }
/* Row 1 — dark primary bar */
.tn { height: 56px; background: var(--ink-0); color: var(--ink-7); display: flex; align-items: center; gap: 6px; padding: 0 20px; position: sticky; top: 0; z-index: 50; }
.tn-brand { display: flex; align-items: center; gap: 9px; padding-right: 18px; margin-right: 8px; border-right: 1px solid rgba(255,255,255,0.10); flex: none; }
.tn-brand .mk { font-weight: 600; color: var(--ink-10); font-size: 15px; letter-spacing: 0.01em; }
.tn-brand .sub { font-weight: 600; color: var(--ink-5); font-size: 15px; }
.tn-brand .env { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.16em; color: var(--ink-4); border: 1px solid rgba(255,255,255,0.12); padding: 2px 5px; border-radius: 3px; margin-left: 2px; }
.tn-groups { display: flex; align-items: center; gap: 2px; }
.tn-g { display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--ink-5); cursor: pointer; position: relative; transition: background 120ms, color 120ms; white-space: nowrap; }
.tn-g:hover { color: var(--ink-10); background: rgba(255,255,255,0.05); }
.tn-g.on { color: var(--ink-10); }
.tn-g.on::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: -8px; height: 2px; background: var(--signal-500); border-radius: 2px; }
.tn-g i { width: 16px; height: 16px; stroke-width: 1.5; flex: none; }
.tn-g .dotbadge { width: 6px; height: 6px; border-radius: 999px; background: var(--signal-500); }
.tn-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tn .search { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: var(--ink-5); width: 230px; }
.tn .search input { color: var(--ink-10); }
.tn .search input::placeholder { color: var(--ink-5); }
.tn .search kbd { color: var(--ink-5); border-color: rgba(255,255,255,0.16); }
.tn .ic-btn { color: var(--ink-5); }
.tn .ic-btn:hover { background: rgba(255,255,255,0.08); color: var(--ink-10); }
.tn .ic-btn .pip { border-color: var(--ink-0); }
.tn-acct { display: flex; align-items: center; gap: 9px; padding-left: 14px; margin-left: 6px; border-left: 1px solid rgba(255,255,255,0.10); cursor: pointer; }
.tn-acct .av { width: 30px; height: 30px; border-radius: 6px; }
.tn-acct .who { line-height: 1.1; }
.tn-acct .who .name { color: var(--ink-10); font-size: 13px; font-weight: 500; }
.tn-acct .who .role { font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); letter-spacing: 0.06em; text-transform: uppercase; }
.tn-acct i { color: var(--ink-5); width: 15px; height: 15px; }
/* Row 2 — light sub bar */
.tnsub { height: 46px; background: var(--bg-elevated); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 20px; gap: 4px; position: sticky; top: 56px; z-index: 49; overflow-x: auto; }
.tnsub::-webkit-scrollbar { height: 0; }
.tnsub-tab { display: flex; align-items: center; gap: 8px; padding: 0 13px; height: 46px; font-size: 13px; font-weight: 500; color: var(--fg-muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: color 120ms; }
.tnsub-tab:hover { color: var(--fg); }
.tnsub-tab.on { color: var(--fg); border-bottom-color: var(--signal-500); }
.tnsub-tab i { width: 15px; height: 15px; stroke-width: 1.6; }
.tnsub-tab .n { font-family: var(--font-mono); font-size: 10px; color: var(--fg-faint); }
.tnsub-tab .dotbadge { width: 6px; height: 6px; border-radius: 999px; background: var(--signal-500); }
.tnsub-crumb { margin-left: auto; padding-left: 16px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-faint); white-space: nowrap; flex: none; }
/* top-nav page keeps centered max width */
.shell-top .page { margin: 0 auto; }

/* ---------- Sidebar ---------- */
.sb { background: var(--ink-0); color: var(--ink-7); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.sb-brand { display: flex; align-items: center; gap: 9px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); flex: none; }
.sb-brand .mk { font-weight: 600; color: var(--ink-10); letter-spacing: 0.01em; font-size: 15px; }
.sb-brand .sub { font-weight: 600; color: var(--ink-5); font-size: 15px; }
.sb-brand .env { margin-left: auto; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.16em; color: var(--ink-4); border: 1px solid rgba(255,255,255,0.12); padding: 2px 5px; border-radius: 3px; }
.sb-scroll { flex: 1; overflow-y: auto; padding: 6px 0 12px; }
.sb-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-color: transparent; }
.sb-grp { padding: 10px 12px 2px; }
.sb-grp h6 { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-4); padding: 0 12px 6px; margin: 0; font-weight: 500; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 7px 12px; border-radius: 5px; color: var(--ink-6); font-size: 13px; font-weight: 500; cursor: pointer; position: relative; transition: background 120ms, color 120ms; }
.sb-item:hover { background: rgba(255,255,255,0.04); color: var(--ink-10); }
.sb-item.on { background: rgba(255,255,255,0.07); color: var(--ink-10); }
.sb-item.on::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 2px; background: var(--signal-500); }
.sb-item i, .sb-item svg { width: 17px; height: 17px; stroke-width: 1.5; flex: none; color: var(--nav-tint, currentColor); transition: color var(--d-1, 120ms) var(--ease-out, ease); }
.sb-item .n { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.sb-item.soon { color: var(--ink-4); cursor: default; }
.sb-item.soon:hover { background: transparent; color: var(--ink-4); }
.sb-item.soon i { opacity: 0.7; }
.sb-item.soon .n { font-size: 8px; letter-spacing: 0.14em; padding: 1px 5px; border: 1px solid rgba(255,255,255,0.12); border-radius: 3px; }
.sb-item .dotbadge { margin-left: auto; width: 6px; height: 6px; border-radius: 999px; background: var(--signal-500); }
.sb-acct { flex: none; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.sb-acct .av { width: 30px; height: 30px; border-radius: 5px; background: var(--signal-500); color: var(--ink-10); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.sb-acct .name { font-size: 13px; color: var(--ink-10); font-weight: 500; }
.sb-acct .role { font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); letter-spacing: 0.06em; text-transform: uppercase; }
.sb-acct .gear { margin-left: auto; color: var(--ink-5); width: 16px; height: 16px; cursor: pointer; }
.sb-acct .gear:hover { color: var(--ink-10); }

/* ---------- Top bar ---------- */
.top { height: 54px; background: var(--bg-elevated); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 22px; gap: 16px; position: sticky; top: 0; z-index: 40; flex: none; }
.crumb { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--fg-subtle); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.crumb b { color: var(--fg); font-weight: 600; }
.crumb .sep { color: var(--ink-6); }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; font-size: 13px; width: 260px; color: var(--fg-muted); }
.search input { border: 0; background: transparent; outline: 0; flex: 1; font-size: 13px; color: var(--fg); width: 100%; }
.search kbd { font-family: var(--font-mono); font-size: 10px; color: var(--fg-subtle); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; }
.ic-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 5px; color: var(--fg-muted); position: relative; }
.ic-btn:hover { background: var(--bg-sunken); color: var(--fg); }
/* Glyph never swallows the click — the whole 32×32 button is the hit area
   (Lucide swaps <i>→<svg>, so target both; stroke-only SVGs otherwise let
   clicks fall through their transparent gaps). */
.ic-btn i, .ic-btn svg { width: 17px; height: 17px; stroke-width: 1.6; pointer-events: none; }
.ic-btn .pip { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 999px; background: var(--signal-500); border: 1.5px solid var(--bg-elevated); }

/* ---------- Page ---------- */
.page { padding: 24px 28px 56px; max-width: 1680px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.page-head .eyebrow { margin-bottom: 9px; }
.page-head h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; margin: 0; font-family: var(--font-display); }
.page-head .sub { color: var(--fg-muted); font-size: 13px; margin-top: 7px; max-width: 60ch; }
.page-head .actions { display: flex; gap: 8px; flex: none; }

/* ---------- Page status stamp ----------
   Live system status, set in the upper-right of a page head (last sync, live
   counts). Static provenance (version, data pool) belongs in the footer, not
   here. Sits inside .page-head .actions, or top-right of a tool hero. */
.page-status { display: flex; align-items: flex-start; gap: 24px; flex: none; }
.page-status .ps { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.page-status .ps .k { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-muted); white-space: nowrap; }
.page-status .ps .v { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; font-family: var(--font-mono); font-size: 14px; font-weight: 500; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.page-status .ps .v .live-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--ok); flex: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 8px 13px; border-radius: 5px; border: 1px solid transparent; transition: background 120ms, color 120ms, border-color 120ms; white-space: nowrap; }
.btn i { width: 14px; height: 14px; stroke-width: 1.6; }
.btn-pri { background: var(--ink-0); color: var(--ink-10); }
.btn-pri:hover { background: var(--ink-2); }
.btn-signal { background: var(--signal-500); color: var(--ink-10); }
.btn-signal:hover { background: var(--signal-600); }
.btn-out { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn-out:hover { background: var(--bg-sunken); }
.btn-ghost { background: transparent; color: var(--fg-muted); }
.btn-ghost:hover { background: var(--bg-sunken); color: var(--fg); }
.btn-sm { padding: 5px 9px; font-size: 12px; }

/* ---------- KPI ---------- */
.kpis { display: grid; gap: 0; border: 1px solid var(--line); background: var(--bg-elevated); border-radius: 6px; overflow: hidden; }
.kpis.c4 { grid-template-columns: repeat(4, 1fr); }
.kpis.c5 { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: 16px 18px 15px; border-right: 1px solid var(--line); position: relative; }
.kpis > .kpi:last-child { border-right: 0; }
.kpi .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-muted); display: flex; align-items: center; gap: 6px; }
.kpi .lbl i { width: 13px; height: 13px; stroke-width: 1.6; color: var(--fg-subtle); }
.kpi .val { font-family: var(--font-mono); font-size: 30px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; margin-top: 12px; font-variant-numeric: tabular-nums; color: var(--fg); }
.kpi .val small { font-size: 15px; color: var(--fg-subtle); font-weight: 500; }
.kpi .delta { font-family: var(--font-mono); font-size: 11px; margin-top: 8px; color: var(--ok); display: flex; align-items: center; gap: 5px; }
.kpi .delta.neg { color: var(--crit); }
.kpi .delta i { width: 12px; height: 12px; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; margin-top: 10px; }
.spark span { flex: 1; background: var(--ink-7); border-radius: 1px; min-height: 2px; }
.spark span.hi { background: var(--signal-500); }

/* ---------- Cards / plates ---------- */
.grid { display: grid; gap: 16px; }
.card { border: 1px solid var(--line); background: var(--bg-elevated); border-radius: 6px; display: flex; flex-direction: column; min-width: 0; }
.card-hd { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); flex: none; }
.card-hd h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; margin: 0; font-family: var(--font-display); }
.card-hd .eyebrow { margin: 0; }
.card-hd .act { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-bd { padding: 16px; }
.card-bd.flush { padding: 0; }
.card .more { font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.card .more:hover { color: var(--signal-600); }
.card .more i { width: 13px; height: 13px; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--fg-muted); cursor: pointer; transition: all 120ms; white-space: nowrap; }
.chip:hover { border-color: var(--ink-5); color: var(--fg); }
.chip.on { background: var(--ink-0); color: var(--ink-10); border-color: var(--ink-0); }
.chip .c { font-variant-numeric: tabular-nums; opacity: 0.6; margin-left: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--fg-muted); border-right: 1px solid var(--line); transition: all 120ms; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink-0); color: var(--ink-10); }
.seg button:not(.on):hover { background: var(--bg-sunken); color: var(--fg); }
.inp { display: flex; align-items: center; gap: 7px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; font-size: 13px; color: var(--fg-muted); }
.inp i { width: 15px; height: 15px; }
.inp input { border: 0; background: transparent; outline: 0; color: var(--fg); font-size: 13px; width: 160px; }

/* ---------- Tables ---------- */
.tbl-wrap { border: 1px solid var(--line); background: var(--bg-elevated); border-radius: 6px; overflow: hidden; }
table.swx { width: 100%; border-collapse: collapse; font-size: 13px; }
table.swx th { text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-muted); padding: 11px 16px; border-bottom: 1px solid var(--line); font-weight: 500; white-space: nowrap; background: var(--bg-elevated); position: sticky; top: 0; }
table.swx th.r, table.swx td.r { text-align: right; }
table.swx td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.swx tbody tr:last-child td { border-bottom: 0; }
table.swx tbody tr { transition: background 100ms; }
table.swx tbody tr.click { cursor: pointer; }
table.swx tbody tr.click:hover td { background: var(--ink-9); }
table.swx tr.sel td { background: var(--signal-50); box-shadow: inset 2px 0 0 var(--signal-500); }
table.swx td.code { font-family: var(--font-mono); color: var(--fg-muted); font-size: 12px; }
table.swx td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.swx td.title { font-weight: 500; color: var(--fg); }
table.swx td .sub { color: var(--fg-subtle); font-size: 12px; margin-top: 2px; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; font-weight: 500; }
.pill .d { width: 5px; height: 5px; border-radius: 999px; background: currentColor; flex: none; }
.pill.green   { background: var(--ok-soft); color: #2E7D52; }
.pill.amber   { background: #FCEFD8; color: #B5740B; }
.pill.blue    { background: var(--info-soft); color: #1C4E70; }
.pill.red     { background: var(--signal-50); color: #C42E2E; }
.pill.grey    { background: var(--ink-8); color: var(--ink-3); }
.pill.teal    { background: #DBF0F1; color: #2C7A7F; }
.pill.purple  { background: #EAE3F2; color: #6B4A9C; }

/* ---------- Tags ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--fg-muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
.tag .sw { width: 7px; height: 7px; border-radius: 2px; }
.tag.solid { border: 0; color: var(--ink-10); }

/* ---------- Avatars ---------- */
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--ink-10); flex: none; }
.av.sq { border-radius: 5px; }
.av-stack { display: flex; }
.av-stack .av { border: 2px solid var(--bg-elevated); margin-left: -7px; }
.av-stack .av:first-child { margin-left: 0; }

/* ---------- Progress ---------- */
.bar { height: 6px; background: var(--ink-8); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--signal-500); border-radius: 999px; }
.bar.green > span { background: var(--ok); }
.bar.amber > span { background: var(--brand-yellow); }
.bar.navy > span { background: var(--brand-navy); }
.bar.teal > span { background: var(--brand-teal); }
.barlabel { display: flex; align-items: center; gap: 10px; }
.barlabel .bar { flex: 1; }
.barlabel .v { font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); width: 34px; text-align: right; }

/* ---------- Meta rows / specs ---------- */
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.specs .k { font-family: var(--font-mono); font-size: 10px; color: var(--fg-muted); letter-spacing: 0.1em; text-transform: uppercase; }
.specs .v { font-size: 14px; color: var(--fg); margin-top: 3px; font-weight: 500; }
.specs .v.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.metarow { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--line); }
.metarow:first-child { border-top: 0; }
.metarow .k { color: var(--fg-muted); font-size: 13px; }
.metarow .v { font-weight: 500; font-size: 13px; }

/* ---------- Timeline ---------- */
.tl { display: flex; flex-direction: column; }
.tl .step { display: grid; grid-template-columns: 78px 14px 1fr; gap: 12px; padding: 9px 0; align-items: start; }
.tl .date { font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); letter-spacing: 0.02em; padding-top: 1px; }
.tl .rail { display: flex; flex-direction: column; align-items: center; height: 100%; }
.tl .node { width: 9px; height: 9px; border-radius: 999px; background: var(--ink-7); margin-top: 4px; flex: none; }
.tl .node.done { background: var(--ok); }
.tl .node.now { background: var(--signal-500); box-shadow: 0 0 0 4px rgba(224,62,62,0.16); }
.tl .line { width: 2px; flex: 1; background: var(--line); margin-top: 3px; min-height: 8px; }
.tl .t { font-size: 13px; font-weight: 500; }
.tl .s { font-size: 12px; color: var(--fg-muted); margin-top: 1px; }

/* ---------- Slide-over ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,10,10,0.28); opacity: 0; pointer-events: none; transition: opacity 240ms; z-index: 50; }
.scrim.open { opacity: 1; pointer-events: auto; }
.over { position: fixed; top: 0; bottom: 0; right: 0; width: 520px; max-width: 94vw; background: var(--bg); border-left: 1px solid var(--line); z-index: 60; transform: translateX(100%); transition: transform 320ms var(--ease-out); overflow-y: auto; box-shadow: -10px 0 40px rgba(10,10,10,0.10); }
.over.open { transform: translateX(0); }
.over-hd { padding: 20px 24px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.over-hd .x { position: absolute; top: 16px; right: 18px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fg-muted); border-radius: 5px; }
.over-hd .x:hover { background: var(--bg-sunken); color: var(--fg); }
.over-hd .x i { width: 17px; height: 17px; }
.over-hd h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; margin: 9px 0 0; font-family: var(--font-display); padding-right: 40px; }
.over-hd .meta { display: flex; gap: 14px; margin-top: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); flex-wrap: wrap; }
.over-bd { padding: 22px 24px 48px; display: flex; flex-direction: column; gap: 24px; }
.over-sec h6 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-muted); margin: 0 0 11px; font-weight: 500; }

/* ---------- Charts ---------- */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.legend { display: flex; flex-direction: column; gap: 7px; }
.legend .li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend .li .sw { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.legend .li .v { margin-left: auto; font-family: var(--font-mono); color: var(--fg-muted); font-variant-numeric: tabular-nums; padding-left: 16px; }
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 130px; padding-top: 8px; }
.vbars .vb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.vbars .vb .stack { width: 100%; max-width: 30px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 3px 3px 0 0; overflow: hidden; }
.vbars .vb .stack > span { display: block; }
.vbars .vb .x { font-family: var(--font-mono); font-size: 10px; color: var(--fg-subtle); }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.heat .cell { aspect-ratio: 1; border-radius: 2px; background: var(--ink-8); }

/* ---------- Calendar ---------- */
.cal { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg-elevated); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-dow div { padding: 9px 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); border-right: 1px solid var(--line); }
.cal-dow div:last-child { border-right: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px 8px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--bg); }
.cal-cell .dn { font-family: var(--font-mono); font-size: 11px; color: var(--fg-subtle); font-variant-numeric: tabular-nums; }
.cal-cell.today .dn { background: var(--signal-500); color: var(--ink-10); width: 20px; height: 20px; border-radius: 5px; display: flex; align-items: center; justify-content: center; }
.cal-ev { font-size: 11px; padding: 3px 6px; border-radius: 4px; border-left: 2px solid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; cursor: pointer; }
.cal-ev .ph { font-family: var(--font-mono); font-size: 9px; opacity: 0.7; }

/* ---------- Kanban / pipeline ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(258px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; min-height: 200px; }
.kcol-hd { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.kcol-hd .dot { width: 7px; height: 7px; border-radius: 999px; }
.kcol-hd h4 { font-size: 12px; font-weight: 600; font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; margin: 0; }
.kcol-hd .c { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--fg-muted); }
.kcol-bd { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kcard { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: 5px; padding: 11px 12px; cursor: pointer; transition: border-color 120ms, box-shadow 120ms; }
.kcard:hover { border-color: var(--line-strong); box-shadow: var(--e-1); }
.kcard .code { font-family: var(--font-mono); font-size: 10px; color: var(--fg-subtle); }
.kcard .ttl { font-size: 13px; font-weight: 600; margin: 4px 0 2px; letter-spacing: -0.01em; }
.kcard .cl { font-size: 12px; color: var(--fg-muted); }
.kcard .ft { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

/* ---------- Asset / drawing grid ---------- */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 14px; }
.asset { border: 1px solid var(--line); background: var(--bg-elevated); border-radius: 6px; overflow: hidden; cursor: pointer; transition: border-color 120ms, box-shadow 120ms; }
.asset:hover { border-color: var(--line-strong); box-shadow: var(--e-2); }
.asset .thumb { aspect-ratio: 4/3; background: var(--ink-8); display: flex; align-items: center; justify-content: center; position: relative; border-bottom: 1px solid var(--line); }
.asset .thumb i { width: 30px; height: 30px; color: var(--ink-6); stroke-width: 1.3; }
.asset .thumb .rev { position: absolute; top: 8px; right: 8px; font-family: var(--font-mono); font-size: 9px; background: var(--ink-0); color: var(--ink-10); padding: 2px 6px; border-radius: 3px; letter-spacing: 0.06em; }
.asset .meta { padding: 10px 12px; }
.asset .meta .fn { font-size: 13px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset .meta .det { font-family: var(--font-mono); font-size: 10px; color: var(--fg-subtle); margin-top: 3px; display: flex; justify-content: space-between; }

/* ---------- Alerts / feed ---------- */
.feed { display: flex; flex-direction: column; }
.feed .it { display: grid; grid-template-columns: 28px 1fr auto; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); align-items: start; }
.feed .it:first-child { border-top: 0; }
.feed .it .ic { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex: none; }
.feed .it .ic i { width: 15px; height: 15px; stroke-width: 1.7; }
.feed .it .ic.red { background: var(--signal-50); color: var(--crit); }
.feed .it .ic.amber { background: #FCEFD8; color: #B5740B; }
.feed .it .ic.green { background: var(--ok-soft); color: var(--ok); }
.feed .it .ic.blue { background: var(--info-soft); color: var(--info); }
.feed .it .ic.grey { background: var(--ink-8); color: var(--ink-3); }
.feed .it .tx { font-size: 13px; line-height: 1.45; }
.feed .it .tx b { font-weight: 600; }
.feed .it .tx .s { color: var(--fg-muted); font-size: 12px; margin-top: 2px; }
.feed .it .ts { font-family: var(--font-mono); font-size: 10px; color: var(--fg-faint); white-space: nowrap; padding-top: 2px; }

/* ---------- List rows (compact) ---------- */
.lrow { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.lrow:first-child { border-top: 0; }
.lrow .ln { font-size: 13px; font-weight: 500; }
.lrow .ls { font-size: 12px; color: var(--fg-muted); }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.dot { width: 7px; height: 7px; border-radius: 999px; flex: none; }
.kbd { font-family: var(--font-mono); font-size: 10px; color: var(--fg-subtle); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; }
.note { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 6px; padding: 13px 15px; font-size: 13px; color: var(--fg-muted); }
.swx-link { color: var(--signal-600); font-weight: 500; cursor: pointer; }
.swx-link:hover { text-decoration: underline; }
.health { display: inline-flex; gap: 3px; }
.health span { width: 5px; height: 12px; border-radius: 1px; background: var(--ink-7); }
.health span.on.g { background: var(--ok); }
.health span.on.a { background: var(--brand-yellow); }
.health span.on.r { background: var(--crit); }

/* ============================================================
   PRINT — strip the app chrome and let content flow across as many
   pages as it needs (Reporting → Export uses window.print()). The
   shell is a fixed-height flex with internal scroll, so without these
   overrides the browser captures only the on-screen viewport (1 page)
   and includes the sidebar/top bar. Add class "no-print" to any
   on-page control that shouldn't appear in the printout.
   ============================================================ */
@media print {
  /* hide app chrome + transient UI */
  .sb, #swx-console-sb, .top, #swx-console-top, .tn, .tnsub,
  .swxp, .swxp-scrim, .no-print { display: none !important; }
  /* interactive controls don't belong in a printed report */
  .btn, .ic-btn, .page-status { display: none !important; }

  /* unlock the fixed-height shell so the report paginates naturally */
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  .shell, .shell-top { display: block !important; min-height: 0 !important; }
  .main, .main-top { display: block !important; height: auto !important; overflow: visible !important; }
  #swx-console-content { max-width: none !important; width: auto !important; margin: 0 !important; padding: 0 !important; }

  /* keep cards/tables from splitting awkwardly across page breaks */
  .card, .kpi, .stat-tile, .kpi-card, table { break-inside: avoid; }
  .card-bd { overflow: visible !important; }
}