/* App MGF Pessoal — usa os tokens de /assets/css/mgf.css */

[hidden] { display: none !important; }

/* ---------- Entrada ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth__art {
  margin: 0; display: grid; place-content: center; justify-items: center; gap: 28px; padding: 48px clamp(24px, 5vw, 72px);
  background: radial-gradient(90% 70% at 50% 42%, rgb(252 210 116 / .55), rgb(253 240 223 / 0) 70%), var(--cream-2);
}
.auth__art img { width: min(100%, 460px); }
.auth__art figcaption { max-width: 30ch; text-align: center; font-size: 1.15rem; font-weight: 600; color: var(--ink-2); text-wrap: balance; }
.auth__panel { display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 48px clamp(24px, 6vw, 88px); max-width: 560px; }
.auth__brand { align-self: flex-start; margin-bottom: 12px; }
.auth__brand img { height: 92px; width: auto; }
.auth__panel h1 { font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 900; }
.auth__lede { font-size: 1.1rem; max-width: 40ch; }

/* botão no padrão de marca do Google: fundo claro, borda neutra, "G" colorido */
.gbtn {
  margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 56px; padding: 0 24px;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 999px;
  font: 600 1.05rem/1 var(--font); cursor: pointer;
  transition: background-color .2s, box-shadow .3s var(--ease);
}
.gbtn:hover { background: #f8f9fa; box-shadow: 0 1px 2px rgb(60 64 67 / .3), 0 2px 6px 2px rgb(60 64 67 / .15); }
.gbtn:disabled { cursor: progress; opacity: .7; box-shadow: none; }
.gbtn__g { width: 22px; height: 22px; flex: none; }
.auth__trust { margin-top: -4px; font-size: .95rem; color: var(--ink-3); text-align: center; }
.auth__msg { min-height: 1.5em; font-weight: 600; color: var(--navy); }
.auth__msg.is-error { color: var(--warn); }
.auth__links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.auth__links a { display: inline-flex; align-items: center; min-height: 44px; font-size: .95rem; }
.linkbtn { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: .95rem; color: var(--royal); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.linkbtn:hover { color: var(--accent-ink); }

/* tela de assinatura: o plano em destaque, como o "Recomendado" da home */
.pay__plan { display: grid; gap: 2px; padding: 18px 22px; border-radius: var(--r); background: var(--paper); box-shadow: inset 0 0 0 2px var(--gold), var(--shadow); }
.pay__plan b { font-size: 1.05rem; font-weight: 800; color: var(--navy); }
.pay__price { font-size: 2rem; font-weight: 900; letter-spacing: -.03em; color: var(--navy); font-variant-numeric: tabular-nums; }
.pay__plan small { color: var(--ink-3); font-size: .95rem; }
#pay-buy { align-self: stretch; justify-content: space-between; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth__art { order: 2; padding: 32px 24px 40px; gap: 16px; }
  .auth__art img { width: min(70%, 300px); }
  .auth__panel { max-width: none; justify-content: flex-start; padding: 32px var(--gutter) 24px; }
  .auth__brand img { height: 76px; }
}

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--paper); border-right: 1px solid var(--line); padding: 16px 14px 32px; }
.side__brand img { height: 76px; width: auto; margin: 0 0 12px 6px; }
.nav-group { margin-top: 14px; }
.nav-group__title { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 0 12px 6px; }
.side nav a { display: block; padding: 9px 12px; border-radius: var(--r-sm); color: var(--navy); text-decoration: none; font-weight: 600; font-size: .98rem; }
.side nav a:hover { background: var(--cream-2); }
.side nav a[aria-current] { background: var(--navy); color: #fff; }

.work { min-width: 0; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px clamp(16px, 3vw, 32px); background: rgb(253 252 248 / .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.appbar__title { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 800; margin-right: auto; }
.appbar__toggle { display: none; }
.appbar__user { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--navy); }

.month { display: flex; align-items: center; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.month span { min-width: 150px; text-align: center; font-weight: 700; color: var(--navy); }
.month button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--navy); cursor: pointer; display: grid; place-items: center; }
.month button:hover { background: var(--cream-2); }

.view { padding: clamp(20px, 3vw, 32px); outline: none; }
.loading { color: var(--ink-3); }
.empty { max-width: 520px; margin: 48px auto; text-align: center; }
.empty h2 { font-size: 1.6rem; margin-bottom: 8px; }
.note { margin-top: 18px; font-size: .92rem; color: var(--ink-3); }


/* ---------- Cadastros ---------- */
.toolbar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.btn--sm svg { margin-left: -4px; }
.btn--danger { background: var(--warn); color: #fff; }
.btn--danger:hover { background: #8f1d17; color: #fff; }
.hint { font-size: .92rem; color: var(--ink-3); }

/* botão só de ícone: 40px de área de toque, rótulo em aria-label */
.ibtn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink-3); cursor: pointer; transition: background-color .2s, color .2s; }
.ibtn:hover { background: var(--cream-2); color: var(--navy); }
.ibtn--danger:hover { background: #fdecea; color: var(--warn); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.row__name { min-width: 0; overflow-wrap: anywhere; }
.row__sub { display: block; font-size: .85rem; font-weight: 500; color: var(--ink-3); }
.row__acts { display: flex; flex: none; gap: 2px; }
/* no computador as ações aparecem ao passar o mouse ou focar; no toque ficam sempre visíveis */
@media (hover: hover) {
  .row .row__acts { opacity: 0; transition: opacity .2s; }
  .row:hover .row__acts, .row:focus-within .row__acts { opacity: 1; }
}

.tag { font-size: .72rem; font-weight: 700; color: var(--ink-3); background: var(--cream-2); padding: 2px 8px; border-radius: 99px; vertical-align: 1px; white-space: nowrap; }
.tag--main { color: var(--accent-ink); background: #ffe9cf; }

.cats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.cats { padding: 20px 20px 12px; }
.cats__head, .inst__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cats h2, .inst h2 { font-size: 1.25rem; }
.cats ul { list-style: none; margin: 0; padding: 0; }
.cats > ul > li { padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.cats > ul > li:last-child { border-bottom: 0; }
.cats > ul > li > .row { font-weight: 700; color: var(--navy); }
.cats li ul { margin: 0 0 6px 6px; padding-left: 14px; border-left: 2px solid var(--line); }
.cats li li { font-weight: 500; color: var(--ink-2); min-height: 40px; }

.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.inst { padding: 20px; display: grid; gap: 8px; }
.inst ul { list-style: none; margin: 0 0 8px; padding: 0; }
.inst li { border-top: 1px solid var(--line-2); padding: 6px 0; font-weight: 700; color: var(--navy); }
.inst > .btn { justify-self: start; }

.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.ccard { padding: 20px; display: grid; gap: 6px; }
.ccard__top { display: flex; align-items: center; gap: 10px; }
.ccard h2 { font-size: 1.2rem; }
.ccard__days b { color: var(--navy); }
.ccard__limit { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ccard .row__acts { justify-self: end; margin-top: 4px; }

.empty-state { max-width: 560px; margin: 32px auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
.empty-state h2 { font-size: 1.6rem; }

/* ---------- Lançamentos ---------- */
.tx { display: grid; gap: 20px; }
.tx__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.tx__sums { display: flex; flex-wrap: wrap; gap: 10px; }
.tx__sums p { background: var(--paper); border-radius: 14px; padding: 10px 16px; box-shadow: var(--shadow); min-width: 150px; }
.tx__sums small { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.tx__sums b { font-size: 1.2rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.is-in { color: var(--ok) !important; }
.is-neg { color: var(--warn) !important; }
.tx__new { display: flex; flex-wrap: wrap; gap: 10px; }
.tx__new .btn--gold { padding-right: 20px; }
.tx__filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tx__filters input[type=search] { flex: 1 1 240px; }
.tx__filters select { flex: 0 1 220px; }
.input--sm { min-height: 44px; font-size: .95rem; padding: 0 14px; }
.tabs { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tabs button { border: 0; background: transparent; border-radius: 999px; padding: 8px 14px; min-height: 38px; font: 700 .9rem var(--font); color: var(--ink-3); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.txt { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.txt th { text-align: left; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.txt td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: .95rem; }
.txt tbody tr:last-child td { border-bottom: 0; }
.txt tbody tr:hover { background: #fffaf3; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.txt__date { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 600; }
.txt__orig { font-size: .88rem; color: var(--ink-3); white-space: nowrap; }
.txt__desc b { display: block; color: var(--navy); font-weight: 700; }
.txt__desc small { font-size: .82rem; color: var(--ink-3); }
.txt__val { font-weight: 700; color: var(--navy); }
.txt__acts { white-space: nowrap; text-align: right; width: 1%; }
.chip { border: 1px solid var(--line); background: #fff7ec; color: var(--accent-ink); border-radius: 999px; padding: 4px 12px; min-height: 32px; font: 700 .82rem var(--font); cursor: pointer; white-space: nowrap; }
.chip.is-done { background: #eaf5ef; border-color: #cfe7da; color: var(--ok); }
.chip:hover { border-color: var(--gold); }

@media (max-width: 900px) {
  /* no celular cada lançamento vira um bloco: descrição e valor em cima, detalhes embaixo */
  .tx__sums { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; gap: 8px; }
  .tx__sums p { min-width: 0; padding: 8px 10px; }
  .tx__sums b { font-size: .95rem; }
  .txt thead { display: none; }
  .txt, .txt tbody { display: block; }
  .txt tr { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .txt__sel { grid-column: 1; grid-row: 1 / span 4; align-self: start; }
  .txt td { padding: 0; border: 0; }
  .txt__date { grid-column: 2; grid-row: 3; font-size: .82rem; }
  .txt__desc { grid-column: 2; grid-row: 1; }
  .txt__val { grid-column: 3; grid-row: 1; }
  .txt__cat, .txt__pay { grid-column: 2; font-size: .85rem; color: var(--ink-3); }
  .txt__cat { grid-row: 2; }
  .txt__pay { grid-row: 4; }
  .txt__orig { display: none; } /* no celular a linha já é densa; a origem fica no computador */
  .txt td:has(.chip) { grid-column: 3; grid-row: 2 / span 2; justify-self: end; }
  .txt__acts { grid-column: 3; grid-row: 4; }
}

/* seletor de tipo (Única / Parcelada / Recorrente) */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--cream-2); border-radius: 999px; padding: 4px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; min-height: 40px; border-radius: 999px; font-weight: 700; font-size: .92rem; color: var(--ink-2); }
.seg input:checked + span { background: var(--navy); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--gold-deep); outline-offset: 2px; }
.preview { font-size: .92rem; font-weight: 600; color: var(--royal); min-height: 0; }
.preview:empty { display: none; }
.check--radio, input[type=radio].check { border-radius: 50%; }

/* ---------- Início ---------- */
.home { display: grid; gap: 22px; }
.home__top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.home__hi { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.home__sub { margin-top: 4px; color: var(--ink-2); }
.home__sub b { color: var(--navy); font-variant-numeric: tabular-nums; }
/* colunas que se encaixam (sem buracos entre caixas de alturas diferentes) */
.home__grid { columns: 3 300px; column-gap: 18px; }
.box { padding: 18px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; break-inside: avoid; margin-bottom: 18px; }
.box__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.box__head h3 { font-size: 1.1rem; }
.box__head small { color: var(--ink-3); font-weight: 600; }
.box__link { font-size: .9rem; font-weight: 700; color: var(--accent-ink); }
.box__empty { color: var(--ink-3); font-size: .95rem; }
.box__note { font-size: .9rem; color: var(--ink-3); }
.box__more { font-size: .9rem; font-weight: 700; color: var(--accent-ink); }
.box__foot { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; color: var(--navy); }
.box__foot b { font-variant-numeric: tabular-nums; }
.box__big { font-size: 1.7rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.box__big small { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-3); }
.box .tabs button { padding: 6px 12px; min-height: 34px; font-size: .85rem; }

.mini { list-style: none; margin: 0; padding: 0; }
.mini li { display: flex; align-items: center; gap: 10px; min-height: 42px; border-bottom: 1px solid var(--line-2); font-size: .95rem; }
.mini li:last-child { border-bottom: 0; }
.mini__date { flex: none; width: 3.2em; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.mini__date.is-late { color: var(--warn); }
.mini__desc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); }
.mini b { flex: none; color: var(--navy); font-variant-numeric: tabular-nums; }
.mini .chip { flex: none; min-height: 30px; padding: 2px 10px; }
.tag--late { color: var(--warn); background: #fdecea; }

.weeks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.weeks li { aspect-ratio: 1; border-radius: 6px; background: var(--cream-2); box-shadow: inset 0 0 0 1px var(--line); }
.weeks li.is-on { background: var(--grad-gold); box-shadow: none; }
.weeks li:last-child { outline: 2px solid var(--navy); outline-offset: 2px; }

.cards-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cards-mini li { display: grid; gap: 4px; }
.cards-mini__row { display: flex; justify-content: space-between; color: var(--navy); font-variant-numeric: tabular-nums; }
.cards-mini small { color: var(--ink-3); font-size: .85rem; }
.meter { height: 8px; border-radius: 99px; background: var(--cream-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--grad-bar); }

.notes { min-height: 140px; font-size: 1rem; font-weight: 500; }

/* ---------- Planejamento e Controle ---------- */
.plan { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.plan__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.plan__bar .hint { max-width: 60ch; }
.plan__win { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); font-size: .92rem; }
.plan__win select { width: auto; }
.plan__scroll { position: relative; overflow-x: auto; background: var(--paper); border-radius: var(--r); box-shadow: var(--shadow); }
.pt { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.pt th, .pt td { padding: 7px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.pt thead th { font-size: .78rem; font-weight: 800; color: var(--ink-3); vertical-align: bottom; background: var(--paper); }
.pt thead small { font-weight: 600; }
.pt tbody th, .pt tfoot th { text-align: left; font-weight: 600; color: var(--navy); }
/* primeira coluna fica parada ao rolar a tabela para o lado */
.pt th:first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); min-width: 190px; box-shadow: 1px 0 0 var(--line); }
.pt .sub th { padding-left: 30px; font-weight: 500; color: var(--ink-2); }
.pt .top th { font-weight: 700; }
.pt .grp th, .pt .grp td { font-weight: 800; color: #fff; border-bottom: 0; }
/* a cor da faixa fica na linha; o mês selecionado só clareia por cima */
.pt .grp--receita, .pt .grp--receita th { background: var(--royal); }
.pt .grp--despesa, .pt .grp--despesa th { background: var(--gold-deep); }
.pt .grp--card, .pt .grp--card th { background: var(--cream-2); }
.pt .grp--card th, .pt .grp--card td { color: var(--navy); }
.pt .grp--card small { font-weight: 600; color: var(--ink-3); }
.pt .mc.is-sel { background: #fff7ec; }
.pt .grp .mc.is-sel { background: rgb(255 255 255 / .14); }
.pt .st { color: var(--ink-3); }
.pt .grp .st { color: #fff; }
.pt .is-over { color: var(--warn); font-weight: 700; }
.pt .warn { font-size: .85rem; }
.pt tfoot th, .pt tfoot td { font-weight: 800; color: var(--navy); border-top: 2px solid var(--line); }
.pt tfoot .acc th, .pt tfoot .acc td { border-top: 0; color: var(--ink-2); }
.plan-btn { min-width: 84px; min-height: 32px; padding: 2px 10px; border: 1px dashed var(--gold); border-radius: 8px; background: #fffaf3; font: 700 .9rem var(--font); color: var(--navy); cursor: pointer; font-variant-numeric: tabular-nums; }
.plan-btn:hover { background: var(--cream-2); border-style: solid; }
.seg--2 { grid-template-columns: repeat(2, 1fr); }
.months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.months .input { min-height: 44px; }
@media (max-width: 520px) { .months { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Balanço Mensal ---------- */
.bal { display: grid; gap: 18px; }
.bal__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.bal__year { grid-column: span 2; }
.bal__cats { grid-column: span 2; }
.bal__detail { grid-column: 1 / -1; }
.bal .box { margin: 0; }
@media (max-width: 1100px) { .bal__grid { grid-template-columns: minmax(0, 1fr); } .bal__year, .bal__cats { grid-column: auto; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; font-weight: 600; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend__plan { width: 3px !important; height: 12px !important; background: var(--navy); border-radius: 2px !important; }
.chart { width: 100%; height: auto; font: 600 11px var(--font); }
.chart text { fill: var(--ink-3); }
.chart__grid line { stroke: var(--line); stroke-width: 1; }
.chart__axis { stroke: #cfc3b0; stroke-width: 1; }
.chart__hit { fill: transparent; }
.chart__month:hover .chart__hit { fill: rgb(12 26 60 / .04); }
.chart__month.is-sel .chart__hit { fill: #fff3e3; }
.chart__month.is-sel text { fill: var(--navy); font-weight: 800; }
.meter--lg { height: 12px; }

.cmp { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
/* coluna de valores com largura fixa: todas as trilhas ficam do mesmo tamanho e comparáveis */
.cmp li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 210px; align-items: center; gap: 12px; font-size: .92rem; }
.cmp__name { color: var(--navy); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp__track { position: relative; height: 12px; border-radius: 99px; background: var(--cream-2); }
.cmp__real { position: absolute; inset: 0 auto 0 0; border-radius: 0 4px 4px 0; background: #4a64a8; }
.cmp__real.is-over { background: var(--warn); }
.cmp__plan { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--navy); box-shadow: 0 0 0 2px var(--paper); }
.cmp__val { text-align: right; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.cmp__val small { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-3); }
@media (max-width: 520px) {
  .cmp li { grid-template-columns: minmax(0, 1fr) auto; } .cmp__track { grid-column: 1 / -1; grid-row: 2; }
  /* no celular a tabela fica com 3 colunas: sai "% das despesas" */
  .det th, .det td { padding: 8px 6px; }
  .det th:nth-child(3), .det td:nth-child(3) { display: none; }
}

.det { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.det th, .det td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: left; }
.det thead th { font-size: .78rem; color: var(--ink-3); font-weight: 800; }
.det .num { text-align: right; }
.det__top th, .det__top td { font-weight: 700; color: var(--navy); }
.det__sub th { padding-left: 28px; font-weight: 500; color: var(--ink-2); }
.tag--ok { color: var(--ok); background: #eaf5ef; }

/* ---------- Pendências ---------- */
.pend { display: grid; gap: 28px; }
.pend__title { font-size: 1.3rem; margin-bottom: 12px; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.inv { padding: 18px 20px; display: grid; gap: 10px; }
.inv.is-paid { background: #fbfdfb; }
.inv__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.inv__head h3 { font-size: 1.1rem; }
.inv__due { font-size: .88rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; }
.inv__total { font-size: 1.3rem; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv__items summary { cursor: pointer; font-weight: 700; color: var(--royal); font-size: .92rem; min-height: 32px; display: flex; align-items: center; }
.inv__cat { display: flex; justify-content: space-between; margin-top: 8px; font-size: .82rem; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.inv__acts { display: flex; justify-content: flex-end; }
.pend__cols { columns: 3 300px; column-gap: 16px; }
.pend__cols .box { break-inside: avoid; margin-bottom: 16px; }
.box--late { box-shadow: inset 0 0 0 1px #f3c4bf, var(--shadow); }
.mini__sub { display: block; font-size: .78rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.mini li:has(.mini__sub) { min-height: 52px; }
.pay__total { display: grid; gap: 2px; background: var(--cream-2); border-radius: 12px; padding: 12px 14px; }
.pay__total small { color: var(--ink-3); font-weight: 600; }
.pay__total b { font-size: 1.5rem; color: var(--navy); font-variant-numeric: tabular-nums; }

/* ---------- Meus Planos ---------- */
.planos { display: grid; gap: 22px; }
.planos__top { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 22px; align-items: start; }
.planos__top .box { margin: 0; }
.planos__intro { display: grid; gap: 10px; justify-items: start; align-content: center; padding: 8px 0; }
.planos__intro h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.planos__intro p { max-width: 58ch; }
@media (max-width: 800px) { .planos__top { grid-template-columns: minmax(0, 1fr); } .planos__intro { order: -1; } }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.plan-card { padding: 18px 20px; display: grid; gap: 12px; }
.plan-card.is-done { background: #fbfdfb; }
.plan-card__head { display: flex; justify-content: space-between; gap: 10px; }
.plan-card__head h3 { font-size: 1.15rem; }
.plan-card__sub { font-size: .85rem; color: var(--ink-3); margin-top: 2px; }
.plan-card__prog { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.plan-card__prog b { color: var(--navy); font-variant-numeric: tabular-nums; }
.plan-card__nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0; }
.plan-card__nums dt { font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.plan-card__nums dd { margin: 0; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.plan-card__month { font-size: .92rem; background: var(--cream-2); border-radius: 10px; padding: 8px 12px; }
.plan-card__month b { color: var(--navy); }
.plan-card__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tl th:first-child { min-width: 160px; }

/* ---------- Painel Planos e Metas ---------- */
/* colunas que se encaixam, como no Início (sem buracos entre caixas de alturas diferentes) */
.dplan { columns: 2 360px; column-gap: 18px; }
.dplan .box { margin: 0 0 18px; break-inside: avoid; }
.dplan__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.dplan__list li { display: grid; gap: 6px; }
.dplan__list small { color: var(--ink-3); font-size: .85rem; }

/* ---------- Investimentos ---------- */
.invs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.invs__top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.link-btn { border: 0; background: none; padding: 4px 0; min-height: 32px; font: 700 .85rem var(--font); color: var(--accent-ink); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.tx__sums .link-btn { display: block; }
.invt th:first-child { min-width: 180px; }
.invt tbody th b { display: block; color: var(--navy); }
.invt tbody th small { font-size: .78rem; color: var(--ink-3); font-weight: 500; }
.invt td { white-space: nowrap; }
.invt tr.is-closed { opacity: .6; }
.inv-cell { width: 100%; min-width: 92px; border: 1px dashed transparent; border-radius: 8px; background: none; padding: 4px 6px; text-align: right; font: 600 .9rem var(--font); color: var(--ink-3); cursor: pointer; font-variant-numeric: tabular-nums; }
.inv-cell.is-set { color: var(--navy); font-weight: 700; }
.inv-cell:hover { border-color: var(--gold); background: #fffaf3; }
.inv-cell small { display: block; font-size: .75rem; font-weight: 700; color: var(--ink-3); }
.menu-list { display: grid; gap: 8px; }
.menu-list .btn { justify-content: flex-start; }

.dinv { columns: 2 380px; column-gap: 18px; }
.dinv .box { margin: 0 0 18px; break-inside: avoid; }
.dinv__chart, .dinv__table { column-span: all; }
.bcb { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bcb li { background: var(--cream); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.bcb span { font-weight: 800; color: var(--navy); font-size: .9rem; }
.bcb small { display: block; font-weight: 600; color: var(--ink-3); font-size: .75rem; }
.bcb b { font-size: 1.3rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.stack { display: flex; gap: 2px; height: 14px; border-radius: 99px; overflow: hidden; background: var(--cream-2); }
.stack span { display: block; height: 100%; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* ---------- Janela de formulário ---------- */
.dlg { width: min(92vw, 480px); max-height: 92dvh; padding: 0; border: 0; border-radius: var(--r-lg); background: var(--paper); color: var(--ink-2); box-shadow: 0 30px 60px -20px rgb(12 26 60 / .45); }
.dlg--wide { width: min(94vw, 600px); }
.dlg::backdrop { background: rgb(12 26 60 / .45); }
.dlg__form { display: grid; gap: 16px; padding: 24px; }
.dlg__form h2 { font-size: 1.35rem; }
.dlg__body { display: grid; gap: 14px; }
.dlg__err { color: var(--warn); font-weight: 600; min-height: 1.2em; margin: -6px 0; }
.dlg__err:empty { min-height: 0; margin: 0; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 10px; }
.dlg .input { min-height: 48px; font-size: 1rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkline { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--navy); cursor: pointer; }
.checkline small { font-weight: 500; color: var(--ink-3); }
.checkline .check { width: 26px; height: 26px; }

/* ---------- Celular ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); z-index: 40; transform: translateX(-100%); transition: transform .35s var(--ease); }
  .menu-open .side { transform: none; box-shadow: var(--shadow-lift); }
  .side__scrim { position: fixed; inset: 0; z-index: 30; background: rgb(12 26 60 / .35); }
  .appbar__toggle { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); color: var(--navy); cursor: pointer; }
  .appbar__user #user-name { display: none; }
  .appbar__title { flex: 1 1 0; min-width: 0; margin-right: 0; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .month { order: 5; width: 100%; justify-content: space-between; }
}

/* Análises */
.an { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.an .an__filters { margin: 0; }
.an__row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; }
.an__label { min-width: 52px; padding-top: 6px; font-size: .85rem; font-weight: 700; color: var(--ink-3); }
.an__chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 0; min-width: 0; }
.fchip { border: 1px solid var(--line); background: var(--paper); color: var(--ink-3); border-radius: 999px; padding: 4px 12px; min-height: 32px; font: 700 .82rem var(--font); cursor: pointer; }
.fchip:hover { border-color: var(--gold); }
.fchip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.tx__sums .an__period { font-size: 1rem; }

/* Importar e duplicados */
.tx__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.imp { display: grid; gap: 10px; }
.imp__sum { font-size: .92rem; color: var(--ink-2); }
.imp__list { max-height: min(46vh, 420px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.imp__list .det td, .imp__list .det th { padding: 6px 8px; vertical-align: middle; }
.imp__list .det small.tag { margin-left: 6px; }
.imp__list .det select { min-width: 150px; }
.imp__list tr.is-dup td { color: var(--ink-3); }
.dup__crit { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
.dup__crit legend { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.dup__group { list-style: none; margin: 0; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.dup__group:last-child { border-bottom: 0; }
.dup__group .checkline { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.dup__group small { display: block; color: var(--ink-3); font-size: .82rem; }

/* Minha conta */
.conta { columns: 2 380px; column-gap: 18px; }
.conta .box { break-inside: avoid; }
.appbar__user #user-name { color: var(--navy); text-decoration: none; }
.appbar__user #user-name:hover { text-decoration: underline; text-underline-offset: .2em; }
.conta__who { display: flex; align-items: center; gap: 14px; }
.conta__who b { display: block; color: var(--navy); font-size: 1.1rem; }
.conta__who div { min-width: 0; }
.conta__who small { color: var(--ink-3); overflow-wrap: anywhere; }
.conta__photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.conta__photo--none { display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; font-size: 1.6rem; }
.conta__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.conta__form .field { flex: 1 1 220px; }
.conta__ok { flex-basis: 100%; font-size: .9rem; color: var(--ok); min-height: 1.2em; }
.conta .checkline small, .conta__parts .checkline small { display: block; margin-top: 2px; }

/* Seleção e edição em massa */
.txt__sel { width: 1%; padding-right: 0 !important; }
.txt__sel .check { width: 22px; height: 22px; }
.txt tbody tr.is-sel { background: #fff3e3; }
.tx__bulk { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--gold); border-radius: 14px; box-shadow: 0 10px 30px rgb(12 26 60 / .18); }
.tx__bulk[hidden] { display: none; }
.tx:has(.tx__bulk:not([hidden])) { padding-bottom: 88px; } /* a barra flutuante não cobre a última linha */
.tx__bulk b { color: var(--navy); margin-right: auto; }
.bulk { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; }
.bulk__f { display: grid; gap: 6px; align-content: start; }
.bulk__f [data-ctl] :disabled { opacity: .45; }

/* Ícone das categorias */
.cat-ico { display: inline-block; width: 1.4em; margin-right: 6px; text-align: center; font-style: normal; }
.ico-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.ico-pick legend { font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.ico-pick label { position: relative; }
.ico-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ico-pick span { display: grid; place-items: center; height: 44px; border: 1px solid var(--line); border-radius: 10px; font-size: 1.35rem; color: var(--ink-3); background: var(--paper); }
.ico-pick input:checked + span { border: 2px solid var(--gold); background: #fff3e3; }
.ico-pick input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }

/* Cor dos cartões */
.cchip { display: inline-block; width: 22px; height: 15px; margin-right: 8px; border-radius: 4px; vertical-align: -2px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #000)); box-shadow: inset 0 -3px 0 rgb(255 255 255 / .25); }
.ccard[style] { border-top: 4px solid var(--c); }
.color-pick span { background: linear-gradient(135deg, var(--c, var(--paper)), color-mix(in srgb, var(--c, var(--paper)) 70%, #000)); }
.color-pick label:first-of-type span { background: var(--paper); }
.color-pick input:checked + span { background: linear-gradient(135deg, var(--c, var(--paper)), color-mix(in srgb, var(--c, var(--paper)) 70%, #000)); border: 3px solid var(--navy); }
.color-pick label:first-of-type input:checked + span { background: var(--paper); }

/* Foto do plano */
.plan-card__photo { display: block; width: calc(100% + 40px); max-width: none; margin: -18px -20px 0; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r) var(--r) 0 0; background: var(--cream-2); }

/* ---------- Modo escuro (só no app) ----------
   O tema vem de <html data-theme>: escolha salva, ou o do aparelho. --navy é texto forte no claro
   e vira claro aqui; fundos que eram navy passam a usar --fill, para o texto branco continuar legível. */
:root { --fill: var(--navy); --fill-2: var(--navy-2); }
:root[data-theme="dark"] {
  color-scheme: dark;
  --navy: #e9edf7; --navy-2: #cfd6ea; --royal: #9fb0dc; --blue: #8fa2d6;
  --ink: #e9edf7; --ink-2: #c3cbe0; --ink-3: #97a2bf;
  --cream: #0f1628; --cream-2: #1c2640; --paper: #161f36;
  --line: #2a3553; --line-2: #222c47;
  --accent-ink: #ffab66; --ok: #4cc38a; --warn: #ff7b72;
  --fill: #33498a; --fill-2: #3f58a3;
  --grad-bar: linear-gradient(90deg, #6a86d0 0%, #f8901f 64%, #fcd274 100%);
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 12px 32px -12px rgb(0 0 0 / .6);
  --shadow-lift: 0 2px 4px rgb(0 0 0 / .4), 0 24px 48px -16px rgb(0 0 0 / .7);
}
.side nav a[aria-current], .tabs button[aria-pressed="true"], .seg input:checked + span,
.fchip[aria-pressed="true"], .conta__photo--none, .btn--navy, .skip { background: var(--fill); border-color: var(--fill); }
.btn--navy:hover { background: var(--fill-2); }

:root[data-theme="dark"] .appbar { background: rgb(15 22 40 / .92); }
:root[data-theme="dark"] .input { background: #0f1628; }
:root[data-theme="dark"] textarea.input { background-image: repeating-linear-gradient(transparent 0 32px, var(--line) 32px 33px); }
:root[data-theme="dark"] .btn--gold, :root[data-theme="dark"] .btn--gold:hover { color: #0c1a3c; }
:root[data-theme="dark"] .btn--ghost:hover { background: rgb(248 144 31 / .12); }
:root[data-theme="dark"] .btn--danger { background: #c9372c; }
:root[data-theme="dark"] .auth__art { background: radial-gradient(90% 70% at 50% 42%, rgb(248 144 31 / .22), rgb(15 22 40 / 0) 70%), var(--cream-2); }
/* botão do Google no tema escuro, conforme o guia de marca dele */
:root[data-theme="dark"] .gbtn { background: #131314; color: #e3e3e3; border-color: #8e918f; }
:root[data-theme="dark"] .gbtn:hover { background: #1f1f21; }

/* realces que eram cores claras fixas */
:root[data-theme="dark"] .txt tbody tr:hover, :root[data-theme="dark"] .inv-cell:hover, :root[data-theme="dark"] .plan-btn { background: rgb(255 255 255 / .04); }
:root[data-theme="dark"] .txt tbody tr.is-sel, :root[data-theme="dark"] .ico-pick input:checked + span,
:root[data-theme="dark"] .pt .mc.is-sel, :root[data-theme="dark"] .chip { background: rgb(248 144 31 / .14); }
:root[data-theme="dark"] .chart__month.is-sel .chart__hit { fill: rgb(248 144 31 / .12); }
:root[data-theme="dark"] .chip.is-done, :root[data-theme="dark"] .tag--ok { background: rgb(76 195 138 / .14); border-color: rgb(76 195 138 / .3); }
:root[data-theme="dark"] .tag--late, :root[data-theme="dark"] .ibtn--danger:hover { background: rgb(255 123 114 / .14); }
:root[data-theme="dark"] .tag--main { background: rgb(248 144 31 / .16); }
:root[data-theme="dark"] .inv.is-paid, :root[data-theme="dark"] .plan-card.is-done { background: var(--paper); }
:root[data-theme="dark"] .box--late { box-shadow: inset 0 0 0 1px rgb(255 123 114 / .4), var(--shadow); }
:root[data-theme="dark"] .chart__axis { stroke: #4a5677; }
:root[data-theme="dark"] .pt .grp--receita, :root[data-theme="dark"] .pt .grp--receita th { background: #2a3d73; }
:root[data-theme="dark"] .pt .grp--despesa, :root[data-theme="dark"] .pt .grp--despesa th { background: #a8430f; }

/* cores dos gráficos: o azul e o vermelho claros somem no fundo escuro; tons validados (dataviz, fundo #161f36) */
:root[data-theme="dark"] [fill="#4a64a8"] { fill: #6a86d0; }
:root[data-theme="dark"] [stroke="#4a64a8"] { stroke: #6a86d0; }
:root[data-theme="dark"] [fill="#b3261e"] { fill: #ff7b72; }
:root[data-theme="dark"] [style*="#4a64a8"] { background: #6a86d0 !important; }

/* botão de tema no topo */
.theme-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--navy); display: grid; place-items: center; cursor: pointer; }
.theme-btn:hover { border-color: var(--gold); }

/* Assinatura: fatos do plano em pares rótulo/valor */
.sub__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 24px; margin: 0; }
.sub__facts dt { font-size: .9rem; color: var(--ink-3); }
.sub__facts dd { margin: 2px 0 0; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.sub__perks { display: grid; gap: 6px; margin: 0 0 12px; padding-left: 20px; color: var(--ink-2); }
.sub__perks li::marker { color: var(--gold); }

/* ✨ categoria escolhida pelo app (histórico ou IA), até a pessoa trocar */
.spark { color: var(--gold-deep); flex: none; vertical-align: -2px; }
.spark-at { display: inline-flex; margin-left: 6px; cursor: help; }
.imp__cat { display: flex; align-items: center; gap: 6px; }
.btn .spark { width: 16px; height: 16px; }

/* ---------- Tour guiado ---------- */
.tour { position: fixed; inset: 0; z-index: 1000; }
/* o "buraco" iluminado é o próprio destaque; a sombra gigante escurece o resto da tela */
.tour__spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 3px var(--gold), 0 0 0 9999px rgb(6 12 30 / .66); transition: top .35s var(--ease), left .35s var(--ease), width .35s var(--ease), height .35s var(--ease); pointer-events: none; }
.tour__pop { position: fixed; width: min(360px, calc(100vw - 32px)); padding: 20px 22px; border-radius: var(--r); background: var(--paper); color: var(--ink-2); box-shadow: var(--shadow-lift); transition: top .35s var(--ease), left .35s var(--ease); }
.tour__pop:focus { outline: none; }
.tour__pop h2 { font-size: 1.2rem; margin: 2px 0 6px; color: var(--navy); }
.tour__pop p { margin: 0; line-height: 1.5; }
.tour__step { font-size: .85rem; font-weight: 700; color: var(--accent-ink); }
.tour__nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.tour__nav span { display: flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .tour__spot, .tour__pop { transition: none; } }

/* menu Tutoriais (details nativo) */
.tut { position: relative; }
.tut summary { list-style: none; cursor: pointer; }
.tut summary::-webkit-details-marker { display: none; }
.tut ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 250px; margin: 0; padding: 6px; list-style: none; border-radius: var(--r); background: var(--paper); box-shadow: var(--shadow-lift); }
.tut li button { width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; font: inherit; font-weight: 600; color: var(--navy); text-align: left; cursor: pointer; }
.tut li button:hover, .tut li button:focus-visible { background: var(--cream-2); }
.tut ul { max-height: 75dvh; overflow-y: auto; }
.tut__h { padding: 10px 12px 4px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.tut li small { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--cream-2); font-size: .72rem; font-weight: 800; color: var(--accent-ink); }

/* vídeo explicativo */
.dlg--video { width: min(94vw, 960px); }
.vid { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r); background: var(--navy); }

/* aviso de novidade */
.news { position: relative; }
.news__x { position: absolute; top: 0; right: 0; font-size: 1.4rem; line-height: 1; }
.news h2 { padding-right: 40px; }
/* celular: "Tutoriais" vira um "?" redondo para não espremer o título (o texto continua para leitores de tela) */
@media (max-width: 600px) {
  /* gap 0: o texto "Tutoriais" (tamanho 0) ainda conta como item e o espaço empurrava o "?" para fora do centro */
  .tut summary { width: 44px; padding: 0; gap: 0; justify-content: center; font-size: 0; }
  .tut summary::before { content: "?"; font-size: 1.05rem; font-weight: 800; }
  .tut ul { right: -48px; }
}

/* ---------- Simuladores ---------- */
.sim__lede { max-width: 70ch; margin: 0 0 16px; color: var(--ink-2); }
.sim__grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
.sim__in { gap: 14px; }
.sim__out { gap: 14px; }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix span { color: var(--ink-3); font-size: .9rem; white-space: nowrap; }
.sim__kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.sim__kpi { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--cream-2); }
.sim__kpi small { color: var(--ink-3); font-size: .85rem; }
.sim__kpi b { font-size: 1.35rem; font-weight: 900; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sim__kpi span { font-size: .82rem; color: var(--ink-3); }
.sim__say { margin: 0; font-size: 1.02rem; }
.sim__tip { max-width: 70ch; margin: 18px 0 0; padding: 14px 18px; border-radius: 14px; background: var(--cream-2); color: var(--ink-2); font-size: .95rem; }
.sim__print { margin-top: 14px; }
.sim__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sim__col { display: grid; gap: 10px; align-content: start; }
.sim__col h3 { font-size: 1.15rem; margin: 0; }
.sim__table summary { cursor: pointer; font-weight: 700; color: var(--royal); min-height: 40px; display: flex; align-items: center; }
.sim__scroll { overflow-x: auto; max-height: 360px; overflow-y: auto; }
.sim__parc td { padding: 4px 4px; vertical-align: middle; }
.sim__parc input[name=p_count] { width: 64px; }
.is-warn { color: var(--accent-ink); } /* falta dinheiro: laranja, não vermelho (regra do dinheiro calmo) */
.sim__bars, .sim__stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sim__bars li, .sim__stack li { display: grid; grid-template-columns: 62px 1fr 110px; align-items: center; gap: 10px; font-size: .9rem; }
.sim__bars li small { grid-column: 2 / -1; margin-top: -4px; color: var(--ink-3); font-size: .8rem; }
.sim__bars i, .sim__stack i { height: 14px; border-radius: 999px; background: var(--line-2, #f6ebdc); position: relative; overflow: hidden; }
.sim__bars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit; background: var(--royal); }
.sim__bars i.is-warn::after { background: var(--gold); }
.sim__stack i { background: linear-gradient(90deg, var(--royal) 0 var(--a), var(--gold) var(--a) calc(var(--a) + var(--b)), transparent 0); }
.sim__bars b, .sim__stack b { text-align: right; font-variant-numeric: tabular-nums; }
.sim__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .85rem; color: var(--ink-3); margin: 0; }
.sim__legend span { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: -10px; }
.sim__legend .is-a { background: var(--royal); } .sim__legend .is-b { background: var(--gold); }
@media (max-width: 900px) { .sim__grid, .sim__cols { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .sim__bars li, .sim__stack li { grid-template-columns: 52px 1fr 92px; font-size: .82rem; } }

/* Salvar em PDF: só o simulador, sem menu nem cabeçalho */
@media print {
  .side, .side__scrim, .appbar, .sim__print, .sim__table summary ~ * { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .sim__grid { grid-template-columns: 1fr 1.4fr; }
}

/* ---------- Painel admin ---------- */
.adm__page { display: grid; gap: 16px; }
.adm__page > .tabs { justify-self: start; }
.adm__wrap { overflow-x: auto; padding: 4px 8px; }
.adm { min-width: 860px; }
.adm td { vertical-align: top; }
.adm td small { display: block; color: var(--ink-3); font-size: .82rem; }
.adm .tag { font-size: .72rem; }
.adm__acts { white-space: nowrap; }
.adm__acts .link-btn + .link-btn { margin-left: 10px; }
.chip.is-warn { background: var(--cream-2); color: var(--accent-ink); }
.chip.is-none { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
.adm__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.adm__list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.adm__list small { display: block; color: var(--ink-3); font-size: .85rem; }
.adm__add { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.adm__add .field { flex: 1 1 260px; margin: 0; }

/* tela de assinatura: CPF e as duas formas de pagar */
.pay__form { display: grid; gap: 10px; }
.pay__form .field { margin: 0; }
.pay__form .field small { color: var(--ink-3); font-size: .85rem; }
.pay__form .btn { justify-content: space-between; }
.pay__form .btn--ghost { justify-content: center; }
.pay__price small { font-size: .9rem; font-weight: 700; letter-spacing: 0; color: var(--accent-ink); }
