/* ═══════════════════════════════════════════════════════════════
   IBuildExpenses — style.css  (v3 · Production)
   Dark-glass design system · Mobile-first · Fully responsive
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────
   0. CSS CUSTOM PROPERTIES (Design Tokens)
───────────────────────────────────────────────────── */
:root {
  /* Colours — overridden by JS theme engine */
  --bg-base:        #12121a;
  --bg-panel:       #1a1b26;
  --bg-card:        #22233a;
  --bg-card2:       #2a2b45;
  --accent:         #f5a623;
  --accent2:        #ff6b6b;
  --accent3:        #43e97b;
  --accent4:        #38f9d7;
  --accent5:        #a78bfa;
  --text-primary:   #f0f0ff;
  --text-secondary: #8a8cad;
  --text-muted:     #4a4c6a;
  --border:         rgba(255,255,255,0.06);
  --shadow:         0 8px 40px rgba(0,0,0,0.5);
  --shadow-lg:      0 16px 56px rgba(0,0,0,0.6);
  --sidebar-bg:     rgba(26,27,38,0.97);
  --topbar-bg:      rgba(26,27,38,0.92);

  /* Layout */
  --sidebar-width:  240px;
  --topbar-height:  64px;

  /* Typography */
  --font-display:   'Syne', sans-serif;
  --font-body:      'DM Sans', sans-serif;

  /* Radii */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-2xl: 40px;

  /* Transitions */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:   0.15s;
  --t-normal: 0.25s;
  --t-slow:   0.4s;
}

