/* =============================================
   FINANCEAPP — REDESIGN
   Mobile-First · Light Theme · Plus Jakarta Sans
   ============================================= */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

/* ── TOKENS ─────────────────────────────────── */
:root {
  /* Brand — mint / emerald */
  --brand:       #0ECB81;
  --brand-strong:#0aae6d;
  --brand-soft:  #e6fdf4;
  --brand-text:  #065f46;

  /* Semantic */
  --income:      #0ECB81;
  --income-soft: #e6fdf4;
  --expense:     #f43f5e;
  --expense-soft:#fff0f3;
  --warning:     #f59e0b;
  --warning-soft:#fffbeb;
  --accent:      #6366f1;
  --accent-strong:#4f46e5;
  --accent-soft: #eef2ff;

  /* Neutrals */
  --bg:          #f4f6fb;
  --surface:     #ffffff;
  --surface-2:   #f0f2f8;
  --surface-3:   #f8f9fc;
  --text:        #0d1b2a;
  --text-2:      #374151;
  --muted:       #64748b;
  --muted-2:     #94a3b8;
  --border:      rgba(13,27,42,0.08);
  --border-2:    rgba(13,27,42,0.05);

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(13,27,42,0.06), 0 1px 2px rgba(13,27,42,0.04);
  --shadow:      0 4px 16px rgba(13,27,42,0.07), 0 1px 4px rgba(13,27,42,0.04);
  --shadow-md:   0 8px 32px rgba(13,27,42,0.10), 0 2px 8px rgba(13,27,42,0.06);
  --shadow-lg:   0 20px 60px rgba(13,27,42,0.14);

  /* Layout */
  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --radius-xl:   24px;
  --sidebar:     240px;
  --bottom-nav:  72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Typography */
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand:       #0ECB81;
  --brand-strong:#34d399;
  --brand-soft:  #052e16;
  --brand-text:  #6ee7b7;
  --income:      #0ECB81;
  --income-soft: #052e16;
  --expense:     #fb7185;
  --expense-soft:#1f0a0e;
  --warning:     #fbbf24;
  --warning-soft:#1a1000;
  --accent:      #818cf8;
  --accent-strong:#a5b4fc;
  --accent-soft: #1e1b4b;
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #21262d;
  --surface-3:   #13171e;
  --text:        #e6edf3;
  --text-2:      #c9d1d9;
  --muted:       #8b949e;
  --muted-2:     #6e7681;
  --border:      rgba(240,246,252,0.10);
  --border-2:    rgba(240,246,252,0.06);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.30);
  --shadow:      0 4px 16px rgba(0,0,0,0.40);
  --shadow-md:   0 8px 32px rgba(0,0,0,0.50);
  --shadow-lg:   0 20px 60px rgba(0,0,0,0.60);
  color-scheme: dark;
}

/* ── RESET ───────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
}

button { cursor: pointer; }
canvas { display: block; width: 100%; max-width: 100%; }

.hidden { display: none !important; }

/* ── APP SHELL ───────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav) + var(--safe-bottom) + 8px);
}

/* ── SIDEBAR (desktop only) ──────────────────── */
.sidebar {
  display: none;
}

/* ── MOBILE HEADER ───────────────────────────── */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-brand span {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-mark-sm {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 11px;
}

.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hide desktop topbar on mobile */
.topbar { display: none; }

/* ── MAIN CONTENT ───────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  padding: 16px 14px 20px;
}

/* ── VIEWS ──────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── HOME HERO ──────────────────────────────── */
.home-hero {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0d1b2a 0%, #1a2f4a 60%, #0d2b1f 100%);
  color: #fff;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(14,203,129,0.18) 0%, transparent 55%),
              radial-gradient(circle at 20% 80%, rgba(99,102,241,0.12) 0%, transparent 45%);
  pointer-events: none;
}

.month-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 0;
}

.month-label {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

.month-nav {
  display: flex;
  gap: 4px;
}

.month-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 9px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  transition: background 150ms, color 150ms, transform 150ms;
}

.month-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }
.month-btn:active { transform: scale(0.92); }

