/* =========================================================================
   Paisa — Expense Tracker
   Tokens → base → layout → components → responsive → print
   ========================================================================= */

/* ------------------------------ TOKENS ---------------------------------- */
:root {
  /* Dark is the default theme: near-black with a green cast, bright emerald
     accent. Kept deliberately low-chroma so the accent does all the talking. */
  --bg:            #080C0B;
  --bg-2:          #0C1211;
  --surface:       #101715;
  --elev:          #161F1C;
  --accent:        #22C55E;
  --accent-2:      #34D399;
  --text:          #F2F7F5;
  --muted:         #86988F;
  --danger:        #F87171;
  --warning:       #FBBF24;
  --success:       #22C55E;
  --border:        #1D2926;

  --accent-soft:   rgba(34, 197, 94, .15);
  --accent2-soft:  rgba(52, 211, 153, .14);
  --success-soft:  rgba(34, 197, 94, .15);
  --danger-soft:   rgba(248, 113, 113, .14);
  --warn-soft:     rgba(251, 191, 36, .14);
  --hover:         rgba(255, 255, 255, .05);
  --scrim:         rgba(3, 7, 6, .78);
  --glass:         rgba(16, 23, 21, .82);
  --sheen:         rgba(255, 255, 255, .05);
  --track:         rgba(255, 255, 255, .09);

  --hero-bg:       linear-gradient(140deg, #10331F 0%, #0B1D16 48%, #0A1512 100%);
  --hero-border:   rgba(34, 197, 94, .22);
  --hero-glow:     0 22px 50px -26px rgba(34, 197, 94, .60);

  --shadow-sm:     0 1px 2px rgba(0,0,0,.34), 0 2px 8px rgba(0,0,0,.24);
  --shadow:        0 10px 30px rgba(0,0,0,.42);
  --shadow-lg:     0 26px 64px rgba(0,0,0,.60);
  --glow:          0 6px 20px -6px color-mix(in srgb, var(--accent) 60%, transparent);

  --r-card:        18px;
  --r-hero:        22px;
  --r-btn:         12px;
  --r-input:       11px;
  --r-pill:        999px;

  --pad:           14px;
  --gap:           12px;
  --maxw:          1440px;
  --rail:          228px;

  --ease:          cubic-bezier(.22, .61, .36, 1);
  --spring:        cubic-bezier(.34, 1.32, .64, 1);
  --t-fast:        140ms var(--ease);
  --t:             200ms var(--ease);
  --t-slow:        280ms var(--ease);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

[data-theme="light"] {
  --bg:            #F4F8F6;
  --bg-2:          #EDF4F0;
  --surface:       #FFFFFF;
  --elev:          #F7FBF9;
  --accent:        #16A34A;
  --accent-2:      #059669;
  --text:          #0B1A14;
  --muted:         #667B72;
  --danger:        #DC2626;
  --warning:       #D97706;
  --success:       #16A34A;
  --border:        #E4EDE8;

  --accent-soft:   rgba(22, 163, 74, .11);
  --accent2-soft:  rgba(5, 150, 105, .10);
  --success-soft:  rgba(22, 163, 74, .12);
  --danger-soft:   rgba(220, 38, 38, .09);
  --warn-soft:     rgba(217, 119, 6, .13);
  --hover:         rgba(11, 26, 20, .045);
  --scrim:         rgba(11, 26, 20, .38);
  --glass:         rgba(255, 255, 255, .84);
  --sheen:         rgba(11, 26, 20, .022);
  --track:         rgba(11, 26, 20, .08);

  --hero-bg:       linear-gradient(140deg, #E4F5EC 0%, #F0FAF5 55%, #F7FCFA 100%);
  --hero-border:   rgba(22, 163, 74, .16);
  --hero-glow:     0 14px 34px -20px rgba(22, 163, 74, .40);

  --shadow-sm:     0 1px 2px rgba(11,26,20,.05), 0 2px 8px rgba(11,26,20,.05);
  --shadow:        0 6px 22px rgba(11,26,20,.07);
  --shadow-lg:     0 26px 64px rgba(11,26,20,.16);
}

/* ------------------------------ BASE ------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(820px 460px at 8% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 62%),
    radial-gradient(680px 420px at 98% 0%,  color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 58%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition: background-color var(--t), color var(--t);
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--accent); }

.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;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--accent-soft); }

body.privacy .amount { filter: blur(7px); user-select: none; }

/* Motion primitives ------------------------------------------------------ */
@keyframes rise    { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop     { from { opacity: 0; transform: scale(.9); }        to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes flash {
  0%   { box-shadow: 0 0 0 0 var(--accent-soft); }
  40%  { box-shadow: 0 0 0 10px var(--accent-soft); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.view:not([hidden]) > *,
.view:not([hidden]) .dash-col > * { animation: rise 420ms var(--ease) backwards; }
.view:not([hidden]) > *:nth-child(1) { animation-delay: 0ms; }
.view:not([hidden]) > *:nth-child(2) { animation-delay: 45ms; }
.view:not([hidden]) > *:nth-child(3) { animation-delay: 80ms; }
.view:not([hidden]) > *:nth-child(4) { animation-delay: 110ms; }
.view:not([hidden]) > *:nth-child(5) { animation-delay: 135ms; }
.view:not([hidden]) > *:nth-child(n+6) { animation-delay: 155ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
}

/* ------------------------------ LAYOUT ---------------------------------- */
.app-shell { display: flex; min-height: 100%; max-width: var(--maxw); margin: 0 auto; }
.main-col  { flex: 1; min-width: 0; display: flex; flex-direction: column; }

main { padding: 0 var(--pad) 112px; flex: 1; }

.view { display: block; }
.view[hidden] { display: none; }

.page-head { padding: 2px 2px 14px; }
.page-head h1 { font-size: 25px; font-weight: 800; letter-spacing: -.032em; line-height: 1.15; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-actions { margin: 16px 0 6px; display: flex; justify-content: center; }

.dash-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; align-items: start; }
.dash-col { min-width: 0; display: flex; flex-direction: column; }

/* A section that sits directly on the page background, no card chrome */
.block { margin-bottom: var(--gap); }
.block-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px; padding: 0 2px;
}
.block-head h2 {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .12em;
}

/* ------------------------------ SIDEBAR --------------------------------- */
.sidebar {
  display: none;
  width: var(--rail);
  flex-shrink: 0;
  padding: 20px 14px 18px;
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
  flex-direction: column;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 800; color: #fff;
  background: linear-gradient(150deg, var(--accent-2), var(--accent));
  box-shadow: inset 0 1.5px 2px rgba(255,255,255,.45), inset 0 -4px 8px rgba(0,0,0,.25), var(--glow);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-text strong { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.brand-text small { color: var(--muted); font-size: 11px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px;
  border-radius: var(--r-btn);
  color: var(--muted);
  font-weight: 600; font-size: 14px;
  text-align: left; position: relative;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.nav-btn:hover { background: var(--hover); color: var(--text); }
.nav-btn:active { transform: scale(.98); }
.nav-btn.is-active { background: var(--accent-soft); color: var(--accent); }
.nav-btn.is-active::before {
  content: ''; position: absolute; left: -14px; top: 50%; translate: 0 -50%;
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-ico { font-size: 15px; width: 20px; text-align: center; opacity: .95; }

.side-cta { display: flex; flex-direction: column; gap: 7px; }

.side-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.side-stat-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .11em; }
.side-stat-value { font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.side-stat-sub { font-size: 11px; color: var(--muted); }
.side-bar { height: 6px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; margin: 3px 0 1px; }
.side-bar-fill { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width 700ms var(--ease); }
.side-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 10px; }
.side-spark i {
  flex: 1; border-radius: 3px 3px 1px 1px;
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  min-height: 3px; transition: height 600ms var(--ease);
}
.side-spark i:last-child { background: var(--accent); }

.side-foot { margin-top: auto; }
.side-note { color: var(--muted); font-size: 11px; line-height: 1.55; padding: 0 4px; }

/* ------------------------------ TOPBAR ---------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px var(--pad);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(170%) blur(16px);
  -webkit-backdrop-filter: saturate(170%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast);
}
.topbar.is-stuck { border-bottom-color: var(--border); }

.profile-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 3px 6px 3px 3px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  min-width: 0;
  transition: background var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
}
.profile-btn:hover { background: var(--hover); border-color: var(--border); }
.profile-btn:active { transform: scale(.98); }
.profile-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: left; min-width: 0; }
.profile-meta small {
  font-size: 9.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .13em; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-meta strong {
  font-size: 18px; font-weight: 800; letter-spacing: -.028em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.topbar-actions { display: flex; gap: 7px; align-items: center; flex-shrink: 0; }
/* Scoped to .topbar so it outranks `.btn { display: inline-flex }`, which is
   declared later in this file. The bottom-nav FAB covers this on mobile. */
.topbar .topbar-cta { display: none; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  transition: background var(--t-fast), transform var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--elev); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.icon-btn:active { transform: scale(.92); }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ------------------------------ 3D AVATARS ------------------------------ */
.avatar-3d {
  --a1: #34D399; --a2: #059669;
  position: relative;
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; line-height: 1;
  background: linear-gradient(155deg, var(--a1) 8%, var(--a2) 92%);
  box-shadow:
    inset 0 1.5px 2px rgba(255,255,255,.55),
    inset 0 -5px 9px rgba(0,0,0,.32),
    0 4px 10px -3px color-mix(in srgb, var(--a2) 70%, transparent);
  isolation: isolate;
  text-shadow: 0 1px 2px rgba(0,0,0,.28);
  transition: transform var(--t-slow);
}
/* Specular highlight — this is what sells the "3D" read */
.avatar-3d::before {
  content: ''; position: absolute; inset: 7% 17% 48% 17%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,0));
  filter: blur(.5px);
  pointer-events: none;
}
.avatar-3d--lg { width: 38px; height: 38px; font-size: 18px; }
@media (min-width: 900px) { .avatar-3d--lg { width: 44px; height: 44px; font-size: 20px; } }
.profile-btn:hover .avatar-3d { transform: scale(1.06) rotate(-4deg); }

.avatar-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-bottom: 12px; }
.avatar-picker button { padding: 0; border-radius: 50%; display: grid; place-items: center; transition: transform var(--t-fast); }
.avatar-picker button:hover { transform: scale(1.12); }
.avatar-picker button.is-active { outline: 2px solid var(--accent); outline-offset: 3px; }
.avatar-editor {
  border: 1px solid var(--border); border-radius: 15px;
  padding: 13px; margin: 12px 0;
  background: var(--elev);
  animation: rise 240ms var(--ease);
}
.avatar-editor-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--muted); margin-bottom: 11px;
}
.avatar-editor-head strong { color: var(--text); }

/* ------------------------------ BUTTONS --------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 15px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  font-size: 13.5px; font-weight: 650;
  transition: background var(--t-fast), transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn--sm { padding: 6px 12px; font-size: 12.5px; border-radius: var(--r-pill); }
.btn--pill { border-radius: var(--r-pill); }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: #04140B; box-shadow: var(--glow); font-weight: 700; }
[data-theme="light"] .btn--primary { color: #fff; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--income { background: var(--accent); color: #04140B; font-weight: 700; box-shadow: var(--glow); }
[data-theme="light"] .btn--income { color: #fff; }
.btn--income:hover { filter: brightness(1.08); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--elev); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(1.08); }
.btn--danger-ghost { color: var(--danger); background: var(--danger-soft); }
.btn--danger-ghost:hover { filter: brightness(1.12); }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; }
.center { display: flex; justify-content: center; }
.spacer { flex: 1; }

/* ------------------------------ CARDS ----------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 15px;
  margin-bottom: var(--gap);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card--fill { display: flex; flex-direction: column; }
.dash-col > .card:last-child { margin-bottom: 0; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 11px; flex-wrap: wrap;
}
.card-head h2 { font-size: 14.5px; font-weight: 750; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 7px; }
.head-hint { font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.head-tools { display: flex; align-items: center; gap: 8px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin-bottom: 11px; }
.rule { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

.mini-search {
  display: flex; align-items: center; gap: 6px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--elev);
  border: 1px solid var(--border);
  transition: border-color var(--t-fast);
}
.mini-search:focus-within { border-color: var(--accent); }
.mini-search > span { color: var(--muted); font-size: 13px; }
/* Typed selector so it outranks the generic input styles declared later. */
.mini-search input[type="search"] {
  border: none; background: none; box-shadow: none;
  min-height: 32px; padding: 0; font-size: 12.5px; width: 96px; min-width: 0;
}
.mini-search input[type="search"]:focus { outline: none; border: none; box-shadow: none; }

/* ------------------------------ BANNERS --------------------------------- */
.banner {
  display: flex; align-items: flex-start; gap: 11px; flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: var(--gap);
  border-radius: 15px;
  background: var(--accent2-soft);
  border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent);
}
.banner--warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.banner-ico {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 8px;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: color-mix(in srgb, var(--accent-2) 26%, transparent);
}
.banner--warn .banner-ico { background: color-mix(in srgb, var(--warning) 30%, transparent); }
.banner strong { font-size: 13.5px; }
.banner p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.banner > div { flex: 1; min-width: 170px; }
.banner-actions { display: flex; gap: 7px; flex: 0 0 auto; }

/* ------------------------------ HERO ------------------------------------ */
.hero-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; margin-bottom: var(--gap); }

.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-hero);
  padding: 18px 18px 17px;
  background: var(--hero-bg);
  border: 1px solid var(--hero-border);
  box-shadow: var(--hero-glow);
  display: flex; flex-direction: column;
  min-height: 186px;
}
.hero-glyph {
  position: absolute; top: 17px; right: 17px;
  width: 24px; height: 24px; color: var(--accent);
  opacity: .9; pointer-events: none;
}
.hero-glyph svg { width: 100%; height: 100%; display: block; }
.hero-label {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .13em;
}
.hero-amount {
  font-size: clamp(34px, 10vw, 50px);
  font-weight: 800; letter-spacing: -.045em; line-height: 1.04;
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}
.hero-sub { font-size: 12.5px; color: var(--muted); margin-top: 9px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.hero-in { color: var(--accent); font-weight: 650; }
.hero-sub b { color: var(--text); font-weight: 650; }
.hero-budget { margin-top: auto; padding-top: 20px; }
.hero-budget-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: var(--muted); margin-bottom: 8px;
}
.hero-bar { height: 8px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; }
.hero-bar-fill {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 65%, transparent);
  transition: width 800ms var(--ease), background var(--t);
}
.hero.is-warn .hero-bar-fill { background: var(--warning); box-shadow: none; }
.hero.is-over .hero-bar-fill { background: var(--danger); box-shadow: none; }

