/* Layout: barra do topo com a igreja e o menu; no celular, menu fixo embaixo com o
   botão de ler QR no centro. Conteúdo em uma coluna com cartões e listas. */
:root {
  --bg: #eef1ef;
  --surface: #ffffff;
  --surface-2: #f5f7f6;
  --ink: #18201d;
  --muted: #5a6762;
  --line: #d3dbd7;
  --accent: #7a1f3d;
  --accent-ink: #ffffff;
  --accent-soft: #f6e9ee;
  --ok: #1d6a44;
  --ok-soft: #e1f0e7;
  --warn: #85560a;
  --warn-soft: #faefd8;
  --info: #1d4e89;
  --info-soft: #e4edf8;
  --danger: #a3262b;
  --danger-soft: #fae6e6;
  --desk: #dde3e0;
  --focus: #1d4e89;
  --shadow: 0 1px 2px rgba(20, 32, 27, .08), 0 10px 28px rgba(20, 32, 27, .07);
  --paper-shadow: 0 1px 3px rgba(20, 32, 27, .18), 0 14px 34px rgba(20, 32, 27, .14);

  --f-display: "Literata", Georgia, "Times New Roman", serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r: 10px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --altura-navbaixo: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101513;
    --surface: #171d1a;
    --surface-2: #1d2521;
    --ink: #e3eae6;
    --muted: #9aa8a2;
    --line: #2d3833;
    --accent: #e8899f;
    --accent-ink: #2a0b16;
    --accent-soft: #3a1d27;
    --ok: #86d3a6;
    --ok-soft: #173326;
    --warn: #f0c26e;
    --warn-soft: #3a2e14;
    --info: #8ab8f0;
    --info-soft: #18263a;
    --danger: #f19a9d;
    --danger-soft: #3d1a1c;
    --desk: #0b0f0d;
    --focus: #8ab8f0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .3);
    --paper-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 14px 34px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Casca ---------- */
.topo {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topo__dentro {
  max-width: 1100px;
  margin: 0 auto;
  padding-block: 8px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.marca__logo {
  width: 36px; height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.marca__logo img { max-width: 100%; max-height: 100%; }
.marca__logo .mono-logo { width: 30px; height: 30px; font-size: 11px; }
.marca__texto { min-width: 0; }
.marca__nome {
  display: block;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.marca__sub { display: block; font-size: .74rem; color: var(--muted); }

.menu { display: flex; gap: 2px; margin-left: auto; }
.menu a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
}
.menu a:hover { background: var(--surface-2); color: var(--ink); }
.menu a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.menu svg, .navbaixo svg { width: 20px; height: 20px; flex: none; }
.usuario { display: flex; align-items: center; gap: 4px; }
.usuario__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}
.usuario__btn svg { width: 19px; height: 19px; }
.usuario__btn:hover, .usuario__btn[aria-current="page"] { color: var(--accent); border-color: var(--accent); }

.conteudo {
  max-width: 1100px;
  margin: 0 auto;
  padding-block: 20px 48px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  outline: none;
  min-height: 60vh;
}

.navbaixo { display: none; }

@media (max-width: 860px) {
  .menu { display: none; }
  .usuario { margin-left: auto; }
  .conteudo { padding-bottom: calc(var(--altura-navbaixo) + 32px + env(safe-area-inset-bottom, 0px)); }
  .navbaixo {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 4px var(--gutter-r) calc(4px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
    min-height: var(--altura-navbaixo);
  }
  .navbaixo a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 6px 2px;
    text-decoration: none;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 600;
  }
  .navbaixo a[aria-current="page"] { color: var(--accent); }
  .navbaixo .navbaixo__ler {
    width: 58px; height: 58px;
    margin: -22px auto 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    align-content: center;
    box-shadow: var(--shadow);
  }
  .navbaixo .navbaixo__ler svg { width: 26px; height: 26px; }
  .navbaixo .navbaixo__ler[aria-current="page"] { color: var(--accent-ink); }
}

/* ---------- Tela ---------- */
.tela { display: grid; gap: 18px; }
.cabecalho {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.cabecalho__texto { display: grid; gap: 4px; min-width: 0; }
.voltar { font-size: .85rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.voltar:hover { color: var(--ink); }
.titulo { font-family: var(--f-display); font-size: 1.6rem; line-height: 1.15; }
.subtitulo { color: var(--muted); font-size: .92rem; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.secao { display: grid; gap: 12px; }
.secao__titulo { font-family: var(--f-display); font-size: 1.12rem; }
.carregando { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, background-color .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn--primario { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primario:hover { border-color: var(--ink); }
.btn--perigo { color: var(--danger); border-color: var(--danger); background: var(--surface); }
.btn--perigo-cheio { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--pequeno { min-height: 34px; padding: 0 12px; font-size: .85rem; }
.btn--bloco { width: 100%; }
.btn--grande { min-height: 52px; font-size: 1rem; padding: 0 20px; }
.link-btn {
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
}

/* ---------- Formulários ---------- */
.form { display: grid; gap: 14px; }
.form__linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.campo { display: grid; gap: 5px; min-width: 0; }
.campo__rotulo {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.campo__rotulo i { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }
.campo__ajuda { font-size: .8rem; color: var(--muted); }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], input[type="search"],
input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 1rem;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
textarea { resize: vertical; line-height: 1.4; }
.separador { padding-top: 14px; border-top: 1px solid var(--line); }
.campo-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.campo-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.campo-check > span { display: grid; gap: 2px; }
.equipe { display: grid; gap: 2px; }
.equipe__item { display: flex; align-items: center; gap: 10px; min-height: 38px; cursor: pointer; }
.equipe__item input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.equipe__item small { margin-left: auto; }
.form-erro {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 600;
  font-size: .9rem;
}
.money {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  min-width: 0;
}
.money:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.money input { border: 0; background: transparent; outline: none; padding-left: 4px; font-family: var(--f-mono); font-weight: 600; }
.money__cur { padding-left: 11px; color: var(--muted); font-family: var(--f-mono); font-size: .9em; }
.money--lg input { font-size: 1.3rem; min-height: 50px; }

.opcoes { display: flex; flex-wrap: wrap; gap: 8px; }
.opcao {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: .9rem;
}
.opcao[aria-pressed="true"], .opcao[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.opcao__cor { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.opcao--cor[aria-checked="true"] { background: var(--surface); color: var(--ink); border-color: var(--ink); }

/* barras de arrastar */
.slider { display: grid; gap: 6px; }
.slider__topo { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.slider__escala { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); font-family: var(--f-mono); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper input[type="number"] {
  width: 76px;
  text-align: center;
  font-family: var(--f-mono);
  font-weight: 600;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .money { width: 140px; }
.stepper .money input { text-align: right; padding-right: 8px; min-height: 42px; }
.stepper__btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.stepper__btn:hover { border-color: var(--accent); color: var(--accent); }
.range {
  --p: 50%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  background: transparent;
  cursor: grab;
  touch-action: pan-y;
}
.range::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--p), var(--line) var(--p)); }
.range::-moz-range-track { height: 10px; border-radius: 999px; background: var(--line); }
.range::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--accent); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.range--fino { height: 24px; }
.range--fino::-webkit-slider-runnable-track { height: 6px; }
.range--fino::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6px; border-width: 2px; }

.conta {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  font-variant-numeric: tabular-nums;
  display: grid;
  gap: 2px;
}
.conta b { font-family: var(--f-mono); }
.conta__grande { font-size: 1.15rem; }

/* logo */
.logo-drop {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  cursor: pointer;
}
.logo-drop:hover, .logo-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.logo-drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.logo-drop__previa {
  width: 58px; height: 58px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.logo-drop__previa img { max-width: 100%; max-height: 100%; }
.logo-drop__previa .mono-logo { width: 46px; height: 46px; font-size: 15px; }
.logo-drop__texto { display: grid; font-size: .85rem; color: var(--muted); }
.logo-drop__texto b { color: var(--ink); }

/* ---------- Cartões, números, listas ---------- */
.cartao {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 16px 18px;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.cartao--destaque { border-color: var(--accent); box-shadow: var(--shadow); }
.cartao__titulo { font-family: var(--f-display); font-size: 1.08rem; }
.cor-ponto { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
a.cartao { text-decoration: none; transition: border-color .15s; }
a.cartao:hover { border-color: var(--accent); }
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; align-items: start; }
.grade--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }

.kpis { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kpi { min-width: 0; }
.kpi dt { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi dd { margin: 2px 0 0; font-family: var(--f-mono); font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi dd small { font-size: .72rem; color: var(--muted); font-weight: 400; }
.kpi--ok dd { color: var(--ok); }
.kpi--warn dd { color: var(--warn); }

.progresso { display: grid; gap: 6px; }
.progresso__texto { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.barra { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.barra__fill { display: block; height: 100%; background: var(--ok); }

.pilula {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid currentColor;
}
.pilula::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pilula--disponivel { color: var(--muted); }
.pilula--disponivel::before { background: transparent; border: 1.5px solid currentColor; }
.pilula--em_dia, .pilula--pendente { color: var(--info); background: var(--info-soft); }
.pilula--atrasado, .pilula--atrasada { color: var(--warn); background: var(--warn-soft); }
.pilula--quitado, .pilula--paga { color: var(--ok); background: var(--ok-soft); }
.pilula--encerrada { color: var(--muted); }

.lista { display: grid; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  min-width: 0;
}
.item:first-child { border-top: 0; }
a.item:hover { background: var(--surface-2); }
.item--apagada { grid-template-columns: auto minmax(0, 1fr) auto; }
.item--apagada .item__titulo { color: var(--ink); }
.item--botao { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer; }
.item--botao:first-child { border-top: 0; }
.item--botao:hover { background: var(--surface-2); }
.form--recuo { margin-top: 10px; }
.item__num { font-family: var(--f-mono); font-weight: 600; color: var(--muted); font-size: .9rem; }
.item__principal { min-width: 0; }
.item__titulo { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__detalhe { display: block; font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__lado { display: grid; justify-items: end; gap: 3px; text-align: right; }
.lista__mais { padding: 12px; text-align: center; border-top: 1px solid var(--line); }

.filtros { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
}
a.chip { text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip b { font-family: var(--f-mono); font-weight: 600; margin-left: 3px; }
.busca { flex: 1 1 220px; }

.vazio {
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
  border: 1.5px dashed var(--line);
  border-radius: var(--r);
  display: grid;
  gap: 10px;
  justify-items: center;
}
.aviso {
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--info-soft);
  border: 1px solid var(--info);
  display: grid;
  gap: 8px;
}
.aviso--warn { background: var(--warn-soft); border-color: var(--warn); }
.aviso--ok { background: var(--ok-soft); border-color: var(--ok); }
.aviso--erro { background: var(--danger-soft); border-color: var(--danger); }
.aviso b { font-weight: 700; }

.pares { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; }
.pares dt { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pares dd { margin: 1px 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* folhas do carnê */
.folhas { display: grid; gap: 8px; }
.folha-linha {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}
a.folha-linha:hover { border-color: var(--accent); }
.folha-linha__num { font-family: var(--f-mono); font-weight: 700; font-size: 1.05rem; }
.folha-linha--paga { background: var(--ok-soft); border-color: transparent; }

.historico { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .88rem; }
.historico li { display: grid; gap: 1px; padding-left: 12px; border-left: 2px solid var(--line); }
.historico small { color: var(--muted); }

/* tabelas (relatórios) */
.tabela-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.tabela { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tabela th {
  text-align: left;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tabela td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .num { text-align: right; font-family: var(--f-mono); white-space: nowrap; }
.tabela .nowrap { white-space: nowrap; }
.tabela tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.tabela a { color: var(--accent); }
.whats { color: var(--ok) !important; font-weight: 600; white-space: nowrap; }

/* ---------- Leitor de QR ---------- */
.camera {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 3 / 4;
  max-height: 62vh;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera__mira {
  position: absolute;
  inset: 18% 14%;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.camera__status {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: .88rem;
  text-align: center;
}
.codigo-manual { display: flex; gap: 8px; align-items: flex-end; max-width: 480px; width: 100%; margin: 0 auto; }
.codigo-manual .campo { flex: 1; }
.codigo-manual input { text-transform: uppercase; font-family: var(--f-mono); letter-spacing: .06em; }

/* ---------- Prévia de impressão ---------- */
.mesa {
  border-radius: 14px;
  background: var(--desk);
  padding: 18px clamp(10px, 2.5vw, 28px) 28px;
  display: grid;
  gap: 16px;
  min-width: 0;
}
.folhas-a4 { --scale: .6; display: flex; flex-wrap: wrap; justify-content: center; gap: 26px 22px; min-width: 0; }
.a4 { display: grid; gap: 6px; justify-items: start; }
.a4__rotulo { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.a4__caixa { width: calc(210mm * var(--scale)); height: calc(297mm * var(--scale)); overflow: hidden; box-shadow: var(--paper-shadow); background: #fff; }
.a4__caixa > .sheet { transform: scale(var(--scale)); transform-origin: 0 0; }
.zoom { display: flex; align-items: center; gap: 10px; }
.zoom .range { width: 130px; }

/* ---------- Login ---------- */
.entrada {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding-block: 32px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.entrada__caixa { width: min(100%, 420px); display: grid; gap: 18px; }
.entrada__marca { display: grid; justify-items: center; gap: 10px; text-align: center; }
.entrada__marca .marca__logo { width: 64px; height: 64px; border-radius: 14px; }
.entrada__marca .mono-logo { width: 54px; height: 54px; font-size: 18px; }

/* logo sem imagem: iniciais (também usada no papel) */
.mono-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--c, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1;
}

/* ---------- Aviso flutuante ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 50;
  width: max-content;
  max-width: min(92vw, 520px);
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  font-size: .92rem;
  box-shadow: var(--shadow);
}
.toast--erro { background: var(--danger); color: #fff; }
@media (max-width: 860px) {
  .toast { bottom: calc(var(--altura-navbaixo) + 18px + env(safe-area-inset-bottom, 0px)); }
}

.so-impressao { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Impressão de relatórios ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .topo, .navbaixo, .toast, .nao-imprimir { display: none !important; }
  .so-impressao { display: block; }
  .conteudo { padding: 0; max-width: none; }
  .tabela-wrap, .cartao, .lista { border-color: #bbb; box-shadow: none; overflow: visible; }
  .tabela { font-size: 8.5pt; }
  .tabela th { background: #eee; color: #000; }
  .tabela tr { break-inside: avoid; }
  a { text-decoration: none; color: inherit !important; }
}

/* ---------- Consulta pública (consulta.html) ---------- */
.consulta {
  max-width: 560px;
  margin: 0 auto;
  padding-block: calc(24px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  display: grid;
  gap: 16px;
}
.consulta__topo { display: flex; align-items: center; gap: 12px; }
.consulta__topo .marca__logo { width: 48px; height: 48px; border-radius: 10px; }
.consulta__topo .mono-logo { width: 40px; height: 40px; font-size: 14px; }
.consulta__igreja { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.consulta__valor { font-size: 1.3rem; }
.consulta__estado b { font-size: 1.05rem; }
.folha-linha--atual { outline: 2px solid var(--accent); outline-offset: 1px; }