.hero-body {
  position: relative;
  padding: 14px 18px 18px;
}

.hero-label {
  margin: 0 0 6px;
  color: rgba(255,255,255,0.5);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-amount {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #fff;
}

.hero-sub {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}

.hero-pill-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.hero-pill {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
}

.hero-pill.free { grid-column: 1 / -1; }

.hero-pill span,
.hero-pill small {
  color: rgba(255,255,255,0.55);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-pill.in span, .hero-pill.in small { color: rgba(14,203,129,0.75); }
.hero-pill.out span, .hero-pill.out small { color: rgba(244,63,94,0.75); }
.hero-pill.free span, .hero-pill.free small { color: rgba(165,180,252,0.75); }

.hero-pill strong {
  overflow: hidden;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(14px, 3.5vw, 18px);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}

/* ── QUICK ACTIONS ──────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.quick-actions button {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 150ms, color 150ms, border-color 150ms, transform 150ms, box-shadow 150ms;
  box-shadow: var(--shadow-sm);
}

.quick-actions button:hover {
  background: var(--surface);
  color: var(--brand-strong);
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.quick-actions button:active { transform: scale(0.94); }

.quick-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--accent);
  transition: background 150ms, color 150ms;
}

.quick-icon.zap   { background: var(--income-soft);   color: var(--income); }
.quick-icon.add   { background: var(--accent-soft);    color: var(--accent); }
.quick-icon.cash  { background: #e0f7ef;               color: #0f766e; }
.quick-icon.insight{ background: var(--accent-soft);   color: var(--accent); }
.quick-icon.bill  { background: var(--warning-soft);   color: var(--warning); }
.quick-icon.budget{ background: var(--accent-soft);    color: var(--accent); }
.quick-icon.goal  { background: #f3e8ff;               color: #9333ea; }

/* ── DASHBOARD GRID ─────────────────────────── */
.dashboard-grid,
.kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

/* ── PANEL ──────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.panel.wide { grid-column: auto; }

.metric {
  min-width: 0;
  min-height: 100px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric span, .metric small { display: block; color: var(--muted); font-size: 12px; }

.metric strong {
  display: block;
  margin: 6px 0 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.metric.positive strong, .amount-income { color: var(--income); }
.metric.negative strong, .amount-expense { color: var(--expense); }
.metric.accent strong, .amount-transfer { color: var(--accent); }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.muted { color: var(--muted); font-size: 12px; }

/* ── BADGE ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
}

.badge.soft {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
}

/* ── BUTTONS ────────────────────────────────── */
.button,
.file-button,
.link-button,
.quick-examples button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  transition: background 150ms, border-color 150ms, color 150ms, transform 120ms, box-shadow 150ms;
  box-shadow: var(--shadow-sm);
}

.button:hover, .file-button:hover, .quick-examples button:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.button:active, .file-button:active, .quick-examples button:active {
  transform: scale(0.97);
}

.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent);
}

.button.primary:hover {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--brand) 35%, transparent);
}

.button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
  box-shadow: none;
}

.button.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.button.danger {
  border-color: var(--expense);
  color: var(--expense);
  background: transparent;
  box-shadow: none;
}

.button.danger:hover {
  background: var(--expense-soft);
  border-color: var(--expense);
}

.button.full, .link-button.full { width: 100%; }

.link-button {
  min-height: 28px;
  padding-inline: 8px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
}

.link-button:hover {
  background: var(--brand-soft);
  transform: none;
  box-shadow: none;
}

.link-button.tiny {
  min-height: 24px;
  padding-inline: 6px;
  font-size: 11px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  transition: background 150ms, color 150ms;
  padding: 0;
}

.icon-button:hover { background: var(--expense-soft); color: var(--expense); border-color: var(--expense); }

.file-button input { display: none; }

