/* =========================================================================
   Clearline Design System — tokens + base + app shell + components
   Industrial ledger aesthetic. NOT Tailwind. NOT shadcn.
   Manila/legal-pad neutrals · petroleum-ink blue · square radii · zebra tables.
   ========================================================================= */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/Inter-VariableFont_opsz_wght.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url('../fonts/Inter-Italic-VariableFont_opsz_wght.ttf') format('truetype'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/JetBrainsMono-VariableFont_wght.ttf') format('truetype'); }
@font-face { font-family: 'JetBrains Mono'; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url('../fonts/JetBrainsMono-Italic-VariableFont_wght.ttf') format('truetype'); }

:root {
  --accent-50:  #E6EAF1; --accent-100: #C2CCDD; --accent-200: #94A3BD;
  --accent-400: #3C5689; --accent-500: #2C4670; --accent-600: #243B5E;
  --accent-700: #1A2B45; --accent-800: #10192B;

  --ink-0:   #FFFFFF; --ink-25:  #F4F3F0; --ink-50:  #EEEEEA; --ink-100: #E8E7E2;
  --ink-200: #D2D0CA; --ink-300: #B5B3AC; --ink-400: #807E78; --ink-500: #605F59;
  --ink-600: #4C4B47; --ink-700: #33322E; --ink-800: #262522; --ink-900: #1C1B19;

  --good-50: #E8EEE5; --good-100: #C6D4BE; --good-600: #3D6B3A; --good-700: #2D5128;
  --warn-50: #F4ECD8; --warn-100: #E9D5A8; --warn-600: #9C6710; --warn-700: #74500D;
  --bad-50:  #F1DDDB; --bad-100:  #E2BCB7; --bad-600:  #A2342E; --bad-700:  #7A2722;

  --bg-app: var(--ink-50); --bg-surface: var(--ink-0); --bg-subtle: var(--ink-100);
  --bg-hover: var(--ink-100); --bg-zebra: var(--ink-25); --bg-selected: #E4E9F0;

  --fg-primary: var(--ink-900); --fg-secondary: var(--ink-600); --fg-tertiary: var(--ink-500);
  --fg-muted: var(--ink-400); --fg-inverse: var(--ink-0); --fg-accent: var(--accent-600);

  --border-default: var(--ink-200); --border-strong: var(--ink-300); --border-accent: var(--accent-600);

  --status-paid-fg: var(--good-700);      --status-paid-bg: var(--good-50);      --status-paid-bar: var(--good-600);
  --status-pending-fg: var(--warn-700);   --status-pending-bg: var(--warn-50);   --status-pending-bar: var(--warn-600);
  --status-denied-fg: var(--bad-700);     --status-denied-bg: var(--bad-50);     --status-denied-bar: var(--bad-600);
  --status-submitted-fg: var(--accent-700); --status-submitted-bg: var(--accent-50); --status-submitted-bar: var(--accent-600);
  --status-followup-fg: var(--ink-700);   --status-followup-bg: var(--ink-100);  --status-followup-bar: var(--ink-500);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --text-11: 11px; --text-12: 12px; --text-13: 13px; --text-14: 14px;
  --text-16: 16px; --text-18: 18px; --text-20: 20px; --text-24: 24px; --text-32: 32px;
  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700;
  --lh-tight: 1.3; --lh-snug: 1.4; --lh-normal: 1.5;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;

  --sidebar-w-expanded: 232px; --sidebar-w-collapsed: 52px; --topbar-h: 48px;
  --drawer-w: 480px; --table-row-h: 34px; --table-row-h-comfy: 42px;

  --radius-pill: 999px; --radius-sm: 2px; --radius-md: 3px; --radius-lg: 4px; --radius-xl: 6px;

  --shadow-card: none;
  --shadow-elev: 0 1px 0 rgba(28,27,25,0.04), 0 6px 14px rgba(28,27,25,0.10);
  --shadow-focus: 0 0 0 2px var(--ink-0), 0 0 0 3px var(--accent-600);

  --duration-fast: 100ms; --duration-base: 140ms; --duration-drawer: 180ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: var(--font-sans);
  font-size: var(--text-14); line-height: var(--lh-normal); color: var(--fg-primary);
  background: var(--bg-app); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.tabular, table, .num, [data-num] { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- Type helpers ---------- */
.t-page-title    { font-size: var(--text-24); font-weight: var(--weight-bold);     line-height: var(--lh-snug); letter-spacing: -0.015em; color: var(--fg-primary); margin: 0; }
.t-section-title { font-size: var(--text-18); font-weight: var(--weight-semibold); line-height: var(--lh-snug); letter-spacing: -0.01em;  color: var(--fg-primary); margin: 0; }
.t-h3            { font-size: var(--text-16); font-weight: var(--weight-semibold); line-height: var(--lh-snug); color: var(--fg-primary); margin: 0; }
.t-body          { font-size: var(--text-14); font-weight: var(--weight-regular);  line-height: var(--lh-normal); color: var(--fg-primary); }
.t-body-strong   { font-size: var(--text-14); font-weight: var(--weight-medium);   line-height: var(--lh-normal); color: var(--fg-primary); }
.t-table         { font-size: var(--text-13); font-weight: var(--weight-regular);  line-height: var(--lh-tight); color: var(--fg-primary); }
.t-table-strong  { font-size: var(--text-13); font-weight: var(--weight-medium);   line-height: var(--lh-tight); color: var(--fg-primary); }
.t-meta          { font-size: var(--text-12); font-weight: var(--weight-regular);  line-height: var(--lh-snug); color: var(--fg-tertiary); }
.t-marker        { font-size: var(--text-11); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-tertiary); }
.t-mono          { font-family: var(--font-mono); font-size: var(--text-13); font-variant-numeric: tabular-nums; }
.t-hero-num      { font-size: var(--text-32); font-weight: var(--weight-bold); line-height: 1.05; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.muted           { color: var(--fg-tertiary); }
.mono            { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-md); }

/* ============================================================
   APP SHELL — Sidebar / Topbar / Layout / Quick Drawer
   ============================================================ */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w-expanded) 1fr; min-height: 100vh; }
