/* =================================================================
   FinFlow — Personal Finance OS
   styles.css  |  v3.1  |  by Researcher Tizar
   License: MIT  |  https://github.com

   Design system:
   - Dark (default): off-black #0f0f11 base, warm off-white #f0ede8 text
   - Light: warm paper #f7f5f2 base, near-black #1a1916 text
   - Indigo accent: trust, stability, finance psychology
   - Green/Red semantics: income/expense with calibrated contrast
   - Animations: spring physics, reduced-motion respected
================================================================= */

/* ═══════════════════════════════════════════════
   WALLET v3 — DESIGN SYSTEM
   Clean, native-feeling, mobile-first
   All original element IDs preserved for engine
═══════════════════════════════════════════════ */

/* ── TOKENS — DARK MODE (off-black palette) ── */
/*
  Color Psychology applied:
  - Off-black (#0f0f11) vs pure black: reduces eye strain, feels premium not harsh
  - Off-white (#f0ede8) text: warm, readable, less clinical than pure white
  - Indigo accent (#5b52f0): trust, stability, intellect — ideal for finance
  - Green (#21b85a): gain/growth — deeper, more serious than neon green
  - Red (#e5404a): loss/alert — clear but not alarming panic-red
  - Amber (#e8950a): warning — warm, not aggressive
  - Subtle warm tint in bg (#0f0f11 has slight warm undertone) creates coziness
  - Card layering uses perceptible but gentle steps for depth hierarchy
*/
:root {
  /* --- Surface Palette (off-black, warm-tinted dark) --- */
  --bg: #0f0f11;
  /* off-black base — warm undertone, not cold blue-black */
  --bg2: #161618;
  /* sidebar / topbar — one step lighter */
  --bg3: #1e1e22;
  /* inset / recessed areas */
  --card: #222226;
  /* cards — clearly elevated from bg */
  --card2: #2a2a30;
  /* card hover / interactive states */

  /* --- Borders (warm-tinted, not cold grey) --- */
  --bdr: rgba(255, 253, 248, 0.065);
  /* subtle warm border */
  --bdr2: rgba(255, 253, 248, 0.11);
  /* stronger border on hover/focus */

  /* --- Text Hierarchy (off-white, warm) --- */
  --fg: #f0ede8;
  /* primary text — warm off-white, easy on dark bg */
  --fg2: #b0aca6;
  /* secondary text — warm mid-grey */
  --fg3: #6e6b66;
  /* tertiary / labels — warm muted */
  --fg4: #32302e;
  /* barely visible dividers / disabled */

  /* --- Accent — Indigo (trust, stability, finance) --- */
  --accent: #5b52f0;
  /* primary CTA — slightly warmer indigo */
  --accent-h: #7068f5;
  /* hover state */
  --ac2: rgba(91, 82, 240, 0.17);
  /* tinted backgrounds */
  --ac3: rgba(91, 82, 240, 0.08);
  /* very subtle tint */

  /* --- Semantic Colors (finance-calibrated) --- */
  --green: #21b85a;
  /* income/gain — confident green, not neon */
  --green2: rgba(33, 184, 90, 0.15);
  --red: #e5404a;
  /* expense/loss — clear alert, not panic */
  --red2: rgba(229, 64, 74, 0.15);
  --amber: #e8950a;
  /* warning — warm amber, not garish */
  --amber2: rgba(232, 149, 10, 0.15);
  --sky: #1aa3d4;
  /* info/transfer — calmer sky blue */
  --sky2: rgba(26, 163, 212, 0.15);
  --purple: #9d6ef5;
  /* special / tag — softer purple */
  --purple2: rgba(157, 110, 245, 0.15);

  /* --- Backward compat aliases --- */
  --teal: var(--green);
  --teal2: var(--green2);
  --rose: var(--red);
  --rose2: var(--red2);
  --p: var(--accent);
  --p2: var(--ac2);
  --p3: var(--ac3);
  --font-m: var(--font);
  --font-h: var(--font);
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --r: 10px;
  --r2: 14px;
  --r3: 18px;
  --r4: 22px;
  --sh: 0 2px 20px rgba(0, 0, 0, 0.55);
  --sh2: 0 8px 48px rgba(0, 0, 0, 0.75);

  --side-w: 252px;
  --top-h: 56px;
  --nav-h: 60px;
  /* bottom nav */
}

/* ── LIGHT MODE (off-white palette) ── */
/*
  Color Psychology applied:
  - Off-white (#f7f5f2) base: warm, paper-like — reduces clinical coldness
  - #1a1916 text: warm near-black — not harsh pure black on white
  - Cards (#ffffff → #f0ede8): gentle depth without heavy shadows
  - Borders have warm tint to unify the palette
  - Accent shifted slightly warmer for light mode legibility
  - All semantic colors darkened for light bg contrast (WCAG AA+)
*/
body.light {
  /* --- Surface Palette (off-white, warm-tinted) --- */
  --bg: #f7f5f2;
  /* off-white base — warm, like quality paper */
  --bg2: #fefcfa;
  /* sidebar / topbar — barely-white, warm */
  --bg3: #edeae5;
  /* inset / recessed — warm light grey */
  --card: #fefcfa;
  /* cards — pure warm white */
  --card2: #f0ede8;
  /* card hover — warm off-white */

  /* --- Borders (warm-tinted for cohesion) --- */
  --bdr: rgba(28, 24, 18, 0.07);
  /* warm tinted subtle border */
  --bdr2: rgba(28, 24, 18, 0.13);
  /* stronger border */

  /* --- Text Hierarchy (near-black, warm) --- */
  --fg: #1a1916;
  /* primary text — warm near-black (not harsh #000) */
  --fg2: #4a4540;
  /* secondary — warm dark grey */
  --fg3: #8a847c;
  /* tertiary — warm mid grey */
  --fg4: #c8c3bc;
  /* barely visible */

  /* --- Accent — deeper indigo for light bg contrast --- */
  --accent: #3d34c8;
  /* darker indigo for light bg (WCAG AA) */
  --accent-h: #5048d8;
  /* hover */
  --ac2: rgba(61, 52, 200, 0.11);
  --ac3: rgba(61, 52, 200, 0.055);

  /* --- Semantic Colors (darkened for light bg readability) --- */
  --green: #178a42;
  --green2: rgba(23, 138, 66, 0.12);
  /* WCAG AA on white */
  --red: #c8262e;
  --red2: rgba(200, 38, 46, 0.11);
  --amber: #b86d04;
  --amber2: rgba(184, 109, 4, 0.11);
  --sky: #0e7ba8;
  --sky2: rgba(14, 123, 168, 0.11);
  --purple: #7040c8;
  --purple2: rgba(112, 64, 200, 0.11);

  --sh: 0 2px 14px rgba(0, 0, 0, 0.07);
  --sh2: 0 8px 36px rgba(0, 0, 0, 0.12);
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  transition:
    background 0.28s,
    color 0.28s;
}

::-webkit-scrollbar {
  width: 3px;
  height: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bdr2);
  border-radius: 2px;
}

/* ═══════════════════════════════════════
   SHELL LAYOUT
═══════════════════════════════════════ */
#app {
  display: flex;
  height: 100dvh;
  position: relative;
}

/* ── SIDEBAR ── */
#sidebar {
  width: var(--side-w);
  background: var(--bg2);
  border-right: 1px solid var(--bdr);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  z-index: 50;
  transition:
    width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.collapsed {
  width: 0;
}

.sb-brand {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--bdr);
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.sb-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sb-logo:hover {
  transform: scale(1.08) rotate(-5deg);
}

.sb-brand-text h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sb-brand-text p {
  font-size: 11px;
  color: var(--fg3);
  margin-top: 1px;
}

#sidebar nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
}

