:root {
  --bg: #0f1115;
  --bg-elev: #171a21;
  --bg-elev-2: #1f232c;
  --border: #262b36;
  --text: #e8eaed;
  --text-dim: #9aa0ac;
  --text-mute: #6b7280;
  --accent: #7dd3a8;
  --accent-dark: #4ea87a;
  --danger: #ef6b6b;
  --warn: #f5b461;
  --info: #6fb3e8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(0,0,0,.25);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa;
    --bg-elev: #ffffff;
    --bg-elev-2: #f0f2f5;
    --border: #e3e6eb;
    --text: #1a1d23;
    --text-dim: #4a5160;
    --text-mute: #8a909b;
    --shadow: 0 6px 20px rgba(0,0,0,.06);
  }
}

/* ============ SPLASH ============ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1115 0%, #1a1f2a 100%);
  transition: opacity .4s ease, visibility .4s ease;
}
.splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: linear-gradient(135deg, #7dd3a8, #4ea87a);
  color: #0a1410;
  font-weight: 800;
  font-size: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 12px 32px rgba(125, 211, 168, 0.25);
  animation: splashPulse 1.8s ease-in-out infinite;
}
.splash-brand {
  margin-top: 18px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #e8eaed;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}
.splash-spinner {
  margin-top: 36px;
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(125, 211, 168, 0.15);
  border-top-color: #7dd3a8;
  border-radius: 50%;
  animation: splashSpin .8s linear infinite;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes splashSpin {
  to { transform: rotate(360deg); }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* desativa zoom por toque-duplo acidental, mantém scroll e pinch */
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }
a { color: var(--accent); }

/* ============ SCREENS ============ */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ============ AUTH ============ */
#auth-screen {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#auth-screen.active { display: flex; }

.auth-container {
  width: 100%;
  max-width: 380px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.brand { text-align: center; margin-bottom: 24px; }
.brand-logo {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0a1410;
  font-weight: 800;
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.brand h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.brand-sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; }

.tabs {
  display: flex;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}
.tab {
  flex: 1;
  padding: 10px;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: 8px;
  transition: all .2s;
  font-size: 14px;
}
.tab.active { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}
label input, label select, label textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color .15s;
}
label input:focus, label select:focus { outline: none; border-color: var(--accent); }

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #0a1410;
  font-weight: 700;
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: transform .1s, opacity .15s;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary:hover { opacity: .92; }

.btn-secondary {
  flex: 1;
  padding: 11px;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
}
.btn-secondary:hover { background: var(--border); }

.form-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.auth-hint { font-size: 12px; color: var(--text-mute); margin-top: 18px; text-align: center; line-height: 1.5; }

/* ============ APP ============ */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 12px;
  max-width: 720px;
  margin: 0 auto;
}
.greeting { font-size: 18px; font-weight: 600; }
.date { font-size: 12px; color: var(--text-mute); text-transform: capitalize; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}