.app-shell.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.sidebar {
  background: var(--ink-900); color: var(--ink-100);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--ink-800);
}
.sidebar .brand { padding: var(--space-4) var(--space-4); display: flex; align-items: center; gap: var(--space-2); border-bottom: 1px solid var(--ink-800); height: var(--topbar-h); }
.sidebar .brand img { height: 20px; }
.sidebar .nav { flex: 1; padding: var(--space-3) var(--space-2); display: flex; flex-direction: column; gap: 2px; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 6px var(--space-3); color: var(--ink-200);
  text-decoration: none; cursor: pointer;
  font-size: var(--text-13); border-radius: var(--radius-md);
  position: relative; border: none; background: transparent; text-align: left; width: 100%;
}
.sidebar .nav-item:hover { background: var(--ink-800); color: var(--ink-0); }
.sidebar .nav-item.active { background: var(--ink-800); color: var(--ink-0); }
.sidebar .nav-item.active::before {
  content: ''; position: absolute; left: -8px; top: 4px; bottom: 4px;
  width: 3px; background: var(--accent-400); border-radius: 0 2px 2px 0;
}
.sidebar .nav-item .badge { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-11); color: var(--ink-300); background: var(--ink-800); padding: 1px 6px; border-radius: var(--radius-sm); }
.sidebar .nav-item.active .badge { background: var(--accent-600); color: var(--ink-0); }
.sidebar .nav-item.soon { opacity: 0.55; }
.sidebar .nav-item.soon:hover { opacity: 0.85; }
.sidebar .nav-item .soon-pill { margin-left: auto; font-family: var(--font-mono); font-size: var(--text-11); color: var(--ink-400); border: 1px solid var(--ink-700); padding: 0 6px; border-radius: var(--radius-sm); text-transform: uppercase; letter-spacing: 0.06em; }
.sidebar .nav-section { padding: var(--space-3) var(--space-3) var(--space-1); font-size: var(--text-11); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-400); }
.sidebar .user { padding: var(--space-3); border-top: 1px solid var(--ink-800); display: flex; align-items: center; gap: var(--space-2); }
.sidebar .user-meta { display: flex; flex-direction: column; min-width: 0; }
.sidebar .user-name { font-size: var(--text-13); color: var(--ink-0); }
.sidebar .user-role { font-size: var(--text-11); color: var(--ink-400); text-transform: uppercase; letter-spacing: 0.06em; }
.app-shell.collapsed .sidebar .nav-item .label,
.app-shell.collapsed .sidebar .nav-item .badge,
.app-shell.collapsed .sidebar .user-meta,
.app-shell.collapsed .sidebar .brand .wordmark,
.app-shell.collapsed .sidebar .nav-section { display: none; }