/* ── GRIDS ──────────────────────────────────── */
.insight-grid,
.split-grid,
.whatsapp-grid,
.wallet-grid,
.settings-grid,
.form-grid,
.filters {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.split-grid,
.whatsapp-grid,
.wallet-grid,
.settings-grid {
  margin-bottom: 12px;
}

.form-grid { gap: 10px; }
.filters { gap: 10px; }
.compact-form { gap: 8px; }

/* ── FORM ELEMENTS ──────────────────────────── */
label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

label.label-full { grid-column: 1 / -1; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="search"],
select {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  font-size: 14px;
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
  background: var(--surface);
}

input[type="search"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  padding-left: 34px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

/* ── RADIO TOGGLE ───────────────────────────── */
.di-radio-wrap { position: relative; }

.di-radio-input { position: absolute; opacity: 0; width: 0; height: 0; }

.di-radio-island {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
  padding: 3px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.di-radio-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(33.333% - 2px);
  height: calc(100% - 6px);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

#txIncome:checked ~ .di-radio-island .di-radio-indicator { transform: translateX(100%); }
#txTransfer:checked ~ .di-radio-island .di-radio-indicator { transform: translateX(200%); }

.di-radio-btn {
  position: relative;
  z-index: 1;
  display: block;
  padding: 7px 6px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: color 180ms;
}

#txExpense:checked ~ .di-radio-island label[for="txExpense"],
#txIncome:checked ~ .di-radio-island label[for="txIncome"],
#txTransfer:checked ~ .di-radio-island label[for="txTransfer"] {
  color: var(--text);
}

/* ── CHECKBOX ───────────────────────────────── */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.check-input { position: absolute; opacity: 0; width: 0; height: 0; }

.check {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  transition: border-color 150ms, background 150ms;
}

.check svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2.5; stroke-dasharray: 30; stroke-dashoffset: 30; transition: stroke-dashoffset 200ms; }
.check svg path { fill: none; stroke: transparent; }
.check svg polyline { stroke: #fff; }

.check-input:checked + .check {
  background: var(--brand);
  border-color: var(--brand);
}

.check-input:checked + .check svg polyline { stroke-dashoffset: 0; }

/* ── HEALTH / SCORE ─────────────────────────── */
.health-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.score-wrap { display: flex; justify-content: center; }

.score-ring {
  --score: 0deg;
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--surface) 56%, transparent 57%),
    conic-gradient(var(--brand) var(--score), var(--surface-2) 0);
  box-shadow: var(--shadow);
}

.score-ring span {
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.health-list,
.stack-list,
.action-list,
.status-box,
.parse-preview,
.quick-question-grid {
  display: grid;
  gap: 8px;
}

/* ── LIST ITEMS ─────────────────────────────── */
.list-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
}

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

.list-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.list-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  flex-wrap: wrap;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── PROGRESS ───────────────────────────────── */
.progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
  margin: 6px 0;
}

.progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress.warn > span { background: var(--warning); }
.progress.danger > span { background: var(--expense); }

/* ── HEALTH ITEMS ───────────────────────────── */
.health-item { display: grid; gap: 5px; }
.health-item header { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }

/* ── QUICK QUESTIONS ────────────────────────── */
.quick-question-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 10px;
}

.quick-question {
  min-height: 44px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: border-color 150ms, background 150ms, transform 150ms, box-shadow 150ms;
}

.quick-question:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ── STATUS BOX ─────────────────────────────── */
.status-box {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}

.status-box strong { display: block; font-size: 13px; margin-bottom: 4px; color: var(--text); }
.status-box p { margin: 0; color: var(--muted); }
.status-box code { font-family: "JetBrains Mono", monospace; font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; color: var(--accent); }

/* ── TABLES ─────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

.table-wrap.compact { margin-top: -4px; }

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

th {
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  background: var(--surface-3);
  white-space: nowrap;
}

td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
  color: var(--text-2);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-3); }

/* ── BANK / INSIGHTS ────────────────────────── */
.bank-shell {
  display: grid;
  gap: 14px;
}

