/* ============================================
   EXPENSE TRACKER - MAIN STYLES
   Glassmorphism Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Quicksand:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

/* ---- CSS Variables ---- */
:root {
  --bg-base: #060818;
  --bg-layer1: #0b0f24;
  --bg-layer2: #0f1530;

  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-blur: blur(20px);
  --glass-blur-heavy: blur(40px);

  --neon-cyan: #00e5ff;
  --neon-purple: #b44aff;
  --neon-green: #00ff9d;
  --neon-pink: #ff2d78;
  --neon-amber: #ffb700;
  --neon-blue: #4d7cff;

  --text-primary: #f0f4ff;
  --text-secondary: rgba(240, 244, 255, 0.6);
  --text-muted: rgba(240, 244, 255, 0.35);

  --success: #00ff9d;
  --warning: #ffb700;
  --danger: #ff2d78;
  --info: #00e5ff;

  --font-display: 'Syne', sans-serif;
  --font-body: 'Quicksand', sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-neon-cyan: 0 0 20px rgba(0, 229, 255, 0.3), 0 0 60px rgba(0, 229, 255, 0.1);
  --shadow-neon-purple: 0 0 20px rgba(180, 74, 255, 0.3), 0 0 60px rgba(180, 74, 255, 0.1);
  --shadow-neon-green: 0 0 20px rgba(0, 255, 157, 0.3), 0 0 60px rgba(0, 255, 157, 0.1);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  --sidebar-width: 260px;
  --nav-height: 70px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Remove arrows/spinners from number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
}

/* ---- Custom Flatpickr Calendar Styling ---- */
.flatpickr-calendar {
  font-family: var(--font-body) !important; /* Forces Quicksand */
  background: rgba(11, 15, 36, 0.95) !important;
  backdrop-filter: var(--glass-blur-heavy) !important;
  -webkit-backdrop-filter: var(--glass-blur-heavy) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--shadow-card) !important;
}
.flatpickr-day.selected {
  background: var(--neon-cyan) !important;
  border-color: var(--neon-cyan) !important;
}

/* Animated background orbs */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -20%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: orbFloat1 20s ease-in-out infinite;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(180, 74, 255, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: orbFloat2 25s ease-in-out infinite;
  z-index: 0;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(5%, 8%) scale(1.05); }
  66% { transform: translate(-3%, 5%) scale(0.97); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-8%, -5%) scale(1.08); }
  66% { transform: translate(4%, -8%) scale(0.95); }
}

/* ---- App Layout ---- */
.app-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(11, 15, 36, 0.8);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-logo {
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 16px;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-neon-cyan);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 1px;
}

.nav-section {
  padding: 0 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-section::-webkit-scrollbar { width: 0; }

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-base);
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
  border-color: var(--glass-border);
}

.nav-item.active {
  color: var(--text-primary);
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.2);
}

.nav-item.active .nav-icon {
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 6px var(--neon-cyan));
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nav-badge {
  margin-left: auto;
  background: var(--neon-cyan);
  color: var(--bg-base);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.nav-badge.warning { background: var(--warning); }
.nav-badge.danger { background: var(--danger); }

.sidebar-footer {
  padding: 16px 24px 0;
  border-top: 1px solid var(--glass-border);
  margin-top: 8px;
}

.budget-mini {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.budget-mini-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 6px;
}

.budget-mini-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.budget-mini-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--transition-slow);
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
}