.views {
  padding: 8px 20px calc(100px + var(--safe-bottom));
  max-width: 720px;
  margin: 0 auto;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view-title { font-size: 22px; margin: 8px 0 16px; font-weight: 700; letter-spacing: -0.5px; }

/* ============ BALANCE CARD ============ */
.balance-card {
  background: linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.balance { font-size: 32px; font-weight: 700; margin: 4px 0 16px; letter-spacing: -1px; }
.balance-row { display: flex; gap: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.balance-row > div { flex: 1; }
.value-up { color: var(--accent); font-weight: 700; font-size: 18px; margin-top: 2px; }
.value-down { color: var(--danger); font-weight: 700; font-size: 18px; margin-top: 2px; }

/* ============ QUICK TIP ============ */
.quick-tip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.tip-label { font-size: 11px; color: var(--warn); font-weight: 700; letter-spacing: .5px; margin-bottom: 4px; }

/* ============ QUICK VERSE ============ */
.quick-verse {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.verse-label {
  font-size: 11px;
  color: var(--info);
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.verse-text {
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 6px;
}
.verse-ref {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 600;
  text-align: right;
}

/* ============ SECTIONS ============ */
.section-title {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 24px 0 10px;
}

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

.transaction {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.t-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg-elev-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.t-body { flex: 1; min-width: 0; }
.t-desc { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-meta { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.t-value { font-weight: 700; font-size: 15px; white-space: nowrap; }
.t-value.in { color: var(--accent); }
.t-value.out { color: var(--danger); }
.t-delete {
  font-size: 18px; color: var(--text-mute); padding: 4px 6px; border-radius: 6px;
}
.t-delete:hover { color: var(--danger); background: var(--bg-elev-2); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-mute);
  font-size: 14px;
}

/* ============ CATEGORY ============ */
.category-list { display: flex; flex-direction: column; gap: 8px; }
.category-row {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.category-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.category-bar { height: 6px; background: var(--bg-elev-2); border-radius: 3px; overflow: hidden; }
.category-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }

/* ============ FILTERS ============ */
.filter-row { display: flex; gap: 8px; margin-bottom: 14px; }
.filter-row select {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

/* ============ FORM ============ */
.form-stack { display: flex; flex-direction: column; gap: 14px; }

.type-toggle {
  display: flex;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.toggle-btn {
  flex: 1;
  padding: 12px;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: 8px;
  transition: all .2s;
}
.toggle-btn.active[data-type="out"] { background: var(--danger); color: white; }
.toggle-btn.active[data-type="in"] { background: var(--accent); color: #0a1410; }

/* ============ NAV ============ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px calc(8px + var(--safe-bottom));
  z-index: 100;
  max-width: 720px;
  margin: 0 auto;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px;
  color: var(--text-mute);
  font-size: 11px;
  font-weight: 500;
  transition: color .15s;
}
.nav-btn.active { color: var(--accent); }

/* Ícones SVG — todos exatamente do mesmo tamanho */
.nav-icon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .15s;
}
.nav-btn:active .nav-icon { transform: scale(.85); }

/* Botão central de adicionar */
.nav-add { position: relative; }
.nav-add-circle {
  width: 50px;
  height: 50px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -16px;
  box-shadow: 0 4px 12px rgba(125, 211, 168, .4);
  transition: transform .15s;
}
.nav-btn:active .nav-add-circle { transform: scale(.9); }
.nav-add-circle svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #0a1410;
  stroke-width: 2.6;
  stroke-linecap: round;
}

/* ============ PLANNING ============ */
.planning-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.planning-card h3 { font-size: 16px; font-weight: 700; }
.planning-card small { display: block; margin-top: 4px; font-size: 11px; }
.muted { color: var(--text-dim); font-size: 13px; }

.plan-result {
  margin-top: 4px;
  padding: 14px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.6;
  display: none;
}
.plan-result.active { display: block; animation: slideIn .3s ease; }
.plan-result .highlight { color: var(--accent); font-weight: 700; font-size: 18px; }
.plan-result .danger { color: var(--danger); font-weight: 700; }
.plan-result ul { margin-left: 20px; margin-top: 8px; }
.plan-result li { margin: 4px 0; }

/* Grid visual de resultados */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  gap: 6px;
  margin-top: 10px;
  margin-bottom: 12px;
}
.calc-cell {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: transform .15s;
}
.calc-cell:hover { transform: translateY(-2px); }
.calc-cell .calc-label {
  font-size: 10px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 700;
  margin-bottom: 4px;
}
.calc-cell .calc-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.calc-cell.highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: var(--accent);
}
.calc-cell.highlight .calc-label,
.calc-cell.highlight .calc-value {
  color: #0a1410;
}
.calc-cell.muted-cell { opacity: 0.65; }

/* Stats grandes */
.calc-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.calc-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 12px;
  background: var(--bg-elev);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.calc-stat-label { font-size: 13px; color: var(--text-dim); }
.calc-stat-value { font-weight: 700; font-size: 15px; }
.calc-stat.featured { background: linear-gradient(135deg, var(--bg-elev), rgba(125,211,168,.08)); border-color: var(--accent); }
.calc-stat.featured .calc-stat-value { color: var(--accent); font-size: 18px; }
.calc-stat.featured .calc-stat-label { color: var(--text); font-weight: 600; }

.calc-tip {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ============ TIPS ============ */
.tip-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 14px;
}
.tip-filter {
  padding: 6px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.tip-filter.active { background: var(--accent); color: #0a1410; border-color: var(--accent); }

.tips-list { display: flex; flex-direction: column; gap: 10px; }
.tip-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tip-head {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.tip-head-text { flex: 1; }
.tip-tag {
  font-size: 10px;
  color: var(--info);
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.tip-title { font-weight: 600; font-size: 14px; margin-top: 2px; }
.tip-toggle { font-size: 18px; color: var(--text-mute); }
.tip-body {
  display: none;
  padding: 0 16px 16px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}
.tip-card.open .tip-body { display: block; }
.tip-card.open .tip-toggle { transform: rotate(45deg); }
.tip-body p { margin-bottom: 8px; }
.tip-body ul { margin-left: 18px; }
.tip-body li { margin: 4px 0; }
.tip-body strong { color: var(--text); }

/* ============ CREDIT ============ */
.credit {
  text-align: center;
  margin-top: 32px;
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.3px;
  opacity: 0.7;
}

/* ============ HEADER ACTIONS ============ */
.header-actions { display: flex; gap: 8px; }

/* ============ CARD CLICÁVEL ============ */
.balance-clickable {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 2px;
  margin: -2px;
  transition: background .15s;
}
.balance-clickable:hover { background: rgba(255,255,255,0.03); }
.balance-clickable:active { transform: scale(.99); }

.balance-side {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin: -6px -8px;
  transition: background .15s;
  color: inherit;
  font: inherit;
}
.balance-side:hover { background: rgba(255,255,255,0.04); }
.balance-side:active { transform: scale(.97); }
.balance-side .arrow {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.4;
  font-size: 12px;
  transition: opacity .15s, transform .15s;
}
.balance-side:hover .arrow { opacity: 1; transform: translateX(2px); }

.balance-compare {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.balance-compare .delta { font-weight: 700; }
.balance-compare .delta.up { color: var(--accent); }
.balance-compare .delta.down { color: var(--danger); }

/* ============ TRANSAÇÃO CLICÁVEL ============ */
.transaction { cursor: pointer; }
.transaction .t-body { cursor: pointer; }

/* ============ FORGOT LINK ============ */
.forgot-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  text-decoration: none;
  display: block;
  margin-top: -4px;
  padding: 6px;
}
.forgot-link:hover { color: var(--accent); }

/* ============ GOOGLE BUTTON ============ */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-google:hover { background: var(--border); border-color: var(--text-mute); }
.g-icon {
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  color: #4285f4;
  border-radius: 50%;
  font-weight: 800;
  font-size: 14px;
  font-family: "Inter", sans-serif;
}

.google-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 4px;
  margin-bottom: 0;
  line-height: 1.4;
  min-height: 16px;
  transition: color .2s;
}
.google-hint.loading { color: var(--accent); }
.google-hint.error { color: var(--danger); }
.google-hint:empty { min-height: 0; margin: 0; }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-mute);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 14px 0 12px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============ SEARCH ============ */
.search-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  margin-bottom: 10px;
  transition: border-color .15s;
}
.search-input:focus { outline: none; border-color: var(--accent); }

/* ============ CHECKBOX ============ */
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 8px 0;
}
.checkbox-label input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

/* ============ SETTINGS CARD ============ */
.settings-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: cardPop .35s cubic-bezier(.2, .9, .3, 1.2);
}
.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-elev);
  z-index: 1;
}
.settings-header h3 { font-size: 18px; font-weight: 700; }

.settings-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }
.settings-label {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
  font-weight: 600;
}
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 12px;
}
.settings-item-title {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.settings-item-value {
  font-weight: 600;
  font-size: 14.5px;
  word-break: break-all;
}
.settings-action {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  margin-top: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.settings-action:hover { background: var(--bg-elev-2); border-color: var(--text-mute); }
.settings-action.danger { color: var(--danger); border-color: rgba(239,107,107,.3); }
.settings-action.danger:hover { background: rgba(239,107,107,.08); border-color: var(--danger); }

/* ============ CATEGORIES MANAGER ============ */
.cat-tabs {
  display: flex;
  margin: 0 20px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-top: 16px;
}
.cat-tab {
  flex: 1;
  padding: 8px;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: 6px;
  font-size: 13px;
}
.cat-tab.active { background: var(--bg-elev); color: var(--text); }
.cat-list {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.cat-item .cat-default { font-size: 11px; color: var(--text-mute); }
.cat-item .cat-remove {
  color: var(--text-mute);
  font-size: 18px;
  padding: 2px 6px;
}
.cat-item .cat-remove:hover { color: var(--danger); }
.cat-add {
  display: flex;
  gap: 8px;
  padding: 14px 20px 20px;
}
.cat-add input {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.cat-add input:focus { outline: none; border-color: var(--accent); }
.cat-add .btn-primary { width: auto; flex: 0 0 auto; padding: 10px 16px; }

/* ============ GOALS ============ */
.goals-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.goal-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.goal-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.goal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.goal-name { font-weight: 700; font-size: 15px; }
.goal-pct { font-weight: 700; color: var(--accent); font-size: 13px; }
.goal-bar {
  height: 8px;
  background: var(--bg-elev-2);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.goal-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  border-radius: 4px;
  transition: width .6s cubic-bezier(.2,.8,.3,1);
}
.goal-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
}
.goal-meta .deadline { font-size: 11px; color: var(--text-mute); }
.goal-card.done {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(125,211,168,.06), transparent);
}
.goal-card.done .goal-pct { font-size: 16px; }

/* ============ TUTORIAL ============ */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeOverlay .25s ease;
}
.tutorial-overlay[hidden] { display: none; }
@keyframes fadeOverlay { from { opacity: 0; } to { opacity: 1; } }

.tutorial-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px 20px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: cardPop .35s cubic-bezier(.2, .9, .3, 1.2);
  position: relative;
}

.tutorial-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  color: var(--text-mute);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  z-index: 2;
}
.tutorial-close:hover { background: var(--bg-elev-2); color: var(--text); }
@keyframes cardPop {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.tutorial-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 22px;
}
.tutorial-progress .dot {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-elev-2);
  transition: background .25s, transform .25s;
}
.tutorial-progress .dot.active {
  background: var(--accent);
  transform: scaleX(1.1);
}
.tutorial-progress .dot.done { background: var(--accent-dark); }