.bank-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bank-header h2 {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.bank-period {
  color: var(--muted-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.bank-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bank-balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1.5px solid color-mix(in srgb, var(--income) 25%, var(--border));
  border-radius: 10px;
  background: var(--income-soft);
  color: var(--income);
  font-size: 13px;
  font-weight: 600;
}

.bank-balance-chip.saved {
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
}

.statement-import-grid {
  margin: 16px 0;
}

.pdf-import-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.statement-file-button {
  min-height: 44px;
}

.statement-import-panel .status-box {
  margin-top: 0;
}

.import-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.import-summary-grid span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
}

.import-summary-grid strong {
  color: var(--text);
  font-size: 15px;
}

.statement-import-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.bank-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  position: sticky;
  top: calc(57px + 1px);
  z-index: 10;
}

.bank-tab {
  min-height: 34px;
  padding: 0 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: background 150ms, color 150ms;
  white-space: nowrap;
}

.bank-tab:hover { color: var(--text); }

.bank-tab.active {
  background: var(--surface);
  color: var(--brand-strong);
  box-shadow: var(--shadow-sm);
}

.bank-tab-panel { display: none; }
.bank-tab-panel.active { display: grid; gap: 12px; }
.bank-overview-grid { margin-top: 4px; }

.bank-history-filters {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}

.bank-transaction-list {
  display: grid;
  gap: 0;
  max-height: min(65vh, 600px);
  overflow: auto;
  padding-right: 2px;
}

.bank-transaction {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-2);
}

.bank-transaction:last-child { border-bottom: none; }

.bank-transaction-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bank-transaction-main strong,
.bank-transaction-main small { display: block; }

.bank-transaction-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-transaction-main small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
}

.bank-transaction-category { max-width: 200px; margin-top: 6px; }

.bank-transaction-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  padding-top: 1px;
}

/* ── INSIGHT HERO ───────────────────────────── */
.insight-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.insight-hero article {
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.insight-hero span,
.insight-hero small {
  display: block;
  color: var(--muted-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.insight-hero strong {
  display: block;
  overflow: hidden;
  margin: 6px 0 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(16px, 3.5vw, 22px);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── INSIGHT PLAN ───────────────────────────── */
.insight-plan {
  display: grid;
  gap: 8px;
}

.plan-step {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}

.plan-step > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.plan-step strong { margin: 0; font-size: 13px; font-weight: 700; }
.plan-step p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ── BILL ITEMS ─────────────────────────────── */
.bill-item { padding: 10px 0; }
.bill-item.warn .list-item-title strong { color: var(--warning); }
.bill-item.danger .list-item-title strong { color: var(--expense); }

.bill-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.insight-opportunity strong { white-space: nowrap; }
.insight-form { margin-bottom: 8px; }

/* ── LEGEND ─────────────────────────────────── */
.legend,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.legend-item,
.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
}

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

/* ── ACTION LIST ────────────────────────────── */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── EYEBROW / TYPOGRAPHY ───────────────────── */
.eyebrow {
  margin: 0 0 3px;
  color: var(--muted-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── WHATSAPP / CHAT ────────────────────────── */
.phone-panel { padding: 0; overflow: hidden; }

.phone-frame {
  display: flex;
  flex-direction: column;
  min-height: 480px;
  height: min(60vh, 600px);
  border-radius: var(--radius);
  overflow: hidden;
  background: #e5ddd5;
}

:root[data-theme="dark"] .phone-frame { background: #1a1a1a; }

.phone-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--brand);
  color: #fff;
}

.phone-header strong { display: block; font-weight: 700; font-size: 15px; }
.phone-header span { display: block; font-size: 11px; opacity: 0.75; }

.phone-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 13px;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.bubble.user {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble.bot {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.chat-form input {
  border-radius: 999px;
  min-height: 40px;
  background: var(--surface-2);
}

.chat-form .button { border-radius: 999px; min-height: 40px; padding: 0 16px; }

.parse-preview { min-height: 80px; }

.parse-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-2);
}

.parse-row:last-child { border-bottom: none; }

.quick-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.quick-examples button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
}

/* ── INLINE CATEGORY SELECT ─────────────────── */
.inline-category-select {
  width: 100%;
  max-width: 180px;
  min-height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
}

/* ── EMPTY STATE ────────────────────────────── */
.empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* ── THEME SWITCH ───────────────────────────── */
.theme-switch {
  display: inline-block;
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.theme-switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  transition: background 250ms, border-color 250ms;
}

.slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1), background 250ms;
}

.theme-switch input:checked + .slider { background: #1a2f4a; border-color: #334155; }
.theme-switch input:checked + .slider::before { transform: translateX(20px); background: #f8fafc; }

/* ── SCORE RING BONUS ───────────────────────── */
.bank-metrics { grid-template-columns: 1fr 1fr; }

/* ── OVERLAYS ───────────────────────────────── */
.login-overlay,
.edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13,27,42,0.6);
  backdrop-filter: blur(6px);
  animation: fadeIn 180ms ease;
}

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

.login-card,
.edit-sheet {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }

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

.login-brand .brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--text);
  color: var(--surface);
}

