/* CultoCheck · Igreja do Nazareno Aeronave
   Identidade: preto + branco + vermelho (inspirada no site e no Instagram), tipografia Source Sans. */

:root {
  color-scheme: light;
  --bg: #f6f6f6;
  --surface: #ffffff;
  --surface-2: #f0efec;
  --ink: #0b0b0b;
  --ink-2: #4b4a47;
  --muted: #898781;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;
  --wash: rgba(11, 11, 11, 0.05);
  --accent: #c8282e;
  --accent-ink: #b3191f;
  --accent-contrast: #ffffff;
  --good: #006300;
  --good-bg: #e3f3e1;
  --warn-bg: #fff3d1;
  --warn-ink: #6b4a00;
  --bad-bg: #fde4e4;
  --bad-ink: #9a1c1c;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.05);
  --radius: 14px;
  --font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #262624; --ink: #ffffff; --ink-2: #c3c2b7;
    --line: #2c2c2a; --line-strong: #383835; --wash: rgba(255, 255, 255, 0.07);
    --accent: #c8282e; --accent-ink: #ff7a7e;
    --good: #5fd35f; --good-bg: #17301a; --warn-bg: #3a2f10; --warn-ink: #ffd36b; --bad-bg: #3b1818; --bad-ink: #ff9a9a;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #262624; --ink: #ffffff; --ink-2: #c3c2b7;
  --line: #2c2c2a; --line-strong: #383835; --wash: rgba(255, 255, 255, 0.07);
  --accent: #c8282e; --accent-ink: #ff7a7e;
  --good: #5fd35f; --good-bg: #17301a; --warn-bg: #3a2f10; --warn-ink: #ffd36b; --bad-bg: #3b1818; --bad-ink: #ff9a9a;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.4;
  min-height: 100vh; min-height: 100dvh;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #000; padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Barra superior ---------- */
.topbar { background: #000; color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; }
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; color: #fff; text-decoration: none; }
.wm-small { font-size: 9.5px; letter-spacing: 0.22em; font-weight: 600; opacity: 0.85; }
.wm-script { font-family: "Mrs Saint Delafield", "Segoe Script", "Brush Script MT", cursive; font-size: 34px; line-height: 0.8; margin-top: 2px; }
.topbar .spacer { flex: 1; }
.who { font-size: 14px; opacity: 0.9; text-align: right; line-height: 1.15; }
.who b { display: block; font-size: 15px; }
.top-links { display: none; gap: 4px; margin-left: 16px; }
.top-links a { color: #fff; text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 8px; font-size: 16px; opacity: 0.8; }
.top-links a:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.top-links a[aria-current="page"] { opacity: 1; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.icon-btn { background: transparent; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 18px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--wash); }
.topbar .icon-btn { color: #fff; }
.topbar .icon-btn:hover { background: rgba(255, 255, 255, 0.14); }

main { max-width: 1180px; margin: 0 auto; padding: 16px 16px 112px; }
.page-title { font-size: 26px; font-weight: 700; margin: 4px 0 2px; }
.page-sub { color: var(--ink-2); margin-bottom: 14px; }

/* ---------- Navegação inferior (mobile) ---------- */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; text-align: center; text-decoration: none; color: var(--ink-2); padding: 8px 4px 9px; font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; justify-content: center; }
.bottomnav a .ico { font-size: 20px; line-height: 1; }
.bottomnav a[aria-current="page"] { color: var(--accent-ink); box-shadow: inset 0 3px 0 var(--accent); }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card h2, .card-title { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; }
.card .sub { color: var(--ink-2); font-size: 14px; margin: -6px 0 10px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 12px; border: 2px solid var(--ink); background: transparent; font-weight: 700; font-size: 17px; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--wash); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.dark { background: #000; color: #fff; border-color: #000; }
.btn.ghost { border-color: var(--line-strong); }
.btn.danger { background: #8e1b1b; color: #fff; border-color: #8e1b1b; }
.btn.wa { background: #1a7f43; border-color: #1a7f43; color: #fff; }
.btn.block { width: 100%; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 15px; border-radius: 10px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.btn-row .btn { flex: 1 1 140px; }
.link { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 700; text-decoration: underline; font-size: inherit; }

/* ---------- Formulários ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field > .lbl { display: block; font-weight: 700; margin-bottom: 4px; font-size: 16px; }
.field > .lbl .req { color: var(--accent-ink); }
.hint { color: var(--ink-2); font-size: 14px; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; min-height: 50px; padding: 10px 12px; border: 2px solid var(--line-strong); border-radius: 12px; background: var(--surface); font-size: 17px; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--wash); }
.input.err { border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-btn { display: flex; gap: 8px; }
.inline-btn .input { flex: 1; min-width: 0; }

/* Contadores */
.counter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.counter + .counter { margin-top: 10px; }
.counter .c-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.counter .c-name { font-weight: 700; font-size: 18px; }
.counter .c-hint { color: var(--ink-2); font-size: 14px; }
.counter .c-ctl { display: flex; gap: 10px; align-items: center; }
.counter .c-ctl .step { width: 60px; height: 60px; border-radius: 14px; border: 2px solid var(--ink); background: transparent; font-size: 30px; font-weight: 700; line-height: 1; flex: none; display: grid; place-items: center; }
.counter .c-ctl .step.plus { background: var(--ink); color: var(--bg); }
.counter .c-ctl .step:active { transform: scale(0.96); }
.counter .c-ctl input { flex: 1; min-width: 0; width: 100%; text-align: center; font-size: 34px; font-weight: 700; border: 2px solid var(--line-strong); background: var(--surface); border-radius: 14px; height: 60px; }
.counter .c-ctl input:focus { border-color: var(--ink); outline: none; }
.counter .c-ctl input::placeholder { color: var(--muted); }
.counter .c-quick { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 15px; min-height: 38px; }
.chip:hover { background: var(--wash); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.counter.big { border-width: 2px; border-color: var(--ink); }

/* Progresso do formulário */
.steps { display: flex; gap: 6px; margin: 4px 0 16px; }
.steps li { list-style: none; flex: 1; }
.steps button { width: 100%; border: 0; background: transparent; padding: 0; text-align: left; }
.steps .bar { display: block; height: 6px; border-radius: 3px; background: var(--line-strong); margin-bottom: 5px; }
.steps .done .bar { background: var(--ink); }
.steps .on .bar { background: var(--accent); }
.steps .nm { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: block; }
.steps .on .nm { color: var(--ink); }
.steps ol, .steps { padding: 0; margin-left: 0; }
.formbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.formbar-in { max-width: 680px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.formbar .tot { flex: 1; line-height: 1.1; font-size: 13px; color: var(--ink-2); }
.formbar .tot b { display: block; font-size: 24px; color: var(--ink); }
.formwrap { max-width: 680px; margin: 0 auto; }
.savestate { font-size: 13px; color: var(--ink-2); }

/* Alertas / selos */
.note { border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.note + .note { margin-top: 8px; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.bad { background: var(--bad-bg); color: var(--bad-ink); }
.note.good { background: var(--good-bg); color: var(--good); }
.note.info { background: var(--surface-2); color: var(--ink); }
.badge { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.live { background: var(--bad-bg); color: var(--bad-ink); }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .t { font-weight: 700; }
.list .s { color: var(--ink-2); font-size: 14px; }
.cult { display: flex; flex-direction: column; gap: 2px; }

/* Resumo (revisão) */
.sumtable { width: 100%; border-collapse: collapse; }
.sumtable th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 7px 0; font-size: 15px; }
.sumtable td { text-align: right; font-weight: 700; padding: 7px 0; }
.sumtable tr + tr { border-top: 1px solid var(--line); }
.miss td { color: var(--accent-ink); }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #000; color: #fff; }
.login-hero { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 32px 24px 24px; background: radial-gradient(120% 80% at 70% 0%, #6b2a14 0%, #1a0b06 45%, #000 100%); }
.login-hero .wm-script { font-size: 72px; }
.login-hero .wm-small { font-size: 13px; }
.login-hero h1 { font-size: 22px; margin-top: 20px; font-weight: 600; max-width: 18em; }
.login-hero p { color: #d9d6d0; margin-top: 6px; }
.login-box { background: var(--surface); color: var(--ink); padding: 22px 24px calc(24px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
.login-box .in { max-width: 420px; margin: 0 auto; }
.demo { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.demo p { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 84px; }
.pw-wrap button { position: absolute; right: 6px; top: 6px; min-height: 38px; }
@media (min-width: 820px) {
  .login { flex-direction: row; }
  .login-hero { flex: 1.2; justify-content: center; padding: 64px; }
  .login-box { flex: 1; border-radius: 0; display: flex; align-items: center; padding: 48px; }
  .login-box .in { width: 100%; }
}

/* ---------- Painel do pastor ---------- */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 14px; font-weight: 700; font-size: 16px; min-height: 42px; }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.datenav { display: flex; align-items: center; gap: 6px; }
.datenav .input { width: auto; min-height: 44px; font-weight: 700; }
.datenav .icon-btn { border: 2px solid var(--line-strong); border-radius: 12px; width: 44px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .k-l { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.kpi .k-v { font-size: 34px; font-weight: 700; line-height: 1.1; margin-top: 2px; }
.kpi .k-s { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.kpi.hero { grid-column: 1 / -1; background: #000; color: #fff; border-color: #000; }
.kpi.hero .k-l, .kpi.hero .k-s { color: #d9d6d0; }
.kpi.hero .k-v { font-size: 56px; }
.kpi.hero .hero-row { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 8px; }
.kpi.hero .hero-row div { min-width: 90px; }
.kpi.hero .hero-row b { font-size: 24px; display: block; line-height: 1.1; }
.kpi.hero .hero-row span { font-size: 13.5px; color: #d9d6d0; }
.delta { font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--accent-ink); }
.kpi.hero .delta.up { color: #7ee07e; }
.kpi.hero .delta.down { color: #ff9a9a; }
.delta.flat { color: var(--ink-2); }

.charts { display: grid; gap: 12px; margin-top: 12px; }
.chartcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 10px; box-shadow: var(--shadow); min-width: 0; }
.chartcard header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.chartcard h2 { font-size: 18px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); margin: 0; }
.chartcard .sub { color: var(--ink-2); font-size: 14px; margin: 2px 0 0; }
.chartcard .tbl-toggle { font-size: 14px; }
.chartcard .empty { padding: 40px 10px; text-align: center; color: var(--ink-2); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); margin: 4px 0 2px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.chart { width: 100%; position: relative; }
.chart svg { display: block; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-2); }
.chart .ax { font-size: 12px; fill: var(--ink-2); }
.chart .cat { font-size: 13.5px; fill: var(--ink); }
.chart .lbl { font-size: 13px; font-weight: 700; fill: var(--ink); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid-strong { stroke: var(--line-strong); stroke-width: 1; }
.chart .base { stroke: var(--line-strong); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .ring { stroke: var(--surface); stroke-width: 2; }
.chart .hit { touch-action: pan-y; }
.chart .band, .chart .rowbg { touch-action: pan-y; }
.tip { position: fixed; z-index: 60; background: #111; color: #fff; padding: 8px 10px; border-radius: 10px; font-size: 14px; pointer-events: none; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35); max-width: 260px; }
.tip-h { font-weight: 700; margin-bottom: 4px; }
.tip-r { display: flex; align-items: center; gap: 8px; }
.tip-r b { margin-left: auto; padding-left: 14px; }
.tip-x { color: #c9c6c0; margin-top: 4px; font-size: 13px; }
.tip .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.meter { margin: 12px 0; }
.meter .m-top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.meter .m-top b { font-size: 16px; }
.meter .track { height: 12px; background: var(--surface-2); border-radius: 6px; margin-top: 5px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 6px; background: var(--s1); }
.meter .m-bot { font-size: 13px; color: var(--ink-2); margin-top: 3px; }

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th { text-align: left; font-size: 13px; color: var(--ink-2); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--line-strong); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
table.data th.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tbody tr[tabindex] { cursor: pointer; }
table.data tbody tr[tabindex]:hover { background: var(--wash); }
table.data th button { background: none; border: 0; font: inherit; font-weight: 700; color: inherit; padding: 0; }

.daycards { display: grid; gap: 10px; margin-top: 12px; }
.daycard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.daycard .d-h { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.daycard .d-t { font-weight: 700; font-size: 19px; }
.daycard .d-s { color: var(--ink-2); font-size: 14px; }
.daycard .d-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.daycard .d-nums b { font-size: 22px; display: block; line-height: 1.1; }
.daycard .d-nums span { font-size: 12.5px; color: var(--ink-2); }

/* Histórico em cartões (mobile) */
.hcards { display: grid; gap: 10px; }
.hcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-align: left; width: 100%; }
.hcard .h-top { display: flex; justify-content: space-between; gap: 8px; }
.hcard .h-nums { display: flex; gap: 16px; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.hcard .h-nums b { color: var(--ink); font-size: 17px; }

/* Folha / modal */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; max-height: 92vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 8px 4px 20px; }
.sheet-head h2 { font-size: 20px; }
.sheet-body { overflow: auto; padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet-text { margin-bottom: 4px; }
@media (min-width: 820px) {
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 20px; }
}
.fileira { display: grid; grid-template-columns: 1fr 116px 44px; gap: 8px; align-items: center; margin-bottom: 8px; }
.fileira .input { text-align: center; font-weight: 700; font-size: 20px; }

#toasts { position: fixed; left: 0; right: 0; bottom: 84px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 70; pointer-events: none; padding: 0 16px; }
.toast { background: #111; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35); transition: opacity 0.3s; max-width: 480px; }
.toast.good { background: #14683a; }
.toast.out { opacity: 0; }

.success { text-align: center; padding: 28px 8px 8px; }
.success .big { font-size: 64px; }
.success h1 { font-size: 26px; margin: 8px 0; }
.empty-state { text-align: center; color: var(--ink-2); padding: 28px 10px; }
.metaform .field { margin-top: 10px; }
.logline { font-size: 14px; border-top: 1px solid var(--line); padding: 8px 0; color: var(--ink-2); }
.logline b { color: var(--ink); }

/* ---------- Responsivo ---------- */
@media (min-width: 820px) {
  .top-links { display: flex; }
  .bottomnav { display: none; }
  main { padding-bottom: 48px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .kpi.hero { grid-column: span 2; grid-row: span 2; }
  .charts { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: auto 1fr; align-items: center; }
  .filters .chips { grid-column: 1 / -1; }
  .daycards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  #toasts { bottom: 24px; }
}
@media (min-width: 820px) { .hcards { display: none; } }
@media (max-width: 819px) { .tablewrap.desk { display: none; } }

/* ---------- Impressão (relatório para o pastor em PDF) ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .topbar, .bottomnav, .filters .seg, .datenav button, .noprint, .tbl-toggle, .formbar { display: none !important; }
  main { padding: 0; max-width: none; }
  .card, .chartcard, .kpi, .daycard { box-shadow: none; break-inside: avoid; }
  .kpi.hero { background: #fff; color: #000; border: 2px solid #000; }
  .kpi.hero .k-l, .kpi.hero .k-s, .kpi.hero .hero-row span { color: #333; }
  .charts { grid-template-columns: 1fr 1fr; }
  .printhead { display: block !important; }
}
.printhead { display: none; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Correções de celular (iOS/Android) ---------- */
.grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid2 > *, .field, .card { min-width: 0; }
input[type="date"], input[type="time"], input[type="month"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%; min-width: 0;
  text-align: left; line-height: 1.2;
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
@media (max-width: 480px) {
  main { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px 12px; }
  .grid2 { gap: 8px; }
  .counter .c-ctl { gap: 8px; }
  .counter .c-ctl .step { width: 54px; height: 54px; }
  .topbar-in { gap: 8px; padding: 8px 12px; }
  .who { font-size: 12.5px; } .who b { font-size: 14px; }
  .filters .row.wrap { gap: 8px; }
  .seg button { padding: 8px 10px; font-size: 15px; }
  .datenav { flex-wrap: wrap; }
  .datenav .input { flex: 1 1 140px; }
}

/* ---------- Usuários (pastor) e avisos ---------- */
.toast.bad { background: #8e1b1b; }
.dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1; }
.bottomnav a .dot { position: absolute; margin: -4px 0 0 14px; }
.bottomnav a { position: relative; }
.ulist { display: grid; gap: 10px; }
.ucard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.ucard .u-top { display: flex; gap: 8px; align-items: flex-start; }
.ucard .u-n { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.ucard .u-e, .ucard .u-m { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.ucard .u-m { margin-top: 4px; }
.ucard .u-a { margin-top: 10px; align-items: center; }
.ucard .u-a .btn { flex: 0 1 auto; }
@media (min-width: 820px) { .ulist { grid-template-columns: 1fr 1fr; } }
