:root {
  /* Semáforo — 5 níveis */
  --c-verde-escuro: #38761d;
  --c-verde: #6aa84f;
  --c-amarelo: #ffe599;
  --c-vermelho: #e06666;
  --c-vermelho-escuro: #990000;

  /* Superfícies */
  --bg: #0f1115;
  --bg-card: #1a1d24;
  --bg-card-2: #22262f;
  --text: #f4f6f8;
  --text-dim: #b4bcc8;
  --border: #2c313c;
  --in: #8fd68a;
  --out: #f08a8a;

  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

.app {
  max-width: 430px;
  margin: 0 auto;
  padding: 20px 16px 120px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.view { display: flex; flex-direction: column; gap: 16px; }
.view[hidden] { display: none !important; }

/* ---------- Tabbar (navegação por abas) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  max-width: 430px; margin: 0 auto;
  display: flex;
  background: rgba(26, 29, 36, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar[hidden] { display: none !important; }
.tabbar__btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0 8px; background: transparent; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 11px; font-weight: 600;
  transition: opacity .08s ease;
}
.tabbar__btn:active { opacity: .6; }
.tabbar__btn.is-active { color: var(--text); }
.tabbar__icon { font-size: 20px; line-height: 1; }
.tabbar__label { font-size: 11px; }

/* ---------- Relatórios ---------- */
.report__period { display: flex; gap: 8px; }
.report__period select {
  flex: 1; background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; appearance: none;
}

.report__filtro {
  display: flex; gap: 6px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px; padding: 4px;
}
.report__filtro-btn {
  flex: 1; padding: 10px 0; border: none; border-radius: 9px;
  background: transparent; color: var(--text-dim); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity .08s ease;
}
.report__filtro-btn:active { opacity: .6; }
.report__filtro-btn.is-active { background: var(--bg-card-2); color: var(--text); }

.field__checkbox {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer;
}
.field__checkbox input { width: 18px; height: 18px; accent-color: var(--c-verde); }

.report {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  min-height: 220px; display: flex; align-items: center; justify-content: center;
}
.report__empty { color: var(--text-dim); font-size: 14px; text-align: center; }

.report__total {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.report__total-label { font-size: 13px; color: var(--text-dim); }
.report__total-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* pizza */
.donut { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.donut__legend { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.donut__row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.donut__dot { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 auto; }
.donut__cat { flex: 1; color: var(--text); }
.donut__valor { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.donut__pct { color: var(--text-dim); font-variant-numeric: tabular-nums; width: 44px; text-align: right; }

/* ---------- Cofrinhos (Reserva) ---------- */
.cofrinhos { display: flex; flex-direction: column; gap: 12px; }
.cofrinho {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.cofrinho__head { display: flex; align-items: center; gap: 12px; }
.cofrinho__emoji {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.cofrinho__info { flex: 1; min-width: 0; }
.cofrinho__nome { font-size: 16px; font-weight: 700; }
.cofrinho__valor { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cofrinho__meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.cofrinho__bar {
  margin-top: 12px; height: 10px; border-radius: 6px;
  background: var(--bg-card-2); overflow: hidden;
}
.cofrinho__fill { height: 100%; border-radius: 6px; transition: width .3s ease; }
.cofrinho__actions { display: flex; gap: 8px; margin-top: 12px; }
.cofrinho__btn {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-card-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
  min-height: 44px;
  transition: transform .08s ease;
}
.cofrinho__btn:active { transform: scale(.97); }
.cofrinho__btn--edit {
  flex: 0 0 auto; width: 44px; padding: 10px 0; text-align: center;
}
.cofrinho__btn--del {
  color: var(--out);
  border-color: rgba(224, 102, 102, .35);
}
.cofrinho__empty { color: var(--text-dim); text-align: center; padding: 24px 8px; font-size: 14px; }

/* modal de ação em série */
.serie__actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.topbar__left { display: flex; flex-direction: column; gap: 2px; }
.topbar__title { font-size: 22px; font-weight: 700; }
.topbar__subtitle { font-size: 13px; color: var(--text-dim); }
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.year-select select {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: 14px; appearance: none;
}
.icon-btn {
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 10px;
  width: 44px; height: 44px; font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Telas (auth / setup) ---------- */
.screen {
  max-width: 430px; margin: 0 auto; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
/* CRÍTICO: o atributo `hidden` precisa vencer o display:flex, senão as telas nunca somem */
.screen[hidden],
.app[hidden],
.fab[hidden],
.toast[hidden] { display: none !important; }
.screen__inner { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.screen__logo { display: flex; gap: 8px; justify-content: center; margin-bottom: 4px; }
.dot { width: 18px; height: 18px; border-radius: 50%; }
.dot--v  { background: var(--c-vermelho); }
.dot--a  { background: var(--c-amarelo); }
.dot--vd { background: var(--c-verde); }
.screen__title { font-size: 24px; font-weight: 800; text-align: center; }
.screen__subtitle { font-size: 14px; color: var(--text-dim); text-align: center; line-height: 1.45; }
.screen__error {
  background: rgba(224, 102, 102, .12); color: var(--out);
  border: 1px solid rgba(224, 102, 102, .35);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; text-align: center;
}

/* Bloco de confirmação de e-mail (aparece após criar conta sem e-mail confirmado) */
.auth__confirmacao {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; text-align: center; display: flex;
  flex-direction: column; gap: 8px;
}
.auth__confirmacao[hidden] { display: none !important; }
.auth__confirmacao-titulo { font-size: 15px; font-weight: 700; }
.auth__confirmacao-texto { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* Link "Esqueci minha senha" / "Voltar" na tela de auth */
.auth__link {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 13px; font-weight: 600;
  padding: 4px 0; text-align: center; align-self: center;
}
.auth__link:active { opacity: .7; }

/* Links legais na tela de login */
.auth__legal {
  display: flex; justify-content: center; gap: 8px;
  font-size: 12px; margin-top: 4px;
}
.auth__legal a { color: var(--text-dim); text-decoration: none; }
.auth__legal a:active { opacity: .7; }

/* Links legais no rodapé do app */
.legal-links {
  display: flex; justify-content: center; gap: 8px;
  font-size: 11px; margin-top: 8px; opacity: .7;
}
.legal-links a { color: var(--text-dim); text-decoration: none; }
.legal-links a:active { opacity: .7; }

/* ---------- Onboarding ---------- */
.onboard__section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
}
.onboard__section-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; }
.onboard__section:has(.onboard__row) .onboard__section-head { margin-bottom: 10px; }
.onboard__section-title { font-size: 13px; font-weight: 700; color: var(--text); }
.onboard__add {
  background: var(--bg-card-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; width: 44px; height: 44px; font-size: 22px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.onboard__row {
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
}
.onboard__row .field__input { font-size: 16px; padding: 11px 12px; }
.onboard__row--desc-line {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.onboard__row--desc { flex: 1; min-width: 0; }
.onboard__row--categoria { margin-bottom: 8px; }
.onboard__row--categoria .onboard__label > span { text-align: left; }
.onboard__row--categoria select.field__input { text-align: left; }
.onboard__row--numeros { display: flex; gap: 8px; }
.onboard__label {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.onboard__label > span {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .03em;
  text-align: center;
}
.onboard__label:first-child { flex: 2; }
.onboard__label .field__input { width: 100%; text-align: center; }
.onboard__label:first-child .field__input { text-align: left; }
.onboard__remove {
  flex: 0 0 auto;
  background: transparent; border: none; color: var(--text-dim);
  font-size: 20px; cursor: pointer; padding: 0 4px;
}
.onboard__remove:hover { color: var(--out); }
.onboard__empty { font-size: 12px; color: var(--text-dim); text-align: center; padding: 4px 0; }

/* ---------- Wizard (onboarding em passos) ---------- */
.wizard__dots {
  display: flex; justify-content: center; gap: 8px; margin-bottom: 6px;
}
.wizard__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); transition: all .2s ease;
}
.wizard__dot.is-active {
  background: var(--c-verde); width: 22px; border-radius: 999px;
}
.wizard__passo { display: flex; flex-direction: column; gap: 14px; }
.wizard__passo[hidden] { display: none !important; }
.wizard__nav { display: flex; gap: 10px; align-items: stretch; }
.wizard__nav .btn--ghost { flex: 0 0 96px; width: 96px; padding: 14px 0; }
.wizard__nav .btn--primary { flex: 1; }
.wizard__nav .btn--primary:only-child { width: 100%; }

/* chips de sugestão */
.onboard__chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.onboard__chip {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .12s ease;
}
.onboard__chip:active { transform: scale(.95); background: var(--bg-card-2); }
.onboard__chip.is-added { background: var(--c-verde); color: #fff; border-color: var(--c-verde); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--bg-card-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 18px; font-size: 14px; z-index: 100;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); max-width: 90vw;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px;
}
.hero__label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.hero__edit {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 14px; cursor: pointer; line-height: 1;
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.hero__edit:active { color: var(--text); }
.hero__amount { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero__badge { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.hero__metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.metric { display: flex; flex-direction: column; gap: 2px; }
.metric__label { font-size: 11px; color: var(--text-dim); }
.metric__value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric__value--in { color: var(--in); }
.metric__value--out { color: var(--out); }

/* ---------- Lista de meses colapsáveis ---------- */
.months-list { display: flex; flex-direction: column; gap: 12px; }

.month {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.month__header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer; user-select: none;
}
.month__chevron {
  width: 20px; height: 20px; flex: 0 0 auto;
  transition: transform .2s ease; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-dim);
}
.month--open .month__chevron { transform: rotate(90deg); }
.month__name { font-size: 16px; font-weight: 700; flex: 1; }
.month__end {
  font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 6px;
}
.month__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.month__body { display: none; }
.month--open .month__body { display: block; }

.month__weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  padding: 0 8px 8px;
}
.month__weekdays span { text-align: center; font-size: 11px; color: var(--text-dim); font-weight: 600; }
.month__grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  padding: 0 8px 14px;
}

.day {
  position: relative; aspect-ratio: 1 / 1; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: transform .08s ease;
  overflow: hidden;
}
.day:active { transform: scale(.93); }
.day--empty { background: transparent; cursor: default; }
.day--future-muted { opacity: .5; }
.day__saldo {
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
  margin-top: 2px; opacity: .95; white-space: nowrap;
  letter-spacing: -0.03em; line-height: 1;
}

.day--hoje { outline: 2px solid #fff; outline-offset: 1px; }

/* ---------- Legenda ---------- */
.legend { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.legend__title { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.legend__edit {
  background: transparent; border: none; cursor: pointer; font-size: 16px; line-height: 1;
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
}
.legend__items { display: flex; flex-direction: column; gap: 8px; }
.legend__item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.legend__dot { width: 16px; height: 16px; border-radius: 5px; flex: 0 0 auto; }

/* editor de faixas */
.faixas { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.faixa-edit { display: flex; gap: 10px; align-items: flex-end; }
.faixa-edit__lim { flex: 1; }
.faixa-edit__cor { flex: 0 0 110px; }
.faixa-edit__color-input {
  width: 100%; height: 42px; padding: 2px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg-card); cursor: pointer;
}
.faixa-edit__lim .field__label, .faixa-edit__cor .field__label { margin-bottom: 6px; }
.faixa-edit--last .faixa-edit__cor { flex: 1; }
.faixas__actions { display: flex; gap: 10px; }

.footnote { text-align: center; font-size: 11px; color: var(--text-dim); opacity: .7; }

/* Link de "Excluir minha conta" no rodapé */
.conta { margin-top: 24px; text-align: center; }
.conta__link {
  background: none; border: none; cursor: pointer;
  color: var(--out); font-size: 12px; font-weight: 600;
  padding: 8px 0; opacity: .75;
}
.conta__link:active { opacity: .5; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 20px; bottom: 84px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--c-verde); color: #fff;
  font-size: 28px; line-height: 1; border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  z-index: 46;
}
.fab:active { transform: scale(.95); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.modal__sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg-card-2); border-radius: 20px 20px 0 0;
  padding: 12px 20px 32px; max-height: 90vh; overflow-y: auto;
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(100%);} to { transform: translateY(0);} }
.modal__handle { width: 40px; height: 4px; border-radius: 999px; background: var(--border); margin: 0 auto 16px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.modal__date { font-size: 19px; font-weight: 700; }
.modal__sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }
.modal__close {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  width: 44px; height: 44px; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.modal__body { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.tx { display: flex; align-items: center; gap: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.tx__cat {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.tx__info { flex: 1; min-width: 0; }
.tx__desc { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx__catname { font-size: 11px; color: var(--text-dim); }
.tx__valor { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tx__valor--in { color: var(--in); }
.tx__valor--out { color: var(--out); }
.tx__del {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 18px; cursor: pointer;
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.tx__del:hover { color: var(--out); }

.btn {
  width: 100%; padding: 14px; border-radius: 12px; border: none;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform .08s ease, opacity .08s ease;
}
.btn:active { transform: scale(.98); opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--c-verde); color: #fff; }
.btn--ghost { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }

/* ---------- Segmentado ---------- */
.seg { display: flex; gap: 8px; margin-bottom: 16px; }
.seg__btn {
  flex: 1; padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-dim); font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform .08s ease;
}
.seg__btn:active { transform: scale(.97); }
.seg__btn--out.is-active { background: var(--c-vermelho); color: #fff; border-color: var(--c-vermelho); }
.seg__btn--in.is-active { background: var(--c-verde); color: #fff; border-color: var(--c-verde); }

/* ---------- Campos ---------- */
.field { margin-bottom: 14px; }
.field__label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.field__input {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  font-size: 16px;
}
.field__input:focus { outline: none; border-color: var(--c-verde); }
.field__hint { font-size: 11px; color: var(--text-dim); margin-top: 5px; opacity: .8; }

/* ================================================================
   RESPONSIVIDADE (mobile-first)
   A base acima já é mobile-first. As regras abaixo ajustam:
   - telas MUITO pequenas (<= 350px): reduzem espaçamentos
   - telas GRANDES (>= 768px, desktop/tablet landscape): centralizam
     modais e o botão + em relação ao container de 430px
================================================================ */

/* Telas muito pequenas */
@media (max-width: 360px) {
  .app { padding: 16px 12px 110px; gap: 12px; }
  .day__saldo { font-size: 10px; }
  .day { font-size: 13px; }
  .hero__amount { font-size: 28px; }
}

/* Telas grandes (desktop / tablet em paisagem) */
@media (min-width: 768px) {
  /* FAB alinhado à borda direita do container de 430px */
  .fab {
    right: calc(50% - 215px + 20px);
    bottom: 104px;
  }

  /* Modais deixam de ser bottom-sheet e viram caixa centralizada */
  .modal__sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 430px;
    max-width: calc(100vw - 32px);
    max-height: 85vh;
    border-radius: 20px;
    animation: popIn .18s ease;
  }
  @keyframes popIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }

  /* O "handle" de arrastar só faz sentido no bottom-sheet mobile */
  .modal__handle { display: none; }
}

/* Evita zoom automático do iOS ao focar inputs (font-size >= 16px) */
@media (max-width: 767px) {
  .field__input { font-size: 16px; }

  /* No celular as células são estreitas: usa o espaçamento original (sem
     apertar) e um valor mais curto/sem centavos (ver dinheiroCurto). */
  .day__saldo {
    margin-top: 4px;
    letter-spacing: 0; /* sem compressão de letras */
  }
}

/* ---------- Indicador de dropdown nos selects (chevron) ---------- */
select.field__input,
.report__period select,
.year-select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b4bcc8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}

/* ---------- Tour guiado ---------- */
.tour { position: fixed; inset: 0; z-index: 200; }
.tour[hidden] { display: none !important; }
.tour__overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .25);
}
.tour__tip {
  position: absolute; left: 20px; right: 20px; bottom: 110px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: tourPop .2s ease;
}
.tour__tip--top {
  bottom: auto; top: 20px;
  animation: tourPopDown .2s ease;
}
@keyframes tourPopDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tourPop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.tour__body { display: flex; gap: 14px; align-items: flex-start; }
.tour__emoji { font-size: 32px; line-height: 1; }
.tour__title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.tour__desc { font-size: 14px; color: var(--text-dim); line-height: 1.5; }
.tour__footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; gap: 10px;
}
.tour__skip {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 13px; cursor: pointer; padding: 10px 6px;
}
.tour__next {
  background: var(--c-verde); color: #fff; border: none;
  border-radius: 10px; padding: 10px 20px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.tour__next:active { opacity: .85; }
.tour__dots { display: flex; gap: 6px; }
.tour__dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.tour__dots span.is-active { background: var(--c-verde); }

/* ---------- Destaque do elemento no tour ---------- */
/* usa outline (não depende de position/z-index), preserva fixed do fab/tabbar */
.tour-highlight {
  outline: 3px solid var(--c-verde);
  outline-offset: 2px;
  box-shadow: 0 0 20px rgba(106, 168, 79, .6);
  border-radius: var(--radius);
  transition: outline .2s ease;
}

/* ---------- Modal de confirmação ---------- */
.confirmar__msg { font-size: 14px; color: var(--text); line-height: 1.5; margin-bottom: 16px; }
.confirmar__actions { display: flex; gap: 10px; }
.confirmar__actions .btn--ghost { flex: 1; }
.confirmar__actions .btn--primary { flex: 2; }
.confirmar__actions .btn--primary.btn--danger { background: var(--c-vermelho-escuro); }
