@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');

:root {
  --paper: #ffffff;
  --canvas: #fafafc;
  --rail: #f3f2f8;
  --ink: #191a23;
  --ink-2: #3d3e4c;
  --muted: #6e6f80;
  --faint: #a3a3b3;
  --line: #e7e6ef;
  --line-2: #d9d8e4;
  --nile: #3a4be0;
  --nile-ink: #2a38b8;
  --nile-wash: #eef0ff;
  --credit: #12784f;
  --credit-wash: #e7f6ef;
  --debit: #b4232c;
  --debit-wash: #fdeced;
  --amber: #9a5a00;
  --amber-wash: #fff4e0;
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;
  --shadow: 0 1px 2px rgba(25, 26, 35, .05), 0 8px 24px -12px rgba(25, 26, 35, .12);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
[v-cloak] { display: none; }
a { color: var(--nile); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--nile); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono-id { font-size: 12px; color: var(--muted); word-break: break-all; }

/* ---------- money ---------- */
.money { font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.money .cur { font-weight: 500; color: var(--muted); margin-right: .25em; font-size: .62em; letter-spacing: 0; vertical-align: .12em; }
.money .dec { color: var(--faint); font-weight: 500; }
.money.xl { font-size: 46px; line-height: 1.05; }
.money.lg { font-size: 30px; }
.money.md { font-size: 18px; }
.money.sm { font-size: 14px; font-weight: 500; }
.money.credit { color: var(--credit); }
.money.credit .dec { color: color-mix(in srgb, var(--credit) 55%, white); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.rail {
  background: var(--rail);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--nile);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -0.02em; }
.biz-chip {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 9px 11px; margin-bottom: 14px; display: flex; gap: 9px; align-items: center;
}
.biz-chip .avatar { width: 24px; height: 24px; border-radius: 6px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.biz-chip .n { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.nav-link:hover { background: rgba(58, 75, 224, .06); text-decoration: none; }
.nav-link.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(25,26,35,.06); }
.nav-link svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; flex: none; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }

.main { min-width: 0; }
.topbar {
  height: 58px; display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--paper);
  position: sticky; top: 0; z-index: 5;
}
.user-pill { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.user-pill .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--nile); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.page { padding: 30px 32px 64px; max-width: 1160px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary { background: var(--nile); color: #fff; }
.btn-primary:hover { background: var(--nile-ink); }
.btn-soft { background: var(--rail); color: var(--ink); border-color: var(--line); }
.btn-soft:hover { background: #e9e8f2; }
.btn-ghost { background: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--rail); }
.btn-danger { background: var(--debit-wash); color: var(--debit); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 550; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--paper); outline: none; width: 100%;
}
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--nile); box-shadow: 0 0 0 3px var(--nile-wash); }
.input.code { letter-spacing: .4em; font-size: 20px; text-align: center; height: 50px; font-weight: 600; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.err { color: var(--debit); font-size: 13px; background: var(--debit-wash); padding: 9px 12px; border-radius: var(--r-sm); margin-bottom: 14px; }

.seg { display: inline-flex; background: var(--rail); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 13px; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(25,26,35,.08); }

.check { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--nile); }