.tutorial-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0a1410;
  font-size: 28px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(125,211,168,.3);
  animation: iconPulse 2.4s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.tutorial-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.tutorial-body {
  text-align: center;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.55;
  margin-bottom: 24px;
  min-height: 84px;
}
.tutorial-body strong { color: var(--text); }

.tutorial-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tutorial-back, .tutorial-next {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
  white-space: nowrap;
}
.tutorial-back:disabled { opacity: 0.35; cursor: default; }

.btn-text {
  color: var(--text-mute);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
}
.btn-text:hover { color: var(--text); }

/* ============ MAIS DINÂMICO ============ */
.transaction { animation: slideIn .25s ease both; }
.transaction:nth-child(1) { animation-delay: 0ms; }
.transaction:nth-child(2) { animation-delay: 40ms; }
.transaction:nth-child(3) { animation-delay: 80ms; }
.transaction:nth-child(4) { animation-delay: 120ms; }
.transaction:nth-child(5) { animation-delay: 160ms; }
.transaction:nth-child(6) { animation-delay: 200ms; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.category-row { animation: slideIn .3s ease both; }
.category-bar-fill { transition: width .6s cubic-bezier(.2, .8, .3, 1); }

.balance { transition: color .25s; }

.nav-btn { position: relative; transition: color .15s; }
.nav-btn.active { color: var(--accent); }
.nav-btn:active .nav-icon { transform: scale(.85); }
.nav-icon, .nav-icon-big { transition: transform .15s; }

.tip-card { transition: transform .15s, box-shadow .15s; }
.tip-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.toggle-btn { transition: all .2s; }
.btn-primary { transition: transform .12s, opacity .15s, box-shadow .2s; }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(125,211,168,.25); }

