:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #14213d;
  --muted: #7b879e;
  --muted-2: #a0aabd;
  --line: #e7ecf3;
  --navy: #101a34;
  --navy-2: #182747;
  --blue: #4d80f0;
  --blue-soft: #eaf0ff;
  --green: #22bf8b;
  --green-soft: #e7faf3;
  --red: #eb7180;
  --red-soft: #fff0f2;
  --amber: #f2ae4d;
  --amber-soft: #fff7e9;
  --violet: #8c75ef;
  --shadow: 0 16px 42px rgba(22, 44, 82, .07);
  --radius: 18px;
  --radius-sm: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.is-hidden { display: none !important; }

/* Auth */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #314978 0, transparent 37%), linear-gradient(140deg, #0c1530, #182a51 70%, #233d6d); }
.auth-card { width: min(100%, 420px); padding: 38px; color: white; border: 1px solid rgba(255,255,255,.13); border-radius: 26px; background: rgba(9, 17, 37, .64); box-shadow: 0 30px 90px rgba(0,0,0,.28); backdrop-filter: blur(18px); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: white; background: linear-gradient(145deg, #6792ff, #4168db); box-shadow: 0 8px 18px rgba(71, 111, 231, .32); font-weight: 800; font-size: 20px; flex: 0 0 auto; }
.brand-mark.large { width: 56px; height: 56px; border-radius: 18px; font-size: 28px; margin-bottom: 30px; }
.eyebrow, .panel-kicker { color: var(--blue); font-size: 10px; letter-spacing: .13em; line-height: 1.2; text-transform: uppercase; font-weight: 800; }
.auth-card .eyebrow { color: #90b3ff; }
.auth-card h1 { margin: 10px 0 8px; font-size: 30px; letter-spacing: -.04em; }
.auth-card p { margin: 0 0 26px; color: rgba(255,255,255,.64); line-height: 1.6; }
.stack-form { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field span { font-size: 12px; color: var(--muted); font-weight: 700; }
.auth-card .field span { color: rgba(255,255,255,.7); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; outline: none; color: var(--ink); background: #fff; transition: .2s border, .2s box-shadow; }
.auth-card input { border-color: rgba(255,255,255,.16); color: white; background: rgba(255,255,255,.1); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #759bff; box-shadow: 0 0 0 4px rgba(77,128,240,.13); }
.auth-card input:focus { box-shadow: 0 0 0 4px rgba(112,153,255,.18); }
.auth-hint { min-height: 22px; margin-top: 18px; color: #ffb2b9; font-size: 12px; line-height: 1.5; }

/* Shell */
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 244px; display: flex; flex-direction: column; flex: 0 0 244px; padding: 29px 16px 19px; color: #dbe5ff; background: var(--navy); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 35px; }
.brand-name { color: white; font-weight: 800; font-size: 18px; letter-spacing: -.03em; }
.brand-caption { margin-top: 2px; color: #7888ac; font-size: 10px; white-space: nowrap; }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 11px; padding: 12px 13px; color: #8e9cbb; background: transparent; text-align: left; transition: .2s background, .2s color, .2s transform; }
.nav-item:hover { color: #eef3ff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(80,128,241,.25), rgba(80,128,241,.08)); box-shadow: inset 3px 0 #6c94ff; }
.nav-icon { width: 18px; color: currentColor; font-size: 19px; line-height: 1; text-align: center; opacity: .9; }
.nav-item span:nth-child(2) { font-size: 13px; font-weight: 700; }
.nav-badge { margin-left: auto; min-width: 23px; padding: 2px 6px; border-radius: 20px; color: #a9c1ff; background: rgba(88, 133, 242, .17); font-size: 10px; text-align: center; }
.nav-separator { height: 1px; margin: 18px 13px; background: rgba(255,255,255,.07); }
.sidebar-bottom { margin-top: auto; }
.privacy-note { display: flex; align-items: center; gap: 9px; padding: 13px 11px; border-radius: 12px; background: rgba(255,255,255,.045); }
.lock-dot { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: #6de0bd; background: rgba(34,191,139,.14); font-size: 9px; }
.privacy-note strong, .privacy-note small { display: block; }
.privacy-note strong { color: #c8d2e8; font-size: 10px; }
.privacy-note small { margin-top: 3px; color: #7685a6; font-size: 9px; }
.logout-button { width: 100%; display: flex; justify-content: space-between; border: 0; padding: 16px 12px 0; color: #7786a7; background: none; font-size: 11px; }
.logout-button:hover { color: #fff; }
.main-content { min-width: 0; flex: 1; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 4vw, 54px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.68); }
.topbar-title h1 { margin: 5px 0 0; color: var(--ink); font-size: 24px; letter-spacing: -.045em; }
.topbar-title span { color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.month-control { display: grid; gap: 2px; }
.month-control span { color: var(--muted-2); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.month-control input { border: 0; color: var(--ink); background: transparent; outline: none; font-weight: 800; }
.icon-button, .avatar, .mobile-menu { border: 0; }
.icon-button { width: 34px; height: 34px; border-radius: 10px; color: var(--muted); background: #fff; font-size: 21px; transition: .2s; }
.icon-button:hover { color: var(--blue); box-shadow: var(--shadow); transform: rotate(35deg); }
.avatar { width: 34px; height: 34px; border-radius: 11px; color: #fff; background: var(--navy); font-weight: 800; }
.mobile-menu { display: none; color: var(--ink); background: none; font-size: 22px; }
.content-wrap { width: min(100%, 1490px); margin: 0 auto; padding: 31px clamp(24px, 4vw, 54px) 60px; }
.view { display: none; animation: view-in .3s ease both; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Shared */
h2 { margin: 5px 0 7px; color: var(--ink); font-size: clamp(26px, 3vw, 34px); letter-spacing: -.055em; }
h3 { margin: 6px 0 0; color: var(--ink); font-size: 16px; letter-spacing: -.025em; }
p { color: var(--muted); }
.welcome-row, .section-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.welcome-row p, .section-intro p { margin: 0; max-width: 650px; font-size: 12px; line-height: 1.6; }
.quick-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; min-height: 38px; padding: 0 15px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 800; transition: .2s transform, .2s box-shadow, .2s background; }
.button:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(40, 65, 112, .12); }
.button.primary { color: white; background: linear-gradient(135deg, #5e8bf4, #4c73dc); box-shadow: 0 8px 18px rgba(77,128,240,.22); }
.button.ghost { border: 1px solid var(--line); color: #53617c; background: rgba(255,255,255,.7); }
.button.scan-button { color: #fff; background: #1ca885; box-shadow: 0 8px 18px rgba(28,168,133,.19); }
.button.wide { width: 100%; margin-top: 3px; }
.button-arrow { margin-left: auto; font-size: 18px; }
.text-button { border: 0; color: var(--blue); background: none; font-size: 11px; font-weight: 800; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding: 22px 23px 13px; }
.panel-kicker { color: var(--muted-2); font-size: 9px; }

/* Metric cards */
.metric-grid { display: grid; grid-template-columns: 1.45fr repeat(3, 1fr); gap: 13px; margin-bottom: 18px; }
.metric-card { min-height: 151px; position: relative; overflow: hidden; padding: 20px 21px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.metric-card.dark-card { color: white; border: 0; background: linear-gradient(140deg, #162443, #253c70); }
.metric-card.accent-card { background: linear-gradient(135deg, #eef3ff, #fff); }
.metric-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.metric-actions { display: flex; align-items: center; gap: 7px; }
.metric-edit { border: 0; border-bottom: 1px dashed currentColor; padding: 0 0 1px; color: var(--muted-2); background: transparent; font-size: 9px; font-weight: 700; }
.metric-edit:hover { color: var(--blue); }
.dark-card .metric-top, .dark-card .metric-foot { color: #aebce0; }
.dark-card .metric-edit { color: #b3c4eb; }
.dark-card .metric-edit:hover { color: #fff; }
.metric-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--blue); background: var(--blue-soft); font-weight: 900; }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.dark-card .metric-icon { color: #d1ddff; background: rgba(255,255,255,.11); }
.metric-value { margin-top: 18px; color: var(--ink); font-size: 25px; font-weight: 850; letter-spacing: -.06em; }
.dark-card .metric-value { color: #fff; }
.metric-foot { margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.metric-foot.positive { color: var(--green); }
.sparkline { position: absolute; right: 0; bottom: 0; left: 0; height: 38px; opacity: .9; overflow: hidden; }
.sparkline svg { width: 100%; height: 100%; }
.metric-mini-line { position: absolute; right: 20px; bottom: 17px; left: 20px; height: 3px; border-radius: 5px; background: #f0f3f8; }
.metric-mini-line::before { content: ""; display: block; width: 54%; height: 100%; border-radius: inherit; background: var(--green); }
.red-line::before { width: 45%; background: var(--red); }
.accent-line::before { width: 65%; background: var(--blue); }

/* Dashboard */
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .8fr); gap: 18px; margin-bottom: 18px; }
.lower-grid { grid-template-columns: minmax(0, 1.25fr) minmax(330px, .95fr); }
.chart-panel, .insight-panel { min-height: 330px; }
.chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.income-dot { background: var(--blue); }
.expense-dot { background: var(--red); }
.chart-wrap { height: 245px; padding: 8px 22px 17px; }
.chart-wrap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: #edf1f6; stroke-width: 1; }
.chart-label { fill: #a1adbf; font-size: 9px; font-family: inherit; }
.chart-area-income { fill: url(#incomeArea); }
.chart-area-expense { fill: url(#expenseArea); }
.chart-line-income { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-line-expense { fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-point { fill: white; stroke-width: 2; }
.insights-list { display: grid; gap: 10px; padding: 8px 22px 22px; }
.insight { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: #f8fafc; }
.insight-marker { width: 8px; flex: 0 0 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.insight.amber .insight-marker { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.insight.violet .insight-marker { background: var(--violet); box-shadow: 0 0 0 4px #f0edff; }
.insight.green .insight-marker { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.insight.red .insight-marker { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.insight strong, .insight span { display: block; }
.insight strong { font-size: 11px; }
.insight span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); margin: 9px 4px 0 0; }
.category-bars { display: grid; gap: 14px; padding: 9px 23px 25px; }
.category-row { display: grid; grid-template-columns: minmax(100px, 1.2fr) 3fr auto; align-items: center; gap: 12px; }
.category-label { display: flex; align-items: center; gap: 7px; min-width: 0; color: #4d5a72; font-size: 11px; font-weight: 700; }
.category-label i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }
.category-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track, .progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #f0f3f7; }
.bar-track i, .progress-track i { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: var(--blue); }
.category-amount { color: var(--ink); font-size: 11px; font-weight: 800; white-space: nowrap; }
.recent-list { display: grid; padding: 2px 22px 16px; }
.recent-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f0f2f6; }
.recent-item:last-child { border-bottom: 0; }
.item-icon { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 14px; }
.item-info { min-width: 0; flex: 1; }
.item-info strong, .item-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-info strong { color: #33415a; font-size: 11px; }
.item-info small { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.item-amount { font-size: 11px; font-weight: 850; white-space: nowrap; }
.item-amount.income { color: var(--green); }
.item-amount.expense { color: var(--ink); }

/* Sections, tables */
.section-intro { align-items: center; }
.toolbar { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; padding: 11px 14px; box-shadow: none; }
.filter-pills { display: flex; gap: 4px; }
.filter-pill { border: 0; border-radius: 9px; padding: 9px 11px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.filter-pill.active { color: var(--blue); background: var(--blue-soft); }
.search-box { display: flex; align-items: center; gap: 8px; min-width: 190px; margin-left: auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted-2); background: #fff; }
.search-box input { width: 100%; border: 0; outline: none; padding: 9px 0; color: var(--ink); background: transparent; font-size: 11px; }
.select-control { min-width: 150px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; outline: none; color: var(--muted); background: #fff; font-size: 11px; }
.table-panel { overflow: hidden; min-height: 260px; box-shadow: none; }
.table-scroller { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { padding: 14px 20px; color: var(--muted-2); border-bottom: 1px solid var(--line); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 14px 20px; color: #4e5c74; border-bottom: 1px solid #f0f3f7; font-size: 11px; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfe; }
.data-table tr:last-child td { border-bottom: 0; }
.align-right { text-align: right; }
.date-cell { color: var(--muted-2) !important; white-space: nowrap; }
.operation-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.operation-cell strong, .operation-cell small { display: block; }
.operation-cell strong { color: var(--ink); font-size: 11px; }
.operation-cell small { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.category-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; color: #596780; background: #f4f6fa; font-size: 10px; white-space: nowrap; }
.category-tag i { width: 6px; height: 6px; border-radius: 50%; }
.account-cell { color: var(--muted); }
.table-amount { color: var(--ink); font-weight: 850; white-space: nowrap; }
.table-amount.income { color: var(--green); }
.table-delete { opacity: 0; border: 0; color: var(--muted-2); background: transparent; font-size: 14px; }
.data-table tr:hover .table-delete { opacity: 1; }
.empty-state { display: grid; place-items: center; gap: 7px; min-height: 230px; padding: 25px; color: var(--muted); text-align: center; }
.empty-state.compact { min-height: 170px; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state span { font-size: 11px; }
.empty-icon { display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 4px; border-radius: 15px; color: var(--blue); background: var(--blue-soft); font-size: 22px; }

/* Purchases */
.purchase-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.7fr; gap: 12px; margin-bottom: 18px; }
.small-stat, .receipt-tip { display: flex; align-items: center; gap: 11px; min-height: 76px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.small-stat-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; font-size: 16px; }
.small-stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.small-stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.small-stat-icon.violet { color: var(--violet); background: #f1efff; }
.small-stat strong, .small-stat small { display: block; }
.small-stat strong { color: var(--ink); font-size: 16px; letter-spacing: -.04em; }
.small-stat small { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.receipt-tip { color: #816123; border-color: #f5e4bd; background: #fffaf0; }
.receipt-tip > span { font-size: 20px; }
.receipt-tip strong, .receipt-tip small { display: block; }
.receipt-tip strong { color: #8d6d2c; font-size: 11px; }
.receipt-tip small { margin-top: 3px; color: #a88e5b; font-size: 10px; line-height: 1.35; }
.purchases-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.purchase-card { position: relative; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.purchase-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--blue), #85a8ff); }
.purchase-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.purchase-store { display: flex; align-items: center; gap: 10px; min-width: 0; }
.store-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-weight: 900; }
.purchase-store strong, .purchase-store small { display: block; }
.purchase-store strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.purchase-store small { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.purchase-total { color: var(--ink); font-size: 17px; font-weight: 900; letter-spacing: -.04em; white-space: nowrap; }
.purchase-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 12px; border-top: 1px solid #f0f3f7; color: var(--muted); font-size: 10px; }
.purchase-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-items { display: grid; gap: 5px; margin-top: 12px; }
.purchase-item-line { display: flex; justify-content: space-between; gap: 8px; color: #69768d; font-size: 10px; }
.purchase-item-line span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.purchase-actions { display: flex; justify-content: end; gap: 10px; margin-top: 13px; }
.mini-action { border: 0; color: var(--muted-2); background: none; font-size: 10px; font-weight: 700; }
.mini-action:hover { color: var(--blue); }

/* Accounts and bank balances */
.account-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 18px; }
.account-summary-card { min-height: 112px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.account-summary-card span, .account-summary-card small { display: block; color: var(--muted); font-size: 10px; }
.account-summary-card strong { display: block; margin: 13px 0 4px; color: var(--ink); font-size: 24px; letter-spacing: -.06em; }
.account-summary-card.total { color: white; border: 0; background: linear-gradient(135deg, #172646, #294477); }
.account-summary-card.total span, .account-summary-card.total small { color: #adbee3; }
.account-summary-card.total strong { color: #fff; }
.account-summary-card.shared strong { color: var(--blue); }
.account-summary-card.personal strong { color: var(--violet); }
.accounts-panel, .transfers-panel { margin-bottom: 18px; box-shadow: none; }
.account-count { color: var(--muted-2); font-size: 10px; }
.accounts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding: 8px 22px 23px; }
.account-card { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.account-card-top { display: flex; align-items: start; gap: 10px; }
.account-bank-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-size: 18px; }
.account-card-title { min-width: 0; flex: 1; }
.account-card-title strong, .account-card-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card-title strong { color: var(--ink); font-size: 12px; }
.account-card-title small { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.account-owner-pill { padding: 4px 7px; border-radius: 7px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.account-owner-pill.shared { color: var(--green); background: var(--green-soft); }
.account-owner-pill.personal { color: var(--violet); background: #f1efff; }
.account-card-balance { margin-top: 25px; color: var(--ink); font-size: 22px; font-weight: 900; letter-spacing: -.06em; }
.account-card-owner { margin-top: 4px; color: var(--muted); font-size: 10px; }
.account-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #f0f3f7; }
.account-readonly { color: var(--muted-2); font-size: 10px; }
.transfers-list { padding: 2px 22px 18px; }
.transfer-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f0f3f7; }
.transfer-row:last-child { border-bottom: 0; }
.transfer-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 16px; }
.transfer-info { min-width: 0; flex: 1; }
.transfer-info strong, .transfer-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-info strong { color: var(--ink); font-size: 11px; }
.transfer-info strong span { color: var(--blue); padding: 0 4px; }
.transfer-info small { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.transfer-amount { color: var(--ink); font-size: 12px; white-space: nowrap; }
.transfer-delete { opacity: 1; }
/* Recurring expenses and budgets */
.recurring-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 3px 0 13px; }
.recurring-head h3 { margin-top: 4px; }
.recurring-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.recurring-head-actions { display: flex; align-items: center; gap: 14px; }
.recurring-head-actions > strong { color: var(--ink); font-size: 17px; letter-spacing: -.04em; white-space: nowrap; }
.recurring-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.recurring-card { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.recurring-card.inactive { opacity: .56; }
.recurring-card-main, .recurring-card-right { display: flex; align-items: center; gap: 10px; }
.recurring-card-right { display: block; text-align: right; }
.recurring-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 11px; font-size: 18px; }
.recurring-info { min-width: 0; }
.recurring-info strong, .recurring-info small, .recurring-card-right strong, .recurring-card-right small { display: block; }
.recurring-info strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.recurring-info small, .recurring-card-right small { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.recurring-card-right strong { color: var(--ink); font-size: 14px; white-space: nowrap; }
.recurring-card-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 12px; padding-top: 10px; border-top: 1px solid #f0f3f7; }
.recurring-card-actions .mini-action.applied { color: var(--green); }
.recurring-card-actions .mini-action:disabled { cursor: default; }
.checkbox-field { display: flex; align-items: center; gap: 9px; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--blue); }
.checkbox-field span { color: var(--ink); }
/* Budgets */
.budget-summary { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 19px; padding: 21px 24px; background: linear-gradient(120deg, #172646, #263e70); }
.budget-summary .panel-kicker { color: #9bb7ff; }
.budget-summary h3 { color: #fff; }
.budget-summary-numbers { display: flex; align-items: center; gap: 30px; }
.budget-summary-numbers > div:not(.overall-progress) strong, .budget-summary-numbers > div:not(.overall-progress) span { display: block; }
.budget-summary-numbers strong { color: white; font-size: 16px; }
.budget-summary-numbers span { margin-top: 4px; color: #9aaed2; font-size: 9px; }
.overall-progress { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.overall-progress .progress-track { width: 100px; background: rgba(255,255,255,.14); }
.overall-progress .progress-track i { background: #6fe1bf; }
.overall-progress > span { margin: 0; color: #fff; font-size: 11px; font-weight: 800; }
.budgets-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.budget-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.budget-card-head { display: flex; justify-content: space-between; gap: 10px; }
.budget-title { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; font-size: 12px; }
.budget-title i { width: 9px; height: 9px; border-radius: 50%; }
.budget-delete { border: 0; color: var(--muted-2); background: none; }
.budget-numbers { display: flex; justify-content: space-between; align-items: baseline; margin: 25px 0 9px; }
.budget-numbers strong { color: var(--ink); font-size: 20px; letter-spacing: -.05em; }
.budget-numbers span { color: var(--muted-2); font-size: 10px; }
.budget-card.over .progress-track i { background: var(--red); }
.budget-card.over .budget-status { color: var(--red); }
.budget-status { display: block; margin-top: 9px; color: var(--muted); font-size: 10px; }

/* Reports */
.report-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; margin-bottom: 18px; }
.lower-report { grid-template-columns: 1fr 1fr; }
.report-chart-panel { min-height: 300px; }
.report-total { color: var(--ink); font-size: 14px; font-weight: 850; }
.donut-layout { display: flex; align-items: center; gap: 25px; min-height: 210px; padding: 9px 25px 24px; }
.donut { width: 170px; height: 170px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(#e7ecf3 0 100%); position: relative; }
.donut::after { content: ""; position: absolute; inset: 30px; border-radius: 50%; background: white; }
.donut span { z-index: 1; color: var(--ink); font-size: 14px; font-weight: 900; text-align: center; }
.donut-legend { display: grid; gap: 10px; min-width: 0; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.donut-legend-item i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }
.donut-legend-item strong { margin-left: auto; color: var(--ink); font-size: 10px; white-space: nowrap; }
.comparison-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 22px 25px; }
.comparison-card { padding: 17px; border-radius: 14px; background: #f7fafc; }
.comparison-card > span, .comparison-card small { display: block; color: var(--muted); font-size: 10px; }
.comparison-card strong { display: block; margin: 10px 0 3px; color: var(--ink); font-size: 20px; letter-spacing: -.06em; }
.comparison-card small { color: var(--muted-2); }
.comparison-bar { height: 5px; margin-top: 17px; border-radius: 99px; background: #e8edf3; overflow: hidden; }
.comparison-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--amber); }
.loan-comparison .comparison-bar i { background: var(--red); }
.merchant-list { padding: 3px 22px 18px; }
.merchant-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f0f3f7; }
.merchant-rank { width: 20px; color: var(--muted-2); font-size: 10px; font-weight: 800; }
.merchant-name { flex: 1; color: #4e5c74; font-size: 11px; font-weight: 700; }
.merchant-count { color: var(--muted-2); font-size: 9px; }
.merchant-value { color: var(--ink); font-size: 11px; font-weight: 850; }
.report-verdict { display: flex; gap: 13px; margin: 9px 22px 24px; padding: 17px; border-radius: 14px; background: #f7f9ff; }
.verdict-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 17px; }
.report-verdict strong, .report-verdict span { display: block; }
.report-verdict strong { color: var(--ink); font-size: 12px; line-height: 1.4; }
.report-verdict span { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.55; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 17px; }
.settings-card { display: flex; align-items: start; gap: 14px; min-height: 190px; padding: 22px; box-shadow: none; }
.settings-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; color: var(--blue); background: var(--blue-soft); font-size: 19px; }
.settings-icon.lock { color: var(--violet); background: #f1efff; }
.settings-icon.scan { color: var(--green); background: var(--green-soft); }
.settings-card h3 { margin: 0; }
.settings-card p { min-height: 54px; margin: 8px 0 18px; font-size: 11px; line-height: 1.55; }
.file-button { position: relative; margin-left: 5px; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.privacy-panel { display: flex; align-items: center; gap: 16px; padding: 22px; background: #f1fbf7; border-color: #d9f2e9; box-shadow: none; }
.privacy-badge { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 13px; color: var(--green); background: var(--green-soft); font-size: 11px; }
.privacy-panel h3 { margin-top: 0; color: #1b6e57; }
.privacy-panel p { margin: 6px 0 0; font-size: 11px; line-height: 1.5; }

/* Modals */
.modal-root { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(15, 27, 54, .47); backdrop-filter: blur(5px); }
.modal { width: min(100%, 620px); max-height: min(90vh, 760px); overflow: auto; border: 1px solid rgba(255,255,255,.48); border-radius: 20px; background: #fff; box-shadow: 0 30px 100px rgba(12, 25, 52, .28); animation: modal-in .22s ease both; }
.modal.wide { width: min(100%, 820px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 23px 25px 16px; }
.modal-head h3 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.modal-head p { margin: 5px 0 0; font-size: 11px; }
.modal-close { width: 28px; height: 28px; border: 0; border-radius: 8px; color: var(--muted); background: #f4f6f9; font-size: 17px; }
.modal-body { padding: 0 25px 25px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: end; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.field-note { margin-top: 5px; color: var(--muted-2); font-size: 9px; line-height: 1.4; }
.scan-callout { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px; border-radius: 12px; color: #246c5a; background: var(--green-soft); font-size: 11px; }
.scan-callout span { font-size: 21px; }
.modal-tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 4px; border-radius: 10px; background: #f5f7fb; }
.modal-tab { flex: 1; border: 0; border-radius: 8px; padding: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.modal-tab.active { color: var(--blue); background: #fff; box-shadow: 0 4px 12px rgba(31,58,105,.07); }
.items-header { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; }
.items-header strong { color: var(--ink); font-size: 12px; }
.items-header button { border: 0; color: var(--blue); background: none; font-size: 10px; font-weight: 800; }
.item-form-row { display: grid; grid-template-columns: 1.8fr .7fr .9fr 1.1fr 28px; gap: 7px; align-items: center; margin-bottom: 7px; }
.item-form-row input, .item-form-row select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px; outline: none; color: var(--ink); font-size: 10px; }
.item-form-row button { width: 28px; height: 28px; border: 0; border-radius: 8px; color: var(--muted-2); background: #f4f6f9; }
.item-form-row button:hover { color: var(--red); }
.scanner-modal { width: min(100%, 560px); }
.scanner-stage { position: relative; overflow: hidden; min-height: 280px; margin: 0 25px 15px; border-radius: 16px; background: #101a34; }
#scannerVideo { width: 100%; height: 300px; display: block; object-fit: cover; }
.scanner-overlay { position: absolute; inset: 25% 17%; border: 2px solid rgba(126, 238, 205, .9); border-radius: 13px; box-shadow: 0 0 0 100vmax rgba(7, 16, 34, .35); }
.scanner-status { position: absolute; right: 12px; bottom: 11px; left: 12px; padding: 8px; border-radius: 8px; color: white; background: rgba(10,20,41,.65); font-size: 10px; text-align: center; }
.scanner-manual { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 0 25px 25px; }
.scanner-manual input { min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px; outline: none; font-size: 11px; }
.scanner-help { margin: 0 25px 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.confirm-scan { margin: 0 25px 22px; padding: 13px; border-radius: 12px; color: #425170; background: #f5f8fc; font-size: 11px; line-height: 1.5; }

/* Toast */
.toast-root { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 40px)); }
.toast { display: flex; align-items: start; gap: 9px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: #44526d; background: #fff; box-shadow: 0 12px 30px rgba(21,43,82,.15); font-size: 11px; animation: toast-in .25s ease both; }
.toast.success::before { content: "✓"; color: var(--green); font-weight: 900; }
.toast.error::before { content: "!"; color: var(--red); font-weight: 900; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .sidebar { width: 218px; flex-basis: 218px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card:first-child { grid-column: span 2; }
  .purchases-grid, .budgets-grid, .accounts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-insights { grid-template-columns: repeat(3, 1fr); }
  .receipt-tip { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; transform: translateX(-105%); transition: transform .25s; box-shadow: 18px 0 60px rgba(4, 15, 39, .25); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: block; }
  .topbar { gap: 16px; }
  .topbar-title { margin-right: auto; }
  .dashboard-grid, .lower-grid, .report-grid, .lower-report { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .account-summary-grid, .accounts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-card { min-height: auto; }
  .settings-card p { min-height: unset; }
}
@media (max-width: 640px) {
  .topbar { height: 75px; padding: 0 16px; }
  .topbar-title h1 { font-size: 20px; }
  .topbar-title span { font-size: 9px; }
  .topbar-actions { gap: 8px; }
  .month-control { display: none; }
  .content-wrap { padding: 23px 15px 40px; }
  .welcome-row, .section-intro { display: block; margin-bottom: 20px; }
  .welcome-row .quick-actions, .section-intro .quick-actions { margin-top: 17px; }
  .section-intro > .button { margin-top: 16px; }
  .metric-grid { gap: 9px; }
  .account-summary-grid, .accounts-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 132px; padding: 15px; }
  .metric-card:first-child { grid-column: span 2; }
  .metric-value { margin-top: 13px; font-size: 20px; }
  .metric-foot { font-size: 9px; }
  .panel-heading { padding: 18px 17px 11px; }
  .chart-wrap { height: 210px; padding-right: 14px; padding-left: 14px; }
  .chart-legend { display: none; }
  .category-bars, .recent-list { padding-right: 17px; padding-left: 17px; }
  .category-row { grid-template-columns: 1fr auto; gap: 7px; }
  .category-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .toolbar { align-items: stretch; flex-wrap: wrap; padding: 9px; }
  .filter-pills { width: 100%; }
  .filter-pill { flex: 1; }
  .search-box { min-width: 0; width: 100%; margin-left: 0; }
  .select-control { width: 100%; }
  .table-panel { border-radius: 14px; }
  .data-table th, .data-table td { padding: 12px 13px; }
  .data-table th:nth-child(4), .data-table td:nth-child(4) { display: none; }
  .table-delete { opacity: 1; }
  .purchase-insights { grid-template-columns: 1fr 1fr; }
  .receipt-tip { grid-column: 1 / -1; }
  .recurring-head { display: block; }
  .recurring-head-actions { justify-content: space-between; margin-top: 12px; }
  .recurring-grid, .purchases-grid, .budgets-grid { grid-template-columns: 1fr; }
  .recurring-card { grid-template-columns: 1fr; }
  .recurring-card-right { display: flex; align-items: baseline; justify-content: space-between; text-align: left; }
  .recurring-card-actions { justify-content: flex-start; flex-wrap: wrap; }
  .budget-summary { display: block; padding: 18px; }
  .budget-summary-numbers { flex-wrap: wrap; gap: 18px; margin-top: 18px; }
  .overall-progress { width: 100%; }
  .overall-progress .progress-track { flex: 1; width: auto; }
  .donut-layout { display: grid; place-items: center; }
  .donut-legend { width: 100%; }
  .comparison-cards { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .item-form-row { grid-template-columns: 1.5fr .65fr .8fr 1fr 28px; gap: 4px; }
  .item-form-row input, .item-form-row select { padding: 7px 4px; font-size: 9px; }
  .modal-root { padding: 10px; }
  .modal-head, .modal-body { padding-right: 17px; padding-left: 17px; }
  .scanner-stage { margin-right: 17px; margin-left: 17px; }
  .scanner-manual, .scanner-help, .confirm-scan { margin-right: 17px; margin-left: 17px; padding-right: 0; padding-left: 0; }
  .scanner-manual { grid-template-columns: 1fr; }
  .privacy-panel { align-items: start; }
}
