/* ==========================================================================
   Confessômetro — folha de estilo
   Paleta penitencial: roxo litúrgico + dourado. Público: roxo / rosa / azul.
   ========================================================================== */

:root {
  /* Marca */
  --purple-950: #1E0E3D;
  --purple-900: #2A1352;
  --purple-800: #3A1D6E;
  --purple-700: #4C2A8C;
  --purple-600: #5E3AA6;
  --purple-500: #7048C2;
  --purple-200: #D9CBEF;
  --purple-100: #EEE8F7;
  --lilac: #F5F1FA;
  --gold: #E6B54A;
  --gold-600: #C9962B;
  --gold-200: #F7E6B8;

  /* Público (validado para daltonismo) */
  --men: #6A45B5;
  --women: #D94F7A;
  --children: #2E8FD6;
  --men-soft: #EFEAF8;
  --women-soft: #FBEAF0;
  --children-soft: #E8F2FC;

  /* Tinta e superfícies */
  --ink: #1C1233;
  --ink-2: #5A5074;
  --ink-3: #8C82A6;
  --line: #E3DCEF;
  --line-2: #EFEAF6;
  --surface: #FFFFFF;
  --bg: var(--lilac);
  --danger: #C6373F;
  --danger-soft: #FBE8E9;
  --ok: #2E8B57;

  --shadow: 0 8px 24px rgba(58, 29, 110, 0.08), 0 1px 2px rgba(58, 29, 110, 0.06);
  --shadow-lg: 0 18px 48px rgba(42, 19, 82, 0.18);
  --radius: 20px;
  --radius-sm: 12px;
  --maxw: 520px;
  --tabbar-h: 66px;

  --font-display: "Sora", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Plus Jakarta Sans", "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--purple-700); }
svg { display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   Casca do app
   -------------------------------------------------------------------------- */

#app {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line);
}
@media (min-width: 560px) {
  #app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(42, 19, 82, 0.12); }
}

.screen {
  padding: 18px 18px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}
.screen.no-tabbar { padding-bottom: 32px; }

/* Textura de anéis concêntricos: assinatura visual do app */
.rings {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.rings::before {
  content: "";
  position: absolute;
  inset: -40% -30% auto auto;
  width: 120%;
  aspect-ratio: 1;
  background: repeating-radial-gradient(circle at center, rgba(255,255,255,0.05) 0 1px, transparent 1px 22px);
  pointer-events: none;
  z-index: -1;
}

/* Barra superior */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--purple-900), var(--purple-700));
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.appbar-in {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: 60px;
}
.logo-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.logo-mark svg { width: 100%; height: 100%; }
.appbar-title { flex: 1; min-width: 0; line-height: 1.15; }
.appbar-title b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.appbar-title small { display: block; font-size: 12px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.08);
  color: #fff; border-radius: 999px;
  padding: 7px 12px; font-size: 13px; font-weight: 600;
}
.appbar-btn svg { width: 16px; height: 16px; }

/* Barra de abas inferior */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, var(--maxw));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  z-index: 30;
}
.tabbar button {
  border: 0; background: transparent; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  position: relative;
}
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.active { color: var(--purple-700); }
.tabbar button.active::after {
  content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold);
}

/* --------------------------------------------------------------------------
   Tipografia e blocos
   -------------------------------------------------------------------------- */

