/* ============================================================
   WealthWise v3 – Full CSS (Dark/Light + iOS + Auth + Glass)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0a14;
  --bg-dark: #0a0a14;
  --bg-secondary: #111122;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.08);
  --bg-input: rgba(255,255,255,0.06);
  --bg-sidebar: rgba(10,10,20,0.95);
  --accent: #10b981;
  --accent-glow: rgba(16,185,129,0.35);
  --accent-light: rgba(16,185,129,0.14);
  --accent-dark: #059669;
  --text-primary: #f0f0ff;
  --text-secondary: #9090b8;
  --text-muted: #5a5a7e;
  --income: #10b981;
  --expense: #f43f5e;
  --transfer: #7c3aed;
  --border: rgba(255,255,255,0.08);
  --border-focus: rgba(16,185,129,0.5);
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --font: 'DM Sans', -apple-system, sans-serif;
  --font-display: 'Sora', sans-serif;
  --sidebar-width: 260px;
  --bnav-height: 72px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  /* iOS safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  /* Glass */
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.10);
  --glass-blur: blur(24px) saturate(180%);
}

/* Accent Variants */
.accent-violet { --accent:#7c3aed; --accent-glow:rgba(124,58,237,0.35); --accent-light:rgba(124,58,237,0.14); --accent-dark:#6d28d9; }
.accent-rose   { --accent:#e11d48; --accent-glow:rgba(225,29,72,0.35);  --accent-light:rgba(225,29,72,0.14);  --accent-dark:#be123c; }
.accent-amber  { --accent:#d97706; --accent-glow:rgba(217,119,6,0.35);  --accent-light:rgba(217,119,6,0.14);  --accent-dark:#b45309; }
.accent-sky    { --accent:#0284c7; --accent-glow:rgba(2,132,199,0.35);  --accent-light:rgba(2,132,199,0.14);  --accent-dark:#0369a1; }

/* Light Mode */
body.light-mode {
  --bg-dark: #f0f2f8;
  --bg-primary: #f0f2f8;
  --bg-card: rgba(255,255,255,0.65);
  --bg-card-hover: rgba(255,255,255,0.88);
  --bg-input: rgba(255,255,255,0.7);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: rgba(0,0,0,0.08);
  --border-focus: rgba(16,185,129,0.5);
  --glass-bg: rgba(255,255,255,0.55);
  --glass-border: rgba(255,255,255,0.8);
  background: linear-gradient(135deg, #f0f8ff 0%, #e8f5f0 50%, #f0f2f8 100%);
}
body.light-mode .glass-panel {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
body.light-mode .sidebar {
  background: rgba(255,255,255,0.7);
  border-right: 1px solid rgba(0,0,0,0.06);
}
body.light-mode .bottom-nav {
  background: rgba(255,255,255,0.85);
  border-top: 1px solid rgba(0,0,0,0.06);
}

*, *:before, *:after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; width: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: var(--font);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  background-image:
    radial-gradient(ellipse at 15% 20%, rgba(16,185,129,0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(59,130,246,0.18) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(124,58,237,0.12) 0%, transparent 65%);
  background-attachment: fixed;
  background-size: 100% 100%;
}

/* Liquid Glass */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.12);
}

/* ---- SPLASH ---- */
.splash {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg-dark);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
.splash.hidden { opacity: 0; pointer-events: none; }
html.logged-in .splash { display: none !important; }
.splash-logo { text-align: center; }
.splash-icon { font-size: 56px; display: block; margin-bottom: 16px; animation: float 3s ease-in-out infinite; filter: drop-shadow(0 0 20px var(--accent-glow)); }
.splash-title { font-family: var(--font-display); font-size: 32px; font-weight: 800; background: linear-gradient(135deg, var(--accent), #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 6px; }
.splash-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 40px; }
.splash-loader { width: 200px; height: 3px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; }
.loader-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #3b82f6); border-radius: 999px; animation: loaderFill 1.8s ease forwards; }

/* ============================================================
   AUTH SCREEN — Unified, Consistent, Glass Style
   ============================================================ */
.auth-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 40px 20px;
  background: var(--bg-dark);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(16,185,129,0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(59,130,246,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 10%, rgba(124,58,237,0.15) 0%, transparent 40%);
}
.auth-screen.hidden { display: none !important; }
html.logged-in .auth-screen { display: none !important; }

/* Animated blobs */
.auth-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.auth-blob { position: absolute; border-radius: 50%; filter: blur(80px); animation: blobFloat 8s ease-in-out infinite; }
.auth-blob1 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(16,185,129,0.4), transparent); top: -100px; left: -100px; animation-delay: 0s; }
.auth-blob2 { width: 350px; height: 350px; background: radial-gradient(circle, rgba(59,130,246,0.35), transparent); bottom: -80px; right: -80px; animation-delay: 3s; }
@keyframes blobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(20px,-30px) scale(1.05); }
  66% { transform: translate(-15px,15px) scale(0.97); }
}

/* Auth Container — Same glass card for BOTH sign in and sign up */
.auth-container {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  padding: 40px 36px;
  border-radius: 32px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 24px 64px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
  animation: authCardIn 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-brand-icon {
  font-size: 52px; display: block; margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}
.auth-brand-name {
  font-family: var(--font-display); font-size: 30px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -0.5px;
}
.auth-brand-sub { font-size: 13px; color: var(--text-secondary); margin-top: 5px; }

/* Pill Tab Switch — SAME for both forms */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px; margin-bottom: 28px;
}
.auth-tab {
  padding: 10px 16px; border-radius: 10px; border: none;
  background: transparent; color: var(--text-secondary);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Auth Form — SAME structure both sign in and sign up */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form.hidden { display: none; }
.auth-form-group { display: flex; flex-direction: column; gap: 7px; }
.auth-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  letter-spacing: 0.5px; display: flex; align-items: center; gap: 6px;
}
.auth-input {
  width: 100%; padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary); font-family: var(--font); font-size: 15px;
  outline: none; transition: var(--transition);
  -webkit-appearance: none; appearance: none;
}
.auth-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.09);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.auth-input::placeholder { color: var(--text-muted); }
.auth-input option { background: #1e1e32; }
.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 50px; }
.eye-btn {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 16px; cursor: pointer; color: var(--text-muted);
  padding: 4px; transition: var(--transition);
}
.eye-btn:hover { color: var(--accent); }
.auth-forgot {
  background: none; border: none; color: var(--accent); font-size: 13px;
  cursor: pointer; text-align: right; font-family: var(--font); font-weight: 500;
  margin-top: -8px; padding: 0;
  transition: var(--transition);
}
.auth-forgot:hover { opacity: 0.8; }

