@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1f2a42;
  --bg-input: #0f1629;
  --border: #2a3554;
  --border-focus: #3b82f6;
  --text-primary: #e8ecf4;
  --text-secondary: #8892a8;
  --text-muted: #5a6478;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.1);
  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.1);
  --cyan: #06b6d4;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --transition: all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Background texture ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(59,130,246,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139,92,246,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Layout ─── */
.app { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 23, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.topbar-actions { display: flex; gap: 8px; }

.main-layout {
  display: flex;
  min-height: calc(100vh - 65px);
}

/* ─── Sidebar ─── */
.sidebar {
  width: 220px;
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  color: var(--text-secondary);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); font-weight: 500; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ─── Content area ─── */
.content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

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

.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }

/* ─── Cards ─── */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; font-family: 'JetBrains Mono', monospace; letter-spacing: -1px; }
.stat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.orange { color: var(--orange); }

/* ─── Charts ─── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.chart-container { position: relative; height: 220px; }

/* ─── Tables ─── */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.table-header-title { font-size: 14px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 12px 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

tbody td {
  padding: 14px 20px;
  font-size: 13px;
  border-bottom: 1px solid rgba(42, 53, 84, 0.4);
  vertical-align: middle;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--bg-card-hover); }
tbody tr:last-child td { border-bottom: none; }

.amount-cell { font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 13px; }
.amount-cell.expense { color: var(--red); }
.amount-cell.income { color: var(--green); }

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
  font-size: 16px;
}
.delete-btn:hover { color: var(--red); background: var(--red-bg); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
}