.budget-mini-fill.warning { background: linear-gradient(90deg, var(--warning), #ff6b00); }
.budget-mini-fill.danger { background: linear-gradient(90deg, var(--danger), #ff6b00); }

.budget-mini-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

.budget-mini-spent { color: var(--text-primary); font-weight: 600; }
.budget-mini-total { color: var(--text-muted); }

/* ---- Main Content ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Top Bar ---- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(6, 8, 24, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.page-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 10px 18px;
  transition: all var(--transition-base);
}

.top-search:focus-within {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.1);
}

.top-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  width: 180px;
}

.top-search input::placeholder { color: var(--text-muted); }
.top-search .search-icon { color: var(--text-muted); font-size: 14px; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--text-secondary);
  font-size: 16px;
  position: relative;
}

.icon-btn:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
}

.icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 2px solid var(--bg-base);
}

/* ---- Alerts Dropdown ---- */
.dropdown-anchor {
  position: relative;
}

.alerts-dropdown {
  position: absolute;
  top: 130%;
  right: 0;
  width: 320px;
  background: rgba(11, 15, 36, 0.95);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: none; /* Hidden by default */
  flex-direction: column;
  z-index: 200;
  cursor: default;
  color: var(--text-primary);
}

.alerts-dropdown.show {
  display: flex;
  animation: fadeInUp 0.2s ease;
  right: 0;
}

.alerts-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alerts-dropdown-body {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
}

.dropdown-alert-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--glass-bg);
  border: 1px solid transparent;
}

.dropdown-alert-item.danger { border-color: rgba(255, 45, 120, 0.3); background: rgba(255, 45, 120, 0.08); }
.dropdown-alert-item.warning { border-color: rgba(255, 183, 0, 0.3); background: rgba(255, 183, 0, 0.08); }

/* ---- Page Content ---- */
.page-content {
  padding: 28px 32px;
  flex: 1;
}

.page {
  display: none;
  animation: fadeInUp 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Glass Cards ---- */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--glass-border-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-body {
  padding: 20px 24px;
}

/* ---- Stat Cards ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.08;
  transition: opacity var(--transition-base);
}

.stat-card:hover::before { opacity: 0.15; }
.stat-card:hover { border-color: var(--glass-border-hover); transform: translateY(-2px); }

.stat-card.cyan::before { background: var(--neon-cyan); }
.stat-card.purple::before { background: var(--neon-purple); }
.stat-card.green::before { background: var(--neon-green); }
.stat-card.pink::before { background: var(--neon-pink); }
.stat-card.blue::before { background: var(--neon-blue); }
.stat-card.amber::before { background: var(--neon-amber); }

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-icon.cyan { background: rgba(0, 229, 255, 0.15); color: var(--neon-cyan); }
.stat-icon.purple { background: rgba(180, 74, 255, 0.15); color: var(--neon-purple); }
.stat-icon.green { background: rgba(0, 255, 157, 0.15); color: var(--neon-green); }
.stat-icon.pink { background: rgba(255, 45, 120, 0.15); color: var(--neon-pink); }
.stat-icon.blue { background: rgba(77, 125, 225, 0.15); color: var(--neon-blue); }
.stat-icon.amber { background: rgba(255, 183 , 0, 0.15); color: var(--neon-amber); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-trend {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend.neutral { color: var(--text-muted); }

/* ---- Charts Grid ---- */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-container {
  position: relative;
  padding: 16px 0;
}

canvas {
  max-width: 100%;
  font-family: 'Quicksand', sans-serif;
}

/* ---- Recent Transactions ---- */
.expense-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expense-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.expense-item:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

.expense-cat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.expense-info {
  flex: 1;
  min-width: 0;
}

.total-total {font-size: 13px; color: var(--text-secondary);}

.smmm, .wppp {
  display: none;
}

.expense-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.expense-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.expense-category-tag {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.expense-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.expense-amount {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--neon-pink);
}

.expense-payment {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.expense-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.expense-item:hover .expense-actions { opacity: 1; }

.action-btn {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition-fast);
}

.action-btn.edit {
  background: rgba(0, 229, 255, 0.1);
  color: var(--neon-cyan);
}

.action-btn.edit:hover {
  background: rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 8px rgba(0,229,255,0.3);
}

.action-btn.delete {
  background: rgba(255, 45, 120, 0.1);
  color: var(--neon-pink);
}

.action-btn.delete:hover {
  background: rgba(255, 45, 120, 0.2);
  box-shadow: 0 0 8px rgba(255,45,120,0.3);
}

/* ---- Category Colors ---- */
.cat-food { background: rgba(255, 183, 0, 0.15); color: #ffb700; }
.cat-transport { background: rgba(0, 229, 255, 0.15); color: var(--neon-cyan); }
.cat-shopping { background: rgba(255, 45, 120, 0.15); color: var(--neon-pink); }
.cat-bills { background: rgba(180, 74, 255, 0.15); color: var(--neon-purple); }
.cat-health { background: rgba(0, 255, 157, 0.15); color: var(--neon-green); }
.cat-entertainment { background: rgba(255, 107, 0, 0.15); color: #ff6b00; }
.cat-education { background: rgba(77, 124, 255, 0.15); color: var(--neon-blue); }
.cat-loan { background: rgba(255, 87, 34, 0.15); color: #ff5722; } /* ADDED LOAN */
.cat-others { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

/* ---- Forms & Modals ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #0d1228;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-slow);
  position: relative;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 45, 120, 0.1);
  border-color: var(--neon-pink);
  color: var(--neon-pink);
}

/* ---- Form Elements ---- */
.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: all var(--transition-base);
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.08);
}

/* ---- Date Picker Styling ---- */
input[type="date"].form-input {
  /* Forces the browser's native dark mode calendar! */
  color-scheme: dark; 
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
  /* Inverts the black calendar icon to a soft white */
  filter: invert(0.8); 
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-base);
}

input[type="date"].form-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffffff40' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

option {
  background: #0d1228;
  color: var(--text-primary);
}

/* Amount Input with currency prefix */
.amount-input-wrap {
  position: relative;
}

.currency-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neon-cyan);
  font-weight: 700;
  font-size: 14px;
}

.amount-input-wrap .form-input {
  padding-left: 36px;
}

/* ---- Custom Segmented Radio Buttons ---- */
.type-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 4px;
    margin-top: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
}
.type-toggle input[type="radio"] {
    display: none;
}
.type-toggle label {
    flex: 1;
    text-align: center;
    padding: 12px;
    margin: 0;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
}
.type-toggle label:hover {
    color: var(--text-primary);
}
.type-toggle input[type="radio"]:checked + label {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
/* Using your existing theme variables for the bottom borders */
#type-expense:checked + label { 
    border-bottom: 2px solid var(--neon-pink); 
    border-bottom-left-radius: 2px; 
    border-bottom-right-radius: 2px;
}
#type-income:checked + label { 
    border-bottom: 2px solid var(--neon-green); 
    border-bottom-left-radius: 2px; 
    border-bottom-right-radius: 2px;
}

