/* ============================================================
   FinTrack Pro – style.css  v2.0
   Ultra-Premium Design System with Advanced Animations
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg-base:        #060912;
  --bg-surface:     #0c1020;
  --bg-card:        rgba(255,255,255,0.035);
  --bg-card-hover:  rgba(255,255,255,0.065);
  --border:         rgba(255,255,255,0.07);
  --border-hover:   rgba(255,255,255,0.14);

  --text-primary:   #eef2ff;
  --text-secondary: #7c87a6;
  --text-muted:     #444d66;

  --accent:         #6c63ff;
  --accent-rgb:     108,99,255;
  --accent-soft:    rgba(108,99,255,0.15);
  --accent-glow:    rgba(108,99,255,0.4);
  --accent-2:       #a78bfa;

  --income:         #10d9a8;
  --income-rgb:     16,217,168;
  --income-soft:    rgba(16,217,168,0.14);
  --income-bg:      rgba(16,217,168,0.08);

  --expense:        #f0415a;
  --expense-rgb:    240,65,90;
  --expense-soft:   rgba(240,65,90,0.14);
  --expense-bg:     rgba(240,65,90,0.08);

  --savings:        #f59e0b;
  --savings-soft:   rgba(245,158,11,0.14);
  --savings-rgb:    245,158,11;

  --danger:         #ef4444;
  --danger-soft:    rgba(239,68,68,0.12);

  --sidebar-w:      256px;
  --topbar-h:       70px;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
  --shadow-card: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 60px rgba(108,99,255,0.12);
  --shadow-float: 0 20px 60px rgba(0,0,0,0.6);

  --transition:      0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.4s cubic-bezier(0.4,0,0.2,1);
  --transition-spring: 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

/* ---- Light Theme ---- */
[data-theme="light"] {
  --bg-base:        #f5f7ff;
  --bg-surface:     #eceef8;
  --bg-card:        rgba(255,255,255,0.85);
  --bg-card-hover:  rgba(255,255,255,0.98);
  --border:         rgba(0,0,0,0.07);
  --border-hover:   rgba(0,0,0,0.14);
  --text-primary:   #0d1117;
  --text-secondary: #4a5568;
  --text-muted:     #9ca3b8;
  --accent-soft:    rgba(108,99,255,0.09);
  --shadow-card:    0 4px 24px rgba(0,0,0,0.07);
  --shadow-glow:    0 0 40px rgba(108,99,255,0.06);
  --shadow-float:   0 16px 40px rgba(0,0,0,0.12);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background var(--transition-slow), color var(--transition-slow);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb),0.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb),0.5); }

.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* ============================================================
   ANIMATED BACKGROUND
   ============================================================ */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: orbFloat 12s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, #6c63ff, transparent); top: -150px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, #10d9a8, transparent); bottom: -100px; right: -100px; animation-delay: 3s; animation-direction: reverse; }
.orb-3 { width: 350px; height: 350px; background: radial-gradient(circle, #f0415a, transparent); top: 40%; left: 40%; animation-delay: 6s; }
.orb-4 { width: 300px; height: 300px; background: radial-gradient(circle, #f59e0b, transparent); bottom: 20%; left: 20%; animation-delay: 9s; animation-direction: reverse; }

[data-theme="light"] .orb { opacity: 0.06; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -40px) scale(1.05); }
  66%       { transform: translate(-20px, 20px) scale(0.97); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 48px 48px;
}
[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(0,0,0,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.035) 1px, transparent 1px);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(12,16,32,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 100;
  transition: transform var(--transition), background var(--transition-slow);
  box-shadow: 4px 0 30px rgba(0,0,0,0.3);
}
[data-theme="light"] .sidebar {
  background: rgba(236,238,248,0.94);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 6px 20px rgba(var(--accent-rgb),0.45);
  flex-shrink: 0;
  animation: brandPulse 4s ease-in-out infinite;
}
@keyframes brandPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(var(--accent-rgb),0.45); }
  50%       { box-shadow: 0 6px 30px rgba(var(--accent-rgb),0.7); }
}
.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}
.brand-pro {
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.5px;
}
.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Nav pill (sliding indicator) */
.nav-pill {
  position: absolute;
  left: 14px;
  width: calc(var(--sidebar-w) - 28px);
  height: 44px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  transition: top var(--transition-spring), opacity var(--transition);
  pointer-events: none;
  opacity: 0;
}
.sidebar-nav.ready .nav-pill { opacity: 1; }

/* Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  position: relative;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-card-hover);
  opacity: 0;
  transition: opacity var(--transition);
}
.nav-item:hover::before { opacity: 1; }
.nav-item:hover { color: var(--text-primary); }

.nav-icon-wrap {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: transparent;
  transition: all var(--transition);
  flex-shrink: 0;
}
.nav-item:hover .nav-icon-wrap { background: var(--accent-soft); color: var(--accent); }
.nav-item.active {
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active .nav-icon-wrap { background: var(--accent-soft); color: var(--accent); }

.nav-badge {
  margin-left: auto;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.nav-badge.show { display: flex; }
.nav-badge.alert { background: var(--expense-soft); color: var(--expense); display: flex; animation: badgePulse 2s ease-in-out infinite; }
@keyframes badgePulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* Sidebar Stats */
.sidebar-stats {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 12px 0;
}
.ss-item { flex: 1; text-align: center; }
.ss-divider { width: 1px; height: 30px; background: var(--border); }
.ss-label { display: block; font-size: 10px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 3px; }
.ss-value { font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 700; }
.income-text { color: var(--income); }
.expense-text { color: var(--expense); }

/* Sidebar Footer */
.sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-icon { font-size: 16px; }

/* Custom toggle track */
.toggle-track {
  width: 32px; height: 18px;
  background: var(--border-hover);
  border-radius: 99px;
  margin-left: auto;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  position: absolute;
  top: 3px; left: 3px;
  transition: all var(--transition-spring);
}
[data-theme="light"] .toggle-track { background: var(--accent); }
[data-theme="light"] .toggle-thumb { background: white; transform: translateX(14px); }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: rgba(6,9,18,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}
[data-theme="light"] .topbar { background: rgba(245,247,255,0.82); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 7px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
}
.hamburger:hover { background: var(--bg-card-hover); }
.hamburger span { display:block; width:20px; height:2px; background:var(--text-primary); border-radius:2px; transition:all var(--transition); }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

.topbar-left { flex:1; }
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}
.page-date { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; display:block; }

.topbar-right { display:flex; align-items:center; gap:10px; }

/* Topbar search */
.topbar-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
}
.topbar-search {
  width: 220px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.10);
  color: var(--text-primary);
  padding: 9px 40px 9px 36px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
[data-theme="light"] .topbar-search {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}
.topbar-search:focus {
  border-color: var(--accent);
  background: rgba(108,99,255,0.10);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.18);
  width: 280px;
}
.topbar-search:focus ~ .topbar-search-icon,
.topbar-search-wrap:focus-within .topbar-search-icon { color: var(--accent); }
.topbar-search::placeholder { color: var(--text-muted); }
.search-kbd {
  position: absolute;
  right: 10px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 2px 5px;
  border-radius: 4px;
  pointer-events: none;
  transition: opacity 0.2s;
}
.topbar-search:focus ~ .search-kbd { opacity: 0; }

/* Icon buttons */
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* Notification */
.notif-btn { position: relative; }
.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--expense);
  border: 1.5px solid var(--bg-base);
  display: none;
  animation: notifBlink 2s ease-in-out infinite;
}
.notif-dot.show { display: block; }
@keyframes notifBlink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }

/* ============================================================
   CUSTOM CURRENCY DROPDOWN
   ============================================================ */
.currency-selector-wrap {
  position: relative;
}

