/* ============================
   MONEY FLOW - Light Mode CSS
   Clean & Premium Design
   ============================ */

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

/* ── CSS Variables (Light Mode) ── */
:root {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-modal: #ffffff;
  --bg-input: #f1f5f9;

  --color-emerald: #10b981;
  --color-emerald-light: #34d399;
  --color-emerald-dark: #059669;
  --color-indigo: #6366f1;
  --color-indigo-light: #818cf8;
  --color-amber: #d97706;
  --color-rose: #e11d48;
  --color-sky: #0284c7;
  --color-violet: #7c3aed;
  --color-teal: #0d9488;
  --color-orange: #ea580c;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #059669;

  --border-color: #e2e8f0;
  --border-accent: rgba(16, 185, 129, 0.35);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 24px rgba(16, 185, 129, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --sidebar-width: 260px;
  --header-height: 64px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 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-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Background Gradient (subtle on light) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(16,185,129,0.06) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 110%, rgba(99,102,241,0.04) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ════════════════════════════
   LOGIN / PIN SCREEN
   ════════════════════════════ */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-container {
  width: 100%;
  max-width: 400px;
  animation: fadeInUp 0.5s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo img {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-glow), var(--shadow-md);
}

.login-logo h1 {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #059669, #10b981, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 13px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px 28px 36px;
  box-shadow: var(--shadow-lg);
}

.login-card h2 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 4px;
  text-align: center;
  color: var(--text-primary);
}

.login-card .subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  margin-bottom: 4px;
}

/* ── PIN Display ── */
.pin-display {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 20px 0 6px;
}

.pin-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: transparent;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-dot.filled {
  background: var(--color-emerald);
  border-color: var(--color-emerald);
  transform: scale(1.12);
  box-shadow: 0 0 8px rgba(16,185,129,0.4);
}

.pin-dot.error {
  background: var(--color-rose);
  border-color: var(--color-rose);
  box-shadow: 0 0 8px rgba(225,29,72,0.35);
  animation: shake 0.45s ease;
}

.pin-dot.success {
  background: var(--color-emerald);
  border-color: var(--color-emerald);
  animation: pinPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.pin-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  min-height: 20px;
  transition: color 0.2s;
}

/* ── PIN Keypad ── */
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 0 auto;
}

.pin-key {
  height: 62px;
  border-radius: var(--radius-md);
  font-size: 22px;
  font-weight: 600;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
  transition: all 0.15s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.pin-key::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-emerald);
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: inherit;
}

.pin-key:hover {
  border-color: var(--color-emerald);
  color: var(--color-emerald);
  background: rgba(16,185,129,0.06);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pin-key:active {
  transform: scale(0.94);
  background: rgba(16,185,129,0.15);
}

.pin-key-back {
  background: rgba(225,29,72,0.05);
  color: var(--color-rose);
  border-color: rgba(225,29,72,0.2);
}

.pin-key-back:hover {
  background: rgba(225,29,72,0.1);
  border-color: var(--color-rose);
  color: var(--color-rose);
}

.pin-key-confirm {
  background: rgba(16,185,129,0.08);
  color: var(--color-emerald);
  border-color: rgba(16,185,129,0.35);
  font-size: 22px;
}

.pin-key-confirm:not(:disabled):hover {
  background: var(--color-emerald);
  color: white;
  border-color: var(--color-emerald);
}

.pin-key-confirm:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.login-hint {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.login-hint span { color: var(--color-emerald); font-weight: 600; }

/* ── Change PIN Modal Keypad ── */
.pin-keypad-sm {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 240px;
  margin: 0 auto;
}

.pin-key-sm {
  height: 52px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 600;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
  transition: all 0.15s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.pin-key-sm:hover {
  border-color: var(--color-emerald);
  color: var(--color-emerald);
  background: rgba(16,185,129,0.06);
}

.pin-key-sm:active { transform: scale(0.93); }

.pin-key-sm.back {
  background: rgba(225,29,72,0.05);
  color: var(--color-rose);
  border-color: rgba(225,29,72,0.2);
}

.pin-key-sm.back:hover { background: rgba(225,29,72,0.12); }

.pin-step-title {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.pin-step-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 6px;
}

.pin-step-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  min-height: 18px;
}

/* ════════════════════════════
   APP LAYOUT
   ════════════════════════════ */
#app-screen { display: none; }

.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-emerald), var(--color-emerald-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(16,185,129,0.25);
  flex-shrink: 0;
}

.sidebar-brand h2 { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sidebar-brand p { font-size: 11px; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 14px 12px; }

.nav-section { margin-bottom: 22px; }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  position: relative;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(16,185,129,0.09);
  color: var(--color-emerald-dark);
  border-color: rgba(16,185,129,0.2);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--color-emerald);
  border-radius: 0 3px 3px 0;
}

