:root {
  --ink: #16213A;
  --ink-soft: #2A3A5C;
  --action: #2B5FAD;
  --action-soft: #1F4A8A;
  --paper: #F4F5F2;
  --paper-raised: #FFFFFF;
  --rule: #D8DAD3;
  --rule-strong: #B7BAB2;
  --seal: #A63D2F;
  --seal-soft: #F4E3DF;
  --text: #1C1E1B;
  --text-muted: #6B6E68;

  --status-pending: #9AA0A6;
  --status-pending-bg: #EDEEEF;
  --status-staged: #3D6B8C;
  --status-staged-bg: #E3EBF0;
  --status-reviewed: #9A7B1F;
  --status-reviewed-bg: #F3ECD8;
  --status-promoted: #2F6E4F;
  --status-promoted-bg: #E2EEE7;
  --status-attention: #A63D2F;
  --status-attention-bg: #F4E3DF;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
}
h1, h2, h3, .display {
  font-family: 'Zilla Slab', serif;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.mono, .num, td.num, .stamp { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.nav { background: var(--ink); color: #E8EAF2; padding: 28px 20px; display: flex; flex-direction: column; }
.nav-brand { font-family: 'Zilla Slab', serif; font-weight: 700; font-size: 20px; color: #fff; margin-bottom: 4px; }
.nav-brand small { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 400; color: #8E9BC2; letter-spacing: 0.06em; margin-top: 2px; }
.nav-sep { height: 1px; background: #2A3A5C; margin: 20px 0; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 500; color: #B7C0DA; cursor: pointer; }
.nav-item.active { background: #202E4C; color: #fff; }
.nav-item:hover:not(.active) { background: #1C2A47; }
.nav-icon { width: 16px; text-align: center; opacity: 0.85; font-size: 13px; }
.nav-foot { margin-top: auto; font-size: 11.5px; color: #6E7BA0; line-height: 1.5; }

.main { padding: 32px 40px 60px; max-width: 1160px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 6px; }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.page-head h1 { font-size: 27px; margin: 0; }
.page-sub { color: var(--text-muted); font-size: 13.5px; margin-top: 6px; }
.head-actions { display: flex; gap: 10px; }

.btn { font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; font-weight: 500; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--rule-strong); background: var(--paper-raised); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--ink-soft); }
.btn-primary { background: var(--action); color: #fff; border-color: var(--action); }
.btn-primary:hover { background: var(--action-soft); }
.btn-danger { background: var(--seal); color: #fff; border-color: var(--seal); }
.btn-danger:hover { background: #8E3327; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: #EAEBE7; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Generic "processing" state -- htmx automatically adds .htmx-request to
   whichever element triggered the in-flight request (unless a specific
   hx-indicator is set elsewhere), for as long as that request is pending.
   This rule picks that up automatically on ANY .btn, with no per-button
   wiring needed in any template. hx-disabled-elt="this" (set once, on
   <body>, and inherited by every descendant per htmx's own attribute
   inheritance) additionally disables the button itself for the same
   duration, preventing an accidental double-click from firing the same
   action twice. */
.btn.htmx-request {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.htmx-request::after {
  content: "Working…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.btn-primary.htmx-request, .btn-danger.htmx-request { opacity: 1; }
.btn-primary.htmx-request { background: var(--action-soft); }
.btn-primary.htmx-request::after { color: #fff; }
.btn-danger.htmx-request { background: #8E3327; }
.btn-danger.htmx-request::after { color: #fff; }

.tracker { display: flex; align-items: center; margin: 26px 0 30px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 10px; padding: 18px 22px; }
.tstep { display: flex; align-items: center; gap: 10px; flex: 1; }
.tstep .dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 600; border: 2px solid var(--rule-strong); color: var(--text-muted); flex-shrink: 0; }
.tstep.done .dot { background: var(--status-promoted); border-color: var(--status-promoted); color: #fff; }
.tstep.current .dot { background: var(--status-staged); border-color: var(--status-staged); color: #fff; }
.tstep .label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.tstep.done .label, .tstep.current .label { color: var(--text); }
.tstep .count { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-muted); }
.tline { height: 2px; flex: 0 0 40px; background: var(--rule-strong); margin: 0 4px; }
.tline.done { background: var(--status-promoted); }

.card { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; padding: 12px 18px; border-bottom: 1px solid var(--rule); background: #FAFAF8; }
tbody td { padding: 13px 18px; border-bottom: 1px solid var(--rule); font-size: 13.5px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFAF8; }
.company-code { font-family: 'IBM Plex Mono', monospace; font-weight: 600; letter-spacing: 0.02em; }
.company-name { color: var(--text-muted); font-size: 12px; margin-top: 1px; }

.stamp { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 5px 10px 5px 8px; border-radius: 4px; border: 1.5px solid currentColor; }
.stamp .dotmark { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stamp.pending { color: var(--status-pending); background: var(--status-pending-bg); }
.stamp.staged { color: var(--status-staged); background: var(--status-staged-bg); }
.stamp.reviewed { color: var(--status-reviewed); background: var(--status-reviewed-bg); }
.stamp.promoted { color: var(--status-promoted); background: var(--status-promoted-bg); transform: rotate(-1.5deg); }
.stamp.attention { color: var(--status-attention); background: var(--status-attention-bg); }
/* Promoted, but verification_status isn't 'passed' -- a legacy
   pre-verification period, or a genuine regression. Keeps the "stamp"
   tactile rotation of an ordinary Promoted badge (still reads as
   "promoted"), but in the attention palette instead of green, so it
   can't be mistaken for a clean promotion at a glance. */
.stamp.promoted-unverified { color: var(--status-attention); background: var(--status-attention-bg); transform: rotate(-1.5deg); }
/* A different run already promoted this exact company/period -- this
   attempt is moot, not merely "not started yet" (pending) or "something
   went wrong" (attention). No dotmark (that reads as an in-progress
   status light) and no rotation (that's the "promoted" family's own
   tactile signature) -- deliberately flatter and quieter than every other
   stamp, since there's nothing to do here. */
.stamp.superseded { color: var(--text-muted); background: var(--paper); border-style: dashed; }

.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Dashboard status grid -- companies (fixed at 8) as sticky-left rows,
   periods as columns. Periods is the axis that grows over time, so it's
   the one that scrolls; the company column stays put via position:sticky
   rather than a second, separately-scrolled panel, so there's exactly one
   scroll container and it can't drift out of sync with itself. */
/* max-width:100% pins this as the ONE scroll container regardless of how
   wide its content wants to be; width:max-content on the table forces it
   to size to its own natural content width (sum of every column's real
   width) instead of ever being squeezed down to fit -- that combination
   is what guarantees the horizontal scrollbar actually appears once there
   are enough period columns to overflow the card, rather than the table
   silently wrapping/shrinking its cells to fit instead. */
.dash-grid-scroll { overflow-x: auto; max-width: 100%; }
.dash-grid { border-collapse: collapse; width: max-content; }
.dash-grid th, .dash-grid td { border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); padding: 0; }
.dash-grid thead th { background: #FAFAF8; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; padding: 10px 16px; white-space: nowrap; text-align: left; }
.dash-grid-corner, .dash-grid-company-head {
  position: sticky; left: 0; z-index: 2;
  background: var(--paper-raised);
}
.dash-grid-corner { z-index: 3; }
.dash-grid-company-head { padding: 10px 16px; text-align: left; white-space: nowrap; }
.dash-grid-company-head .company-code { font-weight: 600; font-size: 13px; }
.dash-grid-cell { padding: 0; min-width: 118px; text-align: center; vertical-align: middle; }
.dash-grid-cell a { display: flex; align-items: center; justify-content: center; padding: 10px 10px; height: 100%; }
.dash-grid-cell a:hover { background: var(--paper); }
.dash-grid-empty { display: block; padding: 10px; color: var(--rule-strong); text-align: center; }
.timestamp { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-muted); }
.attention-note { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--status-attention); margin-top: 3px; }
.helper-text { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(22, 33, 58, 0.45); display: flex; align-items: flex-start; justify-content: center; padding-top: 64px; z-index: 50; }
.modal { background: var(--paper-raised); width: 620px; max-width: 92vw; border-radius: 12px; border: 1px solid var(--rule); box-shadow: 0 24px 60px rgba(22,33,58,0.25); overflow: hidden; }
.modal-head { padding: 22px 26px 18px; border-bottom: 1px solid var(--rule); }
.modal-head h2 { font-size: 19px; margin: 0 0 4px; }
.modal-head p { margin: 0; font-size: 12.5px; color: var(--text-muted); }

.wiz-steps { display: flex; padding: 16px 26px 0; gap: 4px; }
.wiz-step { flex: 1; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-align: center; padding-bottom: 12px; color: var(--text-muted); border-bottom: 3px solid var(--rule); }
.wiz-step.active { color: var(--ink); border-bottom-color: var(--seal); font-weight: 600; }
.wiz-step.past { color: var(--status-promoted); border-bottom-color: var(--status-promoted); }

.modal-body { padding: 22px 26px; }
.modal-body h3 { font-size: 14.5px; margin: 0 0 12px; }

.summary-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.summary-table th, .summary-table td { padding: 8px 10px; font-size: 12.5px; text-align: right; border-bottom: 1px solid var(--rule); }
.summary-table th:first-child, .summary-table td:first-child { text-align: left; }
.summary-table th { color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.diff-ok { color: var(--status-promoted); font-family: 'IBM Plex Mono', monospace; }
.diff-bad { color: var(--status-attention); font-family: 'IBM Plex Mono', monospace; font-weight: 600; }

.danger-box { background: var(--seal-soft); border: 1px solid #E0B8B0; border-radius: 8px; padding: 16px 18px; margin-bottom: 4px; }
.danger-box .dtitle { font-weight: 600; color: var(--seal); font-size: 13.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.danger-box ul { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; }
.danger-box li { margin-bottom: 3px; }
.danger-confirm { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; }

.modal-foot { display: flex; justify-content: space-between; align-items: center; padding: 16px 26px; border-top: 1px solid var(--rule); background: #FAFAF8; }
.step-nav { display: flex; gap: 8px; }

.review-clean { display: flex; align-items: flex-start; gap: 12px; background: var(--status-promoted-bg); border: 1px solid #BFDACB; border-radius: 8px; padding: 14px 16px; margin-bottom: 20px; }
.review-attention { display: flex; align-items: flex-start; gap: 12px; background: var(--status-attention-bg); border: 1px solid #E0B8B0; border-radius: 8px; padding: 14px 16px; margin-bottom: 20px; }
.dotmark-lg { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; background: var(--status-promoted); display: inline-block; position: relative; }
.dotmark-lg::after { content: "✓"; position: absolute; inset: 0; color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.review-clean-title { font-weight: 600; font-size: 13px; color: var(--status-promoted); margin-bottom: 2px; }
.review-attention .review-clean-title { color: var(--status-attention); }
.review-clean-sub { font-size: 12px; color: var(--text); line-height: 1.5; }

.unmatched-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
.unmatched-table th, .unmatched-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: left; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }
.htmx-request.htmx-indicator { display: inline; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }

.stub-note { background: var(--status-staged-bg); border: 1px solid #BFD3E0; border-radius: 8px; padding: 16px 20px; color: var(--status-staged); font-size: 13px; }

/* PR3 workflow/help additions; existing report styles retained. */

/* ==========================================================================
   Shared components (added 2026-10-22). One vocabulary, used on every page:
   .badge (status), .tip (tooltip), .alert (result of an action), .field /
   .input / .select (forms), .picker + .chip (company picker), .tiles / .tile
   (health counts), .next-action (what to do now), .table-wrap, .tabs.
   The old .stamp / .danger-box / .review-clean classes still work so pages
   not yet converted keep rendering; new work should use these.
   ========================================================================== */
:root {
  --ok: #2F6E4F;       --ok-bg: #E2EEE7;      --ok-line: #BFDACB;
  --info: #3D6B8C;     --info-bg: #E3EBF0;    --info-line: #BFD3E0;
  --warn: #7A6116;     --warn-bg: #F3ECD8;    --warn-line: #E0D2A6;
  --danger: #A63D2F;   --danger-bg: #F4E3DF;  --danger-line: #E0B8B0;
  --neutral: #5C5F59;  --neutral-bg: #EDEEEF; --neutral-line: #9AA0A6;
  --focus-ring: 0 0 0 3px rgba(43,95,173,0.18);
}

/* Nav groups */
.nav-group { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.1em; color: #8E9BC2; padding: 14px 10px 4px; }
.nav-item a { display: flex; align-items: center; gap: 10px; width: 100%; color: inherit; }
.nav-item .nav-count { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 11px; background: var(--danger); color: #fff; border-radius: 10px; padding: 1px 7px; }
.nav-icon svg { width: 15px; height: 15px; display: block; }

/* Status badge: one vocabulary */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 9px; border-radius: 4px; border: 1.5px solid currentColor; white-space: nowrap; }
.badge.b-neutral { color: var(--neutral); background: var(--neutral-bg); border-color: var(--neutral-line); }
.badge.b-info    { color: var(--info); background: var(--info-bg); }
.badge.b-warn    { color: var(--warn); background: var(--warn-bg); }
.badge.b-danger  { color: var(--danger); background: var(--danger-bg); }
.badge.b-ok      { color: var(--ok); background: var(--ok-bg); }
.badge.b-muted   { color: var(--text-muted); background: var(--paper); border-style: dashed; border-color: var(--neutral-line); }

/* Tooltip: hover or keyboard focus on the (i) mark */
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--text-muted); color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 600; cursor: help; vertical-align: middle; margin-left: 5px; outline: none; }
.tip:hover, .tip:focus { border-color: var(--action); color: var(--action); }
.tip:focus-visible { box-shadow: var(--focus-ring); }
.tip .tip-body { display: none; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: 300px; background: var(--ink); color: #E8EAF2; border-radius: 8px; padding: 11px 13px; font-family: 'IBM Plex Sans', sans-serif; font-size: 12.5px; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-transform: none; text-align: left; box-shadow: 0 10px 24px rgba(22,33,58,0.28); z-index: 60; white-space: normal; cursor: default; }
.tip .tip-body strong { color: #fff; }
.tip .tip-body a { color: #B7C0DA; text-decoration: underline; }
.tip:hover .tip-body, .tip:focus .tip-body, .tip:focus-within .tip-body { display: block; }
.tip.tip-right .tip-body { left: auto; right: -6px; transform: none; }
.tip.tip-left .tip-body { left: -6px; transform: none; }
.tip.tip-below .tip-body { bottom: auto; top: calc(100% + 8px); }

/* Alerts: result of an action. Same shape, four kinds. */
.alert { display: flex; align-items: flex-start; gap: 10px; border: 1px solid; border-radius: 8px; padding: 11px 14px; font-size: 13px; line-height: 1.5; }
.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert .alert-body { flex: 1; min-width: 0; }
.alert .alert-body strong { font-weight: 600; }
.alert .alert-close { margin-left: auto; width: 24px; height: 24px; border: none; background: transparent; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.alert.a-ok     { background: var(--ok-bg); border-color: var(--ok-line); color: #1C1E1B; }
.alert.a-info   { background: var(--info-bg); border-color: var(--info-line); color: #1C1E1B; }
.alert.a-warn   { background: var(--warn-bg); border-color: var(--warn-line); color: #1C1E1B; }
.alert.a-danger { background: var(--danger-bg); border-color: var(--danger-line); color: #1C1E1B; }
.alert.a-ok svg { color: var(--ok); } .alert.a-info svg { color: var(--info); } .alert.a-warn svg { color: var(--warn); } .alert.a-danger svg { color: var(--danger); }
.alert .alert-log { font-family: 'IBM Plex Mono', monospace; font-size: 12px; line-height: 1.6; max-height: 260px; overflow-y: auto; background: #FAFAF8; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; margin-top: 8px; }
#toast-region { position: fixed; right: 20px; bottom: 20px; width: 420px; max-width: calc(100vw - 40px); display: flex; flex-direction: column; gap: 10px; z-index: 80; }
#toast-region .alert { box-shadow: 0 12px 30px rgba(22,33,58,0.25); background-color: #fff; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; }
.field > .field-label, .field > label { display: flex; align-items: center; font-size: 12.5px; font-weight: 500; }
.input, .select { height: 40px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: 6px; background: #fff; font-family: 'IBM Plex Sans', sans-serif; font-size: 13.5px; color: var(--text); box-sizing: border-box; width: 100%; }
.select.mono, .input.mono { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
.input:focus, .select:focus { outline: none; border-color: var(--action); box-shadow: var(--focus-ring); }
.field-help { font-size: 12px; color: var(--text-muted); font-weight: 400; line-height: 1.5; }
.field-error { font-size: 12px; color: var(--danger); font-weight: 400; }
.fieldset { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fieldset > legend { font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.fieldset > legend .n { font-family: 'IBM Plex Mono', monospace; color: var(--text-muted); font-weight: 500; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: 8px; cursor: pointer; background: #fff; }
.choice:has(input:checked) { border-color: var(--action); background: #EEF3FA; }
.choice input { margin-top: 3px; }
.choice .choice-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.choice .choice-sub { font-size: 12.5px; color: var(--neutral); line-height: 1.45; margin-top: 2px; }
.btn-lg { height: 42px; padding: 0 22px; font-size: 13.5px; }
.btn.btn-busy::after, .btn.htmx-request::after { content: attr(data-busy) ; }
.btn:not([data-busy]).htmx-request::after { content: "Working…"; }

/* Company picker: presets + grid, one partial everywhere */
.picker { display: flex; flex-direction: column; gap: 8px; }
.picker-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 11px; border: 1px solid var(--rule-strong); border-radius: 14px; background: #fff; color: var(--ink); font-size: 11.5px; font-weight: 500; font-family: 'IBM Plex Sans', sans-serif; cursor: pointer; }
.chip:hover { border-color: var(--ink-soft); }
.picker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.picker-grid label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; background: #fff; }
.picker-grid label:has(input:checked) { border-color: var(--rule-strong); background: #FAFAF8; }

/* Health tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--neutral-line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: inherit; }
.tile:hover { border-color: var(--rule-strong); }
.tile .tile-label { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; }
.tile .tile-n { font-family: 'Zilla Slab', serif; font-size: 28px; font-weight: 600; line-height: 1.1; }
.tile .tile-sub { font-size: 12px; color: var(--text-muted); }
.tile.t-ok { border-left-color: var(--ok); } .tile.t-ok .tile-n { color: var(--ok); }
.tile.t-warn { border-left-color: var(--warn); } .tile.t-warn .tile-n { color: var(--warn); }
.tile.t-danger { border-left-color: var(--danger); } .tile.t-danger .tile-n { color: var(--danger); }
.tile.t-info { border-left-color: var(--info); } .tile.t-info .tile-n { color: var(--info); }

/* Next-action banner and step rail states */
.next-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid; border-radius: 8px; padding: 13px 18px; font-size: 13.5px; }
.next-action.a-danger { background: var(--danger-bg); border-color: var(--danger-line); }
.next-action.a-info { background: var(--info-bg); border-color: var(--info-line); }
.next-action.a-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.next-action .btn { white-space: nowrap; }
.tstep.blocked .dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.tstep.blocked .label { color: var(--danger); }
.tstep .sub { font-size: 12px; color: var(--text-muted); }
.tstep.blocked .sub { color: var(--danger); }
.tracker.steps { align-items: flex-start; }
.tracker.steps .tstep { align-items: flex-start; }

/* Tables */
.table-wrap { overflow-x: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.card-head .card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; }
.card-body { padding: 18px 22px; }
.count-pill { font-family: 'IBM Plex Mono', monospace; font-size: 11px; background: var(--danger); color: #fff; border-radius: 10px; padding: 1px 7px; margin-left: 6px; }
.count-pill.zero { background: var(--ok); }
tbody tr.row-attention { background: #FDF6F4; }

/* Tabs (condensed P&L result and anywhere else) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); }
.tabs a { padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--action); }
.tabs a:hover { color: var(--ink); }

/* Breadcrumb */
.crumbs { font-size: 12.5px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.crumbs a { color: var(--action); }

/* Page layout helpers */
.two-col { display: flex; gap: 20px; align-items: flex-start; }
.two-col > .col-main { flex: 1 1 0; min-width: 0; }
.two-col > .col-side { flex: 0 0 320px; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.env-banner { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid var(--warn-line); font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; text-align: center; padding: 5px 10px; }