/* Trigger button */
.cur-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.11);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  height: 36px;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  outline: none;
}
[data-theme="light"] .cur-trigger {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}
.cur-trigger:hover {
  background: rgba(108,99,255,0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.cur-trigger:hover .cur-chevron { color: var(--accent); }
.cur-trigger[aria-expanded="true"] {
  background: rgba(108,99,255,0.14);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.18);
}
.cur-trigger[aria-expanded="true"] .cur-chevron {
  transform: rotate(180deg);
}

.cur-flag { font-size: 18px; line-height: 1; }
.cur-code { font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; }
.cur-chevron {
  color: var(--text-muted);
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
}

/* Dropdown panel */
.cur-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #0f1526;
  border: 1.5px solid rgba(108,99,255,0.28);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.65), 0 0 0 1px rgba(108,99,255,0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
  transform-origin: top right;
}
[data-theme="light"] .cur-panel {
  background: #fff;
  border-color: rgba(108,99,255,0.22);
  box-shadow: 0 12px 40px rgba(0,0,0,0.14), 0 0 0 1px rgba(108,99,255,0.06);
}
.cur-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Individual options */
.cur-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.cur-option:hover {
  background: rgba(108,99,255,0.12);
}
.cur-option.selected {
  background: rgba(108,99,255,0.16);
}
.cur-opt-flag {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.cur-opt-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cur-opt-code {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}
.cur-opt-name {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.cur-opt-check {
  color: var(--accent);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.cur-option.selected .cur-opt-code { color: var(--accent); }
.cur-option.selected .cur-opt-check { opacity: 1; }

/* Profile button */
.profile-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-base), var(--bg-base)) padding-box,
              linear-gradient(135deg, var(--accent), var(--accent-2)) border-box;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.profile-btn:hover { transform: scale(1.08); }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 800;
  color: white;
}
.profile-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: profileRipple 2.5s ease-out infinite;
  opacity: 0;
}
@keyframes profileRipple { 0%{opacity:0.6;transform:scale(1)} 100%{opacity:0;transform:scale(1.4)} }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  display: none;
  padding: 24px;
  flex: 1;
  animation: sectionIn 0.4s cubic-bezier(0.4,0,0.2,1) both;
}
.section.active { display: block; }
@keyframes sectionIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Section heading */
.section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px; font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.heading-icon { font-size: 17px; }
.section-heading-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.section-heading-row .section-heading { margin-bottom: 0; }
.view-all {
  font-size: 12.5px; font-weight: 600; color: var(--accent);
  text-decoration: none; cursor: pointer;
  transition: all var(--transition); padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--accent-soft);
}
.view-all:hover { background: var(--accent-soft); }

/* ============================================================
   HEALTH BANNER
   ============================================================ */
.health-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(108,99,255,0.12) 0%, rgba(16,217,168,0.08) 100%);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.health-banner::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(108,99,255,0.15), transparent);
  pointer-events: none;
}
.health-left { display: flex; align-items: center; gap: 16px; }
.health-score-ring {
  width: 60px; height: 60px;
  position: relative;
  flex-shrink: 0;
}
.ring-svg { width: 60px; height: 60px; }
.health-score-num {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 800;
  color: var(--text-primary);
}
.health-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.health-desc { font-size: 12px; color: var(--text-secondary); }
.health-metrics { display: flex; gap: 28px; }
.hm-item { text-align: center; }
.hm-label { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.hm-val { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-primary); }

/* ============================================================
   SUMMARY CARDS
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px 14px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
  cursor: default;
}
.card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card), 0 20px 50px rgba(0,0,0,0.25);
}

/* Animated top stripe */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 99px;
  background-size: 200% 100%;
  animation: shimmerStripe 3s linear infinite;
}
@keyframes shimmerStripe {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.balance-card::before  { background: linear-gradient(90deg,#6c63ff,#a78bfa,#6c63ff); }
.income-card::before   { background: linear-gradient(90deg,#10d9a8,#4ade80,#10d9a8); }
.expense-card::before  { background: linear-gradient(90deg,#f0415a,#f97316,#f0415a); }
.savings-card::before  { background: linear-gradient(90deg,#f59e0b,#fbbf24,#f59e0b); }

/* Card glow */
.card-glow {
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  top: -40px; right: -30px;
  background: radial-gradient(circle, rgba(108,99,255,0.15), transparent);
  pointer-events: none;
  transition: opacity var(--transition);
}
.income-glow  { background: radial-gradient(circle, rgba(16,217,168,0.15), transparent); }
.expense-glow { background: radial-gradient(circle, rgba(240,65,90,0.15), transparent); }
.savings-glow { background: radial-gradient(circle, rgba(245,158,11,0.15), transparent); }
.card:hover .card-glow { opacity: 1.5; }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.card-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.9px;
}
.card-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition-spring);
}
.card:hover .card-icon { transform: scale(1.12) rotate(-5deg); }
.balance-icon  { background: var(--accent-soft); color: var(--accent); }
.income-icon   { background: var(--income-bg); color: var(--income); }
.expense-icon  { background: var(--expense-bg); color: var(--expense); }
.savings-icon  { background: var(--savings-soft); color: var(--savings); }

.card-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.8px;
  margin-bottom: 4px;
}
.income-amount  { color: var(--income); }
.expense-amount { color: var(--expense); }
.savings-amount { color: var(--savings); }

.card-sub { font-size: 11.5px; color: var(--text-muted); }

/* Sparkline */
.card-sparkline {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  opacity: 0.35;
  pointer-events: none;
}
.card:hover .card-sparkline { opacity: 0.6; }

/* Savings bar */
.savings-bar-wrap { margin-top: 10px; }
.savings-bar-track { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.savings-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--savings), #fbbf24);
  border-radius: 99px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   GLASS CARDS
   ============================================================ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--transition-slow), box-shadow var(--transition-slow);
  position: relative;
  overflow: hidden;
}
.glass-card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.025), transparent);
  pointer-events: none;
  transition: left 0.6s ease;
}
.glass-card:hover::after { left: 150%; }
.glass-card:hover { border-color: var(--border-hover); }

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.right-col { display: flex; flex-direction: column; gap: 16px; }