.nav-sec {
  font-size: 10px;
  font-weight: 700;
  color: var(--fg4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 10px 4px;
  white-space: nowrap;
}

/* .ni is original engine class — keep it, style it beautifully */
.ni {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin: 1px 0;
  border-radius: var(--r);
  color: var(--fg3);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.14s;
  user-select: none;
  white-space: nowrap;
  border: 1px solid transparent;
}

.ni:hover {
  color: var(--fg);
  background: var(--card);
}

.ni.on {
  color: var(--accent-h);
  background: var(--ac2);
  border-color: var(--ac3);
  font-weight: 600;
}

.ni-ic {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.ni.on .ni-ic {
  color: var(--accent-h);
}

.ni-lbl {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ni-badge {
  background: var(--red2);
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9px;
}

.ni-new {
  background: var(--ac2);
  color: var(--accent-h);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 7px;
}

.sb-footer {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--bdr);
  flex-shrink: 0;
}

.sb-storage {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--r);
  background: var(--bg3);
  border: 1px solid var(--bdr);
}

.sb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: dot-pulse 2.5s ease infinite;
}

@keyframes dot-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(33, 184, 90, 0.5);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(33, 184, 90, 0);
  }
}

/* ── MAIN WRAPPER ── */
#mw {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── TOPBAR ── */
#topbar {
  height: var(--top-h);
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
  z-index: 40;
  gap: 10px;
}

.tb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tb-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

/* pg-title & pg-sub — engine sets these */
#pg-title {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#pg-sub {
  display: none;
}

/* engine sets this, we hide it — title is enough */

.tb-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  background: var(--card);
  color: var(--fg2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.14s;
  position: relative;
  flex-shrink: 0;
}

.tb-btn:hover {
  background: var(--card2);
  color: var(--fg);
}

.tb-btn:active {
  transform: scale(0.9);
}

.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg2);
}

/* Month nav */
.month-nav {
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--bdr2);
  border-radius: 9px;
  padding: 2px;
}

.month-nav button {
  background: none;
  border: none;
  color: var(--fg2);
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11px;
  transition: all 0.1s;
}

.month-nav button:hover {
  background: var(--bg3);
  color: var(--fg);
}

#mlbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg2);
  min-width: 96px;
  text-align: center;
  padding: 0 3px;
}

/* Global search */
.gsearch-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.gsearch-wrap i {
  position: absolute;
  left: 10px;
  color: var(--fg3);
  font-size: 12px;
  pointer-events: none;
}

#global-search {
  background: var(--card);
  border: 1px solid var(--bdr2);
  border-radius: 9px;
  padding: 7px 10px 7px 29px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  width: 160px;
  outline: none;
  transition: all 0.18s;
}

#global-search:focus {
  width: 220px;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ac3);
  background: var(--card2);
}

#global-search::placeholder {
  color: var(--fg3);
}

/* Primary button */
.btn-p {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--accent);
  color: #f0ede8;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-p:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(91, 82, 240, 0.4);
}

.btn-p:active {
  transform: scale(0.96);
  box-shadow: none;
}

.btn-p:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-p.sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
}

/* ── BANNERS ── */
#offline-banner,
#install-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

#offline-banner {
  background: var(--amber2);
  color: var(--amber);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

#install-banner {
  background: var(--ac2);
  border-bottom: 1px solid var(--ac3);
}

#offline-banner.show,
#install-banner.show {
  display: flex;
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ── CONTENT ── */
#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}

/* ── VIEWS ── */
.view {
  padding: 20px;
  display: none;
  min-height: 100%;
}

.view.active {
  display: block;
  animation: view-in 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════
   MOBILE BOTTOM NAV
═══════════════════════════════════════ */
#bottom-nav {
  display: none;
  /* toggled by media query */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--bdr);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#bottom-nav .bn-row {
  display: flex;
  align-items: stretch;
  height: var(--nav-h);
}

/* .bn-item — engine class, keep it */
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--fg3);
  transition: color 0.14s;
  padding: 4px 2px;
  border: none;
  background: none;
  font-family: var(--font);
}

.bn-item i {
  font-size: 20px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bn-item span {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.bn-item.on {
  color: var(--accent-h);
}

.bn-item.on i {
  transform: scale(1.12);
}

/* Center add button */
.bn-item.bn-add {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.bn-add-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: #f0ede8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(91, 82, 240, 0.5);
  transition:
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.18s;
}

.bn-add-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(91, 82, 240, 0.65);
}

.bn-add-circle:active {
  transform: scale(0.9) !important;
}

/* Mobile sidebar overlay */
#sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

#sb-overlay.show {
  display: block;
}

/* Mobile more menu */
#mobile-more-menu {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  right: 10px;
  background: var(--card2);
  border: 1px solid var(--bdr2);
  border-radius: var(--r3);
  padding: 6px;
  box-shadow: var(--sh2);
  z-index: 200;
  display: none;
  min-width: 200px;
}

#mobile-more-menu.show {
  display: block;
  animation: more-pop 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes more-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.mm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg2);
  transition: background 0.1s;
}

.mm-item:hover,
.mm-item:active {
  background: var(--bdr);
  color: var(--fg);
}

.mm-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: var(--accent-h);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   CARDS & GRID
═══════════════════════════════════════ */
.cd {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  padding: 16px 18px;
  transition: border-color 0.18s;
}

.cd:hover {
  border-color: var(--bdr2);
}

.cd-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.cd-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.g3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.g4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.g-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.fr {
  display: flex;
  align-items: center;
}

.fb {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap8 {
  gap: 8px;
}

/* ═══════════════════════════════════════
   STAT CARDS (engine creates these)
═══════════════════════════════════════ */
.sc {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  padding: 14px 16px;
  transition: all 0.18s;
}

.sc:hover {
  border-color: var(--bdr2);
  transform: translateY(-1px);
}

.sc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sc-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sc-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9px;
}

.sc-badge.up {
  background: var(--green2);
  color: var(--green);
}

.sc-badge.dn {
  background: var(--red2);
  color: var(--red);
}

.sc-badge.neu {
  background: var(--ac2);
  color: var(--accent-h);
}

.sc-val {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 3px;
}

.sc-lbl {
  font-size: 11px;
  color: var(--fg3);
  font-weight: 500;
}

/* ═══════════════════════════════════════
   HERO CARD (dashboard)
═══════════════════════════════════════ */
.hero-wrap {
  background: linear-gradient(135deg, #3d34c8 0%, #6b40e0 55%, #8b52e8 100%);
  border-radius: var(--r3);
  padding: 22px 20px 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  color: #f0ede8;
}

.hero-wrap::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.hero-wrap::after {
  content: "";
  position: absolute;
  bottom: -70px;
  left: -30px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.hero-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
  margin-bottom: 5px;
  position: relative;
  z-index: 1;
}

/* nw-val — engine sets this */
#nw-val {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}

#nw-val.pos {
  /* white on gradient */
}

#nw-val.neg {
  /* still white, engine will prefix minus */
}

.hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(240, 237, 232, 0.16);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* nw-delta — engine sets innerHTML here */
#nw-delta {
  /* styled as hero-pill by engine output - we just show it inline */
}

.month-delta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.month-delta.up {
  color: var(--green);
}

.month-delta.dn {
  color: var(--red);
}

/* ═══════════════════════════════════════
   QUICK ACTIONS (dashboard)
═══════════════════════════════════════ */
.quick-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.qb {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-radius: var(--r2);
  border: 1px solid var(--bdr2);
  background: var(--card);
  color: var(--fg2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
}

.qb:hover {
  color: var(--fg);
  background: var(--card2);
  border-color: var(--bdr2);
  transform: translateY(-1px);
}

.qb:active {
  transform: scale(0.96);
}

.qb.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.qb.primary:hover {
  background: var(--accent-h);
}

/* ═══════════════════════════════════════
   DASHBOARD MOBILE MONTH NAV
   (engine calls updateMobileMonthLabels — uses mobile-mlbl / mobile-mlbl-tx)
═══════════════════════════════════════ */
.mobile-month-nav {
  display: none;
  /* shown on mobile via media query */
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--bdr2);
  border-radius: var(--r2);
  padding: 6px 8px;
  margin-bottom: 12px;
}

.mobile-month-nav button {
  background: none;
  border: none;
  color: var(--fg2);
  cursor: pointer;
  padding: 7px 14px;
  border-radius: var(--r);
  font-size: 14px;
  transition: background 0.1s;
}

.mobile-month-nav button:active {
  background: var(--bg3);
}

/* ═══════════════════════════════════════
   TRANSACTION ROW (engine renders these)
═══════════════════════════════════════ */
.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--bdr);
}

