/* ============================================================
   app.css — Premium Dark Theme for ระบบรายรับ-รายจ่าย
   ============================================================ */

/* ── Custom Properties ────────────────────────────────────── */
:root {
  /* Color Palette */
  --bg-base:        #0b0f1a;
  --bg-surface:     #111827;
  --bg-card:        #1a2235;
  --bg-card-hover:  #1e2a3f;
  --bg-input:       #0f1726;
  --bg-overlay:     rgba(0, 0, 0, 0.7);

  /* Brand Gradient */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --gradient-income:  linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-expense: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --gradient-ai:      linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);

  /* Solid Colors */
  --primary:     #6366f1;
  --primary-lt:  #818cf8;
  --secondary:   #8b5cf6;
  --accent:      #06b6d4;
  --income:      #10b981;
  --income-lt:   #34d399;
  --expense:     #ef4444;
  --expense-lt:  #f87171;
  --warning:     #f59e0b;
  --info:        #3b82f6;

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-inverse:   #0b0f1a;

  /* Borders */
  --border:       rgba(255,255,255,0.08);
  --border-focus: rgba(99,102,241,0.6);

  /* Glass Effect */
  --glass-bg:     rgba(26, 34, 53, 0.8);
  --glass-border: rgba(255,255,255,0.1);
  --glass-blur:   16px;

  /* Sidebar */
  --sidebar-width:          260px;
  --sidebar-collapsed-width: 70px;
  --topbar-height:          64px;

  /* Spacing */
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full:9999px;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow:     0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow:0 0 30px rgba(99,102,241,0.2);

  /* Transition */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Sarabun', 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background mesh gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(99,102,241,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(6,182,212,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(139,92,246,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--primary-lt); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

hr { border: none; border-top: 1px solid var(--border); }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

.text-income  { color: var(--income) !important; }
.text-expense { color: var(--expense) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-danger  { color: var(--expense) !important; }
.text-primary { color: var(--primary) !important; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Layout ───────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.brand-icon { font-size: 1.4rem; }
.brand-name { background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition), transform var(--transition);
  z-index: 900;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-section { margin-bottom: 1rem; }

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  display: block;
  margin-bottom: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(99,102,241,0.12); color: var(--text-primary); }
.nav-item.active {
  background: rgba(99,102,241,0.2);
  color: var(--primary-lt);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item-income { color: var(--income); }
.nav-item-income:hover { background: rgba(16,185,129,0.12); color: var(--income-lt); }
.nav-item-expense { color: var(--expense); }
.nav-item-expense:hover { background: rgba(239,68,68,0.12); color: var(--expense-lt); }

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius);
}

.sidebar-user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.sidebar-user-role { font-size: 0.72rem; color: var(--text-muted); }

.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 1.5rem;
  min-height: calc(100vh - var(--topbar-height));
  position: relative;
  z-index: 1;
  transition: margin-left var(--transition);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.5);
  color: white;
}

.btn-income {
  background: var(--gradient-income);
  color: white;
  box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
.btn-income:hover { transform: translateY(-1px); color: white; box-shadow: 0 6px 20px rgba(16,185,129,0.4); }

.btn-expense {
  background: var(--gradient-expense);
  color: white;
  box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}
.btn-expense:hover { transform: translateY(-1px); color: white; box-shadow: 0 6px 20px rgba(239,68,68,0.4); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--expense);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.8rem;
  position: relative;
}
.btn-icon:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon .btn-label { display: none; }

.btn-ai-toggle {
  width: auto;
  padding: 0 0.9rem;
  gap: 0.5rem;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--primary-lt);
  border-radius: var(--radius-full);
}
.btn-ai-toggle .btn-label { display: inline; }
.btn-ai-toggle:hover { background: rgba(99,102,241,0.25); color: var(--primary-lt); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-color, rgba(99,102,241,0.15)) 0%, transparent 70%);
  transform: translate(30%, -30%);
  pointer-events: none;
}

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

