/* ============================================================
   FINANÇAS FANTI — Design System
   Dark/Light · Glassmorphism · Mobile-first
   ============================================================ */

/* ── 1. VARIÁVEIS ─────────────────────────────────────────── */
:root {
  --bg:          #0d0d1a;
  --bg2:         #12121f;
  --bg3:         #1a1a2e;
  --surface:     rgba(255,255,255,.05);
  --surface2:    rgba(255,255,255,.08);
  --border:      rgba(255,255,255,.09);
  --border2:     rgba(255,255,255,.15);
  --text:        #e2e8f0;
  --text-sec:    #94a3b8;
  --text-muted:  #64748b;
  --accent:      #6366f1;
  --accent-h:    #818cf8;
  --accent-dim:  rgba(99,102,241,.18);
  --income:      #22c55e;
  --income-dim:  rgba(34,197,94,.15);
  --expense:     #ef4444;
  --expense-dim: rgba(239,68,68,.15);
  --warn:        #f59e0b;
  --warn-dim:    rgba(245,158,11,.15);
  --radius:      14px;
  --radius-sm:   8px;
  --radius-lg:   20px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --shadow-sm:   0 2px 8px  rgba(0,0,0,.3);
  --sidebar-w:   240px;
  --topbar-h:    56px;
  --bnav-h:      64px;
  --transition:  .2s ease;
}

[data-theme="light"] {
  --bg:          #f0f2f8;
  --bg2:         #e8eaf2;
  --bg3:         #dfe2ee;
  --surface:     rgba(255,255,255,.7);
  --surface2:    rgba(255,255,255,.9);
  --border:      rgba(0,0,0,.08);
  --border2:     rgba(0,0,0,.14);
  --text:        #1e293b;
  --text-sec:    #475569;
  --text-muted:  #94a3b8;
  --shadow:      0 4px 24px rgba(99,102,241,.12);
  --shadow-sm:   0 2px 8px  rgba(99,102,241,.08);
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ── 3. GLASSMORPHISM ─────────────────────────────────────── */
.glass {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── 4. LAYOUT: SIDEBAR + MAIN ───────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100dvh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.sidebar-brand i { font-size: 22px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-sec);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-item i { font-size: 16px; width: 18px; text-align: center; }
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-user {
  flex: 1;
  font-size: 13px;
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── 5. TOPBAR (mobile) ───────────────────────────────────── */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 150;
  height: var(--topbar-h);
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.topbar-title { flex: 1; font-weight: 600; font-size: 15px; }
.topbar-actions { display: flex; gap: 4px; }

/* ── 6. CONTENT AREA ─────────────────────────────────────── */
.content {
  flex: 1;
  padding: 20px 24px calc(var(--bnav-h) + 16px);
  max-width: 1200px;
  width: 100%;
}

/* ── 7. BOTTOM NAV (mobile) ──────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bnav-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  z-index: 100;
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color var(--transition);
  flex: 1;
  text-align: center;
}
.bnav-item i { font-size: 18px; }
.bnav-item.active { color: var(--accent); }

/* ── 8. SIDEBAR OVERLAY (mobile) ─────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 190;
}

/* ── 9. BOTÕES ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: var(--surface2);
  color: var(--text-sec);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger { background: var(--expense); color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-sec);
  font-size: 15px;
  transition: all var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--surface2); color: var(--text); }
.btn-icon-danger:hover { background: var(--expense-dim); color: var(--expense); }
.btn-link { font-size: 13px; color: var(--accent); font-weight: 500; }
.btn-link:hover { color: var(--accent-h); }

/* ── 10. FORMULÁRIOS ─────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-sec); }
.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 120px; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; min-width: 160px; }

.form-control {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  width: 100%;
  transition: border-color var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--accent); }
.form-control::placeholder { color: var(--text-muted); }
.form-control option { background: var(--bg3); color: var(--text); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 72px; }
.form-control-sm { padding: 6px 10px; font-size: 13px; }
.form-color { padding: 4px 6px; height: 40px; cursor: pointer; }

.input-password { position: relative; }
.input-password .form-control { padding-right: 42px; }
.btn-eye {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 15px;
}
.btn-eye:hover { color: var(--text); }

/* Checkbox & radio inline */
.radio-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-label input[type="radio"] { display: none; }
.radio-label input:checked + .tab-btn { opacity: 1; border-color: currentColor; }

/* ── 11. CARDS GERAIS ────────────────────────────────────── */
.card {
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sec);
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-header h3 i { color: var(--accent); }

/* ── 12. KPI CARDS ───────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.kpi-blue   { background: rgba(99,102,241,.18);  color: #818cf8; }
.kpi-green  { background: rgba(34,197,94,.18);   color: #22c55e; }
.kpi-red    { background: rgba(239,68,68,.18);   color: #ef4444; }
.kpi-yellow { background: rgba(245,158,11,.18);  color: #f59e0b; }
.kpi-info   { display: flex; flex-direction: column; gap: 3px; }
.kpi-label  { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.kpi-value  { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }

/* ── 13. LISTA DE ITENS ──────────────────────────────────── */
.list-items { display: flex; flex-direction: column; }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface2); }
.list-item-unpaid { opacity: .7; }
.list-item-paid { opacity: .55; }
.list-item-overdue { background: rgba(239,68,68,.05); }

.list-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.list-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.list-sub { font-size: 12px; color: var(--text-muted); }

.list-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.list-amount { font-size: 14px; font-weight: 700; white-space: nowrap; }
.list-actions { display: flex; gap: 2px; }

/* ── 14. PAGE HEADER ─────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title i { color: var(--accent); }

/* ── 15. MONTH NAV ───────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.month-label {
  font-size: 15px;
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}

/* ── 16. SUMMARY BAR ─────────────────────────────────────── */
.summary-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  flex-wrap: wrap;
}
.summary-divider { color: var(--border2); }