.tx-item:last-child {
  border-bottom: none;
}

.tx-cat-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.tx-info {
  flex: 1;
  min-width: 0;
}

.tx-desc {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  font-size: 11px;
  color: var(--fg3);
  margin-top: 2px;
}

.tx-amount {
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.tx-inc {
  color: var(--green);
  font-weight: 700;
}

.tx-exp {
  color: var(--red);
  font-weight: 700;
}

.tx-trf {
  color: var(--accent-h);
  font-weight: 700;
}

/* ═══════════════════════════════════════
   ACCOUNT CARD
═══════════════════════════════════════ */
.acc-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}

.acc-card:hover {
  border-color: var(--bdr2);
  box-shadow: var(--sh);
  transform: translateY(-2px);
}

.acc-card:active {
  transform: scale(0.98);
}

.acc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.acc-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.acc-menu {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.acc-card:hover .acc-menu {
  opacity: 1;
}

.acc-bal {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.acc-name {
  font-size: 14px;
  font-weight: 700;
  margin-top: 6px;
}

.acc-type {
  font-size: 11px;
  color: var(--fg3);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════
   GOAL / BUDGET / RECURRING CARDS
═══════════════════════════════════════ */
.goal-card,
.bud-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  padding: 16px;
  transition: all 0.18s;
}

.goal-card:hover,
.bud-card:hover {
  border-color: var(--bdr2);
}

.rc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r2);
  border: 1px solid var(--bdr);
  background: var(--card);
  margin-bottom: 8px;
  transition: border-color 0.15s;
}

.rc-item:hover {
  border-color: var(--bdr2);
}

/* ═══════════════════════════════════════
   PROGRESS
═══════════════════════════════════════ */
.prog {
  background: var(--bg3);
  border-radius: 10px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ═══════════════════════════════════════
   FORMS — engine creates modals with these
═══════════════════════════════════════ */
.fg-row {
  margin-bottom: 14px;
}

.fg-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg2);
  margin-bottom: 5px;
}

input,
select,
textarea {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--bdr2);
  border-radius: var(--r);
  padding: 11px 13px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  /* prevents iOS zoom */
  outline: none;
  transition:
    border-color 0.16s,
    box-shadow 0.16s,
    background 0.16s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ac3);
  background: var(--card);
}

input::placeholder,
textarea::placeholder {
  color: var(--fg3);
}

textarea {
  resize: vertical;
  min-height: 72px;
}

input.err,
select.err {
  border-color: var(--red);
}

.err-msg {
  font-size: 11px;
  color: var(--red);
  margin-top: 4px;
  display: none;
}

.err-msg.vis {
  display: block;
}

.frow2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.frow3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 9px;
}

.amt-wrap {
  position: relative;
}

.amt-prefix {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 700;
  color: var(--fg3);
  pointer-events: none;
}

.amt-wrap input {
  padding-left: 28px;
  font-size: 20px;
  font-weight: 700;
}

/* Type toggle (expense/income/transfer) */
.type-toggle {
  display: flex;
  gap: 5px;
  margin-bottom: 16px;
  background: var(--bg3);
  border-radius: var(--r2);
  padding: 4px;
}

.tt-btn {
  flex: 1;
  padding: 10px 6px;
  border-radius: var(--r);
  border: none;
  background: none;
  color: var(--fg3);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tt-btn.on.expense {
  background: var(--card);
  color: var(--red);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tt-btn.on.income {
  background: var(--card);
  color: var(--green);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tt-btn.on.transfer {
  background: var(--card);
  color: var(--accent-h);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--bdr2);
  background: var(--card2);
  color: var(--fg2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
}

.btn:hover {
  color: var(--fg);
  background: var(--card);
  border-color: var(--bdr2);
}

.btn:active {
  transform: scale(0.96);
}

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

.btn.xs {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 7px;
}

.btn.danger {
  color: var(--red);
  border-color: var(--red2);
}

.btn.danger:hover {
  background: var(--red2);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  color: var(--fg3);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.14s;
}

.btn-ghost:hover {
  color: var(--fg);
  background: var(--card);
}

.btn-ghost.sm {
  padding: 5px 9px;
  font-size: 12px;
}

/* ═══════════════════════════════════════
   MODALS — engine uses .mo and .mo.vis
═══════════════════════════════════════ */
.mo {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mo.vis {
  display: flex;
  animation: mo-in 0.2s ease;
}

@keyframes mo-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.mo-box {
  background: var(--card);
  border: 1px solid var(--bdr2);
  border-radius: var(--r4);
  width: 100%;
  max-width: 490px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--sh2);
  animation: mo-slide 0.26s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes mo-slide {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Drag handle */
.mo-box::before {
  content: "";
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--fg4);
  margin: 10px auto 0;
}

.mo-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--bdr);
}

.mo-hd h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mo-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg3);
  color: var(--fg3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.14s;
}

.mo-close:hover {
  background: var(--card2);
  color: var(--fg);
}

.mo-body {
  padding: 15px 18px;
}

.mo-ft {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 18px;
  border-top: 1px solid var(--bdr);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.mo-box.wide {
  max-width: 620px;
}

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
#toasts {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: var(--r2);
  background: var(--card2);
  border: 1px solid var(--bdr2);
  font-size: 13px;
  font-weight: 500;
  max-width: 300px;
  box-shadow: var(--sh2);
  pointer-events: auto;
  cursor: pointer;
  animation: toast-in 0.28s cubic-bezier(0.25, 1, 0.5, 1);
}

.toast.ok {
  border-color: rgba(34, 197, 94, 0.3);
}

.toast.err {
  border-color: rgba(239, 68, 68, 0.3);
}

.toast.wrn {
  border-color: rgba(245, 158, 11, 0.3);
}

.toast.inf {
  border-color: rgba(79, 70, 229, 0.3);
}

.toast i {
  font-size: 13px;
  flex-shrink: 0;
}

.toast.ok i {
  color: var(--green);
}

.toast.err i {
  color: var(--red);
}

.toast.wrn i {
  color: var(--amber);
}

.toast.inf i {
  color: var(--accent-h);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(14px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════ */
.emp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  gap: 12px;
}

.emp-ic {
  width: 60px;
  height: 60px;
  border-radius: var(--r3);
  background: var(--ac3);
  border: 1px solid var(--ac2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent-h);
  margin-bottom: 4px;
}

.emp h3 {
  font-size: 17px;
  font-weight: 700;
}

.emp p {
  font-size: 13px;
  color: var(--fg3);
  max-width: 260px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════
   TABLE
═══════════════════════════════════════ */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-size: 10px;
  font-weight: 700;
  color: var(--fg3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 13px;
  text-align: left;
  border-bottom: 1px solid var(--bdr);
  white-space: nowrap;
}

td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--bdr);
  font-size: 13px;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--card2);
}

.td-mono {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════
   FILTER BAR (transactions)
═══════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 7px;
  align-items: center;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  width: auto;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--bdr2);
}

.filter-bar input {
  flex: 1;
  min-width: 110px;
}

/* ═══════════════════════════════════════
   TABS (reports)
═══════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--bg3);
  border-radius: var(--r2);
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 1;
  padding: 7px 11px;
  border-radius: var(--r);
  border: none;
  background: none;
  color: var(--fg3);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn.on {
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.tab-pane {
  display: none;
}

.tab-pane.on {
  display: block;
}

/* ═══════════════════════════════════════
   CHART CONTAINERS
═══════════════════════════════════════ */
.chart-wrap {
  position: relative;
  height: 200px;
}

.chart-wrap canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

.chart-wrap-tall {
  position: relative;
  height: 240px;
}

.chart-wrap-tall canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ═══════════════════════════════════════
   CATEGORY CHIP
═══════════════════════════════════════ */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--ac2);
  color: var(--accent-h);
  font-size: 10px;
  font-weight: 600;
  margin: 1px;
}

/* ═══════════════════════════════════════
   TOGGLE SWITCH
═══════════════════════════════════════ */
.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--bdr2);
  cursor: pointer;
  transition: 0.24s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ═══════════════════════════════════════
   COLOR PICKER & ICON GRID
