/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #EEF0FF;
  --surface: #FFFFFF;
  --border: #E2E4F0;
  --text: #1A1A2E;
  --text-muted: #6B7280;
  --primary: #7C3AED;
  --primary-light: #EDE9FE;
  --yellow: #F59E0B;
  --yellow-light: #FEF3C7;
  --green: #10B981;
  --green-light: #D1FAE5;
  --red: #EF4444;
  --red-light: #FEE2E2;
  --blue: #3B82F6;
  --blue-light: #DBEAFE;
  --pink: #EC4899;
  --pink-light: #FCE7F3;
  --teal: #06B6D4;
  --teal-light: #CFFAFE;
  --orange: #F97316;
  --sidebar-w: 240px;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 15px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}
.logo-icon { font-size: 28px; }
.logo-dollar {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #10B981, #059669);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900;
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
  box-shadow: 0 4px 12px rgba(16,185,129,0.4);
  flex-shrink: 0;
}
.logo-text { font-size: 20px; font-weight: 700; color: var(--primary); }

.nav-links { list-style: none; padding: 16px 0; flex: 1; overflow-y: auto; }
.nav-links li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 10px;
  margin: 2px 10px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-links li a:hover { background: var(--bg); color: var(--text); }
.nav-links li a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 18px; width: 22px; text-align: center; }

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

/* ── Bloc utilisateur ── */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg); margin-bottom: 10px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg,#10B981,#059669);
  color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-transform: uppercase;
}