/* ============================================================
   FORM
   ============================================================ */
.type-toggle {
  display: flex; gap: 6px;
  margin-bottom: 18px;
  background: var(--bg-base);
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.type-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 0;
  border: none; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
  color: var(--text-muted); background: transparent;
}
.type-btn[data-type="income"].active  { background: var(--income-soft); color: var(--income); box-shadow: 0 3px 12px rgba(var(--income-rgb),0.25); }
.type-btn[data-type="expense"].active { background: var(--expense-soft); color: var(--expense); box-shadow: 0 3px 12px rgba(var(--expense-rgb),0.25); }
.type-btn:not(.active):hover { background: var(--bg-card-hover); color: var(--text-primary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }

label {
  font-size: 11px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.7px;
}
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); }

input[type="text"], input[type="number"], input[type="date"],
input[type="search"], input[type="email"], select, textarea {
  background: rgba(var(--accent-rgb),0.04);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13.5px; font-family: inherit;
  transition: all var(--transition); outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: rgba(var(--accent-rgb),0.06);
}
input::placeholder { color: var(--text-muted); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }
[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }

.amount-input-wrap { position: relative; }
.currency-prefix {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  font-size: 13.5px; font-weight: 700; color: var(--accent);
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
}
.amount-input-wrap input { padding-left: 28px; }

/* Recurring toggle */
.recurring-wrap {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.toggle-label {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); text-transform: none; letter-spacing: 0;
}
.toggle-checkbox { display: none; }
.custom-toggle {
  width: 36px; height: 20px;
  background: var(--border-hover);
  border-radius: 99px; position: relative;
  transition: background var(--transition);
}
.custom-toggle::after {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%; background: var(--text-muted);
  position: absolute; top: 3px; left: 3px;
  transition: all var(--transition-spring);
}
.toggle-checkbox:checked + .custom-toggle { background: var(--accent); }
.toggle-checkbox:checked + .custom-toggle::after { transform: translateX(16px); background: white; }
.recur-freq { width: auto; flex-shrink: 0; }

/* Submit button */
.submit-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; border-radius: var(--radius-sm);
  color: white; font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
  margin-top: 4px; letter-spacing: 0.2px;
  position: relative; overflow: hidden;
}
.submit-btn::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
}
.submit-btn:hover::before { width: 300px; height: 300px; opacity: 0; }
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(var(--accent-rgb),0.5); }
.submit-btn:active { transform: translateY(0); }
.btn-icon { display:flex; align-items:center; }

/* ============================================================
   TODAY'S SNAPSHOT
   ============================================================ */
.today-date-badge {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-base);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 99px;
}
.today-stats { display: flex; gap: 12px; margin-bottom: 16px; }
.today-stat {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.ts-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.income-bg-soft  { background: var(--income-bg); }
.expense-bg-soft { background: var(--expense-bg); }
.ts-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.ts-val { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 800; margin-top: 2px; }

/* Week bars */
.week-bars { display: flex; align-items: flex-end; gap: 4px; height: 50px; }
.week-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.week-bar {
  width: 100%; background: var(--border);
  border-radius: 3px 3px 0 0;
  transition: height 0.8s cubic-bezier(0.4,0,0.2,1), background var(--transition);
  position: relative;
}
.week-bar.income  { background: rgba(var(--income-rgb),0.5); }
.week-bar.expense { background: rgba(var(--expense-rgb),0.5); }
.week-bar:hover   { background: var(--accent); }
.week-bar-label { font-size: 9px; color: var(--text-muted); }

/* ============================================================
   TRANSACTION LIST
   ============================================================ */
.tx-list { display: flex; flex-direction: column; }

.tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  animation: txSlideIn 0.35s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes txSlideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tx-item:hover { background: var(--bg-card-hover); }
.tx-item:hover .tx-delete { opacity: 1; transform: scale(1); }
.tx-item + .tx-item { border-top: 1px solid var(--border); }

.tx-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  transition: transform var(--transition-spring);
}
.tx-item:hover .tx-icon { transform: scale(1.1) rotate(-5deg); }
.tx-icon.income  { background: var(--income-bg); }
.tx-icon.expense { background: var(--expense-bg); }