.btn-auth-primary {
  padding: 15px; border-radius: var(--radius-sm); border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white; font-family: var(--font); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 20px var(--accent-glow);
  letter-spacing: 0.3px;
}
.btn-auth-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px var(--accent-glow); }
.btn-auth-primary:active { transform: translateY(0); }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,0.08);
}

.btn-google {
  padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary); font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-google:hover { border-color: var(--accent); background: rgba(255,255,255,0.09); }
.auth-spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; }
.auth-terms { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 16px; line-height: 1.7; }
.auth-terms a { color: var(--accent); text-decoration: none; }
.auth-terms a:hover { text-decoration: underline; }

/* ============================================================
   PRIVACY POLICY MODAL (in-app)
   ============================================================ */
#privacyModal .modal { max-width: 600px; }
.policy-content { font-size: 13px; line-height: 1.8; color: var(--text-secondary); }
.policy-content h2 { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; }
.policy-content p { margin-bottom: 10px; }
.policy-content strong { color: var(--text-primary); }

/* ============================================================
   SAVINGS TIPS SECTION
   ============================================================ */
.savings-tips-card {
  background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(59,130,246,0.08));
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.savings-tips-card::before {
  content: '';
  position: absolute; inset: 0;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: -1;
}
.savings-tip-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.savings-tip-item:last-child { border-bottom: none; padding-bottom: 0; }
.savings-tip-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.savings-tip-body { flex: 1; }
.savings-tip-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.savings-tip-text { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.savings-tip-badge {
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 99px; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent);
  border: 1px solid rgba(16,185,129,0.2);
}