.app-main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h); background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-4); position: sticky; top: 0; z-index: 10;
}
.topbar .search { flex: 1; max-width: 520px; position: relative; }
.topbar .search input {
  width: 100%; height: 30px; padding: 0 var(--space-3) 0 30px;
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--ink-25); font: inherit; font-size: var(--text-13);
}
.topbar .search input:focus { background: var(--bg-surface); border-color: var(--border-strong); outline: none; }
.topbar .search .icon { position: absolute; left: 8px; top: 7px; color: var(--fg-muted); }
.topbar .search .kbd { position: absolute; right: 8px; top: 5px; font-family: var(--font-mono); font-size: var(--text-11); color: var(--fg-muted); border: 1px solid var(--border-default); padding: 1px 4px; border-radius: var(--radius-sm); background: var(--ink-0); }
.topbar .sync { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: var(--text-11); color: var(--fg-tertiary); }
.topbar .sync .dot { width: 8px; height: 8px; background: var(--good-600); border-radius: var(--radius-sm); }
.topbar .right { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.topbar .bell { position: relative; }
.topbar .bell .count { position: absolute; top: -4px; right: -4px; background: var(--bad-600); color: var(--ink-0); font-family: var(--font-mono); font-size: 10px; padding: 0 4px; border-radius: var(--radius-sm); min-width: 14px; text-align: center; }

.content {
  padding: var(--space-4) var(--space-6); flex: 1; overflow: auto; min-width: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 var(--space-3); border-radius: var(--radius-md);
  border: 1px solid transparent; font: inherit; font-size: var(--text-13);
  cursor: pointer; transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
  user-select: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary    { background: var(--accent-600); color: var(--ink-0); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); }
.btn-primary:hover:not(:disabled) { background: var(--accent-700); }
.btn-secondary  { background: var(--bg-surface); color: var(--fg-primary); border-color: var(--border-default); }
.btn-secondary:hover:not(:disabled) { border-color: var(--border-strong); background: var(--ink-25); }
.btn-ghost      { background: transparent; color: var(--fg-primary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); }
.btn-destructive { background: var(--bad-600); color: var(--ink-0); box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); }
.btn-destructive:hover:not(:disabled) { background: var(--bad-700); }
.btn-sm { height: 24px; padding: 0 var(--space-2); font-size: var(--text-12); }
.btn-lg { height: 36px; padding: 0 var(--space-4); font-size: var(--text-14); }

/* ============================================================
   FIELDS / INPUTS
   ============================================================ */
.input, .select, .textarea {
  width: 100%; height: 30px; padding: 0 var(--space-2);
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--bg-surface); font: inherit; font-size: var(--text-13);
  color: var(--fg-primary);
}
.textarea { height: auto; min-height: 60px; padding: 6px var(--space-2); resize: vertical; line-height: var(--lh-normal); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: var(--shadow-focus); }
.input.mono, .textarea.mono { font-family: var(--font-mono); }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--bad-600); }

.field-label { display: block; font-size: var(--text-11); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-tertiary); margin-bottom: 4px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3) var(--space-4); }
.field-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field-row.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   STATUS MARKER
   ============================================================ */