/* ============ PLANO ============ */
.plan-empty {
  text-align: center;
  padding: 30px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.plan-empty-icon {
  width: 70px; height: 70px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0a1410;
  font-size: 32px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  animation: iconPulse 2.4s ease-in-out infinite;
}
.plan-empty h3 {
  font-size: 20px;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}
.plan-empty p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 20px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.situation-card {
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  position: relative;
  overflow: hidden;
}
.situation-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.situation-card[data-sit="crise"]::before { background: var(--danger); }
.situation-card[data-sit="endividado"]::before { background: var(--warn); }
.situation-card[data-sit="equilibrio"]::before { background: var(--info); }
.situation-card[data-sit="estavel"]::before { background: var(--accent); }
.situation-card[data-sit="crescimento"]::before { background: linear-gradient(90deg, var(--accent), #b48cff); }

.sit-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-mute);
}
.sit-name {
  font-size: 22px;
  font-weight: 700;
  margin: 4px 0 8px;
  letter-spacing: -0.5px;
}
.sit-name .sit-emoji {
  display: inline-block;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-elev-2);
  text-align: center;
  line-height: 32px;
  margin-right: 8px;
  vertical-align: middle;
  font-size: 18px;
}
.sit-description {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}

.plan-steps {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.plan-steps h4 {
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
  margin-bottom: 12px;
}
.plan-steps ol {
  margin-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-steps li {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}
.plan-steps li strong { color: var(--accent); }

/* Missões */
.missions-list { display: flex; flex-direction: column; gap: 8px; }
.mission {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .2s;
}
.mission:hover { border-color: var(--accent); transform: translateY(-1px); }
.mission.done { opacity: 0.55; }
.mission.done .mission-title { text-decoration: line-through; }

.mission-check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--text-mute);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: transparent;
  margin-top: 1px;
  transition: all .2s;
}
.mission.done .mission-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a1410;
}

