/* ── TOKENS ───────────────────────────────────────────────────────── */
:root {
 --font-sans: 'DM Sans', sans-serif;
 --font-mono: 'DM Mono', monospace;
 --font-display: 'Fraunces', serif;

 /* Light palette */
 --bg: #f5f4f0;
 --bg-card: #ffffff;
 --bg-card2: #faf9f6;
 --bg-input: #f0efe9;
 --bg-hover: #eceae3;
 --border: #e4e2d9;
 --border-strong: #ccc9bc;
 --text: #1a1916;
 --text-2: #5a574e;
 --text-3: #8c8980;
 --text-inv: #ffffff;
 --accent: #2563eb;
 --accent-light: #dbeafe;
 --accent-muted: #eff6ff;

 /* Semantic */
 --green: #16a34a;
 --green-bg: #dcfce7;
 --red: #dc2626;
 --red-bg: #fee2e2;
 --yellow: #ca8a04;
 --yellow-bg: #fef9c3;
 --blue: #2563eb;
 --blue-bg: #dbeafe;
 --purple: #7c3aed;
 --purple-bg: #ede9fe;
 --orange: #ea580c;
 --orange-bg: #ffedd5;
 --teal: #0d9488;
 --teal-bg: #ccfbf1;
 --pink: #db2777;
 --pink-bg: #fce7f3;

 /* Asset type colors */
 --type-fiat: #16a34a;
 --type-crypto: #7c3aed;
 --type-stock: #2563eb;
 --type-etf: #0d9488;
 --type-bond: #ca8a04;
 --type-commodity: #ea580c;
 --type-nft: #db2777;
 --type-other: #64748b;

 --radius: 12px;
 --radius-sm: 8px;
 --radius-lg: 16px;
 --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
 --shadow-md: 0 4px 12px rgba(0,0,0,.08);
 --shadow-lg: 0 8px 32px rgba(0,0,0,.12);

 --sidebar-w: 220px;
 --header-h: 0px;

 --ease: cubic-bezier(.25,.1,.25,1);
 --spring: cubic-bezier(.34,1.56,.64,1);
}

[data-theme="dark"], .dark {
 --bg: #141311;
 --bg-card: #1e1d1a;
 --bg-card2: #252320;
 --bg-input: #2a2924;
 --bg-hover: #2f2e28;
 --border: #2e2c27;
 --border-strong: #3f3d37;
 --text: #f0ede6;
 --text-2: #a09d94;
 --text-3: #6b6860;
 --text-inv: #1a1916;
 --accent: #3b82f6;
 --accent-light: #1d3461;
 --accent-muted: #172035;

 --green: #22c55e;
 --green-bg: #14271f;
 --red: #f87171;
 --red-bg: #2b1414;
 --yellow: #eab308;
 --yellow-bg: #29230a;
 --blue: #60a5fa;
 --blue-bg: #172035;
 --purple: #a78bfa;
 --purple-bg: #241a3a;
 --orange: #fb923c;
 --orange-bg: #2b1a0a;
 --teal: #2dd4bf;
 --teal-bg: #0d2520;
 --pink: #f472b6;
 --pink-bg: #2b1020;

 --shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
 --shadow-md: 0 4px 12px rgba(0,0,0,.4);
 --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
}

/* ── RESET ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
 font-family: var(--font-sans);
 background: var(--bg);
 color: var(--text);
 min-height: 100vh;
 transition: background .2s, color .2s;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── APP LAYOUT ───────────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }
#main-app { display: flex; width: 100%; min-height: 100vh; }

/* ── SIDEBAR ──────────────────────────────────────────────────────── */
#sidebar {
 width: var(--sidebar-w);
 min-height: 100vh;
 background: var(--bg-card);
 border-right: 1px solid var(--border);
 display: flex;
 flex-direction: column;
 padding: 20px 12px;
 position: fixed;
 top: 0; left: 0; bottom: 0;
 z-index: 100;
 transition: background .2s, border-color .2s;
}

