/* =====================================================================
   Final de Ano na Chácara — visual "noite de réveillon"
   ===================================================================== */
:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #172033;
  --muted: #687386;
  --line: #e6e1d6;
  --line-soft: #f0ece4;

  --navy: #0f1d3a;
  --navy-2: #1d3466;
  --gold: #f0b429;
  --gold-soft: #fdf4dc;
  --gold-ink: #7a5500;

  --green: #1d8a5a;
  --green-soft: #e3f5ec;
  --green-ink: #126240;
  --red: #d64535;
  --red-soft: #fde9e6;
  --red-ink: #a52a1d;
  --amber-soft: #fdf0d5;
  --amber-ink: #875600;
  --slate-soft: #edf1f7;
  --slate-ink: #45536b;
  --blue-soft: #e8efff;

  --r: 20px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 29, 58, .04), 0 6px 22px rgba(15, 29, 58, .06);
  --shadow-lg: 0 14px 40px rgba(15, 29, 58, .22);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy-2); }
::selection { background: rgba(240, 180, 41, .35); }

/* =====================================================================
   Topo
   ===================================================================== */
.topo {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(115deg, #0b1630 0%, #13254b 55%, #1d3466 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(11, 22, 48, .25);
}
.topo-linha {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px 8px;
}
.marca { display: flex; align-items: center; gap: 11px; min-width: 0; }
.marca > div { min-width: 0; }
.marca-icone {
  width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; font-size: 22px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14);
}
.marca-nome { font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca-sub { font-size: 12.5px; color: rgba(255, 255, 255, .68); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-acesso {
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08);
  color: #fff; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-acesso:hover { background: rgba(255, 255, 255, .16); }
.btn-acesso.logado { background: var(--gold); border-color: var(--gold); color: var(--navy); }
@media (max-width: 440px) {
  .btn-acesso-txt { display: none; }
  .btn-acesso { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; font-size: 15px; }
}

.abas {
  max-width: 1100px; margin: 0 auto;
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 14px 12px;
  scrollbar-width: none;
}
.abas::-webkit-scrollbar { display: none; }
.abas button {
  border: 0; background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .82);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s;
}
.abas button:hover:not(.ativa) { background: rgba(255, 255, 255, .14); color: #fff; }
.abas button.ativa { background: var(--gold); color: var(--navy); box-shadow: 0 4px 14px rgba(240, 180, 41, .35); }

/* =====================================================================
   Estrutura
   ===================================================================== */
.conteudo { max-width: 1100px; margin: 0 auto; padding: 20px 14px 90px; }
.carregando { padding: 60px 0; text-align: center; color: var(--muted); }

.cabecalho-aba { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 2px 16px; }
.cabecalho-aba h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.cabecalho-aba p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

.cartao {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px; border: 1px solid var(--line-soft);
}
.cartao h2 {
  font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.cartao h2 small { font-weight: 600; color: var(--muted); font-size: 13px; }
.cartao-sub { margin: -6px 0 10px; color: var(--muted); font-size: 13.5px; }

.grade-2 { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.grade-2 > .cartao { margin-bottom: 0; }
@media (min-width: 860px) { .grade-2 { grid-template-columns: 1fr 1fr; } }

/* =====================================================================
   Contagem regressiva (herói)
   ===================================================================== */
.heroi {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: 26px; padding: 24px 22px 20px; margin-bottom: 16px; color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(58, 96, 180, .55) 0%, transparent 55%),
    linear-gradient(150deg, #0a142c 0%, #13285a 55%, #1c3b7c 100%);
  box-shadow: var(--shadow-lg);
}
.heroi-fogos { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.heroi-fogos::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .7) 0 1px, transparent 2px),
    radial-gradient(circle at 30% 80%, rgba(255, 255, 255, .5) 0 1px, transparent 2px),
    radial-gradient(circle at 48% 12%, rgba(255, 255, 255, .6) 0 1px, transparent 2px),
    radial-gradient(circle at 58% 64%, rgba(255, 255, 255, .45) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 90%, rgba(255, 255, 255, .5) 0 1px, transparent 2px),
    radial-gradient(circle at 92% 70%, rgba(255, 255, 255, .6) 0 1px, transparent 2px);
}
.heroi-fogos i {
  position: absolute; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--c) 0deg 3deg, transparent 3deg 20deg);
  -webkit-mask: radial-gradient(circle, transparent 0 22%, #000 24% 66%, transparent 70%);
          mask: radial-gradient(circle, transparent 0 22%, #000 24% 66%, transparent 70%);
  animation: brilho 3.2s ease-in-out infinite;
}
.heroi-fogos i:nth-child(1) { --c: rgba(240, 180, 41, .95); width: 190px; height: 190px; right: -34px; top: -44px; }
.heroi-fogos i:nth-child(2) { --c: rgba(255, 120, 170, .85); width: 110px; height: 110px; right: 120px; top: 20px; animation-delay: 1.1s; }
.heroi-fogos i:nth-child(3) { --c: rgba(120, 215, 255, .8); width: 80px; height: 80px; right: 40px; top: 130px; animation-delay: 2.1s; }
@keyframes brilho {
  0%, 100% { opacity: .55; transform: scale(.92) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.04) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) { .heroi-fogos i { animation: none; } }
.heroi-conteudo { position: relative; }
.contagem-rotulo { font-size: 14px; color: rgba(255, 255, 255, .8); font-weight: 500; }
.contagem {
  font-size: 46px; font-weight: 800; line-height: 1.02; letter-spacing: -.03em; margin: 2px 0;
  background: linear-gradient(90deg, #ffe08a, #f0b429 60%, #ffd36b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.heroi-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.heroi-chips span {
  background: rgba(255, 255, 255, .11); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; backdrop-filter: blur(4px);
}
.btn-heroi {
  margin-top: 16px; border: 0; cursor: pointer; border-radius: 999px; padding: 10px 18px;
  background: var(--gold); color: var(--navy); font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 18px rgba(240, 180, 41, .35); transition: transform .1s, filter .15s;
}
.btn-heroi:hover { filter: brightness(1.05); }
.btn-heroi:active { transform: translateY(1px); }

/* =====================================================================
   Indicadores
   ===================================================================== */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
@media (min-width: 860px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: var(--card); border-radius: var(--r); padding: 14px 15px; box-shadow: var(--shadow);
  border: 1px solid var(--line-soft); min-width: 0;
}
.kpi-topo { display: flex; align-items: center; gap: 8px; }
.kpi-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; flex: none; background: var(--slate-soft); }
.kpi-ic.verde { background: var(--green-soft); }
.kpi-ic.ambar { background: var(--amber-soft); }
.kpi-ic.azul { background: var(--blue-soft); }
.kpi-ic.ouro { background: var(--gold-soft); }
.kpi-rotulo { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-valor { font-size: 23px; font-weight: 800; margin-top: 10px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-det { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.bom .kpi-valor { color: var(--green); }
.kpi.ruim .kpi-valor { color: var(--red); }
@media (max-width: 380px) { .kpi-valor { font-size: 19px; } }

.barra { height: 8px; background: #ece7dc; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.barra > span { display: block; height: 100%; background: linear-gradient(90deg, #1d8a5a, #3cbf86); border-radius: 99px; min-width: 0; }
.barra.fina { height: 6px; margin-top: 7px; max-width: 340px; }

/* =====================================================================
   Resumo: quanto cada um paga / caloteiro / contas
   ===================================================================== */
.valores, .cal-lista, .contas { list-style: none; margin: 0; padding: 0; }
.vl { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line-soft); }
.vl:last-child { border-bottom: 0; }
.vl-info { flex: 1; min-width: 0; }
.vl-nome { font-weight: 700; }
.vl-nome a { color: inherit; text-decoration: none; border-bottom: 1px dashed #b8bfcc; }
.vl-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.vl-valor { font-size: 18px; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.vl-indef { font-size: 12.5px; font-weight: 700; color: var(--slate-ink); background: var(--slate-soft); padding: 5px 11px; border-radius: 999px; letter-spacing: 0; }
.vl-total {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px;
  padding: 12px 15px; background: var(--gold-soft); border-radius: 14px; color: var(--gold-ink); font-weight: 700; font-size: 14px;
}
.vl-total b { font-size: 20px; color: var(--navy); font-weight: 800; }

.caloteiro { overflow: hidden; }
.caloteiro::before {
  content: ""; display: block; height: 9px; margin: -16px -18px 14px;
  background: repeating-linear-gradient(-45deg, var(--gold) 0 12px, var(--navy) 12px 24px);
}
.cal-item { display: flex; gap: 12px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line-soft); }
.cal-item:last-child { border-bottom: 0; }
.cal-pos {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--red-soft); color: var(--red-ink); font-weight: 800; font-size: 14px;
}
.cal-item.lider .cal-pos { background: var(--gold-soft); font-size: 17px; }
.cal-dir { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.cal-dir .valor { color: var(--red); }
.cal-vazio { text-align: center; padding: 10px 8px 6px; display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--muted); font-size: 13.5px; }
.cal-vazio b { color: var(--ink); }
.cal-vazio > b:first-of-type { font-size: 16px; }
.cal-emoji { font-size: 44px; line-height: 1; }

.conta { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); }
.conta:last-child { border-bottom: 0; }
.conta-data { width: 50px; flex: none; text-align: center; background: var(--slate-soft); border-radius: 13px; padding: 7px 0 6px; line-height: 1.05; }
.conta-data b { display: block; font-size: 19px; font-weight: 800; color: var(--navy); }
.conta-data span { font-size: 10.5px; text-transform: uppercase; color: var(--slate-ink); font-weight: 800; letter-spacing: .06em; }
.conta-dir { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; align-self: flex-start; padding-top: 2px; }
.conta-status { margin-top: 5px; }

/* =====================================================================
   Tabelas e listas
   ===================================================================== */
.tabela-wrap { overflow-x: auto; margin: 0 -4px; }
table.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabela td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.num, .tabela th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela tfoot td { font-weight: 800; border-top: 1px solid var(--line); }

.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line-soft); }
.lista > li:last-child { border-bottom: 0; }
.principal { flex: 1; min-width: 0; }
.titulo { font-weight: 700; }
.detalhe { color: var(--muted); font-size: 13px; }
.valor { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vazio { color: var(--muted); text-align: center; padding: 20px 10px; font-size: 14px; }

/* Selos */
.selo { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.selo.ok { background: var(--green-soft); color: var(--green-ink); }
.selo.parcial { background: var(--amber-soft); color: var(--amber-ink); }
.selo.pendente { background: var(--red-soft); color: var(--red-ink); }
.selo.neutro { background: var(--slate-soft); color: var(--slate-ink); }
.selo.ouro { background: var(--gold-soft); color: var(--gold-ink); }
.selo.info { background: var(--blue-soft); color: #2a4fa8; }

/* =====================================================================
   Filtros e busca
   ===================================================================== */
.filtros { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.chip-filtro {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.chip-filtro:hover { background: #faf8f3; }
.chip-filtro.ativo { background: var(--navy); border-color: var(--navy); color: #fff; }
.busca {
  flex: 1; min-width: 170px; max-width: 320px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px 8px 36px; background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23687386' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px center;
}
.busca:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29, 52, 102, .12); }

/* =====================================================================
   Quem pagou (quadro de pessoas x itens)
   ===================================================================== */
.matriz { display: grid; gap: 12px; }
.mlinha {
  background: var(--card); border-radius: var(--r); border: 1px solid var(--line-soft); box-shadow: var(--shadow);
  padding: 14px 15px; display: grid; gap: 10px; grid-template-columns: 1fr;
}
.mlinha .mnome { font-weight: 800; font-size: 16px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mlinha .mnome small { color: var(--muted); font-weight: 500; font-size: 13px; }
.mcelulas { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.mcel {
  border-radius: 14px; padding: 8px 11px; border: 1px solid transparent; text-align: left; background: var(--slate-soft);
  display: flex; flex-direction: column; gap: 1px; cursor: default; min-height: 56px; font: inherit;
}
.mcel.clicavel { cursor: pointer; transition: transform .08s, box-shadow .15s; }
.mcel.clicavel:hover { box-shadow: 0 3px 10px rgba(15, 29, 58, .1); transform: translateY(-1px); }
.mcel .mcota { font-size: 12px; font-weight: 600; opacity: .85; }
.mcel .mval { font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.mcel.ok { background: var(--green-soft); color: var(--green-ink); }
.mcel.parcial { background: var(--amber-soft); color: var(--amber-ink); }
.mcel.pendente { background: var(--red-soft); color: var(--red-ink); }
.mcel.avencer { background: var(--slate-soft); color: var(--slate-ink); }
.mcel.fora { background: #f7f5f0; color: #a0a6b0; }
.mtotal { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.mtotal b { color: var(--ink); }
@media (min-width: 860px) {
  .mlinha { grid-template-columns: 190px 1fr 170px; align-items: center; }
  .mtotal { flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
}

/* =====================================================================
   Cartões (pessoas, quartos)
   ===================================================================== */
.cartoes { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .cartoes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cartoes.tres { grid-template-columns: 1fr 1fr 1fr; } }
.pcard {
  background: var(--card); border-radius: var(--r); padding: 14px 15px; border: 1px solid var(--line-soft); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 7px;
}
.pcard-topo { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pcard-nome { font-weight: 800; font-size: 16px; }
.pcard-det { color: var(--muted); font-size: 13px; }
.pcard-acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.etiquetas { display: flex; gap: 5px; flex-wrap: wrap; }

/* =====================================================================
   Lista de compras
   ===================================================================== */
.item-linha { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); }
.item-linha:last-child { border-bottom: 0; }
.item-linha.feito .titulo { text-decoration: line-through; color: var(--muted); }
.check {
  width: 26px; height: 26px; border-radius: 8px; border: 2px solid #c9c3b4; background: #fff; flex: none;
  display: grid; place-items: center; font-size: 14px; color: #fff; padding: 0;
}
.check.marcado { background: var(--green); border-color: var(--green); }
button.check { cursor: pointer; }
.grupo-titulo { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 14px 2px 4px; }
.grupo-titulo:first-child { margin-top: 2px; }

/* =====================================================================
   Botões
   ===================================================================== */
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 8px 14px; cursor: pointer;
  font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink);
  white-space: nowrap; transition: background .15s, transform .08s, filter .15s;
}
.btn:hover { background: #faf8f3; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.prim { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.prim:hover { background: var(--navy-2); }
.btn.ouro { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 700; }
.btn.ouro:hover { filter: brightness(1.05); }
.btn.perigo { color: var(--red); border-color: #f2c6c0; }
.btn.peq { padding: 5px 11px; font-size: 13px; border-radius: 10px; }
.btn.zap { background: #e5f8ec; border-color: #bfe8cf; color: #117a3e; }
.btn-icone { border: 0; background: transparent; cursor: pointer; padding: 5px 7px; border-radius: 9px; color: var(--muted); font-size: 15px; }
.btn-icone:hover { background: var(--slate-soft); color: var(--ink); }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; }

/* =====================================================================
   Informações
   ===================================================================== */
.info-grade { display: grid; gap: 14px 20px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .info-grade { grid-template-columns: 1fr 1fr; } }
.info-campo .rot { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.info-campo .val { font-weight: 600; word-break: break-word; margin-top: 2px; }
.texto-livre { white-space: pre-wrap; margin: 0; }
.pix { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--gold-soft); border-radius: 14px; padding: 12px 14px; border: 1px dashed #e7c463; }
.pix code { font-size: 16px; font-weight: 800; word-break: break-all; }

/* =====================================================================
   Pesquisa de preços
   ===================================================================== */
.quick { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.quick input, .quick-linha input {
  border: 1px solid #dcd6c9; border-radius: 12px; padding: 10px 12px; font-size: 16px; width: 100%; background: #fff; min-width: 0;
}
.quick input:focus, .quick-linha input:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29, 52, 102, .12); }
.quick [name=produto] { grid-column: span 2; }
.quick .btn { justify-content: center; }
.seg { display: flex; gap: 4px; background: var(--slate-soft); padding: 3px; border-radius: 12px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 7px 6px; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--slate-ink); }
.seg button.ativo { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(15, 29, 58, .12); }
@media (min-width: 900px) {
  .quick { grid-template-columns: 2fr 1.4fr 110px auto auto; }
  .quick [name=produto] { grid-column: auto; }
}
.quick-linha { display: grid; grid-template-columns: 1fr 100px auto; gap: 6px; margin-top: 8px; }
.quick-linha input { padding: 8px 11px; }

details.cat {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line-soft);
  margin-bottom: 12px; overflow: hidden;
}
details.cat > summary, details.prod > summary { list-style: none; cursor: pointer; }
details.cat > summary::-webkit-details-marker, details.prod > summary::-webkit-details-marker { display: none; }
details.cat > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; font-weight: 800; font-size: 17px; }
details.cat > summary:hover { background: #fcfbf8; }
details.cat[open] > summary { border-bottom: 1px solid var(--line-soft); }
.cat-n { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; color: var(--muted); }
.chev { display: inline-block; font-size: 20px; line-height: 1; color: var(--muted); transition: transform .15s; }
details[open] > summary .chev { transform: rotate(90deg); }
.cat-corpo { padding: 4px 12px 10px; }
.cat-dica { font-size: 13px; color: var(--green-ink); background: var(--green-soft); border-radius: 12px; padding: 9px 12px; margin: 8px 0 4px; }
details.prod { border-bottom: 1px solid var(--line-soft); }
details.prod:last-child { border-bottom: 0; }
details.prod > summary { display: grid; grid-template-columns: 1fr auto 18px; gap: 10px; align-items: center; padding: 12px 6px; border-radius: 12px; }
details.prod > summary:hover { background: #faf8f3; }
.prod-nome { font-weight: 700; }
.prod-melhor { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prod-melhor small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.prod-melhor.sem { font-weight: 500; color: var(--muted); font-size: 13px; }
.prod-corpo { background: #faf8f3; border: 1px solid var(--line-soft); border-radius: 14px; padding: 8px 11px 11px; margin: 0 0 10px; }
.prod-acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.precos-tab { width: 100%; border-collapse: separate; border-spacing: 0 3px; font-size: 14px; }
.precos-tab td { padding: 7px 6px; vertical-align: middle; }
.precos-tab tr.melhor td { background: var(--green-soft); }
.precos-tab tr.melhor td:first-child { border-radius: 10px 0 0 10px; }
.precos-tab tr.melhor td:last-child { border-radius: 0 10px 10px 0; }
.precos-tab .loja { font-weight: 700; }
.precos-tab .quem { color: var(--muted); font-size: 12px; font-weight: 500; }
.economia { font-size: 12.5px; color: var(--green-ink); font-weight: 700; margin-top: 4px; }

/* =====================================================================
   Janela (modal) e formulários
   ===================================================================== */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-fundo { position: absolute; inset: 0; background: rgba(10, 20, 44, .5); backdrop-filter: blur(2px); animation: aparece .15s ease-out; }
.modal-caixa {
  position: relative; background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 24px 24px 0 0; padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(10, 20, 44, .25); animation: sobe .2s ease-out;
}
.modal-caixa::before { content: ""; display: block; width: 42px; height: 5px; border-radius: 3px; background: #dcd7cc; margin: -6px auto 12px; }
@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal-caixa { border-radius: 22px; }
  .modal-caixa::before { display: none; }
}
@keyframes sobe { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes aparece { from { opacity: 0; } to { opacity: 1; } }
.modal-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.modal-topo h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.btn-x { border: 0; background: var(--slate-soft); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; flex: none; color: var(--slate-ink); }
.btn-x:hover { background: #e2e7ef; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; }
.campo { display: flex; flex-direction: column; gap: 5px; grid-column: span 2; min-width: 0; }
.campo.meia { grid-column: span 1; }
.campo label, .campo .rot { font-size: 13px; font-weight: 700; color: #3a4558; }
.campo .ajuda { font-size: 12px; color: var(--muted); }
.campo input[type=text], .campo input[type=tel], .campo input[type=date], .campo input[type=time],
.campo input[type=number], .campo input[type=password], .campo select, .campo textarea {
  border: 1px solid #dcd6c9; border-radius: 12px; padding: 10px 12px; background: #fff; width: 100%; font-size: 16px; min-width: 0;
}
.campo textarea { min-height: 84px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29, 52, 102, .12); }
.opcoes-check { display: flex; flex-wrap: wrap; gap: 6px; }
.opcoes-check label {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dcd6c9; border-radius: 999px; padding: 6px 12px;
  font-weight: 600; font-size: 14px; cursor: pointer; background: #fff;
}
.opcoes-check label:has(input:checked) { background: var(--green-soft); border-color: #9fd6b9; color: var(--green-ink); }
.opcoes-check input { accent-color: var(--green); }
.linha-check { display: flex; align-items: center; gap: 9px; font-weight: 600 !important; cursor: pointer; }
.linha-check input { width: 19px; height: 19px; accent-color: var(--green); }
.form-rodape { grid-column: span 2; display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.form-rodape .dir { display: flex; gap: 8px; margin-left: auto; }
.form-aviso { grid-column: span 2; background: var(--slate-soft); border-radius: 12px; padding: 10px 13px; font-size: 13.5px; color: #33405a; }
.form-aviso.ouro { background: var(--gold-soft); }
.erro-form { grid-column: span 2; color: var(--red); font-size: 13.5px; font-weight: 600; }

/* =====================================================================
   Avisos e tela de senha
   ===================================================================== */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(10, 20, 44, .3); max-width: calc(100% - 30px); animation: sobe .2s ease-out;
}
.toast.erro { background: var(--red); }

.tela-senha { max-width: 400px; margin: 40px auto; text-align: center; }
.tela-senha .cartao { padding: 28px 24px; }
.tela-senha h2 { justify-content: center; font-size: 20px; }
.tela-senha input {
  width: 100%; border: 1px solid #dcd6c9; border-radius: 12px; padding: 12px 14px; font-size: 16px; margin: 14px 0 10px; text-align: center;
}
.tela-senha input:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(29, 52, 102, .12); }
.tela-senha .btn { padding: 11px 14px; }

/* =====================================================================
   Utilidades
   ===================================================================== */
.rodape-info { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 24px; }
.mt { margin-top: 12px; }
.direita { text-align: right; }
.texto-suave { color: var(--muted); }
.verde { color: var(--green); }
.vermelho { color: var(--red); }

/* =====================================================================
   Interações, animações e celular
   ===================================================================== */
html { -webkit-tap-highlight-color: transparent; }
button, summary, a, .mcel, .check, label { touch-action: manipulation; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Abas: nome comprido no computador, curto no celular */
.ab-sm { display: none; }
.ab-ic { display: inline-block; margin-right: 2px; }

/* Apertar botões: afunda de leve */
.btn, .chip-filtro, .abas button, .btn-icone, .check, .seg button, .btn-heroi, .btn-acesso, .btn-x, .mcel.clicavel, .opcoes-check label {
  transition: transform .12s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:active, .chip-filtro:active, .abas button:active, .btn-icone:active, .check:active, .seg button:active,
.btn-heroi:active, .btn-acesso:active, .btn-x:active, .mcel.clicavel:active, .opcoes-check label:active { transform: scale(.95); }
summary { transition: background-color .15s ease; -webkit-user-select: none; user-select: none; }
details > summary:active { background: #f3efe6; }

/* Troca de aba: o conteúdo entra subindo de leve */
.conteudo.anima > * { animation: entra .34s cubic-bezier(.2, .7, .2, 1) both; }
.conteudo.anima > *:nth-child(2) { animation-delay: .04s; }
.conteudo.anima > *:nth-child(3) { animation-delay: .08s; }
.conteudo.anima > *:nth-child(4) { animation-delay: .12s; }
.conteudo.anima > *:nth-child(5) { animation-delay: .16s; }
.conteudo.anima > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes entra { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Abrir caixas */
details[open] > .cat-corpo, details[open] > .prod-corpo, details[open] > .pes-corpo { animation: abre .22s ease-out; }
@keyframes abre { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Barras de progresso crescem */
.barra > span { animation: cresce .9s cubic-bezier(.2, .7, .2, 1); }
@keyframes cresce { from { width: 0; } }

/* Destaque do que acabou de mudar */
.destaque { animation: brilhoDestaque 1.3s ease-out; }
@keyframes brilhoDestaque {
  0% { box-shadow: 0 0 0 0 rgba(240, 180, 41, .75); }
  35% { box-shadow: 0 0 0 7px rgba(240, 180, 41, .28); }
  100% { box-shadow: 0 0 0 0 rgba(240, 180, 41, 0); }
}
.item-linha.destaque, details.prod.destaque > summary { animation: fundoDestaque 1.4s ease-out; border-radius: 12px; }
.item-linha.destaque { box-shadow: none; }
details.prod.destaque { animation: none; }
@keyframes fundoDestaque { from { background: var(--gold-soft); } to { background: transparent; } }
.item-linha.destaque .check.marcado { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 0% { transform: scale(.55); } 100% { transform: scale(1); } }

/* Janela: entra e sai */
.modal-caixa { padding: 18px 18px 0; }
.modal.fechando .modal-caixa { animation: desce .18s ease-in forwards; }
.modal.fechando .modal-fundo { animation: some .18s ease-in forwards; }
@keyframes desce { to { transform: translateY(40px); opacity: 0; } }
@keyframes some { to { opacity: 0; } }
@media (min-width: 640px) {
  .modal-caixa { animation: zoomEntra .18s ease-out; }
  .modal.fechando .modal-caixa { animation: zoomSai .16s ease-in forwards; }
}
@keyframes zoomEntra { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes zoomSai { to { transform: scale(.97); opacity: 0; } }

/* Botões Salvar/Cancelar sempre visíveis no fim da janela */
.form-rodape, .modal-caixa > div > .form-rodape {
  position: sticky; bottom: 0; z-index: 2; background: #fff;
  margin: 6px 0 0; padding: 12px 0 calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
}

/* Aviso (toast) */
.toast { animation: toastEntra .22s ease-out; }
.toast.saindo { animation: toastSai .2s ease-in forwards; }
@keyframes toastEntra { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastSai { to { opacity: 0; transform: translate(-50%, 10px); } }

/* Carregando */
.spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: -4px; margin-right: 8px;
  border: 2px solid rgba(15, 29, 58, .15); border-top-color: var(--navy); animation: gira .7s linear infinite;
}
.btn.carregando { position: relative; color: transparent !important; pointer-events: none; }
.btn.carregando::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: gira .7s linear infinite;
}
.btn:not(.prim).carregando::after { border-color: rgba(15, 29, 58, .18); border-top-color: var(--navy); }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- Quem pagou: uma linha por pessoa ---------- */
.legenda { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: -4px 4px 12px; }
.legenda span { display: inline-flex; align-items: center; gap: 5px; }
.pes-lista { padding: 4px 10px; }
details.pes { border-bottom: 1px solid var(--line-soft); }
details.pes:last-child { border-bottom: 0; }
details.pes > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto 18px;
  grid-template-areas: "nome st chev" "dots st chev"; gap: 5px 10px; align-items: center; padding: 12px 6px; border-radius: 12px;
}
details.pes > summary::-webkit-details-marker { display: none; }
details.pes > summary:hover { background: #faf8f3; }
.pes-nome { grid-area: nome; font-weight: 700; font-size: 15.5px; }
.pes-nome small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.pes-dots { grid-area: dots; display: flex; gap: 4px; flex-wrap: wrap; }
.pes-st { grid-area: st; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.pes-st small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
details.pes > summary .chev { grid-area: chev; }
.pes-corpo { padding: 2px 4px 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #e4e0d7; flex: none; }
.dot.ok { background: var(--green); }
.dot.parcial { background: #e3a008; }
.dot.pendente { background: var(--red); }
.dot.avencer { background: #9aa8c2; }
.dot.fora { background: #e9e5dc; }

/* ---------- Celular ---------- */
@media (max-width: 759px) {
  .topo-linha { padding: 10px 14px; }

  /* Abas viram barra fixa no rodapé, ao alcance do polegar */
  .abas {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: none; margin: 0;
    display: flex; gap: 2px; overflow: visible; justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(12, 24, 50, .97); border-top: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 -8px 24px rgba(11, 22, 48, .22);
  }
  .abas button {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 6px 2px 5px; border-radius: 14px; background: transparent; color: rgba(255, 255, 255, .62);
    font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  }
  .abas button .ab-ic { font-size: 20px; line-height: 1.15; margin: 0; filter: grayscale(.85); opacity: .75; transition: filter .2s, opacity .2s, transform .2s; }
  .abas button.ativa { background: rgba(240, 180, 41, .15); color: var(--gold); box-shadow: none; }
  .abas button.ativa .ab-ic { filter: none; opacity: 1; transform: translateY(-1px) scale(1.08); }
  .abas button:hover:not(.ativa) { background: transparent; }
  .ab-lg { display: none; }
  .ab-sm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  .conteudo { padding: 16px 12px calc(96px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  /* Toques maiores */
  .btn { min-height: 42px; }
  .btn.peq { min-height: 36px; padding: 6px 12px; }
  .btn-icone { min-width: 40px; min-height: 40px; font-size: 17px; }
  .chip-filtro { padding: 8px 14px; }
  .check { width: 30px; height: 30px; }
  .busca { max-width: none; flex: 1 1 100%; }
  .cabecalho-aba h1 { font-size: 22px; }
  .cabecalho-aba .acoes { width: 100%; }
  .cabecalho-aba .acoes .btn { flex: 1; justify-content: center; }
  .heroi { padding: 20px 18px 18px; border-radius: 22px; }
  .contagem { font-size: 42px; }
  .quick-linha { grid-template-columns: 1fr 96px 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   App instalado (iPhone/Android)
   ===================================================================== */
/* Barra de status do iPhone fica por cima do topo azul */
.topo { padding-top: env(safe-area-inset-top); }
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
}
.instalar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px 10px 12px 14px;
  background: var(--card); border: 1.5px solid var(--gold); border-radius: var(--r); box-shadow: var(--shadow);
}
.instalar-ic { width: 46px; height: 46px; border-radius: 12px; flex: none; box-shadow: 0 3px 10px rgba(15, 29, 58, .22); }
.instalar .detalhe { margin-top: 2px; line-height: 1.4; }
.ic-share { vertical-align: -3px; color: #0a84ff; }
.passos { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .passos { grid-template-columns: 1fr 1fr; } }
.passos-tit { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.passos ol { margin: 6px 0 0; padding-left: 20px; }
.passos li { margin: 5px 0; }

/* =====================================================================
   Entrada com nome + senha, conta e "sua parte"
   ===================================================================== */
.senha-wrap { position: relative; }
.senha-wrap input { padding-right: 50px !important; width: 100%; }
.ver-senha {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border: 0; background: transparent; border-radius: 10px; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: background-color .15s, color .15s, transform .12s;
}
.ver-senha:hover, .ver-senha.ativo { color: var(--navy); background: var(--slate-soft); }
.ver-senha:active { transform: translateY(-50%) scale(.9); }

.tela-senha-ic { width: 68px; height: 68px; border-radius: 17px; box-shadow: 0 8px 22px rgba(15, 29, 58, .28); }
.tela-senha h2 { margin: 14px 0 6px; }
.tela-senha form { text-align: left; margin-top: 8px; }
.tela-rot { display: block; font-size: 13px; font-weight: 700; color: #3a4558; margin: 14px 0 6px; }
.tela-senha input { margin: 0; text-align: left; }
.tela-senha .btn { width: 100%; justify-content: center; margin-top: 18px; }
.tela-senha .erro-form { margin-top: 12px; text-align: center; }

.btn-acesso { display: inline-flex; align-items: center; gap: 7px; }
.btn-acesso.com-nome { padding: 4px 13px 4px 4px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 11.5px; font-weight: 800; letter-spacing: .02em; background: rgba(255, 255, 255, .2); color: #fff;
}
.btn-acesso.logado .avatar { background: var(--navy); color: var(--gold); }
.avatar.grande { width: 54px; height: 54px; font-size: 19px; background: var(--slate-soft); color: var(--navy); }
.avatar.grande.ouro { background: var(--gold); color: var(--navy); }
.conta-perfil { display: flex; align-items: center; gap: 14px; margin: 2px 0 12px; }
@media (max-width: 440px) {
  .btn-acesso.com-nome { padding: 0; }
  .btn-acesso.com-nome .avatar { width: 30px; height: 30px; }
}

.heroi-ola { font-weight: 800; font-size: 17px; margin-bottom: 10px; color: #fff; }
.sua-parte { border: 1.5px solid #e9dcb5; }
.sp-linha { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14.5px; }
.sp-prox { margin: 10px 0 10px; font-size: 13.5px; color: var(--muted); }
.sp-prox b { color: var(--ink); }
/* Na tela de entrada não há abas */
.sem-login .abas { display: none !important; }