.h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}
.rule { width: 44px; height: 4px; border-radius: 2px; background: var(--gold); margin: 12px 0; }
.center { text-align: center; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 24px; } .mt-6 { margin-top: 32px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { font-variant-numeric: tabular-nums; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.section-head .h3 { font-size: 15px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card.tight { padding: 14px 16px; }
.card + .card { margin-top: 12px; }

/* Painel roxo (herói) */
.panel {
  background: linear-gradient(140deg, var(--purple-900) 0%, var(--purple-700) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-lg);
}
.panel .eyebrow { color: rgba(255,255,255,0.72); }
.panel .rule { background: var(--gold); }
.panel-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 6px;
}
.panel-sub { font-size: 13px; opacity: 0.85; margin-top: 8px; }
.panel-icon {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--gold); color: var(--gold);
  display: grid; place-items: center; margin-bottom: 12px;
}
.panel-icon svg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Botões, campos e chips
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: transform 0.08s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--purple-800); color: #fff; box-shadow: 0 6px 16px rgba(58, 29, 110, 0.28); }
.btn-primary:hover { background: var(--purple-700); }
.btn-gold { background: var(--gold); color: var(--purple-950); box-shadow: 0 6px 16px rgba(230, 181, 74, 0.35); }
.btn-gold:hover { background: #EFC25F; }
.btn-outline { background: var(--surface); color: var(--purple-800); border-color: var(--line); }
.btn-outline:hover { background: var(--purple-100); }
.btn-light { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.35); }
.btn-light:hover { background: rgba(255,255,255,0.18); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: #F7D9DB; }
.btn-sm { min-height: 40px; font-size: 14px; padding: 0 14px; border-radius: 12px; width: auto; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.link {
  background: none; border: 0; padding: 8px 4px;
  color: var(--purple-700); font-weight: 600; font-size: 14px;
  text-decoration: underline; text-decoration-color: var(--purple-200); text-underline-offset: 3px;
}
.link-light { color: #fff; text-decoration-color: rgba(255,255,255,0.4); }
.link.danger { color: var(--danger); text-decoration-color: #F0BABF; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, select.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
}
.input:focus { outline: none; border-color: var(--purple-600); box-shadow: 0 0 0 4px rgba(94, 58, 166, 0.14); }
.input::placeholder { color: #B3ABC6; }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A5074' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}
input[type="date"].input, input[type="datetime-local"].input { padding-right: 10px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: transparent; color: var(--ink-3); border-radius: 8px;
  display: grid; place-items: center;
}
.eye svg { width: 20px; height: 20px; }
.form-error {
  background: var(--danger-soft); color: var(--danger);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 12px;
}
.form-error:empty { display: none; }
.form-ok { background: #E4F4EA; color: #1E6B3E; border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
}
.chip.active { background: var(--purple-800); border-color: var(--purple-800); color: #fff; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
}
.tag-H { background: var(--men-soft); color: var(--men); }
.tag-M { background: var(--women-soft); color: var(--women); }
.tag-C { background: var(--children-soft); color: var(--children); }
.tag-off { background: var(--line-2); color: var(--ink-3); }
.tag-gold { background: var(--gold-200); color: #7A5A10; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-H { background: var(--men); } .dot-M { background: var(--women); } .dot-C { background: var(--children); }

/* --------------------------------------------------------------------------
   Boas-vindas e login
   -------------------------------------------------------------------------- */

.welcome {
  min-height: 100dvh;
  background: linear-gradient(160deg, var(--purple-950) 0%, var(--purple-800) 60%, var(--purple-700) 100%);
  color: #fff;
  display: flex; flex-direction: column;
  padding: calc(28px + env(safe-area-inset-top)) 26px calc(28px + env(safe-area-inset-bottom));
}
.welcome::before { inset: -20% -40% auto auto; width: 140%; }
.welcome-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.welcome-logo { width: 116px; margin: 0 0 26px; }
.welcome .h1 { font-size: 34px; color: #fff; }
.welcome .lead { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--gold); }
.welcome .sub { color: rgba(255,255,255,0.82); margin-top: 10px; max-width: 34ch; }
.welcome .stack { margin-top: 32px; }
.welcome-foot { text-align: center; font-size: 12px; letter-spacing: 0.22em; text-transform: lowercase; color: rgba(255,255,255,0.55); margin-top: 26px; }

.auth {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--purple-900) 0, var(--purple-900) 220px, var(--bg) 220px);
  padding: calc(20px + env(safe-area-inset-top)) 18px 28px;
}
.auth-top { color: #fff; display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-top .logo-mark { width: 30px; height: 30px; }
.auth-top .back { background: transparent; border: 0; color: #fff; padding: 6px; margin-left: -6px; border-radius: 10px; }
.auth-top .back svg { width: 22px; height: 22px; }
.auth-title { color: #fff; margin-bottom: 18px; }
.auth-title .h2 { color: #fff; }
.auth-title p { color: rgba(255,255,255,0.78); margin-top: 4px; }
.auth .card { padding: 22px 20px; }

/* --------------------------------------------------------------------------
   Escolha de perfil
   -------------------------------------------------------------------------- */

.grid-priests { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.pcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 12px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.pcard:active { transform: scale(0.97); }
.pcard .pname { font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1.2; }
.pcard .puser { font-size: 12px; color: var(--ink-3); }
.pcard-admin { background: linear-gradient(140deg, var(--purple-100), #fff); border-style: dashed; border-color: var(--purple-200); }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--purple-800), var(--purple-600));
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.avatar.sm { width: 40px; height: 40px; font-size: 15px; margin: 0; }
.avatar.gold { background: var(--gold); color: var(--purple-950); }
.avatar.off { background: var(--line); color: var(--ink-3); }
.avatar svg { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   Registro de confissões
   -------------------------------------------------------------------------- */

.greet { margin-bottom: 6px; }
.greet .h2 { font-size: 24px; }
.greet p { color: var(--ink-2); font-size: 14px; }

/* Cartão de contagem: "−" pequeno à esquerda (bem separado) e toda a área restante é o "+" */
.kcard {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: stretch;
  background: var(--surface);
  border: 1.5px solid var(--k-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin-top: 12px;
}
.kcard::before {
  content: ""; position: absolute; left: -1.5px; top: 18px; bottom: 18px; width: 5px; border-radius: 0 4px 4px 0; background: var(--k);
}
.kcard.k-men { --k: var(--men); --k-soft: var(--men-soft); --k-border: rgba(106, 69, 181, 0.35); }
.kcard.k-women { --k: var(--women); --k-soft: var(--women-soft); --k-border: rgba(217, 79, 122, 0.4); }
.kcard.k-children { --k: var(--children); --k-soft: var(--children-soft); --k-border: rgba(46, 143, 214, 0.4); }
.kcard.k-uncao { --k: #B8860B; --k-soft: #FBF3DF; --k-border: rgba(184, 134, 11, 0.4); }
.kcard.k-visita { --k: #1F8A70; --k-soft: #E3F4EE; --k-border: rgba(31, 138, 112, 0.4); }
.kminus {
  border: 0; background: transparent; border-right: 1px dashed var(--line);
  border-radius: var(--radius) 0 0 var(--radius);
  display: grid; place-items: center; color: var(--ink-3);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.kminus span {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; background: var(--surface);
}
.kminus svg { width: 14px; height: 14px; }
.kminus:hover, .kminus:active { background: var(--danger-soft); color: var(--danger); }
.kminus:active span { border-color: var(--danger); }
.kmain {
  border: 0; background: transparent; text-align: left;
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 14px;
  padding: 16px 16px 16px 12px; border-radius: 0 var(--radius) var(--radius) 0;
  transition: transform 0.08s ease;
}
.kmain:active { transform: scale(0.985); }
.kicon { width: 56px; height: 56px; border-radius: 16px; background: var(--k-soft); color: var(--k); display: grid; place-items: center; }
.kicon svg { width: 30px; height: 30px; }
.klabel { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.kcount { display: block; font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: -0.03em; color: var(--ink); margin-top: 2px; }
.kplus {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--k); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--k) 40%, transparent);
}
.kcard.compact .kmain { padding: 12px 14px 12px 10px; grid-template-columns: 44px 1fr auto; }
.kcard.compact .kicon { width: 44px; height: 44px; border-radius: 12px; }
.kcard.compact .kicon svg { width: 24px; height: 24px; }
.kcard.compact .kcount { font-size: 26px; }
.kcard.compact .kplus { width: 38px; height: 38px; font-size: 22px; }
.kcard.shake { animation: shake 0.3s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
.kcard.pulse::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; pointer-events: none;
  border: 2px solid var(--k);
  animation: ring 0.55s ease-out forwards;
}
@keyframes ring {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.06); }
}
.kcount.bump { animation: bump 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.total-panel { margin-top: 16px; }
.total-panel .row { margin-top: 14px; gap: 8px; }
.total-panel .btn { flex: 1; white-space: nowrap; }

/* Histórico */
.day-group { margin-top: 18px; }
.day-group .eyebrow { margin-bottom: 8px; }
.hist-row {
  display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 14px;
  margin-bottom: 8px;
}
.hist-row .time { font-family: var(--font-display); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.hist-row .who { font-size: 12px; color: var(--ink-3); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-3);
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--line-2); color: var(--danger); }
.icon-btn svg { width: 18px; height: 18px; }

/* Lista de padres */
.prow {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 12px 14px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.prow .pname { font-weight: 700; font-family: var(--font-display); font-size: 15px; }
.prow .pmeta { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prow.off { opacity: 0.7; }
.menu { display: grid; gap: 4px; }
.menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 13px 10px; border-radius: 12px; font-weight: 600; font-size: 15px;
}
.menu button:hover { background: var(--purple-100); }
.menu button svg { width: 20px; height: 20px; color: var(--ink-3); }
.menu button.danger { color: var(--danger); }
.menu button.danger svg { color: var(--danger); }

/* Estado vazio */
.empty { text-align: center; padding: 28px 16px; color: var(--ink-2); }
.empty .glyph { width: 64px; height: 64px; border-radius: 20px; background: var(--purple-100); color: var(--purple-700); display: grid; place-items: center; margin: 0 auto 12px; }
.empty .glyph svg { width: 30px; height: 30px; }
.empty b { display: block; color: var(--ink); font-family: var(--font-display); font-size: 16px; margin-bottom: 4px; }

/* --------------------------------------------------------------------------
   Relatórios e gráficos
   -------------------------------------------------------------------------- */

.filters { margin: 4px 0 14px; }
.filters .grid-2 { margin-top: 8px; }
.filters .field { margin-bottom: 0; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 10px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--t, var(--purple-600));
}
.tile .tl { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.tile .tl svg { width: 14px; height: 14px; flex: 0 0 auto; }
.tile .tv { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin-top: 4px; line-height: 1.1; }
.tile .tp { font-size: 12px; color: var(--ink-2); margin-top: 2px; font-weight: 600; }
.tile.t-H { --t: var(--men); } .tile.t-M { --t: var(--women); } .tile.t-C { --t: var(--children); }
.tiles.four { grid-template-columns: repeat(2, 1fr); }

.insights { display: grid; gap: 10px; }
.insight { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.insight .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--purple-100); color: var(--purple-700); display: grid; place-items: center; }
.insight .ic svg { width: 18px; height: 18px; }
.insight b { display: block; font-family: var(--font-display); font-size: 15px; }
.insight span { font-size: 13px; color: var(--ink-2); }

.chart-card { padding: 16px 16px 12px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chart-head .h3 { font-size: 15px; }
.chart-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.chart-toggle { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); flex: 0 0 auto; }
.chart-toggle.active { background: var(--purple-100); border-color: var(--purple-200); color: var(--purple-800); }
.chart-body svg { width: 100%; height: auto; }
.chart-body svg text { font-family: var(--font-body); }
.chart-body .tick { font-size: 10.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart-body .xlab { font-size: 10.5px; fill: var(--ink-2); font-weight: 600; }
.chart-body .ylab { font-size: 11.5px; fill: var(--ink); font-weight: 600; }
.chart-body .val { font-size: 11px; fill: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-body .grid { stroke: var(--line-2); stroke-width: 1; }
.chart-body .axis { stroke: var(--line); stroke-width: 1; }
.chart-body .hit { cursor: pointer; }
.chart-body .hit:hover .bar, .chart-body .hit:focus .bar { filter: brightness(1.12); }
.chart-body .hit:focus { outline: none; }
.chart-body .hit:focus .bar { stroke: var(--gold); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); font-weight: 600; margin: 4px 0 8px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

/* Seletor de visão do gráfico (barras / pizza / tabela) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); flex: 0 0 auto; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.seg button svg { width: 14px; height: 14px; }
.seg button.active { background: var(--purple-100); color: var(--purple-800); }

/* Pizza (rosca) com legenda */
.pie-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
.pie-wrap svg { width: 150px; height: 150px; }
.pie-wrap .slice { transition: opacity 0.15s ease; }
.pie-wrap .hit:hover .slice, .pie-wrap .hit:focus .slice { opacity: 0.85; }
.pie-wrap .hit:focus { outline: none; }
.pie-center { font-family: var(--font-display); font-weight: 800; font-size: 22px; fill: var(--ink); }
.pie-center-lab { font-size: 9.5px; fill: var(--ink-3); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.pie-lab { font-size: 10px; font-weight: 700; fill: #fff; }
.pie-legend { display: grid; gap: 5px; font-size: 12.5px; min-width: 0; }
.pie-legend div { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; }
.pie-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pie-legend span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-weight: 600; }
.pie-legend b { font-variant-numeric: tabular-nums; }
.pie-legend em { font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 11.5px; min-width: 40px; text-align: right; }
@media (max-width: 360px) { .pie-wrap { grid-template-columns: 1fr; justify-items: center; } }

.tile.t-U { --t: #B8860B; } .tile.t-V { --t: #1F8A70; }
.dot-U { background: #B8860B; } .dot-V { background: #1F8A70; }
.tag-U { background: #FBF3DF; color: #7A5A10; } .tag-V { background: #E3F4EE; color: #1F6B57; }
.tag-admin { background: var(--purple-100); color: var(--purple-800); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 8px 8px; border-bottom: 1px solid var(--line-2); text-align: left; }
table.data th { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
table.data td.n, table.data th.n { text-align: right; font-variant-numeric: tabular-nums; }

.tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; line-height: 1.35;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2); max-width: 220px;
  opacity: 0; transition: opacity 0.12s ease;
}
.tip.show { opacity: 1; }
.tip b { font-family: var(--font-display); font-size: 14px; display: block; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.actions .btn { min-height: 46px; font-size: 13px; padding: 0 8px; }

/* Lista "hoje por padre" */
.today-list .row { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.today-list .row:last-child { border-bottom: 0; }
.today-list .n { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.mini-bars { display: flex; gap: 3px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line-2); margin-top: 6px; }
.mini-bars i { display: block; height: 100%; }

/* Ajustes */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.setting-row:last-child { border-bottom: 0; }
.setting-row b { font-family: var(--font-display); font-size: 15px; }
.setting-row span { font-size: 12px; color: var(--ink-3); display: block; }

/* --------------------------------------------------------------------------
   Folha inferior (sheet), diálogo e toast
   -------------------------------------------------------------------------- */

.sheet-root { position: fixed; inset: 0; z-index: 50; display: none; }
.sheet-root.open { display: block; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(30, 14, 61, 0.55); backdrop-filter: blur(2px); animation: fade 0.18s ease; }
.sheet {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, var(--maxw));
  max-height: 88dvh; overflow-y: auto;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(30, 14, 61, 0.25);
  animation: rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.sheet .h2 { font-size: 20px; margin-bottom: 4px; }
.sheet .lead { color: var(--ink-2); font-size: 14px; margin-bottom: 16px; }
.sheet-actions { display: grid; gap: 10px; margin-top: 8px; }
.sheet-actions.two { grid-template-columns: 1fr 1fr; }
@keyframes rise { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
  transform: translate(-50%, 10px);
  background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 16px;
  font-size: 13px; font-weight: 600; z-index: 70; opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.gold { background: var(--gold); color: var(--purple-950); }

.loading { min-height: 100dvh; display: grid; place-items: center; color: var(--purple-700); }
.loading .logo-mark { width: 64px; height: 64px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* --------------------------------------------------------------------------
   Impressão (Relatório em PDF)
   -------------------------------------------------------------------------- */

.print-only { display: none; }
@media print {
  body { background: #fff; }
  #app { max-width: none; box-shadow: none; }
  .appbar, .tabbar, .filters, .actions, .chart-toggle, .no-print, .toast, .sheet-root, .tip { display: none !important; }
  .print-only { display: block; margin-bottom: 14px; }
  .screen { padding: 0; }
  .card, .tile, .panel { box-shadow: none; break-inside: avoid; }
  .panel { color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tile, .kcard { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