/* ─────────────────────────────────────────────────────
   1. RESET & BASE
───────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-slow) var(--ease-smooth),
              color var(--t-slow) var(--ease-smooth);
}

.site-credit-block {
  margin-top: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.75;
}

.site-credit-block strong {
  color: var(--text-primary);
}

.site-credit-block a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  margin: 0 4px;
}

.site-credit-block a:hover {
  text-decoration: underline;
}

.stat-card-primary {
  border: 1px solid rgba(29, 78, 216, 0.16);
  box-shadow: 0 14px 36px rgba(29, 78, 216, 0.08);
}

.data-actions-bar {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(248,250,252,0.96));
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(15,23,42,0.06);
  flex-wrap: wrap;
}

.data-actions-copy {
  display: grid;
  gap: 4px;
  min-width: 260px;
  flex: 1;
}

.data-actions-eyebrow {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.data-actions-title {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.data-actions-sub {
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 560px;
}

.data-actions-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar-btn {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  transition: transform var(--t-fast) var(--ease-smooth), box-shadow var(--t-fast) var(--ease-smooth), border-color var(--t-fast) var(--ease-smooth), background var(--t-fast) var(--ease-smooth);
}

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

.toolbar-btn-icon {
  font-size: 0.95rem;
}

.toolbar-btn-primary {
  background: #eef2f6;
  color: var(--text-primary);
  border-color: rgba(148,163,184,0.22);
  box-shadow: none;
}

.toolbar-btn-primary:hover {
  box-shadow: 0 8px 18px rgba(15,23,42,0.05);
}

.toolbar-btn-secondary {
  background: #f8fafc;
  color: var(--text-primary);
}

.toolbar-btn-secondary:hover {
  border-color: rgba(148,163,184,0.28);
  box-shadow: 0 10px 20px rgba(15,23,42,0.05);
}

.budget-warning-box {
  margin-top: 4px;
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.budget-warning-box.tone-safe {
  background: rgba(21, 128, 61, 0.08);
  border-color: rgba(21, 128, 61, 0.18);
  color: #166534;
}

.budget-warning-box.tone-watch {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.18);
  color: #b45309;
}

.budget-warning-box.tone-risk,
.cat-card-progress-fill.tone-risk,
.heat-card-meter-fill.tone-risk {
  background: linear-gradient(135deg, #f6d6a8, #e7ad66);
}

.budget-warning-box.tone-over {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.18);
  color: #b91c1c;
}

.cat-card-budget {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 6px;
}

.cat-card-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-card2);
  overflow: hidden;
  margin-top: 12px;
}

.cat-card-progress-fill,
.heat-card-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #b7e4c7, #6abf95);
}

.cat-card-progress-fill.tone-watch,
.heat-card-meter-fill.tone-watch {
  background: linear-gradient(135deg, #fde2b4, #ebb96a);
}

.cat-card-progress-fill.tone-over,
.heat-card-meter-fill.tone-over {
  background: linear-gradient(135deg, #f7c3c8, #e07b86);
}

.cat-card-budget-meta {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.cat-budget-btn {
  margin-top: 14px;
  width: 100%;
  justify-content: center;
}

.heatmap-shell {
  display: grid;
  gap: 20px;
}

.heatmap-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.heatmap-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 6px;
}

.heatmap-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.heat-pill {
  appearance: none;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(148, 163, 184, 0.18);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}

.heat-pill:hover,
.heat-pill.active {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(148,163,184,0.16);
}

.heat-safe {
  background: #edf7f1;
  color: #356c4f;
}

.heat-watch {
  background: #fff6e8;
  color: #9a6a1d;
}

.heat-risk {
  background: #fff0df;
  color: #ad6a22;
}

.heat-over {
  background: #fdecec;
  color: #b25b63;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.heatmap-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.heatmap-summary-pill {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.heatmap-summary-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.heatmap-summary-value {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.heat-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  box-shadow: 0 16px 35px rgba(148,163,184,0.14);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.heat-card.tone-over {
  border-color: rgba(220, 38, 38, 0.18);
}

.heat-card.tone-risk {
  border-color: rgba(245, 158, 11, 0.2);
}

.heat-card.tone-watch {
  border-color: rgba(217, 119, 6, 0.18);
}

.heat-card.tone-safe {
  border-color: rgba(21, 128, 61, 0.15);
}

.heat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.heat-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.heat-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.heat-card-name {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.heat-card-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.heat-card-score {
  min-width: 72px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255,255,255,0.9);
  color: var(--text-primary);
}

.heat-card-score.tone-safe { background: #edf7f1; color: #356c4f; }
.heat-card-score.tone-watch { background: #fff6e8; color: #9a6a1d; }
.heat-card-score.tone-risk { background: #fff0df; color: #ad6a22; }
.heat-card-score.tone-over { background: #fdecec; color: #b25b63; }

.heat-card-progress-wrap {
  display: grid;
  gap: 8px;
}

.heat-card-progress-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
}

.heat-card-meter {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(148,163,184,0.22);
}

.heat-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  gap: 10px;
}

.heat-card-empty {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.heat-card-detail-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.heat-card-detail {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.74);
  border: 1px solid var(--border);
}

.heat-card-detail-label {
  font-size: 0.64rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.heat-card-detail-value {
  margin-top: 3px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.8rem;
}

.settings-grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 768px) {
  .settings-grid-two {
    grid-template-columns: 1fr;
  }

  .data-actions-bar {
    align-items: stretch;
  }

  .data-actions-buttons {
    width: 100%;
  }

  .data-actions-buttons .add-btn {
    width: 100%;
    justify-content: center;
  }

  .data-actions-buttons .toolbar-btn {
    width: 100%;
    justify-content: center;
  }
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { display: block; max-width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--bg-card2);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent5); }

/* ─────────────────────────────────────────────────────
   2. LAYOUT SHELL
───────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transition: transform var(--t-slow) var(--ease-bounce),
              box-shadow var(--t-slow) var(--ease-smooth);
  overflow-y: auto;
  overflow-x: hidden;
}

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--t-slow) var(--ease-smooth);
}

/* ─────────────────────────────────────────────────────
   3. SIDEBAR COMPONENTS
───────────────────────────────────────────────────── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.sidebar-logo .logo-icon {
  font-size: 2rem;
  color: var(--accent);
  filter: drop-shadow(0 0 12px rgba(245,166,35,0.5));
  animation: logoSpin 14s linear infinite;
  flex-shrink: 0;
}

@keyframes logoSpin {
  to { transform: rotate(360deg); }
}

.logo-text-wrapper {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0;
}

.logo-main {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--accent), var(--accent5), var(--accent4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradShift 5s ease infinite;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.logo-sub {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar-close-btn {
  display: none;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease-smooth);
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  background: var(--accent2);
  color: #fff;
  border-color: var(--accent2);
}

/* NAV */
.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--t-normal) var(--ease-smooth);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent5));
  opacity: 0;
  transition: opacity var(--t-normal) var(--ease-smooth);
  border-radius: inherit;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-card);
  transform: translateX(3px);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(245,166,35,0.18), rgba(167,139,250,0.12));
  border: 1px solid rgba(245,166,35,0.22);
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(245,166,35,0.12), inset 0 1px 0 rgba(255,255,255,0.06);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), var(--accent5));
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  transition: transform var(--t-normal) var(--ease-bounce);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  transform: scale(1.2);
}

.nav-settings { margin-top: auto; }
.nav-logout   { color: rgba(255, 107, 107, 0.75); }
.nav-logout:hover { background: rgba(255,107,107,0.1) !important; color: var(--accent2); }

/* SIDEBAR FOOTER */
.sidebar-footer {
  padding: 16px 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bank-balance-section,
.month-budget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  transition: all var(--t-normal) var(--ease-smooth);
}