/* ── 17. FILTERS BAR ─────────────────────────────────────── */
.filters-bar { padding: 12px 16px; margin-bottom: 16px; }
.filters-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.filters-grid .form-control { min-width: 110px; flex: 1; }

/* ── 18. MODAIS ──────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; animation: fadeIn .18s ease; }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp .22s ease;
}
.modal-lg { max-width: 600px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* ── 19. CHARTS ──────────────────────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.chart-card { }
.chart-container {
  padding: 16px 18px 18px;
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chart-container canvas { max-height: 200px; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-sec);
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.empty-chart {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  min-height: 160px;
}
.empty-chart i { font-size: 32px; opacity: .4; }

/* ── 20. BOTTOM GRID ─────────────────────────────────────── */
.bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* ── 21. DEBTS ───────────────────────────────────────────── */
.debts-list { display: flex; flex-direction: column; gap: 14px; }

.debt-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.debt-done { opacity: .6; }
.debt-done-badge {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--income);
  display: flex;
  align-items: center;
  gap: 4px;
}

.debt-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.debt-card-name { font-size: 16px; font-weight: 700; }
.debt-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.debt-creditor { font-size: 12px; color: var(--text-sec); }
.debt-rate { font-size: 12px; color: var(--warn); }
.debt-card-actions { display: flex; gap: 4px; align-items: flex-start; flex-shrink: 0; }

.debt-progress-section { display: flex; flex-direction: column; gap: 6px; }
.debt-progress-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-sec); }

