:root {
  color-scheme: light;
  --bg: #f5f7fb; --surface: rgba(255,255,255,.9); --surface-solid: #fff; --surface-soft: #f0f3f8;
  --ink: #17201f; --muted: #71807d; --brand: #0f4c46; --brand-2: #176b61; --accent: #c9f56f;
  --mint: #7cdfbc; --coral: #ff8d73; --gold: #f4bd59; --line: rgba(23,54,50,.09);
  --shadow: 0 18px 50px rgba(20,48,44,.08); --shadow-hover: 0 24px 60px rgba(20,48,44,.13); --radius: 26px;
}
body.dark {
  color-scheme: dark; --bg: #0c1716; --surface: rgba(21,40,38,.88); --surface-solid: #152826;
  --surface-soft: #1d3431; --ink: #f2fbf8; --muted: #9ab0ac; --brand: #90e3c6; --brand-2: #b8f2dc;
  --line: rgba(212,245,234,.1); --shadow: 0 20px 56px rgba(0,0,0,.24); --shadow-hover: 0 26px 70px rgba(0,0,0,.34);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-width: 320px;
  background: radial-gradient(circle at 88% 4%,rgba(201,245,111,.18),transparent 24rem), radial-gradient(circle at 40% 90%,rgba(124,223,188,.11),transparent 30rem), var(--bg);
  color: var(--ink); font-family: Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.auth-gate { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:22px; background:radial-gradient(circle at 20% 10%,#263d63 0,#0d2039 38%,#07111f 100%); }
.auth-gate[hidden] { display:none; }
.auth-card { width:min(100%,450px); padding:32px; border:1px solid rgba(242,183,5,.42); border-radius:28px; background:rgba(10,27,47,.97); color:#f8fafc; box-shadow:0 30px 100px rgba(0,0,0,.55); text-align:center; }
.auth-mark { width:62px; height:62px; display:grid; place-items:center; margin:0 auto 14px; border-radius:19px; background:linear-gradient(145deg,#ffd756,#f2b705); color:#10233d; font-size:30px; }
.auth-card h1 { margin:3px 0 8px; font-size:clamp(26px,6vw,36px); letter-spacing:-.04em; }
.auth-card > div > p { margin:0 0 20px; color:#b8c5d5; line-height:1.55; }
.auth-card label { display:grid; gap:7px; margin:13px 0; text-align:left; font-size:13px; font-weight:800; }
.auth-card input { width:100%; height:49px; padding:0 14px; border:1px solid #49637f; border-radius:13px; background:#102a48; color:#fff; font:700 16px system-ui; }
.auth-card input:focus { outline:3px solid #f2b705; outline-offset:2px; }
.auth-error { min-height:22px; margin:4px 0!important; color:#ff9ba0!important; font-size:13px; }
.auth-restore { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:22px; padding-top:20px; border-top:1px solid rgba(255,255,255,.12); color:#a9b8c9; font-size:13px; }
.auth-note { display:block; margin-top:18px; color:#7f93a9; line-height:1.45; }
button,input,select { font: inherit; } button { cursor: pointer; } .app-shell { min-height: 100vh; }

.sidebar {
  position: fixed; inset: 16px auto 16px 16px; z-index: 20; width: 240px; display: flex; flex-direction: column;
  padding: 22px 14px 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); border-radius: 28px;
  background: linear-gradient(165deg,#103f3b 0%,#0b2c29 100%); color: #fff; box-shadow: 0 24px 70px rgba(10,42,39,.22);
}
.sidebar::after { content:""; position:absolute; width:190px; height:190px; right:-100px; top:-90px; border:34px solid rgba(201,245,111,.08); border-radius:50%; pointer-events:none; }
.brand { position:relative; z-index:1; display:flex; align-items:center; gap:12px; padding:4px 10px 27px; color:#fff; text-decoration:none; }
.brand-mark { width:43px; height:43px; display:grid; place-items:center; flex:none; border-radius:14px; background:linear-gradient(145deg,#d9ff8b,#b8ed5c); box-shadow:0 10px 24px rgba(201,245,111,.18); }
.brand-mark svg { width:24px; fill:none; stroke:#113d39; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.brand b,.brand small { display:block; } .brand b { font-size:17px; letter-spacing:-.02em; } .brand small { color:#a9c3be; font-size:12px; }
.side-nav { display:grid; gap:5px; }
.nav-item { display:flex; align-items:center; gap:12px; min-height:49px; padding:0 13px; border:0; border-radius:15px; background:transparent; color:#adc4bf; text-align:left; transition:.2s ease; }
.nav-item:hover { color:#fff; background:rgba(255,255,255,.06); transform:translateX(2px); }
.nav-item.active { color:#fff; background:rgba(255,255,255,.105); box-shadow:inset 0 0 0 1px rgba(255,255,255,.045); }
.nav-item.active .nav-icon { color:#173e3a; background:var(--accent); }
.nav-icon { width:30px; height:30px; display:grid; place-items:center; border-radius:10px; font-size:17px; transition:.2s ease; }
.sidebar-foot { margin-top:auto; }
.privacy-note { display:flex; gap:10px; align-items:flex-start; padding:13px; border:1px solid rgba(255,255,255,.08); border-radius:16px; background:rgba(255,255,255,.055); }
.privacy-note>span { color:var(--accent); } .privacy-note p { margin:0; color:#a9c3be; font-size:11px; line-height:1.45; } .privacy-note b { color:#fff; font-size:12px; }
.text-button { padding:14px 4px 0; border:0; background:none; color:#8daaa4; font-size:11px; text-decoration:underline; text-underline-offset:3px; }

.main-content { max-width:1540px; margin-left:272px; padding:31px clamp(24px,4vw,58px) 64px; }
.topbar { position:sticky; top:0; z-index:12; display:flex; align-items:center; justify-content:space-between; gap:20px; margin:-10px -12px 24px; padding:15px 12px 13px; background:linear-gradient(to bottom,var(--bg) 68%,transparent); }
.topbar h1 { margin:3px 0 0; font-size:clamp(28px,3vw,40px); line-height:1.08; letter-spacing:-.045em; }
.eyebrow { margin:0; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.13em; text-transform:uppercase; }
.top-actions { display:flex; gap:9px; }
.primary-button,.secondary-button,.icon-button { min-height:46px; border:0; border-radius:14px; font-weight:800; transition:transform .18s ease,box-shadow .18s ease,background .18s ease; }
.primary-button { padding:0 19px; background:linear-gradient(135deg,#13554e,#0d3d38); color:#fff; box-shadow:0 10px 24px rgba(15,76,70,.18); }
.primary-button:hover { transform:translateY(-2px); box-shadow:0 15px 30px rgba(15,76,70,.24); } body.dark .primary-button { background:var(--accent); color:#183a36; }
.primary-button span { margin-right:5px; font-size:20px; vertical-align:-1px; }
.secondary-button { padding:0 17px; border:1px solid var(--line); background:var(--surface-solid); color:var(--ink); }
.icon-button { width:46px; padding:0; border:1px solid var(--line); background:var(--surface); color:var(--ink); box-shadow:0 8px 24px rgba(20,48,44,.04); backdrop-filter:blur(16px); }
.top-actions a.icon-button { display:grid; place-items:center; text-decoration:none; }
.icon-button:hover,.secondary-button:hover { transform:translateY(-2px); border-color:rgba(23,107,97,.25); }

.view { display:none; animation:view-in .28s ease; } .view.active { display:block; }
@keyframes view-in { from { opacity:0; transform:translateY(7px); } }
.card { padding:24px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow); backdrop-filter:blur(18px); transition:box-shadow .22s ease,transform .22s ease; }
.card-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:22px; }
.card-heading h2 { margin:3px 0 0; font-size:19px; letter-spacing:-.025em; }
.pill { padding:7px 11px; border:1px solid var(--line); border-radius:999px; background:var(--surface-soft); color:var(--muted); font-size:11px; font-weight:750; white-space:nowrap; }
.link-button { padding:6px 0; border:0; background:none; color:var(--brand-2); font-size:12px; font-weight:800; }

.summary-grid { display:grid; grid-template-columns:1.35fr repeat(3,1fr); gap:14px; margin-bottom:14px; }
.summary-card { position:relative; min-height:151px; overflow:hidden; padding:21px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow); transition:transform .22s ease,box-shadow .22s ease; }
.summary-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-hover); }
.summary-card.primary { border:0; background:linear-gradient(145deg,#155b53,#0c3935); color:#fff; }
.summary-card.primary::before { content:""; position:absolute; width:155px; height:155px; right:-64px; bottom:-79px; border:29px solid rgba(201,245,111,.13); border-radius:50%; }
.summary-card.primary::after { content:""; position:absolute; width:62px; height:62px; right:22px; top:19px; border-radius:50%; background:rgba(201,245,111,.07); }
.summary-label { position:relative; z-index:1; display:flex; align-items:center; justify-content:space-between; color:var(--muted); font-size:12px; font-weight:700; }
.primary .summary-label,.primary .summary-foot { color:#bad3ce; }
.summary-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:11px; background:var(--surface-soft); color:var(--brand-2); }
.primary .summary-icon { background:rgba(255,255,255,.11); color:var(--accent); }
.summary-value { position:relative; z-index:1; margin:19px 0 2px; font-size:clamp(25px,2.35vw,34px); font-weight:850; letter-spacing:-.045em; font-variant-numeric:tabular-nums; }
.summary-foot { position:relative; z-index:1; color:var(--muted); font-size:11px; }
.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(300px,.82fr); gap:14px; margin-bottom:14px; }

.cashflow-chart { height:220px; display:flex; align-items:flex-end; gap:clamp(10px,2vw,26px); padding:18px 8px 3px; border-bottom:1px solid var(--line); background:repeating-linear-gradient(to top,transparent 0,transparent 53px,var(--line) 54px); }
.chart-group { position:relative; flex:1; height:100%; display:flex; align-items:flex-end; justify-content:center; gap:5px; }
.chart-group label { position:absolute; bottom:-29px; color:var(--muted); font-size:10px; font-weight:700; }
.bar { width:min(19px,38%); min-height:4px; border-radius:7px 7px 3px 3px; transition:height .5s ease,filter .2s ease; } .bar:hover { filter:brightness(1.08); }
.bar.income { background:linear-gradient(to top,#59cba6,#9be8cd); } .bar.expense { background:linear-gradient(to top,#0e4a44,#28756c); } body.dark .bar.expense { background:linear-gradient(to top,#ee8068,#ffac97); }
.chart-legend { display:flex; gap:18px; margin-top:35px; color:var(--muted); font-size:11px; }
.chart-legend i { display:inline-block; width:9px; height:9px; margin-right:7px; border-radius:3px; } .legend-income { background:var(--mint); } .legend-expense { background:var(--brand); } body.dark .legend-expense { background:var(--coral); }
.budget-item { margin-bottom:20px; } .budget-item:last-child { margin-bottom:0; }
.budget-line { display:flex; justify-content:space-between; gap:10px; margin-bottom:8px; font-size:12px; } .budget-line b:last-child { color:var(--muted); font-weight:650; }
.progress { height:8px; overflow:hidden; border-radius:99px; background:var(--surface-soft); } .progress span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#55cda6,#9ce6c9); }
.progress.warn span { background:linear-gradient(90deg,#e9a93e,#f4cf77); } .progress.danger span { background:linear-gradient(90deg,#ee7058,#ff9e89); }

.transaction-list { display:grid; }
.transaction-row { display:grid; grid-template-columns:auto 1fr auto; gap:13px; align-items:center; padding:13px 2px; border-bottom:1px solid var(--line); }
.transaction-row:last-child { border-bottom:0; } .transaction-row:hover .category-icon { transform:scale(1.06); }
.category-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:14px; font-size:18px; transition:transform .18s ease; }
.transaction-name { font-size:13px; font-weight:800; } .transaction-meta { margin-top:2px; color:var(--muted); font-size:11px; }
.transaction-amount { font-size:13px; font-weight:850; font-variant-numeric:tabular-nums; } .transaction-amount.income { color:#21866c; } .transaction-amount.expense { color:var(--ink); }
.toolbar-card { display:flex; align-items:center; gap:11px; margin-bottom:14px; padding:14px; }
.search-wrap { height:46px; display:flex; align-items:center; gap:8px; flex:1; padding:0 14px; border:1px solid var(--line); border-radius:14px; background:var(--surface-soft); }
.search-wrap input { width:100%; border:0; outline:0; background:transparent; color:var(--ink); }
.toolbar-card select,dialog select { height:46px; padding:0 36px 0 13px; border:1px solid var(--line); border-radius:14px; background:var(--surface-solid); color:var(--ink); }
.full-list .transaction-row { padding:16px 2px; } .empty-state { padding:50px 20px; color:var(--muted); text-align:center; }

.budget-hero { position:relative; display:flex; align-items:center; justify-content:space-between; gap:20px; overflow:hidden; margin-bottom:14px; border:0; background:linear-gradient(135deg,#155b53,#0d3c37); color:#fff; }
.budget-hero::after { content:""; position:absolute; width:260px; height:260px; right:-95px; top:-120px; border-radius:50%; background:rgba(201,245,111,.07); }
.budget-hero>* { position:relative; z-index:1; } .budget-hero .eyebrow { color:#bdd6d1; } .budget-hero h2 { margin:5px 0; font-size:27px; letter-spacing:-.035em; }
.budget-hero p:last-child { margin:0; color:#cfe0dc; font-size:13px; }
.budget-ring { --p:65; position:relative; width:112px; aspect-ratio:1; display:grid; place-items:center; flex:none; border-radius:50%; background:conic-gradient(var(--accent) calc(var(--p)*1%),rgba(255,255,255,.14) 0); }
.budget-ring::before { content:""; position:absolute; width:78px; aspect-ratio:1; border-radius:50%; background:#155049; box-shadow:inset 0 0 0 1px rgba(255,255,255,.06); }
.budget-ring span { position:relative; font-size:14px; font-weight:850; }
.budget-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.budget-card { padding:20px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow); transition:.22s ease; }
.budget-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-hover); }
.budget-card-head { display:flex; align-items:center; gap:11px; } .budget-card h3 { margin:0; font-size:15px; } .budget-card p { margin:3px 0 20px; color:var(--muted); font-size:11px; }
.budget-card .big { margin:16px 0 2px; font-size:23px; font-weight:850; letter-spacing:-.03em; } .budget-card .remaining { color:var(--muted); font-size:11px; }

.report-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:14px; }
.donut-layout { min-height:260px; display:flex; align-items:center; gap:30px; }
.donut { width:190px; aspect-ratio:1; display:grid; place-items:center; flex:none; border-radius:50%; filter:drop-shadow(0 12px 20px rgba(20,48,44,.1)); }
.donut>div { width:116px; aspect-ratio:1; display:grid; place-content:center; border-radius:50%; background:var(--surface-solid); text-align:center; }
.donut b { font-size:20px; letter-spacing:-.03em; } .donut span { color:var(--muted); font-size:10px; }
.donut-legend { display:grid; gap:10px; flex:1; } .legend-row { display:grid; grid-template-columns:auto 1fr auto; gap:8px; align-items:center; font-size:11px; }
.legend-row i { width:9px; height:9px; border-radius:3px; } .legend-row b { font-size:11px; }
.six-month-chart { height:260px; display:flex; align-items:flex-end; gap:15px; padding-top:20px; }
.month-col { height:100%; display:flex; align-items:center; justify-content:flex-end; flex:1; flex-direction:column; gap:8px; }
.month-col .month-bar { position:relative; width:min(42px,80%); overflow:hidden; border-radius:9px 9px 3px 3px; background:var(--surface-soft); }
.month-col .month-bar span { position:absolute; inset:auto 0 0; border-radius:inherit; background:linear-gradient(to top,#0e4a44,#28756c); } .month-col.current .month-bar span { background:linear-gradient(to top,#58cba6,#a0ebce); }
.month-col small { color:var(--muted); font-size:10px; }
.insight-card { display:flex; align-items:center; gap:16px; background:linear-gradient(115deg,var(--surface),rgba(201,245,111,.08)); }
.insight-icon { width:48px; height:48px; display:grid; place-items:center; flex:none; border-radius:16px; background:var(--accent); color:#153d38; font-size:21px; }
.insight-card h3 { margin:0 0 3px; font-size:15px; } .insight-card p { margin:0; color:var(--muted); font-size:13px; }

.recurring-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:14px; }
.recurring-stat { padding:22px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow); }
.recurring-stat small { display:block; color:var(--muted); } .recurring-stat b { display:block; margin-top:8px; font-size:26px; letter-spacing:-.035em; }
.recurring-list { display:grid; grid-template-columns:1fr 1fr; gap:10px 20px; }
.recurring-row { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:12px; padding:13px; border:1px solid var(--line); border-radius:17px; background:rgba(255,255,255,.22); transition:.18s ease; }
.recurring-row:hover { border-color:rgba(23,107,97,.22); transform:translateY(-1px); } .recurring-row .due { color:var(--muted); font-size:10px; }

dialog { width:min(570px,calc(100% - 28px)); padding:0; border:1px solid var(--line); border-radius:28px; background:var(--surface-solid); color:var(--ink); box-shadow:0 35px 100px rgba(0,0,0,.32); }
dialog::backdrop { background:rgba(6,25,23,.6); backdrop-filter:blur(7px); } dialog form { padding:27px; }
.dialog-head { display:flex; align-items:flex-start; justify-content:space-between; } .dialog-head h2 { margin:3px 0 18px; font-size:24px; letter-spacing:-.035em; }
.dialog-close { width:37px; height:37px; border:0; border-radius:12px; background:var(--surface-soft); color:var(--ink); font-size:24px; }
.type-toggle { display:grid; grid-template-columns:1fr 1fr; margin-bottom:18px; padding:4px; border-radius:14px; background:var(--surface-soft); }
.type-toggle button { padding:10px; border:0; border-radius:11px; background:none; color:var(--muted); font-weight:800; }
.type-toggle button.active { background:var(--surface-solid); color:var(--ink); box-shadow:0 4px 14px rgba(20,57,53,.08); }
dialog label { display:grid; gap:7px; margin-bottom:14px; font-size:12px; font-weight:750; }
dialog input,dialog select { width:100%; height:46px; padding:0 13px; border:1px solid var(--line); border-radius:13px; outline:none; background:var(--surface-solid); color:var(--ink); }
dialog input:focus,dialog select:focus { border-color:var(--brand-2); box-shadow:0 0 0 4px rgba(29,106,96,.11); }
.amount-input { position:relative; } .amount-input span { position:absolute; left:14px; top:9px; font-size:20px; font-weight:850; } .amount-input input { padding-left:40px; font-size:20px; font-weight:850; }
.form-row { display:grid; grid-template-columns:1.4fr 1fr; gap:12px; } .optional { color:var(--muted); font-weight:400; } .wide { width:100%; margin-top:4px; }
.toast { position:fixed; right:24px; bottom:24px; z-index:50; padding:13px 18px; border:1px solid rgba(255,255,255,.1); border-radius:14px; background:#17302e; color:#fff; box-shadow:0 18px 50px rgba(0,0,0,.2); opacity:0; transform:translateY(120px); transition:.25s; }
.toast.show { opacity:1; transform:none; } .mobile-nav { display:none; }

@media (max-width:1100px) {
  .summary-grid { grid-template-columns:1fr 1fr; } .dashboard-grid,.report-grid { grid-template-columns:1fr; }
  .budget-grid { grid-template-columns:1fr 1fr; } .recurring-list { grid-template-columns:1fr; }
}
@media (max-width:760px) {
  .auth-card { padding:25px 20px; }
  .auth-restore { align-items:stretch; flex-direction:column; }
  body { padding-bottom:88px; background:radial-gradient(circle at 90% 0,rgba(201,245,111,.18),transparent 18rem),var(--bg); }
  .sidebar { display:none; } .main-content { margin:0; padding:18px 15px 30px; }
  .topbar { margin:-5px -4px 18px; padding:12px 4px 10px; } .topbar .eyebrow { font-size:9px; } .topbar h1 { font-size:26px; }
  .top-actions { gap:6px; } .top-actions .primary-button { display:none; } .icon-button { width:42px; min-height:42px; border-radius:13px; }
  .summary-grid { grid-template-columns:1fr 1fr; gap:10px; margin-bottom:10px; }
  .summary-card { min-height:125px; padding:16px; border-radius:20px; } .summary-card.primary { grid-column:1/-1; min-height:142px; }
  .summary-value { margin-top:13px; font-size:23px; } .summary-label,.summary-foot { font-size:10px; }
  .dashboard-grid { gap:10px; margin-bottom:10px; } .card { padding:18px; border-radius:20px; } .card-heading { margin-bottom:18px; }
  .cashflow-chart { height:190px; } .recent-card { margin-top:10px; }
  .transaction-row { grid-template-columns:auto minmax(0,1fr) auto; } .transaction-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .transaction-amount { font-size:12px; }
  .toolbar-card { display:grid; grid-template-columns:1fr 1fr; } .search-wrap { grid-column:1/-1; }
  .toolbar-card select { width:100%; min-width:0; } .toolbar-card .secondary-button { padding:0 10px; }
  .budget-grid,.recurring-summary { grid-template-columns:1fr; } .budget-hero h2 { font-size:21px; }
  .budget-ring { width:88px; } .budget-ring::before { width:61px; }
  .donut-layout { flex-direction:column; } .donut-legend { width:100%; } .six-month-chart { height:230px; } .recurring-list { grid-template-columns:1fr; }
  .mobile-nav { position:fixed; inset:auto 8px 8px; z-index:30; display:grid; grid-template-columns:repeat(6,1fr); align-items:center; padding:7px 4px calc(7px + env(safe-area-inset-bottom)); border:1px solid var(--line); border-radius:21px; background:rgba(255,255,255,.91); box-shadow:0 18px 50px rgba(16,48,44,.18); backdrop-filter:blur(18px); }
  body.dark .mobile-nav { background:rgba(20,39,36,.93); }
  .mobile-nav button { min-height:50px; display:grid; place-items:center; gap:1px; padding:0 2px; border:0; background:none; color:var(--muted); font-size:17px; }
  .mobile-nav button.active { color:var(--brand-2); } .mobile-nav small { font-size:8px; font-weight:650; }
  .mobile-nav .mobile-add { width:49px; height:49px; min-height:49px; margin:-24px auto 0; border-radius:16px; background:linear-gradient(145deg,#175c54,#0d403b); color:#fff; box-shadow:0 10px 23px rgba(15,76,70,.3); font-size:27px; }
  dialog { margin:auto; border-radius:23px; } dialog form { padding:21px; } .form-row { grid-template-columns:1fr; }
  .toast { right:16px; bottom:94px; left:16px; text-align:center; }
}
@media (max-width:390px) {
  .summary-grid { grid-template-columns:1fr; } .summary-card.primary { grid-column:auto; }
  .budget-hero { align-items:flex-start; } .budget-ring { width:74px; } .budget-ring::before { width:50px; } .topbar h1 { font-size:23px; }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto!important; animation:none!important; transition:none!important; } }

/* =========================================================
   2026 REDESIGN — luminous fintech / bento dashboard
   ========================================================= */
:root {
  --bg: #f5f4ff;
  --surface: rgba(255,255,255,.72);
  --surface-solid: #ffffff;
  --surface-soft: #f0effa;
  --ink: #17172b;
  --muted: #74748c;
  --brand: #5a45e8;
  --brand-2: #6c56f2;
  --accent: #75f2d0;
  --mint: #62dab9;
  --coral: #ff7897;
  --gold: #ffbd59;
  --line: rgba(70,58,151,.11);
  --shadow: 0 18px 50px rgba(65,48,151,.10);
  --shadow-hover: 0 28px 70px rgba(65,48,151,.17);
}
body.dark {
  --bg: #0c0d1c;
  --surface: rgba(24,25,51,.78);
  --surface-solid: #181933;
  --surface-soft: #242548;
  --ink: #f7f5ff;
  --muted: #aaa8c5;
  --brand: #a89bff;
  --brand-2: #c0b7ff;
  --line: rgba(212,207,255,.11);
  --shadow: 0 20px 58px rgba(0,0,0,.27);
  --shadow-hover: 0 30px 76px rgba(0,0,0,.38);
}
body {
  background:
    radial-gradient(circle at 8% 6%, rgba(121,102,255,.24), transparent 29rem),
    radial-gradient(circle at 94% 12%, rgba(82,226,213,.25), transparent 28rem),
    radial-gradient(circle at 62% 96%, rgba(255,117,179,.15), transparent 32rem),
    var(--bg);
  background-attachment: fixed;
}
.card,.summary-card,.budget-card,.recurring-stat {
  border-color: rgba(255,255,255,.72);
  box-shadow: 0 22px 55px rgba(61,44,143,.10), inset 0 0 0 1px rgba(80,65,165,.05);
  backdrop-filter: blur(24px) saturate(1.25);
}
body.dark .card,body.dark .summary-card,body.dark .budget-card,body.dark .recurring-stat { border-color: rgba(255,255,255,.08); }
.summary-card.primary {
  background:
    radial-gradient(circle at 82% 22%, rgba(117,242,208,.48), transparent 25%),
    linear-gradient(135deg,#7657f5 0%,#4f3bdd 48%,#2b65e2 100%);
  box-shadow: 0 24px 55px rgba(83,61,222,.30);
}
.summary-card.primary::before { border-color: rgba(255,255,255,.13); }
.summary-card.primary::after { background: rgba(255,255,255,.11); }
.primary .summary-icon { color:#172052; background:rgba(255,255,255,.55); }
.primary .summary-label,.primary .summary-foot { color:rgba(255,255,255,.78); }
.primary-button {
  background: linear-gradient(135deg,#7b5bf5,#4d3cdb 55%,#287fdc);
  box-shadow: 0 13px 28px rgba(87,65,226,.28);
}
.primary-button:hover { box-shadow: 0 18px 38px rgba(87,65,226,.38); }
body.dark .primary-button { color:#fff; background:linear-gradient(135deg,#8b6dff,#5a49e5 55%,#268bdd); }
.progress span { background:linear-gradient(90deg,#7160ee,#50d5ce); }
.progress.warn span { background:linear-gradient(90deg,#ff8d77,#ffc35c); }
.progress.danger span { background:linear-gradient(90deg,#f04fa0,#ff6f7d); }
.bar.income { background:linear-gradient(to top,#4dd7bd,#8ef0db); }
.bar.expense { background:linear-gradient(to top,#5745dd,#8d72ff); }
body.dark .bar.expense { background:linear-gradient(to top,#7e63f5,#ad99ff); }
.legend-expense { background:#6751e8; }
.budget-hero {
  background:
    radial-gradient(circle at 80% 20%,rgba(97,240,211,.38),transparent 30%),
    linear-gradient(130deg,#774ff0,#5145dc 52%,#197fd5);
  box-shadow:0 26px 65px rgba(76,56,207,.25);
}
.budget-ring { background:conic-gradient(#7af3d3 calc(var(--p)*1%),rgba(255,255,255,.16) 0); }
.budget-ring::before { background:#5547dc; }
.donut { filter:drop-shadow(0 16px 24px rgba(90,69,224,.18)); }
.month-col .month-bar span { background:linear-gradient(to top,#5b43dd,#9178ff); }
.month-col.current .month-bar span { background:linear-gradient(to top,#28c8bf,#7cf0d8); }
.insight-card { background:linear-gradient(115deg,rgba(255,255,255,.78),rgba(111,86,242,.12),rgba(79,221,208,.13)); }
body.dark .insight-card { background:linear-gradient(115deg,rgba(31,31,65,.92),rgba(111,86,242,.18),rgba(79,221,208,.12)); }
.insight-icon { color:#30236f; background:linear-gradient(145deg,#82f1d6,#a4ffbd); }
.type-toggle button.active { color:#4f3ed0; }
.search-wrap:focus-within { border-color:rgba(108,86,242,.4); box-shadow:0 0 0 4px rgba(108,86,242,.08); }

@media (min-width:761px) {
  .sidebar {
    inset: 18px 24px auto;
    width: auto;
    height: 76px;
    display: grid;
    grid-template-columns: 220px 1fr auto;
    align-items: center;
    padding: 10px 12px;
    border-radius: 24px;
    background:
      radial-gradient(circle at 88% 10%,rgba(88,229,211,.22),transparent 18rem),
      linear-gradient(110deg,#17142f 0%,#25204d 55%,#172c49 100%);
    box-shadow: 0 22px 58px rgba(23,20,58,.23);
  }
  .sidebar::after { display:none; }
  .brand { padding:0 10px; }
  .brand-mark { width:42px; height:42px; background:linear-gradient(145deg,#83f4d9,#adffba); box-shadow:0 10px 24px rgba(117,242,208,.2); }
  .brand-mark svg { stroke:#202451; }
  .brand small { color:#aaa8c9; }
  .side-nav { display:flex; justify-content:center; gap:3px; }
  .nav-item { min-height:48px; padding:0 11px; border-radius:14px; color:#bcb9d6; }
  .nav-item:hover { transform:translateY(-1px); background:rgba(255,255,255,.06); }
  .nav-item.active { background:linear-gradient(135deg,rgba(124,97,255,.35),rgba(66,207,197,.15)); box-shadow:inset 0 0 0 1px rgba(170,160,255,.14); }
  .nav-item.active .nav-icon { color:#1c214f; background:linear-gradient(145deg,#7cf0d5,#abffb7); }
  .nav-icon { width:27px; height:27px; }
  .sidebar-foot { margin:0; }
  .privacy-note { min-width:170px; padding:9px 11px; border-radius:14px; }
  .privacy-note p { font-size:10px; }
  .privacy-note b { font-size:11px; }
  .text-button { display:none; }
  .main-content { max-width:1500px; margin:0 auto; padding:118px clamp(28px,5vw,76px) 70px; }
  .topbar { position:static; margin:0 0 25px; padding:0; background:none; }
  .topbar h1 { font-size:clamp(31px,3vw,43px); }
  .summary-grid { grid-template-columns:2fr repeat(3,1fr); }
  .summary-card.primary { min-height:164px; }
  .dashboard-grid { grid-template-columns:minmax(0,1.6fr) minmax(310px,.85fr); }
}

@media (max-width:980px) and (min-width:761px) {
  .sidebar { grid-template-columns:185px 1fr; }
  .sidebar-foot { display:none; }
  .nav-item { padding:0 8px; font-size:13px; }
  .nav-icon { display:none; }
  .summary-grid { grid-template-columns:repeat(3,1fr); }
  .summary-card.primary { grid-column:1/-1; }
}

@media (max-width:760px) {
  body { background:radial-gradient(circle at 0 0,rgba(121,102,255,.25),transparent 18rem),radial-gradient(circle at 100% 12%,rgba(82,226,213,.22),transparent 18rem),var(--bg); }
  .topbar { background:linear-gradient(to bottom,var(--bg) 70%,transparent); }
  .summary-card.primary { background:radial-gradient(circle at 80% 20%,rgba(117,242,208,.45),transparent 28%),linear-gradient(135deg,#7657f5,#4f3bdd 50%,#2b65e2); }
  .mobile-nav { border-color:rgba(93,73,204,.13); background:rgba(248,247,255,.88); box-shadow:0 20px 55px rgba(68,50,157,.22); }
  body.dark .mobile-nav { background:rgba(20,20,43,.91); }
  .mobile-nav button.active { color:#624be7; }
  .mobile-nav .mobile-add { background:linear-gradient(145deg,#7c5bf5,#4b3ad9 60%,#267fd8); box-shadow:0 12px 26px rgba(86,64,222,.36); }
}

/* Ruby red brand variation */
:root {
  --bg: #fff6f7;
  --surface: rgba(255,255,255,.76);
  --surface-soft: #f9edef;
  --ink: #24181c;
  --muted: #826f76;
  --brand: #d9284d;
  --brand-2: #e23a5c;
  --accent: #ffba63;
  --coral: #ff667f;
  --line: rgba(149,38,66,.11);
  --shadow: 0 18px 50px rgba(148,38,68,.10);
  --shadow-hover: 0 28px 70px rgba(148,38,68,.17);
}
body.dark {
  --bg: #170d13;
  --surface: rgba(43,23,34,.82);
  --surface-solid: #2b1722;
  --surface-soft: #3b2230;
  --ink: #fff5f7;
  --muted: #c5a4af;
  --brand: #ff7992;
  --brand-2: #ff9aaa;
  --line: rgba(255,194,207,.11);
}
body {
  background:
    radial-gradient(circle at 8% 5%,rgba(238,58,98,.24),transparent 29rem),
    radial-gradient(circle at 95% 11%,rgba(255,157,92,.22),transparent 27rem),
    radial-gradient(circle at 62% 96%,rgba(120,72,224,.13),transparent 32rem),
    var(--bg);
}
.primary-button {
  background:linear-gradient(135deg,#f04462,#d5224b 55%,#9d1740);
  box-shadow:0 13px 30px rgba(207,31,72,.30);
}
.primary-button:hover { box-shadow:0 18px 40px rgba(207,31,72,.40); }
body.dark .primary-button { background:linear-gradient(135deg,#ff7189,#e33258 58%,#ad1b45); }
.summary-card.primary {
  background:
    radial-gradient(circle at 83% 21%,rgba(255,193,104,.48),transparent 27%),
    linear-gradient(135deg,#f04963 0%,#d7234d 47%,#9d1843 100%);
  box-shadow:0 25px 58px rgba(198,29,70,.31);
}
.primary .summary-icon { color:#6d1730; background:rgba(255,255,255,.62); }
.progress span { background:linear-gradient(90deg,#e72e58,#ff896f); }
.progress.warn span { background:linear-gradient(90deg,#ff8758,#ffc55d); }
.progress.danger span { background:linear-gradient(90deg,#a9143e,#e92750); }
.bar.expense { background:linear-gradient(to top,#c91f48,#f05a70); }
body.dark .bar.expense { background:linear-gradient(to top,#dc3158,#ff8497); }
.bar.income { background:linear-gradient(to top,#5940d8,#9a7cf4); }
.legend-expense { background:#db2851; }
.legend-income { background:#7158df; }
.budget-hero {
  background:
    radial-gradient(circle at 82% 18%,rgba(255,190,101,.42),transparent 30%),
    linear-gradient(132deg,#ee4462,#ce204b 52%,#8d1740);
  box-shadow:0 27px 66px rgba(190,28,68,.27);
}
.budget-ring { background:conic-gradient(#ffd178 calc(var(--p)*1%),rgba(255,255,255,.17) 0); }
.budget-ring::before { background:#bd2349; }
.month-col .month-bar span { background:linear-gradient(to top,#c71c46,#ef5970); }
.month-col.current .month-bar span { background:linear-gradient(to top,#6846d9,#a989f7); }
.insight-card { background:linear-gradient(115deg,rgba(255,255,255,.8),rgba(228,44,84,.13),rgba(255,160,96,.15)); }
body.dark .insight-card { background:linear-gradient(115deg,rgba(49,25,38,.94),rgba(228,44,84,.2),rgba(255,160,96,.1)); }
.insight-icon { color:#6b1a31; background:linear-gradient(145deg,#ffd074,#ff987b); }
.type-toggle button.active { color:#d3244e; }
.search-wrap:focus-within { border-color:rgba(211,36,78,.42); box-shadow:0 0 0 4px rgba(211,36,78,.08); }

@media (min-width:761px) {
  .sidebar {
    background:
      radial-gradient(circle at 88% 10%,rgba(245,69,99,.27),transparent 18rem),
      linear-gradient(110deg,#20121e 0%,#35162b 54%,#481934 100%);
    box-shadow:0 22px 60px rgba(55,18,41,.27);
  }
  .brand-mark { background:linear-gradient(145deg,#ffbf70,#ff758c); box-shadow:0 10px 26px rgba(244,73,105,.24); }
  .brand-mark svg { stroke:#61172e; }
  .nav-item.active { background:linear-gradient(135deg,rgba(238,61,96,.36),rgba(255,154,91,.14)); box-shadow:inset 0 0 0 1px rgba(255,156,178,.15); }
  .nav-item.active .nav-icon { color:#65172f; background:linear-gradient(145deg,#ffc66f,#ff7b91); }
}
@media (max-width:760px) {
  body { background:radial-gradient(circle at 0 0,rgba(237,51,94,.26),transparent 18rem),radial-gradient(circle at 100% 10%,rgba(255,154,87,.22),transparent 18rem),var(--bg); }
  .summary-card.primary { background:radial-gradient(circle at 82% 20%,rgba(255,194,104,.46),transparent 29%),linear-gradient(135deg,#f04963,#d7234d 50%,#9d1843); }
  .mobile-nav { border-color:rgba(180,39,72,.14); background:rgba(255,249,250,.9); box-shadow:0 20px 55px rgba(150,34,67,.22); }
  body.dark .mobile-nav { background:rgba(42,21,32,.93); }
  .mobile-nav button.active { color:#dc2a52; }
  .mobile-nav .mobile-add { background:linear-gradient(145deg,#f04a65,#d6244d 60%,#9d1740); box-shadow:0 12px 28px rgba(199,30,70,.38); }
}

/* Signal red + navy + gold — no pink/coral */
:root {
  --bg: #f3f6fa;
  --surface: rgba(255,255,255,.82);
  --surface-solid: #ffffff;
  --surface-soft: #edf2f7;
  --ink: #10233d;
  --muted: #68788d;
  --brand: #c5141f;
  --brand-2: #d91d28;
  --accent: #f2b705;
  --mint: #20a88a;
  --coral: #c5141f;
  --gold: #f2b705;
  --line: rgba(18,45,76,.10);
  --shadow: 0 18px 50px rgba(16,35,61,.09);
  --shadow-hover: 0 28px 70px rgba(16,35,61,.15);
}
body.dark {
  --bg: #081524;
  --surface: rgba(16,35,61,.84);
  --surface-solid: #10233d;
  --surface-soft: #18314f;
  --ink: #f5f8fc;
  --muted: #a4b2c3;
  --brand: #ff4a50;
  --brand-2: #ff6469;
  --line: rgba(201,216,235,.12);
}
body {
  background:
    radial-gradient(circle at 8% 4%,rgba(42,96,153,.18),transparent 29rem),
    radial-gradient(circle at 95% 10%,rgba(242,183,5,.17),transparent 27rem),
    radial-gradient(circle at 60% 96%,rgba(28,121,128,.11),transparent 32rem),
    var(--bg);
}
.card,.summary-card,.budget-card,.recurring-stat {
  border-color:rgba(255,255,255,.82);
  box-shadow:0 22px 55px rgba(16,35,61,.09),inset 0 0 0 1px rgba(18,45,76,.045);
}
body.dark .card,body.dark .summary-card,body.dark .budget-card,body.dark .recurring-stat { border-color:rgba(255,255,255,.08); }
.primary-button {
  background:linear-gradient(135deg,#df2029,#bd101b 58%,#8e0911);
  box-shadow:0 13px 30px rgba(178,13,25,.28);
}
.primary-button:hover { box-shadow:0 18px 40px rgba(178,13,25,.38); }
body.dark .primary-button { background:linear-gradient(135deg,#ee3037,#c5141f 60%,#940b13); }
.summary-card.primary {
  background:
    radial-gradient(circle at 84% 18%,rgba(242,183,5,.42),transparent 27%),
    linear-gradient(135deg,#dd2028 0%,#b80f19 48%,#75070d 100%);
  box-shadow:0 25px 58px rgba(151,9,17,.29);
}
.summary-card.primary::before { border-color:rgba(255,255,255,.13); }
.primary .summary-icon { color:#112946; background:rgba(255,255,255,.72); }
.progress span { background:linear-gradient(90deg,#bf111c,#ed2c33); }
.progress.warn span { background:linear-gradient(90deg,#d98000,#f2b705); }
.progress.danger span { background:linear-gradient(90deg,#77070c,#c5141f); }
.bar.income { background:linear-gradient(to top,#148c78,#42c8ab); }
.bar.expense { background:linear-gradient(to top,#9a0b14,#d9232c); }
body.dark .bar.expense { background:linear-gradient(to top,#c5141f,#ff5358); }
.legend-income { background:#20a88a; }
.legend-expense { background:#c5141f; }
.budget-hero {
  background:
    radial-gradient(circle at 82% 18%,rgba(242,183,5,.44),transparent 29%),
    linear-gradient(132deg,#dc2028,#b30e18 52%,#70070c);
  box-shadow:0 27px 66px rgba(145,8,16,.26);
}
.budget-ring { background:conic-gradient(#f2b705 calc(var(--p)*1%),rgba(255,255,255,.18) 0); }
.budget-ring::before { background:#9f0d15; }
.month-col .month-bar span { background:linear-gradient(to top,#9b0b14,#d9232c); }
.month-col.current .month-bar span { background:linear-gradient(to top,#075d75,#249bb0); }
.insight-card { background:linear-gradient(115deg,rgba(255,255,255,.85),rgba(33,81,129,.10),rgba(242,183,5,.11)); }
body.dark .insight-card { background:linear-gradient(115deg,rgba(16,35,61,.96),rgba(197,20,31,.12),rgba(242,183,5,.08)); }
.insight-icon { color:#10233d; background:linear-gradient(145deg,#ffd95b,#f2b705); }
.type-toggle button.active { color:#b70f19; }
.search-wrap:focus-within { border-color:rgba(197,20,31,.38); box-shadow:0 0 0 4px rgba(197,20,31,.07); }
.dialog-copy { margin:-8px 0 20px; color:var(--muted); line-height:1.5; }
.settings-section-title { margin:8px 0 12px; font-size:13px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; }
.settings-budget-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 14px; margin-bottom:8px; }
.empty-state.compact { padding:24px 12px; }
.data-file-actions { margin-top:18px; padding-top:18px; border-top:1px solid var(--line); }
.data-file-actions > div:first-child { display:grid; gap:4px; }
.data-file-actions small { color:var(--muted); line-height:1.45; }
.data-file-buttons { display:flex; gap:10px; margin-top:13px; }
.data-file-buttons button { flex:1; }

@media (min-width:761px) {
  .sidebar {
    background:
      radial-gradient(circle at 90% 8%,rgba(242,183,5,.16),transparent 18rem),
      linear-gradient(110deg,#091a31 0%,#102b4a 55%,#173a5e 100%);
    box-shadow:0 22px 60px rgba(8,24,45,.27);
  }
  .brand-mark { background:linear-gradient(145deg,#ffd756,#f2b705); box-shadow:0 10px 26px rgba(242,183,5,.22); }
  .brand-mark svg { stroke:#10233d; }
  .nav-item.active { background:linear-gradient(135deg,rgba(197,20,31,.42),rgba(242,183,5,.12)); box-shadow:inset 0 0 0 1px rgba(255,255,255,.11); }
  .nav-item.active .nav-icon { color:#10233d; background:linear-gradient(145deg,#ffd756,#f2b705); }
}
@media (max-width:760px) {
  .settings-budget-grid { grid-template-columns:1fr; }
  .data-file-buttons { flex-direction:column; }
  body { background:radial-gradient(circle at 0 0,rgba(42,96,153,.2),transparent 18rem),radial-gradient(circle at 100% 10%,rgba(242,183,5,.15),transparent 18rem),var(--bg); }
  .summary-card.primary { background:radial-gradient(circle at 83% 18%,rgba(242,183,5,.42),transparent 29%),linear-gradient(135deg,#dd2028,#b80f19 50%,#75070d); }
  .mobile-nav { border-color:rgba(18,45,76,.13); background:rgba(249,251,253,.92); box-shadow:0 20px 55px rgba(16,35,61,.2); }
  body.dark .mobile-nav { background:rgba(10,27,47,.94); }
  .mobile-nav button.active { color:#c5141f; }
  .mobile-nav .mobile-add { background:linear-gradient(145deg,#df2029,#b70f19 60%,#79070d); box-shadow:0 12px 28px rgba(165,10,19,.36); }
}