.nav-item svg { flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--color-rose);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border-color);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-indigo), var(--color-violet));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.user-info .user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(225,29,72,0.07);
  color: var(--color-rose);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 99;
  backdrop-filter: blur(3px);
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ── Top Header ── */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}

.menu-toggle:hover { background: #e2e8f0; color: var(--text-primary); }

.page-title-header { flex: 1; }
.page-title-header h1 { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.page-title-header p { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.btn-add-quick {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-emerald), var(--color-emerald-dark));
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(16,185,129,0.3);
  white-space: nowrap;
}

.btn-add-quick:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16,185,129,0.4);
}

.notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition);
}

.notif-btn:hover { background: #e2e8f0; color: var(--text-primary); }

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: var(--color-rose);
  border-radius: 50%;
  border: 2px solid white;
  display: none;
}

.notif-dot.active { display: block; }

/* ── Page Content ── */
.page-content {
  flex: 1;
  padding: 24px;
  display: none;
}

.page-content.active { display: block; }

/* ════════════════════════════
   CARDS & COMPONENTS
   ════════════════════════════ */

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.glass-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--color-emerald));
  opacity: 0.7;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card .stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-bg, rgba(16,185,129,0.12));
  color: var(--icon-color, var(--color-emerald));
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.stat-card .stat-sub { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
}

.stat-change.positive { background: rgba(16,185,129,0.12); color: var(--color-emerald-dark); }
.stat-change.negative { background: rgba(225,29,72,0.1); color: var(--color-rose); }

/* Grids */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.section-header h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.btn-text { font-size: 12.5px; color: var(--color-emerald-dark); font-weight: 600; transition: var(--transition); }
.btn-text:hover { color: var(--color-emerald); }

/* Chart */
.chart-wrapper { position: relative; height: 250px; }
.chart-wrapper.sm { height: 180px; }
.chart-wrapper.lg { height: 320px; }

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-emerald), var(--color-emerald-light));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

.progress-fill.danger { background: linear-gradient(90deg, var(--color-rose), #fb7185); }
.progress-fill.warning { background: linear-gradient(90deg, var(--color-amber), #fbbf24); }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.badge-income { background: rgba(16,185,129,0.12); color: var(--color-emerald-dark); border: 1px solid rgba(16,185,129,0.2); }
.badge-expense { background: rgba(225,29,72,0.1); color: var(--color-rose); border: 1px solid rgba(225,29,72,0.15); }
.badge-invest { background: rgba(99,102,241,0.1); color: var(--color-indigo); border: 1px solid rgba(99,102,241,0.2); }
.badge-saving { background: rgba(2,132,199,0.1); color: var(--color-sky); border: 1px solid rgba(2,132,199,0.2); }

/* Tag */
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid #e2e8f0;
}

/* ════════════════════════════
   DASHBOARD
   ════════════════════════════ */

.dashboard-welcome { margin-bottom: 20px; }
.dashboard-welcome h2 { font-size: 21px; font-weight: 700; margin-bottom: 3px; color: var(--text-primary); }
.dashboard-welcome p { color: var(--text-secondary); font-size: 13px; }

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid;
}

.alert-banner.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-banner.danger { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.alert-banner.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-banner.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

/* Recent Transactions */
.txn-list { display: flex; flex-direction: column; gap: 2px; }

.txn-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.txn-item:hover { background: #f8fafc; }

.txn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.txn-info { flex: 1; min-width: 0; }
.txn-info .txn-desc { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.txn-info .txn-meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.txn-amount { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.txn-amount.income { color: var(--color-emerald-dark); }
.txn-amount.expense { color: var(--color-rose); }

/* Goal Progress */
.goal-progress-item { margin-bottom: 16px; }
.goal-progress-item:last-child { margin-bottom: 0; }
.goal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.goal-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.goal-pct { font-size: 12px; font-weight: 700; color: var(--color-emerald-dark); }
.goal-amounts { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Events */
.today-events { display: flex; flex-direction: column; gap: 8px; }

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-emerald);
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--color-emerald);
}

.event-item.reminder { border-left-color: var(--color-amber); }
.event-item.payment { border-left-color: var(--color-rose); }
.event-item.event { border-left-color: var(--color-sky); }

.event-time { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.event-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.event-notes { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ════════════════════════════
   TRANSACTIONS PAGE
   ════════════════════════════ */

.txn-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-btn {
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: var(--transition);
}

.filter-btn:hover { border-color: var(--color-emerald); color: var(--color-emerald-dark); }
.filter-btn.active { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.35); color: var(--color-emerald-dark); font-weight: 600; }

.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 16px 8px 38px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus { border-color: var(--color-emerald); background: rgba(16,185,129,0.04); }
.search-box input::placeholder { color: var(--text-muted); }

.select-input {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.select-input:focus { border-color: var(--color-emerald); }

/* Transaction Table */
.txn-table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); }

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

.txn-table th {
  background: #f8fafc;
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}

.txn-table td {
  padding: 13px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-primary);
}

.txn-table tbody tr:last-child td { border-bottom: none; }
.txn-table tbody tr { transition: var(--transition); cursor: pointer; }
.txn-table tbody tr:hover { background: #f8fafc; }
.txn-table .amount-cell { font-weight: 700; font-size: 14px; }

.txn-actions { display: flex; gap: 6px; }

.action-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  color: var(--text-muted);
}

.action-btn:hover.edit { background: rgba(99,102,241,0.1); color: var(--color-indigo); }
.action-btn:hover.delete { background: rgba(225,29,72,0.1); color: var(--color-rose); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; }

.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition);
}

.page-btn:hover, .page-btn.active {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.35);
  color: var(--color-emerald-dark);
}