.mission-body { flex: 1; min-width: 0; }
.mission-title { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.mission-desc { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin-top: 4px; }

.mission-progress {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mission-progress-text { font-size: 13px; color: var(--text-dim); }
.mission-progress-count { font-weight: 700; color: var(--accent); font-size: 14px; }

/* Budget Card */
.budget-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.budget-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.budget-row:last-child { border-bottom: none; }
.budget-row .label { color: var(--text-dim); }
.budget-row .value { font-weight: 700; }

/* Budget Bar (Home) */
.budget-status {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
}
.budget-status-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.budget-status-bar {
  height: 8px;
  background: var(--bg-elev-2);
  border-radius: 4px;
  overflow: hidden;
}
.budget-status-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .5s cubic-bezier(.2,.8,.3,1), background .3s;
}
.budget-status-fill.warn { background: var(--warn); }
.budget-status-fill.danger { background: var(--danger); }
.budget-status-msg {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 6px;
}

/* ============ DIAGNOSTIC WIZARD ============ */
.diagnostic-card { max-width: 420px; }

.diag-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 20px;
  font-weight: 700;
  background: var(--bg-elev-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: center;
  transition: border-color .2s;
}
.diag-input:focus { outline: none; border-color: var(--accent); }
.diag-prefix {
  position: relative;
}
.diag-prefix::before {
  content: "R$";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-mute);
  font-weight: 600;
  z-index: 1;
}
.diag-prefix .diag-input { padding-left: 44px; text-align: left; }