.tx-info { flex: 1; min-width: 0; }
.tx-desc {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tx-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.tx-tags { margin-top: 3px; display: flex; gap: 4px; flex-wrap: wrap; }
.tx-tag {
  font-size: 10px; font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}
.tx-recurring-badge {
  font-size: 10px; color: var(--savings); background: var(--savings-soft);
  padding: 1px 6px; border-radius: 99px; font-weight: 600;
}

.tx-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tx-amount { font-family: 'Space Grotesk', monospace; font-size: 14.5px; font-weight: 800; }
.tx-amount.income  { color: var(--income); }
.tx-amount.expense { color: var(--expense); }

.tx-delete {
  opacity: 0;
  transform: scale(0.8);
  background: var(--danger-soft);
  border: none; border-radius: 7px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--danger);
  transition: all var(--transition);
}
.tx-delete:hover { background: var(--danger); color: white; transform: scale(1.1); }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 20px; gap: 12px; text-align: center;
}
.empty-icon { font-size: 48px; line-height: 1; animation: emptyFloat 3s ease-in-out infinite; }
@keyframes emptyFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.empty-state p { font-size: 13.5px; color: var(--text-muted); max-width: 220px; line-height: 1.6; }

/* ============================================================
   TRANSACTIONS PAGE
   ============================================================ */
.tx-page-card { padding: 20px; }
.tx-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.tx-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.filter-tabs {
  display: flex; gap: 4px;
  background: var(--bg-base);
  padding: 4px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border: none; border-radius: 7px;
  background: transparent; color: var(--text-secondary);
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
}
.filter-btn.active { background: var(--accent); color: white; box-shadow: 0 3px 12px rgba(var(--accent-rgb),0.35); }
.filter-btn:not(.active):hover { color: var(--text-primary); background: var(--bg-card-hover); }
.filter-count {
  font-size: 10px; font-weight: 800; min-width: 18px; height: 18px;
  background: rgba(255,255,255,0.15); border-radius: 99px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.filter-btn:not(.active) .filter-count { background: var(--bg-card); color: var(--text-muted); }
.income-count  { background: var(--income-soft) !important; color: var(--income) !important; }
.expense-count { background: var(--expense-soft) !important; color: var(--expense) !important; }

.tx-search-wrap { position: relative; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.tx-search { padding-left: 34px; width: 200px; height: 36px; }

.sort-select { height: 36px; font-size: 12.5px; padding: 0 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: inherit; cursor: pointer; outline: none; }
.sort-select:focus { border-color: var(--accent); }

.export-mini-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px; height: 36px;
  background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb),0.3);
  border-radius: var(--radius-sm); color: var(--accent);
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
}
.export-mini-btn:hover { background: var(--accent); color: white; }