/* ════════════════════════════
   CALENDAR PAGE
   ════════════════════════════ */

.calendar-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }

.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }

.calendar-nav { display: flex; align-items: center; gap: 10px; }

.cal-nav-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition);
}

.cal-nav-btn:hover { background: #f1f5f9; color: var(--text-primary); }

.calendar-title { font-size: 16px; font-weight: 700; min-width: 180px; text-align: center; color: var(--text-primary); }

.calendar-grid { border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }

.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: #f8fafc; border-bottom: 1px solid var(--border-color); }

.cal-weekday { padding: 10px 0; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg-card); }

.cal-day {
  min-height: 88px;
  padding: 8px;
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.cal-day:hover { background: #f8fafc; }
.cal-day.other-month { opacity: 0.35; background: #fafafa; }
.cal-day.today { background: rgba(16,185,129,0.05); }

.cal-day.today .cal-day-num {
  background: var(--color-emerald);
  color: white;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16,185,129,0.35);
}

.cal-day.selected { background: rgba(16,185,129,0.08); outline: 2px solid rgba(16,185,129,0.3); outline-offset: -1px; }

.cal-day-num { font-size: 13px; font-weight: 600; margin-bottom: 4px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--text-primary); }

.cal-day-dots { display: flex; flex-direction: column; gap: 2px; }

.cal-dot {
  font-size: 10px;
  color: var(--text-muted);
  background: #f1f5f9;
  border-radius: 3px;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-dot.event { color: var(--color-sky); background: rgba(2,132,199,0.08); }
.cal-dot.reminder { color: var(--color-amber); background: rgba(217,119,6,0.08); }
.cal-dot.payment { color: var(--color-rose); background: rgba(225,29,72,0.08); }
.cal-dot.txn-income { color: var(--color-emerald-dark); background: rgba(16,185,129,0.08); }
.cal-dot.txn-expense { color: var(--color-rose); background: rgba(225,29,72,0.08); }

.cal-sidebar-panel { display: flex; flex-direction: column; gap: 14px; }

.selected-day-info { font-size: 14px; font-weight: 600; color: var(--color-emerald-dark); margin-bottom: 12px; }

.event-form { display: flex; flex-direction: column; gap: 12px; }

/* ════════════════════════════
   INVESTMENTS PAGE
   ════════════════════════════ */

.invest-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }

.invest-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.invest-card:hover { box-shadow: var(--shadow-md); }

.invest-list { display: flex; flex-direction: column; gap: 12px; }

.invest-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

.invest-item:hover { border-color: #cbd5e1; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.invest-item-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.invest-name { font-size: 15px; font-weight: 600; margin-bottom: 3px; color: var(--text-primary); }
.invest-type { font-size: 11px; color: var(--text-muted); }
.invest-values { text-align: right; }
.invest-current { font-size: 18px; font-weight: 800; color: var(--color-sky); }

.invest-return {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  display: inline-block;
}

.invest-return.positive { color: var(--color-emerald-dark); background: rgba(16,185,129,0.1); }
.invest-return.negative { color: var(--color-rose); background: rgba(225,29,72,0.1); }

.invest-detail { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }

/* Savings Goals */
.savings-goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.savings-goal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.savings-goal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--goal-color, var(--color-emerald));
}