.btn:hover { border-color: var(--accent); background: var(--bg-card-hover); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #2563eb; box-shadow: 0 0 20px rgba(59,130,246,0.3); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }

/* ─── Forms ─── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

.form-input, .form-select {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-input::placeholder { color: var(--text-muted); }

.form-select { cursor: pointer; }
.form-select option { background: var(--bg-secondary); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 520px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* ─── Upload zone ─── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 20px;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-zone-icon { font-size: 36px; margin-bottom: 10px; }
.upload-zone-text { font-size: 14px; color: var(--text-secondary); }
.upload-zone-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ─── Budget bars ─── */
.budget-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

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

.budget-name { font-size: 14px; font-weight: 500; }
.budget-amounts { font-size: 12px; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }

.budget-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.budget-bar-fill.ok { background: linear-gradient(90deg, var(--green), #34d399); }
.budget-bar-fill.warning { background: linear-gradient(90deg, var(--orange), #fbbf24); }
.budget-bar-fill.over { background: linear-gradient(90deg, var(--red), #f87171); }

.budgets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── Tabs ─── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 500;
}

.tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.tab:hover:not(.active) { color: var(--text-primary); }

/* ─── Filter bar ─── */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar .form-input, .filter-bar .form-select { padding: 8px 12px; font-size: 12px; }

/* ─── Notification ─── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 13px;
  box-shadow: var(--shadow);
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

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

/* ─── Categorization Step ─── */
.cat-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.cat-stat-pill span { font-size: 11px; font-weight: 400; color: var(--text-secondary); font-family: 'DM Sans', sans-serif; }
.cat-stat-pill.auto { background: var(--green-bg); color: var(--green); }
.cat-stat-pill.uncategorized { background: var(--orange-bg); color: var(--orange); }
.cat-stat-pill.total { background: var(--purple-bg); color: var(--purple); }

.cat-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--orange-bg);
  border: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.cat-alert-ok { background: var(--green-bg); border-color: rgba(16, 185, 129, 0.2); }
.cat-alert-icon { font-size: 18px; flex-shrink: 0; }

.cat-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.cat-bulk-bar .form-select { padding: 7px 10px; font-size: 12px; min-width: 160px; }

.cat-select {
  padding: 6px 10px !important;
  font-size: 12px !important;
  min-width: 160px;
}

.row-uncategorized {
  background: rgba(245, 158, 11, 0.04);
}

.row-uncategorized:hover { background: rgba(245, 158, 11, 0.08) !important; }

.confidence-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.confidence-tag.auto { background: var(--green-bg); color: var(--green); }
.confidence-tag.learned { background: var(--purple-bg); color: var(--purple); }
.confidence-tag.csv { background: var(--accent-glow); color: var(--accent); }
.confidence-tag.none { background: var(--orange-bg); color: var(--orange); }
.confidence-tag.manual { background: var(--cyan); background: rgba(6, 182, 212, 0.1); color: var(--cyan); }

/* ─── Mobile Bottom Nav ─── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 6px 0;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  z-index: 200;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item span { font-weight: 500; }

.bottom-nav-item.add-btn {
  background: var(--accent);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  margin-top: -18px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.bottom-nav-item.add-btn svg { width: 24px; height: 24px; }

/* ─── Responsive ─── */

/* Tablet */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .charts-grid, .budgets-grid, .form-grid { grid-template-columns: 1fr; }
  .content { padding: 20px 16px; padding-bottom: 90px; }
  .cards-row { grid-template-columns: 1fr 1fr; }
}

/* Mobile */
@media (max-width: 600px) {

  /* ── Topbar ── */
  .topbar {
    padding: 10px 14px;
    position: sticky;
    top: 0;
  }
  .logo { font-size: 16px; gap: 8px; }
  .logo-icon { width: 28px; height: 28px; font-size: 14px; }
  .topbar-actions .btn:first-child { display: none; } /* hide export btn */
  .topbar-actions .btn-primary { padding: 8px 14px; }

  /* ── Layout ── */
  .content {
    padding: 16px 12px;
    padding-bottom: 90px;
    max-height: calc(100vh - 53px);
  }

  .cards-row { grid-template-columns: 1fr; gap: 10px; margin-bottom: 20px; }

  /* ── Page header ── */
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
  .page-title { font-size: 20px; }

  /* ── Period tabs ── */
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; padding: 8px 10px; font-size: 12px; }

  /* ── Stat cards ── */
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }

  /* ── Charts ── */
  .charts-grid { gap: 14px; margin-bottom: 20px; }
  .chart-card { padding: 14px; }
  .chart-container { height: 180px; }
  .chart-title { font-size: 13px; margin-bottom: 10px; }

  /* ── Tables → scrollable ── */
  .table-card { border-radius: var(--radius-sm); }
  .table-card table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-card thead { white-space: nowrap; }
  .table-card tbody td { white-space: nowrap; padding: 12px 14px; font-size: 12px; }
  .table-card thead th { padding: 10px 14px; font-size: 10px; }
  .table-header { padding: 12px 14px; }

  /* ── Filters ── */
  .filter-bar { flex-direction: column; gap: 8px; }
  .filter-bar .form-input,
  .filter-bar .form-select { width: 100%; padding: 10px 12px; font-size: 14px; }

  /* ── Forms ── */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-input, .form-select {
    padding: 12px 14px;
    font-size: 16px; /* prevents iOS zoom on focus */
    border-radius: var(--radius-sm);
  }
  .form-label { font-size: 13px; }

  /* ── Buttons — larger touch targets ── */
  .btn { padding: 11px 16px; font-size: 14px; min-height: 44px; }
  .btn-sm { padding: 9px 14px; font-size: 13px; min-height: 40px; }

  /* ── Modal → full screen on mobile ── */
  .modal {
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
    padding: 20px 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .modal-title { font-size: 18px; }
  .modal-actions { flex-direction: column; gap: 10px; }
  .modal-actions .btn { width: 100%; justify-content: center; }

  /* ── Budgets ── */
  .budgets-grid { grid-template-columns: 1fr; gap: 12px; }
  .budget-item { padding: 14px 16px; }

  /* ── Upload zone ── */
  .upload-zone { padding: 28px 16px; }
  .upload-zone-icon { font-size: 28px; }
  .upload-zone-text { font-size: 13px; }

  /* ── Import tabs ── */
  #import-tabs { width: 100%; }
  #import-tabs .tab { flex: 1; text-align: center; }

  /* ── Category badges ── */
  .category-badge { font-size: 11px; padding: 3px 8px; }

  /* ── Amount cells ── */
  .amount-cell { font-size: 12px; }

  /* ── Categorization step ── */
  .cat-bulk-bar { flex-direction: column; align-items: stretch; }
  .cat-bulk-bar .form-select { min-width: unset; width: 100%; padding: 10px 12px; font-size: 14px; }
  .cat-stat-pill { font-size: 14px; padding: 5px 10px; }
  .cat-select { min-width: 140px !important; font-size: 13px !important; padding: 8px 10px !important; }

  /* ── Empty state ── */
  .empty-state { padding: 40px 16px; }
  .empty-state-icon { font-size: 36px; }

  /* ── Toast ── */
  .toast {
    left: 12px;
    right: 12px;
    bottom: 80px;
    text-align: center;
  }
}

/* ── Small phones ── */
@media (max-width: 380px) {
  .topbar-actions .btn-primary span { display: none; }
  .stat-value { font-size: 20px; }
  .bottom-nav-item { padding: 6px 8px; font-size: 9px; }
  .bottom-nav-item svg { width: 20px; height: 20px; }
}

/* ─── Auth Screen ─── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 400px;
  max-width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 700;
}

.auth-logo .logo-icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-form .form-input {
  padding: 14px 16px;
  font-size: 15px;
}

.auth-form .btn-primary {
  padding: 14px;
  font-size: 15px;
  width: 100%;
  justify-content: center;
}

.auth-error {
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
}

.auth-error.show { display: block; }

/* Hide app when not authenticated */
.app { display: none; }
.app.authenticated { display: block; }
.auth-screen.hidden { display: none; }

/* ─── User Menu in Topbar ─── */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-logout {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-logout:hover { color: var(--red); border-color: var(--red); }

@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .user-name { display: none; }
}

/* ─── Big Add Button ─── */
.big-add-section {
  margin-bottom: 24px;
}

.big-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.big-add-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
}

.big-add-btn:active { transform: translateY(0); }

.big-add-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
}

/* ─── Top Categories List ─── */
.top-cat-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(42, 53, 84, 0.4);
}

.top-cat-item:last-child { border-bottom: none; }

.top-cat-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-input);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.top-cat-info { flex: 1; }
.top-cat-name { font-size: 14px; font-weight: 500; }
.top-cat-count { font-size: 11px; color: var(--text-muted); }

.top-cat-bar {
  width: 120px;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-right: 12px;
}

.top-cat-bar-fill { height: 100%; border-radius: 3px; }

.top-cat-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--red);
  min-width: 90px;
  text-align: right;
}

@media (max-width: 600px) {
  .big-add-btn { padding: 16px; font-size: 14px; }
  .big-add-icon { width: 32px; height: 32px; font-size: 18px; }
  .top-cat-bar { width: 60px; }
}

/* ─── Auth Links & Success ─── */
.auth-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  text-align: center;
  transition: var(--transition);
}
.auth-link:hover { text-decoration: underline; }

.auth-success {
  background: var(--green-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--green);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
}
.auth-success.show { display: block; }
