/* ============================================================
   Finio — Personal Finance OS
   style.css
   ============================================================ */

/* ── Variables ── */
:root {
  --accent: #6ee7b7;
  --accent-dim: rgba(110,231,183,0.12);
  --accent-glow: rgba(110,231,183,0.25);
  --danger: #f87171;
  --danger-dim: rgba(248,113,113,0.12);
  --warning: #fbbf24;
  --warning-dim: rgba(251,191,36,0.12);
  --blue: #60a5fa;
  --blue-dim: rgba(96,165,250,0.12);
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --sidebar-w: 228px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.18s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="dark"] {
  --bg: #080810;
  --bg-secondary: #0e0e1a;
  --surface: #13131f;
  --surface-2: #1a1a2e;
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.13);
  --text-primary: #f0f0ff;
  --text-secondary: rgba(240,240,255,0.55);
  --text-muted: rgba(240,240,255,0.3);
  --sidebar-bg: #09090f;
  --modal-bg: #13131f;
  --input-bg: #0e0e1a;
  --shadow: 0 8px 40px rgba(0,0,0,0.5);
}

[data-theme="light"] {
  --bg: #f4f5f9;
  --bg-secondary: #eceef5;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: rgba(0,0,0,0.07);
  --border-strong: rgba(0,0,0,0.13);
  --text-primary: #0f0f1a;
  --text-secondary: rgba(15,15,26,0.6);
  --text-muted: rgba(15,15,26,0.35);
  --sidebar-bg: #0f0f1a;
  --modal-bg: #ffffff;
  --input-bg: #f4f5f9;
  --shadow: 0 8px 40px rgba(0,0,0,0.12);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  padding: 24px 16px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  padding: 0 4px;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 16px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item.active svg { stroke: var(--accent); }

.sidebar-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all var(--transition);
}

.theme-toggle:hover { color: #fff; background: rgba(255,255,255,0.1); }
.theme-toggle-mobile { background: transparent; border: none; cursor: pointer; color: var(--text-primary); display: flex; }

[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85); }
.user-email { font-size: 11px; color: rgba(255,255,255,0.35); }

/* ── MOBILE HEADER ── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 99;
}

.mobile-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.hamburger {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 5px;
}

.hamburger span {
  display: block; width: 22px; height: 2px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ── MAIN ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 40px 40px 60px;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ── PAGES ── */
.page { display: none; }
.page.active { display: block; animation: fadeUp 0.3s ease; }

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

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.wave { display: inline-block; animation: wave 2.5s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave {
  0%,60%,100% { transform: rotate(0deg); }
  10%,30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

.page-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* ── KPI CARDS ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.kpi-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kpi-card:hover::before { opacity: 1; }

.kpi-income::before { background: var(--accent); }
.kpi-expense::before { background: var(--danger); }
.kpi-savings::before { background: var(--blue); }
.kpi-debt::before { background: var(--warning); }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.kpi-delta {
  font-size: 12px;
  color: var(--text-secondary);
}

.kpi-delta.positive { color: var(--accent); }
.kpi-delta.negative { color: var(--danger); }

/* ── CHARTS ── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

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

.chart-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.chart-tab {
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ── DONUT LEGEND ── */
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-name { color: var(--text-secondary); flex: 1; }
.legend-val { color: var(--text-primary); font-weight: 500; }

/* ── BOTTOM ROW ── */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

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

.card-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.link-sm {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

/* ── TRANSACTION LIST ── */
.txn-list { display: flex; flex-direction: column; gap: 2px; }

.txn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.txn-item:hover { background: var(--surface-2); }

.txn-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

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

.txn-cat-date {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.txn-amount {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.txn-amount.income { color: var(--accent); }
.txn-amount.expense { color: var(--danger); }

/* ── HEALTH CARD ── */
.health-card { display: flex; flex-direction: column; gap: 0; }

.health-score-ring {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 8px auto 16px;
}

.health-score-ring svg { display: block; }

.ring-bg { stroke: var(--border-strong); }
.ring-fill { stroke: var(--accent); transition: stroke-dashoffset 1s ease; }

.health-score-label {
  position: absolute;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.health-score-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
}

.health-score-txt {
  font-size: 13px;
  color: var(--text-muted);
}

.health-breakdown { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.health-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.health-row > span:first-child { width: 90px; flex-shrink: 0; }

.health-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.health-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 1s ease;
}

.health-bar.danger { background: var(--danger); }

.health-val { font-weight: 600; color: var(--text-primary); min-width: 35px; text-align: right; }

.nudge-box {
  background: var(--accent-dim);
  border: 1px solid rgba(110,231,183,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: auto;
}

.nudge-icon { flex-shrink: 0; }

/* ── TRANSACTION TABLE ── */
.txn-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 200px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition);
}

.search-input:focus { border-color: var(--accent); }

select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
}

.txn-table-wrap { overflow-x: auto; }

.txn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.txn-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.txn-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.txn-table tr:last-child td { border-bottom: none; }
.txn-table tr:hover td { background: var(--surface-2); }

.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.type-badge.income { background: var(--accent-dim); color: var(--accent); }
.type-badge.expense { background: var(--danger-dim); color: var(--danger); }

.delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}

.delete-btn:hover { color: var(--danger); background: var(--danger-dim); }

/* ── LOANS ── */
.loans-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }

.loan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

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

.loan-name-wrap { display: flex; align-items: center; gap: 10px; }

.loan-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--blue-dim);
  color: var(--blue);
}