/* ---------- surfaces ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-pad { padding: 22px 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); gap: 12px; }

/* overview hero */
.hero { display: grid; grid-template-columns: 1fr 340px; gap: 18px; margin-bottom: 18px; }
.hero-balance { padding: 26px 28px; }
.hero-balance .label { color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.hero-stats { display: flex; gap: 34px; margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-2); flex-wrap: wrap; }
.hero-stats .k { color: var(--muted); font-size: 13px; }
.flow { padding: 22px 24px; display: flex; flex-direction: column; }
.flow-bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; margin-top: auto; }
.flow-bars .day { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.flow-bars .in { background: var(--nile); border-radius: 3px 3px 0 0; min-height: 2px; }
.flow-bars .out { background: #c9cdf7; border-radius: 0 0 3px 3px; min-height: 0; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* wallet tree: the signature element */
.tree { padding: 6px 0; }
.tree-main { padding: 16px 22px; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; cursor: pointer; }
.tree-main:hover, .tree-sub:hover { background: #fbfbfe; }
.tree-main .name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 9px; }
.tree-main .node { width: 12px; height: 12px; border-radius: 4px; background: var(--nile); flex: none; }
.tree-branch { position: relative; margin-left: 27px; border-left: 1.5px solid var(--line-2); margin-bottom: 8px; }
.tree-sub { position: relative; padding: 10px 22px 10px 26px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; cursor: pointer; }
.tree-sub::before { content: ''; position: absolute; left: 0; top: 50%; width: 16px; border-top: 1.5px solid var(--line-2); }
.tree-sub:last-child::after { content: ''; position: absolute; left: -2px; top: calc(50% + 1px); bottom: 0; width: 3px; background: var(--paper); }
.tree-sub .name { font-weight: 500; }
.tree-sub .meta { font-size: 12px; color: var(--muted); }
.tree + .tree { border-top: 1px solid var(--line); }
.tree-more { padding: 0 22px 14px 53px; font-size: 13px; color: var(--muted); }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 11px 22px; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #fbfbfe; }
.table .num { text-align: right; }
.table-wrap { overflow-x: auto; }
.txn-what { display: flex; align-items: center; gap: 11px; }
.txn-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.txn-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.txn-icon.in { background: var(--credit-wash); color: var(--credit); }
.txn-icon.out { background: var(--rail); color: var(--ink-2); }
.txn-title { font-weight: 550; }
.txn-sub { font-size: 12.5px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--credit-wash); color: var(--credit); }
.badge.failed { background: var(--debit-wash); color: var(--debit); }
.badge.pending, .badge.processing { background: var(--amber-wash); color: var(--amber); }
.badge.review { background: #f3e8ff; color: #7a2db8; }
.badge.neutral { background: var(--rail); color: var(--ink-2); }

.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 15px; }
.empty .btn { margin-top: 14px; }

/* wallet detail */
.wallet-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; padding: 26px 28px; }
.crumbs { display: flex; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 14px; align-items: center; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.split { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }

/* modal & drawer */
.scrim { position: fixed; inset: 0; background: rgba(25, 26, 35, .32); display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal { background: var(--paper); border-radius: 18px; width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px -20px rgba(25,26,35,.4); animation: rise .18s ease-out; }
.modal.wide { max-width: 560px; }
.modal-head { padding: 22px 24px 4px; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.modal-body { padding: 16px 24px 24px; }
.x { border: 0; background: var(--rail); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); }
.drawer-scrim { position: fixed; inset: 0; background: rgba(25,26,35,.24); z-index: 40; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(440px, 100%); background: var(--paper); z-index: 41; overflow: auto; box-shadow: -20px 0 60px -20px rgba(25,26,35,.3); animation: slide .2s ease-out; }
.quote { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 14px; }
.quote-row { display: flex; justify-content: space-between; padding: 3px 0; }
.quote-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 600; }
.verified { display: flex; gap: 8px; align-items: center; background: var(--credit-wash); color: var(--credit); padding: 8px 12px; border-radius: var(--r-sm); font-weight: 550; margin: -6px 0 14px; }
.secret-box { background: var(--ink); color: #fff; padding: 14px; border-radius: var(--r-md); word-break: break-all; font-size: 13px; margin: 10px 0 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.warn-note { background: var(--amber-wash); color: var(--amber); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 500; box-shadow: var(--shadow); animation: rise .18s ease-out; }
.toast.bad { background: var(--debit); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) 1.1fr; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 7vw, 96px); background: var(--paper); }
.auth-form .inner { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 28px; margin: 26px 0 6px; }
.auth-form .lede { color: var(--muted); margin-bottom: 26px; }
.auth-side {
  background: var(--rail); border-left: 1px solid var(--line); padding: 48px; display: flex; flex-direction: column; justify-content: center; overflow: hidden;
}
.auth-side .diagram { max-width: 460px; }
.auth-side .caption { margin-top: 24px; max-width: 420px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.demo-tree { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); margin: 6px 0 12px; }
.qr svg { width: 180px; height: 180px; }
.switch { margin-top: 18px; color: var(--muted); }
.switch button { background: none; border: 0; color: var(--nile); cursor: pointer; font-weight: 550; padding: 0; }

