/* =========================================================================
   Reward Points — design system
   Source of truth for all visuals. Drop into <STATIC>/css/styles.css.
   ========================================================================= */

:root {
  /* Neutrals (slate) */
  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --surface-2: #f9fafb;
  --border:    #e5e7eb;
  --border-2:  #d1d5db;
  --ink:       #0f172a;
  --ink-2:     #334155;
  --muted:     #64748b;
  --muted-2:   #94a3b8;

  /* Accent — emerald (override via [data-accent]) */
  --accent:        #047857;
  --accent-soft:   #d1fae5;
  --accent-ink:    #064e3b;
  --accent-hover:  #065f46;

  /* Status */
  --green:   #047857;
  --green-s: #d1fae5;
  --amber:   #b45309;
  --amber-s: #fef3c7;
  --red:     #b91c1c;
  --red-s:   #fee2e2;
  --blue:    #1d4ed8;
  --blue-s:  #dbeafe;
  --slate-s: #e2e8f0;

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Density (override via [data-density]) */
  --row-py:   10px;
  --card-pad: 20px;
  --gap:      16px;
  --radius:   10px;
  --radius-sm: 6px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:    0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);

  /* Layout */
  --sidebar-w: 232px;
  --topbar-h:  60px;
}

/* Accent variants */
[data-accent="indigo"]  { --accent:#4338ca; --accent-soft:#e0e7ff; --accent-ink:#312e81; --accent-hover:#3730a3; }
[data-accent="amber"]   { --accent:#b45309; --accent-soft:#fef3c7; --accent-ink:#78350f; --accent-hover:#92400e; }
[data-accent="oxblood"] { --accent:#9f1239; --accent-soft:#ffe4e6; --accent-ink:#881337; --accent-hover:#881337; }

/* Density variants */
[data-density="compact"]     { --row-py:6px;  --card-pad:14px; --gap:12px; }
[data-density="comfortable"] { --row-py:14px; --card-pad:24px; --gap:20px; }

/* Dark theme */
[data-theme="dark"] {
  --bg:        #0b1220;
  --surface:   #111a2e;
  --surface-2: #0f172a;
  --border:    #1f2a44;
  --border-2:  #2c3a5a;
  --ink:       #e5edff;
  --ink-2:     #c5d0e6;
  --muted:     #8896b3;
  --muted-2:   #64748b;

  --accent-soft: rgba(16, 185, 129, 0.16);
  --green-s:     rgba(16, 185, 129, 0.16);
  --amber-s:     rgba(180, 83, 9, 0.20);
  --red-s:       rgba(185, 28, 28, 0.20);
  --blue-s:      rgba(29, 78, 216, 0.20);
  --slate-s:     rgba(148, 163, 184, 0.18);
  --shadow:      0 1px 3px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
}
[data-theme="dark"][data-accent="emerald"] { --accent:#10b981; --accent-ink:#a7f3d0; }
[data-theme="dark"][data-accent="indigo"]  { --accent:#818cf8; --accent-ink:#c7d2fe; }
[data-theme="dark"][data-accent="amber"]   { --accent:#f59e0b; --accent-ink:#fde68a; }
[data-theme="dark"][data-accent="oxblood"] { --accent:#fb7185; --accent-ink:#fecdd3; }

/* =========================================================================
   Base
   ========================================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 24px 0 12px; letter-spacing: -0.005em; }
h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
small, .small { font-size: 12px; color: var(--muted); }

code { font-family: var(--font-mono); font-size: 0.92em; color: var(--ink); }

hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

/* =========================================================================
   App shell
   ========================================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 18px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.nav-group {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted-2);
  padding: 14px 10px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 1px;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent-ink); }
[data-theme="dark"] .nav-link.active { color: var(--accent-ink); }
.nav-link .ico { width: 16px; height: 16px; flex: 0 0 16px; opacity: 0.85; }
.nav-link .count {
  margin-left: auto; font-size: 11px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 999px;
}

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .crumbs {
  font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.topbar .crumbs strong { color: var(--ink); font-weight: 500; }
.topbar .spacer { flex: 1; }
.topbar .user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-2);
}
.topbar .user .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}
.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.page {
  padding: 24px 28px 64px;
  max-width: 1280px;
  width: 100%;
}

/* =========================================================================
   Flash messages
   ========================================================================= */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
}
.flash.success { border-color: var(--green); background: var(--green-s); color: var(--green); }
.flash.error,
.flash.danger  { border-color: var(--red);   background: var(--red-s);   color: var(--red); }
.flash.warning { border-color: var(--amber); background: var(--amber-s); color: var(--amber); }
.flash.info    { border-color: var(--blue);  background: var(--blue-s);  color: var(--blue); }

/* =========================================================================
   Page header
   ========================================================================= */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.page-head .lede { color: var(--muted); font-size: 13px; margin-top: 2px; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
.back-link:hover { color: var(--ink); text-decoration: none; }

/* =========================================================================
   Cards
   ========================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--card-pad);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--gap); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.card-head h2, .card-head h3 { margin: 0; }

.grid { display: grid; gap: var(--gap); }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.kpis   { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
@media (max-width: 900px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* KPI card */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; }
.kpi .value {
  font-family: var(--font-mono);
  font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink);
}
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi .delta.up   { color: var(--green); }
.kpi .delta.down { color: var(--red); }

/* =========================================================================
   Tables
   ========================================================================= */
.tbl-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tbl th, .tbl td {
  padding: var(--row-py) 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl thead th {
  background: var(--surface-2);
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tbl td.shrink, .tbl th.shrink { width: 1%; white-space: nowrap; }
.tbl td a { font-weight: 500; }
.tbl .empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn, button.btn, input[type="submit"].btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--ink);
  font: inherit; font-weight: 500; font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease, transform .04s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.subtle {
  border-color: transparent; background: transparent; color: var(--ink-2);
}
.btn.subtle:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger {
  border-color: var(--red); color: var(--red); background: var(--surface);
}
.btn.danger:hover { background: var(--red-s); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================================
   Forms (Django form.as_p compatible)
   ========================================================================= */
.form { max-width: 560px; }
.form p { margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.form label,
form p > label { font-size: 12px; font-weight: 500; color: var(--ink-2); letter-spacing: 0.01em; }
.form .helptext,
form .helptext { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.form .errorlist,
form .errorlist {
  list-style: none; padding: 0; margin: 4px 0 0;
  font-size: 12px; color: var(--red);
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
input[type="tel"], input[type="url"], input[type="file"],
select, textarea {
  appearance: none;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit; font-size: 13.5px;
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 80px; resize: vertical; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                          linear-gradient(135deg, var(--muted) 50%, transparent 50%);
         background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
         background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
         padding-right: 28px; }
input[type="file"] { padding: 6px; }

.form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-actions {
  display: flex; gap: 10px; align-items: center;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* =========================================================================
   Filter bar
   ========================================================================= */
.filterbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.filterbar label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.filterbar select, .filterbar input { width: auto; min-width: 180px; }

/* =========================================================================
   Badges & pills
   ========================================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--slate-s); color: var(--ink-2);
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}
.badge.accent  { background: var(--accent-soft); color: var(--accent-ink); }
.badge.success { background: var(--green-s);  color: var(--green); }
.badge.warning { background: var(--amber-s);  color: var(--amber); }
.badge.danger  { background: var(--red-s);    color: var(--red); }
.badge.info    { background: var(--blue-s);   color: var(--blue); }
.badge.outline { background: transparent; border-color: var(--border-2); color: var(--ink-2); }

.role-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 500;
  color: var(--ink-2);
}
.role-chip.eligible { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

/* =========================================================================
   Stage stepper (RA-bill workflow, 7 stages)
   ========================================================================= */
.stepper {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin: 8px 0 4px;
}
.step {
  position: relative;
  padding: 10px 12px 10px 28px;
  border-bottom: 2px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  background: transparent;
}
.step::before {
  content: "";
  position: absolute; left: 10px; top: 13px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-2);
}
.step .num { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); }
.step .name { display: block; font-weight: 500; color: var(--ink-2); margin-top: 1px; }
.step.done {
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
}
.step.done::before { background: var(--accent); border-color: var(--accent); }
.step.done .name { color: var(--ink); }
.step.current {
  border-bottom-color: var(--accent);
  color: var(--accent-ink);
}
.step.current::before {
  background: var(--surface); border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.step.current .name { color: var(--ink); font-weight: 600; }

/* Workflow node list */
.workflow-nodes { display: flex; flex-direction: column; gap: 8px; }
.node-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.node-row .grow { flex: 1; }
.node-row input[type="text"] { flex: 1; min-width: 180px; }
.node-row .meta { font-size: 12px; color: var(--muted); }

/* =========================================================================
   Timeline (audit trail / stage events)
   ========================================================================= */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px;
  width: 2px; background: var(--border);
}
.tl-item { position: relative; padding: 4px 0 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
}
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-head .who { font-weight: 500; }
.tl-head .when { font-size: 12px; color: var(--muted); }
.tl-body { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* =========================================================================
   Definition list (read-only key/value)
   ========================================================================= */
.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 24px;
  margin: 0;
}
.kv dt { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; padding-top: 2px; }
.kv dd { margin: 0; color: var(--ink); }
.kv dd .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* =========================================================================
   Pagination
   ========================================================================= */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 16px;
  font-size: 13px; color: var(--muted);
}
.pager .links { display: flex; gap: 6px; }
.pager a, .pager .current {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
}
.pager .current { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.pager a:hover { background: var(--surface-2); text-decoration: none; }

/* =========================================================================
   Login page
   ========================================================================= */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent 60%),
    var(--bg);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth-card .brand { padding: 0 0 20px; }
.auth-card h1 { font-size: 18px; margin-bottom: 4px; }
.auth-card .lede { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.auth-card .form-actions { border-top: 0; padding-top: 8px; margin-top: 8px; }
.auth-card .footer { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }

/* =========================================================================
   Utilities
   ========================================================================= */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }


/* ============================================================================
   Operator chrome upgrades — design handoff v2
   ============================================================================ */

/* ----- Sidebar brand subtitle ----- */
.brand-meta { display: flex; flex-direction: column; line-height: 1.25; }
.brand-meta strong { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; color: var(--ink); }
.brand-meta small { font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: 0; }

/* ----- Sidebar nav-link count badge ----- */
.nav-link .nav-count {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 11px;
  background: var(--surface-2); padding: 1px 6px;
  border-radius: 5px; color: var(--muted);
}
.nav-link.active .nav-count { background: var(--accent-soft); color: var(--accent); }

/* ----- Sidebar user-chip at bottom ----- */
.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px;
  text-decoration: none; color: inherit;
}
.user-chip:hover { background: var(--surface-2); }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 12px;
  letter-spacing: -0.01em; flex-shrink: 0;
}
.user-chip .meta { flex: 1; min-width: 0; }
.user-chip .meta .name { font-weight: 500; font-size: 13px; color: var(--ink); }
.user-chip .meta .role-line { font-size: 11px; color: var(--muted); }

/* ----- Topbar search input ----- */
.topbar-search {
  flex: 1; max-width: 480px; position: relative;
  margin: 0 12px;
}
.topbar-search input {
  width: 100%; height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 36px 0 34px;
  font-size: 13px; color: var(--ink);
  font-family: inherit;
}
.topbar-search input:focus {
  outline: none; border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.topbar-search svg.search-ico {
  position: absolute; left: 10px; top: 9px;
  width: 16px; height: 16px; opacity: 0.55;
}
.topbar-search .kbd {
  position: absolute; right: 8px; top: 7px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px;
}

/* ----- Icon-button indicator dot ----- */
.icon-btn .indicator {
  position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* ----- KPI tile with leading icon ----- */
.kpi { position: relative; overflow: hidden; }
.kpi .label svg.kpi-ico {
  width: 14px; height: 14px; opacity: 0.7; margin-right: 6px;
  vertical-align: -2px;
}
.kpi-spark {
  position: absolute; right: 12px; bottom: 12px;
  opacity: 0.6; pointer-events: none;
}

/* ----- Horizontal mini-bar (Bills by stage / Ageing) ----- */
.hbar-list { display: grid; grid-template-columns: 110px 1fr 32px; gap: 8px 12px; align-items: center; }
.hbar-label { font-size: 12.5px; color: var(--muted); }
.hbar-track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.3s; }
.hbar-fill.warn { background: #b45309; }
.hbar-fill.danger { background: #b91c1c; }
.hbar-num { font-family: var(--font-mono); font-size: 12.5px; text-align: right; color: var(--ink-2); }

/* ----- Status tabs (RA Bills list) ----- */
.status-tabs {
  display: inline-flex; gap: 4px;
  padding-bottom: 0; border-bottom: 1px solid var(--border);
  margin-bottom: var(--gap);
}
.status-tabs a {
  padding: 8px 14px;
  font-size: 13px; color: var(--muted); font-weight: 500;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent; border-bottom: none;
  text-decoration: none; position: relative; bottom: -1px;
}
.status-tabs a:hover { color: var(--ink); background: var(--surface-2); }
.status-tabs a.on {
  color: var(--ink); background: var(--surface);
  border-color: var(--border);
}
.status-tabs a .count {
  font-family: var(--font-mono); font-size: 11px;
  margin-left: 6px; color: var(--muted);
}

/* ----- Workflow card (bill detail) ----- */
.workflow-card .stage-panel {
  padding: 18px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.stage-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.stage-panel .node-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.stage-panel .node-row + .node-row { margin-top: 8px; }
.stage-panel .node-row.completed {
  background: var(--accent-soft); border-color: transparent;
}
.stage-panel .node-row.up-next {
  border-color: var(--accent);
}
.stage-panel .node-check {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--border); flex-shrink: 0;
}
.stage-panel .node-check.done {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.stage-panel .node-meta {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
}
.stage-panel .node-meta .who {
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.stage-panel .node-meta .who-line {
  font-size: 12px; color: var(--muted); font-family: var(--font-mono);
}

/* ----- Hero strip (bill detail header) ----- */
.hero-strip {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.hero-strip .cell .h-label {
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 4px;
}
.hero-strip .cell .h-value {
  font-size: 18px; font-weight: 500;
  letter-spacing: -0.01em; color: var(--ink);
}
.hero-strip .cell.accent .h-value { color: var(--accent); font-weight: 600; }
.hero-strip .cell .h-value.mono { font-family: var(--font-mono); }

/* ----- Form-64 step progress ----- */
.step-progress {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 0; align-items: center;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.step-progress .sp-step {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; color: var(--muted);
}
.step-progress .sp-step .num {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
}
.step-progress .sp-step.on .num { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.step-progress .sp-step.on { color: var(--ink); }

/* ----- Drop zone (Form-64 upload) ----- */
.dropzone {
  padding: 48px 20px; text-align: center;
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  border-radius: 12px;
}
.dropzone .dz-icon {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  border-radius: 50%; background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 12px; color: var(--muted);
}
.dropzone h3 { font-size: 16px; margin: 8px 0 4px; font-weight: 500; }
.dropzone .dz-sub { font-size: 12.5px; color: var(--muted); }

/* ----- Avatar mini (people list) ----- */
.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-size: 11px; font-weight: 600;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.avatar-sm.av-blue   { background: linear-gradient(135deg, #1d4ed8, #7c3aed); }
.avatar-sm.av-green  { background: linear-gradient(135deg, #047857, #1d4ed8); }
.avatar-sm.av-orange { background: linear-gradient(135deg, #ea580c, #b45309); }
.avatar-sm.av-rose   { background: linear-gradient(135deg, #be185d, #b91c1c); }
.avatar-sm.av-teal   { background: linear-gradient(135deg, #0d9488, #047857); }
.avatar-sm.av-violet { background: linear-gradient(135deg, #7c3aed, #be185d); }

/* ----- Sparkline (KPI inline trend) ----- */
.kpi-spark { width: 80px; height: 28px; }
.kpi-spark .sparkpath { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.kpi-spark .sparkfill { fill: var(--accent-soft); opacity: 0.6; }