.debt-card-footer {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.debt-stat { display: flex; flex-direction: column; gap: 2px; }
.debt-stat-label { font-size: 11px; color: var(--text-muted); }
.debt-stat-val { font-size: 14px; font-weight: 600; }

.debts-summary { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.debt-row { display: flex; flex-direction: column; gap: 6px; }
.debt-info { display: flex; justify-content: space-between; align-items: baseline; }
.debt-name { font-size: 13px; font-weight: 500; }
.debt-meta { font-size: 11px; color: var(--text-muted); }
.debt-progress-wrap { display: flex; align-items: center; gap: 10px; }
.debt-remaining { font-size: 12px; font-weight: 600; color: var(--expense); white-space: nowrap; }
.debt-total { font-size: 13px; color: var(--text-sec); padding-top: 8px; border-top: 1px solid var(--border); text-align: right; }

/* ── 22. PROGRESS BAR ────────────────────────────────────── */
.progress-bar-track {
  flex: 1;
  height: 7px;
  background: var(--bg3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
  background: var(--accent);
}

/* ── 23. CONTAS GRID ─────────────────────────────────────── */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.account-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.account-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.account-header { display: flex; justify-content: space-between; align-items: flex-start; }
.account-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.account-actions { display: flex; gap: 2px; }
.account-name { font-size: 15px; font-weight: 700; }
.account-type { font-size: 12px; color: var(--text-muted); }
.account-balance { font-size: 22px; font-weight: 800; }

/* ── 24. CARTÕES CRÉDITO ─────────────────────────────────── */
.credit-card-widget {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: var(--radius-lg) !important;
}
.cc-top {}
.cc-name { font-size: 16px; font-weight: 700; }
.cc-bank { font-size: 12px; color: var(--text-sec); }
.cc-numbers { font-size: 16px; letter-spacing: 4px; color: var(--text-sec); font-family: monospace; }
.cc-info { display: flex; gap: 20px; flex-wrap: wrap; }
.cc-label { font-size: 11px; color: var(--text-muted); display: block; }
.cc-val { font-size: 14px; font-weight: 700; }
.cc-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-sec); }
.cc-progress .progress-bar-track { flex: 1; }
.cc-footer { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.cc-actions { display: flex; gap: 2px; }

/* ── 25. CATEGORIAS ──────────────────────────────────────── */
.cat-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cat-group-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }

/* Icon picker */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.icon-opt { cursor: pointer; }
.icon-opt input { display: none; }
.icon-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg3);
  border: 2px solid transparent;
  font-size: 16px;
  transition: all var(--transition);
}
.icon-opt input:checked + span { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.icon-opt span:hover { border-color: var(--border2); }

/* ── 26. BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  flex-shrink: 0;
}
.badge-blue   { background: var(--accent-dim); color: var(--accent); }
.badge-green  { background: var(--income-dim);  color: var(--income); }
.badge-red    { background: var(--expense-dim); color: var(--expense); }
.badge-yellow { background: var(--warn-dim);    color: var(--warn); }

/* ── 27. PAGINAÇÃO ───────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 14px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  background: var(--surface2);
  color: var(--text-sec);
  transition: all var(--transition);
}
.page-btn.active { background: var(--accent); color: #fff; }
.page-btn:hover  { background: var(--accent-dim); color: var(--accent); }

/* ── 28. ALERTS ──────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
}
.alert i { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: var(--expense-dim); color: var(--expense); border: 1px solid rgba(239,68,68,.3); }
.alert-success { background: var(--income-dim);  color: var(--income);  border: 1px solid rgba(34,197,94,.3); }
.alert-info    { background: var(--accent-dim);  color: var(--accent);  border: 1px solid rgba(99,102,241,.3); }

/* ── 29. TOASTS ──────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(20px);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  white-space: nowrap;
  max-width: 90vw;
}
.toast-success { background: rgba(34,197,94,.9);  color: #fff; }
.toast-error   { background: rgba(239,68,68,.9);  color: #fff; }
.toast-info    { background: rgba(99,102,241,.9); color: #fff; }

/* ── 30. AUTH PAGES ──────────────────────────────────────── */
.auth-body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.auth-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}
.auth-orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -100px; left: -100px;
}
.auth-orb-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #22c55e, transparent 70%);
  bottom: -80px; right: -80px;
}
.auth-container { position: relative; z-index: 1; width: 100%; max-width: 400px; }
.auth-card { padding: 32px 28px; display: flex; flex-direction: column; gap: 0; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon {
  width: 64px; height: 64px;
  background: var(--accent-dim);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--accent);
  margin: 0 auto 12px;
}
.auth-logo h1 { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.auth-logo p  { font-size: 13px; color: var(--text-muted); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-links { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-sec); }
.auth-links a { color: var(--accent); font-weight: 500; }

/* ── 31. TRANSACTION TYPE TABS ───────────────────────────── */
.type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.type-tab { flex: 1; }
.type-tab input { display: none; }
.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 2px solid transparent;
  opacity: .45;
  transition: all var(--transition);
  width: 100%;
  cursor: pointer;
}
.tab-expense { background: var(--expense-dim); color: var(--expense); }
.tab-income  { background: var(--income-dim);  color: var(--income);  }
.type-tab input:checked + .tab-btn { opacity: 1; border-color: currentColor; }