/* ============================================================
   APP SHELL
   ============================================================ */
html:not(.logged-in) .app { display: none !important; }
.app { display: flex; height: 100%; width: 100%; overflow: hidden; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(10,10,20,0.85);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); z-index: 300;
  position: relative; flex-shrink: 0;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-icon { font-size: 28px; filter: drop-shadow(0 0 10px var(--accent-glow)); }
.brand-name {
  font-family: var(--font-display); font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--radius-sm); border: none;
  background: transparent; color: var(--text-secondary);
  font-family: var(--font); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition); width: 100%; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent); font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.2);
}
.nav-icon { font-size: 18px; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.05); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white; flex-shrink: 0; overflow: hidden;
  box-shadow: 0 0 0 2px var(--accent-light);
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-tagline { display: block; font-size: 11px; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.btn-signout {
  width: 100%; padding: 10px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08); background: transparent;
  color: var(--text-secondary); font-family: var(--font); font-size: 13px; cursor: pointer; transition: var(--transition);
}
.btn-signout:hover { border-color: var(--expense); color: var(--expense); }

/* ---- BOTTOM NAV (Mobile) ---- */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--bnav-height) + var(--safe-bottom));
  background: rgba(10,10,20,0.88);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0 8px; padding-bottom: var(--safe-bottom);
  align-items: center; justify-content: space-around;
  z-index: 200;
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 10px; border: none; background: transparent; color: var(--text-muted);
  font-family: var(--font); font-size: 10px; cursor: pointer;
  border-radius: var(--radius-sm); transition: var(--transition); flex: 1;
  -webkit-tap-highlight-color: transparent;
}
.bnav-item.active { color: var(--accent); }
.bnav-icon { font-size: 22px; }
.bnav-label { font-size: 10px; font-weight: 600; }
.bnav-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none; color: white; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 20px var(--accent-glow);
  transition: var(--transition); flex-shrink: 0; margin: 0 4px; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.bnav-fab:active { transform: scale(0.92) rotate(45deg); }