.loan-name-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.loan-amount {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--warning);
}

.loan-meta {
  display: flex;
  gap: 24px;
  margin-bottom: 14px;
}

.loan-meta-item { display: flex; flex-direction: column; gap: 3px; }
.loan-meta-label { font-size: 11px; color: var(--text-muted); }
.loan-meta-value { font-size: 13px; font-weight: 500; color: var(--text-primary); }

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #34d399);
  border-radius: 4px;
  transition: width 1s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── RECURRING ── */
.recurring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.rec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition);
}

.rec-card:hover { border-color: var(--border-strong); }

.rec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rec-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.rec-freq {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-muted);
}

.rec-amount {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.rec-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rec-cat {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.rec-due {
  font-size: 11.5px;
  color: var(--warning);
}

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

/* ── INSIGHTS ── */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.insight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.insight-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.insight-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.insight-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.insight-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-positive { background: var(--accent-dim); color: var(--accent); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
.badge-info { background: var(--blue-dim); color: var(--blue); }

/* ── LEDGER ── */
.ledger-month { margin-bottom: 28px; }

.ledger-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
}

.ledger-month-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ledger-month-summary {
  display: flex;
  gap: 20px;
  font-size: 12px;
}

.ledger-month-income { color: var(--accent); font-weight: 600; }
.ledger-month-expense { color: var(--danger); font-weight: 600; }

.ledger-month-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }

/* ── HEATMAP ── */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 8px;
}

.heatmap-day {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--border);
  cursor: default;
  transition: all var(--transition);
}

.heatmap-day:hover { transform: scale(1.15); }

.heatmap-day.lvl-1 { background: rgba(110,231,183,0.2); }
.heatmap-day.lvl-2 { background: rgba(110,231,183,0.4); }
.heatmap-day.lvl-3 { background: rgba(110,231,183,0.65); }
.heatmap-day.lvl-4 { background: var(--accent); }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--modal-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}

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

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

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all var(--transition);
}

.modal-close:hover { color: var(--danger); background: var(--danger-dim); }

.modal-body { padding: 0 28px 28px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

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

.form-group input:focus, .form-group select:focus { border-color: var(--accent); }

.toggle-group {
  display: flex;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.toggle-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
}

.toggle-btn.active {
  background: var(--accent);
  color: #0a1a12;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  cursor: pointer;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

.checkbox-label input { width: auto !important; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--accent);
  color: #0a1a12;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary:hover { background: #34d399; transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }

.btn-outline {
  background: var(--surface-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-outline:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  z-index: 999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.toast.show { opacity: 1; transform: translateY(0); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    width: 240px;
  }

  .sidebar.open { transform: translateX(0); }

  .main {
    margin-left: 0;
    padding: 80px 16px 40px;
    max-width: 100vw;
  }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 20px; }

  .page-header { flex-direction: column; align-items: flex-start; }
  .page-title { font-size: 22px; }

  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: 1; }
  .loan-meta { flex-wrap: wrap; gap: 12px; }

  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .txn-filters { flex-direction: column; }
  .txn-filters .search-input { min-width: 100%; }
  .recurring-grid { grid-template-columns: 1fr; }
}

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

/* ── CATEGORY ICONS ── */
.cat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; }

/* ══════════════════════════════════════
   NEW MODULES — Budget, Goals, Net Worth
   ══════════════════════════════════════ */

/* ── BUDGET PAGE ── */
.budget-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.budget-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color var(--transition);
}

.budget-card.over-budget {
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.03);
}

.budget-card.near-budget {
  border-color: rgba(251,191,36,0.35);
}

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

.budget-cat-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.budget-cat-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.budget-amounts {
  text-align: right;
}

