/* Tender — merchant dashboard styles */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --font-ui: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }

/* ---- THEME TOKENS ---- */
.app {
  /* accent injected inline as --accent / --accent-ink */
  --bg:        oklch(0.985 0.004 95);
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.975 0.004 95);
  --raised:    oklch(1 0 0);
  --ink:       oklch(0.24 0.012 265);
  --ink-soft:  oklch(0.42 0.012 265);
  --muted:     oklch(0.58 0.012 265);
  --faint:     oklch(0.72 0.01 265);
  --line:      oklch(0.92 0.005 265);
  --line-soft: oklch(0.95 0.004 265);
  --pos:       oklch(0.58 0.12 155);
  --pos-bg:    oklch(0.95 0.04 155);
  --neg:       oklch(0.585 0.16 25);
  --neg-bg:    oklch(0.955 0.03 25);
  --warn:      oklch(0.66 0.13 70);
  --warn-bg:   oklch(0.95 0.05 75);
  --info-bg:   oklch(0.95 0.03 265);
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 265 / 0.06), 0 1px 1px oklch(0.2 0.02 265 / 0.04);
  --shadow-md: 0 4px 14px oklch(0.2 0.02 265 / 0.08), 0 1px 3px oklch(0.2 0.02 265 / 0.05);
  --shadow-lg: 0 18px 50px oklch(0.2 0.03 265 / 0.18), 0 4px 12px oklch(0.2 0.02 265 / 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --row-h: 56px;
  --pad: 16px;

  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
}

.app[data-density="compact"] { --row-h: 44px; --pad: 11px; }
.app[data-density="comfy"]   { --row-h: 64px; --pad: 20px; }

.app[data-radius="sharp"]  { --radius: 5px;  --radius-sm: 3px;  --radius-lg: 8px; }
.app[data-radius="round"]  { --radius: 18px; --radius-sm: 12px; --radius-lg: 26px; }

.app[data-theme="dark"] {
  --bg:        oklch(0.19 0.012 265);
  --surface:   oklch(0.225 0.014 265);
  --surface-2: oklch(0.205 0.013 265);
  --raised:    oklch(0.25 0.015 265);
  --ink:       oklch(0.96 0.006 265);
  --ink-soft:  oklch(0.82 0.01 265);
  --muted:     oklch(0.66 0.012 265);
  --faint:     oklch(0.5 0.012 265);
  --line:      oklch(0.31 0.014 265);
  --line-soft: oklch(0.27 0.013 265);
  --pos:       oklch(0.74 0.14 155);
  --pos-bg:    oklch(0.32 0.05 155);
  --neg:       oklch(0.72 0.15 25);
  --neg-bg:    oklch(0.33 0.06 25);
  --warn:      oklch(0.78 0.12 75);
  --warn-bg:   oklch(0.34 0.05 75);
  --info-bg:   oklch(0.3 0.04 265);
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 18px 50px oklch(0 0 0 / 0.55), 0 4px 12px oklch(0 0 0 / 0.4);
}

/* ---- LAYOUT ---- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.main { min-width: 0; display: flex; flex-direction: column; }

/* brand */
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 17px;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-mode { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }

/* nav */
.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--faint); padding: 16px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--ink-soft); font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav-item.active .ic { opacity: 1; }
.nav-item .ic { opacity: .7; flex-shrink: 0; }
.nav-badge { margin-left: auto; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); padding: 1px 7px; border-radius: 20px; }
.nav-item.active .nav-badge { background: oklch(1 0 0 / 0.22); color: var(--accent-ink); }

.sidebar-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); }
.acct { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.acct:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--accent); color: var(--accent-ink); }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.muted { background: var(--surface-2); color: var(--ink-soft); }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.search {
  display: flex; align-items: center; gap: 8px; flex: 1; max-width: 360px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 12px; color: var(--muted);
}
.search input { border: none; background: none; outline: none; font: inherit; font-size: 14px;
  color: var(--ink); width: 100%; }
.search input::placeholder { color: var(--faint); }
.kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; color: var(--muted); }

.content { padding: 26px 28px 64px; max-width: 1240px; width: 100%; margin: 0 auto; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm); padding: 9px 15px; border: 1px solid transparent;
  transition: background .12s, border-color .12s, transform .05s, box-shadow .12s;
  white-space: nowrap;
}
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-subtle { background: var(--surface-2); color: var(--ink-soft); }
.btn-subtle:hover { background: var(--line-soft); color: var(--ink); }
.btn-danger { background: var(--neg-bg); color: var(--neg); border-color: transparent; }
.btn-danger:hover { filter: brightness(0.97); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ---- CARDS ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: var(--pad); }