.savings-goal-card:hover { border-color: #cbd5e1; transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ════════════════════════════
   REPORTS PAGE
   ════════════════════════════ */

.report-month-selector { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }

.month-chip {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.month-chip.active { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.35); color: var(--color-emerald-dark); font-weight: 600; }
.month-chip:hover { border-color: #cbd5e1; color: var(--text-primary); }

.category-breakdown { display: flex; flex-direction: column; gap: 10px; }
.cat-breakdown-item { display: flex; align-items: center; gap: 12px; }
.cat-color { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.cat-name { flex: 1; font-size: 13px; color: var(--text-primary); }
.cat-amount { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.cat-pct { font-size: 12px; color: var(--text-muted); width: 40px; text-align: right; }

/* ════════════════════════════
   SETTINGS PAGE
   ════════════════════════════ */

.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }

.settings-nav { display: flex; flex-direction: column; gap: 4px; }

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.settings-nav-item:hover { background: #f1f5f9; color: var(--text-primary); }
.settings-nav-item.active { background: rgba(16,185,129,0.08); color: var(--color-emerald-dark); font-weight: 600; }

.settings-section { display: none; }
.settings-section.active { display: block; }

.settings-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); }

.setting-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f1f5f9;
}

.setting-item:last-child { border-bottom: none; }
.setting-info { flex: 1; }
.setting-label { font-size: 14px; font-weight: 500; margin-bottom: 3px; color: var(--text-primary); }
.setting-desc { font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════
   MODAL
   ════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-modal);
  z-index: 1;
}

.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--text-secondary);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.modal-close:hover { background: rgba(225,29,72,0.1); color: var(--color-rose); border-color: rgba(225,29,72,0.2); }

.modal-body { padding: 22px 24px; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 24px;
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: 0;
  background: var(--bg-modal);
}

/* Form Controls */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--color-emerald);
  background: rgba(16,185,129,0.04);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 80px; }

.type-toggle {
  display: flex;
  gap: 0;
  background: #f1f5f9;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  overflow: hidden;
}

.type-toggle-btn {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.type-toggle-btn.income.active { background: rgba(16,185,129,0.15); color: var(--color-emerald-dark); }
.type-toggle-btn.expense.active { background: rgba(225,29,72,0.12); color: var(--color-rose); }

/* Buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--color-emerald), var(--color-emerald-dark));
  color: white;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  box-shadow: 0 2px 10px rgba(16,185,129,0.3);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(16,185,129,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.btn-secondary:hover { background: #e2e8f0; border-color: #cbd5e1; }

.btn-danger {
  background: rgba(225,29,72,0.08);
  border: 1.5px solid rgba(225,29,72,0.2);
  color: var(--color-rose);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.btn-danger:hover { background: rgba(225,29,72,0.15); border-color: rgba(225,29,72,0.35); }

.btn-icon {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition);
}

.btn-icon:hover { background: #e2e8f0; color: var(--text-primary); border-color: #cbd5e1; }

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 14px; opacity: 0.6; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 17px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  animation: slideInRight 0.3s ease, fadeOut 0.4s ease 2.6s forwards;
  pointer-events: all;
}

.toast.success { border-left: 3px solid var(--color-emerald); }
.toast.error { border-left: 3px solid var(--color-rose); }
.toast.info { border-left: 3px solid var(--color-sky); }
.toast.warning { border-left: 3px solid var(--color-amber); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-message { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--text-primary); }

/* PWA Install Banner */
.install-banner {
  display: none;
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1.5px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  z-index: 150;
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  animation: fadeInUp 0.4s ease;
}

.install-banner.show { display: flex; align-items: center; gap: 16px; }
.install-banner p { flex: 1; font-size: 13px; color: var(--text-secondary); }
.install-banner p strong { color: var(--text-primary); display: block; font-size: 14px; margin-bottom: 2px; }

/* ════════════════════════════
   GOALS PAGE
   ════════════════════════════ */

/* ════════════════════════════
   ANIMATIONS
   ════════════════════════════ */

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(40px); }
}