.marker { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: var(--text-11); font-weight: var(--weight-medium); letter-spacing: 0.06em; text-transform: uppercase; }
.marker .sq { width: 10px; height: 10px; border-radius: var(--radius-sm); flex: none; }
.marker.filled { padding: 2px 6px; border-radius: var(--radius-sm); }
.marker.paid       { color: var(--status-paid-fg); }       .marker.paid .sq { background: var(--status-paid-bar); }
.marker.paid.filled       { background: var(--status-paid-bg); }
.marker.pending    { color: var(--status-pending-fg); }    .marker.pending .sq { background: var(--status-pending-bar); }
.marker.pending.filled    { background: var(--status-pending-bg); }
.marker.denied     { color: var(--status-denied-fg); }     .marker.denied .sq { background: var(--status-denied-bar); }
.marker.denied.filled     { background: var(--status-denied-bg); }
.marker.submitted  { color: var(--status-submitted-fg); }  .marker.submitted .sq { background: var(--status-submitted-bar); }
.marker.submitted.filled  { background: var(--status-submitted-bg); }
.marker.followup   { color: var(--status-followup-fg); }   .marker.followup .sq { background: var(--status-followup-bar); }
.marker.followup.filled   { background: var(--status-followup-bg); }
.marker.draft      { color: var(--fg-tertiary); }          .marker.draft .sq { background: var(--ink-300); }
.marker.draft.filled      { background: var(--ink-100); }
.marker.ready      { color: var(--accent-700); }           .marker.ready .sq { background: var(--accent-500); }
.marker.ready.filled      { background: var(--accent-50); }
.marker.exported   { color: var(--good-700); }             .marker.exported .sq { background: var(--good-600); }
.marker.exported.filled   { background: var(--good-50); }
.marker.invalid    { color: var(--bad-700); }              .marker.invalid .sq { background: var(--bad-600); }
.marker.invalid.filled    { background: var(--bad-50); }

/* ============================================================
   AVATARS / PILLS / CARDS
   ============================================================ */
.avatar { display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-100); color: var(--accent-700); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--text-11); font-weight: var(--weight-semibold);
  width: 24px; height: 24px; flex: none; }
.avatar.tone-jr { background: #C2CCDD; color: #1A2B45; }
.avatar.tone-ms { background: #C6D4BE; color: #2D5128; }
.avatar.tone-ap { background: #E2BCB7; color: #7A2722; }
.avatar.tone-so { background: #E9D5A8; color: #74500D; }

.pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--ink-100); color: var(--ink-700); font-size: var(--text-12); }
.pill.accent { background: var(--accent-50); color: var(--accent-700); }

.card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-4); }
.card.flush { padding: 0; }
.card-header { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default); display: flex; align-items: center; gap: var(--space-3); }
.card-body { padding: var(--space-4); }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; }
table.cl-table { width: 100%; border-collapse: collapse; font-size: var(--text-13); font-variant-numeric: tabular-nums; }
.cl-table thead th {
  position: sticky; top: 0; background: var(--ink-100); z-index: 1;
  font-weight: var(--weight-medium); font-size: var(--text-12); text-align: left;
  padding: 0 var(--space-3); height: 32px; color: var(--fg-secondary);
  border-bottom: 1px solid var(--border-default);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.cl-table thead th.num { text-align: right; }
.cl-table tbody tr { height: var(--table-row-h); cursor: pointer; }
.cl-table tbody tr:nth-child(even) { background: var(--bg-zebra); }
.cl-table tbody tr:hover { background: var(--bg-hover); }
.cl-table tbody tr.selected { background: var(--bg-selected); }
.cl-table tbody tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent-600); }
.cl-table tbody td { padding: 0 var(--space-3); border-bottom: 1px solid var(--ink-100); vertical-align: middle; }
.cl-table tbody td.num { text-align: right; font-family: var(--font-mono); }
.cl-table tbody td.mono { font-family: var(--font-mono); }
.cl-table td.status-bar { position: relative; padding: 0; width: 3px; }
.cl-table td.status-bar::before { content: ''; position: absolute; inset: 0; }
.cl-table tbody tr.s-paid       td.status-bar::before { background: var(--status-paid-bar); }
.cl-table tbody tr.s-pending    td.status-bar::before { background: var(--status-pending-bar); }
.cl-table tbody tr.s-denied     td.status-bar::before { background: var(--status-denied-bar); }
.cl-table tbody tr.s-submitted  td.status-bar::before { background: var(--status-submitted-bar); }
.cl-table tbody tr.s-followup   td.status-bar::before { background: var(--status-followup-bar); }
.cl-table tbody tr.s-draft      td.status-bar::before { background: var(--ink-300); }
.cl-table tbody tr.s-ready      td.status-bar::before { background: var(--accent-500); }
.cl-table tbody tr.s-exported   td.status-bar::before { background: var(--good-600); }
.cl-table tbody tr.s-invalid    td.status-bar::before { background: var(--bad-600); }