/* Summary bar */
.tx-summary-bar {
  display: flex; gap: 20px;
  padding: 10px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.tsb-label { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.tsb-val { font-family: 'Space Grotesk', sans-serif; font-size: 13.5px; font-weight: 700; color: var(--text-primary); margin-left: 6px; }

.full-list { max-height: calc(100vh - 310px); overflow-y: auto; padding-right: 4px; }

/* ============================================================
   BUDGETS
   ============================================================ */
.budget-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.budget-list { display: flex; flex-direction: column; gap: 12px; }

.budget-item {
  padding: 16px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  animation: txSlideIn 0.3s ease both;
}
.budget-item:hover { border-color: var(--border-hover); transform: translateX(3px); }
.budget-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.budget-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.budget-amounts { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.budget-pct { font-family: 'Space Grotesk', sans-serif; font-size: 14px; font-weight: 800; }
.budget-ok     { color: var(--income); }
.budget-warn   { color: var(--savings); }
.budget-danger { color: var(--expense); }

.budget-bar-track {
  height: 8px; background: var(--border);
  border-radius: 99px; overflow: hidden; margin-bottom: 4px;
}
.budget-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width 1s cubic-bezier(0.4,0,0.2,1), background 0.5s;
}
.budget-bar-ok     { background: linear-gradient(90deg, var(--income), #4ade80); }
.budget-bar-warn   { background: linear-gradient(90deg, var(--savings), #fbbf24); }
.budget-bar-danger { background: linear-gradient(90deg, var(--expense), #f97316); animation: dangerPulse 1.5s ease-in-out infinite; }
@keyframes dangerPulse { 0%,100%{opacity:1} 50%{opacity:0.65} }

.budget-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.budget-delete {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 5px;
  transition: all var(--transition); font-size: 15px;
}
.budget-delete:hover { color: var(--danger); background: var(--danger-soft); }

.budget-month { font-size: 12px; color: var(--text-muted); background: var(--bg-base); border: 1px solid var(--border); padding: 4px 10px; border-radius: 99px; }

.budget-tips {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.tips-title { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-bottom: 10px; }
.tips-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tips-list li { font-size: 12.5px; color: var(--text-muted); padding-left: 14px; position: relative; }
.tips-list li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }

.budget-list-card { min-height: 200px; }

/* ============================================================
   GOALS
   ============================================================ */
.goals-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.goals-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; }

.goal-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all var(--transition);
  animation: txSlideIn 0.35s ease both;
  position: relative;
  overflow: hidden;
}
.goal-card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--shadow-card); }
.goal-card::before { content:''; position:absolute; top:0;left:0;right:0; height:3px; background:linear-gradient(90deg,var(--accent),var(--accent-2)); }

.goal-emoji { font-size: 32px; margin-bottom: 10px; display: block; }
.goal-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.goal-deadline { font-size: 11.5px; color: var(--text-muted); margin-bottom: 14px; }

.goal-amounts { display: flex; justify-content: space-between; margin-bottom: 8px; }
.goal-current { font-family:'Space Grotesk',sans-serif; font-size:18px; font-weight:800; color:var(--accent); }
.goal-target { font-size:12px; color:var(--text-muted); text-align:right; }
.goal-target-val { font-weight:700; color:var(--text-secondary); }

.goal-progress-track { height:8px; background:var(--border); border-radius:99px; overflow:hidden; margin-bottom:10px; }
.goal-progress-fill {
  height:100%; border-radius:99px;
  background: linear-gradient(90deg,var(--accent),var(--accent-2));
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.goal-progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, transparent 50%, rgba(255,255,255,0.3) 100%);
  animation: goalShimmer 2s linear infinite;
}
@keyframes goalShimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }

.goal-pct { font-size: 12px; color: var(--text-secondary); font-weight: 600; margin-bottom: 12px; }
.goal-days-left { font-size: 11px; color: var(--text-muted); }
.goal-days-left.urgent { color: var(--expense); font-weight: 700; }

.goal-actions { display: flex; gap: 8px; margin-top: 12px; }
.goal-fund-btn {
  flex: 1; padding: 8px 0;
  background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb),0.25);
  border-radius: var(--radius-xs); color: var(--accent);
  font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
}
.goal-fund-btn:hover { background: var(--accent); color: white; }
.goal-del-btn {
  width: 32px; height: 32px;
  background: var(--danger-soft); border: none;
  border-radius: var(--radius-xs); color: var(--danger);
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.goal-del-btn:hover { background: var(--danger); color: white; }

/* Emoji picker */
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-opt {
  width: 36px; height: 36px; border-radius: var(--radius-xs);
  border: 1.5px solid var(--border); background: var(--bg-base);
  font-size: 18px; cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.emoji-opt:hover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.1); }
.emoji-opt.selected { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.1); }

/* ============================================================
   ANALYTICS
   ============================================================ */
.analytics-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.analytic-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}
.as-label { font-size: 10.5px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.7px; text-transform: uppercase; margin-bottom: 6px; }
.as-val { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 800; color: var(--text-primary); }
.as-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wide-card { grid-column: 1 / -1; }
.chart-card { overflow: visible; }
.chart-wrap { position: relative; width: 100%; height: 250px; }
.donut-wrap { height: 210px; }

.chart-period-select {
  background: var(--bg-base); border: 1px solid var(--border);
  color: var(--text-primary); padding: 5px 10px;
  border-radius: var(--radius-sm); font-size: 12px; font-family: inherit;
  cursor: pointer; outline: none; transition: border-color var(--transition);
}
.chart-period-select:focus { border-color: var(--accent); }