.diag-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.diag-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-elev-2);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14.5px;
  text-align: left;
  width: 100%;
  transition: all .2s;
}
.diag-option:hover { border-color: var(--border); }
.diag-option.selected {
  border-color: var(--accent);
  background: rgba(125, 211, 168, 0.08);
}
.diag-option-icon {
  width: 36px; height: 36px;
  background: var(--bg-elev);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.diag-option-text {
  flex: 1;
}
.diag-option-text strong { display: block; margin-bottom: 2px; }
.diag-option-text small { color: var(--text-dim); font-size: 12px; }

.diag-scale {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}
.diag-scale-btn {
  flex: 1;
  padding: 16px 0;
  background: var(--bg-elev-2);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  color: var(--text);
}
.diag-scale-btn:hover { border-color: var(--border); }
.diag-scale-btn.selected { background: var(--accent); color: #0a1410; border-color: var(--accent); }
.diag-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 8px;
  padding: 0 4px;
}

.diag-helper {
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

/* ============ WARNING MODAL ============ */
.warning-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 22px 20px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: cardPop .35s cubic-bezier(.2, .9, .3, 1.2);
}
.warning-icon {
  width: 60px; height: 60px;
  border-radius: 18px;
  background: var(--warn);
  color: #1a1d23;
  font-size: 32px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.warning-card.danger .warning-icon { background: var(--danger); color: white; }
.warning-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}
.warning-card p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 18px;
}
.warning-card .warning-detail {
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 12px 0 18px;
  font-size: 13px;
  text-align: left;
  line-height: 1.6;
}
.warning-card .warning-detail strong { color: var(--text); }
.warning-actions {
  display: flex;
  gap: 8px;
}
.warning-actions button { flex: 1; padding: 12px; }
.btn-warn {
  background: var(--bg-elev-2);
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
}
.btn-warn:hover { background: var(--warn); color: #1a1d23; }
.btn-danger {
  background: var(--bg-elev-2);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
}
.btn-danger:hover { background: var(--danger); color: white; }

/* ============ TIP TOOLTIP ============ */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  z-index: 1000;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ RESPONSIVE ============ */
@media (min-width: 720px) {
  .views { padding-left: 24px; padding-right: 24px; }
  .balance { font-size: 38px; }
}

/* ============ ACESSIBILIDADE MOBILE — fontes e ícones maiores ============ */
@media (max-width: 720px) {
  html, body { font-size: 17px; }

  /* Header */
  .greeting { font-size: 20px; }
  .date { font-size: 13px; }
  .icon-btn { width: 44px; height: 44px; font-size: 20px; }

  /* Saldo */
  .balance { font-size: 36px; }
  .card-label { font-size: 13px; }
  .value-up, .value-down { font-size: 20px; }

  /* Cards e títulos */
  .view-title { font-size: 26px; }
  .section-title { font-size: 15px; }

  /* Lançamentos */
  .transaction { padding: 14px 16px; }
  .t-icon { width: 42px; height: 42px; font-size: 18px; }
  .t-desc { font-size: 16.5px; }
  .t-meta { font-size: 13px; }
  .t-value { font-size: 16.5px; }
  .t-delete { font-size: 22px; padding: 6px 10px; }

  /* Categorias */
  .category-row { padding: 14px 16px; }
  .category-head { font-size: 15.5px; }

  /* Cards genéricos */
  .quick-tip, .quick-verse { padding: 16px 18px; }
  .quick-tip p:not(.tip-label), .verse-text { font-size: 15.5px; line-height: 1.5; }
  .tip-label, .verse-label { font-size: 12px; }
  .verse-ref { font-size: 13px; }

  /* Botões principais */
  .btn-primary { padding: 14px; font-size: 16px; }
  .btn-secondary { padding: 13px; font-size: 15px; }
  .btn-google { padding: 14px; font-size: 15px; }

  /* Inputs */
  label { font-size: 14px; }
  label input, label select, label textarea {
    padding: 14px 16px;
    font-size: 16.5px;
  }

  /* Nav inferior — ícones e textos maiores */
  .bottom-nav { padding: 10px 4px calc(10px + var(--safe-bottom)); }
  .nav-btn { font-size: 12px; padding: 8px 4px; }
  .nav-icon { width: 30px; height: 30px; }
  .nav-add-circle { width: 58px; height: 58px; margin-top: -20px; }
  .nav-add-circle svg { width: 30px; height: 30px; }

  /* Plano e missões */
  .sit-name { font-size: 24px; }
  .sit-description { font-size: 15px; }
  .plan-steps li { font-size: 15.5px; }
  .mission-title { font-size: 15.5px; }
  .mission-desc { font-size: 14px; }
  .mission-check { width: 26px; height: 26px; }
  .mission-progress-text { font-size: 14px; }
  .mission-progress-count { font-size: 15px; }

  /* Diagnóstico */
  .tutorial-title { font-size: 24px; }
  .tutorial-body { font-size: 15.5px; }
  .diag-option { padding: 16px; font-size: 15.5px; }
  .diag-option-icon { width: 42px; height: 42px; font-size: 18px; }
  .diag-option-text strong { font-size: 15.5px; }
  .diag-option-text small { font-size: 13px; }
  .diag-scale-btn { padding: 18px 0; font-size: 24px; }
  .diag-scale-labels { font-size: 12px; }
  .diag-input { font-size: 22px; padding: 16px 18px; }

  /* Dicas */
  .tip-filter { padding: 8px 14px; font-size: 13px; }
  .tip-title { font-size: 15.5px; }
  .tip-body { font-size: 15px; line-height: 1.65; padding: 0 18px 18px; }
  .tip-tag { font-size: 11px; }

  /* Filtros e busca */
  .filter-row select { padding: 12px 14px; font-size: 15px; }
  .search-input { padding: 13px 16px; font-size: 16px; }

  /* Configurações */
  .settings-header h3 { font-size: 20px; }
  .settings-label { font-size: 12px; }
  .settings-item-title { font-size: 14px; }
  .settings-item-value { font-size: 15.5px; }
  .settings-action { padding: 14px 16px; font-size: 15px; }

  /* Metas */
  .goal-name { font-size: 16.5px; }
  .goal-pct { font-size: 14px; }
  .goal-meta { font-size: 13px; }

  /* Calculadoras */
  .planning-card h3 { font-size: 17px; }
  .calc-stat-label { font-size: 14px; }
  .calc-stat-value { font-size: 16px; }
  .calc-stat.featured .calc-stat-value { font-size: 19px; }
  .calc-cell .calc-label { font-size: 11px; }
  .calc-cell .calc-value { font-size: 14px; }
  .plan-result { font-size: 15px; }

  /* Avisos */
  .warning-card h3 { font-size: 21px; }
  .warning-card p { font-size: 15px; }
  .warning-card .warning-detail { font-size: 14px; }
}

/* Mobile pequeno — mantém legibilidade sem virar gigante */
@media (max-width: 360px) {
  .balance { font-size: 32px; }
  .nav-icon { width: 27px; height: 27px; }
  .view-title { font-size: 23px; }
}