.bank-balance-section:hover,
.month-budget:hover {
  border-color: rgba(245,166,35,0.2);
  background: var(--bg-card2);
}

.budget-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.bank-balance-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent4);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  transition: color var(--t-normal);
}

.budget-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.set-budget-btn {
  width: 100%;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--t-fast) var(--ease-smooth);
}

.set-budget-btn:hover {
  background: var(--accent);
  color: #0b0c15;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.set-budget-btn.bank-btn:hover {
  background: var(--accent4);
  border-color: var(--accent4);
}

/* ─────────────────────────────────────────────────────
   4. TOPBAR
───────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 14px;
  box-shadow: 0 2px 24px rgba(0,0,0,0.2);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.period-panel {
  margin: 18px 20px 0;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(245,166,35,0.08), rgba(56,249,215,0.06), rgba(255,255,255,0.04));
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.period-panel-copy {
  display: grid;
  gap: 4px;
}

.period-panel-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.period-panel-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.period-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.period-toolbar-panel {
  background: rgba(11, 12, 21, 0.12);
}

.period-toolbar select {
  height: 36px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 34px 0 12px;
  min-width: 122px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23f0f0ff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.period-toolbar select:hover,
.period-toolbar select:focus {
  border-color: rgba(245,166,35,0.35);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.1);
}

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px;
  transition: all var(--t-fast) var(--ease-smooth);
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--t-normal) var(--ease-smooth);
}

.hamburger-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.hamburger-btn:hover span { background: #0b0c15; }

.topbar-title-group {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* SEARCH */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 340px;
  min-width: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0 14px;
  height: 38px;
  transition: all var(--t-normal) var(--ease-smooth);
}

.search-box:focus-within {
  border-color: rgba(245,166,35,0.4);
  background: var(--bg-card2);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.08);
}

.search-icon-glyph { font-size: 0.85rem; flex-shrink: 0; }

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  min-width: 0;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
  animation: dropIn 0.18s var(--ease-bounce);
  max-height: 380px;
  overflow-y: auto;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--t-fast);
  border-bottom: 1px solid var(--border);
}

.sd-item:last-child { border-bottom: none; }
.sd-item:hover { background: var(--bg-card); }

.sd-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sd-info { flex: 1; min-width: 0; }
.sd-name { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-meta { font-size: 0.72rem; color: var(--text-muted); }
.sd-amount { font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; color: var(--accent2); flex-shrink: 0; }
.sd-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.sd-footer { padding: 10px 14px; background: var(--bg-card); font-size: 0.8rem; color: var(--accent); cursor: pointer; text-align: center; }
.sd-footer:hover { background: var(--bg-card2); }
.sd-footer strong { color: var(--text-primary); }

.search-dropdown mark {
  background: rgba(245,166,35,0.25);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 2px;
}

/* TOPBAR ACTION BUTTONS */
.topbar-action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-lg);
  background: #eef2f6;
  border: 1px solid rgba(148,163,184,0.22);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.8rem;
  font-family: var(--font-display);
  transition: all var(--t-normal) var(--ease-bounce);
  box-shadow: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15,23,42,0.05);
}

.add-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(245,166,35,0.2);
}

.add-income-btn {
  background: #eef2f6;
  box-shadow: none;
}

.add-income-btn:hover {
  box-shadow: 0 8px 18px rgba(15,23,42,0.05);
}

.add-btn-icon {
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1;
}

.btn-label { display: inline; }

/* USER MENU */
.user-menu {
  position: relative;
  flex-shrink: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--border);
  object-fit: cover;
  transition: all var(--t-normal) var(--ease-bounce);
}

.user-avatar:hover {
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.2);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 600;
  animation: dropIn 0.18s var(--ease-bounce);
}

.user-info {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.uname {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uemail {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: left;
  transition: all var(--t-fast);
}

.dropdown-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.dropdown-btn.danger:hover { background: rgba(255,107,107,0.1); color: var(--accent2); }

.login-prompt {
  padding: 8px 18px;
  border-radius: var(--r-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--t-fast);
}

.login-prompt:hover { background: var(--accent); color: #0b0c15; border-color: var(--accent); }

/* ─────────────────────────────────────────────────────
   5. MOBILE OVERLAY & SIDEBAR OPEN STATE
───────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 250;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-smooth);
}

.sidebar-overlay.open {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────
   6. PAGE CONTAINER
───────────────────────────────────────────────────── */
.page {
  display: none;
  padding: 24px;
  flex: 1;
  animation: pageFadeIn 0.3s var(--ease-smooth);
}

.page.active { display: block; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────
   7. STAT CARDS
───────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: all var(--t-normal) var(--ease-bounce);
  box-shadow: var(--shadow);
  animation: cardIn 0.4s var(--ease-bounce) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, var(--stat-glow, rgba(245,166,35,0.1)), transparent 60%);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: rgba(245,166,35,0.2);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(245,166,35,0.1);
}

.stat-icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transition: transform var(--t-normal) var(--ease-bounce);
}

.stat-card:hover .stat-icon { transform: scale(1.15) rotate(-5deg); }

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
  transition: color var(--t-normal);
}