/* ---- BADGES ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 30px; line-height: 1.7; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-succeeded { background: var(--pos-bg); color: var(--pos); }
.badge-refunded  { background: var(--surface-2); color: var(--muted); }
.badge-failed    { background: var(--neg-bg); color: var(--neg); }
.badge-disputed  { background: var(--warn-bg); color: var(--warn); }
.badge-uncaptured{ background: var(--info-bg); color: var(--accent); }
.badge-in_transit{ background: var(--info-bg); color: var(--accent); }
.badge-paid      { background: var(--pos-bg); color: var(--pos); }

/* numbers */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -0.02em; }

/* utility */
.muted { color: var(--muted); }
.soft { color: var(--ink-soft); }
.row { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.spread { justify-content: space-between; }
.scroll-area { overflow: auto; }

.fade-in { animation: fadeIn .28s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* responsive */
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%);
    transition: transform .25s ease; width: 248px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: oklch(0.2 0.02 265 / 0.4); z-index: 50; }
  .content { padding: 18px 16px 64px; }
  .topbar { padding: 12px 16px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 881px) { .menu-btn { display: none; } }

/* ---- ENDPOINT (bank / brokerage chip) ---- */
.endpoint { display: flex; align-items: center; gap: 11px; min-width: 0; }
.endpoint-txt { min-width: 0; }
.endpoint-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.endpoint-sub { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.bank-logo { border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; letter-spacing: -0.02em; }
.acct-icon { border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  background: color-mix(in oklch, var(--accent) 16%, var(--surface)); color: var(--accent); }
.payee-icon { border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); color: var(--ink-soft); }

/* text inputs */
.tinput { width: 100%; font: inherit; font-size: 14.5px; padding: 11px 13px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); outline: none; transition: border-color .12s, box-shadow .12s; }
.tinput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent); }
.tinput.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.tinput.bad { border-color: var(--neg); }
.tinput::placeholder { color: var(--faint); }
.amount-range-input { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); padding: 9px 12px; transition: border-color .12s, box-shadow .12s; }
.amount-range-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent); }
.amount-range-input > span { color: var(--muted); font-family: var(--font-mono); font-weight: 600; }
.amount-range-input input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink);
  font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.field-hint.bad { color: var(--neg); }
.field-hint.ok { color: var(--pos); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- KPI ---- */
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-soft); }
.kpi-ic.accent { background: color-mix(in oklch, var(--accent) 15%, var(--surface)); color: var(--accent); }
.kpi-value { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.kpi-value.accent { color: var(--accent); }
.kpi-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.kpi-trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-family: var(--font-mono); font-size: 12px; }
.kpi-trend.up { color: var(--pos); } .kpi-trend.down { color: var(--neg); }

/* ---- CHARTS ---- */
.areachart { display: block; }
.barchart { display: flex; align-items: flex-end; gap: 10px; }
.barcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.barwrap { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: color-mix(in oklch, var(--accent) 26%, var(--surface-2));
  position: relative; transition: filter .12s; min-height: 4px; }
.bar.current { background: var(--accent); }
.bar:hover { filter: brightness(1.05); }
.bar:hover .bar-tip { opacity: 1; }
.bar-tip { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600;
  background: var(--ink); color: var(--bg); padding: 2px 7px; border-radius: 5px; white-space: nowrap; opacity: 0; transition: opacity .12s; pointer-events: none; }
