/* ============================================================================
   GIP Bank — component styles. PHP component partials in views/components/
   emit this markup; JS behavior modules bind via [data-component].
   ========================================================================== */

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.btn--primary { background: var(--green-700); color: var(--white); }
.btn--primary:hover { background: var(--green-600); }

.btn--secondary { background: var(--white); color: var(--stone-800); border-color: var(--stone-300); }
.btn--secondary:hover { background: var(--stone-50); border-color: var(--stone-400); }

.btn--ghost { background: transparent; color: var(--green-700); }
.btn--ghost:hover { background: var(--hover-tint); }

.btn--danger { background: var(--err-700); color: var(--white); }
.btn--danger:hover { background: #99201A; }

.btn--gold { background: var(--gold-500); color: var(--green-950); }
.btn--gold:hover { background: var(--gold-400); }

.btn--sm { padding: 5px 10px; font-size: var(--text-small); }
.btn--lg { padding: 12px 22px; font-size: var(--text-lead); }

.btn .spinner { width: 14px; height: 14px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-6); }
.field__label { font-weight: 600; color: var(--stone-800); font-size: var(--text-base); }
.field__label .req { color: var(--err-700); }
.field__help { font-size: var(--text-small); color: var(--muted); }
.field__error {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-small); color: var(--err-700);
}

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--stone-300);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px var(--green-100);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--err-700);
}
.input::placeholder, .textarea::placeholder { color: var(--stone-400); }
.textarea { min-height: 110px; resize: vertical; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E6A61' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 34px;
}

.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; }
.input-group > :first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group > :last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group__addon {
  display: inline-flex; align-items: center;
  padding: 0 12px;
  background: var(--stone-50);
  border: 1px solid var(--stone-300);
  color: var(--stone-600);
  font-weight: 600;
}
.input-group__addon:first-child { border-right: 0; }
.input-group__addon:last-child { border-left: 0; }

.checkbox-row {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  font-size: var(--text-base); color: var(--body);
}
.checkbox-row input[type="checkbox"], .checkbox-row input[type="radio"] {
  width: 16px; height: 16px; margin-top: 3px; accent-color: var(--green-700);
}

/* ── File upload ─────────────────────────────────────────────────────────── */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-6);
  border: 1.5px dashed var(--stone-300);
  border-radius: var(--r-md);
  background: var(--stone-25);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--green-500); background: var(--hover-tint); }
.dropzone .icon { width: 28px; height: 28px; color: var(--green-600); }

.file-row {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  background: var(--white);
}
.file-row + .file-row { margin-top: var(--sp-3); }
.file-row__name { font-weight: 600; color: var(--stone-800); overflow-wrap: anywhere; }
.file-row__meta { font-size: var(--text-small); color: var(--muted); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--e-0);
  padding: var(--sp-7);
}
.card--flush { padding: 0; overflow: hidden; }
.card--interactive { transition: box-shadow var(--t-fast) var(--ease); }
.card--interactive:hover { box-shadow: var(--e-0), var(--e-1); }
.card--premium { border-top: 2px solid var(--gold-400); }

.card__header {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}
.card__title { font-size: var(--text-h5); font-weight: 650; color: var(--ink); }

/* ── Stat tiles ──────────────────────────────────────────────────────────── */
.stat-tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(9,53,36,.04);
  padding: var(--sp-5) var(--sp-6);
  display: flex; flex-direction: column; gap: 5px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.stat-tile__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.stat-tile__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat-tile__icon svg { width: 21px; height: 21px; }
.stat-tile__label { font-size: var(--text-small); font-weight: 600; color: var(--muted); }
.stat-tile__value {
  font-family: var(--font-display); font-size: var(--text-h2); font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.12; letter-spacing: -.01em;
}
.stat-tile__sub { font-size: var(--text-caption); color: var(--stone-500); margin-top: 2px; }
.stat-tile__delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-caption); font-weight: 650; padding: 3px 9px; border-radius: 999px;
}
.stat-tile__delta svg { width: 13px; height: 13px; }
.stat-tile__delta--up   { color: var(--ok-700);  background: var(--ok-50); }
.stat-tile__delta--down { color: var(--err-700); background: var(--err-50); }
.stat-tile__delta--flat { color: var(--stone-600); background: var(--stone-100); }
.stat-tile__go { position: absolute; top: var(--sp-5); right: var(--sp-5); color: var(--stone-400); opacity: 0; transition: opacity .16s, transform .16s; }
a.stat-tile { text-decoration: none; }
a.stat-tile.stat-tile--link:hover { transform: translateY(-2px); border-color: var(--stone-200); box-shadow: 0 2px 4px rgba(9,53,36,.05), 0 24px 40px -26px rgba(9,53,36,.32); }
a.stat-tile.stat-tile--link:hover .stat-tile__go { opacity: 1; transform: translateX(2px); }
/* Tones — icon badge colour */
.stat-tile--green  .stat-tile__icon { background: var(--green-25); color: var(--green-700); }
.stat-tile--gold   .stat-tile__icon { background: var(--gold-50);  color: var(--gold-700); }
.stat-tile--blue   .stat-tile__icon { background: var(--pill-blue-bg);   color: var(--pill-blue-fg); }
.stat-tile--teal   .stat-tile__icon { background: var(--pill-teal-bg);   color: var(--pill-teal-fg); }
.stat-tile--violet .stat-tile__icon { background: var(--pill-violet-bg); color: var(--pill-violet-fg); }
.stat-tile--orange .stat-tile__icon { background: var(--pill-orange-bg); color: var(--pill-orange-fg); }
.stat-tile--red    .stat-tile__icon { background: var(--err-50); color: var(--err-700); }
.stat-tile--gold::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-500)); }