.empty-state { padding: var(--space-12) var(--space-6); text-align: center; color: var(--fg-tertiary); }
.empty-state .title { font-size: var(--text-16); font-weight: var(--weight-semibold); color: var(--fg-primary); margin-bottom: var(--space-2); }
.empty-state .body { font-size: var(--text-13); margin-bottom: var(--space-4); }

/* ============================================================
   FILTER TOOLBAR / TABS
   ============================================================ */
.toolbar { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; flex-wrap: wrap; }
.tabs { display: flex; align-items: center; gap: var(--space-1); border-bottom: 1px solid var(--border-default); }
.tab { padding: 8px var(--space-3); cursor: pointer; border: none; background: transparent; font: inherit; color: var(--fg-secondary); font-size: var(--text-13); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--fg-primary); border-bottom-color: var(--accent-600); font-weight: var(--weight-medium); }
.tab .count { font-family: var(--font-mono); color: var(--fg-tertiary); margin-left: 6px; font-size: var(--text-11); }
.tab .count.bad { color: var(--bad-700); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--ink-100); border-radius: var(--radius-md); font-size: var(--text-12); }
.chip.active { background: var(--accent-50); color: var(--accent-700); }
.chip button { background: transparent; border: none; cursor: pointer; padding: 0; line-height: 1; color: inherit; }

/* ============================================================
   QUICK DRAWER / MODAL
   ============================================================ */
.drawer-scrim { position: fixed; inset: 0; background: rgba(26,23,20,0.40); z-index: 30; opacity: 0; pointer-events: none; transition: opacity var(--duration-drawer) var(--ease); }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: var(--drawer-w); background: var(--bg-surface); border-left: 1px solid var(--border-default); box-shadow: var(--shadow-elev); z-index: 31; transform: translateX(100%); transition: transform var(--duration-drawer) var(--ease); display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer .head { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-default); background: var(--ink-50); }
.drawer .head .id { font-family: var(--font-mono); font-weight: var(--weight-semibold); font-size: var(--text-13); }
.drawer .head .name { font-size: var(--text-18); font-weight: var(--weight-semibold); margin-top: 4px; }
.drawer .body { flex: 1; overflow: auto; padding: var(--space-5); }
.drawer .footer { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-default); background: var(--ink-50); display: flex; align-items: center; gap: var(--space-2); }
.drawer .footer .spacer { flex: 1; }

.modal-scrim { position: fixed; inset: 0; background: rgba(26,23,20,0.40); z-index: 40; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--bg-surface); border-radius: var(--radius-xl); border: 1px solid var(--border-default); box-shadow: var(--shadow-elev); padding: var(--space-5); min-width: 360px; max-width: 90vw; max-height: 90vh; overflow: auto; }

/* ============================================================
   TIMELINE / AI SUGGESTION
   ============================================================ */
.timeline { display: flex; flex-direction: column; gap: 0; margin-top: var(--space-4); }
.timeline-event { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-3); position: relative; padding-bottom: var(--space-3); }
.timeline-event:not(.last)::before { content: ''; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--border-default); }
.timeline-event .icon-sq { width: 18px; height: 18px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; background: var(--ink-100); color: var(--fg-secondary); }
.timeline-event.t-denied .icon-sq    { background: var(--bad-50); color: var(--bad-700); }
.timeline-event.t-paid .icon-sq      { background: var(--good-50); color: var(--good-700); }
.timeline-event.t-pending .icon-sq   { background: var(--warn-50); color: var(--warn-700); }
.timeline-event.t-submitted .icon-sq { background: var(--accent-50); color: var(--accent-700); }
.timeline-event .title { font-size: var(--text-13); font-weight: var(--weight-medium); }
.timeline-event .time  { font-size: var(--text-11); color: var(--fg-tertiary); font-family: var(--font-mono); margin-top: 2px; }

