/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-wash); }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.serif { font-family: var(--serif); }
.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.pos { color: var(--positive); }
.neg { color: var(--negative); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.gap-s { gap: 6px; } .gap-m { gap: 14px; } .gap-l { gap: 22px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hairline { height: 1px; background: var(--line-soft); }

/* ---------------------------------------------------------------------------
   Shell
   --------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--chrome);
  border-right: 1px solid var(--line);
  color: #e7edf6;
}
:root[data-theme="light"] .rail { color: #dfe6f1; }

.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: linear-gradient(160deg, #1a2f4d, #0d1b2f);
  border: 1px solid var(--gold-line);
  display: grid; place-items: center;
}
.brand-name { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: 0.06em; line-height: 1.1; }
.brand-sub { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(231,237,246,0.5); }

.nav { flex: 1; overflow-y: auto; padding: 14px 10px 10px; }
.nav-group { margin-bottom: 16px; }
.nav-group > .eyebrow { padding: 0 10px 7px; color: rgba(231,237,246,0.38); }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 8px 10px;
  border: 0; background: transparent; cursor: pointer;
  border-radius: var(--r-s);
  color: rgba(231,237,246,0.72);
  font-size: 13.5px; font-weight: 500;
  text-align: left;
  position: relative;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.nav-item:hover { background: rgba(255,255,255,0.055); color: #fff; }
.nav-item.active { background: rgba(201,162,74,0.13); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 2.5px;
  background: var(--gold-bright); border-radius: 0 2px 2px 0;
}
.nav-item svg { flex: none; opacity: 0.85; }
.nav-item .tally {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  background: rgba(255,255,255,0.09); color: rgba(231,237,246,0.8);
  padding: 1px 6px; border-radius: 99px;
}
.nav-item.active .tally { background: var(--gold); color: var(--gold-ink); }

.rm-card {
  margin: 10px; padding: 12px; border-radius: var(--r-m);
  background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.07);
}
.rm-card .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(150deg, var(--gold-bright), #8a6a1f); color: #16110a; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.rail-foot { padding: 12px 18px 16px; border-top: 1px solid rgba(255,255,255,0.07); font-size: 10px; line-height: 1.5; color: rgba(231,237,246,0.42); }

/* ---------------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar);
  display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16px; white-space: nowrap; }
.topbar .crumb { font-size: 11px; color: var(--ink-3); }

.searchbox {
  display: flex; align-items: center; gap: 8px;
  width: 300px; padding: 7px 11px;
  background: var(--surface-inset); border: 1px solid var(--line);
  border-radius: var(--r-s); color: var(--ink-3);
}
.searchbox input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 13px; color: var(--ink); }
.searchbox kbd {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px;
  border: 1px solid var(--line); border-radius: var(--r-xs); color: var(--ink-3);
}

.chip-secure {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: 99px;
  background: var(--positive-wash); color: var(--positive);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.chip-secure .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: color 0.14s var(--ease), border-color 0.14s var(--ease), background 0.14s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn .badge-dot { position: absolute; }

.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); cursor: pointer; }
.user-chip div { white-space: nowrap; }
.user-chip .avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(150deg, #1f3555, #0e1b2e); border: 1px solid var(--line-strong); color: var(--gold-bright); display: grid; place-items: center; font-size: 11px; font-weight: 700; }

.page { padding: 22px var(--gutter) 60px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; font-family: var(--serif); letter-spacing: 0; }

/* ---------------------------------------------------------------------------
   Panels
   --------------------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.panel.raised { box-shadow: var(--shadow); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--sheen);
}
.panel-head h3 { font-size: 13.5px; }
.panel-head .sub { font-size: 11.5px; color: var(--ink-3); }
.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }
.panel-foot { padding: 11px 16px; border-top: 1px solid var(--line-soft); background: var(--surface-2); font-size: 12px; color: var(--ink-2); }

.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); }
@media (max-width: 1180px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3, .grid.main-side { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------------------
   Buttons, pills, form controls
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r-s);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform 0.1s var(--ease), background 0.14s var(--ease), border-color 0.14s var(--ease), opacity 0.14s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.gold {
  background: linear-gradient(175deg, var(--gold-bright), var(--gold));
  border-color: var(--gold); color: var(--gold-ink);
}
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--ink-2); padding: 6px 8px; font-weight: 500; }
.btn.quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--negative); border-color: color-mix(in srgb, var(--negative) 40%, transparent); background: var(--negative-wash); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.lg { padding: 12px 20px; font-size: 14px; }
.btn.block { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 99px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em;
  background: var(--surface-3); color: var(--ink-2);
  border: 1px solid transparent; white-space: nowrap;
}
.pill.pos { background: var(--positive-wash); color: var(--positive); }
.pill.neg { background: var(--negative-wash); color: var(--negative); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.info { background: var(--info-wash); color: var(--info); }
.pill.gold { background: var(--gold-wash); color: var(--gold); border-color: var(--gold-line); }
.pill.outline { background: transparent; border-color: var(--line); color: var(--ink-3); }

.seg { display: inline-flex; padding: 2px; background: var(--surface-inset); border: 1px solid var(--line); border-radius: var(--r-s); }
.seg button {
  border: 0; background: transparent; cursor: pointer;
  padding: 5px 12px; border-radius: 4px;
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  transition: color 0.14s, background 0.14s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface-3); color: var(--ink); box-shadow: var(--shadow-s); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 11px;
  background: var(--surface-inset); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-s);
  outline: none; font-size: 13.5px;
  transition: border-color 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--gold-line); box-shadow: var(--ring); }
select.input { appearance: none; cursor: pointer; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 14px center, right 9px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.input.amount { font-family: var(--mono); font-size: 22px; font-weight: 600; padding: 12px 13px; letter-spacing: -0.02em; }

.switch { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background 0.18s var(--ease); flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-3); transition: transform 0.18s var(--ease), background 0.18s; }
.switch.on { background: var(--positive-wash); border-color: color-mix(in srgb, var(--positive) 45%, transparent); }
.switch.on::after { transform: translateX(16px); background: var(--positive); }

/* ---------------------------------------------------------------------------
   Ledger table
   --------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
/* A sticky header needs a scrolling ancestor of its own, or it drifts. */
.table-wrap.scroll-y { max-height: calc(100vh - 300px); overflow: auto; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ledger thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-2);
  padding: 9px 12px;
  text-align: left;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.ledger.static thead th { position: static; }
table.ledger thead th.sortable { cursor: pointer; user-select: none; }
table.ledger thead th.sortable:hover { color: var(--ink); }
table.ledger tbody td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.ledger tbody tr { cursor: pointer; transition: background 0.1s linear; }
table.ledger tbody tr:hover { background: var(--surface-2); }
table.ledger tbody tr.sel { background: var(--gold-wash); }
table.ledger td.amt { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
table.ledger th.amt { text-align: right; }
table.ledger .date-cell { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
table.ledger .desc { font-weight: 500; }
table.ledger .desc, table.ledger .meta { max-width: 265px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.ledger td.acct, table.ledger td.acct div { white-space: nowrap; font-size: 12px; }
table.ledger td.acct div { max-width: 168px; overflow: hidden; text-overflow: ellipsis; }
table.ledger td .mono { white-space: nowrap; }
table.ledger .meta { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

.tx-icon {
  width: 30px; height: 30px; border-radius: var(--r-s); flex: none;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--ink-2);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-soft);
}
.tx-icon.in { background: var(--positive-wash); color: var(--positive); border-color: transparent; }
.tx-icon.out { background: var(--surface-3); }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); }
.empty h4 { color: var(--ink-2); margin-bottom: 4px; }

/* ---------------------------------------------------------------------------
   Drawer, modal, toast
   --------------------------------------------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(3, 7, 14, 0.6); backdrop-filter: blur(2px); animation: fade 0.16s var(--ease); }
@keyframes fade { from { opacity: 0; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95;
  width: min(460px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-l);
  display: flex; flex-direction: column;
  animation: slide-in 0.2s var(--ease);
}
@keyframes slide-in { from { transform: translateX(26px); opacity: 0.4; } }
.drawer-head { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { padding: 13px 18px; border-top: 1px solid var(--line-soft); background: var(--surface-2); display: flex; gap: 10px; }

.modal {
  position: fixed; z-index: 95; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 60px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  box-shadow: var(--shadow-l);
  animation: pop 0.18s var(--ease);
}
@keyframes pop { from { transform: translate(-50%, -47%) scale(0.985); opacity: 0; } }

.dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 9px 18px; font-size: 12.5px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; text-align: right; font-weight: 500; word-break: break-word; }
.dl dd .mono { white-space: nowrap; font-size: 11.5px; }

.toasts { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; gap: 11px; align-items: flex-start;
  min-width: 290px; max-width: 380px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--positive);
  border-radius: var(--r-s); box-shadow: var(--shadow-l);
  animation: toast-in 0.22s var(--ease);
}
.toast.err { border-left-color: var(--negative); }
.toast.info { border-left-color: var(--info); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------------------
   Sign-in
   --------------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } }

.auth-aside {
  position: relative; overflow: hidden;
  padding: 46px 52px;
  background:
    radial-gradient(900px 500px at 15% 8%, rgba(201,162,74,0.13), transparent 58%),
    linear-gradient(155deg, #0d1b2f 0%, #071019 62%, #050b13 100%);
  color: #e9eef6;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(115deg, rgba(255,255,255,0.028) 0 1px, transparent 1px 9px);
  pointer-events: none;
}
.auth-quote { font-family: var(--serif); font-size: 30px; line-height: 1.3; letter-spacing: -0.01em; max-width: 15ch; }
.auth-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.auth-stats .v { font-family: var(--serif); font-size: 22px; }
.auth-stats .k { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(233,238,246,0.5); }

.auth-main { display: grid; place-items: center; padding: 40px 28px; background: var(--bg-grad), var(--bg); }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 20px; }
.auth-card .lockline { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.otp-boxes { display: flex; gap: 9px; }
.otp-boxes input {
  width: 100%; height: 52px; text-align: center;
  font-family: var(--mono); font-size: 20px; font-weight: 600;
  background: var(--surface-inset); border: 1px solid var(--line); border-radius: var(--r-s);
  outline: none; color: var(--ink);
}
.otp-boxes input:focus { border-color: var(--gold-line); box-shadow: var(--ring); }

/* ---------------------------------------------------------------------------
   Overview
   --------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-m); border: 1px solid var(--line);
  background:
    radial-gradient(700px 320px at 88% -30%, rgba(201,162,74,0.16), transparent 62%),
    linear-gradient(160deg, var(--surface-2), var(--surface));
  padding: 22px 24px;
  display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap;
  box-shadow: var(--shadow-s);
}
.hero .total { font-family: var(--mono); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.hero .total .cur { font-size: 20px; color: var(--ink-3); margin-right: 8px; letter-spacing: 0; }
.hero-splits { display: flex; gap: 26px; flex-wrap: wrap; align-items: flex-end; }
.hero-split .k { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.hero-split .v { font-family: var(--mono); font-size: 15px; font-weight: 600; }

.stat { padding: 15px 16px; display: flex; flex-direction: column; gap: 7px; }
.stat .v { font-family: var(--mono); font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.stat .foot { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }

.acct-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 15px 16px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  transition: border-color 0.16s var(--ease), transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
  position: relative; overflow: hidden;
}
.acct-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--flag, var(--line-strong)); }
.acct-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.acct-card .bal { font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.acct-card .iban { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.flagbox {
  width: 30px; height: 22px; border-radius: 3px; flex: none;
  display: grid; place-items: center; font-size: 12px;
  background: var(--surface-3); border: 1px solid var(--line);
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Charts
   --------------------------------------------------------------------------- */
.chart { display: block; overflow: visible; max-width: 100%; }
.chart.fluid { width: 100%; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis-text { fill: var(--ink-3); font-size: 10px; font-family: var(--mono); }
.chart .bar-in { fill: var(--positive); }
.chart .bar-out { fill: var(--negative); opacity: 0.85; }
.chart .area { fill: url(#areaGrad); }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .marker { fill: var(--gold); stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.legend .item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.legend .swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }

.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--gold); }

/* ---------------------------------------------------------------------------
   Filter bar
   --------------------------------------------------------------------------- */
.filters {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.filters .input, .filters select.input { width: auto; padding: 6px 10px; font-size: 12.5px; background: var(--surface); }
.filters select.input { padding-right: 28px; }
.filters .search { min-width: 230px; flex: 1 1 230px; }

/* ---------------------------------------------------------------------------
   Cards view
   --------------------------------------------------------------------------- */
.plastic {
  position: relative; overflow: hidden;
  aspect-ratio: 1.586;
  width: 100%; max-width: 380px;
  border-radius: 14px;
  padding: 20px;
  color: #f2eee4;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(140deg, #1d2a3c 0%, #0a1119 48%, #131b26 100%);
  border: 1px solid rgba(201,162,74,0.34);
  box-shadow: var(--shadow-l);
}
.plastic::after {
  content: ""; position: absolute; top: -60%; left: -20%; width: 70%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: rotate(18deg);
}
.plastic.gold-tier { background: linear-gradient(140deg, #4a3a17 0%, #1b1408 52%, #33280f 100%); border-color: rgba(227,189,104,0.5); }
.plastic.frozen { filter: grayscale(0.55) brightness(0.75); }
.plastic .pan { font-family: var(--mono); font-size: 17px; letter-spacing: 0.16em; }
.plastic .chip { width: 38px; height: 28px; border-radius: 5px; background: linear-gradient(150deg, #e6cd8f, #a4832f); opacity: 0.92; }
.plastic .tier { font-family: var(--serif); font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-bright); }

/* ---------------------------------------------------------------------------
   Transfer flow
   --------------------------------------------------------------------------- */
.steps { display: flex; align-items: center; gap: 0; }
.steps .step { display: flex; align-items: center; gap: 9px; padding-right: 14px; }
.steps .step + .step { padding-left: 14px; border-left: 1px solid var(--line); }
.steps .n {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--surface-3); color: var(--ink-3); border: 1px solid var(--line);
}
.steps .step.on .n { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.steps .step.done .n { background: var(--positive-wash); color: var(--positive); border-color: color-mix(in srgb, var(--positive) 40%, transparent); }
.steps .lbl { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.steps .step.on .lbl, .steps .step.done .lbl { color: var(--ink); }

.quote-box { background: var(--surface-inset); border: 1px solid var(--line); border-radius: var(--r-m); padding: 15px 16px; display: flex; flex-direction: column; gap: 11px; }
.quote-row { display: flex; justify-content: space-between; font-size: 12.5px; }
.quote-row .k { color: var(--ink-3); }
.quote-row .v { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.quote-total { border-top: 1px dashed var(--line); padding-top: 11px; font-size: 15px; font-weight: 600; }

.picker-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 13px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s);
  transition: border-color 0.14s var(--ease), background 0.14s var(--ease);
}
.picker-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.picker-row.on { border-color: var(--gold-line); background: var(--gold-wash); }

.receipt {
  border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden;
  background: repeating-linear-gradient(180deg, var(--surface) 0 27px, var(--surface-2) 27px 28px);
}
.receipt .head { padding: 18px; text-align: center; border-bottom: 1px dashed var(--line); background: var(--surface); }
.receipt .body { padding: 18px; }

.rates-board td.mono { font-size: 12.5px; }
.spark { width: 78px; height: 22px; }

.doc-row { display: flex; align-items: center; gap: 13px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.doc-ico { width: 32px; height: 40px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-3); flex: none; }

.timeline { display: flex; flex-direction: column; }
.timeline .ev { display: flex; gap: 13px; padding-bottom: 16px; position: relative; }
.timeline .ev::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline .ev:last-child { padding-bottom: 0; }
.timeline .ev:last-child::before { display: none; }
.timeline .dot { width: 13px; height: 13px; border-radius: 50%; border: 3px solid var(--surface); background: var(--ink-3); margin-top: 3px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.timeline .ev.ok .dot { background: var(--positive); }
.timeline .ev.warn .dot { background: var(--warn); }

@media (max-width: 1240px) {
  .topbar .searchbox { display: none; }
}

@media (max-width: 1000px) {
  :root { --rail: 66px; --gutter: 16px; }
  .brand-text, .nav-item span, .nav-group > .eyebrow, .rm-card, .rail-foot { display: none; }
  .nav-item { justify-content: center; }
  .nav-item .tally { position: absolute; top: 2px; right: 2px; }
  .topbar .user-chip div { display: none; }
}

.donut-block { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; }
.donut-legend { flex: 1 1 190px; min-width: 180px; }
