:root {
  --navy: #0b1f3a;
  --accent: #0f766e;
  --accent-dark: #0b5c56;
  --accent-soft: #e6f4f2;
  --text: #14213d;
  --muted: #5b6474;
  --line: #e3e7ec;
  --bg: #f4f6f8;
  --panel: #f8fafb;
  --danger: #b42318;
  --green: #15803d;
  --top: 64px;
  --showme-accent: var(--accent);
  --showme-accent-soft: var(--accent-soft);
  --showme-text: var(--text);
  --showme-muted: var(--muted);
  --showme-line: var(--line);
  --showme-panel: var(--panel);
  --showme-green: var(--green);
  --showme-danger: var(--danger);
  --showme-top: var(--top);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.3px; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

.topbar { height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 24px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 60; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.2px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #2dd4bf, #0f766e); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 8px; right: 8px; top: 13px; height: 3px; background: #fff; border-radius: 2px; box-shadow: 0 -5px 0 #fff, 0 5px 0 #fff; }
.topbar .btn.ghost { border-color: rgba(255,255,255,.35); background: transparent; color: #fff; }
.topbar .btn.ghost:hover { background: rgba(255,255,255,.1); }
.topbar .icon-btn { color: #fff; }
.topbar .icon-btn:hover { background: rgba(255,255,255,.12); }
.avatar-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 4px; border-radius: 999px; color: #fff; }
.avatar-btn:hover { background: rgba(255,255,255,.12); }
.avatar-btn svg { width: 16px; height: 16px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2dd4bf; color: var(--navy); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--muted); position: relative; }
.icon-btn:hover { background: #eef1f5; }
.icon-btn.light { color: #fff; }
.icon-btn.light:hover { background: rgba(255,255,255,.15); }
.badge { position: absolute; top: 3px; right: 1px; background: #f59e0b; color: var(--navy); font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 8px; }

.tabs { display: flex; align-items: center; gap: 4px; padding: 0 24px; height: 48px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: var(--top); z-index: 19; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; padding: 0 14px; height: 48px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-color: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 600; background: #e9edf2; white-space: nowrap; }
.btn:hover { background: #dde2e9; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.subtle { background: transparent; }
.btn.subtle:hover { background: #eef1f5; }
.btn.ghost { border: 1px solid var(--line); background: #fff; }
.btn.ghost .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.btn svg { width: 18px; height: 18px; }

.content { max-width: 1100px; margin: 0 auto; padding: 28px 24px 48px; }
.page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.accounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.acct { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 1px 2px rgba(11,31,58,.04); }
.acct-name { font-weight: 600; }
.acct-num { font-size: 12px; color: var(--muted); }
.acct b { font-size: 26px; margin-top: 8px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.acct.credit b { color: var(--danger); }
.quick { display: flex; gap: 10px; margin-bottom: 28px; }
.tx-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tx-head h2 { margin: 0; }
.search { margin-left: auto; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 8px; height: 36px; padding: 0 10px; width: 260px; color: var(--muted); }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; }
.tx-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tx { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tx:last-child { border-bottom: 0; }
.tx:hover { background: var(--panel); }
.tx .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.tx .m { font-weight: 600; }
.tx .sub { font-size: 12px; color: var(--muted); }
.tx .amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.tx .amt.in { color: var(--green); }
.tx .chip { margin-left: 8px; }
.chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef1f5; color: var(--muted); }
.chip.warn { background: #fef3c7; color: #92400e; }
.chip.frozen { background: #fff; color: var(--navy); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 20px; }
.settings-layout { display: flex; gap: 24px; margin-top: 20px; }
.settings-nav { width: 220px; flex: none; display: flex; flex-direction: column; gap: 2px; }
.snav { text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.snav:hover { background: #e9edf2; }
.snav.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-body { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0; max-width: 420px; }
.field input, .field select, .field textarea { border: 2px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 15px; font-weight: 400; color: var(--text); background: #fff; }
.field input, .field select { height: 40px; }
.field textarea { min-height: 72px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 0; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.toggle:last-child { border-bottom: 0; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.section-toggle { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 8px; font-weight: 600; border-radius: 8px; border: 1px solid var(--line); margin: 14px 0 6px; }
.section-toggle:hover { background: #eef1f5; }
.section-toggle svg { width: 16px; height: 16px; transition: transform .2s; }
.section-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.notice { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 14px 16px; color: #7c2d12; max-width: 520px; }
.tbl { border-collapse: collapse; width: 100%; margin: 8px 0 12px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { font-size: 12px; color: var(--muted); }
.tbl td:last-child { text-align: right; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.plain { list-style: none; padding: 0; margin: 12px 0; max-width: 640px; }
.plain li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.plain li .btn { margin-left: auto; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 340px)); gap: 18px; margin: 18px 0 28px; }
.bankcard { aspect-ratio: 1.6; border-radius: 16px; padding: 18px 20px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(135deg, #0b1f3a, #0f766e); box-shadow: 0 10px 24px rgba(11,31,58,.25); position: relative; }
.bankcard.credit { background: linear-gradient(135deg, #1f2937, #6d28d9); }
.bankcard.frozen { filter: grayscale(.8); opacity: .85; }
.bankcard-top { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bankcard-top .menu-anchor { margin-left: auto; }
.bankcard-num { font-size: 20px; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.bankcard-foot { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 1px; opacity: .85; }

.menu-anchor { position: relative; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; min-width: 220px; background: #fff; color: var(--text); border-radius: 10px; box-shadow: 0 8px 24px -4px rgba(11,31,58,.25), 0 0 1px rgba(11,31,58,.3); padding: 6px 0; z-index: 30; }
.menu.right { left: auto; right: 0; }
.menu button { display: block; width: 100%; text-align: left; padding: 9px 14px; font-weight: 500; }
.menu button:hover { background: #eef1f5; }
.menu button.danger { color: var(--danger); }
.menu-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 6px 14px; }

.modal-backdrop { position: fixed; inset: var(--top) 0 0 0; background: rgba(11,31,58,.55); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 520px; max-width: calc(100% - 32px); box-shadow: 0 16px 40px rgba(11,31,58,.35); max-height: 88vh; overflow: auto; }
.modal.small { width: 420px; }
.modal-head { display: flex; align-items: flex-start; gap: 4px; margin-bottom: 8px; }
.modal-head h2 { font-size: 20px; margin: 0; }
.tx-amount { font-size: 34px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; margin: 6px 0 14px; }
.tx-amount.in { color: var(--green); }
.meta { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0 0 12px; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 500; }
.dispute { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.dispute h3 { margin-top: 0; }
.dispute .field { max-width: none; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; z-index: 60; box-shadow: 0 8px 16px rgba(11,31,58,.3); max-width: calc(100% - 32px); text-align: center; }
.file-banner { background: #fee2e2; color: #991b1b; padding: 12px 16px; font-weight: 600; text-align: center; }
.file-banner code { background: #fff; padding: 1px 6px; border-radius: 3px; }

body.drawer-open .modal-backdrop { right: 376px; }

@media (max-width: 1180px) {
  body.drawer-open .modal-backdrop { right: 356px; }
  body.drawer-open .content { margin-right: 0; }
}
@media (max-width: 900px) {
  .topbar, .tabs { padding: 0 14px; }
  .content { padding: 20px 14px 40px; }
  .accounts { grid-template-columns: 1fr; }
  .quick { flex-wrap: wrap; }
  .tx-head { flex-wrap: wrap; }
  .search { width: 100%; margin-left: 0; }
  .settings-layout { flex-direction: column; gap: 12px; }
  .settings-nav { width: auto; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .cards { grid-template-columns: 1fr; }
  .tx { grid-template-columns: 36px 1fr auto; }
}