.stat-sub {
  font-size: 0.73rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.stat-badge {
  position: absolute;
  top: 16px;
  right: 14px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}

.badge-up   { background: rgba(255,107,107,0.15); color: var(--accent2); }
.badge-down { background: rgba(67,233,123,0.15);  color: var(--accent3); }

/* ─────────────────────────────────────────────────────
   8. CARDS & CHARTS
───────────────────────────────────────────────────── */
.card,
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: border-color var(--t-normal);
}

.card:hover,
.chart-card:hover {
  border-color: rgba(245,166,35,0.12);
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  margin-bottom: 18px;
}

.chart-card.wide { grid-column: auto; }

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.chart-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-base);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.tab-btn {
  padding: 5px 12px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all var(--t-fast) var(--ease-smooth);
}

.tab-btn.active {
  background: var(--accent);
  color: #0b0c15;
  box-shadow: 0 2px 8px rgba(245,166,35,0.3);
}

.tab-btn:hover:not(.active) { color: var(--text-primary); }

/* DONUT LEGEND */
.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* BOTTOM ROWS */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.card-header {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* RECENT ITEMS */
.recent-item, .upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeSlideIn 0.3s var(--ease-bounce) both;
  transition: background var(--t-fast);
  border-radius: var(--r-sm);
  padding-inline: 6px;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.recent-item:last-child,
.upcoming-item:last-child { border-bottom: none; }

.recent-item:hover,
.upcoming-item:hover { background: var(--bg-card2); }

.recent-cat-icon,
.upcoming-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform var(--t-normal) var(--ease-bounce);
}

.recent-item:hover .recent-cat-icon,
.upcoming-item:hover .upcoming-icon { transform: scale(1.12); }

.recent-info, .upcoming-info { flex: 1; min-width: 0; }

.recent-name, .upcoming-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-date, .upcoming-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent2);
  flex-shrink: 0;
}

.upcoming-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.upcoming-alert {
  background: rgba(245,166,35,0.15);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* TOP LIST */
.top-item { margin-bottom: 12px; }
.top-item:last-child { margin-bottom: 0; }

.top-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.top-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.top-item-val {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.top-bar-wrap {
  background: var(--bg-card2);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.top-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s var(--ease-bounce);
  position: relative;
  overflow: hidden;
}

.top-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: rgba(255,255,255,0.35);
  transform: skewX(-20deg);
  animation: shimmer 2.2s infinite;
}

@keyframes shimmer {
  to { left: 160%; }
}

/* MONTH SUMMARY */
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

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

.summary-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.summary-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.summary-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  margin: 6px 0;
  opacity: 0.4;
}

/* UPCOMING */
.upcoming-card {
  margin-bottom: 18px;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.6;
}

/* ─────────────────────────────────────────────────────
   9. EXPENSES / INCOME PAGE
───────────────────────────────────────────────────── */
.exp-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar .clear-filter {
  height: 34px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 0.76rem;
  padding: 0 10px;
  outline: none;
  transition: all var(--t-fast);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a8cad'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.filter-bar select:focus,
.filter-bar select:hover {
  border-color: rgba(148,163,184,0.28);
  color: var(--text-primary);
}

.clear-filter {
  background-image: none !important;
  padding-right: 10px !important;
  background: var(--bg-card2);
  color: var(--text-muted);
  font-weight: 600;
  transition: all var(--t-fast);
}

.clear-filter:hover {
  background: #eef2f6;
  color: var(--text-primary);
  border-color: rgba(148,163,184,0.28);
}

.add-btn-page {
  flex-shrink: 0;
}

/* BULK BAR */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(245,166,35,0.12), rgba(167,139,250,0.08));
  border: 1px solid rgba(245,166,35,0.22);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all var(--t-normal) var(--ease-bounce);
  flex-wrap: wrap;
}

.bulk-bar.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.bulk-count {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
}

.bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.bulk-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-card2);
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.bulk-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.bulk-btn.priority-btn:hover { background: rgba(167,139,250,0.12); color: var(--accent5); border-color: rgba(167,139,250,0.3); }
.bulk-btn.delete-btn:hover { background: rgba(255,107,107,0.12); color: var(--accent2); border-color: rgba(255,107,107,0.3); }