/* ---- MAIN CONTENT ---- */
.main-content {
  flex: 1; min-width: 0;
  height: 100%;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ---- PAGES ---- */
.page {
  display: none; padding: 28px 32px;
  max-width: 1200px; margin: 0 auto;
  animation: fadeSlideUp 0.35s ease;
  padding-top: calc(28px + var(--safe-top));
  padding-bottom: calc(48px + var(--safe-bottom));
}
.page.active { display: block; }

/* ---- PAGE HEADER ---- */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  background: linear-gradient(90deg, #fff 30%, #94a3b8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
body.light-mode .page-title {
  background: linear-gradient(90deg, #0f172a, #334155);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.live-clock {
  font-family: var(--font-display); font-size: 12px; color: var(--text-secondary);
  background: rgba(255,255,255,0.05); padding: 7px 14px;
  border-radius: 20px; border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-icon {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05); color: var(--text-secondary);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: var(--transition); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
#mobileMenuBtn { display: none; }

/* MONTH SELECTOR */
.month-selector {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); padding: 10px 18px; margin-bottom: 22px;
}
.month-label { flex: 1; text-align: center; font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text-primary); }
.month-nav-btn {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.06); color: var(--text-secondary);
  font-size: 20px; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.month-nav-btn:hover { background: var(--accent-light); color: var(--accent); }

/* ---- NET WORTH CARD ---- */
.net-worth-card {
  padding: 28px; border-radius: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 60%, #3b82f6 100%);
  color: white; margin-bottom: 20px; position: relative; overflow: hidden;
  box-shadow: 0 16px 48px var(--accent-glow);
  animation: slideUp 0.5s ease;
}
.net-worth-card::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.net-worth-card::after {
  content: '';
  position: absolute; bottom: -40px; left: 30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.nw-label { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 1.5px; }
.nw-amount { font-family: var(--font-display); font-size: 42px; font-weight: 800; color: white; margin: 6px 0 4px; line-height: 1; }
.nw-change { font-size: 13px; font-weight: 600; margin-bottom: 22px; color: rgba(255,255,255,0.55); }
.nw-change.positive { color: rgba(255,255,255,0.9); }
.nw-change.negative { color: rgba(255,200,200,0.9); }
.nw-breakdown { display: flex; align-items: center; gap: 16px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.15); flex-wrap: wrap; position: relative; z-index: 1; }
.nw-item { display: flex; align-items: center; gap: 10px; }
.nw-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; background: rgba(255,255,255,0.15); }
.nw-desc { font-size: 11px; color: rgba(255,255,255,0.5); }
.nw-val { font-size: 15px; font-weight: 700; color: white; margin-top: 1px; }
.nw-val.income { color: #a7f3d0; }
.nw-val.expense { color: #fca5a5; }
.nw-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.15); }

/* ---- WALLET ROW ---- */
.wallet-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 18px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.wallet-row::-webkit-scrollbar { display: none; }
.wallet-chip {
  flex-shrink: 0; padding: 12px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  cursor: pointer; transition: var(--transition); min-width: 130px;
}
.wallet-chip:hover { border-color: var(--accent); background: var(--accent-light); }
.wallet-chip-name { font-size: 11px; color: var(--text-secondary); margin-bottom: 5px; }
.wallet-chip-bal { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.wallet-chip-type { font-size: 10px; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; }

/* ---- WALLETS GRID ---- */
.wallets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.wallet-card {
  border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden;
  cursor: pointer; transition: var(--transition); animation: fadeSlideUp 0.3s ease;
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.wallet-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.wallet-card-type { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; }
.wallet-card-icon { font-size: 34px; margin-bottom: 12px; }
.wallet-card-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: white; margin-bottom: 4px; }
.wallet-card-balance { font-size: 26px; font-weight: 800; color: white; font-family: var(--font-display); }
.wallet-card-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; opacity: 0; transition: var(--transition); }
.wallet-card:hover .wallet-card-actions { opacity: 1; }

/* ---- QUICK STATS ---- */
.quick-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 22px; }
.stat-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius); padding: 18px; display: flex; align-items: center; gap: 12px; transition: var(--transition);
}
.stat-card:hover { background: rgba(255,255,255,0.08); border-color: var(--accent); transform: translateY(-2px); }
.stat-icon { font-size: 24px; }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 3px; }
.stat-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-primary); }