/* ── Quick links (icon cards) ────────────────────────────────────────────── */
.ql-head { display: flex; align-items: center; justify-content: space-between; margin: var(--sp-7) 0 var(--sp-4); }
.ql-head__title { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 700; color: var(--brand); font-size: var(--text-h5); }
.ql-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.ql-card { position: relative; display: flex; align-items: center; gap: var(--sp-4); text-decoration: none;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: var(--sp-4) var(--sp-5);
  transition: transform .16s, box-shadow .16s, border-color .16s; }
.ql-card:hover { transform: translateY(-2px); border-color: var(--stone-200); box-shadow: 0 2px 4px rgba(9,53,36,.05), 0 22px 40px -26px rgba(9,53,36,.3); }
.ql-card__icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--chip-bg); color: var(--chip-fg); }
.ql-card--green .ql-card__icon { background: var(--green-25); color: var(--green-700); }
.ql-card__icon svg { width: 21px; height: 21px; }
.ql-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ql-card__name { font-weight: 650; color: var(--ink); font-size: var(--text-base); }
.ql-card__desc { font-size: var(--text-caption); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ql-card__go { margin-left: auto; color: var(--stone-400); flex: none; transition: transform .16s; }
.ql-card:hover .ql-card__go { transform: translateX(3px); color: var(--gold-600); }
.ql-card--gold   .ql-card__icon { background: var(--gold-50);  color: var(--gold-700); }
.ql-card--blue   .ql-card__icon { background: var(--pill-blue-bg);   color: var(--pill-blue-fg); }
.ql-card--teal   .ql-card__icon { background: var(--pill-teal-bg);   color: var(--pill-teal-fg); }
.ql-card--violet .ql-card__icon { background: var(--pill-violet-bg); color: var(--pill-violet-fg); }
.ql-card--orange .ql-card__icon { background: var(--pill-orange-bg); color: var(--pill-orange-fg); }
@media (max-width: 1000px) { .ql-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ql-grid { grid-template-columns: 1fr; } }

/* ── Dashboard list panels ───────────────────────────────────────────────── */
.dash-list { display: flex; flex-direction: column; }
.dash-list__row { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-3) 0; border-top: 1px solid var(--hairline); }
.dash-list__row:first-child { border-top: 0; }
.dash-list__main { min-width: 0; flex: 1; }
.dash-list__title { font-weight: 600; color: var(--ink); font-size: var(--text-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-list__meta { font-size: var(--text-caption); color: var(--muted); }
.dash-list__empty { padding: var(--sp-6) 0; text-align: center; color: var(--muted); font-size: var(--text-small); }

/* ── Premium card refinements (stat + quick-link) ────────────────────────── */
.stat-tile { overflow: hidden; box-shadow: 0 1px 2px rgba(9,53,36,.05), 0 16px 30px -22px rgba(9,53,36,.24); }
.stat-tile::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-tile--green::before  { background: linear-gradient(90deg, var(--green-400), var(--green-700)); }
.stat-tile--gold::before   { background: linear-gradient(90deg, var(--gold-300), var(--gold-600)); }
.stat-tile--blue::before   { background: linear-gradient(90deg, #6aa8f2, #2A78D6); }
.stat-tile--teal::before   { background: linear-gradient(90deg, #4fd0c4, #17B3A3); }
.stat-tile--violet::before { background: linear-gradient(90deg, #9d8cff, #7A5AF8); }
.stat-tile--orange::before { background: linear-gradient(90deg, #f2a07f, #E8654B); }
.stat-tile--red::before    { background: linear-gradient(90deg, #f08a8a, var(--err-700)); }
.stat-tile__icon { box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 0 0 1px rgba(9,53,36,.04); }
a.stat-tile.stat-tile--link:hover { box-shadow: 0 2px 4px rgba(9,53,36,.05), 0 28px 46px -24px rgba(9,53,36,.36); }

.ql-card { overflow: hidden; box-shadow: 0 1px 2px rgba(9,53,36,.04); }
.ql-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: background .16s; }
.ql-card:hover::after { background: linear-gradient(180deg, var(--gold-400), var(--gold-600)); }
.ql-card__icon { box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 0 0 1px rgba(9,53,36,.04); }

/* ── Chart entrance + report card polish ─────────────────────────────────── */
[data-chart] svg { animation: chartIn .55s cubic-bezier(.16,.84,.44,1); }
@keyframes chartIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chart-toggle button { transition: background .15s, color .15s; }
.report-legend { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); margin-top: var(--sp-3); }
.report-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-caption); color: var(--muted); }
.report-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
@media (prefers-reduced-motion: reduce) { [data-chart] svg { animation: none; } }

/* ── PWA / mobile standalone + safe-area insets ──────────────────────────── */
.topbar { padding-top: env(safe-area-inset-top); }
@media (max-width: 900px) {
  .sidebar { padding-top: env(safe-area-inset-top); }
  .main { padding-left: max(var(--sp-6), env(safe-area-inset-left)); padding-right: max(var(--sp-6), env(safe-area-inset-right)); }
}
@media (display-mode: standalone) {
  body { overscroll-behavior-y: contain; }
  .main { padding-bottom: max(var(--sp-11), calc(env(safe-area-inset-bottom) + var(--sp-8))); }
}
/* Install-app button — hidden until the browser reports installability (JS). */
.pwa-install[hidden] { display: none; }

/* ── Mobile refinements for dashboards ───────────────────────────────────── */
@media (max-width: 700px) {
  .main { padding: var(--sp-5) var(--sp-4) var(--sp-10); }
  .page-head { flex-direction: column; align-items: stretch; gap: var(--sp-4); }
  .page-head__actions { width: 100%; flex-wrap: wrap; }
  .page-head__actions .btn { flex: 1 1 auto; justify-content: center; }
  .page-head__title { font-size: var(--text-h3); }
  .stat-tile { padding: var(--sp-4) var(--sp-5); }
  .stat-tile__value { font-size: var(--text-h3); }
  .stat-tile__top { margin-bottom: var(--sp-2); }
  .card { padding: var(--sp-5) var(--sp-5); }
  .ql-head { margin: var(--sp-6) 0 var(--sp-3); }
  .kv { grid-template-columns: 1fr; row-gap: var(--sp-2); }
  .kv dt { margin-top: var(--sp-3); }
}
@media (max-width: 420px) {
  .stat-tile__value { font-size: var(--text-h4); }
  .page-head__actions .btn { font-size: var(--text-small); }
}

/* ── Premium receipt ─────────────────────────────────────────────────────── */
.receipt { max-width: 560px; margin-inline: auto; background: var(--surface);
  border-radius: 20px; overflow: hidden; box-shadow: 0 2px 6px rgba(9,53,36,.06), 0 40px 80px -36px rgba(9,53,36,.4); }
.receipt__head { position: relative; text-align: center; color: var(--surface-dark-fg); padding: 34px 28px 30px;
  background: radial-gradient(600px 260px at 82% -30%, rgba(207,168,61,.2), transparent 62%),
              var(--gradient-ceremonial); }
.receipt__head .seal { width: 40px; height: 40px; color: #fff; }
.receipt__brand { font-size: 12px; color: var(--green-200); margin-top: 8px; letter-spacing: .02em; }
.receipt__stamp { position: absolute; top: 18px; right: 18px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #062A1E;
  background: var(--gold-400); border-radius: 999px; padding: 5px 12px; }
.receipt__check { width: 60px; height: 60px; margin: 20px auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(75,214,141,.16); border: 1px solid rgba(75,214,141,.5); color: #7FE3AE; }
.receipt__check svg { width: 30px; height: 30px; }
.receipt__title { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: #fff; margin: 0; }
.receipt__eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-400); margin: 0 0 4px; }
.receipt__amount { text-align: center; padding: 26px 28px 8px; }
.receipt__amount b { font-family: var(--font-display); font-size: 40px; font-weight: 600; color: var(--green-900); letter-spacing: -.01em; }
.receipt__amount span { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.receipt__body { padding: 12px 30px 24px; }
.receipt__row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--hairline); font-size: 14.5px; }
.receipt__row:last-child { border-bottom: 0; }
.receipt__row dt { color: var(--muted); margin: 0; }
.receipt__row dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
/* Perforated tear line */
.receipt__perf { position: relative; height: 24px; background:
  radial-gradient(circle 8px at 12px 50%, var(--page, #F4F2EC) 96%, transparent) left / 24px 100% repeat-x; }
.receipt__perf::before, .receipt__perf::after { content: ""; position: absolute; top: 50%; height: 0; width: calc(100% - 40px);
  left: 20px; border-top: 2px dashed var(--hairline-strong, #D3D0C6); }
.receipt__foot { padding: 8px 30px 28px; }
.receipt__verify { display: flex; align-items: center; gap: 12px; background: var(--green-25); border: 1px solid var(--green-100);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.receipt__verify svg { width: 26px; height: 26px; color: var(--green-700); flex: none; }
.receipt__verify b { display: block; color: var(--green-900); font-size: 13.5px; }
.receipt__verify span { color: var(--stone-600); font-size: 12.5px; }
.receipt__code { font-family: var(--font-mono); font-size: 12.5px; color: var(--gold-700); }
.receipt__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
@media print {
  .no-print, .page-head { display: none !important; }
  .receipt { box-shadow: none; border: 1px solid #ccc; }
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); box-shadow: var(--e-0); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.table th {
  text-align: left;
  font-size: var(--text-caption);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--stone-600);
  background: var(--stone-50);
  padding: 10px var(--sp-5);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.table th a { color: inherit; display: inline-flex; align-items: center; gap: var(--sp-1); }
.table td {
  padding: 12px var(--sp-5);
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover-tint); }
.table .t-num { font-family: var(--font-mono); font-size: var(--text-small); }
.table__actions { display: flex; gap: var(--sp-2); justify-content: flex-end; }

.table-footer {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--text-small); color: var(--muted);
}

/* ── Badges & status pills ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: var(--text-caption);
  font-weight: 600;
  background: var(--stone-100);
  color: var(--stone-700);
}
.badge--tint { background: var(--stone-100); color: var(--stone-700); }
.badge--gold { background: var(--gold-100); color: var(--gold-800); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--text-caption);
  font-weight: 650;
  white-space: nowrap;
}
.pill .icon { width: 12px; height: 12px; }
.pill--neutral { color: var(--pill-neutral-fg); background: var(--pill-neutral-bg); }
.pill--blue    { color: var(--pill-blue-fg);    background: var(--pill-blue-bg); }
.pill--indigo  { color: var(--pill-indigo-fg);  background: var(--pill-indigo-bg); }
.pill--teal    { color: var(--pill-teal-fg);    background: var(--pill-teal-bg); }
.pill--violet  { color: var(--pill-violet-fg);  background: var(--pill-violet-bg); }
.pill--gold    { color: var(--pill-gold-fg);    background: var(--pill-gold-bg); }
.pill--green   { color: var(--pill-green-fg);   background: var(--pill-green-bg); }
.pill--orange  { color: var(--pill-orange-fg);  background: var(--pill-orange-bg); }
.pill--red     { color: var(--pill-red-fg);     background: var(--pill-red-bg); }
.pill--live    { color: var(--white);           background: var(--green-700); } /* the only solid pill */

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: var(--sp-6);
  border-bottom: 1px solid var(--hairline);
  overflow-x: auto;
}
.tabs__link {
  padding: var(--sp-4) 2px;
  color: var(--stone-600);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs__link:hover { color: var(--green-700); text-decoration: none; }
.tabs__link.is-active { color: var(--green-800); border-bottom-color: var(--green-700); }

/* ── Modal (native <dialog>) ─────────────────────────────────────────────── */
.modal {
  border: 0;
  border-radius: var(--r-md);
  box-shadow: var(--e-3);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
}
.modal::backdrop { background: rgba(6, 42, 30, 0.45); }
.modal__body { padding: var(--sp-7); }
.modal__title { font-size: var(--text-h4); margin-bottom: var(--sp-4); }
.modal__footer {
  display: flex; justify-content: flex-end; gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-7);
  background: var(--stone-50);
  border-top: 1px solid var(--hairline);
}

/* ── Drawer ──────────────────────────────────────────────────────────────── */
.drawer {
  position: fixed; inset: 0 0 0 auto;
  width: min(480px, 100vw);
  height: 100dvh;
  max-height: none;
  border: 0; margin: 0; padding: 0;
  background: var(--surface);
  box-shadow: var(--e-3);
  transform: translateX(100%);
  transition: transform var(--t-med) var(--ease);
}
.drawer[open] { transform: translateX(0); }
.drawer::backdrop { background: rgba(6, 42, 30, 0.35); }
.drawer__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-6) var(--sp-7);
  border-bottom: 1px solid var(--hairline);
}
.drawer__body { padding: var(--sp-7); overflow-y: auto; height: calc(100dvh - 65px); }

/* ── Stepper ─────────────────────────────────────────────────────────────── */
.stepper { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.stepper__step { display: flex; align-items: center; gap: var(--sp-3); }
.stepper__dot {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: var(--text-caption); font-weight: 700;
  background: var(--stone-100); color: var(--stone-500);
  border: 2px solid transparent;
}
.stepper__step.is-complete .stepper__dot { background: var(--green-700); color: var(--white); }
.stepper__step.is-current .stepper__dot {
  background: var(--white); color: var(--green-800);
  border-color: var(--gold-400);
}
.stepper__label { font-size: var(--text-small); font-weight: 600; color: var(--stone-600); }
.stepper__step.is-current .stepper__label { color: var(--ink); }
.stepper__bar { flex: 1 1 12px; min-width: 12px; height: 1px; background: var(--hairline); }
@media (max-width: 720px) {
  .stepper__label { display: none; }
  .stepper__step.is-current .stepper__label { display: inline; }
}

/* ── Timeline (workflow / audit) ─────────────────────────────────────────── */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute; left: 13px; top: 8px; bottom: 8px;
  width: 1px; background: var(--hairline);
}
.timeline__item {
  position: relative;
  padding-left: 40px;
  padding-bottom: var(--sp-6);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__node {
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  width: 27px; height: 27px;
  border-radius: 50%;
  background: var(--green-50); color: var(--green-700);
  border: 1px solid var(--green-200);
}
.timeline__item.is-pending .timeline__node { background: var(--stone-50); color: var(--stone-400); border-color: var(--hairline); }
.timeline__item.is-negative .timeline__node { background: var(--err-50); color: var(--err-700); border-color: var(--err-300); }
.timeline__node .icon { width: 13px; height: 13px; }
.timeline__title { font-weight: 650; color: var(--ink); font-size: var(--text-base); }
.timeline__meta { font-size: var(--text-caption); color: var(--muted); }
.timeline__comment {
  margin-top: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--stone-50);
  border-radius: var(--r-sm);
  font-size: var(--text-small);
  color: var(--body);
}

/* ── Toasts / flash ──────────────────────────────────────────────────────── */
.toast-region {
  position: fixed; top: var(--sp-5); right: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3);
  z-index: 90;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--e-2);
  border-left: 3px solid var(--stone-400);
  font-size: var(--text-base);
  animation: toast-in var(--t-med) var(--ease);
}
.toast--success { border-left-color: var(--ok-700); }
.toast--error   { border-left-color: var(--err-700); }
.toast--warning { border-left-color: var(--warn-700); }
.toast--info    { border-left-color: var(--info-700); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Alert banners ───────────────────────────────────────────────────────── */
.alert {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-sm);
  border: 1px solid;
  font-size: var(--text-base);
}
.alert .icon { margin-top: 2px; }
.alert--success { color: var(--ok-700);  background: var(--ok-50);  border-color: var(--ok-300); }
.alert--warning { color: var(--warn-700); background: var(--warn-50); border-color: var(--warn-300); }
.alert--error   { color: var(--err-700); background: var(--err-50); border-color: var(--err-300); }
.alert--info    { color: var(--info-700); background: var(--info-50); border-color: var(--info-300); }

/* ── Executive-presentation launcher card ────────────────────────────────── */
.card--present {
  background: radial-gradient(760px 300px at 88% -20%, rgba(207,168,61,.18), transparent 62%),
              var(--gradient-ceremonial);
  border: 1px solid var(--surface-dark-line);
  color: var(--surface-dark-fg); overflow: hidden;
}
.present-cta { display: flex; align-items: center; gap: var(--sp-6); justify-content: space-between; }
.present-cta__title { font-family: var(--font-display); font-weight: 600; color: #fff;
  font-size: var(--text-h3); line-height: 1.15; margin: var(--sp-2) 0 var(--sp-3); }
.present-cta__sub { color: var(--green-200); font-size: var(--text-base); line-height: 1.55; max-width: 60ch; }
.present-cta__sub kbd { font-family: var(--font-mono); font-size: 11px; background: rgba(255,255,255,.12);
  border: 1px solid rgba(207,168,61,.4); border-radius: 4px; padding: 1px 6px; color: #EAF3EE; }
.present-cta__mark { flex: none; }
.present-cta__mark svg { width: 108px; height: 108px; opacity: .92; }
.card--present .btn--ghost { color: #EAF3EE; border-color: rgba(207,168,61,.45); background: transparent; }
.card--present .btn--ghost:hover { background: rgba(255,255,255,.08); border-color: var(--gold-400); }
@media (max-width: 720px) {
  .present-cta__mark { display: none; }
}

/* ── Radio cards (selectable option list) ────────────────────────────────── */
.radio-cards { display: grid; gap: var(--sp-3); }
.radio-card {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.radio-card:hover { border-color: var(--stone-300); }
.radio-card input { margin-top: 3px; accent-color: var(--green-700); flex: none; }
.radio-card__body { display: flex; flex-direction: column; gap: 3px; }
.radio-card__title { font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: var(--sp-2); }
.radio-card__desc { font-size: var(--text-caption); color: var(--muted); line-height: 1.45; }
.radio-card.is-selected { border-color: var(--green-700); background: var(--green-25); box-shadow: 0 0 0 1px var(--green-700) inset; }

/* ── Empty states ────────────────────────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-11) var(--sp-7);
  text-align: center;
}
.empty .icon { width: 34px; height: 34px; color: var(--stone-400); }
.empty__title { font-weight: 650; color: var(--stone-800); }
.empty__body { color: var(--muted); max-width: 34rem; font-size: var(--text-base); }

/* ── Skeletons ───────────────────────────────────────────────────────────── */
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--stone-100) 25%, var(--stone-50) 45%, var(--stone-100) 65%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  min-height: 14px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */
.breadcrumbs {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  font-size: var(--text-small);
  color: var(--muted);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--green-700); }
.breadcrumbs .sep { color: var(--stone-300); }
.breadcrumbs .current { color: var(--stone-800); font-weight: 600; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: var(--sp-2); align-items: center; }
.pagination__link {
  display: grid; place-items: center;
  min-width: 32px; height: 32px; padding: 0 6px;
  border-radius: var(--r-sm);
  color: var(--stone-700);
  font-size: var(--text-small); font-weight: 600;
}
.pagination__link:hover { background: var(--stone-100); text-decoration: none; }
.pagination__link.is-active { background: var(--green-700); color: var(--white); }
.pagination__link.is-disabled { color: var(--stone-300); pointer-events: none; }

/* ── Key-value description list ──────────────────────────────────────────── */
.kv {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  row-gap: var(--sp-4);
  column-gap: var(--sp-6);
  font-size: var(--text-base);
}
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .kv { grid-template-columns: 1fr; row-gap: var(--sp-1); }
  .kv dt { margin-top: var(--sp-4); }
}

/* ── Public top nav ──────────────────────────────────────────────────────── */
.public-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--hairline);
}
.public-nav.is-scrolled { box-shadow: var(--e-1); }
.public-nav__inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6);
  height: 64px;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--sp-7);
}
.public-nav__brand {
  display: flex; align-items: center; gap: var(--sp-3);
  color: var(--green-800); font-weight: 700;
  text-decoration: none;
}
.public-nav__brand:hover { text-decoration: none; }
.public-nav__brand .seal { width: 34px; height: 34px; }
.public-nav__links { display: flex; gap: var(--sp-6); align-items: center; }
.public-nav__links a { color: var(--stone-700); font-weight: 600; font-size: var(--text-base); }
.public-nav__links a:hover { color: var(--green-700); text-decoration: none; }
@media (max-width: 900px) { .public-nav__links { display: none; } }

/* ── Portal shell ────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--surface-dark);
  color: var(--surface-dark-fg);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100dvh;
  overflow-y: auto;
  border-right: 1px solid var(--surface-dark-line);
}
@media (max-width: 900px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 70; transform: translateX(-100%); transition: transform var(--t-med) var(--ease); }
  .sidebar.is-open { transform: none; box-shadow: var(--e-3); }
}
.sidebar__brand {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-6);
  color: var(--white); font-weight: 700; font-size: var(--text-lead);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand .seal { width: 30px; height: 30px; }
.sidebar__section {
  padding: var(--sp-6) var(--sp-6) var(--sp-2);
  font-size: var(--text-caption); font-weight: 650;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--surface-dark-muted);
}
.sidebar__nav { list-style: none; padding: 0 var(--sp-4); }
.sidebar__link {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 9px var(--sp-4);
  border-radius: var(--r-sm);
  color: var(--surface-dark-fg);
  font-weight: 550; font-size: var(--text-base);
  border-left: 2px solid transparent;
}
.sidebar__link:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; color: var(--white); }
.sidebar__link.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-left-color: var(--gold-400);
}
.sidebar__link .icon { color: var(--surface-dark-muted); }
.sidebar__link.is-active .icon { color: var(--gold-300); }
.sidebar__foot {
  margin-top: auto;
  padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--surface-dark-line);
  font-size: var(--text-caption); color: var(--surface-dark-muted);
}

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
  height: var(--topbar-h);
  padding-inline: var(--sp-7);
  background: var(--white);
  border-bottom: 1px solid var(--hairline);
}
.topbar__left { display: flex; align-items: center; gap: var(--sp-4); min-width: 0; }
.topbar__right { display: flex; align-items: center; gap: var(--sp-4); }
.topbar__menu-btn { display: none; }
@media (max-width: 900px) { .topbar__menu-btn { display: inline-flex; } }

.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--stone-600);
  cursor: pointer;
  position: relative;
}
.icon-btn:hover { background: var(--stone-100); color: var(--stone-800); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--err-700);
  border: 2px solid var(--white);
}

.user-chip {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 4px var(--sp-3) 4px 4px;
  border: 0; border-radius: var(--r-pill);
  background: transparent; cursor: pointer;
}
.user-chip:hover { background: var(--stone-100); }
.user-chip__avatar {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-dark); color: var(--gold-300);
  font-size: var(--text-caption); font-weight: 700;
}
.user-chip__role { font-size: var(--text-caption); color: var(--muted); }

.main { padding: var(--sp-8) var(--sp-7) var(--sp-11); max-width: calc(var(--content-max) + 2 * var(--sp-7)); width: 100%; margin-inline: auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-5); flex-wrap: wrap; margin-bottom: var(--sp-7); }
.page-head__title { font-family: var(--font-display); font-weight: 600; color: var(--brand); font-size: var(--text-h2); }
.page-head__sub { color: var(--muted); margin-top: var(--sp-1); }

/* ── Dropdown menu ───────────────────────────────────────────────────────── */
.menu { position: relative; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 200px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--e-2);
  padding: var(--sp-2);
  z-index: 60;
  display: none;
}
.menu.is-open .menu__panel { display: block; }
.menu__item {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%;
  padding: 8px var(--sp-4);
  border: 0; border-radius: var(--r-sm);
  background: none; text-align: left;
  color: var(--stone-700); font-size: var(--text-base);
  cursor: pointer; text-decoration: none;
}
.menu__item:hover { background: var(--stone-50); text-decoration: none; }
.menu__item--danger { color: var(--err-700); }
.menu__sep { border: 0; border-top: 1px solid var(--hairline); margin: var(--sp-2) 0; }

/* ── Command bar (Ctrl+K) ────────────────────────────────────────────────── */
.cmdbar { border: 0; border-radius: var(--r-md); box-shadow: var(--e-3); padding: 0; width: min(640px, calc(100vw - 32px)); margin-top: 10vh; }
.cmdbar::backdrop { background: rgba(6, 42, 30, 0.45); }
.cmdbar__input {
  width: 100%; border: 0; border-bottom: 1px solid var(--hairline);
  padding: var(--sp-5) var(--sp-6); font-size: var(--text-lead);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.cmdbar__input:focus { outline: none; }
.cmdbar__results { max-height: 50vh; overflow-y: auto; padding: var(--sp-3); }
.cmdbar__group { font-size: var(--text-caption); font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: var(--sp-3) var(--sp-4) var(--sp-1); }
.cmdbar__item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 9px var(--sp-4); border-radius: var(--r-sm);
  color: var(--stone-800); text-decoration: none;
}
.cmdbar__item:hover, .cmdbar__item.is-selected { background: var(--hover-tint); text-decoration: none; }

/* ── Gated band (marketplace premium lock) ───────────────────────────────── */
.gated {
  border-top: 2px solid var(--gold-400);
  background: linear-gradient(180deg, var(--gold-50), var(--white));
  border-radius: var(--r-md);
  box-shadow: var(--e-0);
  padding: var(--sp-7);
  display: flex; gap: var(--sp-5); align-items: center;
}
.gated .icon { width: 26px; height: 26px; color: var(--gold-600); }

/* ── Hero band (public) ──────────────────────────────────────────────────── */
.hero {
  background: var(--gradient-ceremonial);
  border-bottom: 2px solid var(--gold-400);
  color: var(--white);
}
.hero h1 { color: var(--white); }
.hero .lead { color: var(--green-200); font-size: var(--text-h5); }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Charts ──────────────────────────────────────────────────────────────── */
.chart-box { position: relative; }
.chart-box svg text { font-family: var(--font-ui); }
.chart-toggle { display: inline-flex; gap: 0; border: 1px solid var(--stone-300); border-radius: var(--r-sm); overflow: hidden; }
.chart-toggle button {
  border: 0; background: var(--white); color: var(--stone-600);
  padding: 4px 12px; font-size: var(--text-caption); font-weight: 650; cursor: pointer;
}
.chart-toggle button.is-active { background: var(--green-700); color: var(--white); }
.chart-tooltip {
  position: absolute; pointer-events: none;
  background: var(--stone-900); color: var(--white);
  border-radius: var(--r-sm); padding: 6px 10px;
  font-size: var(--text-caption);
  box-shadow: var(--e-2);
  z-index: 30;
  white-space: nowrap;
}

/* ── Button busy state (JS-driven; label stays, spinner leads) ────────────── */
.btn.is-busy { pointer-events: none; opacity: 0.9; }
.btn.is-busy::before {
  content: ""; width: 14px; height: 14px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  display: inline-block; vertical-align: -2px; margin-right: 7px;
}
@media (prefers-reduced-motion: reduce) {
  .btn.is-busy::before, .spinner { animation-duration: 1.6s; }
}

/* ── Page-head actions + inline report controls ──────────────────────────── */
.page-head__actions { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.report-controls { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap; }
.report-controls__form { display: flex; gap: var(--sp-4); align-items: flex-end; flex-wrap: wrap; }
.field--inline { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.field--inline .field__label { margin: 0; }
.field--inline .select { min-width: 150px; }
.report-meta { margin-bottom: var(--sp-5); color: var(--stone-700); }

/* ── Reconciliation workbench ────────────────────────────────────────────── */
.recon-list { display: flex; flex-direction: column; }
.recon-credit { padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--hairline); }
.recon-credit:last-child { border-bottom: 0; }
.recon-credit__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.recon-credit__head .t-num { font-size: var(--text-h5); font-weight: 700; margin-right: var(--sp-2); }
.recon-credit__none { margin: 0; }
.recon-cands { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.recon-cand {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--stone-50); border: 1px solid var(--hairline); border-radius: var(--r-sm);
}
.recon-cand__info { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; min-width: 0; }
.recon-cand__reason { flex-basis: 100%; }
.recon-cand form { margin: 0; flex: none; }

/* ── Print — strip app chrome, render a clean report ─────────────────────── */
.print-only { display: none; }
@media print {
  .no-print, .sidebar, .topbar, .cmdbar, .toast-region, .public-nav,
  .app-footer, .chart-toggle, .skip-link { display: none !important; }
  .print-only { display: block; }
  html, body { background: #fff !important; }
  .shell { display: block; }
  .main { padding: 0 !important; }
  .card, .table-wrap, .stat-tile {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
  .page-head { border-bottom: 2px solid #000; padding-bottom: 8px; }
  .page-head__title, .card__title { color: #000 !important; }
  [data-chart] svg { max-height: 260px; }
  a[href] { color: #000; text-decoration: none; }
  @page { margin: 1.4cm; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Admin — user detail, finance & gateway (enterprise console)
   ═══════════════════════════════════════════════════════════════════════ */
.badge--warn  { background: var(--warn-50);  color: var(--warn-700); }
.badge--muted { background: var(--stone-100); color: var(--stone-700); }
.link-strong  { font-weight: 700; color: var(--ink); text-decoration: none; }
.link-strong:hover { color: var(--green-700); text-decoration: underline; }
.ta-right { text-align: right; }
.table--tight th, .table--tight td { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.amt-credit { color: #0CA30C; }
.amt-debit  { color: var(--stone-700); }
.dot { color: var(--stone-300); }

/* Identity banner */
.user-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-6); flex-wrap: wrap;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(207,168,61,.10), transparent 55%),
    linear-gradient(180deg, var(--stone-50), var(--surface));
  border-color: var(--stone-200);
}
.user-banner__id { display: flex; align-items: center; gap: var(--sp-5); min-width: 0; }
.user-avatar {
  display: grid; place-items: center; flex: none;
  width: 60px; height: 60px; border-radius: 50%;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: .02em;
  box-shadow: var(--e-1);
}
.user-avatar--green { background: var(--surface-dark); color: var(--gold-300); }
.user-avatar--gold  { background: var(--gold-500);  color: var(--graphite-950); }
.user-banner__name { font-size: var(--text-h3); margin: 0 0 var(--sp-2); line-height: 1.1; }
.user-banner__meta { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; font-size: var(--text-small); }
.user-banner__meta a { color: var(--muted); text-decoration: none; }
.user-banner__meta a:hover { color: var(--green-700); }
.user-banner__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.user-banner__actions form { margin: 0; }

/* Two-column detail grid */
.user-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.user-col { display: flex; flex-direction: column; gap: var(--sp-6); min-width: 0; }
@media (max-width: 900px) { .user-grid { grid-template-columns: 1fr; } }

/* Roles */
.role-list { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.role-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  background: var(--green-50); border: 1px solid var(--green-200);
  border-radius: var(--r-pill); font-size: var(--text-small); font-weight: 600; color: var(--green-800);
}
.role-chip__name { display: inline-flex; align-items: center; gap: var(--sp-2); }
.role-chip__form { margin: 0; }
.role-chip__x {
  display: grid; place-items: center; width: 20px; height: 20px; padding: 0;
  border: none; background: transparent; color: var(--green-600); cursor: pointer; border-radius: 50%;
}
.role-chip__x:hover { background: var(--error-50, #FBEBEA); color: #B42318; }
.role-add { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); align-items: center; }
.role-add .select { flex: 1; min-width: 0; }

/* Wallet band */
.wallet-band {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap;
  padding: var(--sp-5); border-radius: var(--r-md);
  background: var(--gradient-ceremonial); color: #fff;
}
.wallet-band__label { display: block; font-size: var(--text-caption); color: rgba(255,255,255,.7); letter-spacing: .04em; text-transform: uppercase; }
.wallet-band__value { display: block; font-size: var(--text-h2); font-weight: 700; font-variant-numeric: tabular-nums; margin-top: var(--sp-1); }
.wallet-band__acct { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.wallet-band__acct .t-mono { color: var(--gold-300); font-size: var(--text-h5); letter-spacing: .04em; }
.wallet-band__acct .t-caption { color: rgba(255,255,255,.7) !important; }

/* Mini list (support) */
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--hairline); }
.mini-list li:last-child { border-bottom: none; }
.mini-list__title { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--ink); font-size: var(--text-small); min-width: 0; }
.mini-list__title svg { color: var(--green-600); flex: none; }

/* Activity feed */
.activity-feed { list-style: none; margin: 0; padding: 0; position: relative; }
.activity-feed::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--hairline); }
.activity-feed__item { position: relative; display: flex; gap: var(--sp-4); padding: var(--sp-3) 0 var(--sp-3) var(--sp-6); }
.activity-feed__dot { position: absolute; left: 0; top: 12px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--green-600); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--green-200); }
.activity-feed__action { font-weight: 600; font-size: var(--text-small); color: var(--ink); }

/* Finance summary + filter bar (shared by transactions/settlements/gateway) */
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-5); }
.filter-bar .input, .filter-bar .select { max-width: 200px; }
.finance-total {
  display: inline-flex; align-items: baseline; gap: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.provider-card {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
  padding: var(--sp-5); border: 1px solid var(--hairline); border-radius: var(--r-md);
  margin-bottom: var(--sp-4); background: var(--surface);
}
.provider-card__lead { display: flex; align-items: center; gap: var(--sp-4); min-width: 0; }
.provider-card__icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: var(--r-md); background: var(--chip-bg); color: var(--chip-fg); }
.provider-card__name { font-weight: 700; color: var(--ink); }
.provider-card__form { margin: 0; }

/* Settlement pipeline cells */
.pipe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-4); }
.pipe-cell {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-4) var(--sp-5); border-radius: var(--r-md);
  border: 1px solid var(--hairline); border-left: 3px solid var(--stone-300); background: var(--surface);
}
.pipe-cell__n { font-size: var(--text-h3); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; color: var(--ink); }
.pipe-cell__label { font-size: var(--text-caption); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pipe-cell__amt { font-size: var(--text-small); font-family: var(--font-mono); color: var(--stone-700); margin-top: var(--sp-1); }
.pipe-cell--green  { border-left-color: #0CA30C; }
.pipe-cell--gold   { border-left-color: var(--gold-500); }
.pipe-cell--orange { border-left-color: #EC835A; }
.pipe-cell--red    { border-left-color: #D03B3B; }
.pipe-cell--muted  { border-left-color: var(--stone-300); }

/* Settings hub */
.settings-form { max-width: var(--form-max); margin-top: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-6); }
.settings-section { padding: 0; overflow: hidden; }
.settings-section__head {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-5); border-bottom: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--stone-50), var(--surface));
}
.settings-section__icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--r-md); background: var(--surface-dark); color: var(--gold-300); }
.settings-section__title { font-size: var(--text-h5); margin: 0; }
.settings-section__blurb { font-size: var(--text-small); color: var(--muted); margin: 2px 0 0; }
.settings-section__body { padding: var(--sp-5); }
.settings-section__body .field:last-child { margin-bottom: 0; }
.settings-form__actions { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }

/* Transaction-detail management panel */
.mgmt-actions { display: flex; flex-direction: column; gap: var(--sp-4); }
.mgmt-actions > form { margin: 0; }
.mgmt-actions .btn { width: 100%; }
.mgmt-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.mgmt-form--danger { border-top: 1px solid var(--hairline); padding-top: var(--sp-4); margin-top: var(--sp-1); }
.input--sm { padding: 7px 10px; font-size: var(--text-small); }
.kv dd .pill { vertical-align: middle; }

/* SLA revenue-terms editor */
.sla-form .field { margin-bottom: var(--sp-4); }
.sla-split { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: var(--sp-4); margin: var(--sp-4) 0; background: var(--stone-50); }
.sla-split__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3);
  font-size: var(--text-caption); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sla-split__sum { font-family: var(--font-mono); font-size: var(--text-small); font-weight: 700; color: var(--green-700);
  background: var(--green-50); border: 1px solid var(--green-200); border-radius: var(--r-pill); padding: 2px 10px; }
.sla-split__sum.is-bad { color: #B3261E; background: var(--err-50, #FBEDEB); border-color: var(--err-300, #EFB0AB); }
.sla-split__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.sla-split__cell .field__label { display: inline-flex; align-items: center; gap: 5px; margin-bottom: var(--sp-2); }
.sla-split__cell .field__label svg { color: var(--stone-500); }
.sla-split__input { position: relative; }
.sla-split__input .input { padding-right: 26px; }
.sla-split__pct { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: var(--text-small); }

/* Reports hub */
.rpt-group { margin-bottom: var(--sp-8); }
.rpt-group__title { font-size: var(--text-h5); color: var(--ink); margin: 0 0 var(--sp-4);
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--hairline); }
.rpt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.rpt-card { display: flex; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-5);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md);
  text-decoration: none; transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s; }