.chart-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.chart-badge-row { display: flex; gap: 8px; }
.chart-badge {
  font-size: 11.5px; font-weight: 700; padding: 4px 10px;
  border-radius: 99px; border: 1px solid;
}
.badge-income  { background: var(--income-soft); color: var(--income); border-color: rgba(var(--income-rgb),0.3); }
.badge-expense { background: var(--expense-soft); color: var(--expense); border-color: rgba(var(--expense-rgb),0.3); }

/* Heatmap */
.heatmap-wrap { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.hm-week { display: flex; flex-direction: column; gap: 3px; }
.hm-cell {
  width: 14px; height: 14px;
  border-radius: 3px;
  transition: transform var(--transition);
  cursor: pointer;
  position: relative;
}
.hm-cell:hover { transform: scale(1.4); z-index: 10; }
.hm-cell[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 10px; font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  z-index: 100;
}
.hm-0 { background: var(--border); }
.hm-1 { background: rgba(var(--expense-rgb),0.2); }
.hm-2 { background: rgba(var(--expense-rgb),0.4); }
.hm-3 { background: rgba(var(--expense-rgb),0.65); }
.hm-4 { background: rgba(var(--expense-rgb),0.9); }
.heatmap-legend { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--text-muted); }
.hm-scale { display: flex; gap: 3px; }
.hm-sq { width: 12px; height: 12px; border-radius: 2px; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-card { height: fit-content; }
.settings-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; margin-top: -8px; }