.login-brand strong { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }

.login-card h2, .edit-sheet h2 {
  margin: 6px 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-card p, .edit-sheet p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.login-card label, .edit-sheet label { margin-bottom: 14px; }
.login-card code { font-family: "JetBrains Mono", monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--accent); }

.edit-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── TOAST ──────────────────────────────────── */
#toast {
  position: fixed;
  bottom: calc(var(--bottom-nav) + var(--safe-bottom) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  min-width: 200px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  transition: opacity 200ms, transform 200ms;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── LOADER ─────────────────────────────────── */
.loader {
  position: relative;
  width: 75px;
  height: 100px;
}

.loader.mini {
  width: 34px;
  height: 30px;
  transform: scale(0.36);
  transform-origin: center;
}

.loader__bar {
  position: absolute;
  bottom: 0;
  width: 10px;
  height: 50%;
  background: var(--text);
  transform-origin: center bottom;
}

.loader__bar:nth-child(1) { left: 0;    transform: scale(1,0.2); animation: barUp1 4s infinite; }
.loader__bar:nth-child(2) { left: 15px; transform: scale(1,0.4); animation: barUp2 4s infinite; }
.loader__bar:nth-child(3) { left: 30px; transform: scale(1,0.6); animation: barUp3 4s infinite; }
.loader__bar:nth-child(4) { left: 45px; transform: scale(1,0.8); animation: barUp4 4s infinite; }
.loader__bar:nth-child(5) { left: 60px; transform: scale(1,1);   animation: barUp5 4s infinite; }

.loader__ball {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 10px;
  height: 10px;
  background: var(--brand);
  border-radius: 50%;
  animation: ball624 4s infinite;
}

@keyframes ball624 {
  0%,100%{transform:translate(0,0)}5%{transform:translate(8px,-14px)}10%{transform:translate(15px,-10px)}17%{transform:translate(23px,-24px)}20%{transform:translate(30px,-20px)}27%{transform:translate(38px,-34px)}30%{transform:translate(45px,-30px)}37%{transform:translate(53px,-44px)}40%{transform:translate(60px,-40px)}50%{transform:translate(60px,0)}57%{transform:translate(53px,-14px)}60%{transform:translate(45px,-10px)}67%{transform:translate(37px,-24px)}70%{transform:translate(30px,-20px)}77%{transform:translate(22px,-34px)}80%{transform:translate(15px,-30px)}87%{transform:translate(7px,-44px)}90%{transform:translate(0,-40px)}
}

@keyframes barUp1 { 0%,40%,100%{transform:scale(1,0.2)} 50%,90%{transform:scale(1,1)} }
@keyframes barUp2 { 0%,40%,100%{transform:scale(1,0.4)} 50%,90%{transform:scale(1,0.8)} }
@keyframes barUp3 { 0%,100%{transform:scale(1,0.6)} }
@keyframes barUp4 { 0%,40%,100%{transform:scale(1,0.8)} 50%,90%{transform:scale(1,0.4)} }
@keyframes barUp5 { 0%,40%,100%{transform:scale(1,1)} 50%,90%{transform:scale(1,0.2)} }

/* ── FAB ────────────────────────────────────── */
.fab { display: none; }

/* ── BOTTOM NAVIGATION ──────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-nav) + var(--safe-bottom));
  padding: 6px 8px;
  padding-bottom: calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(13,27,42,0.06);
}

.bnav-item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 4px 6px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 150ms, background 150ms, transform 150ms;
}

.bnav-item:hover { color: var(--brand-strong); }
.bnav-item:active { transform: scale(0.92); }

.bnav-item.active {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.bnav-cta {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.bnav-cta.active,
.bnav-cta:hover {
  background: var(--brand);
  color: #fff;
}

/* ── RESPONSIVE — TABLET (768px+) ───────────── */
@media (min-width: 768px) {
  .quick-actions {
    grid-template-columns: repeat(7, 1fr);
  }

  .hero-pill-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-pill.free { grid-column: auto; }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid .panel.wide { grid-column: span 2; }

  .split-grid {
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
  }

  .whatsapp-grid {
    grid-template-columns: minmax(300px, 380px) minmax(300px, 1fr);
  }

  .wallet-grid,
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .insight-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .insight-grid .panel.wide { grid-column: span 2; }

  .health-layout {
    grid-template-columns: 120px 1fr;
  }

  .score-wrap { display: block; }

  .insight-hero { grid-template-columns: repeat(4, 1fr); }
  .bank-metrics { grid-template-columns: repeat(4, 1fr); }

  .insight-plan {
    grid-template-columns: repeat(2, 1fr);
  }

  .bank-history-filters {
    grid-template-columns: 1fr auto auto;
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters {
    grid-template-columns: repeat(2, 1fr);
  }

  .compact-form {
    grid-template-columns: repeat(2, 1fr);
  }

  .bank-tabs {
    top: calc(57px + 1px);
  }
}

/* ── RESPONSIVE — DESKTOP (1024px+) ─────────── */
@media (min-width: 1024px) {
  .app-shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    grid-template-rows: 1fr;
    padding-bottom: 0;
  }

  /* Show sidebar, hide mobile nav */
  .sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 20px 14px;
    border-right: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(16px);
    overflow-y: auto;
    grid-row: 1;
  }

  .bottom-nav { display: none; }
  .mobile-header { display: none; }
  .fab { display: none !important; }

  /* Desktop topbar */
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }

  .topbar-title .eyebrow { margin-bottom: 3px; }

  .topbar h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

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

  .main {
    grid-column: 2;
    padding: 24px 28px;
    min-height: 100vh;
  }

  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .insight-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .insight-plan { grid-template-columns: repeat(4, 1fr); }

  #toast {
    bottom: 24px;
    left: calc(var(--sidebar) + 50%);
    transform: translateX(-50%) translateY(12px);
  }

  #toast.show {
    transform: translateX(-50%) translateY(0);
  }

  .bank-tabs {
    top: 16px;
  }
}