/* ADD THESE FOR SAVINGS: */
#sav-deposit:checked + label { 
    border-bottom: 2px solid var(--neon-green); 
    border-bottom-left-radius: 2px; 
    border-bottom-right-radius: 2px;
}
#sav-withdraw:checked + label { 
    border-bottom: 2px solid var(--neon-pink); 
    border-bottom-left-radius: 2px; 
    border-bottom-right-radius: 2px;
}

/* ---- Buttons ---- */
button {
    font-family: var(--font-body);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  color: var(--bg-base);
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(0, 229, 255, 0.4);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.btn-danger {
  background: rgba(255, 45, 120, 0.1);
  border: 1px solid rgba(255, 45, 120, 0.3);
  color: var(--neon-pink);
}

.btn-danger:hover {
  background: rgba(255, 45, 120, 0.2);
  box-shadow: 0 0 20px rgba(255, 45, 120, 0.2);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--bg-base);
  cursor: pointer;
  box-shadow: var(--shadow-neon-cyan);
  z-index: 90;
  transition: all var(--transition-slow);
  border: none;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
}

/* ---- Budget Page ---- */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.budget-category-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all var(--transition-base);
}

.budget-category-card:hover {
  border-color: var(--glass-border-hover);
}

.budget-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.budget-cat-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.budget-cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.budget-cat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.budget-cat-percent {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-display);
}

.budget-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.budget-bar-fill.safe { background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green)); }
.budget-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #ff9500); }
.budget-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #ff6b00); }

.budget-cat-amounts {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.spent-amount { color: var(--text-primary); font-weight: 600; }
.limit-amount { color: var(--text-muted); }

/* Alert badges on budget cards */
.alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alert-badge.warning {
  background: rgba(255, 183, 0, 0.15);
  color: var(--warning);
  border: 1px solid rgba(255, 183, 0, 0.3);
}

.alert-badge.danger {
  background: rgba(255, 45, 120, 0.15);
  color: var(--neon-pink);
  border: 1px solid rgba(255, 45, 120, 0.3);
}

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.filter-chip {
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.filter-chip:hover, .filter-chip.active {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.3);
  color: var(--neon-cyan);
}

.filter-divider {
  width: 1px;
  height: 24px;
  background: var(--glass-border);
}

.filter-select {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 7px 14px;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.filter-select:focus { border-color: var(--neon-cyan); }

.filter-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-date-range input {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 7px 14px;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-body);
  outline: none;
}

.filter-date-range input::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  width: 340px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #0d1228;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
  backdrop-filter: blur(20px);
}

.toast.removing { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(10px) scale(0.9); }
}

.toast-icon { font-size: 18px; }
.toast-msg { font-size: 13px; font-weight: 500; flex: 1; }

.toast.success { border-color: rgba(0, 255, 157, 0.3); }
.toast.success .toast-icon { color: var(--neon-green); }
.toast.error { border-color: rgba(255, 45, 120, 0.3); }
.toast.error .toast-icon { color: var(--neon-pink); }
.toast.warning { border-color: rgba(255, 183, 0, 0.3); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info { border-color: rgba(0, 229, 255, 0.3); }
.toast.info .toast-icon { color: var(--neon-cyan); }

/* ---- Alert Banner ---- */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}

.alert-banner.warning {
  background: rgba(255, 183, 0, 0.08);
  border: 1px solid rgba(255, 183, 0, 0.25);
  color: var(--warning);
}

.alert-banner.danger {
  background: rgba(255, 45, 120, 0.08);
  border: 1px solid rgba(255, 45, 120, 0.25);
  color: var(--neon-pink);
}

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
}

/* ---- Toggle Switch ---- */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--transition-base);
  border: 1px solid var(--glass-border);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform var(--transition-base);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  border-color: transparent;
  box-shadow: 0 0 10px rgba(0,229,255,0.3);
}

.toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---- Section Headers ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Bottom Nav (Mobile) ---- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(11, 15, 36, 0.95);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-top: 1px solid var(--glass-border);
  z-index: 100;
  padding: 0 8px;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--text-muted);
  font-size: 20px;
  flex: 1;
  max-width: 72px;
}

.bottom-nav-item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.bottom-nav-item.active {
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 6px var(--neon-cyan));
}