/* ---- CARDS ---- */
.card {
  position: relative;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px; padding: 22px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  margin-bottom: 20px; overflow: hidden;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.card-period { font-size: 12px; color: var(--text-secondary); background: rgba(255,255,255,0.06); padding: 4px 10px; border-radius: 12px; }

/* ---- CATEGORY BARS ---- */
.cat-bar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.cat-bar-name { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.cat-bar-amount { font-size: 12px; color: var(--text-primary); font-weight: 600; }
.cat-bar-track { height: 7px; background: rgba(255,255,255,0.05); border-radius: 999px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 999px; transition: width 1s cubic-bezier(0.4,0,0.2,1); }
.category-bars { display: flex; flex-direction: column; gap: 12px; }
.cat-bar-item { display: flex; flex-direction: column; gap: 5px; }

/* ---- TRANSACTION LIST ---- */
.transaction-list { display: flex; flex-direction: column; gap: 8px; }
.transaction-list.full { margin-top: 14px; }
.tx-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; transition: var(--transition); animation: fadeSlideUp 0.3s ease;
}
.tx-item:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); }
.tx-item:active { transform: scale(0.99); }
.tx-icon { width: 42px; height: 42px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.tx-amount { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.tx-amount.income { color: var(--income); }
.tx-amount.expense { color: var(--expense); }
.tx-amount.transfer { color: var(--transfer); }
.tx-actions { display: flex; gap: 5px; opacity: 0; transition: var(--transition); }
.tx-item:hover .tx-actions { opacity: 1; }
.tx-action-btn {
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: rgba(255,255,255,0.07); color: var(--text-secondary);
  font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.tx-action-btn:hover { background: rgba(255,255,255,0.13); color: var(--text-primary); }
.tx-action-btn.delete:hover { background: rgba(244,63,94,0.2); color: var(--expense); }

/* ---- FILTER BAR ---- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-select, .filter-input {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary); font-family: var(--font); font-size: 13px;
  outline: none; transition: var(--transition); -webkit-appearance: none; appearance: none;
}
.filter-select:focus, .filter-input:focus { border-color: var(--accent); }
.filter-input { flex: 1; min-width: 150px; }

/* ---- BUDGET ---- */
.budget-summary-bar { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 18px; }
.bsb-item {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-sm); padding: 16px; text-align: center;
}
.bsb-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 600; letter-spacing: 0.5px; }
.bsb-val { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-primary); }
.bsb-val.danger { color: var(--expense); }
.bsb-val.success { color: var(--income); }
.budget-list { display: flex; flex-direction: column; gap: 10px; }
.budget-item {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius); padding: 18px 20px; transition: var(--transition); animation: fadeSlideUp 0.3s ease;
}
.budget-item:hover { border-color: var(--accent); background: rgba(255,255,255,0.06); }
.budget-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.budget-cat { display: flex; align-items: center; gap: 10px; }
.budget-cat-icon { font-size: 20px; }
.budget-cat-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.budget-cat-period { font-size: 10px; color: var(--text-muted); }
.budget-amounts { text-align: right; }
.budget-spent { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.budget-limit { font-size: 11px; color: var(--text-secondary); }
.budget-progress-track { height: 9px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; margin-bottom: 7px; }
.budget-progress-fill { height: 100%; border-radius: 999px; transition: width 1s cubic-bezier(0.4,0,0.2,1); }
.budget-progress-fill.safe { background: linear-gradient(90deg, var(--income), #059669); }
.budget-progress-fill.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.budget-progress-fill.danger { background: linear-gradient(90deg, var(--expense), #be123c); }
.budget-footer { display: flex; justify-content: space-between; align-items: center; }
.budget-remain { font-size: 11px; color: var(--text-secondary); }
.budget-remain .good { color: var(--income); font-weight: 600; }
.budget-remain .bad { color: var(--expense); font-weight: 600; }
.budget-actions { display: flex; gap: 6px; }

/* ---- GOALS ---- */
.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.goal-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius); padding: 22px; transition: var(--transition); animation: fadeSlideUp 0.3s ease; position: relative; overflow: hidden;
}
.goal-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.25); }
.goal-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.goal-icon-display { font-size: 36px; }
.goal-actions { display: flex; gap: 5px; opacity: 0; transition: var(--transition); }
.goal-card:hover .goal-actions { opacity: 1; }
.goal-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.goal-target-txt { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.goal-pct-num { font-size: 30px; font-weight: 800; font-family: var(--font-display); color: var(--accent); margin-bottom: 6px; }
.goal-progress-track { height: 10px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.goal-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #3b82f6); transition: width 1s cubic-bezier(0.4,0,0.2,1); }
.goal-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); }
.goal-days-left { font-weight: 700; color: var(--accent); }

/* ---- ANALYTICS ---- */
.analytics-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.analytics-card { margin-bottom: 0; }
.analytics-card.wide { grid-column: 1 / -1; }
.chart-container { height: 220px; position: relative; display: flex; align-items: flex-end; }
.chart-container.small { height: 190px; }
.chart-container canvas { width: 100% !important; max-height: 100%; }
.pie-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pie-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); }
.pie-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.insights-list { display: flex; flex-direction: column; gap: 9px; }
.insight-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px;
  border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.07); animation: fadeSlideUp 0.3s ease;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.insight-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.insight-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.insight-text strong { color: var(--text-primary); }