@media (max-width: 980px) {
  .hero, .split { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .rail .brand, .rail .biz-chip, .rail-foot { display: none; }
  .nav-link { width: auto; }
  .page { padding: 22px 16px 48px; }
  .topbar { padding: 0 16px; }
  .money.xl { font-size: 36px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .table th, .table td { padding: 11px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- v2: modes, team, go live, recovery ---------- */
.test-strip { background: #fff4e0; color: #7a4a00; text-align: center; font-size: 12.5px; font-weight: 550; padding: 5px 12px; border-bottom: 1px solid #f3dfb8; }
.test-strip a { color: inherit; text-decoration: underline; }
.topbar { justify-content: space-between; }
.mode-toggle { display: inline-flex; background: var(--rail); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.mode-toggle button { border: 0; background: none; padding: 5px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); }
.mode-toggle button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(25,26,35,.1); }
.mode-toggle button.on:first-child { background: #fff4e0; color: #7a4a00; }
.mode-toggle button.on:last-child { background: var(--credit-wash); color: var(--credit); }
.mode-toggle button.locked { opacity: .55; }
.banner { background: var(--nile-wash); color: var(--nile-ink); padding: 10px 32px; font-size: 13.5px; border-bottom: 1px solid #dfe3ff; }
.banner a { color: inherit; font-weight: 600; }
.linklike { background: none; border: 0; padding: 0; color: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.biz-wrap { position: relative; margin-bottom: 14px; }
.biz-wrap .biz-chip { width: 100%; margin: 0; cursor: pointer; text-align: left; font: inherit; }
.biz-chip .chev { margin-left: auto; color: var(--muted); font-size: 11px; }
.biz-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); z-index: 20; padding: 4px; }
.biz-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; font: inherit; font-weight: 550; }
.biz-menu button:hover, .biz-menu button.on { background: var(--rail); }
.biz-menu small { display: block; color: var(--muted); font-weight: 400; text-transform: capitalize; }
.nav-link.golive { margin-top: 6px; }
.nav-link .pill { margin-left: auto; font-size: 11px; background: var(--nile); color: #fff; padding: 1px 8px; border-radius: 99px; }
.cap { margin-top: 16px; }
.cap-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; gap: 10px; flex-wrap: wrap; }
.cap-bar { height: 6px; background: var(--rail); border-radius: 3px; overflow: hidden; }
.cap-bar i { display: block; height: 100%; background: var(--nile); }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.codes code { background: var(--rail); border: 1px solid var(--line); border-radius: 7px; padding: 8px; text-align: center; font: 600 14px ui-monospace, Menlo, monospace; letter-spacing: .05em; }
.ok-note { background: var(--credit-wash); color: var(--credit); padding: 9px 12px; border-radius: var(--r-sm); margin-bottom: 14px; font-size: 13px; }
.invite-note { background: var(--nile-wash); color: var(--nile-ink); padding: 10px 12px; border-radius: var(--r-sm); margin-top: 18px; }
.fine { font-size: 12.5px; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-card { border: 1.5px solid var(--line); background: var(--paper); border-radius: var(--r-md); padding: 14px; text-align: left; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 4px; }
.type-card span { font-size: 12.5px; color: var(--muted); }
.type-card.on { border-color: var(--nile); background: var(--nile-wash); }
.type-card:disabled { cursor: default; }
.doc-slot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--r-md); margin-bottom: 8px; flex-wrap: wrap; }
.doc-slot.done { border-style: solid; background: #fbfdfc; border-color: #cde9da; }
.btn.disabled { opacity: .5; pointer-events: none; }
.person { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; margin-bottom: 12px; }
.person-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.person-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0 2px; border-top: 1px solid var(--line); margin-top: 10px; flex-wrap: wrap; }
.step-done { color: var(--credit); font-weight: 600; }
.live-box { display: flex; gap: 14px; align-items: center; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; margin-bottom: 8px; max-width: 460px; }
.qr.small { margin: 0; padding: 6px; } .qr.small svg { width: 112px; height: 112px; }
.checklist ul { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding: 6px 0 6px 26px; font-size: 13.5px; color: var(--ink-2); }
.checklist li::before { content: ''; position: absolute; left: 0; top: 8px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.checklist li.done { color: var(--muted); }
.checklist li.done::before { background: var(--credit); border-color: var(--credit); }
.checklist li.done::after { content: '✓'; position: absolute; left: 3.5px; top: 6px; color: #fff; font-size: 11px; font-weight: 700; }
.status-card h2 { margin-bottom: 8px; } .status-card.ok { border-color: #bfe3d1; background: #fbfdfc; }
@media (max-width: 760px) { .type-grid { grid-template-columns: 1fr; } .codes { grid-template-columns: 1fr; } .banner { padding: 10px 16px; } .live-box { flex-direction: column; align-items: flex-start; } }