.barlabel { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ---- TABLE ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--faint); padding: 0 14px 10px; border-bottom: 1px solid var(--line); }
.tbl thead th.right, .tbl td.right { text-align: right; }
.tbl tbody tr { border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .1s; }
.tbl tbody tr:last-child { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td { padding: 0 14px; height: var(--row-h); font-size: 14px; vertical-align: middle; }
.tbl .amt { font-size: 14.5px; }
.dirpill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.dirpill .arr { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; }
.dirpill.in .arr { background: var(--pos-bg); color: var(--pos); }
.dirpill.out .arr { background: var(--info-bg); color: var(--accent); }

/* section headers */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.sec-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.sec-link { font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; background: none; border: none; }
.sec-link:hover { text-decoration: underline; }

/* ---- OVERLAY / MODAL ---- */
.overlay { position: fixed; inset: 0; z-index: 100; background: oklch(0.2 0.02 265 / 0.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn .18s ease both; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%;
  border: 1px solid var(--line); max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal.fade-in { animation: pop .2s cubic-bezier(.2,.8,.2,1) both; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.modal-body { padding: 22px; overflow: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }
.icon-x { background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 7px; display: grid; place-items: center; }
.icon-x:hover { background: var(--surface-2); color: var(--ink); }

/* ---- DRAWER ---- */
.drawer-root { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.drawer-root.open { pointer-events: auto; }
.drawer-scrim { position: absolute; inset: 0; background: oklch(0.2 0.02 265 / 0.4); opacity: 0; transition: opacity .25s; }
.drawer-root.open .drawer-scrim { opacity: 1; }
.drawer { position: absolute; right: 0; top: 0; height: 100%; max-width: 92vw; background: var(--surface);
  box-shadow: var(--shadow-lg); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; }
.drawer-root.open .drawer { transform: none; }

/* ---- FORM CONTROLS ---- */
.field { margin-bottom: 18px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; display: block; }
.amount-input { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 4px 16px;
  background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.amount-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 18%, transparent); }
.amount-input .cur { font-family: var(--font-mono); font-size: 30px; color: var(--muted); font-weight: 500; }
.amount-input input { border: none; outline: none; background: none; font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 36px; font-weight: 600; color: var(--ink); width: 100%; padding: 8px 4px; letter-spacing: -0.02em; }
.amount-input input::placeholder { color: var(--faint); }
.quick-amts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 30px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: all .12s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.selectable { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s; margin-bottom: 8px; }
.selectable:hover { border-color: color-mix(in oklch, var(--accent) 50%, var(--line)); }
.selectable.sel { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 6%, var(--surface)); }
.selectable .radio { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0;
  display: grid; place-items: center; }
.selectable.sel .radio { border-color: var(--accent); }
.selectable.sel .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* segmented */
.toggle { margin-left: auto; width: 40px; height: 24px; border-radius: 20px; background: var(--line); position: relative; transition: background .15s; flex-shrink: 0; }
.toggle.on { background: var(--accent); }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.toggle.on .knob { transform: translateX(16px); }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; border: 1px solid var(--line); }
.seg { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 6px; border: none; background: none;
  color: var(--muted); cursor: pointer; transition: all .12s; }
.seg.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---- ACH TIMELINE ---- */
.timeline { position: relative; padding-left: 4px; }
.tl-step { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-rail { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.tl-node { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; z-index: 2;
  background: var(--surface-2); color: var(--faint); border: 2px solid var(--line); }
.tl-node.done { background: var(--pos); color: #fff; border-color: var(--pos); }
.tl-node.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 20%, transparent); }
.tl-node.failed { background: var(--neg); color: #fff; border-color: var(--neg); }
.tl-line { width: 2px; flex: 1; background: var(--line); margin: 2px 0; min-height: 14px; }
.tl-line.done { background: var(--pos); }
.tl-body { padding-top: 2px; }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tl-step.pending .tl-title { color: var(--muted); }

/* detail rows */
.drow { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line-soft); gap: 16px; }
.drow:last-child { border-bottom: none; }
.drow-k { font-size: 13px; color: var(--muted); }
.drow-v { font-size: 13.5px; font-weight: 600; text-align: right; }

/* info note */
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--info-bg); color: var(--ink-soft);
  font-size: 13px; line-height: 1.5; }
.note .ic { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.note.warn { background: var(--warn-bg); color: var(--ink-soft); }
.note.warn .ic { color: var(--warn); }
.note.neg { background: var(--neg-bg); }
.note.neg .ic { color: var(--neg); }

/* list rows / panels */
.panel-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.panel-row:last-child { border-bottom: none; }
.panel-row .grow { flex: 1; min-width: 0; }

.pill-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px;
  background: var(--surface-2); color: var(--muted); }
.pill-tag.accent { background: color-mix(in oklch, var(--accent) 14%, var(--surface)); color: var(--accent); }

/* clickable payee rows */
.payee-row { cursor: pointer; transition: background .12s; }
.payee-row:hover { background: var(--surface-2); }

/* recurring chip on a payee row */
.recur-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  color: var(--accent); background: color-mix(in oklch, var(--accent) 12%, var(--surface));
  padding: 3px 9px; border-radius: 999px; }
.recur-chip .recur-next { color: var(--muted); font-weight: 500; }

/* payee detail summary stats */
.payee-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.payee-stats > div + div { border-left: 1px solid var(--line); padding-left: 14px; }