.sidebar-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 4px 8px 20px;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-mark {
 width: 28px; height: 28px;
 background: var(--text);
 color: var(--bg);
 border-radius: 7px;
 display: flex; align-items: center; justify-content: center;
 font-family: var(--font-display);
 font-weight: 400;
 font-size: 16px;
 font-style: italic;
 letter-spacing: -.5px;
}
.logo-text {
 font-family: var(--font-display);
 font-size: 17px;
 font-weight: 300;
 color: var(--text);
 letter-spacing: -.3px;
}

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
 display: flex; align-items: center; gap: 10px;
 padding: 9px 10px;
 border-radius: var(--radius-sm);
 color: var(--text-2);
 font-size: 13.5px;
 font-weight: 400;
 transition: background .15s, color .15s;
 text-align: left;
 width: 100%;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
 background: var(--accent-muted);
 color: var(--accent);
 font-weight: 500;
}

.sidebar-footer { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; }

.user-pill {
 display: flex; align-items: center; gap: 9px;
 padding: 8px 10px;
 border-radius: var(--radius-sm);
 background: var(--bg-card2);
 border: 1px solid var(--border);
}
.user-avatar {
 width: 28px; height: 28px;
 border-radius: 50%;
 background: var(--accent);
 color: white;
 display: flex; align-items: center; justify-content: center;
 font-size: 12px;
 font-weight: 600;
 flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-currency { font-size: 11px; color: var(--text-3); }

/* ── CONTENT ──────────────────────────────────────────────────────── */
#content {
 margin-left: var(--sidebar-w);
 flex: 1;
 min-height: 100vh;
 padding: 28px;
 overflow-y: auto;
}

.page { display: none; }
.page.active { display: block; }

/* ── PAGE HEADER ─────────────────────────────────────────────────── */
.page-header {
 display: flex; align-items: flex-end; justify-content: space-between;
 margin-bottom: 24px;
 flex-wrap: wrap; gap: 12px;
}
.page-header h1 {
 font-family: var(--font-display);
 font-size: 28px;
 font-weight: 300;
 letter-spacing: -.5px;
 line-height: 1;
}
.page-header p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── BENTO GRID ───────────────────────────────────────────────────── */
.bento {
 display: grid;
 gap: 12px;
}
.bento-2 { grid-template-columns: repeat(2, 1fr); }
.bento-3 { grid-template-columns: repeat(3, 1fr); }
.bento-4 { grid-template-columns: repeat(4, 1fr); }
.bento-auto { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.card {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 20px;
 transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--border-strong); }
.card-sm { padding: 14px 16px; }
.card-flat { background: var(--bg-card2); }

.card-label {
 font-size: 11.5px;
 font-weight: 500;
 text-transform: uppercase;
 letter-spacing: .6px;
 color: var(--text-3);
 margin-bottom: 10px;
}
.card-value {
 font-family: var(--font-mono);
 font-size: 24px;
 font-weight: 400;
 color: var(--text);
 letter-spacing: -.5px;
}
.card-value.large { font-size: 32px; }
.card-value.small { font-size: 18px; }
.card-sub {
 font-size: 12px;
 color: var(--text-3);
 margin-top: 4px;
}

/* ── METRICS / DELTA ──────────────────────────────────────────────── */
.delta {
 display: inline-flex; align-items: center; gap: 3px;
 font-size: 12px; font-weight: 500;
 padding: 2px 7px;
 border-radius: 20px;
}
.delta.up { color: var(--green); background: var(--green-bg); }
.delta.down { color: var(--red); background: var(--red-bg); }
.delta.neutral { color: var(--text-3); background: var(--bg-hover); }
.delta svg { width: 11px; height: 11px; }

/* ── CHIPS / BADGES ───────────────────────────────────────────────── */
.chip {
 display: inline-flex; align-items: center; gap: 4px;
 padding: 2px 8px;
 border-radius: 20px;
 font-size: 11px;
 font-weight: 500;
 letter-spacing: .2px;
}
.chip-fiat { background: var(--green-bg); color: var(--green); }
.chip-crypto { background: var(--purple-bg); color: var(--purple); }
.chip-stock { background: var(--blue-bg); color: var(--blue); }
.chip-etf { background: var(--teal-bg); color: var(--teal); }
.chip-bond { background: var(--yellow-bg); color: var(--yellow); }
.chip-commodity { background: var(--orange-bg); color: var(--orange); }
.chip-nft { background: var(--pink-bg); color: var(--pink); }
.chip-other { background: var(--bg-hover); color: var(--text-2); }