/* TABLE */
.expenses-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.expenses-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  table-layout: fixed;
}

.expenses-table thead tr {
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
}

.expenses-table th {
  padding: 9px 12px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
}

.expenses-table td {
  padding: 8px 12px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.expenses-table tbody tr {
  transition: background var(--t-fast);
}

.expenses-table tbody tr:last-child td { border-bottom: none; }

.expenses-table tbody tr:hover {
  background: rgba(148,163,184,0.05);
}

.expenses-table tbody tr:hover td { color: var(--text-primary); }

.row-selected {
  background: rgba(245,166,35,0.07) !important;
}

.row-highlight {
  animation: rowPulse 2.8s var(--ease-smooth);
}

@keyframes rowPulse {
  0%, 100% { background: transparent; }
  20%, 80%  { background: rgba(245,166,35,0.1); }
}

/* Custom checkbox */
.col-check { width: 40px; }

.custom-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.custom-checkbox input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 17px;
  height: 17px;
  border: 2px solid var(--text-muted);
  border-radius: 5px;
  position: relative;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.custom-checkbox input:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
}

.custom-checkbox input:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #0b0c15;
  font-weight: 900;
}

.custom-checkbox:hover .checkmark {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.12);
}

/* Category chip */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 600;
  white-space: nowrap;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid rgba(148,163,184,0.18);
}

/* Priority badge */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
}

.priority-badge:hover { opacity: 0.8; transform: scale(1.05); }

.p-critical { background: rgba(255,71,87,0.15);  color: #ff4757; }
.p-high     { background: rgba(255,107,53,0.15); color: #ff6b35; }
.p-medium   { background: rgba(255,215,0,0.15);  color: #ffd700; }
.p-low      { background: rgba(67,233,123,0.15); color: var(--accent3); }
.p-none     { background: var(--bg-card2);       color: var(--text-muted); }

/* Recurring badge */
.recurring-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.66rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
}

/* Action buttons in table */
.edit-btn, .del-btn {
  padding: 4px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 600;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.edit-btn {
  background: #f8fafc;
  color: #475569;
  border-color: rgba(148,163,184,0.2);
}

.edit-btn:hover {
  background: #eef2f6;
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,23,42,0.05);
}

.del-btn {
  background: #f8fafc;
  color: #64748b;
  border-color: rgba(148,163,184,0.2);
}

.del-btn:hover {
  background: #eef2f6;
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,23,42,0.05);
}

/* Priority cell */
.priority-cell { cursor: pointer; }

/* ─────────────────────────────────────────────────────
   10. CATEGORIES PAGE
───────────────────────────────────────────────────── */
.cat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.cat-page-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px 16px;
  text-align: center;
  position: relative;
  transition: all var(--t-normal) var(--ease-bounce);
  animation: cardIn 0.3s var(--ease-bounce) both;
  cursor: default;
}

.cat-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: rgba(245,166,35,0.25);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.cat-del-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,107,107,0.1);
  border: 1px solid rgba(255,107,107,0.2);
  color: var(--accent2);
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--t-fast);
}

.cat-card:hover .cat-del-btn { opacity: 1; }
.cat-del-btn:hover { background: var(--accent2); color: #fff; transform: scale(1.1); }

.cat-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 12px;
  transition: transform var(--t-normal) var(--ease-bounce);
}

.cat-card:hover .cat-card-icon { transform: scale(1.15) rotate(-5deg); }

.cat-card-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-card-total-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cat-card-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
}

/* ─────────────────────────────────────────────────────
   11. REPORTS PAGE
───────────────────────────────────────────────────── */
.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.report-narrative-card,
.report-tips-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow);
}

.report-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.report-summary {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.report-stat-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.rstat {
  flex: 1;
  min-width: 80px;
  background: var(--bg-card2);
  border-radius: var(--r-md);
  padding: 12px;
  text-align: center;
}

.rstat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.rstat-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}

.quote-text {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.65;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin-bottom: 12px;
}

.tips-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tip-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-card2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  transition: all var(--t-fast);
}

.tip-item:hover {
  border-color: rgba(245,166,35,0.2);
  transform: translateX(3px);
}

.tips-subtitle {
  margin-bottom: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.tip-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent5));
  color: #0b0c15;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tip-text {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ─────────────────────────────────────────────────────
   12. MODALS