.insight-item.positive { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.06); }
.insight-item.warning { border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.06); }
.insight-item.danger { border-color: rgba(244,63,94,0.25); background: rgba(244,63,94,0.06); }

/* ---- SETTINGS ---- */
.settings-sections { display: flex; flex-direction: column; gap: 20px; }
.settings-heading { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; }
.settings-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius); overflow: hidden;
}
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); gap: 12px; }
.setting-row:last-child { border-bottom: none; }
.setting-row.danger-row { background: rgba(244,63,94,0.04); }
.setting-label { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.setting-label.danger { color: var(--expense); }
.setting-sub { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.profile-edit { display: flex; gap: 20px; padding: 20px; align-items: flex-start; }
.profile-avatar-large {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: white; flex-shrink: 0; overflow: hidden;
  box-shadow: 0 0 0 3px var(--accent-light);
}
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.profile-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 11px; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.5px; }
.field-input {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.06);
  color: var(--text-primary); font-family: var(--font); font-size: 14px; outline: none; transition: var(--transition);
  -webkit-appearance: none; appearance: none;
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.toggle { position: relative; display: inline-flex; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { display: block; width: 48px; height: 28px; border-radius: 999px; background: rgba(255,255,255,0.12); transition: var(--transition); position: relative; }
.toggle-slider::after { content: ''; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: white; transition: var(--transition); }
.toggle input:checked + .toggle-slider { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); }
.accent-swatches { display: flex; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: var(--transition); }
.swatch.active, .swatch:hover { border-color: white; transform: scale(1.25); box-shadow: 0 0 10px rgba(0,0,0,0.3); }
.about-card { display: flex; flex-direction: column; align-items: center; padding: 30px; text-align: center; }
.about-logo { font-size: 48px; margin-bottom: 12px; filter: drop-shadow(0 0 15px var(--accent-glow)); }
.about-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.about-version { font-size: 12px; color: var(--accent); margin: 4px 0 12px; font-weight: 600; }
.about-desc { font-size: 13px; color: var(--text-secondary); max-width: 300px; line-height: 1.7; }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 500;
  padding: 0; opacity: 0; visibility: hidden; transition: all 0.25s ease;
}
@media (min-width: 600px) { .modal-overlay { align-items: center; padding: 20px; } }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: rgba(20,20,36,0.92);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.10);
  border-top: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 500px; max-height: 92vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.12);
  transform: translateY(60px); transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  padding-bottom: var(--safe-bottom);
}
@media (min-width: 600px) { .modal { border-radius: var(--radius); transform: translateY(20px) scale(0.96); } }
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal.modal-sm { max-width: 360px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky; top: 0;
  background: rgba(20,20,36,0.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 1;
}
.modal-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-xs); border: none;
  background: rgba(255,255,255,0.07); color: var(--text-secondary); font-size: 13px;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.13); color: var(--text-primary); }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.type-tabs {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 5px;
  background: rgba(255,255,255,0.04); padding: 4px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.07);
}
.type-tab {
  padding: 10px; border-radius: var(--radius-xs); border: none;
  background: transparent; color: var(--text-secondary);
  font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.type-tab.active { background: rgba(255,255,255,0.10); color: var(--text-primary); }
.amount-display-wrap {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.05); border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.09); padding: 4px 18px;
}
.amount-currency-sym { font-size: 22px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.8px; }
.form-input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary); font-family: var(--font); font-size: 14px; outline: none; transition: var(--transition);
  -webkit-appearance: none; appearance: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.form-input option { background: #1a1a2e; }
.large-input { font-size: 30px; font-weight: 800; font-family: var(--font-display); border: none; background: transparent; padding: 10px 0; flex: 1; }
.range-input { width: 100%; accent-color: var(--accent); cursor: pointer; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.emoji-cat-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 8px; border-radius: var(--radius-sm);
  border: 2px solid rgba(255,255,255,0.08); background: transparent; cursor: pointer; transition: var(--transition);
}
.emoji-cat-btn:hover, .emoji-cat-btn.active { border-color: var(--accent); background: var(--accent-light); }
.emoji-cat-icon { font-size: 19px; }
.emoji-cat-label { font-size: 9px; color: var(--text-secondary); text-align: center; white-space: nowrap; }
.goal-icon-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.goal-icon-btn {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  border: 2px solid rgba(255,255,255,0.08); background: transparent; font-size: 22px;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.goal-icon-btn.active, .goal-icon-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.wallet-color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.wcolor { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: var(--transition); }
.wcolor.active, .wcolor:hover { border-color: white; transform: scale(1.2); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* ---- BUTTONS ---- */
.btn-primary {
  padding: 12px 20px; border-radius: var(--radius-sm); border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white; font-family: var(--font); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  -webkit-tap-highlight-color: transparent; box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  padding: 11px 18px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05);
  color: var(--text-primary); font-family: var(--font); font-size: 13px; cursor: pointer; transition: var(--transition);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger {
  padding: 11px 18px; border-radius: var(--radius-sm); border: none;
  background: rgba(244,63,94,0.12); color: var(--expense);
  font-family: var(--font); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.btn-danger:hover { background: rgba(244,63,94,0.25); }
.btn-link {
  padding: 0; border: none; background: transparent; color: var(--accent);
  font-family: var(--font); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: var(--transition); -webkit-tap-highlight-color: transparent;
}
.btn-link:hover { text-decoration: underline; opacity: 0.85; }

/* ---- EMPTY STATES ---- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; }
.empty-icon { font-size: 56px; margin-bottom: 14px; opacity: 0.45; }
.empty-text { font-size: 16px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub { font-size: 12px; color: var(--text-muted); }
.empty-state-sm { font-size: 13px; color: var(--text-muted); padding: 12px 0; }

/* ---- TOAST ---- */
.toast-container { position: fixed; bottom: calc(90px + var(--safe-bottom)); right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.toast {
  display: flex; align-items: center; gap: 8px; padding: 13px 18px;
  border-radius: var(--radius-sm);
  background: rgba(20,20,36,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); font-size: 13px; color: var(--text-primary);
  animation: toastIn 0.3s ease; min-width: 220px; max-width: 340px;
}
.toast.success { border-left: 3px solid var(--income); }
.toast.error { border-left: 3px solid var(--expense); }
.toast.info { border-left: 3px solid #3b82f6; }
.toast.warning { border-left: 3px solid #f59e0b; }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast.hiding { animation: toastOut 0.3s ease forwards; }

/* ---- INSTALL BANNER ---- */
.install-banner {
  position: fixed; bottom: calc(80px + var(--safe-bottom)); left: 16px; right: 16px;
  background: rgba(20,20,36,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px 18px;
  display: none; align-items: center; gap: 10px; z-index: 400;
  box-shadow: 0 8px 32px var(--accent-glow); animation: slideUp 0.4s ease;
}
.install-banner.visible { display: flex; }
.install-icon { font-size: 24px; }
.install-text { flex: 1; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.install-btn { padding: 8px 16px; border-radius: var(--radius-xs); border: none; background: var(--accent); color: white; font-weight: 700; font-size: 13px; cursor: pointer; }
.install-close { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px; }

/* ---- UTILITIES ---- */
.mt-8 { margin-top: 8px; }
.hidden { display: none !important; }

/* ---- ANIMATIONS ---- */
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes loaderFill { from { width: 0; } to { width: 100%; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(24px); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 20px rgba(16,185,129,0); } }

/* ---- PIN PAD ---- */
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.15); transition: 0.2s; }
.pin-dot.filled { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.pin-btn {
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.07);
  color: var(--text-primary); font-size: 26px; font-weight: 700; font-family: var(--font-display);
  cursor: pointer; transition: 0.1s; display: flex; align-items: center; justify-content: center;
  margin: 0 auto; -webkit-tap-highlight-color: transparent;
}
.pin-btn:active { transform: scale(0.88); background: var(--accent-light); color: var(--accent); }

/* ---- PRIVACY MODE ---- */
body.privacy-enabled .nw-amount,
body.privacy-enabled .nw-val,
body.privacy-enabled .wallet-chip-bal,
body.privacy-enabled .wallet-card-balance,
body.privacy-enabled .stat-value,
body.privacy-enabled .cat-bar-amount,
body.privacy-enabled .tx-amount,
body.privacy-enabled .bsb-val,
body.privacy-enabled .budget-spent,
body.privacy-enabled .goal-target-txt,
body.privacy-enabled .goal-meta span {
  filter: blur(8px); opacity: 0.6; pointer-events: none; user-select: none; transition: 0.3s ease;
}
body.privacy-enabled .nw-amount:hover,
body.privacy-enabled .wallet-card-balance:hover { filter: blur(0); opacity: 1; pointer-events: auto; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 999px; }

/* ============================================================
   RESPONSIVE — MOBILE FIRST
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%); z-index: 500;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 24px 0 60px rgba(0,0,0,0.6); }
  .main-content { margin-left: 0; }
  .bottom-nav { display: flex; }
  #mobileMenuBtn { display: flex; }
  .page { padding: 16px 18px calc(var(--bnav-height) + var(--safe-bottom) + 24px); padding-top: calc(16px + var(--safe-top)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-card.wide { grid-column: 1; }
  .nw-amount { font-size: 34px; }
  .toast-container { bottom: calc(var(--bnav-height) + 12px + var(--safe-bottom)); left: 16px; right: 16px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .main-content { height: 100%; }
  .live-clock { display: none; }
}

/* Mobile — small screens */
@media (max-width: 600px) {
  .quick-stats { gap: 8px; }
  .stat-card { padding: 14px 12px; }
  .stat-icon { font-size: 20px; }
  .stat-value { font-size: 16px; }
  .budget-summary-bar { grid-template-columns: repeat(3,1fr); gap: 8px; }
  .bsb-val { font-size: 15px; }
  .goals-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-title { font-size: 22px; }
  .filter-bar { flex-direction: column; }
  .filter-select { width: 100%; }
  .nw-amount { font-size: 28px; }
  .net-worth-card { padding: 22px; }
  .nw-breakdown { gap: 10px; }
  /* Auth — bottom sheet style on mobile */
  .auth-container { border-radius: 28px 28px 0 0; max-height: 96vh; overflow-y: auto; padding: 32px 24px; }
  .auth-screen { align-items: flex-end; padding: 0; }
  /* Cards */
  .card { padding: 18px 16px; border-radius: 20px; }
  .wallet-chip { min-width: 110px; }
  .wallets-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .wallet-card { padding: 18px; }
  .wallet-card-balance { font-size: 20px; }
  .modal { border-radius: 24px 24px 0 0; }
  .page-header { flex-direction: row; flex-wrap: wrap; }
  .header-actions { gap: 6px; }
  .savings-tips-card { padding: 16px; }
}

/* Very small screens */
@media (max-width: 380px) {
  .quick-stats { grid-template-columns: 1fr 1fr; }
  .nw-amount { font-size: 24px; }
  .auth-brand-name { font-size: 26px; }
  .wallets-grid { grid-template-columns: 1fr; }
  .budget-summary-bar { grid-template-columns: 1fr 1fr; }
}

/* iOS specific */
@supports (-webkit-touch-callout: none) {
  .bottom-nav { padding-bottom: max(var(--safe-bottom), 14px); }
  .modal { padding-bottom: max(var(--safe-bottom), 20px); }
  input, select, textarea { font-size: 16px !important; }
}