.profile-preview {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; padding: 16px;
  background: var(--bg-base); border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.profile-avatar-large {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 800; color: white;
  flex-shrink: 0; box-shadow: 0 6px 20px rgba(var(--accent-rgb),0.4);
}
.profile-name-display { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.profile-currency-display { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; }

/* Theme Options */
.theme-options { display: flex; gap: 14px; margin-bottom: 20px; }
.theme-option { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; flex: 1; position: relative; }
.theme-preview {
  width: 100%; height: 72px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
  padding: 10px; transition: all var(--transition); overflow: hidden;
}
.theme-option.selected .theme-preview { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dark-preview  { background: #060912; }
.light-preview { background: #f5f7ff; }
.tp-bar  { height: 7px; border-radius: 3px; background: rgba(108,99,255,0.55); width: 55%; }
.tp-card { height: 24px; border-radius: 5px; }
.tp-card2 { height: 14px; border-radius: 5px; width: 70%; }
.dark-preview  .tp-card, .dark-preview  .tp-card2 { background: rgba(255,255,255,0.06); }
.light-preview .tp-card, .light-preview .tp-card2 { background: rgba(255,255,255,0.85); }
.theme-option span { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.theme-check {
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px;
  background: var(--accent); border-radius: 50%;
  font-size: 10px; color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  opacity: 0; transition: opacity var(--transition);
}
.theme-option.selected .theme-check { opacity: 1; }

/* Accent colors */
.accent-section { border-top: 1px solid var(--border); padding-top: 16px; }
.accent-title { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 10px; }
.accent-colors { display: flex; gap: 8px; }
.accent-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer; transition: all var(--transition-spring);
}
.accent-dot:hover { transform: scale(1.2); }
.accent-dot.selected { border-color: white; transform: scale(1.15); box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }

/* Currency table */
.currency-table { display: flex; flex-direction: column; gap: 8px; }
.currency-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: var(--bg-base); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.currency-row:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.currency-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.currency-rate { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text-secondary); }

/* Data actions */
.data-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.data-action-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-base); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
}
.data-action-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.storage-info { font-size: 12px; color: var(--text-muted); padding: 10px 14px; background: var(--bg-base); border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* Danger zone */
.danger-card .section-heading { color: var(--danger); }
.danger-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.danger-actions { display: flex; gap: 10px; }
.danger-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  background: var(--danger-soft); border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm); color: var(--danger);
  font-size: 13.5px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
}
.danger-btn:hover { background: var(--danger); color: white; box-shadow: 0 6px 20px rgba(239,68,68,0.4); transform: translateY(-1px); }

/* ============================================================
   FAB (Floating Action Button)
   ============================================================ */
.fab-wrap {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 200;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.fab-main {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(var(--accent-rgb),0.55);
  transition: all var(--transition-spring);
  z-index: 1;
}
.fab-main:hover { transform: scale(1.1) rotate(45deg); box-shadow: 0 12px 40px rgba(var(--accent-rgb),0.7); }
.fab-main.open { transform: rotate(45deg); }

.fab-menu { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.fab-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 99px; color: var(--text-primary);
  font-size: 13px; font-weight: 700; font-family: inherit;
  cursor: pointer; box-shadow: var(--shadow-card);
  transition: all var(--transition-spring);
  transform: scale(0) translateY(20px);
  opacity: 0;
  pointer-events: none;
}
.fab-wrap.open .fab-option { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }
.fab-wrap.open .fab-option:nth-child(1) { transition-delay: 0.05s; }
.fab-wrap.open .fab-option:nth-child(2) { transition-delay: 0.1s; }
.fab-option:hover { background: var(--accent); border-color: var(--accent); color: white; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  max-width: 400px; width: 90%;
  text-align: center;
  box-shadow: var(--shadow-float);
  transform: scale(0.88) translateY(20px);
  transition: transform var(--transition-spring);
}
.modal-overlay.open .modal-box { transform: scale(1) translateY(0); }
.modal-icon { font-size: 44px; margin-bottom: 14px; }
.modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.modal-msg { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 26px; }
.modal-actions { display: flex; gap: 12px; }
.modal-btn {
  flex: 1; padding: 12px 0;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 800; font-family: inherit;
  cursor: pointer; transition: all var(--transition);
}
.modal-btn.cancel { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.modal-btn.cancel:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.modal-btn.danger { background: linear-gradient(135deg, var(--danger), #f97316); color: white; }
.modal-btn.danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.45); transform: translateY(-1px); }
.modal-btn.confirm:not(.danger) { background: linear-gradient(135deg, var(--income), #4ade80); color: white; }
.modal-btn.confirm:not(.danger):hover { box-shadow: 0 6px 20px rgba(var(--income-rgb),0.45); transform: translateY(-1px); }

/* ============================================================
   NOTIFICATIONS PANEL
   ============================================================ */
.notif-panel {
  position: fixed;
  top: 76px; right: 20px;
  width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  z-index: 400;
  transform: translateY(-10px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-spring);
  overflow: hidden;
}
.notif-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-header h4 { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.notif-clear { background: none; border: none; font-size: 12px; color: var(--accent); cursor: pointer; font-family: inherit; font-weight: 600; }
.notif-list { max-height: 280px; overflow-y: auto; }
.notif-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--text-muted); }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  animation: txSlideIn 0.3s ease both;
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-icon { font-size: 18px; flex-shrink: 0; }
.notif-content { flex: 1; }
.notif-msg { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-float);
  max-width: 360px;
  pointer-events: all;
  animation: toastIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.toast.exit { animation: toastOut 0.3s ease both; }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success { border-color: rgba(var(--income-rgb),0.35); background: linear-gradient(135deg, var(--bg-surface), rgba(var(--income-rgb),0.06)); }
.toast.error   { border-color: rgba(var(--expense-rgb),0.35); background: linear-gradient(135deg, var(--bg-surface), rgba(var(--expense-rgb),0.06)); }
.toast.info    { border-color: rgba(var(--accent-rgb),0.35); }
.toast.warning { border-color: rgba(var(--savings-rgb),0.35); background: linear-gradient(135deg, var(--bg-surface), rgba(var(--savings-rgb),0.06)); }
@keyframes toastIn  { from{opacity:0;transform:translateY(20px) scale(0.92)} to{opacity:1;transform:translateY(0) scale(1)} }
@keyframes toastOut { from{opacity:1;transform:translateY(0) scale(1)} to{opacity:0;transform:translateY(-10px) scale(0.9)} }

/* ============================================================
   CONFETTI CANVAS
   ============================================================ */
.confetti-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  width: 100%; height: 100%;
}

/* ============================================================
   SIDEBAR OVERLAY
   ============================================================ */
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.6); z-index:90; backdrop-filter:blur(4px); }
.sidebar-overlay.open { display:block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .cards-grid { grid-template-columns: repeat(2,1fr); }
  .analytics-stats-row { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 1024px) {
  .budget-grid, .goals-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .wide-card { grid-column: 1; }
}
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .health-metrics { display: none; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .hamburger { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .section { padding: 14px; }
  .topbar-search-wrap { display: none; }
  .health-banner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 540px) {
  .cards-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-amount { font-size: 18px; }
  .tx-toolbar { flex-direction: column; align-items: stretch; }
  .filter-tabs { overflow-x: auto; }
  .fab-wrap { bottom: 20px; right: 16px; }
}
@media (max-width: 380px) {
  .cards-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.pulse-anim { animation: pulseBounce 0.5s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes pulseBounce { 0%{transform:scale(1)} 50%{transform:scale(1.08)} 100%{transform:scale(1)} }