.stat-card.income  { --card-color: rgba(16,185,129,0.2); border-color: rgba(16,185,129,0.2); }
.stat-card.expense { --card-color: rgba(239,68,68,0.2);  border-color: rgba(239,68,68,0.2); }
.stat-card.balance { --card-color: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.2); }
.stat-card.saving  { --card-color: rgba(6,182,212,0.2);  border-color: rgba(6,182,212,0.2); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.stat-change.up   { background: rgba(16,185,129,0.15); color: var(--income); }
.stat-change.down { background: rgba(239,68,68,0.15);  color: var(--expense); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-label.required::after {
  content: ' *';
  color: var(--expense);
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: rgba(15,23,38,0.9);
}

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

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 20px;
  padding-right: 2.5rem;
}

select.form-control option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.form-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-error {
  font-size: 0.76rem;
  color: var(--expense);
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.input-group {
  position: relative;
  display: flex;
  align-items: stretch;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.7rem 0.9rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  border-right: none;
}

.input-group .form-control {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: none;
}

.input-group .form-control:focus { border-color: var(--primary); }

/* Type Toggle */
.type-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem;
  gap: 0.25rem;
}

.type-toggle-btn {
  flex: 1;
  padding: 0.65rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.type-toggle-btn.active-income {
  background: var(--gradient-income);
  color: white;
  box-shadow: 0 2px 10px rgba(16,185,129,0.3);
}

.type-toggle-btn.active-expense {
  background: var(--gradient-expense);
  color: white;
  box-shadow: 0 2px 10px rgba(239,68,68,0.3);
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-input);
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(99,102,241,0.05);
}

.upload-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.upload-text { color: var(--text-secondary); font-size: 0.9rem; }
.upload-hint { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.3rem; }

.upload-preview {
  position: relative;
  display: inline-block;
  margin-top: 1rem;
}

.upload-preview img {
  max-height: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.upload-preview-remove {
  position: absolute;
  top: -8px; right: -8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--expense);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

/* ── Table ────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
  color: var(--text-primary);
}

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

.table tbody tr:hover { background: rgba(255,255,255,0.03); }
.table tbody tr:last-child td { border-bottom: none; }

/* Amount Badge */
.amount-badge {
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.amount-badge.income  { color: var(--income); }
.amount-badge.expense { color: var(--expense); }

/* Category Badge */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255,255,255,0.07);
  color: var(--text-secondary);
}

/* Source Badge */
.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.source-badge.web  { background: rgba(99,102,241,0.15); color: var(--primary-lt); }
.source-badge.line { background: rgba(16,185,129,0.15); color: var(--income); }
.source-badge.liff { background: rgba(6,182,212,0.15);  color: var(--accent); }

/* ── Navigation (Topbar) ──────────────────────────────────── */
.sidebar-toggle {
  width: 36px; height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.sidebar-toggle svg { width: 20px; height: 20px; }

/* Notification badge */
.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  background: var(--expense);
  color: white;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* User Menu */
.user-menu { position: relative; }

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.user-menu-trigger:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }
.user-menu-trigger svg { width: 14px; height: 14px; color: var(--text-muted); }
.user-name-display { font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  z-index: 2000;
  display: none;
  animation: dropdownFadeIn 0.15s ease;
}

.user-menu-dropdown.open { display: block; }

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.dropdown-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.dropdown-item svg { width: 16px; height: 16px; }
.dropdown-item.text-danger { color: var(--expense); }
.dropdown-item.text-danger:hover { background: rgba(239,68,68,0.1); }
.dropdown-divider { margin: 0.4rem 0; }

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.page-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ── Grid ─────────────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-3-1 { grid-template-columns: 3fr 1fr; }
.grid-cols-2-1 { grid-template-columns: 2fr 1fr; }

/* ── Charts Container ─────────────────────────────────────── */
.chart-container {
  position: relative;
  height: 280px;
}

.chart-container.tall { height: 360px; }
.chart-container.short { height: 200px; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition);
}

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