.bottom-nav-item .bnav-dot {
  width: 4px;
  height: 4px;
  background: var(--neon-cyan);
  border-radius: 50%;
  margin-top: 2px;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.bottom-nav-item.active .bnav-dot { opacity: 1; }

/* ---- Sidebar Overlay ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.active { opacity: 1; }

/* ---- Recurring Badge ---- */
.recurring-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(77, 124, 255, 0.12);
  border: 1px solid rgba(77, 124, 255, 0.25);
  color: var(--neon-blue);
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ADD THESE FOR LOANS: */
#loan-borrowed:checked + label { 
    border-bottom: 2px solid var(--neon-pink); 
    border-bottom-left-radius: 2px; 
    border-bottom-right-radius: 2px;
}
#loan-lent:checked + label { 
    border-bottom: 2px solid var(--neon-green); 
    border-bottom-left-radius: 2px; 
    border-bottom-right-radius: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .budget-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.active { pointer-events: all; }

  .main-content { margin-left: 0; }

  .hamburger { display: flex; }

  .top-bar { padding: 14px 16px; }

  .top-search { display: none; }

  .page-content {
    padding: 16px;
    padding-bottom: 90px;
  }

  .bottom-nav { display: none; }

  .fab { display: flex; bottom: 16px; right: 16px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .stat-value { font-size: 20px; }

  .form-row { grid-template-columns: 1fr; }

  .modal { padding: 24px; }

  .filter-bar { gap: 8px; }
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   Optimized for: 550px | 480px | 360px
   ============================================ */

/* ============================================
   TABLETS & LARGE PHONES (max-width: 550px)
   ============================================ */
@media (max-width: 550px) {
  
  /* Layout Adjustments */
  .page-content {
    padding: 12px 12px 100px 12px;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  /* Sidebar becomes overlay */
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  /* Top Bar */
  .top-bar {
    padding: 12px 16px;
  }
  
  .page-title {
    font-size: 18px;
  }
  
  .page-subtitle {
    font-size: 11px;
  }
  
  /* Stat Cards - 2x2 Grid */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  
  .stat-card {
    padding: 14px;
    border-radius: 16px;
  }
  
  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
    margin-bottom: 10px;
    border-radius: 10px;
  }
  
  .stat-label {
    font-size: 9px;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }
  
  .stat-value {
    font-size: 20px;
    margin-bottom: 6px;
  }
  
  .stat-trend {
    font-size: 11px;
  }
  
  /* Charts */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 20px;
  }
  
  .chart-container {
    height: 220px !important;
    padding: 12px 0;
  }
  
  .card {
    border-radius: 20px;
  }
  
  .card-header {
    padding: 16px 16px 0;
  }
  
  .card-title {
    font-size: 14px;
  }
  
  .card-body {
    padding: 16px;
  }
  
  /* Transaction List */
  .expense-item {
    padding: 12px;
    gap: 10px;
    border-radius: 12px;
    margin-bottom: 8px;
  }
  
  .expense-cat-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
    border-radius: 10px;
  }
  
  .expense-name {
    font-size: 13px;
    font-weight: 600;
  }
  
  .expense-meta {
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
  }
  
  .expense-category-tag {
    font-size: 9px;
    padding: 2px 6px;
  }
  
  .expense-amount {
    font-size: 15px;
  }
  
  .expense-payment {
    font-size: 10px;
  }
  
  /* Action buttons always visible on touch devices */
  .expense-actions {
    opacity: 1;
    gap: 4px;
  }
  
  .action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  
  /* Budget Grid */
  .budget-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .budget-category-card {
    padding: 14px;
    border-radius: 14px;
  }
  
  .budget-cat-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .budget-cat-name {
    font-size: 13px;
  }
  
  .budget-cat-percent {
    font-size: 16px;
  }
  
  /* Filter Bar */
  .filter-bar {
    padding: 12px;
    gap: 8px;
    border-radius: 12px;
  }
  
  .filter-chip {
    padding: 6px 12px;
    font-size: 11px;
  }
  
  /* Modal */
  .modal {
    width: 92%;
    max-width: 400px;
    padding: 20px;
    border-radius: 20px;
  }
  
  .modal-header {
    margin-bottom: 20px;
  }
  
  .modal-title {
    font-size: 18px;
  }
  
  .modal-close {
    width: 36px;
    height: 36px;
  }
  
  /* Forms */
  .form-group {
    margin-bottom: 14px;
  }
  
  .form-label {
    font-size: 10px;
    margin-bottom: 6px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .type-toggle {
    margin: 16px 0;
  }
  
  .type-toggle label {
    padding: 10px;
    font-size: 13px;
  }
  
  .currency-prefix {
    left: 12px;
    font-size: 15px;
  }
  
  .amount-input-wrap .form-input {
    padding-left: 32px;
  }
  
  /* Buttons */
  .btn {
    padding: 12px 20px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
  }
  
  .btn-sm {
    padding: 10px 16px;
    font-size: 13px;
    width: auto;
  }
  
  /* FAB - Floating Action Button */
  .fab {
    width: 56px;
    height: 56px;
    font-size: 24px;
    bottom: 20px;
    right: 20px;
    display: flex;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.4);
  }
  
  /* Bottom Navigation */
  .bottom-nav {
    display: flex;
    height: 64px;
    padding: 0 8px;
    backdrop-filter: blur(24px);
  }
  
  .bottom-nav-item {
    font-size: 20px;
    padding: 6px 12px;
  }
  
  .bottom-nav-item span {
    font-size: 9px;
    margin-top: 2px;
  }
  
  /* Toast Notifications */
  .toast-container {
    width: 90%;
    max-width: 320px;
    bottom: 80px; /* Above bottom nav */
  }
  
  .toast {
    padding: 12px 16px;
  }
  
  /* Empty State */
  .empty-state {
    padding: 40px 20px;
  }
  
  .empty-state-icon {
    font-size: 48px;
  }

  .statement, .wrappedd {
    display: none;
  }
  
  .empty-state-title {
    font-size: 16px;
  }
  
  .empty-state-desc {
    font-size: 12px;
  }
  
  /* Alerts Dropdown */
  .alerts-dropdown {
    width: 300px;
    right: -60px;
  }
}