═══════════════════════════════════════ */
.cpk {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 4px 0;
}

.cpk button {
  transition: transform 0.12s;
}

.cpk button:hover {
  transform: scale(1.12);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  max-height: 176px;
  overflow-y: auto;
}

.icon-btn {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--bdr2);
  background: var(--bg3);
  color: var(--fg3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.12s;
}

.icon-btn:hover {
  color: var(--fg);
  background: var(--card2);
}

.icon-btn.sel {
  background: var(--ac2);
  color: var(--accent-h);
  border-color: var(--accent);
}

/* ═══════════════════════════════════════
   INSIGHTS
═══════════════════════════════════════ */
.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  transition: all 0.18s;
  margin-bottom: 9px;
}

.insight-card:hover {
  border-color: var(--bdr2);
}

.insight-ic {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.insight-card h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.insight-card p {
  font-size: 12px;
  color: var(--fg2);
  line-height: 1.55;
}

/* ═══════════════════════════════════════
   SETTINGS
═══════════════════════════════════════ */
.set-sec {
  margin-bottom: 24px;
}

.set-sec-hd {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 2px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--bdr);
  background: var(--card);
  margin-bottom: 2px;
  gap: 10px;
  transition: background 0.12s;
}

.set-row:first-of-type {
  border-radius: var(--r2) var(--r2) 0 0;
}

.set-row:last-of-type {
  border-radius: 0 0 var(--r2) var(--r2);
}

.set-row:only-of-type {
  border-radius: var(--r2);
}

.set-row:hover {
  background: var(--card2);
}

.set-row-info {
  flex: 1;
  min-width: 0;
}

.set-row-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.set-row-info p {
  font-size: 12px;
  color: var(--fg3);
}

/* ═══════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════ */
.sec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.sec-hd h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════
   KBD
═══════════════════════════════════════ */
.kbd {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kbd kbd {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  background: var(--bg3);
  border: 1px solid var(--bdr2);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--fg2);
}

/* ═══════════════════════════════════════
   SEARCH RESULTS
═══════════════════════════════════════ */
.search-results {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--bdr2);
  border-radius: var(--r2);
  box-shadow: var(--sh2);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
}

.sr-item {
  padding: 10px 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--bdr);
  transition: background 0.1s;
}

.sr-item:last-child {
  border-bottom: none;
}

.sr-item:hover {
  background: var(--card2);
}

.sr-item .sr-main {
  font-size: 13px;
  font-weight: 600;
}

.sr-item .sr-sub {
  font-size: 11px;
  color: var(--fg3);
  margin-top: 2px;
}

/* ═══════════════════════════════════════
   PRINT
═══════════════════════════════════════ */
@media print {
  #sidebar,
  #topbar,
  #toasts,
  .mo,
  #offline-banner,
  #install-banner,
  #bottom-nav {
    display: none !important;
  }

  #content {
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  body {
    overflow: visible;
  }
}

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
═══════════════════════════════════════ */
@media (max-width: 768px) {
  /* Hide desktop sidebar */
  #sidebar {
    display: none !important;
  }

  /* Mobile sidebar drawer */
  #sidebar.mobile-open {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px !important;
    z-index: 300;
    box-shadow: 6px 0 40px rgba(0, 0, 0, 0.7);
    animation: sb-in 0.26s cubic-bezier(0.25, 1, 0.5, 1);
  }

  @keyframes sb-in {
    from {
      transform: translateX(-100%);
    }

    to {
      transform: none;
    }
  }

  /* Show bottom nav */
  #bottom-nav {
    display: block;
  }

  /* Content bottom pad */
  #content {
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }

  /* Topbar mobile */
  #topbar {
    height: 50px;
    padding: 0 13px;
  }

  .month-nav {
    display: none !important;
  }

  .gsearch-wrap {
    display: none !important;
  }

  /* Show only key topbar icons */

  /* View padding */
  .view {
    padding: 12px 13px 8px;
  }

  /* Mobile month nav visible */
  .mobile-month-nav {
    display: flex !important;
  }

  /* Grids stack */
  .g4,
  .g3,
  .g2,
  .g-auto {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #stats-grid.g4 {
    grid-template-columns: 1fr 1fr !important;
    gap: 9px;
  }

  /* Hero */
  .hero-wrap {
    padding: 18px 16px 16px;
  }

  #nw-val {
    font-size: 32px;
  }

  /* Quick btns scroll horizontal */
  .quick-btns {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 4px;
  }

  .quick-btns::-webkit-scrollbar {
    display: none;
  }

  .qb {
    flex-shrink: 0;
    padding: 9px 12px;
  }

  /* Modals — bottom sheet */
  .mo {
    padding: 0;
    align-items: flex-end;
  }

  .mo-box {
    max-width: 100% !important;
    width: 100%;
    border-radius: var(--r4) var(--r4) 0 0;
    max-height: 93dvh;
  }

  .mo-ft {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  /* Table scroll */
  .tbl-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 480px;
  }

  /* Filters scroll */
  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    padding-bottom: 8px;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-bar select,
  .filter-bar input {
    flex-shrink: 0;
  }

  /* Tabs scroll */
  .tab-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  /* Toasts above nav */
  #toasts {
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
    right: 10px;
    left: 10px;
  }

  .toast {
    max-width: 100%;
  }

  /* Always show acc menu on mobile */
  .acc-menu {
    opacity: 1 !important;
  }

  /* Frow stacking */
  .frow3 {
    grid-template-columns: 1fr 1fr;
  }

  /* Settings rows */
  .set-row {
    padding: 13px 12px;
  }
}

/* ═══════════════════════════════════════
   TABLET (769–1024)
═══════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  #sidebar {
    width: 70px;
  }

  #sidebar .sb-brand-text,
  #sidebar .nav-sec,
  #sidebar .ni-lbl,
  #sidebar .ni-badge,
  #sidebar .ni-new,
  #sidebar .sb-footer {
    display: none;
  }

  #sidebar .sb-brand {
    justify-content: center;
    padding: 18px 14px;
  }

  #sidebar .ni {
    justify-content: center;
    padding: 11px;
  }

  .g4 {
    grid-template-columns: 1fr 1fr;
  }

  .g3 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ═══════════════════════════════════════
   DESKTOP (>1024)
═══════════════════════════════════════ */
@media (min-width: 1025px) {
  .mobile-month-nav {
    display: none !important;
  }

  #bottom-nav {
    display: none !important;
  }

  #sidebar {
    display: flex !important;
  }

  #stats-grid.g4 {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .g4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .g3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .g2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ═══════════════════════════════════════
   ANIMATIONS (prefers motion)
═══════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .cd,
  .sc,
  .acc-card,
  .goal-card,
  .bud-card,
  .insight-card,
  .rc-item {
    transition:
      border-color 0.18s,
      box-shadow 0.18s,
      transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .ni.on {
    animation: nav-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  @keyframes nav-pop {
    from {
      transform: scale(0.95);
      opacity: 0.7;
    }

    to {
      transform: none;
      opacity: 1;
    }
  }

  .bn-item.on i {
    animation: icon-bounce 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  @keyframes icon-bounce {
    from {
      transform: scale(0.7);
    }

    to {
      transform: scale(1.12);
    }
  }

  .prog-fill {
    transition: width 0.65s cubic-bezier(0.25, 1, 0.5, 1);
  }
}

/* ═══════════════════════════════════════
   ACCESSIBILITY
═══════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════
   MISC
═══════════════════════════════════════ */
.divider {
  border: none;
  border-top: 1px solid var(--bdr);
  margin: 12px 0;
}

.nw-number {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

/* Goal card */
.goal-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  padding: 16px;
  transition: all 0.18s;
}

.goal-card:hover {
  border-color: var(--bdr2);
}

/* ═══════════════════════════════════════════════
   TUTORIAL / ONBOARDING OVERLAY
═══════════════════════════════════════════════ */
#tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#tutorial-overlay.hidden {
  display: none;
}

.tutorial-card {
  background: var(--card);
  border: 1px solid var(--bdr2);
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  position: relative;
}

.tut-progress {
  height: 3px;
  background: var(--bg3);
  border-radius: 3px;
  margin: 16px 20px 0;
}

.tut-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-h));
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.tut-step {
  padding: 20px 24px 24px;
  display: none;
  animation: tut-fade 0.3s ease;
}

