:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --text: #122033;
  --muted: #6f7c8f;
  --line: #dfe6ef;
  --brand: #4f46e5;
  --brand-2: #6d5dfc;
  --brand-soft: #eeecff;
  --navy: #0c1526;
  --green: #159a72;
  --green-soft: #e5f7f1;
  --red: #d9525e;
  --red-soft: #fdecef;
  --amber: #d58a11;
  --amber-soft: #fff5df;
  --blue: #3972d5;
  --blue-soft: #eaf1ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 18px 45px rgba(15, 23, 42, .12);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --sidebar: 272px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #0d1421;
  --surface: #131d2c;
  --surface-2: #192536;
  --surface-3: #223044;
  --text: #eef4fb;
  --muted: #9eacc0;
  --line: #29384d;
  --brand: #8a80ff;
  --brand-2: #a198ff;
  --brand-soft: #29264b;
  --navy: #070c14;
  --green: #45c99f;
  --green-soft: #18372f;
  --red: #ff7d88;
  --red-soft: #40242a;
  --amber: #f1b54a;
  --amber-soft: #3d301b;
  --blue: #73a4ff;
  --blue-soft: #1c3152;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 20px 52px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: linear-gradient(180deg, #0d1729 0%, #0b1322 100%);
  color: #eef3fb;
  padding: 28px 20px 20px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand-block { display: flex; align-items: center; gap: 13px; padding: 0 8px 30px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 21px;
  color: #fff;
  background: linear-gradient(145deg, #7a70ff, #4e46d9);
  box-shadow: 0 10px 24px rgba(83, 73, 230, .34);
}
.brand-name { font-weight: 760; letter-spacing: -.02em; font-size: 19px; }
.brand-tagline { color: #8f9db2; font-size: 11.5px; margin-top: 2px; }
.nav-list { display: grid; gap: 7px; }
.nav-item {
  width: 100%; border: 0; background: transparent; color: #9eacc0;
  display: flex; align-items: center; gap: 12px;
  border-radius: 13px; padding: 12px 13px; cursor: pointer;
  font-size: 14px; font-weight: 630; text-align: left;
  transition: .18s ease;
}
.nav-item svg { width: 20px; height: 20px; flex: 0 0 auto; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #eef3fb; }
.nav-item.active { background: rgba(126, 116, 255, .16); color: #fff; }
.nav-item.active svg { color: #a79fff; }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; }
.sync-pill {
  border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: #aab6c7;
  border-radius: 12px; padding: 9px 11px; display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; cursor: pointer;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #718096; box-shadow: 0 0 0 4px rgba(113,128,150,.12); }
.status-dot.online { background: #48d0a3; box-shadow: 0 0 0 4px rgba(72,208,163,.13); }
.status-dot.syncing { background: #f2b84b; box-shadow: 0 0 0 4px rgba(242,184,75,.13); }
.status-dot.error { background: #ff7781; box-shadow: 0 0 0 4px rgba(255,119,129,.13); }
.profile-card {
  width: 100%; border: 0; background: rgba(255,255,255,.045); color: #f5f7fb;
  border-radius: 15px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 11px; cursor: pointer; text-align: left;
}
.avatar { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: #263650; font-weight: 750; }
.profile-copy { display: grid; min-width: 0; }
.profile-copy strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.profile-copy small { color: #8f9db2; font-size: 10.5px; margin-top: 2px; }

.main-area { grid-column: 2; min-width: 0; }
.topbar {
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 38px 18px;
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
}
.eyebrow { margin: 0 0 5px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.08; letter-spacing: -.035em; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.page-content { max-width: 1440px; margin: 0 auto; padding: 12px 38px 54px; }
.icon-button, .ghost-button, .secondary-button, .primary-button, .danger-button {
  border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; min-height: 42px; padding: 0 16px; font-weight: 700; font-size: 13px; transition: .18s ease;
}
.icon-button { width: 42px; padding: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.icon-button svg, .primary-button svg, .secondary-button svg, .ghost-button svg, .danger-button svg { width: 18px; height: 18px; }
.primary-button { color: white; background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 9px 24px color-mix(in srgb, var(--brand) 27%, transparent); }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.03); }
.secondary-button { color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.ghost-button { color: var(--muted); background: transparent; }
.danger-button { color: #fff; background: var(--red); }
.compact { min-height: 42px; padding-inline: 15px; }

.section-stack { display: grid; gap: 18px; }
.hero-card {
  position: relative; overflow: hidden;
  min-height: 215px; padding: 28px;
  color: white; border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 82% 20%, rgba(255,255,255,.14), transparent 27%),
    radial-gradient(circle at 70% 115%, rgba(109,93,252,.55), transparent 40%),
    linear-gradient(135deg, #111d34 0%, #172845 56%, #30266e 130%);
  box-shadow: var(--shadow-md);
}
.hero-card::after {
  content: ""; position: absolute; right: -50px; bottom: -85px; width: 280px; height: 280px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(255,255,255,.025), 0 0 0 74px rgba(255,255,255,.018);
}
.hero-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; position: relative; z-index: 1; }
.hero-label { color: #aab8cd; font-size: 12px; font-weight: 680; margin-bottom: 8px; }
.hero-value { font-size: clamp(30px, 5.5vw, 48px); font-weight: 790; letter-spacing: -.045em; line-height: 1; }
.hero-delta { display: inline-flex; align-items: center; gap: 6px; margin-top: 13px; font-size: 12px; color: #b8c5d8; }
.hero-delta strong { color: #78e0ba; }
.month-switcher { display: flex; align-items: center; gap: 5px; padding: 4px; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; }
.month-switcher button { width: 34px; height: 34px; border: 0; background: transparent; color: white; cursor: pointer; border-radius: 9px; }
.month-switcher button:hover { background: rgba(255,255,255,.08); }
.month-switcher span { min-width: 108px; text-align: center; font-size: 12px; font-weight: 720; }
.hero-metrics { position: relative; z-index: 1; margin-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.hero-metric { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.07); backdrop-filter: blur(8px); }
.hero-metric small { color: #aab8cd; display: block; font-size: 10px; margin-bottom: 5px; }
.hero-metric strong { font-size: 15px; letter-spacing: -.01em; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kpi-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; }
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-icon.income { color: var(--green); background: var(--green-soft); }
.kpi-icon.expense { color: var(--red); background: var(--red-soft); }
.kpi-icon.invest { color: var(--blue); background: var(--blue-soft); }
.kpi-icon.saving { color: var(--amber); background: var(--amber-soft); }
.kpi-label { color: var(--muted); font-size: 11.5px; font-weight: 650; }
.kpi-value { font-size: 21px; font-weight: 790; margin-top: 13px; letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { margin-top: 6px; color: var(--muted); font-size: 10.5px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .85fr); gap: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-pad { padding: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 20px 20px 0; }
.card-title { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.card-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.card-action { border: 0; background: transparent; color: var(--brand); font-size: 11.5px; font-weight: 750; cursor: pointer; padding: 4px; }

.chart-wrap { padding: 10px 18px 18px; min-height: 250px; }
.chart-svg { width: 100%; height: 225px; overflow: visible; }
.chart-label { fill: var(--muted); font-size: 10px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-income { fill: color-mix(in srgb, var(--green) 76%, transparent); }
.chart-expense { fill: color-mix(in srgb, var(--red) 76%, transparent); }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaGradient); }
.chart-dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2.5; }
.legend { display: flex; gap: 16px; align-items: center; padding: 0 20px 18px; color: var(--muted); font-size: 10.5px; }
.legend-item { display: flex; gap: 6px; align-items: center; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

.donut-layout { display: grid; grid-template-columns: 145px 1fr; gap: 14px; align-items: center; padding: 18px 20px 22px; }
.donut { width: 130px; height: 130px; border-radius: 50%; position: relative; margin: 0 auto; background: conic-gradient(var(--surface-3) 0 100%); }
.donut::after { content: ""; position: absolute; inset: 25px; border-radius: 50%; background: var(--surface); }
.donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font-size: 15px; }
.donut-center small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.category-list { display: grid; gap: 10px; }
.category-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.category-dot { width: 9px; height: 9px; border-radius: 50%; }
.category-name { min-width: 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-value { color: var(--muted); font-size: 10.5px; font-weight: 650; }
.empty-mini { color: var(--muted); font-size: 11px; padding: 18px 0; text-align: center; }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-action { border: 1px solid var(--line); background: var(--surface); border-radius: 15px; padding: 14px 10px; display: grid; place-items: center; gap: 8px; cursor: pointer; box-shadow: var(--shadow-sm); }
.quick-action span:first-child { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.quick-action svg { width: 18px; height: 18px; }
.quick-action strong { font-size: 10.5px; font-weight: 720; }

.list { display: grid; }
.list-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.tx-icon { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; }
.tx-icon svg { width: 18px; height: 18px; }
.tx-icon.income { background: var(--green-soft); color: var(--green); }
.tx-icon.expense { background: var(--red-soft); color: var(--red); }
.tx-icon.investment { background: var(--blue-soft); color: var(--blue); }
.tx-main { min-width: 0; }
.tx-title { font-size: 12px; font-weight: 720; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { color: var(--muted); font-size: 10px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amount { text-align: right; font-size: 12px; font-weight: 780; }
.tx-amount.income { color: var(--green); }
.tx-amount.expense { color: var(--red); }
.tx-amount.investment { color: var(--blue); }
.tx-menu { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 6px; margin-right: -6px; }

.progress-block { padding: 0 20px 20px; }
.progress-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10.5px; margin-bottom: 8px; }
.progress-head strong { color: var(--text); }
.progress-track { height: 9px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .35s ease; }
.progress-bar.danger { background: linear-gradient(90deg, #e36b74, #cf3d4a); }
.progress-bar.green { background: linear-gradient(90deg, #2eb58b, #138c69); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search-box { position: relative; flex: 1 1 280px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--muted); pointer-events: none; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; min-height: 44px; padding: 10px 12px; font-size: 12.5px;
}
.search-box .input { padding-left: 40px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.textarea { min-height: 92px; resize: vertical; }
.filter-select { min-width: 145px; }
.date-group { margin-top: 16px; }
.date-label { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 7px 3px; }
.empty-state { text-align: center; padding: 54px 22px; }
.empty-icon { width: 58px; height: 58px; border-radius: 19px; margin: 0 auto 15px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty-icon svg { width: 25px; height: 25px; }
.empty-state h3 { font-size: 15px; margin: 0 0 7px; }
.empty-state p { max-width: 360px; color: var(--muted); font-size: 11.5px; line-height: 1.55; margin: 0 auto 18px; }

.recurring-grid, .goals-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.recurring-card, .goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.recurring-top, .goal-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.recurring-name, .goal-name { font-size: 13px; font-weight: 750; margin: 0; }
.recurring-meta, .goal-meta { color: var(--muted); font-size: 10px; margin-top: 5px; }
.recurring-amount, .goal-amount { font-size: 20px; font-weight: 790; letter-spacing: -.025em; margin-top: 18px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 5px 8px; font-size: 9px; font-weight: 760; }
.status-badge.paid { color: var(--green); background: var(--green-soft); }
.status-badge.pending { color: var(--amber); background: var(--amber-soft); }
.status-badge.overdue { color: var(--red); background: var(--red-soft); }
.card-footer-actions { display: flex; gap: 8px; margin-top: 16px; }
.card-footer-actions button { flex: 1; min-height: 36px; padding-inline: 9px; font-size: 10.5px; }
.goal-progress { margin-top: 15px; }
.goal-progress .progress-track { height: 8px; }
.goal-stats { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; margin-top: 8px; }
.featured-goal { grid-column: span 2; background: linear-gradient(145deg, #17243b, #25205c); color: #fff; border: 0; }
.featured-goal .goal-meta, .featured-goal .goal-stats { color: #aebbd0; }
.featured-goal .progress-track { background: rgba(255,255,255,.12); }
.featured-goal .progress-bar { background: linear-gradient(90deg, #7e73ff, #a99fff); }

.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.report-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.report-card small { color: var(--muted); font-size: 10px; }
.report-card strong { display: block; font-size: 20px; margin-top: 8px; letter-spacing: -.025em; }
.rank-list { padding: 8px 20px 18px; }
.rank-row { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-number { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 9px; font-weight: 760; }
.rank-name { font-size: 11.5px; font-weight: 650; }
.rank-value { font-size: 11.5px; font-weight: 760; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.settings-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.settings-section.full { grid-column: 1 / -1; }
.settings-title { margin: 0; font-size: 14px; }
.settings-description { color: var(--muted); font-size: 10.5px; line-height: 1.5; margin: 5px 0 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-group { display: grid; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.field-hint { color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.category-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 7px 10px; font-size: 10px; }
.chip button { border: 0; background: transparent; color: var(--muted); padding: 0; cursor: pointer; line-height: 1; }
.setting-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

.bottom-nav { display: none; }
.fab { display: none; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 10, 18, .62); backdrop-filter: blur(4px);
  z-index: 100; display: grid; place-items: center; padding: 20px;
  animation: fadeIn .16s ease;
}
.modal {
  width: min(560px, 100%); max-height: min(92vh, 820px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-md);
  animation: popIn .2s ease;
}
.modal.wide { width: min(700px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 3; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: 18px 20px; display: flex; justify-content: space-between; gap: 15px; align-items: center; }
.modal-header h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.modal-close svg { width: 17px; }
.modal-body { padding: 20px; }
.modal-footer { position: sticky; bottom: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 14px 20px; display: flex; justify-content: flex-end; gap: 9px; }
.type-segment { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; background: var(--surface-3); border-radius: 13px; gap: 4px; }
.type-segment button { min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 730; cursor: pointer; }
.type-segment button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.amount-field { position: relative; }
.amount-field span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; font-weight: 750; }
.amount-field input { min-height: 62px; padding-left: 45px; font-size: 25px; font-weight: 780; letter-spacing: -.025em; }
.voice-button { width: 100%; border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); background: var(--brand-soft); color: var(--brand); border-radius: 12px; min-height: 42px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 10.5px; font-weight: 720; }
.voice-button.listening { animation: pulse 1s infinite; }
.auth-panel { text-align: center; padding: 10px 2px; }
.auth-logo { width: 58px; height: 58px; border-radius: 19px; display: grid; place-items: center; color: white; font-size: 27px; font-weight: 800; margin: 0 auto 16px; background: linear-gradient(145deg, #7a70ff, #4e46d9); }
.auth-panel h2 { margin: 0 0 7px; }
.auth-panel p { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin: 0 auto 18px; max-width: 380px; }
.onboarding-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.onboarding-steps span { width: 28px; height: 5px; border-radius: 99px; background: var(--surface-3); }
.onboarding-steps span.active { background: var(--brand); }

.toast-root { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 250px; max-width: 360px; background: var(--navy); color: white; border-radius: 13px; padding: 12px 14px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 10px; font-size: 11px; animation: toastIn .22s ease; }
.toast.success::before, .toast.error::before, .toast.info::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.toast.success::before { background: #4bd1a5; }
.toast.error::before { background: #ff7884; }
.toast.info::before { background: #8e85ff; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 15%, transparent); } }

@media (max-width: 1120px) {
  :root { --sidebar: 228px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .recurring-grid, .goals-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .featured-goal { grid-column: span 2; }
}

@media (max-width: 820px) {
  body { padding-bottom: calc(74px + var(--safe-bottom)); }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-area { min-height: 100vh; }
  .topbar { padding: calc(18px + var(--safe-top)) 18px 11px; }
  .topbar .eyebrow { display: none; }
  h1 { font-size: 23px; }
  .topbar-actions .primary-button { display: none; }
  .page-content { padding: 8px 14px 34px; }
  .bottom-nav {
    position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(18px); border-top: 1px solid var(--line);
    padding: 7px 5px calc(7px + var(--safe-bottom));
  }
  .bottom-nav .nav-item { display: grid; place-items: center; gap: 3px; padding: 5px 2px; border-radius: 10px; font-size: 9px; color: var(--muted); }
  .bottom-nav .nav-item svg { width: 20px; height: 20px; }
  .bottom-nav .nav-item.active { background: transparent; color: var(--brand); }
  .fab {
    position: fixed; z-index: 70; right: 18px; bottom: calc(82px + var(--safe-bottom));
    display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; border: 0;
    color: white; background: linear-gradient(145deg, var(--brand-2), var(--brand)); box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 36%, transparent); cursor: pointer;
  }
  .fab svg { width: 23px; height: 23px; }
  .hero-card { min-height: 220px; padding: 20px; border-radius: 22px; }
  .hero-value { font-size: 36px; }
  .hero-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); margin-top: 25px; }
  .hero-metric { padding: 10px; }
  .hero-metric strong { font-size: 12.5px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .kpi-card { padding: 15px; }
  .kpi-value { font-size: 17px; }
  .content-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .quick-action { padding: 12px 5px; }
  .donut-layout { grid-template-columns: 130px 1fr; padding-inline: 14px; }
  .recurring-grid, .goals-grid, .report-grid, .settings-grid { grid-template-columns: 1fr; }
  .featured-goal, .settings-section.full { grid-column: auto; }
  .toolbar { align-items: stretch; }
  .search-box { flex-basis: 100%; }
  .filter-select { min-width: 0; flex: 1; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .modal-header { padding-top: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .toast-root { left: 12px; right: 12px; bottom: calc(88px + var(--safe-bottom)); }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 480px) {
  .topbar { padding-inline: 15px; }
  .page-content { padding-inline: 12px; }
  .topbar-actions { gap: 7px; }
  .icon-button { width: 39px; min-height: 39px; }
  .hero-top { display: grid; }
  .month-switcher { width: max-content; }
  .hero-card { min-height: 242px; }
  .hero-metrics { gap: 7px; }
  .hero-metric small { font-size: 8.5px; }
  .hero-metric strong { font-size: 11.5px; }
  .quick-actions { gap: 7px; }
  .quick-action strong { font-size: 9px; }
  .donut-layout { grid-template-columns: 1fr; }
  .category-list { width: 100%; }
  .list-row { padding-inline: 14px; gap: 10px; }
  .card-header { padding-inline: 15px; }
  .rank-list, .progress-block { padding-inline: 15px; }
}

@media print {
  .sidebar, .bottom-nav, .fab, .topbar-actions, .toolbar { display: none !important; }
  .app-shell, .main-area { display: block; }
  .topbar, .page-content { max-width: none; padding-inline: 0; }
  .card, .kpi-card, .report-card { box-shadow: none; break-inside: avoid; }
}