/* ============================================
   STANDARD PHONES (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
  
  .page-content {
    padding: 10px 10px 90px 10px;
  }
  
  /* Stat Cards - Compact */
  .stat-grid {
    gap: 8px;
  }
  
  .stat-card {
    padding: 12px 10px;
    border-radius: 14px;
  }
  
  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    margin-bottom: 8px;
    border-radius: 8px;
  }
  
  .stat-label {
    font-size: 8px;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
  }
  
  .stat-value {
    font-size: 17px;
    margin-bottom: 4px;
  }
  
  .stat-trend {
    font-size: 10px;
  }
  
  /* Charts Smaller */
  .chart-container {
    height: 200px !important;
    padding: 8px 0;
  }
  
  .card {
    border-radius: 16px;
  }
  
  .card-header {
    padding: 14px 14px 0;
  }
  
  .card-title {
    font-size: 13px;
  }
  
  .card-body {
    padding: 14px;
  }
  
  /* Transactions - Ultra Compact */
  .expense-item {
    padding: 10px;
    gap: 8px;
    border-radius: 10px;
    margin-bottom: 6px;
  }
  
  .expense-cat-icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
    border-radius: 8px;
  }
  
  .expense-info {
    min-width: 0;
  }
  
  .expense-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }
  
  .expense-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 10px;
  }
  
  .expense-meta span:nth-child(2) {
    display: none; /* Hide dot separator */
  }
  
  .expense-category-tag {
    font-size: 8px;
    padding: 1px 6px;
    border-radius: 10px;
  }
  
  .expense-right {
    gap: 2px;
  }
  
  .expense-amount {
    font-size: 13px;
  }
  
  .expense-payment {
    font-size: 9px;
  }
  
  .action-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  
  /* Filter Bar - Scrollable */
  .filter-bar {
    padding: 8px;
    gap: 6px;
    border-radius: 10px;
  }
  
  .filter-bar::-webkit-scrollbar {
    display: none;
  }
  
  .filter-chip {
    padding: 6px 10px;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .filter-select {
    padding: 6px 10px;
    font-size: 10px;
    flex-shrink: 0;
  }
  
  /* Budget Cards */
  .budget-category-card {
    padding: 12px;
  }
  
  .budget-cat-header {
    margin-bottom: 10px;
  }
  
  .budget-cat-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .budget-cat-name {
    font-size: 12px;
  }
  
  .budget-cat-percent {
    font-size: 14px;
  }
  
  .budget-bar-wrap {
    height: 5px;
    margin-bottom: 8px;
  }
  
  .budget-cat-amounts {
    font-size: 11px;
  }
  
  .alert-badge {
    padding: 2px 8px;
    font-size: 9px;
  }
  
  /* Modal - Full Screen feel */
  .modal {
    width: 95%;
    padding: 18px;
    border-radius: 18px;
  }
  
  .modal-header {
    margin-bottom: 16px;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  /* Forms - Touch Optimized */
  .form-group {
    margin-bottom: 12px;
  }
  
  .form-label {
    font-size: 9px;
    margin-bottom: 5px;
  }
  
  .form-textarea {
    min-height: 70px;
  }
  
  .type-toggle {
    margin: 14px 0;
  }
  
  .type-toggle label {
    padding: 8px;
    font-size: 12px;
  }
  
  .currency-prefix {
    font-size: 14px;
    left: 12px;
  }
  
  /* Buttons - Better Touch Targets */
  .btn {
    padding: 14px 20px; /* Larger touch target */
    font-size: 14px;
    min-height: 48px;
  }
  
  .btn-sm {
    padding: 10px 14px;
    font-size: 12px;
    min-height: 40px;
  }
  
  .add-wallet {
    padding: 8px 12px;
    font-size: 12px;
  }

  .statement, .wrappedd {
    display: none;
  }
  
  /* FAB - Slightly smaller */
  .fab {
    width: 52px;
    height: 52px;
    font-size: 22px;
    bottom: 16px;
    right: 16px;
  }
  
  /* Bottom Nav - Compact */
  .bottom-nav {
    height: 60px;
  }
  
  .bottom-nav-item {
    font-size: 18px;
    padding: 4px 8px;
  }
  
  .bottom-nav-item span {
    font-size: 8px;
    letter-spacing: 0;
  }
  
  /* Toggle Switch */
  .toggle {
    width: 40px;
    height: 22px;
  }
  
  .toggle-slider::after {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
  }
  
  .toggle input:checked + .toggle-slider::after {
    transform: translateX(18px);
  }
  
  .toggle-label {
    font-size: 12px;
  }
  
  /* Section Headers */
  .section-header {
    margin-bottom: 12px;
    padding: 0 2px;
  }
  
  .section-title {
    font-size: 14px;
  }
  
  /* Toast - Above bottom nav */
  .toast-container {
    bottom: 70px;
    width: 92%;
  }
  
  .toast {
    padding: 10px 14px;
  }
  
  .toast-icon {
    font-size: 16px;
  }
  
  .toast-msg {
    font-size: 12px;
  }
  
  /* Search in Top Bar */
  .top-search {
    display: none; /* Hide on small phones, use dedicated search page */
  }
  
  /* Icon Buttons */
  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
    border-radius: 10px;
  }
  
  /* Budget Mini in Sidebar */
  .budget-mini {
    padding: 10px;
  }
  
  .budget-mini-numbers {
    font-size: 10px;
  }

  .bottom-nav {
    display: none;
  }
}