/* ── 32. EMPTY STATE ─────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state i { font-size: 40px; opacity: .35; }
.empty-state p  { font-size: 14px; }

/* ── 33. INLINE FORM ─────────────────────────────────────── */
.inline-form { display: inline; }

/* ── 34. BARCODE DISPLAY ─────────────────────────────────── */
.barcode-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0 4px;
  text-align: center;
}

/* ── 35. CORES UTILITÁRIAS ───────────────────────────────── */
.text-income  { color: var(--income)  !important; }
.text-expense { color: var(--expense) !important; }
.text-warn    { color: var(--warn)    !important; }
.text-accent  { color: var(--accent)  !important; }
.text-muted   { color: var(--text-muted); }

/* ── 36. ANIMAÇÕES ───────────────────────────────────────── */
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp  { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ── 37. SCROLLBAR CUSTOM ────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ── 38. RESPONSIVE — MOBILE ─────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }
  .sidebar-overlay.open { display: block; }

  .main-wrapper { margin-left: 0; }
  .topbar       { display: flex; }
  .bottom-nav   { display: flex; }

  .content { padding: 16px 14px calc(var(--bnav-h) + 20px); }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 16px; }
  .kpi-card  { padding: 12px 14px; }
  .kpi-icon  { width: 36px; height: 36px; font-size: 16px; }

  .charts-row   { grid-template-columns: 1fr; }
  .bottom-grid  { grid-template-columns: 1fr; }
  .cat-columns  { grid-template-columns: 1fr; }
  .accounts-grid{ grid-template-columns: 1fr 1fr; }

  .page-title { font-size: 16px; }
  .modal { padding: 18px; }
  .modal-lg { max-width: 100%; }

  .list-item  { padding: 10px 14px; }
  .list-title { font-size: 13px; }

  .filters-grid .form-control { min-width: 90px; }
  .form-row { flex-direction: column; gap: 10px; }

  .debt-card-actions .btn { display: none; }
  .debt-card-actions .btn-icon { display: flex; }

  .summary-bar { gap: 10px; font-size: 13px; }
}

@media (max-width: 400px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }
  .type-tabs .tab-btn { font-size: 12px; padding: 8px 6px; }
}

/* ── 39. IMPORT WIZARD ───────────────────────────────────── */
.import-steps {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 4px;
}
.import-step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.import-step span {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.import-step.active       { color: var(--accent); }
.import-step.active span  { background: var(--accent); border-color: var(--accent); color: #fff; }
.import-step.done         { color: var(--income); }
.import-step.done span    { background: var(--income-dim); border-color: var(--income); color: var(--income); }
.import-step-line {
  flex: 1; min-width: 20px; height: 2px;
  background: var(--border2);
  border-radius: 99px;
}
.import-step-line.active  { background: var(--accent); }

/* Tabela de dados CSV */
.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.import-table th {
  background: var(--bg3);
  color: var(--text-sec);
  font-weight: 600;
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.import-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-table tr:last-child td { border-bottom: none; }
.import-table tr:hover td { background: var(--surface2); }
.row-num { color: var(--text-muted); font-size: 11px; text-align: center; }

.import-preview-table td { white-space: nowrap; }
.import-upload-card { overflow: visible; }