@keyframes shimmer {
  from { left: -100%; }
  to { left: 200%; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

@keyframes pinPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.animate-in { animation: fadeInUp 0.35s ease; }

/* ════════════════════════════
   MISC COMPONENTS
   ════════════════════════════ */

.divider { height: 1px; background: var(--border-color); margin: 20px 0; }

.text-muted { color: var(--text-muted); font-size: 13px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }

/* Tab System */
.tab-list {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: center;
}

.tab-btn.active {
  background: white;
  color: var(--color-emerald-dark);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.25s ease; }

/* Switch Toggle */
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  inset: 0;
  background: #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.3s;
  border: 1.5px solid #cbd5e1;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider { background: var(--color-emerald); border-color: var(--color-emerald-dark); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* Color Options */
.color-options { display: flex; gap: 8px; flex-wrap: wrap; }

.color-opt {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  box-shadow: var(--shadow-xs);
}

.color-opt:hover, .color-opt.selected {
  border-color: white;
  outline: 2px solid #94a3b8;
  transform: scale(1.15);
}

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

/* ════════════════════════════
   RESPONSIVE — TABLET
   ════════════════════════════ */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .invest-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
  .calendar-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; }
}

/* ════════════════════════════
   RESPONSIVE — MOBILE
   ════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-width: 260px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .menu-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2-1 { grid-template-columns: 1fr; }
  .btn-add-quick span { display: none; }
  .txn-filters { flex-direction: column; align-items: stretch; }
  .filter-group { overflow-x: auto; }
  .search-box { min-width: unset; }
  .form-row { grid-template-columns: 1fr; }
  .top-header { padding: 0 16px; }
  .modal { max-height: 95vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .cal-day { min-height: 58px; }
  .invest-summary-grid { grid-template-columns: 1fr; }
  .savings-goals-grid { grid-template-columns: 1fr; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { min-width: unset; }
}

@media (max-width: 480px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 20px; }
  .login-card { padding: 24px 20px 28px; }
  .pin-keypad { max-width: 260px; }
  .pin-key { height: 56px; font-size: 20px; }
}

/* ════════════════════════════
   NOTIFICATION PANEL
   ════════════════════════════ */

.notif-wrapper {
  position: relative;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  z-index: 300;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.notif-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(99,102,241,0.04));
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-panel-body {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.notif-panel-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Notification Items */
.notif-item {
  display: flex;
  gap: 11px;
  padding: 11px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-bottom: 5px;
  transition: var(--transition);
  cursor: default;
}

.notif-item:last-child { margin-bottom: 0; }

.notif-item:hover { background: #f8fafc; border-color: var(--border-color); }

.notif-item.today {
  background: rgba(225,29,72,0.04);
  border-color: rgba(225,29,72,0.15);
}

.notif-item.tomorrow {
  background: rgba(245,158,11,0.04);
  border-color: rgba(245,158,11,0.15);
}

.notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.notif-item.today .notif-item-icon { background: rgba(225,29,72,0.08); }
.notif-item.tomorrow .notif-item-icon { background: rgba(245,158,11,0.08); }

.notif-item-body { flex: 1; min-width: 0; }

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.notif-type-tag {
  background: #f1f5f9;
  color: var(--text-secondary);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
}

.notif-item-notes {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.4;
}

.notif-item-amount {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-emerald-dark);
  margin-top: 3px;
}

/* ════════════════════════════
   REPORT HEADER
   ════════════════════════════ */

.report-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 22px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.report-header-left { flex: 1; }
.report-header-right { flex-shrink: 0; }

@media (max-width: 600px) {
  .report-header { flex-direction: column; align-items: stretch; }
  .report-header-right select { width: 100%; }
  .notif-panel { width: 300px; right: -40px; }
}

/* Print */
@media print {
  .sidebar, .top-header, .toast-container, .modal-overlay { display: none !important; }
  .main-content { margin-left: 0; }
  .page-content { display: block !important; }
}