/* ============================================
   SMALL PHONES (max-width: 360px)
   iPhone SE, Small Android Devices
   ============================================ */
@media (max-width: 360px) {
  
  .page-content {
    padding: 8px 8px 80px 8px;
  }
  
  /* Ultra Compact Stats */
  .stat-grid {
    gap: 6px;
  }
  
  .stat-card {
    padding: 10px 8px;
    border-radius: 12px;
  }
  
  .stat-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
    margin-bottom: 6px;
    border-radius: 6px;
  }
  
  .stat-label {
    font-size: 7px;
    letter-spacing: 0.2px;
    margin-bottom: 2px;
  }
  
  .stat-value {
    font-size: 15px;
    margin-bottom: 2px;
  }
  
  .stat-trend {
    font-size: 9px;
  }
  
  /* Minimal Charts */
  .chart-container {
    height: 180px !important;
    padding: 6px 0;
  }
  
  .card {
    border-radius: 14px;
    border-width: 0.5px;
  }
  
  .card-header {
    padding: 12px 12px 0;
  }

  .statement, .wrappedd {
    display: none;
  }
  
  .card-title {
    font-size: 12px;
  }
  
  .card-body {
    padding: 12px;
  }
  
  /* Transactions - Minimal */
  .expense-item {
    padding: 8px;
    gap: 6px;
    border-radius: 8px;
    margin-bottom: 4px;
  }
  
  .expense-cat-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
    border-radius: 6px;
  }
  
  .expense-name {
    font-size: 9px;
    max-width: 110px;
  }
  
  .expense-meta {
    font-size: 9px;
    gap: 1px;
  }

  #expenseDateee {
    font-size: 7px !important;
  }
  
  .expense-category-tag {
    font-size: 5px !important;
    padding: 1px 4px;
    border-radius: 8px;
  }
  
  .expense-amount {
    font-size: 11px;
  }
  
  .expense-payment {
    font-size: 8px;
  }
  
  .action-btn {
    width: 18px;
    height: 18px;
    font-size: 7px;
    border-radius: 6px;
  }
  
  /* Budget - Micro */
  .budget-category-card {
    padding: 10px;
    border-radius: 12px;
  }
  
  .budget-cat-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  
  .budget-cat-name {
    font-size: 11px;
  }
  
  .budget-cat-percent {
    font-size: 13px;
  }
  
  .budget-cat-amounts {
    font-size: 10px;
  }
  
  .alert-badge {
    font-size: 8px;
    padding: 1px 6px;
  }
  
  /* Modal - Edge to Edge */
  .modal {
    width: 96%;
    padding: 16px;
    border-radius: 16px;
  }
  
  .modal-header {
    margin-bottom: 14px;
  }
  
  .modal-title {
    font-size: 15px;
  }
  
  .modal-close {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  /* Forms - Micro */
  .form-group {
    margin-bottom: 10px;
  }
  
  .form-label {
    font-size: 8px;
    margin-bottom: 4px;
  }
  
  .form-textarea {
    min-height: 60px;
  }
  
  .type-toggle {
    margin: 12px 0;
    padding: 3px;
  }
  
  .type-toggle label {
    padding: 6px;
    font-size: 11px;
  }
  
  .currency-prefix {
    font-size: 13px;
    left: 10px;
  }
  
  .amount-input-wrap .form-input {
    padding-left: 28px;
  }

  #dateFrom, #dateTo {
    max-width: 130px;
  }
  
  /* Buttons - Better Touch Targets */
  .btn {
    padding: 14px 20px; /* Larger touch target */
    font-size: 14px;
    min-height: 48px;
  }
  
  .btn-sm {
    padding: 10px 14px;
    font-size: 12px;
    min-height: 40px;
  }

  #addExpenseBtn {
    padding: 4px 7px;
    font-size: 7px;
    min-height: 25px;
  }

  #expenseCount, .total-total {
    font-size: 9px !important;
  }
  
  /* FAB - Smallest */
  .fab {
    width: 48px;
    height: 48px;
    font-size: 20px;
    bottom: 14px;
    right: 14px;
  }
  
  /* Bottom Nav - Minimal */
  .bottom-nav {
    height: 56px;
    padding: 0 4px;
  }
  
  .bottom-nav-item {
    font-size: 16px;
    padding: 4px 6px;
  }
  
  .bottom-nav-item span {
    font-size: 7px;
    display: none; /* Hide labels, icons only */
  }
  
  /* Top Bar - Micro */
  .top-bar {
    padding: 10px 12px;
  }
  
  .page-title {
    font-size: 16px;
  }
  
  .page-subtitle {
    font-size: 10px;
  }
  
  .hamburger {
    gap: 4px;
  }
  
  .hamburger span {
    width: 20px;
    height: 2px;
  }
  
  /* Toggle - Micro */
  .toggle {
    width: 36px;
    height: 20px;
  }
  
  .toggle-slider::after {
    width: 14px;
    height: 14px;
    top: 2px;
    left: 2px;
  }
  
  .toggle input:checked + .toggle-slider::after {
    transform: translateX(16px);
  }
  
  /* Section Header */
  .section-title {
    font-size: 13px;
  }
  
  /* Toast */
  .toast-container {
    bottom: 64px;
  }
  
  .toast {
    padding: 8px 12px;
  }
  
  .toast-icon {
    font-size: 14px;
  }
  
  .toast-msg {
    font-size: 11px;
  }
  
  /* Empty State */
  .empty-state {
    padding: 30px 16px;
  }
  
  .empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
  }
  
  .empty-state-title {
    font-size: 14px;
  }
  
  .empty-state-desc {
    font-size: 11px;
  }
  
  /* Recurring Badge */
  .recurring-badge {
    font-size: 8px;
    padding: 1px 5px;
  }
  
  /* Sidebar Logo */
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  
  .logo-text {
    font-size: 16px;
  }
  
  .logo-sub {
    font-size: 8px;
  }
  
  /* Nav Items in Sidebar */
  .nav-item {
    padding: 10px 12px;
    font-size: 13px;
    gap: 10px;
  }
  
  .nav-icon {
    width: 18px;
    height: 18px;
    font-size: 14px;
  }
  
  .nav-label {
    font-size: 9px;
    padding: 12px 12px 6px;
  }
  
  /* Alerts */
  .alert-banner {
    padding: 10px 12px;
    font-size: 11px;
    gap: 8px;
    margin-bottom: 12px;
  }
  
  /* Filter Bar */
  .filter-bar {
    padding: 6px;
    gap: 4px;
    border-radius: 8px;
  }
  
  .filter-chip,
  .filter-select {
    padding: 5px 8px;
    font-size: 9px;
  }
  
  .bottom-nav {
    display: none;
  }
}