.tut-step.active {
  display: block;
}

@keyframes tut-fade {
  from {
    opacity: 0;
    transform: translateX(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.tut-emoji {
  font-size: 52px;
  text-align: center;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  display: block;
}

.tut-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 8px;
}

.tut-body {
  font-size: 15px;
  color: var(--fg2);
  text-align: center;
  line-height: 1.65;
  margin-bottom: 20px;
}

.tut-highlight {
  display: inline-block;
  background: var(--ac2);
  color: var(--accent-h);
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 700;
  font-size: 13px;
}

.tut-items {
  list-style: none;
  text-align: left;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tut-items li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14px;
  color: var(--fg2);
  line-height: 1.5;
}

.tut-items li .tut-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.tut-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--bdr);
  background: var(--bg3);
}

.tut-dots {
  display: flex;
  gap: 6px;
}

.tut-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bdr2);
  transition: all 0.2s;
}

.tut-dot.on {
  background: var(--accent-h);
  width: 20px;
  border-radius: 4px;
}

.tut-skip {
  background: none;
  border: none;
  color: var(--fg3);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.14s;
}

.tut-skip:hover {
  color: var(--fg);
}

.tut-next {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.16s;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tut-next:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
}

.tut-next:active {
  transform: scale(0.96);
}

/* ═══════════════════════════════════════════════
   CREDITS FOOTER (in About section)
═══════════════════════════════════════════════ */
.credits-card {
  background: linear-gradient(135deg, var(--ac3), transparent);
  border: 1px solid var(--ac2);
  border-radius: var(--r2);
  padding: 18px 20px;
  margin-top: 12px;
}

.credits-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ac2);
  color: var(--accent-h);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.credits-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-h), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.credits-role {
  font-size: 13px;
  color: var(--fg3);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════
   SCROLLABILITY FIXES
═══════════════════════════════════════════════ */
/* Ensure all views are properly scrollable */
#content {
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* Prevent content from being cut off by bottom nav on mobile */
@media (max-width: 768px) {
  .view {
    padding-bottom: calc(24px + var(--nav-h) + env(safe-area-inset-bottom));
  }
}

/* Modal body scrollable */
.mo-box {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mo-body {
  overflow-y: auto;
}

/* ═══════════════════════════════════════════════
   UX POLISH — DIGITAL WALLET INSPIRED
   (Apple Pay / Google Pay / Revolut patterns)
═══════════════════════════════════════════════ */

/* Spending Health Meter */
.health-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border-radius: var(--r2);
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--bdr);
}

.health-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg3);
}

.health-val {
  font-size: 15px;
  font-weight: 800;
}

/* Transaction group headers */
.tx-date-group {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 12px 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-date-group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bdr);
}

/* Wallet card shimmer (hover) */
.acc-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 30%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  transform: skewX(-15deg);
  transition: left 0.6s ease;
  pointer-events: none;
}

.acc-card:hover::before {
  left: 130%;
}

/* Savings rate ring color */
.rate-good {
  color: var(--green);
}

.rate-ok {
  color: var(--amber);
}

.rate-poor {
  color: var(--red);
}

/* Dashboard hero month indicator */
.hero-month-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(240, 237, 232, 0.14);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Quick amount chips for common amounts */
.amount-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.amount-chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg3);
  border: 1px solid var(--bdr2);
  color: var(--fg2);
  cursor: pointer;
  transition: all 0.14s;
}

.amount-chip:hover {
  background: var(--ac2);
  color: var(--accent-h);
  border-color: var(--accent);
}

.amount-chip:active {
  transform: scale(0.94);
}

/* Notification dot pulse */
@keyframes notif-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(229, 64, 74, 0.6);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(229, 64, 74, 0);
  }
}

.notif-dot {
  animation: notif-pulse 2s ease infinite;
}

/* Budget warning bar stripe */
@keyframes stripe-move {
  to {
    background-position: 30px 0;
  }
}

.prog-fill.warning {
  background: repeating-linear-gradient(
    45deg,
    var(--amber),
    var(--amber) 8px,
    rgba(0, 0, 0, 0.15) 8px,
    rgba(0, 0, 0, 0.15) 16px
  );
  background-size: 30px 100%;
  animation: stripe-move 0.8s linear infinite;
}

.prog-fill.over {
  background: var(--red) !important;
  animation: none;
}

/* Account type badge */
.acc-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Floating action button pulse on first visit */
.bn-add-circle.pulse {
  animation: fab-pulse 1.5s cubic-bezier(0.36, 0, 0.66, -0.56) infinite;
}

@keyframes fab-pulse {
  0%,
  100% {
    box-shadow: 0 4px 20px rgba(91, 82, 240, 0.5);
  }

  50% {
    box-shadow:
      0 4px 40px rgba(91, 82, 240, 0.9),
      0 0 0 8px rgba(91, 82, 240, 0.2);
  }
}

/* Empty state illustrations */
.emp-art {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  margin: 0 auto 16px;
  position: relative;
}

.emp-art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), transparent);
  opacity: 0.15;
}

/* Help tooltip */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.tooltip-wrap .tooltip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card2);
  color: var(--fg);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid var(--bdr2);
  box-shadow: var(--sh);
  z-index: 100;
  pointer-events: none;
}

.tooltip-wrap:hover .tooltip-text {
  display: block;
}

/* Haptic-like press for all buttons */
@media (hover: none) and (pointer: coarse) {
  .btn-p:active {
    transform: scale(0.94) !important;
  }

  .btn:active {
    transform: scale(0.94) !important;
  }

  .qb:active {
    transform: scale(0.94) !important;
  }

  .acc-card:active {
    transform: scale(0.98) !important;
  }

  .bn-item:active {
    opacity: 0.7;
  }
}

/* ═══════════════════════════════════════════════
   CATEGORY PILL IMPROVEMENTS
═══════════════════════════════════════════════ */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════
   IMPROVED TRANSACTION ROWS
═══════════════════════════════════════════════ */
.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bdr);
  transition: all 0.14s;
  cursor: pointer;
}

.tx-item:hover {
  padding-left: 4px;
}

.tx-item:last-child {
  border-bottom: none;
}

.tx-cat-ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.tx-item:hover .tx-cat-ic {
  transform: scale(1.1);
}

/* ═══════════════════════════════════════════════
   INSIGHT CARD IMPROVEMENTS
═══════════════════════════════════════════════ */
.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  transition: all 0.18s;
  margin-bottom: 9px;
  cursor: default;
}

.insight-card:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.insight-ic {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.insight-card h4 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 5px;
}

.insight-card p {
  font-size: 13px;
  color: var(--fg2);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE IMPROVEMENTS
═══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .hero-wrap {
    padding: 16px 15px 15px;
  }

  #nw-val {
    font-size: 28px;
  }

  .hero-pills {
    gap: 6px;
  }

  .hero-pill {
    padding: 4px 9px;
    font-size: 11px;
  }

  .quick-btns .qb {
    padding: 8px 10px;
    font-size: 12px;
    gap: 5px;
  }

  .tut-title {
    font-size: 19px;
  }

  .tut-emoji {
    font-size: 44px;
  }
}

@media (min-width: 1280px) {
  :root {
    --side-w: 268px;
  }

  .view {
    padding: 24px;
  }
}

/* ═══════════════════════════════════════════════
   PRINT STYLES
═══════════════════════════════════════════════ */
@media print {
  #sidebar,
  #topbar,
  #toasts,
  .mo,
  #offline-banner,
  #install-banner,
  #bottom-nav,
  #mobile-more-menu,
  #tutorial-overlay,
  .quick-btns,
  .filter-bar button {
    display: none !important;
  }

  #content {
    overflow: visible !important;
    padding: 0 !important;
  }

  body {
    overflow: visible;
    background: #fff;
    color: #000;
  }

  .cd,
  .sc,
  .acc-card,
  .goal-card,
  .bud-card {
    border: 1px solid #ccc;
  }
}