.rpt-card:hover { transform: translateY(-2px); border-color: var(--green-200); box-shadow: var(--e-2); }
.rpt-card__icon { flex: none; width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center;
  background: var(--surface-dark); color: var(--gold-300); }
.rpt-card__icon svg { width: 21px; height: 21px; }
.rpt-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rpt-card__title { font-weight: 700; color: var(--ink); font-size: var(--text-lead); }
.rpt-card__desc { font-size: var(--text-small); color: var(--muted); line-height: 1.45; }
.rpt-card__meta { font-size: var(--text-caption); color: var(--stone-500); display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-2); }
.rpt-card__meta svg { color: var(--stone-400); }
.rpt-card__go { flex: none; color: var(--stone-400); align-self: center; }
.rpt-card:hover .rpt-card__go { color: var(--green-700); }

/* Report filter bar */
.rpt-filters { padding: var(--sp-5); }
.rpt-filters__row { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: flex-end; }
.rpt-filters .field { margin: 0; min-width: 150px; flex: 0 1 auto; }
.rpt-filters .field .select, .rpt-filters .field .input { min-width: 150px; }
.rpt-filters__actions { display: flex; gap: var(--sp-3); align-items: center; margin-left: auto; }

/* Withdrawal queue row actions */
.wd-actions { display: flex; flex-direction: column; gap: var(--sp-2); }
.wd-actions > form { margin: 0; }
.wd-inline { display: flex; gap: var(--sp-2); align-items: center; }
.wd-inline .input--sm { max-width: 130px; }