.ai-suggestion { border: 1px solid var(--accent-200); background: var(--accent-50); padding: var(--space-3); border-radius: var(--radius-md); margin: var(--space-4) 0; }
.ai-suggestion .label { font-size: var(--text-11); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-700); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ai-suggestion .body { font-size: var(--text-13); color: var(--fg-primary); margin-bottom: var(--space-3); }
.ai-suggestion .actions { display: flex; gap: var(--space-2); }

/* ============================================================
   VALIDATION ISSUE LIST
   ============================================================ */
.issues { display: flex; flex-direction: column; gap: 6px; }
.issue { display: grid; grid-template-columns: 14px 1fr auto; gap: var(--space-2); padding: 6px var(--space-3); border-radius: var(--radius-md); font-size: var(--text-13); align-items: center; }
.issue .sq { width: 10px; height: 10px; border-radius: var(--radius-sm); }
.issue.error   { background: var(--bad-50); color: var(--bad-700); }
.issue.error .sq { background: var(--bad-600); }
.issue.warning { background: var(--warn-50); color: var(--warn-700); }
.issue.warning .sq { background: var(--warn-600); }
.issue .field-name { font-family: var(--font-mono); font-size: var(--text-11); color: inherit; opacity: 0.85; }

/* ============================================================
   HOME / KPI / WORK QUEUES
   ============================================================ */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.kpi { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); }
.kpi .label { font-size: var(--text-11); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-tertiary); }
.kpi .value { font-size: var(--text-32); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 6px; color: var(--fg-primary); }
.kpi .delta { font-size: var(--text-12); color: var(--fg-tertiary); font-family: var(--font-mono); margin-top: 4px; }
.kpi.tone-warn .value { color: var(--warn-700); }
.kpi.tone-bad .value  { color: var(--bad-700); }
.kpi.tone-good .value { color: var(--good-700); }
.kpi.tone-accent .value { color: var(--accent-700); }

.queue-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.queue { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); }
.queue .head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.queue .head .title { font-weight: var(--weight-semibold); font-size: var(--text-14); }
.queue .head .count { font-family: var(--font-mono); font-size: var(--text-11); background: var(--ink-100); padding: 1px 6px; border-radius: var(--radius-sm); color: var(--fg-secondary); }
.queue-row { display: grid; grid-template-columns: 80px 1fr auto; gap: var(--space-2); padding: 6px 0; border-bottom: 1px solid var(--ink-100); font-size: var(--text-13); align-items: center; }
.queue-row:last-child { border-bottom: none; }
.queue-row .id { font-family: var(--font-mono); color: var(--fg-secondary); }
.queue-row .amount { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.queue .footer { margin-top: var(--space-2); }
.queue .footer a { color: var(--accent-600); font-size: var(--text-13); text-decoration: none; }
.queue .footer a:hover { text-decoration: underline; }

/* ============================================================
   CMS-1500 PRINT
   ============================================================ */
.cms-1500 { font-family: var(--font-mono); font-size: 12px; line-height: 1.3; color: #000; background: #fff; padding: 0.5in; max-width: 8.5in; margin: 0 auto; }
.cms-1500 .form-title { text-align: center; font-weight: bold; margin-bottom: var(--space-3); font-size: 14px; }
.cms-1500 .form-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; border-bottom: 1px solid #000; padding: 4px 0; }
.cms-1500 .cell { padding: 2px; min-height: 22px; border-right: 1px solid #ccc; }
.cms-1500 .cell:last-child { border-right: none; }
.cms-1500 .lbl { font-size: 8px; text-transform: uppercase; color: #555; display: block; }
.cms-1500 .val { font-size: 11px; }
@media print { .cms-1500 { padding: 0.25in; } .no-print { display: none !important; } body { background: #fff; } }

/* ============================================================
   UTIL
   ============================================================ */
.row { display: flex; align-items: center; gap: var(--space-2); }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: var(--space-2); }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border-default); margin: var(--space-4) 0; }
.section-head { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0 var(--space-2); }
.section-head .t-section-title { flex: 1; }

a { color: var(--accent-600); }
a:hover { color: var(--accent-700); }
hr { border: none; border-top: 1px solid var(--border-default); }