.budget-spent-val {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.budget-limit-val {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.budget-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

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

.budget-bar-fill.safe    { background: var(--accent); }
.budget-bar-fill.warning { background: var(--warning); }
.budget-bar-fill.danger  { background: var(--danger); }

.budget-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

.budget-bar-meta .pct { font-weight: 600; }
.budget-bar-meta .pct.safe    { color: var(--accent); }
.budget-bar-meta .pct.warning { color: var(--warning); }
.budget-bar-meta .pct.danger  { color: var(--danger); }

/* Budget mini grid on dashboard */
.budget-mini-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.budget-mini-row {
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.budget-mini-label {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.budget-mini-val {
  font-size: 12px;
  text-align: right;
  color: var(--text-muted);
}

/* Budget alert strip */
.budget-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.budget-alert.danger-alert {
  background: rgba(248,113,113,0.08);
  border-color: rgba(248,113,113,0.25);
}

/* ── GOALS PAGE ── */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color var(--transition), transform var(--transition);
}

.goal-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.goal-card.completed {
  border-color: rgba(110,231,183,0.4);
  background: rgba(110,231,183,0.03);
}

.goal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.goal-icon-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.goal-emoji {
  font-size: 26px;
  line-height: 1;
}

.goal-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.goal-cat {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.goal-amounts {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
}

.goal-saved-amount {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.goal-target-amount {
  font-size: 13px;
  color: var(--text-muted);
}

.goal-progress-wrap {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 10px;
}

.goal-progress-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #6ee7b7, #34d399);
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

.goal-progress-fill.near {
  background: linear-gradient(90deg, var(--warning), #f59e0b);
}

.goal-progress-fill.complete {
  background: linear-gradient(90deg, #6ee7b7, #059669);
}

.goal-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.goal-pct {
  font-weight: 700;
  color: var(--accent);
}

.goal-pct.near { color: var(--warning); }
.goal-pct.complete { color: var(--accent); }

.goal-months-left {
  color: var(--text-muted);
}

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

.goal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.goal-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.goal-stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.goal-stat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.goal-complete-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(110,231,183,0.3);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  width: fit-content;
}

/* ── NET WORTH PAGE ── */
.networth-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.networth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(110,231,183,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.nw-hero-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.nw-hero-value {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -2px;
  color: var(--text-primary);
  margin-bottom: 8px;
  transition: color 0.4s ease;
}

.nw-hero-value.positive { color: var(--accent); }
.nw-hero-value.negative { color: var(--danger); }

.nw-hero-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.nw-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}

.nw-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.nw-col-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.nw-col-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.nw-col-total {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.nw-col-total.accent { color: var(--accent); }
.nw-col-total.danger { color: var(--danger); }

.nw-items { display: flex; flex-direction: column; gap: 4px; }

.nw-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.nw-item:hover { background: var(--surface-2); }

.nw-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nw-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--surface-2);
  flex-shrink: 0;
}

.nw-item-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.nw-item-type {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.nw-item-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.nw-item-value.asset { color: var(--accent); }
.nw-item-value.liability { color: var(--danger); }

/* NW Allocation Legend */
#nwAllocLegend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nw-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nw-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.nw-legend-name {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}

.nw-legend-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.nw-legend-pct {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 34px;
  text-align: right;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .nw-split { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .budget-mini-row { grid-template-columns: 100px 1fr 70px; }
  .goals-grid { grid-template-columns: 1fr; }
  .budget-page-grid { grid-template-columns: 1fr; }
  .nw-hero-value { font-size: 36px; }
}

/* ══════════════════════════════════════
   AUTH SCREEN
   ══════════════════════════════════════ */

.auth-screen {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.auth-left {
  width: 480px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 40px 48px;
  overflow-y: auto;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}

.auth-logo-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.auth-panel { flex: 1; }

.auth-heading {
  margin-bottom: 32px;
}

.auth-heading h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.auth-heading p {
  font-size: 14px;
  color: var(--text-secondary);
}

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

.auth-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 0;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}

.auth-form .form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.auth-form .form-group input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.auth-form .form-group input:focus { border-color: var(--accent); }

.password-wrap {
  position: relative;
}

.password-wrap input { padding-right: 42px; }

.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color var(--transition);
}

.pw-toggle:hover { color: var(--text-secondary); }

.auth-btn {
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-demo-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-demo-divider::before,
.auth-demo-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-error {
  font-size: 12.5px;
  color: var(--danger);
  min-height: 16px;
}

/* AUTH RIGHT */
.auth-right {
  flex: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
}

.auth-right::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(110,231,183,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.auth-right::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(96,165,250,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.auth-right-inner {
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-tagline {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 48px;
}

[data-theme="light"] .auth-tagline { color: #0f0f1a; }

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.auth-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.auth-feature-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.auth-feature-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.auth-feature-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.auth-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}

/* DISCLAIMER BANNER */
.disclaimer-banner {
  background: rgba(251,191,36,0.07);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
}

.disclaimer-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
}

.disclaimer-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.disclaimer-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.disclaimer-text strong { color: var(--text-primary); }

.disclaimer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition);
}

.disclaimer-close:hover { background: rgba(251,191,36,0.15); color: var(--text-primary); }

/* SIGN OUT LINK */
.user-signout {
  font-size: 11px;
  color: var(--danger);
  cursor: pointer;
  transition: opacity var(--transition);
}

.user-signout:hover { opacity: 0.7; }

/* AUTH RESPONSIVE */
@media (max-width: 900px) {
  .auth-right { display: none; }
  .auth-left { width: 100%; border-right: none; }
}

@media (max-width: 480px) {
  .auth-left { padding: 28px 24px; }
  .auth-form .form-grid { grid-template-columns: 1fr; }
  .auth-tagline { font-size: 32px; }
}

/* ══════════════════════════════════════
   IMPORT MODULE
   ══════════════════════════════════════ */

/* Nav badge */
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #0a1a12;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 20px;
  text-transform: uppercase;
}

/* Step indicator */
.import-steps {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.import-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.import-step.active  { opacity: 1; }
.import-step.done    { opacity: 0.7; }

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--transition);
}

.import-step.active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a1a12;
}

.import-step.done .step-num {
  background: rgba(110,231,183,0.2);
  border-color: var(--accent);
  color: var(--accent);
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.import-step.active .step-label { color: var(--text-primary); font-weight: 600; }

.import-step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
  min-width: 20px;
}

/* Panels */
.import-panel { animation: fadeUp 0.25s ease; }

.import-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.import-panel-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.import-panel-sub { font-size: 13px; color: var(--text-secondary); }

/* Upload zone */
.upload-zone {
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 28px;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.upload-icon {
  width: 72px; height: 72px;
  border-radius: 18px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.upload-zone:hover .upload-icon {
  background: rgba(110,231,183,0.15);
  color: var(--accent);
}

.upload-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.upload-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.upload-types {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Info cards */
.import-info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.import-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.iic-icon { font-size: 24px; margin-bottom: 10px; }

.iic-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.iic-body { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* Mapper */
.mapper-detected-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(110,231,183,0.1);
  border: 1px solid rgba(110,231,183,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 20px;
}

.mapper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.mapper-field {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.mapper-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mapper-required {
  color: var(--danger);
  font-size: 10px;
}

.mapper-field select {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
}

.mapper-field select:focus { border-color: var(--accent); }

/* Preview table */
.import-preview-wrap { margin-bottom: 24px; }

.import-preview-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.import-preview-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.import-preview-table th {
  padding: 8px 12px;
  text-align: left;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.import-preview-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Review table */
.review-stats {
  display: flex;
  gap: 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.review-stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.review-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.review-stat-value { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text-primary); }
.review-stat-value.income { color: var(--accent); }
.review-stat-value.expense { color: var(--danger); }

.review-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  max-height: 480px;
  overflow-y: auto;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 700px;
}

.review-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.review-table th {
  padding: 10px 12px;
  text-align: left;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.review-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.review-table tr.deselected td { opacity: 0.4; }
.review-table tr:hover td { background: var(--surface-2); }

.review-table input[type="text"],
.review-table input[type="number"],
.review-table input[type="date"],
.review-table select {
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--text-primary);
  font-size: 12.5px;
  font-family: var(--font-body);
  outline: none;
  width: 100%;
  transition: border-color var(--transition);
}

.review-table input[type="text"]:focus,
.review-table input[type="number"]:focus,
.review-table input[type="date"]:focus,
.review-table select:focus {
  border-color: var(--accent);
}

.review-table .type-toggle {
  display: flex;
  gap: 4px;
}

.review-type-btn {
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}

.review-type-btn.income.active  { background: var(--accent-dim);  border-color: var(--accent);  color: var(--accent);  }
.review-type-btn.expense.active { background: var(--danger-dim);  border-color: var(--danger);  color: var(--danger);  }

/* Import actions */
.import-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Success state */
.import-success {
  text-align: center;
  padding: 60px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.import-success-icon { font-size: 56px; margin-bottom: 20px; }

.import-success-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.import-success-sub { font-size: 14px; color: var(--text-secondary); }

/* PDF extraction result box */
.pdf-extract-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.pdf-extract-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-raw-text {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 900px) {
  .import-info-cards { grid-template-columns: 1fr; }
  .import-steps { flex-wrap: wrap; gap: 8px; }
  .import-step-line { display: none; }
}

@media (max-width: 600px) {
  .upload-zone { padding: 32px 16px; }
  .mapper-grid { grid-template-columns: 1fr 1fr; }
}