───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
  animation: overlayIn 0.2s var(--ease-smooth);
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: var(--bg-panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-2xl);
  padding: 28px 26px 26px;
  width: 100%;
  max-width: 460px;
  position: relative;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,166,35,0.08) inset;
  animation: modalIn 0.3s var(--ease-bounce);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-wide { max-width: 580px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.modal-close:hover {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #fff;
  transform: rotate(90deg);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-right: 36px;
}

.income-title { color: var(--accent3); }

.modal-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  margin-top: -8px;
}

/* MODAL BALANCE BAR */
.modal-balance-bar {
  background: linear-gradient(135deg, rgba(245,166,35,0.08), rgba(167,139,250,0.06));
  border: 1px solid rgba(245,166,35,0.18);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.income-balance-bar {
  background: linear-gradient(135deg, rgba(67,233,123,0.08), rgba(56,249,215,0.06));
  border-color: rgba(67,233,123,0.2);
}

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

.mbb-label, .mbb-after-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.mbb-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.mbb-after {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  transition: color var(--t-normal);
}

.income-after { color: var(--accent3) !important; }

/* FORM GROUPS */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.form-group .hint {
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group input[type="color"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: all var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
  cursor: pointer;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a8cad'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  background-color: var(--bg-card);
  cursor: pointer;
}

.form-group input:focus,
.form-group select:focus {
  border-color: rgba(245,166,35,0.45);
  background: var(--bg-card2);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.09);
}

.form-group input[type="color"] {
  padding: 6px;
  height: 44px;
  cursor: pointer;
}

/* CUSTOM CATEGORY DROPDOWN IN MODAL */
.cat-select-wrap {
  position: relative;
}

.cat-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all var(--t-fast);
  min-height: 44px;
}

.cat-select-trigger:hover {
  border-color: rgba(245,166,35,0.35);
  background: var(--bg-card2);
}

.cat-select-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform var(--t-fast);
  flex-shrink: 0;
}

.cat-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 900;
  max-height: 260px;
  overflow-y: auto;
  animation: dropIn 0.18s var(--ease-bounce);
}

.cat-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background var(--t-fast);
  border-bottom: 1px solid var(--border);
}

.cat-option:last-child { border-bottom: none; }
.cat-option:hover { background: var(--bg-card); }
.cat-option-selected { background: rgba(245,166,35,0.06); }

.cat-opt-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.cat-opt-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cat-opt-check {
  color: var(--accent);
  font-weight: 900;
  font-size: 0.75rem;
}

/* SUBMIT BUTTON */
.submit-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--accent), #e07c1f);
  border: none;
  border-radius: var(--r-lg);
  color: #0b0c15;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: all var(--t-normal) var(--ease-bounce);
  box-shadow: 0 6px 20px rgba(245,166,35,0.3);
  position: relative;
  overflow: hidden;
}

.submit-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s var(--ease-smooth);
}

.submit-btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 10px 30px rgba(245,166,35,0.45);
}

.submit-btn:hover::after { transform: translateX(100%); }

.submit-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 3px 12px rgba(245,166,35,0.2);
}

.submit-btn:disabled,
.btn-saving {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* RECURRING TOGGLE */
.recurring-toggle-wrap { margin-bottom: 14px; }

.recurring-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-normal) var(--ease-smooth);
}

.recurring-pill:hover {
  border-color: rgba(245,166,35,0.25);
  background: var(--bg-card2);
}

.recurring-pill.pill-active {
  border-color: rgba(56,249,215,0.3);
  background: rgba(56,249,215,0.05);
}

.recurring-pill input[type="checkbox"] { display: none; }

.recurring-pill-icon { font-size: 1.2rem; flex-shrink: 0; }

.recurring-pill-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.recurring-pill-main {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.recurring-pill-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.recurring-pill-toggle {
  width: 38px;
  height: 22px;
  background: var(--bg-card2);
  border-radius: 99px;
  border: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
  transition: all var(--t-normal) var(--ease-smooth);
}

.pill-active .recurring-pill-toggle {
  background: var(--accent4);
  border-color: var(--accent4);
}

.rpt-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--t-normal) var(--ease-bounce);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.pill-active .rpt-knob { transform: translateX(16px); }

.recurring-box {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 14px;
  animation: dropIn 0.2s var(--ease-bounce);
}

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

.recurring-box-grid .form-group { margin-bottom: 0; }

/* PRIORITY GRID IN MODAL */
.priority-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.priority-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all var(--t-normal) var(--ease-bounce);
  text-align: left;
}

.priority-pick-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(245,166,35,0.3);
  background: var(--bg-card2);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.p-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-bottom: 4px;
}

.p-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.p-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* SETTINGS MODAL */
.settings-section { margin-bottom: 22px; }

.settings-section-head {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.theme-picker, .font-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-tile, .font-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all var(--t-normal) var(--ease-bounce);
  min-width: 62px;
}