/* ═══════════════════════════════════════════════
   OFF-COLOR PALETTE REFINEMENTS
   Selection · Scrollbar · Light mode accents
═══════════════════════════════════════════════ */

::selection {
  background: rgba(91, 82, 240, 0.28);
  color: var(--fg);
}

body.light ::selection {
  background: rgba(61, 52, 200, 0.18);
  color: var(--fg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg4);
}

/* Light mode surface overrides — warm paper tones */
body.light #sidebar {
  background: #f2efea;
  border-right-color: rgba(28, 24, 18, 0.09);
}

body.light #topbar {
  background: #fefcfa;
  border-bottom-color: rgba(28, 24, 18, 0.09);
}

body.light #bottom-nav {
  background: rgba(254, 252, 250, 0.92);
  border-top-color: rgba(28, 24, 18, 0.09);
}

body.light #content {
  background: #f7f5f2;
}

body.light .cd,
body.light .sc,
body.light .acc-card,
body.light .goal-card,
body.light .bud-card,
body.light .insight-card,
body.light .rc-item {
  background: #fefcfa;
}

body.light input,
body.light select,
body.light textarea {
  background: #f2efea;
  border-color: rgba(28, 24, 18, 0.15);
  color: #1a1916;
}

body.light input:focus,
body.light select:focus,
body.light textarea:focus {
  background: #fefcfa;
}

body.light input::placeholder,
body.light textarea::placeholder {
  color: #8a847c;
}

body.light .tab-bar {
  background: #edeae5;
}

body.light .tab-btn.on {
  background: #fefcfa;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

body.light .type-toggle {
  background: #edeae5;
}

body.light .tt-btn.on.expense,
body.light .tt-btn.on.income,
body.light .tt-btn.on.transfer {
  background: #fefcfa;
}

body.light .mo {
  background: rgba(26, 25, 22, 0.65);
}

body.light .mo-box {
  background: #fefcfa;
  border-color: rgba(28, 24, 18, 0.1);
}

body.light .toast {
  background: #fefcfa;
  border-color: rgba(28, 24, 18, 0.1);
  color: #1a1916;
}

body.light #mobile-more-menu {
  background: #f7f5f2;
  border-color: rgba(28, 24, 18, 0.1);
}

body.light .tutorial-card {
  background: #fefcfa;
  border-color: rgba(28, 24, 18, 0.1);
}

body.light .tut-nav {
  background: #f2efea;
  border-top-color: rgba(28, 24, 18, 0.09);
}

body.light .search-results {
  background: #fefcfa;
  border-color: rgba(28, 24, 18, 0.1);
}

body.light .month-nav {
  background: #fefcfa;
}

body.light #global-search {
  background: #fefcfa;
  color: #1a1916;
}

body.light #global-search:focus {
  background: #fff;
}

body.light .tb-btn {
  background: #f2efea;
  color: #4a4540;
}

body.light .tb-btn:hover {
  background: #edeae5;
  color: #1a1916;
}

body.light .mo-close {
  background: #f2efea;
}

/* ═══════════════════════════════════════════════
   FINFLOW v3.1 — PRODUCTION ADDITIONS
   Animations · Haptics · Info system · Brand
═══════════════════════════════════════════════ */

/* ── SIDEBAR BRAND UPGRADE ── */
.sb-logo {
  background: linear-gradient(135deg, #5b52f0 0%, #8878f8 100%);
  box-shadow: 0 4px 16px rgba(91, 82, 240, 0.35);
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s;
}

.sb-logo:hover {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 6px 24px rgba(91, 82, 240, 0.5);
}

.sb-brand:hover .sb-brand-text h1 {
  color: var(--accent-h);
}

.sb-dev {
  color: var(--accent-h);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.sb-brand-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: var(--ac2);
  color: var(--accent-h);
  border: 1px solid var(--ac3);
  border-radius: 5px;
  padding: 2px 5px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.sb-brand-text h1 {
  transition: color 0.2s;
}

.sb-brand-text p {
  font-size: 10px;
  color: var(--fg3);
  margin-top: 1px;
}

/* ── INFO BUTTON ── */
.info-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--bdr2);
  background: var(--bg3);
  color: var(--fg3);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.info-btn:hover {
  background: var(--ac2);
  color: var(--accent-h);
  border-color: var(--accent);
  transform: scale(1.15);
}

.info-btn:active {
  transform: scale(0.9);
}

.tb-info-btn {
  color: var(--fg3);
  transition:
    color 0.18s,
    background 0.18s,
    transform 0.18s;
}

.tb-info-btn:hover {
  color: var(--accent-h);
}

.tb-info-btn:active {
  transform: scale(0.9);
}

.sec-hd-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* ── TOPBAR ADD LABEL ── */
.tb-add-label {
}

@media (max-width: 480px) {
  .tb-add-label {
    display: none;
  }
}

/* ── DEPLOY STEPS ── */
.deploy-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bdr);
}

.deploy-step:last-child {
  border-bottom: none;
}

.deploy-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ac2);
  color: var(--accent-h);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deploy-code {
  display: inline-block;
  background: var(--bg);
  color: var(--accent-h);
  border: 1px solid var(--bdr2);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", monospace;
  word-break: break-all;
}

/* ── VIEW INFO MODAL CONTENT ── */
.info-feature-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--bdr);
  font-size: 13px;
  color: var(--fg2);
  line-height: 1.5;
}

.info-feature-row:last-child {
  border-bottom: none;
}

.info-feature-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.info-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--bdr);
}

.info-shortcut-row:last-child {
  border-bottom: none;
}

.info-tip {
  background: var(--ac3);
  border: 1px solid var(--ac2);
  border-radius: var(--r);
  padding: 10px 13px;
  font-size: 13px;
  color: var(--fg2);
  line-height: 1.6;
  margin-top: 12px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.info-tip i {
  color: var(--accent-h);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── DASHBOARD DATE LABEL ── */
#dash-date-label {
  font-size: 12px;
  color: var(--fg3);
  font-weight: 500;
}

/* ══════════════════════════════════════════════
   SMOOTH ANIMATIONS — PRODUCTION GRADE
══════════════════════════════════════════════ */

/* Global transition base */
*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
}