.chip-income { background: var(--green-bg); color: var(--green); }
.chip-expense { background: var(--red-bg); color: var(--red); }
.chip-transfer { background: var(--blue-bg); color: var(--blue); }
.chip-exchange { background: var(--purple-bg); color: var(--purple); }
.chip-trade { background: var(--teal-bg); color: var(--teal); }
.chip-send { background: var(--orange-bg); color: var(--orange); }
.chip-receive { background: var(--green-bg); color: var(--green); }

.chip-cash { background: var(--green-bg); color: var(--green); }
.chip-bank { background: var(--blue-bg); color: var(--blue); }
.chip-crypto_wallet { background: var(--purple-bg); color: var(--purple); }
.chip-investment { background: var(--teal-bg); color: var(--teal); }
.chip-credit { background: var(--red-bg); color: var(--red); }
.chip-loan { background: var(--orange-bg); color: var(--orange); }
.chip-exchange_acc { background: var(--yellow-bg); color: var(--yellow); }
.chip-external { background: var(--bg-hover); color: var(--text-2); }

.chip-open { background: var(--green-bg); color: var(--green); }
.chip-closed { background: var(--bg-hover); color: var(--text-3); }

.chip-pending { background: var(--yellow-bg); color: var(--yellow); }
.chip-settled { background: var(--green-bg); color: var(--green); }
.chip-cancelled { background: var(--bg-hover); color: var(--text-3); }

/* ── BUTTONS ──────────────────────────────────────────────────────── */
.btn {
 display: inline-flex; align-items: center; gap: 7px;
 padding: 8px 14px;
 border-radius: var(--radius-sm);
 font-size: 13.5px;
 font-weight: 500;
 transition: background .12s, opacity .12s, transform .1s var(--spring);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 14px; height: 14px; }

.btn-primary {
 background: var(--text);
 color: var(--bg);
}
.btn-primary:hover { opacity: .85; }
.btn-primary.full { width: 100%; justify-content: center; padding: 10px 14px; }

.btn-ghost {
 background: transparent;
 color: var(--text-2);
 border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-accent {
 background: var(--accent);
 color: white;
}
.btn-accent:hover { opacity: .88; }

.btn-danger {
 background: var(--red-bg);
 color: var(--red);
}
.btn-danger:hover { opacity: .8; }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }

.icon-btn {
 width: 30px; height: 30px;
 display: flex; align-items: center; justify-content: center;
 border-radius: 7px;
 color: var(--text-3);
 transition: background .12s, color .12s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ── THEME TOGGLE ─────────────────────────────────────────────────── */
#theme-toggle .icon-moon { display: none; }
[data-theme="dark"] #theme-toggle .icon-sun { display: none; }
[data-theme="dark"] #theme-toggle .icon-moon { display: block; }

/* ── FORM ELEMENTS ────────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
 background: var(--bg-input);
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 color: var(--text);
 font-size: 13.5px;
 padding: 8px 11px;
 width: 100%;
 outline: none;
 transition: border-color .12s, box-shadow .12s;
 -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
 border-color: var(--accent);
 box-shadow: 0 0 0 3px var(--accent-muted);
}
select { appearance: none; cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

.form-grid { display: grid; gap: 14px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── TABLE ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { position: sticky; top: 0; z-index: 2; }
th {
 padding: 9px 12px;
 text-align: left;
 font-size: 11px;
 font-weight: 500;
 text-transform: uppercase;
 letter-spacing: .5px;
 color: var(--text-3);
 background: var(--bg-card2);
 border-bottom: 1px solid var(--border);
 white-space: nowrap;
}
td {
 padding: 10px 12px;
 border-bottom: 1px solid var(--border);
 color: var(--text);
 vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--bg-hover); }
.td-mono { font-family: var(--font-mono); font-size: 12.5px; }
.td-right { text-align: right; }

/* ── AUTH ─────────────────────────────────────────────────────────── */
.auth-screen {
 display: flex;
 align-items: center;
 justify-content: center;
 min-height: 100vh;
 width: 100%;
 background: var(--bg);
}
.auth-card {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--radius-lg);
 padding: 32px;
 width: 100%;
 max-width: 420px;
 box-shadow: var(--shadow-lg);
}
.auth-logo {
 display: flex; align-items: center; gap: 10px;
 margin-bottom: 28px;
}
.auth-logo .logo-mark { width: 36px; height: 36px; font-size: 20px; border-radius: 9px; }
.auth-logo .logo-text { font-size: 22px; }