.theme-tile:hover, .font-tile:hover {
  border-color: rgba(245,166,35,0.3);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.theme-tile.active, .font-tile.active {
  border-color: var(--accent);
  background: rgba(245,166,35,0.1);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245,166,35,0.15);
}

.theme-swatch {
  width: 30px;
  height: 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.links-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.links-list a {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--t-fast);
}

.links-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─────────────────────────────────────────────────────
   13. TOAST
───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-panel);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: var(--r-lg);
  padding: 12px 22px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  white-space: nowrap;
  max-width: calc(100vw - 40px);
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.4s var(--ease-bounce), opacity 0.3s var(--ease-smooth);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(16px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ─────────────────────────────────────────────────────
   14. LOGIN PAGE
───────────────────────────────────────────────────── */
body.login-page {
  background: linear-gradient(145deg, #0b0c15 0%, #1a1b2f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

body.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(245,166,35,0.12) 0%, transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(167,139,250,0.1) 0%, transparent 35%),
    radial-gradient(circle at 40% 90%, rgba(56,249,215,0.08) 0%, transparent 40%);
  animation: bgShift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes bgShift {
  from { transform: scale(1); }
  to   { transform: scale(1.1) translate(-2%, -2%); }
}

.login-container {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 2;
  animation: floatUp 0.7s var(--ease-bounce);
}

@keyframes floatUp {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  justify-content: center;
}

.login-logo .logo-icon {
  font-size: 2.6rem;
  color: var(--accent);
  filter: drop-shadow(0 0 16px rgba(245,166,35,0.5));
  animation: logoSpin 14s linear infinite;
}

.login-logo .logo-main {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent5), var(--accent4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200%;
  animation: gradShift 5s ease infinite;
}

.login-logo .logo-sub {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.login-card {
  background: rgba(22, 23, 38, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-2xl);
  padding: 32px 28px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(245,166,35,0.1) inset;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
}

.login-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card2);
  padding: 4px;
  border-radius: var(--r-lg);
  margin-bottom: 22px;
}

.login-tab {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--t-fast);
}

.login-tab.active {
  background: var(--accent);
  color: #0b0c15;
  box-shadow: 0 3px 10px rgba(245,166,35,0.3);
}

.login-tab:hover:not(.active) { color: var(--text-primary); }

.login-form { display: none; }
.login-form.active { display: block; animation: dropIn 0.2s var(--ease-bounce); }

.login-form .form-group label { color: var(--text-secondary); }

.login-form input,
.login-form select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--t-fast);
  margin-top: 6px;
  appearance: none;
  -webkit-appearance: none;
}

.login-form input:focus,
.login-form select:focus {
  border-color: rgba(245,166,35,0.4);
  background: var(--bg-card2);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.08);
}

.login-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a8cad'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  background-color: var(--bg-card);
}

.login-divider {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 18px 0;
  position: relative;
}

.login-divider::before,
.login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 44%;
  height: 1px;
  background: var(--border);
}

.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--t-normal) var(--ease-bounce);
}

.google-btn img { width: 20px; height: 20px; }

.google-btn:hover {
  background: var(--bg-card2);
  border-color: rgba(245,166,35,0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.login-form .submit-btn {
  margin-top: 20px;
}

/* ─────────────────────────────────────────────────────
   15. LEGAL PAGES
───────────────────────────────────────────────────── */
body.legal-page {
  background: var(--bg-base);
  padding: 40px 20px;
}

.legal-container {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 40px;
  box-shadow: var(--shadow);
}

.legal-container h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.legal-container h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 24px 0 10px;
}

.legal-container p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.legal-container a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}

.legal-container a:hover { color: var(--accent5); }