.grid-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 980px) { .grid-kpi { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-kpi { grid-template-columns: 1fr; } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.spin { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: sp 0.8s linear infinite; margin: 0 auto; }
@keyframes sp { to { transform: rotate(360deg); } }
.success-check { width: 60px; height: 60px; border-radius: 50%; background: var(--pos-bg); color: var(--pos); display: grid; place-items: center; margin: 0 auto 16px; animation: pop .3s cubic-bezier(.2,.8,.2,1) both; }

/* ---- TOAST ---- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; max-width: 90vw; }
.toast .accent { color: var(--accent); }
.app[data-theme="dark"] .toast { background: var(--raised); color: var(--ink); border: 1px solid var(--line); }

/* ============================================================
   INVESTED PAYMENTS — cohort ROI dashboard
   ============================================================ */
.dash { min-height: 100vh; display: flex; flex-direction: column; }
.dash-top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 32px; border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20;
}
.dash-brand { display: flex; align-items: center; gap: 13px; }
.dash-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 15px; letter-spacing: -0.04em; }
.dash-title { font-size: 19px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.dash-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.dash-content { padding: 26px 32px 72px; max-width: 1280px; width: 100%; margin: 0 auto; }
.dash-asof { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line); padding: 6px 11px; border-radius: 30px; font-weight: 600; }

/* card header used across dashboard cards */
.cardhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.cardhead .ch-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.cardhead .ch-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* KPI delta chip on the dashboard */
.kpi-pct { font-size: 12.5px; font-weight: 700; font-family: var(--font-mono); padding: 2px 8px; border-radius: 30px;
  background: var(--pos-bg); color: var(--pos); display: inline-flex; align-items: center; gap: 3px; }
.kpi-pct.neg { background: var(--neg-bg); color: var(--neg); }
.kpi-foot { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---- COHORT ROI MATRIX (heatmap) ---- */
.matrix-scroll { overflow-x: auto; margin: 0 -2px; }
.cohort-tbl { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; }
.cohort-tbl th, .cohort-tbl td { padding: 0; text-align: right; }
.cohort-tbl thead th { vertical-align: bottom; padding: 0 14px 12px; border-bottom: 1px solid var(--line); }
.cohort-tbl thead .ct-corner { text-align: left; }
.ct-cohhead { cursor: pointer; transition: opacity .12s; }
.ct-cohhead .ct-coh-m { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ct-cohhead .ct-coh-y { font-size: 11px; color: var(--faint); font-weight: 600; }
.ct-cohhead .ct-coh-meta { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 5px; line-height: 1.5; }
.ct-cohhead .ct-coh-meta .cost { color: var(--neg); }
.cohort-tbl thead th.ct-totalhead { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--faint); border-left: 1px solid var(--line); }

.cohort-tbl tbody td { height: 44px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); }
.cohort-tbl tbody tr:last-child td { border-bottom: none; }
.ct-rowlabel { text-align: left !important; font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.ct-cell { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600;
  letter-spacing: -0.02em; transition: box-shadow .12s; }
.ct-cell.empty { color: var(--faint); font-weight: 400; }
.ct-rowtotal { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 700;
  border-left: 1px solid var(--line); }
.cohort-tbl td.col-active, .cohort-tbl th.col-active { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.cohort-tbl th.col-active { background: color-mix(in oklch, var(--accent) 7%, transparent); }

.cohort-tbl tfoot td { height: 42px; padding: 0 14px; }
.cohort-tbl tfoot tr.ct-foot-top td { border-top: 1.5px solid var(--line); }
.ct-footlabel { text-align: left !important; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink-soft); white-space: nowrap; }
.ct-footval { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; }
.ct-footval.net { color: var(--pos); }
.ct-grand { border-left: 1px solid var(--line); }

/* legend */
.heat-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.heat-bar { width: 78px; height: 9px; border-radius: 6px;
  background: linear-gradient(90deg, color-mix(in oklch, var(--accent) 8%, var(--surface)), var(--accent)); }

/* ---- PAYBACK / CUMULATIVE CHART ---- */
.pay-chart { width: 100%; display: block; }
.pay-x { display: flex; justify-content: space-between; margin-top: 8px; }
.pay-x span { font-size: 11px; color: var(--muted); font-weight: 600; flex: 1; text-align: center; }

/* returns-vs-cost mini bars */
.rvc { display: flex; flex-direction: column; gap: 16px; }
.rvc-row { display: flex; flex-direction: column; gap: 7px; }
.rvc-head { display: flex; justify-content: space-between; align-items: baseline; }
.rvc-k { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.dash-content .kpi-label { white-space: nowrap; }
.rvc-k .sw { width: 10px; height: 10px; border-radius: 3px; }
.rvc-v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 700; }
.rvc-track { height: 12px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.rvc-fill { height: 100%; border-radius: 7px; }

@media (max-width: 640px) { .dash-top { padding: 14px 16px; } .dash-content { padding: 18px 14px 56px; } }