.stat-rail { display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr; }
.mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 13px 15px;
  display: flex; flex-direction: column; gap: 2px; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), border-color var(--t);
}
.mini:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.mini-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.mini-trend { font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1; }
.mini-trend.up   { color: var(--danger); }
.mini-trend.down { color: var(--accent); }
.mini-value { font-size: 22px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin-top: 3px; }
.mini-sub { font-size: 10.5px; color: var(--muted); }

/* ------------------------------ QUICK ADD ------------------------------- */
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.quick-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  padding: 13px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left; min-width: 0;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  animation: pop 340ms var(--spring) backwards;
  animation-delay: calc(var(--i, 0) * 28ms);
  position: relative; overflow: hidden;
}
.quick-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.quick-card:active { transform: scale(.95); }
.quick-card.is-flash { animation: flash 520ms var(--ease); }
.quick-emoji { font-size: 19px; line-height: 1; transition: transform var(--t-fast); }
.quick-card:hover .quick-emoji { transform: scale(1.14); }
.quick-label {
  font-size: 12.5px; font-weight: 700; letter-spacing: -.015em;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quick-amount {
  font-size: 11px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; margin-top: -3px;
}
.quick-card--add { border-style: dashed; color: var(--muted); align-items: center; justify-content: center; }
.quick-card--add:hover { color: var(--accent); }

/* ------------------------------ CATEGORY LIST --------------------------- */
.cat-list { display: flex; flex-direction: column; }
.cat-row {
  padding: 9px 0 10px;
  animation: rise 280ms var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 22ms);
}
.cat-row + .cat-row { border-top: 1px solid var(--border); }
.cat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.cat-name { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 650; min-width: 0; }
.cat-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-amt { font-size: 13.5px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cat-bar { height: 3px; border-radius: 3px; background: var(--track); overflow: hidden; }
.cat-bar span { display: block; height: 100%; border-radius: 3px; transition: width 750ms var(--ease); }

/* ------------------------------ PROGRESS -------------------------------- */
.prog { margin-bottom: 12px; }
.prog:last-child { margin-bottom: 0; }
.prog-top { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; font-size: 12.5px; margin-bottom: 5px; }
.prog-name { font-weight: 650; display: flex; align-items: center; gap: 6px; min-width: 0; }
.prog-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-val { color: var(--muted); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prog-bar { height: 8px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; }
.prog-fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width 750ms var(--ease), background var(--t); }
.prog.is-warn .prog-fill { background: var(--warning); }
.prog.is-over .prog-fill { background: var(--danger); }
.prog-note { font-size: 11px; color: var(--muted); margin-top: 4px; }
.prog.is-over .prog-note { color: var(--danger); }

.savings-bar { height: 8px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; margin: 9px 0 5px; }
.savings-fill { height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 700ms var(--ease); }

/* ------------------------------ TRANSACTIONS ---------------------------- */
.txn-list { display: flex; flex-direction: column; }
.txn {
  position: relative; border-radius: 12px; overflow: hidden;
  animation: rise 280ms var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 20ms);
}
.txn + .txn .txn-fg { border-top: 1px solid var(--border); }
.txn-bg {
  position: absolute; inset: 0;
  background: var(--danger);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 18px; color: #fff; font-weight: 700; font-size: 12.5px;
}
.txn-fg {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 6px;
  background: var(--surface);
  transition: background var(--t-fast);
}
.txn-fg:hover { background: var(--elev); }
.txn-emoji {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 15px;
  background: color-mix(in srgb, var(--c, var(--accent)) 17%, transparent);
}
.txn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.txn-desc { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.015em; }
.txn-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-amt { font-size: 13.5px; font-weight: 700; white-space: nowrap; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.txn-amt.is-income { color: var(--accent); }
.txn-tools { display: flex; gap: 1px; flex-shrink: 0; opacity: 0; transition: opacity var(--t-fast); }
.txn:hover .txn-tools, .txn:focus-within .txn-tools { opacity: 1; }
.txn-tool {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-size: 12px; color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.txn-tool:hover { background: var(--hover); color: var(--text); transform: scale(1.1); }
.txn-tool.del:hover { color: var(--danger); }
.txn-tool:disabled { opacity: .3; cursor: default; }
.txn-daygroup {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em;
  padding: 14px 6px 5px;
  display: flex; justify-content: space-between;
}
/* Touch devices have no hover, so the row tools must always be reachable */
@media (hover: none) {
  .txn-tools { opacity: .5; }
}

/* ------------------------------ EMPTY STATE ----------------------------- */
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty-emoji { font-size: 30px; display: block; margin-bottom: 7px; opacity: .8; }
.empty strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 3px; }
.empty p { font-size: 12.5px; }

/* ------------------------------ SEGMENTED ------------------------------- */
.seg {
  position: relative;
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.seg-ind {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: 0;
  border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: var(--glow);
  transition: transform 300ms var(--spring), width 300ms var(--spring);
  pointer-events: none; opacity: 0;
}
.seg--ready .seg-ind { opacity: 1; }
.seg-btn {
  position: relative; z-index: 1;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 650; color: var(--muted);
  white-space: nowrap;
  transition: color 200ms var(--ease);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { color: #04140B; }
[data-theme="light"] .seg-btn.is-active { color: #fff; }
/* Fallback if JS never positions the indicator */
.seg:not(.seg--ready) .seg-btn.is-active { background: var(--accent); }

.seg--full { display: flex; width: 100%; margin-bottom: 14px; }
.seg--full .seg-btn { flex: 1; }
.seg--scroll { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: var(--gap); }
.seg--scroll::-webkit-scrollbar { display: none; }
.seg--xs .seg-btn { padding: 5px 10px; font-size: 11.5px; }

/* ------------------------------ CHIPS ----------------------------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chip {
  padding: 5px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--elev);
  font-size: 12px; font-weight: 600; color: var(--muted);
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.chip:active { transform: scale(.94); }

/* ------------------------------ REPORTS --------------------------------- */
.period-nav {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: var(--gap);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 4px;
}
.period-label { font-size: 13px; font-weight: 750; flex: 1; text-align: center; letter-spacing: -.01em; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: var(--gap); }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 15px; padding: 12px 13px;
  display: flex; flex-direction: column; gap: 1px;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.stat:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); transform: translateY(-2px); }
.stat-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.stat-value { font-size: 18px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11px; color: var(--muted); }
.delta { font-weight: 750; }
.delta.up { color: var(--danger); }
.delta.down { color: var(--accent); }

.insight-list { display: flex; flex-direction: column; gap: 8px; }
.insight-list li {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 12.5px; line-height: 1.55; color: var(--muted);
  animation: slideIn 320ms var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.insight-list li strong { color: var(--text); font-weight: 650; }
.insight-ico {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center; font-size: 11px;
  background: var(--accent-soft); color: var(--accent);
}
.insight-ico.warn { background: var(--warn-soft); color: var(--warning); }
.insight-ico.bad  { background: var(--danger-soft); color: var(--danger); }
.insight-ico.good { background: var(--success-soft); color: var(--success); }

.chart-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
.chart-box { position: relative; height: 210px; }
.chart-box--donut { height: 200px; }
.donut-wrap { position: relative; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-total { font-size: 19px; font-weight: 800; letter-spacing: -.03em; display: block; }
.donut-cap { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.chart-fallback { padding: 24px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 13px; margin-top: 12px; }
.legend li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend b { color: var(--text); font-weight: 650; }

.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat-cell {
  border-radius: 11px; padding: 9px 3px; text-align: center;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) calc(var(--i, 0) * 1%), var(--elev));
  transition: transform var(--t-fast);
}
.heat-cell:hover { transform: translateY(-3px); }
.heat-day { font-size: 10px; font-weight: 700; color: var(--muted); }
.heat-val { font-size: 11px; font-weight: 750; margin-top: 2px; }

.meter-list { display: flex; flex-direction: column; gap: 11px; }

/* ------------------------------ FIELDS ---------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 12px; font-weight: 650; color: var(--muted); }
.field--grow { flex: 1 1 180px; }
.field--btn { justify-content: flex-end; }
.field--check { justify-content: center; }
.req { color: var(--danger); }

input[type="text"], input[type="number"], input[type="date"], input[type="search"], select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-input);
  border: 1px solid var(--border);
  background: var(--elev);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  appearance: none; -webkit-appearance: none;
  min-height: 40px;
}
[data-theme="light"] input, [data-theme="light"] select { background: #fff; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: var(--muted); opacity: .75; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}
input[type="color"] { padding: 4px; height: 40px; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.55); cursor: pointer; }
[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }

.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.err { color: var(--danger); font-size: 11px; }
.err:empty { display: none; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }

.amount-input { position: relative; display: flex; align-items: center; }
.amount-sym { position: absolute; left: 14px; font-size: 19px; font-weight: 700; color: var(--muted); pointer-events: none; }
.amount-input input {
  padding-left: 36px; font-size: 25px; font-weight: 800; letter-spacing: -.03em;
  min-height: 56px; font-variant-numeric: tabular-nums;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.emoji-row, .swatch-row { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-row button {
  width: 28px; height: 28px; border-radius: 8px; font-size: 14px;
  background: var(--elev); border: 1px solid var(--border);
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.emoji-row button:hover { transform: scale(1.15); border-color: var(--accent); }
.swatch-row button { width: 21px; height: 21px; border-radius: 50%; border: 2px solid transparent; transition: transform var(--t-fast); }
.swatch-row button:hover { transform: scale(1.2); }

.filters { display: flex; flex-wrap: wrap; gap: 9px; align-items: flex-end; margin-bottom: 4px; }
.filters .field { margin-bottom: 0; min-width: 112px; }
.history-summary { font-size: 12px; color: var(--muted); padding: 9px 2px; border-top: 1px solid var(--border); margin-top: 9px; }

/* ------------------------------ ROW LIST -------------------------------- */
.row-list { display: flex; flex-direction: column; gap: 5px; }
.row-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: border-color var(--t-fast), transform var(--t-fast);
  animation: rise 260ms var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 18ms);
}
.row-item:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.row-item.is-dragging { opacity: .4; }
.row-item.is-dragover { border-color: var(--accent); transform: translateY(2px); }
.row-emoji {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px;
  background: color-mix(in srgb, var(--c, var(--accent)) 17%, transparent);
}
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.28; }
.row-title { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-tools { display: flex; gap: 2px; flex-shrink: 0; align-items: center; }
.row-input { width: 100px; flex-shrink: 0; }
.row-input input { min-height: 34px; padding: 5px 9px; font-size: 13px; text-align: right; }
.badge {
  font-size: 10px; font-weight: 750; padding: 3px 7px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent);
  text-transform: uppercase; letter-spacing: .05em;
}
.badge--off { background: var(--hover); color: var(--muted); }
.badge--income { background: var(--success-soft); color: var(--success); }

/* ------------------------------ DIALOGS --------------------------------- */
.dlg {
  border: none; padding: 0; margin: 0; inset: 0;
  background: transparent;
  max-width: 100%; max-height: 100%;
  width: 100%; height: 100%;
  overflow: visible; color: var(--text);
}
.dlg::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
.dlg-form {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheetIn 300ms var(--spring);
}
@keyframes sheetIn { from { transform: translateY(30px); opacity: .3; } to { transform: none; opacity: 1; } }

.dlg-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 17px 11px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dlg-head::before {
  content: ''; position: absolute; top: 7px; left: 50%; translate: -50% 0;
  width: 34px; height: 4px; border-radius: 4px; background: var(--border);
}
.dlg-head h2 { font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.dlg-body { padding: 17px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.dlg-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 17px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 0 0 24px 24px;
}

/* ------------------------------ TOASTS ---------------------------------- */
.toast-wrap {
  position: fixed;
  left: 50%; translate: -50% 0;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  display: flex; flex-direction: column; gap: 7px;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 13px;
  pointer-events: auto;
  animation: toastIn 300ms var(--spring);
}
.toast.is-out { animation: toastOut 180ms var(--ease) forwards; }
@keyframes toastIn  { from { transform: translateY(18px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(10px) scale(.98); opacity: 0; } }
.toast-msg { flex: 1; min-width: 0; }
.toast-action {
  font-weight: 750; color: var(--accent); font-size: 12.5px;
  padding: 5px 10px; border-radius: 9px;
  transition: background var(--t-fast);
}
.toast-action:hover { background: var(--accent-soft); }
.toast--err { border-color: var(--danger); }

/* ------------------------------ BOTTOM NAV ------------------------------ */
.bottom-nav {
  position: fixed; z-index: 60;
  left: 12px; right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-template-columns: repeat(4, 1fr);
  align-items: center;
  padding: 7px 8px;
  border-radius: 22px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.tab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 2px;
  color: var(--muted);
  border-radius: 13px;
  transition: color var(--t-fast), transform var(--t-fast);
}
.tab-ico { font-size: 17px; line-height: 1.15; transition: transform var(--t-slow); }
.tab-btn small { font-size: 10px; font-weight: 650; }
.tab-btn.is-active { color: var(--accent); }
.tab-btn.is-active .tab-ico { transform: translateY(-1px) scale(1.14); }
.tab-btn:active { transform: scale(.9); }
.tab-btn--fab {
  background: var(--accent); color: #04140B;
  width: 50px; height: 50px; border-radius: 17px;
  justify-self: center; align-self: center; justify-content: center;
  margin-top: -22px;
  box-shadow: 0 8px 22px -4px color-mix(in srgb, var(--accent) 62%, transparent),
              inset 0 1px 1px rgba(255,255,255,.35);
  transition: transform var(--t-slow), filter var(--t-fast);
}
[data-theme="light"] .tab-btn--fab { color: #fff; }
.tab-btn--fab span { font-size: 25px; font-weight: 400; line-height: 1; }
.tab-btn--fab:hover { filter: brightness(1.08); transform: translateY(-2px) rotate(90deg); }
.tab-btn--fab:active { transform: scale(.9) rotate(90deg); }

/* ------------------------------ RESPONSIVE ------------------------------ */
@media (min-width: 420px) {
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 560px) {
  :root { --pad: 18px; --gap: 14px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 700px) {
  .hero-grid { grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); }
  .stat-rail { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 760px) {
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .card--wide { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  :root { --pad: 22px; }
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  main { padding: 0 var(--pad) 44px; }
  .topbar { padding: 18px var(--pad) 12px; }
  .topbar .topbar-cta { display: inline-flex; }
  .page-head h1 { font-size: 29px; }
  .profile-meta strong { font-size: 21px; }
  .chart-box { height: 240px; }
  .hero { padding: 22px; min-height: 200px; }
  .mini-search input { width: 120px; }
  .toast-wrap { bottom: 22px; left: auto; right: 22px; translate: none; }

  /* Note: only target [open]. A bare `.dlg { display:grid }` would beat the
     UA's `dialog:not([open]) { display:none }` and leak closed dialogs. */
  .dlg[open] { display: grid; place-items: center; }
  .dlg-form {
    position: relative;
    width: min(560px, calc(100vw - 48px));
    max-height: min(88vh, 800px);
    border-radius: 20px;
    border-bottom: 1px solid var(--border);
    animation: popIn 240ms var(--spring);
  }
  .dlg--sm .dlg-form { width: min(430px, calc(100vw - 48px)); }
  .dlg-head::before { display: none; }
  .dlg-foot { border-radius: 0 0 20px 20px; padding-bottom: 12px; }
  @keyframes popIn { from { transform: scale(.94) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}

@media (min-width: 1120px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .stats-grid { grid-template-columns: repeat(6, 1fr); }
  .stat-value { font-size: 17px; }
  .card--fill { height: 100%; }
  .hero-amount { font-size: 48px; }
}

@media (min-width: 1320px) {
  :root { --rail: 244px; }
  .quick-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* ------------------------------ PRINT ----------------------------------- */
@media print {
  :root { --shadow-sm: none; --shadow: none; --glow: none; --hero-glow: none; }
  .sidebar, .bottom-nav, .topbar-actions, .period-nav, .page-actions,
  .toast-wrap, .head-tools, .txn-tools, .btn, .seg, dialog { display: none !important; }
  body { background: #fff; color: #000; background-image: none; }
  .app-shell { display: block; max-width: none; }
  main { padding: 0; }
  .card, .hero, .mini { border: 1px solid #ddd; box-shadow: none; break-inside: avoid; background: #fff; }
  .chart-box { height: 240px; }
  .dash-grid, .hero-grid { grid-template-columns: 1fr 1fr; }
  body.privacy .amount { filter: none; }
  * { animation: none !important; }
}