/* ── Page Auth ── */
#auth-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.auth-bg {
  width: 100%; min-height: 100vh;
  background: linear-gradient(135deg, #111827 0%, #1f2937 50%, #111827 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-icon {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 12px;
  background: linear-gradient(135deg,#10B981,#059669);
  color: #fff; font-size: 40px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Segoe UI', sans-serif;
  box-shadow: 0 8px 32px rgba(16,185,129,0.4);
}
.auth-logo-text { font-size: 28px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.auth-logo-sub  { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 4px; }
.auth-card {
  background: #fff; border-radius: 20px; padding: 36px;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.auth-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 24px; }
.auth-error  { color: var(--red); font-size: 12px; min-height: 18px; margin-bottom: 6px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 20px; }
.auth-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.btn-settings {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.15s;
}
.btn-settings:hover { background: var(--bg); color: var(--text); }

/* ===== TOPBAR (mobile) ===== */
.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 99;
}
.topbar-title { font-weight: 700; font-size: 17px; }
.hamburger, .btn-notif {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.hamburger:hover, .btn-notif:hover { background: var(--bg); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 28px; font-weight: 800; }
.page-subtitle { color: var(--text-muted); margin-top: 4px; }

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

.balance-card {
  padding: 20px;
  border-radius: var(--radius);
  color: white;
  position: relative;
  overflow: hidden;
}
.balance-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.card-blue { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.card-green { background: linear-gradient(135deg, #10B981, #059669); }
.card-red { background: linear-gradient(135deg, #EF4444, #DC2626); }
.card-purple { background: linear-gradient(135deg, #7C3AED, #5B21B6); }
.card-yellow { background: linear-gradient(135deg, #F59E0B, #D97706); }
.card-teal { background: linear-gradient(135deg, #06B6D4, #0891B2); }

.card-label { font-size: 13px; opacity: 0.85; margin-bottom: 6px; font-weight: 500; }
.card-amount { font-size: 26px; font-weight: 800; }
.card-trend { font-size: 13px; opacity: 0.8; margin-top: 4px; }

/* ===== CHARTS ===== */
.charts-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 280px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.chart-header h3 { font-size: 16px; font-weight: 700; }

/* ===== SECTION CARDS ===== */
.section-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-header h3 { font-size: 16px; font-weight: 700; }

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: #6D28D9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,0.3); }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid var(--red);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover { background: var(--red); color: white; }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.btn-link:hover { background: var(--primary-light); }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  font-size: 16px;
  color: var(--text-muted);
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* ===== FILTERS BAR ===== */
.filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-input, .filter-select {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border 0.15s;
}
.filter-input:focus, .filter-select:focus { border-color: var(--primary); }
.filter-input { flex: 1; min-width: 180px; }

/* ===== TX SUMMARY ===== */
.tx-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tx-summary-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== TRANSACTIONS LIST ===== */
.transactions-list { display: flex; flex-direction: column; gap: 8px; }

.tx-group-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 4px 6px;
}

.tx-item {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
  cursor: pointer;
}
.tx-item:hover { transform: translateX(2px); }

.tx-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.tx-info { flex: 1; min-width: 0; }
.tx-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.tx-amount { font-weight: 700; font-size: 16px; white-space: nowrap; }
.tx-amount.income { color: var(--green); }
.tx-amount.expense { color: var(--red); }
.tx-amount.transfer { color: var(--blue); }

.tx-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.tx-item:hover .tx-actions { opacity: 1; }

.tx-cat-badge {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s;
}
.tx-cat-badge:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.cat-picker-popup {
  position: absolute;
  z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 230px;
  overflow: hidden;
}
.cat-picker-header {
  padding: 10px 14px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.cat-picker-search input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  background: var(--bg);
}
.cat-picker-list { max-height: 220px; overflow-y: auto; }
.cat-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}
.cat-picker-item:hover { background: var(--primary-light); }
.cat-picker-item.selected { background: var(--primary-light); font-weight: 600; color: var(--primary); }

/* ===== BUDGET BARS ===== */
.budget-item {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.budget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.budget-name { font-weight: 600; font-size: 15px; }
.budget-amounts { font-size: 13px; color: var(--text-muted); }
.budget-amounts strong { color: var(--text); }

.progress-bar {
  height: 10px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
}
.progress-ok { background: linear-gradient(90deg, var(--green), #34D399); }
.progress-warn { background: linear-gradient(90deg, var(--yellow), #FCD34D); }
.progress-over { background: linear-gradient(90deg, var(--red), #F87171); }

.budget-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.budget-pct { font-weight: 700; }

/* ===== SAVINGS GOALS ===== */
.saving-item {
  background: var(--surface);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.saving-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.saving-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.saving-info { flex: 1; }
.saving-name { font-weight: 700; font-size: 17px; }
.saving-type { font-size: 13px; color: var(--text-muted); }
.saving-actions { display: flex; gap: 6px; }

.saving-progress { margin-bottom: 10px; }
.saving-pct-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.saving-pct { font-weight: 700; }
.saving-amounts {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}
.saving-amounts strong { color: var(--text); font-weight: 700; }

.saving-deadline {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== DEBTS ===== */
.debt-item {
  background: var(--surface);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.debt-icon { font-size: 28px; width: 48px; text-align: center; }
.debt-info { flex: 1; }
.debt-name { font-weight: 700; font-size: 16px; }
.debt-meta { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.debt-progress { margin-top: 8px; }
.debt-amounts { font-size: 13px; }
.debt-amounts .debt-remaining-val { font-weight: 700; color: var(--red); font-size: 18px; }

/* ===== RECURRING ===== */
.recurring-item {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.rec-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.rec-info { flex: 1; }
.rec-title { font-weight: 600; font-size: 15px; }
.rec-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rec-amount { font-weight: 700; font-size: 16px; }

/* ===== INVESTMENTS ===== */
.invest-item {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.invest-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}
.invest-info { flex: 1; }
.invest-name { font-weight: 700; font-size: 15px; }
.invest-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
.invest-amounts { text-align: right; }
.invest-value { font-weight: 800; font-size: 18px; }
.invest-perf { font-size: 13px; font-weight: 600; margin-top: 2px; }
.invest-perf.pos { color: var(--green); }
.invest-perf.neg { color: var(--red); }

/* ===== MONTH SELECTOR ===== */
.month-selector {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 12px;
  width: fit-content;
  box-shadow: var(--shadow);
}
.month-selector button {
  background: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}
.month-selector button:hover { background: var(--primary-light); color: var(--primary); }
.month-selector span { font-weight: 700; font-size: 16px; min-width: 160px; text-align: center; }

/* ===== REPORT TABLE ===== */
.report-table-el {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.report-table-el th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.report-table-el th:not(:first-child), .report-table-el td:not(:first-child) { text-align: right; }
.report-table-el td { padding: 12px; border-bottom: 1px solid var(--border); }
.report-table-el tr:last-child td { border-bottom: none; font-weight: 700; background: var(--bg); }
.report-filters { display: flex; gap: 12px; margin-bottom: 20px; }

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }

.modal-box {
  background: var(--surface);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 201;
  animation: slideUp 0.2s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.modal-header h2 { font-size: 20px; font-weight: 800; }
.modal-close {
  background: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  transition: all 0.15s;
}
.modal-close:hover { background: var(--red-light); color: var(--red); }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 199;
}
.overlay.open { display: block; }

/* ===== FORMS ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border 0.15s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== TYPE SELECTOR ===== */
.type-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.type-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s;
}
.type-btn:hover { border-color: var(--primary); color: var(--primary); }
.type-btn.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* ===== COLOR PICKER ===== */
.color-picker { display: flex; gap: 10px; margin-top: 6px; }
.color-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}
.color-dot.active { border-color: var(--text); transform: scale(1.2); }
.color-dot:hover { transform: scale(1.1); }

/* ===== SETTINGS ===== */
.settings-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.settings-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.custom-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ===== TAGS / CHIPS ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.chip-income { background: var(--green-light); color: var(--green); }
.chip-expense { background: var(--red-light); color: var(--red); }
.chip-transfer { background: var(--blue-light); color: var(--blue); }

/* ===== NOTIFICATION ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  animation: slideUp 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .topbar { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 80px 16px 24px;
  }
  .form-row { grid-template-columns: 1fr; }
  .charts-row { flex-direction: column; }
}

@media (max-width: 480px) {
  .cards-row { grid-template-columns: 1fr 1fr; }
  .card-amount { font-size: 20px; }
}

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

/* ===== MISC ===== */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 20px 0 10px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
}

/* Category color dots */
.cat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ===== CATEGORIES PAGE ===== */
.cat-page-tabs { display: flex; gap: 8px; }
.cat-tab {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.cat-tab.active, .cat-tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.cat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.cat-card:hover { transform: translateY(-2px); }
.cat-card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.cat-card-info { flex: 1; min-width: 0; }
.cat-card-name { font-weight: 700; font-size: 15px; }
.cat-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cat-card-actions { display: flex; align-items: center; gap: 4px; }

/* Color swatches */
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--text); transform: scale(1.2); }

/* ===== HELLO BANK ===== */
.hello-account-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.hello-account-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.hello-account-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.hello-account-info { flex: 1; }
.hello-account-name { font-weight: 700; font-size: 16px; }
.hello-account-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.hello-account-balance { font-size: 22px; font-weight: 800; white-space: nowrap; }

.hello-mvt-list { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 10px; }
.hello-mvt-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; padding: 5px 0;
}
.hello-mvt-dir {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.hello-mvt-dir.in  { background: var(--green-light); color: var(--green); }
.hello-mvt-dir.out { background: var(--red-light);   color: var(--red);   }
.hello-mvt-label  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hello-mvt-amount { font-weight: 700; white-space: nowrap; }
.hello-mvt-amount.income  { color: var(--green); }
.hello-mvt-amount.expense { color: var(--red); }
.hello-mvt-date   { color: var(--text-muted); font-size: 11px; white-space: nowrap; }

.hello-account-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid var(--border);
}

/* ===== POTS / ENVELOPPES ===== */
.pots-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }

.pot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: 10px;
  padding: 9px 12px;
  transition: background 0.15s;
}
.pot-row:hover { background: var(--primary-light); }

.pot-row-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.pot-row-info { flex: 1; min-width: 0; }
.pot-row-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pot-row-amount {
  font-size: 15px; font-weight: 800;
  white-space: nowrap; text-align: right;
}
.pot-row-target { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.pot-row-actions { display: flex; align-items: center; gap: 3px; opacity: 0; transition: opacity 0.15s; }
.pot-row:hover .pot-row-actions { opacity: 1; }

.pot-btn-add, .pot-btn-sub {
  border: none; border-radius: 6px;
  width: 26px; height: 26px;
  font-size: 16px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.pot-btn-add { background: var(--green-light); color: var(--green); }
.pot-btn-add:hover { background: var(--green); color: #fff; }
.pot-btn-sub { background: var(--red-light);   color: var(--red); }
.pot-btn-sub:hover { background: var(--red); color: #fff; }

.pot-row-add {
  border: 2px dashed var(--border);
  background: transparent;
  cursor: pointer;
  justify-content: center;
  gap: 8px;
  padding: 8px;
}
.pot-row-add:hover { border-color: var(--primary); background: var(--primary-light); }