/* ---- Modal Animations ---- */
@keyframes bounce-sm {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
@keyframes shake-sm {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
body.light-theme {
  --bg-base: #f3f5f9;
  --bg-layer1: #ffffff;
  --bg-layer2: #e2e8f0;

  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-bg-hover: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-border-hover: rgba(0, 0, 0, 0.15);

  /* Deepen neon colors slightly for better contrast on white */
  --neon-cyan: #009eb3;
  --neon-purple: #9c27b0;
  --neon-green: #00a050;
  --neon-pink: #e91e63;
  --neon-amber: #f57c00;
  --neon-blue: #1976d2;

  --text-primary: #1a202c;
  --text-secondary: rgba(26, 32, 44, 0.7);
  --text-muted: rgba(26, 32, 44, 0.45);

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* Specific component overrides for Light Mode */
body.light-theme .sidebar { background: rgba(255, 255, 255, 0.75); }
body.light-theme .top-bar { background: rgba(243, 245, 249, 0.85); }
body.light-theme .bottom-nav { background: rgba(255, 255, 255, 0.9); }
body.light-theme .modal { background: #ffffff; }
body.light-theme .alerts-dropdown { background: rgba(255, 255, 255, 0.95); }
body.light-theme option { background: #ffffff; color: var(--text-primary); }
body.light-theme .toast { background: rgba(255, 255, 255, 0.95); }
body.light-theme .flatpickr-calendar { background: rgba(255, 255, 255, 0.95) !important; border-color: var(--glass-border) !important; }
body.light-theme input[type="date"].form-input { color-scheme: light; }
body.light-theme input[type="date"].form-input::-webkit-calendar-picker-indicator { filter: invert(0); }

/* ============================================
   APP LOCK & KEYPAD (PREMIUM)
   ============================================ */
.lock-screen {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(8, 11, 26, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.lock-screen.active {
  opacity: 1;
  pointer-events: all;
}
body.light-theme .lock-screen {
  background: rgba(230, 235, 245, 0.7);
}

/* The Premium Glass Card */
.lock-card {
  background: rgba(17, 21, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  padding: 50px 40px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.light-theme .lock-card {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Syne Typography */
.lock-title { 
  font-family: 'Syne', sans-serif; 
  font-size: 28px; 
  font-weight: 700; 
  margin-bottom: 8px; 
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #aab2cc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
body.light-theme .lock-title {
  background: linear-gradient(135deg, #111 0%, #555 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#pinSetupTitle { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 22px; }

.pin-dots { display: flex; gap: 18px; margin-bottom: 40px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(0, 229, 255, 0.4); transition: all 0.2s; }
.pin-dot.filled { background: var(--neon-cyan); border-color: var(--neon-cyan); box-shadow: 0 0 12px rgba(0, 229, 255, 0.6); }
.pin-dot.error { border-color: var(--neon-pink); background: var(--neon-pink); box-shadow: 0 0 12px var(--neon-pink); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.key-btn { 
  width: 68px; height: 68px; border-radius: 50%; border: none; 
  background: rgba(255, 255, 255, 0.03); color: var(--text-primary); 
  font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 600; 
  cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
  display: flex; align-items: center; justify-content: center; 
}
.key-btn:hover { background: rgba(255, 255, 255, 0.08); }
.key-btn:active { background: rgba(255, 255, 255, 0.15); transform: scale(0.92); }
.key-btn.transparent { background: transparent; pointer-events: none; }
body.light-theme .key-btn { background: rgba(0, 0, 0, 0.04); }
body.light-theme .key-btn:hover { background: rgba(0, 0, 0, 0.08); }

.shake-error { animation: shake-sm 0.4s ease-in-out; }

/* ============================================
   CUSTOM TOGGLE COLORS (Loans & Savings)
   ============================================ */

/* Loans Modal */
#loan-borrowed:checked + label {
  background: rgba(255, 45, 120, 0.1);
  color: var(--neon-pink);
  border-bottom: 2px solid var(--neon-pink);
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
}
#loan-lent:checked + label {
  background: rgba(0, 255, 157, 0.1);
  color: var(--neon-green);
  border-bottom: 2px solid var(--neon-green);
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
}

/* Savings Modal */
#sav-deposit:checked + label {
  background: rgba(0, 255, 157, 0.1);
  color: var(--neon-green);
  border-bottom: 2px solid var(--neon-green);
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
}
#sav-withdraw:checked + label {
  background: rgba(255, 45, 120, 0.1);
  color: var(--neon-pink);
  border-bottom: 2px solid var(--neon-pink);
  border-bottom-left-radius: 2px;
  border-bottom-right-radius: 2px;
}

/* ============================================
   MULTI-WALLET SYSTEM & HIERARCHY
   ============================================ */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Forces 4 items per row */
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1200px) { .wallet-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .wallet-grid { grid-template-columns: 1fr; } }

.wallet-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.wallet-card::before {
  content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px;
  background: var(--wallet-color, var(--neon-cyan));
  filter: blur(40px); opacity: 0.15; border-radius: 50%;
  pointer-events: none; /* <--- CRITICAL FIX: Allows clicking through the glow! */
}
.wallet-top { display: flex; align-items: center; gap: 12px; }
.wallet-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: rgba(255,255,255,0.05);
  color: var(--wallet-color, var(--text-primary));
}
.wallet-name { font-weight: 600; font-size: 14px; }
.wallet-bal { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 0.5px; }

/* The Nested Children */
.wallet-child-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0 0 0; margin-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.1);
  font-size: 12px; color: var(--text-secondary);
}
body.light-theme .wallet-child-row { border-top-color: rgba(0,0,0,0.1); }

/* ============================================
   SIDEBAR SCROLLING & LAYOUT
   ============================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh; /* Ensures the sidebar takes exactly the full screen height */
}

.nav-section {
  flex: 1; /* Forces this middle section to take up all available space */
  overflow-y: auto; /* Enables vertical scrolling */
  overflow-x: hidden;
  padding-bottom: 20px;
}

/* Custom Premium Scrollbar for the Navigation */
.nav-section::-webkit-scrollbar {
  width: 4px; /* Ultra-thin scrollbar */
}
.nav-section::-webkit-scrollbar-track {
  background: transparent;
}
.nav-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.nav-section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Light Theme adjustments for the scrollbar */
body.light-theme .nav-section::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}
body.light-theme .nav-section::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}