/* ─────────────────────────────────────────────────────
   16. RESPONSIVE — TABLET (max 1024px)
───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

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

  :root { --sidebar-width: 220px; }
}

/* ─────────────────────────────────────────────────────
   17. RESPONSIVE — MOBILE (max 768px)
───────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Sidebar: slide-in drawer on mobile */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }

  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.open { pointer-events: all; }

  .sidebar-close-btn { display: flex; }

  /* Main shifts 0 since sidebar is overlay on mobile */
  .main-content { margin-left: 0; }

  /* Hamburger visible */
  .hamburger-btn { display: flex; }

  /* Topbar tighter */
  .topbar {
    padding: 0 14px;
    gap: 10px;
    height: 56px;
  }

  /* Hide search bar on very narrow screens — or shrink */
  .search-wrap { max-width: 160px; }

  .period-panel {
    margin: 14px 14px 0;
    align-items: stretch;
  }

  .period-toolbar {
    width: 100%;
    justify-content: space-between;
  }

  .period-toolbar select {
    flex: 1 1 0;
    min-width: 0;
  }

  /* Button labels hidden */
  .btn-label { display: none; }

  .add-btn {
    padding: 8px 12px;
    min-width: 36px;
    justify-content: center;
  }

  .topbar-action-btns { gap: 6px; }

  /* Pages */
  .page { padding: 14px; }

  /* Stat cards: 2 cols */
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card { padding: 14px 14px; }
  .stat-value { font-size: 1.15rem; }
  .stat-icon  { font-size: 1.3rem; margin-bottom: 8px; }

  /* Charts: single column */
  .charts-row { grid-template-columns: 1fr; gap: 12px; }
  .bottom-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Page title group */
  .page-title { font-size: 0.95rem; }
  .page-date  { display: none; }

  /* Filter bar: wrap nicely */
  .exp-page-head { flex-direction: column; align-items: stretch; }
  .filter-bar { flex-wrap: wrap; gap: 6px; }
  .filter-bar select { flex: 1 1 calc(50% - 4px); min-width: 120px; }

  /* Table: horizontal scroll */
  .expenses-table-wrap {
    border-radius: var(--r-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .expenses-table { min-width: 560px; }

  /* Report grid: single col */
  .report-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Categories: more cols on mobile */
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .heatmap-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heat-card-detail-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Recurring box grid: single col */
  .recurring-box-grid { grid-template-columns: 1fr; }

  /* Modal */
  .modal-box { padding: 22px 18px; border-radius: var(--r-xl); }
  .modal-title { font-size: 1.05rem; }

  /* Priority grid: single col on very small */
  .priority-grid { grid-template-columns: 1fr; }

  /* Theme/font pickers: wrap */
  .theme-picker, .font-picker { gap: 6px; }
  .theme-tile, .font-tile { min-width: 52px; padding: 8px 10px; font-size: 0.68rem; }

  /* Toast */
  .toast {
    bottom: 16px;
    font-size: 0.78rem;
    padding: 10px 16px;
  }

  /* Legal */
  .legal-container { padding: 24px 18px; }
  .legal-container h1 { font-size: 1.5rem; }

  /* User avatar slightly smaller */
  .user-avatar { width: 32px; height: 32px; }

  /* Sidebar footer: compact */
  .sidebar-footer { padding: 12px 12px 16px; gap: 10px; }
  .bank-balance-section, .month-budget { padding: 12px 14px; }
  .bank-balance-value, .budget-value   { font-size: 1.1rem; }
}

/* ─────────────────────────────────────────────────────
   18. RESPONSIVE — SMALL MOBILE (max 480px)
───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 12px 10px;
    border-radius: var(--r-lg);
  }

  .stat-value { font-size: 1rem; }

  .topbar { height: 52px; padding: 0 10px; }

  .period-panel { margin: 10px 10px 0; padding: 14px; }
  .period-toolbar { width: 100%; padding: 4px; gap: 6px; }
  .period-toolbar select { height: 32px; font-size: 0.75rem; padding-left: 10px; flex: 1 1 0; min-width: 0; }

  .search-wrap { display: none; }

  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .heatmap-summary-strip { grid-template-columns: 1fr 1fr; }
  .heat-card-detail-row { grid-template-columns: 1fr; }

  .cat-card { padding: 14px 10px; }

  .report-stat-row { flex-direction: column; }
  .rstat { min-width: unset; }

  .modal-overlay { padding: 10px; }
  .modal-box { padding: 18px 14px; max-height: 85vh; }

  .bulk-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .bulk-actions { flex-wrap: wrap; }

  .login-card { padding: 24px 18px; }

  .donut-legend { gap: 6px 10px; }
  .legend-item  { font-size: 0.7rem; }
}

/* ─────────────────────────────────────────────────────
   19. ANIMATION UTILITIES
───────────────────────────────────────────────────── */

/* Pulse ring on key stat values */
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(245,166,35,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(245,166,35,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,166,35,0); }
}

/* Smooth glow on hover for accent elements */
@keyframes glowPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* Skeleton loader for loading state */
@keyframes skeleton {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-card2) 25%, var(--bg-card) 50%, var(--bg-card2) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s infinite;
  border-radius: var(--r-sm);
}

/* ─────────────────────────────────────────────────────
   20. PRINT
───────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .modal-overlay,
  .add-btn, .hamburger-btn, .toast { display: none !important; }
  .main-content { margin-left: 0; }
  .page { display: block !important; padding: 0; }
  body { background: white; color: black; }
  .stat-card, .card, .chart-card { border: 1px solid #ddd; box-shadow: none; }
}