.modal-header {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 1.15rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.modal-close:hover { background: rgba(239,68,68,0.2); color: var(--expense); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ── AI Chat Panel ────────────────────────────────────────── */
.ai-chat-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 1400;
  display: none;
}

.ai-chat-overlay.visible { display: block; }

.ai-chat-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 380px;
  height: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  z-index: 1500;
  transform: scale(0.85) translateY(30px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  overflow: hidden;
}

.ai-chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  border-bottom: 1px solid var(--border);
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-ai);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 15px rgba(139,92,246,0.4);
}

.ai-name { font-weight: 700; font-size: 0.95rem; }
.ai-status { font-size: 0.72rem; color: var(--income); display: flex; align-items: center; gap: 0.3rem; }
.ai-status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--income);
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.ai-chat-close { width: 32px; height: 32px; }

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-message { display: flex; flex-direction: column; }
.ai-message-user { align-items: flex-end; }
.ai-message-bot  { align-items: flex-start; }

.ai-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  line-height: 1.6;
}

.ai-message-user .ai-bubble {
  background: var(--gradient-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-message-bot .ai-bubble {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.ai-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; padding: 0 0.25rem; }

/* Typing indicator */
.ai-typing .ai-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 1rem;
}

.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.ai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.5rem;
}

.quick-prompt-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.quick-prompt-btn:hover {
  border-color: var(--primary);
  color: var(--primary-lt);
  background: rgba(99,102,241,0.1);
}

.ai-chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
}

.ai-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 0.6rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  resize: none;
  outline: none;
  transition: border-color var(--transition-fast);
  overflow-y: auto;
}

.ai-input:focus { border-color: var(--primary); }
.ai-input::placeholder { color: var(--text-muted); }

.ai-send-btn {
  width: 40px; height: 40px;
  border: none;
  border-radius: var(--radius);
  background: var(--gradient-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99,102,241,0.4);
}

.ai-send-btn:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(99,102,241,0.5); }
.ai-send-btn svg { width: 16px; height: 16px; }
.ai-send-btn:disabled { opacity: 0.5; transform: none; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + 1rem);
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastSlideIn 0.3s ease;
  border-left: 3px solid var(--primary);
}

.toast.success { border-left-color: var(--income); }
.toast.error   { border-left-color: var(--expense); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-text { flex: 1; font-size: 0.875rem; color: var(--text-primary); }
.toast-close { color: var(--text-muted); cursor: pointer; border: none; background: none; padding: 0; font-size: 1rem; }
.toast.dismissing { animation: toastSlideOut 0.3s ease forwards; }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

/* ── Login Page ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.auth-logo-name {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-logo-sub { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.25rem; }
.auth-subtitle { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.75rem; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.page-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.page-btn:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }
.page-btn.active { background: var(--gradient-primary); color: white; border-color: transparent; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.filter-bar .form-control { width: auto; min-width: 150px; }

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-box .form-control { padding-left: 2.5rem; }
.search-box-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-box-icon svg { width: 16px; height: 16px; }

/* ── Loading / Spinner ────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(99,102,241,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,15,26,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.6; }
.empty-state-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-state-desc { color: var(--text-muted); font-size: 0.875rem; }

/* ── Quick Summary Strip ──────────────────────────────────── */
.summary-strip {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.summary-strip-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full);
}

.summary-strip-item.income { background: rgba(16,185,129,0.12); color: var(--income); }
.summary-strip-item.expense { background: rgba(239,68,68,0.12); color: var(--expense); }
.summary-strip-item.balance { background: rgba(99,102,241,0.12); color: var(--primary-lt); }

/* ── Progress Bar ─────────────────────────────────────────── */
.progress {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3-1 { grid-template-columns: 1fr; }
  .grid-cols-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }

  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

  .main-content { margin-left: 0; padding: 1rem; }

  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; justify-content: center; }

  .ai-chat-panel { right: 0.75rem; bottom: 0.75rem; width: calc(100vw - 1.5rem); height: 500px; }

  .user-name-display { display: none; }

  .btn-ai-toggle .btn-label { display: none; }
  .btn-ai-toggle { width: 40px; padding: 0; }
}