/* ── BRAND (desktop sidebar) ─────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--text);
  color: var(--surface);
  flex-shrink: 0;
}

.brand-text strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-text span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 11px;
}

/* ── NAV ITEMS (desktop sidebar) ─────────────── */
.nav {
  display: grid;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1.5px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  transition: background 150ms, color 150ms, border-color 150ms;
}

.nav-item:hover { background: var(--surface-2); color: var(--text); }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-text);
  border-color: color-mix(in srgb, var(--brand) 20%, transparent);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
  transition: background 150ms, color 150ms;
}

.nav-item.active .nav-icon {
  background: color-mix(in srgb, var(--brand) 15%, transparent);
  color: var(--brand-strong);
}

.nav-item:hover .nav-icon { color: var(--text); }

/* ── SMALL SCREEN TWEAKS ─────────────────────── */
@media (max-width: 480px) {
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .insight-hero { grid-template-columns: 1fr 1fr; }
  .bank-metrics { grid-template-columns: 1fr 1fr; }
  .bank-tabs { overflow-x: auto; }
  .bank-tab { min-width: 72px; font-size: 11px; }
  .login-card, .edit-sheet { padding: 22px 18px; }

  .edit-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .edit-sheet {
    max-width: 100%;
    max-height: 88vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow-y: auto;
  }

  .edit-actions { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   PERSONAL BANKING SKIN — Bradesco/Safra inspired, not copied
   Objetivo: app financeiro pessoal interno, com cara de banco.
   ========================================================= */
:root {
  --brand: #0a2f6f;
  --brand-strong: #071f4a;
  --brand-soft: #e8f0ff;
  --brand-text: #0a2f6f;
  --accent: #b78b2f;
  --accent-strong: #936d1e;
  --accent-soft: #fff7e1;
  --expense: #b91c1c;
  --expense-soft: #fff1f2;
  --income: #047857;
  --income-soft: #ecfdf5;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #0b1830;
  --muted: #65758f;
  --border: rgba(11,24,48,.10);
  --shadow: 0 8px 26px rgba(11,24,48,.08);
  --shadow-md: 0 18px 48px rgba(11,24,48,.13);
}

:root[data-theme="dark"] {
  --brand: #7aa7ff;
  --brand-strong: #dbeafe;
  --brand-soft: #0c214a;
  --brand-text: #dbeafe;
  --accent: #d6b35a;
  --accent-soft: #2c220d;
  --bg: #070d19;
  --surface: #0f172a;
  --surface-2: #111c33;
  --text: #e5edf8;
  --muted: #93a4bd;
  --border: rgba(229,237,248,.10);
}

.brand-mark,
.brand-mark-sm {
  background: linear-gradient(145deg, #061a3f, #0a2f6f 58%, #b78b2f);
  color: #fff;
  box-shadow: 0 12px 24px rgba(10,47,111,.22);
}

.sidebar,
.mobile-header,
.topbar,
.bottom-nav {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.home-hero {
  background:
    radial-gradient(circle at 88% 10%, rgba(214,179,90,.34) 0%, transparent 34%),
    radial-gradient(circle at 12% 80%, rgba(10,47,111,.24) 0%, transparent 38%),
    linear-gradient(135deg, #061326 0%, #0a2f6f 58%, #081a3d 100%);
  border: 1px solid rgba(255,255,255,.12);
}

.home-hero::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,.08), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(214,179,90,.20) 0%, transparent 55%);
}

.hero-amount-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.privacy-toggle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.12);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}