/* Page view transition — spring */
.view {
  animation: view-spring 0.32s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes view-spring {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Stat card stagger entrance */
.sc {
  animation: card-enter 0.36s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.sc:nth-child(1) {
  animation-delay: 0.04s;
}

.sc:nth-child(2) {
  animation-delay: 0.08s;
}

.sc:nth-child(3) {
  animation-delay: 0.12s;
}

.sc:nth-child(4) {
  animation-delay: 0.16s;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Sidebar nav items */
.ni {
  transition:
    background 0.14s,
    color 0.14s,
    transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.14s;
}

.ni.on {
  animation: ni-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ni-pop {
  from {
    transform: scale(0.95);
  }

  to {
    transform: none;
  }
}

/* Card hover lift — all cards */
.cd,
.sc,
.acc-card,
.goal-card,
.bud-card,
.insight-card,
.rc-item {
  transition:
    border-color 0.18s,
    box-shadow 0.2s,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.cd:hover,
.sc:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.acc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.goal-card:hover {
  transform: translateY(-2px);
}

.bud-card:hover {
  transform: translateY(-1px);
}

.insight-card:hover {
  transform: translateX(3px);
  border-color: var(--accent);
}

/* Modal spring entrance */
.mo-box {
  animation: mo-spring 0.3s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes mo-spring {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Bottom nav active */
.bn-item.on i {
  animation: bn-bounce 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bn-bounce {
  from {
    transform: scale(0.7) translateY(4px);
  }

  to {
    transform: none;
  }
}

/* FAB continuous gentle pulse when idle */
.bn-add-circle {
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s;
}

.bn-add-circle:hover {
  transform: scale(1.1) !important;
}

.bn-add-circle:active {
  transform: scale(0.88) !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3) !important;
}

/* Hero card number count-up feel */
#nw-val {
  transition:
    opacity 0.4s,
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

#nw-val.updating {
  opacity: 0;
  transform: translateY(-6px);
}

/* Progress bars */
.prog-fill {
  transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Quick action buttons */
.qb {
  transition:
    background 0.14s,
    color 0.14s,
    border-color 0.14s,
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.18s;
}

.qb:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.qb:active {
  transform: scale(0.94) !important;
  box-shadow: none !important;
}

/* Primary button */
.btn-p {
  transition:
    background 0.14s,
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}

.btn-p:hover {
  transform: translateY(-1px);
}

.btn-p:active {
  transform: scale(0.95) !important;
}

/* All buttons active state (haptic-like) */
@media (pointer: coarse) {
  .btn:active {
    transform: scale(0.93) !important;
    transition: transform 0.08s !important;
  }

  .btn-p:active {
    transform: scale(0.93) !important;
    transition: transform 0.08s !important;
  }

  .qb:active {
    transform: scale(0.93) !important;
    transition: transform 0.08s !important;
  }

  .ni:active {
    transform: scale(0.96) !important;
    transition: transform 0.08s !important;
  }

  .bn-item:not(.bn-add):active {
    opacity: 0.7;
    transition: opacity 0.08s !important;
  }

  .acc-card:active {
    transform: scale(0.97) !important;
    transition: transform 0.08s !important;
  }

  .goal-card:active {
    transform: scale(0.97) !important;
    transition: transform 0.08s !important;
  }

  .tb-btn:active {
    transform: scale(0.88) !important;
    transition: transform 0.08s !important;
  }

  .info-btn:active {
    transform: scale(0.85) !important;
    transition: transform 0.08s !important;
  }
}

/* Input focus spring */
input,
select,
textarea {
  transition:
    border-color 0.18s,
    box-shadow 0.22s cubic-bezier(0.25, 1, 0.5, 1),
    background 0.18s;
}

/* Theme transition */
body {
  transition:
    background 0.32s,
    color 0.32s;
}

/* Toggle switch spring */
.toggle-slider::before {
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s;
}

.toggle input:checked + .toggle-slider::before {
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

/* Toast animation */
.toast {
  animation: toast-slide 0.32s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes toast-slide {
  from {
    opacity: 0;
    transform: translateX(20px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Offline banner */
#offline-banner.show,
#install-banner.show {
  animation: banner-drop 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes banner-drop {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Tutorial entrance */
.tutorial-card {
  animation: tut-enter 0.4s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes tut-enter {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Chart container fade in */
.chart-wrap canvas,
.chart-wrap-tall canvas {
  animation: chart-in 0.5s ease both;
  animation-delay: 0.15s;
}

@keyframes chart-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Notification dot */
.notif-dot {
  animation: notif-pulse 2s ease infinite;
}

@keyframes notif-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0);
  }
}

/* ── RIPPLE ── */
@keyframes ripple-expand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
  animation: ripple-expand 0.55s linear forwards;
  transform: scale(0);
}

/* Account card shimmer */
.acc-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -50%;
  left: -60%;
  width: 30%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  transform: skewX(-15deg);
  transition: left 0.7s ease;
  pointer-events: none;
}

.acc-card:hover::before {
  left: 130%;
}

/* Category grid cards */
.cat-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cat-card:hover {
  transform: translateY(-2px);
  border-color: var(--bdr2);
  box-shadow: var(--sh);
}

/* ── HERO GRADIENT SHIMMER ── */
.hero-wrap {
  background-size: 200% 100%;
  animation: hero-shimmer 8s ease infinite;
}

@keyframes hero-shimmer {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ── MOBILE PRODUCTION IMPROVEMENTS ── */
@media (max-width: 768px) {
  /* Larger touch targets */
  .ni {
    min-height: 46px;
  }

  .set-row {
    min-height: 56px;
  }

  .mm-item {
    min-height: 50px;
  }

  /* Bottom nav shadow */
  #bottom-nav {
    box-shadow:
      0 -1px 0 var(--bdr),
      0 -4px 20px rgba(0, 0, 0, 0.3);
  }

  /* Toasts */
  #toasts {
    bottom: calc(72px + env(safe-area-inset-bottom));
    right: 10px;
    left: 10px;
  }

  .toast {
    max-width: 100%;
  }

  /* Modal body max height for short phones */
  .mo-box {
    max-height: 90dvh;
  }

  .mo-body {
    max-height: 60dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Info btn bigger on mobile */
  .info-btn {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  /* Topbar PG title */
  #pg-title {
    font-size: 16px;
  }

  /* Content scroll */
  #content {
    overscroll-behavior-y: contain;
  }

  /* G2 grid stays 1 col on mobile */
  .g2 {
    grid-template-columns: 1fr !important;
  }

  /* Tutorial */
  .tutorial-card {
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 100%;
  }

  #tutorial-overlay {
    align-items: flex-end;
    padding: 0;
  }
}

/* ── DESKTOP SIDEBAR COLLAPSE ANIMATION ── */
#sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.collapsed {
  width: 0;
  overflow: hidden;
}

/* ── SCROLLBAR POLISH ── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bdr2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg4);
}

/* ── FOCUS RINGS (a11y) ── */
:focus-visible {
  outline: 2px solid var(--accent-h);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ── SELECTION ── */
::selection {
  background: var(--ac2);
  color: var(--accent-h);
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   FINFLOW v3.2 — COMPLETE ENHANCEMENT BLOCK
   Performance · UX · Keyboard nav · Animations · Accessibility
═══════════════════════════════════════════════════════════ */

/* ── Number inputs: hide spinners ── */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* ── Selection ── */
::selection {
  background: var(--ac2);
  color: var(--accent-h);
}
::-moz-selection {
  background: var(--ac2);
  color: var(--accent-h);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--fg4);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--fg3);
}

/* ── Focus ring — keyboard only ── */
:focus-visible {
  outline: 2.5px solid var(--accent-h);
  outline-offset: 2px;
  border-radius: 5px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Tabular numbers everywhere financial ── */
.sc-val,
#nw-val,
.acc-bal,
.tx-amount,
.td-mono,
.amt-wrap input {
  font-variant-numeric: tabular-nums;
}

/* ── Count-up animation for hero balance ── */
@keyframes count-up {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
#nw-val.refreshed {
  animation: count-up 0.3s cubic-bezier(0.25, 1, 0.5, 1) both;
}

/* ── Sidebar logo crisp rendering ── */
.sb-logo svg,
.sb-logo img {
  image-rendering: crisp-edges;
  shape-rendering: geometricPrecision;
}
.sb-logo {
  background: linear-gradient(135deg, #5b52f0 0%, #8b78f8 100%);
  box-shadow: 0 4px 16px rgba(91, 82, 240, 0.38);
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.28s;
}
.sb-logo:hover {
  transform: scale(1.09) rotate(-4deg);
  box-shadow: 0 6px 22px rgba(91, 82, 240, 0.55);
}

/* ── KEYBOARD SHORTCUT PANEL (new overlay) ── */
#kbd-panel {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#kbd-panel.vis {
  display: flex;
  animation: mo-in 0.2s ease;
}
.kbd-panel-box {
  background: var(--card);
  border: 1px solid var(--bdr2);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 85dvh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75);
  padding: 0 0 8px;
}
.kbd-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bdr);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
  border-radius: 20px 20px 0 0;
}
.kbd-panel-hd h3 {
  font-size: 16px;
  font-weight: 700;
}
.kbd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
@media (max-width: 520px) {
  .kbd-grid {
    grid-template-columns: 1fr;
  }
}
.kbd-section {
  padding: 14px 20px;
}
.kbd-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--fg3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kbd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--bdr);
  gap: 8px;
}
.kbd-row:last-child {
  border-bottom: none;
}
.kbd-row-label {
  font-size: 13px;
  color: var(--fg2);
  flex: 1;
}
.kbd-keys {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.kk {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg3);
  border: 1px solid var(--bdr2);
  border-radius: 5px;
  padding: 3px 7px;
  color: var(--fg2);
  min-width: 24px;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 2px 0 var(--bdr2);
}
.kk-or {
  font-size: 10px;
  color: var(--fg3);
  padding: 0 1px;
}

/* ── COMMAND PALETTE ── */
#cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 15vh 20px 20px;
}
#cmd-palette.vis {
  display: flex;
  animation: mo-in 0.15s ease;
}
.cmd-box {
  background: var(--card);
  border: 1px solid var(--bdr2);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bdr);
}
.cmd-input-wrap i {
  color: var(--fg3);
  font-size: 14px;
  flex-shrink: 0;
}
#cmd-input {
  background: none;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  flex: 1;
  padding: 0;
}
#cmd-input::placeholder {
  color: var(--fg3);
}
.cmd-results {
  max-height: 340px;
  overflow-y: auto;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--bdr);
  transition: background 0.1s;
}
.cmd-item:last-child {
  border-bottom: none;
}
.cmd-item:hover,
.cmd-item.selected {
  background: var(--ac3);
}
.cmd-item i {
  width: 18px;
  text-align: center;
  color: var(--accent-h);
  flex-shrink: 0;
}
.cmd-item-label {
  font-size: 14px;
  font-weight: 600;
}
.cmd-item-sub {
  font-size: 12px;
  color: var(--fg3);
  margin-top: 1px;
}
.cmd-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--fg3);
  font-size: 14px;
}
.cmd-hint {
  padding: 8px 16px;
  border-top: 1px solid var(--bdr);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.cmd-hint span {
  font-size: 11px;
  color: var(--fg3);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── QUICK STATS BAR (below hero on mobile) ── */
.quick-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-stats::-webkit-scrollbar {
  display: none;
}
.qs-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: var(--r2);
  padding: 10px 14px;
  flex-shrink: 0;
  min-width: 90px;
  transition: all 0.18s;
}
.qs-pill:hover {
  border-color: var(--bdr2);
  transform: translateY(-1px);
}
.qs-val {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.qs-lbl {
  font-size: 10px;
  color: var(--fg3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ── TRANSACTION ITEM improvements ── */
.tx-item {
  cursor: pointer;
  border-radius: var(--r);
  transition:
    background 0.1s,
    padding-left 0.14s;
}
.tx-item:hover {
  background: var(--card2);
  padding-left: 6px;
}

/* ── MOBILE: Better bottom nav label ── */
.bn-item span {
  letter-spacing: 0.01em;
}

/* ── MODAL: Better animation ── */
@keyframes mo-spring {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
.mo-box {
  animation: mo-spring 0.28s cubic-bezier(0.25, 1, 0.5, 1) both;
}
@media (max-width: 768px) {
  @keyframes mo-spring {
    0% {
      opacity: 0;
      transform: translateY(100%);
    }
    100% {
      opacity: 1;
      transform: none;
    }
  }
}

/* ── PROGRESS fill animation ── */
.prog-fill {
  transition: width 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── EMPTY STATE icon gentle bounce ── */
.emp-ic {
  animation: emp-float 3s ease-in-out infinite;
}
@keyframes emp-float {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: translateY(-5px);
  }
}

/* ── CHART fade in ── */
@keyframes chart-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.chart-wrap canvas,
.chart-wrap-tall canvas {
  animation: chart-in 0.4s ease 0.1s both;
}

/* ── TOAST progress bar ── */
.toast-prog {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 0 0 var(--r2) var(--r2);
  transition: width linear;
}

/* ── Stat card entrance stagger ── */
@keyframes sc-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.sc {
  animation: sc-enter 0.3s cubic-bezier(0.25, 1, 0.5, 1) both;
}
.sc:nth-child(1) {
  animation-delay: 0.04s;
}
.sc:nth-child(2) {
  animation-delay: 0.08s;
}
.sc:nth-child(3) {
  animation-delay: 0.12s;
}
.sc:nth-child(4) {
  animation-delay: 0.16s;
}

/* ── VIEW transition ── */
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.view.active {
  animation: view-in 0.25s cubic-bezier(0.25, 1, 0.5, 1) both;
}

/* ── Touch: haptic-feel press ── */
@media (pointer: coarse) {
  .btn-p:active {
    transform: scale(0.93) !important;
    transition: transform 0.07s !important;
  }
  .btn:active {
    transform: scale(0.93) !important;
    transition: transform 0.07s !important;
  }
  .qb:active {
    transform: scale(0.93) !important;
    transition: transform 0.07s !important;
  }
  .ni:active {
    transform: scale(0.96) !important;
    transition: transform 0.07s !important;
  }
  .bn-item:not(.bn-add):active {
    opacity: 0.65;
    transition: opacity 0.07s !important;
  }
  .acc-card:active {
    transform: scale(0.97) !important;
    transition: transform 0.07s !important;
  }
  .tb-btn:active {
    transform: scale(0.88) !important;
    transition: transform 0.07s !important;
  }
  .info-btn:active {
    transform: scale(0.85) !important;
    transition: transform 0.07s !important;
  }
  .tut-next:active {
    transform: scale(0.93) !important;
  }
}
@media (hover: hover) {
  .acc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh);
  }
  .sc:hover {
    transform: translateY(-1px);
  }
  .goal-card:hover {
    transform: translateY(-1px);
    border-color: var(--bdr2);
  }
  .insight-card:hover {
    transform: translateX(3px);
    border-color: var(--accent);
  }
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* ── Touch-action for perf ── */
.bn-item,
.tb-btn,
.btn-p,
.btn,
.qb,
.ni {
  touch-action: manipulation;
}

/* ── iOS rubber-band prevention ── */
#content {
  overscroll-behavior-y: contain;
}

/* ── Print ── */
@media print {
  #sidebar,
  #topbar,
  #toasts,
  .mo,
  #offline-banner,
  #install-banner,
  #bottom-nav,
  #mobile-more-menu,
  #tutorial-overlay,
  #kbd-panel,
  #cmd-palette,
  .quick-btns,
  .filter-bar button {
    display: none !important;
  }
  #content {
    overflow: visible !important;
    padding: 0 !important;
  }
  body {
    overflow: visible;
    background: #fff;
    color: #000;
  }
}

/* ── LIGHT MODE surface overrides ── */
body.light #sidebar {
  background: #f2efea;
  border-right-color: rgba(28, 24, 18, 0.09);
}
body.light #topbar {
  background: #fefcfa;
  border-bottom-color: rgba(28, 24, 18, 0.09);
}
body.light #bottom-nav {
  background: rgba(254, 252, 250, 0.92);
  border-top-color: rgba(28, 24, 18, 0.09);
}
body.light #content {
  background: #f7f5f2;
}
body.light{
  background: #fefcfa;
}
body.light input,
body.light select,
body.light textarea {
  background: #f2efea;
  color: #1a1916;
  border-color: rgba(28, 24, 18, 0.15);
}
body.light input:focus,
body.light select:focus,
body.light textarea:focus {
  background: #fefcfa;
}
body.light .mo-box {
  background: #fefcfa;
  border-color: rgba(28, 24, 18, 0.1);
}
body.light .toast {
  background: #fefcfa;
  border-color: rgba(28, 24, 18, 0.1);
  color: #1a1916;
}
body.light .tab-bar {
  background: #edeae5;
}
body.light .tab-btn.on {
  background: #fefcfa;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
body.light .type-toggle {
  background: #edeae5;
}
body.light .tt-btn.on {
  background: #fefcfa;
}
body.light .tb-btn {
  background: #ebe8e2;
  color: #4a4540;
}
body.light .tb-btn:hover {
  background: #e0ddd6;
  color: #1a1916;
}
body.light .cmd-box {
  background: #fefcfa;
  border-color: rgba(28, 24, 18, 0.1);
}
body.light .kbd-panel-box {
  background: #fefcfa;
  border-color: rgba(28, 24, 18, 0.1);
}
body.light .kk {
  background: #f2efea;
  border-color: rgba(28, 24, 18, 0.15);
  box-shadow: 0 2px 0 rgba(28, 24, 18, 0.12);
}
body.light #global-search {
  background: #fefcfa;
  color: #1a1916;
  border-color: rgba(28, 24, 18, 0.18);
}
body.light .sb-logo {
  box-shadow: 0 4px 16px rgba(91, 82, 240, 0.22);
}
body.light #mobile-more-menu {
  background: #fefcfa;
  border-color: rgba(28, 24, 18, 0.1);
}
body.light .tutorial-card {
  background: #fefcfa;
}
body.light .tut-nav {
  background: #f2efea;
}

/* ── End of styles.css v3.2 ── */