@media (max-width: 480px) {
  .topbar { padding: 0 0.75rem; }
  .brand-name { display: none; }
  .filter-bar { gap: 0.5rem; }
  .filter-bar .form-control { min-width: 120px; }
}

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

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

.animate-fade-in { animation: fadeIn 0.4s ease; }
.animate-fade-up { animation: fadeInUp 0.4s ease; }

/* Stagger children */
.stagger > * { animation: fadeInUp 0.4s ease both; }
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }

/* ── Utilities ────────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fs-sm { font-size: 0.8rem; }
.fs-xs { font-size: 0.72rem; }
.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* ============================================================
   Budget / Savings / Achievements / Recurring Custom Styles
   ============================================================ */

/* Budget System */
.budget-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.budget-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.budget-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.15);
}
.budget-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent-color, var(--primary));
}
.progress-bar.progress-green { background: linear-gradient(90deg, #10B981, #059669); }
.progress-bar.progress-yellow { background: linear-gradient(90deg, #F59E0B, #D97706); }
.progress-bar.progress-red { background: linear-gradient(90deg, #EF4444, #DC2626); }

/* Savings Goal SVG Circular Progress */
.savings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.goal-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all var(--transition);
}
.goal-card:hover {
  border-color: var(--accent-color, var(--primary));
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.goal-circle-wrapper {
  position: relative;
  width: 80px; height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.goal-circle-svg {
  width: 80px; height: 80px;
  transform: rotate(-90deg);
}
.goal-circle-bg {
  fill: none;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 6;
}
.goal-circle-progress {
  fill: none;
  stroke: var(--accent-color, var(--primary));
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  transition: stroke-dashoffset 1s ease-in-out;
}
.goal-circle-text {
  position: absolute;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.icon-picker-btn {
  font-size: 1.5rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}
.icon-picker-btn:hover, .icon-picker-btn.active {
  background: rgba(99,102,241,0.15);
  border-color: var(--primary);
  transform: scale(1.08);
}
.color-picker-grid {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.color-picker-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}
.color-picker-dot:hover, .color-picker-dot.active {
  border-color: white;
  transform: scale(1.1);
}

/* Achievement and Health Score System */
.health-score-section {
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.health-score-gauge {
  width: 140px; height: 140px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.health-score-svg {
  width: 140px; height: 140px;
  transform: rotate(-90deg);
}
.health-score-bg {
  fill: none;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 10;
}
.health-score-progress {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 408;
  stroke-dashoffset: 408;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.health-score-progress.green { stroke: var(--income); }
.health-score-progress.yellow { stroke: var(--warning); }
.health-score-progress.red { stroke: var(--expense); }
.health-score-text {
  position: absolute;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.health-score-number {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}
.health-score-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  position: relative;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.badge-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
}
.badge-card.unlocked:hover .badge-icon {
  transform: scale(1.15) rotate(5deg);
}
.badge-card.unlocked {
  border-color: rgba(99,102,241,0.25);
  box-shadow: 0 4px 15px rgba(99,102,241,0.08);
}
.badge-card.locked {
  opacity: 0.45;
}
.badge-card.locked .badge-icon {
  filter: grayscale(1);
}
.badge-lock-icon {
  position: absolute;
  top: 10px; right: 10px;
  color: var(--text-muted);
}
.badge-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  margin-top: 0.25rem;
}

/* Recurring Transactions Toggle & Badges */
.recur-list-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: opacity 0.3s ease;
}
.recur-list-card.inactive {
  opacity: 0.5;
}
.frequency-badge {
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
}
.frequency-badge.daily { background: rgba(99,102,241,0.15); color: var(--primary-lt); }
.frequency-badge.weekly { background: rgba(6,182,212,0.15); color: var(--accent); }
.frequency-badge.monthly { background: rgba(245,158,11,0.15); color: var(--warning); }
.frequency-badge.yearly { background: rgba(236,72,153,0.15); color: #ec4899; }

/* Switch Toggle Component */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0; width: 0; height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid var(--border);
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--income);
  border-color: transparent;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