.hero-pill,
.panel,
.metric-card,
.statement-card,
.transaction-row,
.fixed-bill-card,
.wallet-card,
.goal-card,
.budget-card {
  border-color: rgba(10,47,111,.10);
}

.button.primary,
.bnav-cta,
.fab {
  background: linear-gradient(145deg, #0a2f6f, #061a3f) !important;
  color: #fff;
}

.button.primary:hover,
.nav-item.active,
.bnav-item.active {
  color: var(--brand);
}

.quick-icon.zap,
.quick-icon.insight,
.quick-icon.cash {
  background: linear-gradient(145deg, #0a2f6f, #061a3f);
  color: #fff;
}

.quick-icon.budget,
.quick-icon.goal,
.quick-icon.bill {
  background: linear-gradient(145deg, #fff7e1, #f0d489);
  color: #704d00;
}

.badge:not(.soft) {
  background: linear-gradient(145deg, var(--brand-soft), #fff);
  color: var(--brand);
}

.amount.income,
.income,
.positive {
  color: var(--income) !important;
}

.amount.expense,
.expense,
.negative {
  color: var(--expense) !important;
}

.login-card {
  border: 1px solid rgba(10,47,111,.10);
  box-shadow: var(--shadow-lg);
}

.status-box code,
code {
  color: var(--brand);
}

/* PDF statement import preview */
.statement-preview-list {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding-right: 2px;
  margin-top: 12px;
}

.statement-preview-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.statement-preview-item strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.statement-preview-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.statement-preview-item > span {
  flex: 0 0 auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.statement-preview-item.duplicate {
  opacity: .72;
  background: color-mix(in srgb, var(--surface-3) 86%, transparent);
  border-style: dashed;
}

.warning-text {
  color: var(--warning, #b45309) !important;
  font-weight: 700;
}

.statement-card-main {
  min-width: 0;
}

.statement-card-main strong,
.statement-card-main small {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .statement-preview-item {
    display: grid;
  }
  .statement-preview-item > span {
    justify-self: start;
  }
}