.auth-tabs {
 display: flex;
 gap: 0;
 margin-bottom: 24px;
 background: var(--bg-input);
 border-radius: var(--radius-sm);
 padding: 3px;
}
.auth-tab {
 flex: 1;
 padding: 7px;
 border-radius: 6px;
 font-size: 13.5px;
 font-weight: 500;
 color: var(--text-3);
 transition: background .12s, color .12s;
}
.auth-tab.active {
 background: var(--bg-card);
 color: var(--text);
 box-shadow: var(--shadow);
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-error {
 background: var(--red-bg);
 color: var(--red);
 padding: 8px 11px;
 border-radius: var(--radius-sm);
 font-size: 12.5px;
}

/* ── MODAL ────────────────────────────────────────────────────────── */
.modal-overlay {
 position: fixed; inset: 0;
 background: rgba(0,0,0,.45);
 backdrop-filter: blur(3px);
 z-index: 1000;
 display: flex; align-items: center; justify-content: center;
 padding: 20px;
 animation: fadeIn .15s var(--ease);
}
.modal-box {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--radius-lg);
 width: 100%;
 max-width: 560px;
 max-height: 90vh;
 overflow-y: auto;
 box-shadow: var(--shadow-lg);
 animation: slideUp .2s var(--spring);
}
.modal-box.modal-lg { max-width: 780px; }
.modal-header {
 display: flex; align-items: center; justify-content: space-between;
 padding: 20px 24px 16px;
 border-bottom: 1px solid var(--border);
 position: sticky; top: 0; background: var(--bg-card); z-index: 2;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
#modal-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 14px; }

/* ── TOAST ────────────────────────────────────────────────────────── */
#toast-container {
 position: fixed; bottom: 24px; right: 24px;
 display: flex; flex-direction: column; gap: 8px;
 z-index: 9999;
}
.toast {
 display: flex; align-items: center; gap: 10px;
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 padding: 10px 14px;
 font-size: 13px;
 box-shadow: var(--shadow-md);
 min-width: 260px;
 animation: slideInRight .2s var(--spring);
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.toast-icon { width: 16px; height: 16px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
.toast.info .toast-icon { color: var(--blue); }

/* ── MINI CHART ───────────────────────────────────────────────────── */
.sparkline-wrap { height: 48px; margin-top: 12px; }
canvas.sparkline { width: 100%; height: 100%; }

/* ── PROGRESS BAR ─────────────────────────────────────────────────── */
.progress-bar {
 height: 4px;
 background: var(--border);
 border-radius: 2px;
 overflow: hidden;
 margin-top: 8px;
}
.progress-fill {
 height: 100%;
 border-radius: 2px;
 transition: width .4s var(--ease);
}

/* ── ALLOCATION RING ──────────────────────────────────────────────── */
.ring-wrap {
 position: relative; display: flex; align-items: center; justify-content: center;
}
.ring-center {
 position: absolute;
 text-align: center;
}
.ring-center .val { font-family: var(--font-mono); font-size: 20px; font-weight: 400; }
.ring-center .lbl { font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* ── SECTION TITLE ────────────────────────────────────────────────── */
.section-title {
 font-size: 12px;
 font-weight: 600;
 text-transform: uppercase;
 letter-spacing: .6px;
 color: var(--text-3);
 margin-bottom: 10px;
}

/* ── EMPTY STATE ──────────────────────────────────────────────────── */
.empty {
 text-align: center;
 padding: 40px 20px;
 color: var(--text-3);
}
.empty svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: .4; display: block; }
.empty p { font-size: 13px; }

/* ── LOADING ──────────────────────────────────────────────────────── */
.skeleton {
 background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
 background-size: 200% 100%;
 animation: shimmer 1.4s infinite;
 border-radius: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.spinner {
 width: 20px; height: 20px;
 border: 2px solid var(--border);
 border-top-color: var(--accent);
 border-radius: 50%;
 animation: spin .7s linear infinite;
 margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SEARCH / FILTER BAR ──────────────────────────────────────────── */
.filter-bar {
 display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.filter-bar input, .filter-bar select {
 width: auto;
}
.filter-bar input { flex: 1; min-width: 180px; }

/* ── PAGINATION ───────────────────────────────────────────────────── */
.pagination {
 display: flex; align-items: center; justify-content: space-between;
 padding: 12px 0;
 font-size: 12.5px;
 color: var(--text-3);
}
.pagination-btns { display: flex; gap: 6px; }

/* ── DATE RANGE PICKER ────────────────────────────────────────────── */
.date-range { display: flex; gap: 8px; align-items: center; }
.date-range label { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ── DIFF COMPARISON ──────────────────────────────────────────────── */
.compare-row {
 display: flex; justify-content: space-between; align-items: center;
 padding: 7px 0;
 border-bottom: 1px solid var(--border);
}
.compare-row:last-child { border-bottom: none; }

/* ── ANIMATIONS ───────────────────────────────────────────────────── */
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes slideUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideInRight { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }

/* ── UTILITY ──────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-mono { font-family: var(--font-mono); }
.text-right { text-align: right; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.bold { font-weight: 600; }
.w-full { width: 100%; }
.overflow-auto { overflow: auto; }

/* ── ACCOUNT LIST ITEM ────────────────────────────────────────────── */
.account-item {
 display: flex; align-items: center; justify-content: space-between;
 padding: 12px 0;
 border-bottom: 1px solid var(--border);
}
.account-item:last-child { border-bottom: none; }
.account-item-left { display: flex; align-items: center; gap: 10px; }
.account-dot {
 width: 8px; height: 8px;
 border-radius: 50%;
 flex-shrink: 0;
}
.account-name { font-weight: 500; font-size: 13.5px; }
.account-desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }

/* ── TRANSACTION ROW ──────────────────────────────────────────────── */
.tx-icon {
 width: 32px; height: 32px;
 border-radius: 8px;
 display: flex; align-items: center; justify-content: center;
 flex-shrink: 0;
}
.tx-icon svg { width: 14px; height: 14px; }

/* ── INLINE CREATE (contextual inside modal) ───────────────────────── */
.inline-create {
 background: var(--accent-muted);
 border: 1px dashed var(--accent-light);
 border-radius: var(--radius-sm);
 padding: 10px 14px;
 cursor: pointer;
 display: flex; align-items: center; gap: 8px;
 color: var(--accent);
 font-size: 13px;
 font-weight: 500;
 transition: background .12s;
}
.inline-create:hover { background: var(--accent-light); }

/* ── SPLIT CARD (for compare) ─────────────────────────────────────── */
.split-card { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; }
.split-half { background: var(--bg-card); padding: 16px; }
.split-half:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.split-half:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

/* ── ACCRUAL TABS ─────────────────────────────────────────────────── */
.tab-bar {
 display: flex;
 gap: 0;
 background: var(--bg-input);
 border-radius: var(--radius-sm);
 padding: 3px;
 width: fit-content;
 margin-bottom: 16px;
}
.tab-btn {
 padding: 6px 14px;
 border-radius: 6px;
 font-size: 12.5px;
 font-weight: 500;
 color: var(--text-3);
 transition: background .12s, color .12s;
}
.tab-btn.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow); }

/* ── CHART CONTAINER ─────────────────────────────────────────────── */
.chart-area { position: relative; }
.chart-area canvas { width: 100% !important; }

/* ── POSITION CARD ────────────────────────────────────────────────── */
.position-card {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 padding: 16px 18px;
 transition: border-color .15s;
}
.position-card:hover { border-color: var(--border-strong); }
.position-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.position-asset { font-weight: 600; font-size: 15px; }
.position-account { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.position-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.position-metric label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-3); }
.position-metric .val { font-family: var(--font-mono); font-size: 13.5px; font-weight: 400; margin-top: 2px; }

/* ── SCROLLBAR ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }