/* =============================================================================
   Brilha Bethel — sistema visual (adaptado dos protótipos em /prototipos).
   Núcleo da marca JDI 2025: índigo #3d1072 + coral #ef6351 (sem dourado).
   Mobile-first; navegação por barra inferior (celular) e lateral (tablet/PC).
   ============================================================================= */

:root {
  --indigo:#3d1072; --plum:#8a5bb2; --opal:#ef6351; --cultured:#f7f7f7; --ink:#222;
  --plum-soft:#f3edfb; --plum-line:#e7dcf6; --opal-soft:#ffe9e4; --peach:#ff9f8a;
  --mint:#1faf86; --mint-soft:#e3f6ef; --amber:#e0902b; --amber-soft:#fdeed6;
  --grad:linear-gradient(135deg,#3d1072 0%,#7a3fb0 48%,#ef6351 112%);
  --shadow-card:0 10px 28px -16px rgba(61,16,114,.40);
  --shadow-pop:0 18px 40px -18px rgba(61,16,114,.55);
  --radius:22px;
  --fd:"Fredoka",system-ui,sans-serif; --fh:"Caveat",cursive; --fb:"Cabin",system-ui,sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--fb); color: var(--ink); min-height: 100vh;
  /* clip (não hidden): corta qualquer estouro decorativo sem criar scroll lateral */
  overflow-x: clip;
  background:
    radial-gradient(1100px 520px at 12% -8%, #efe4fb 0, transparent 60%),
    radial-gradient(900px 520px at 108% 6%, #ffe2da 0, transparent 55%),
    #f4eefb;
}

/* marca (wordmark) */
.marca-brilha { font-family: var(--fd); font-weight: 700; color: var(--indigo); }
.marca-bethel { font-family: var(--fd); font-weight: 700; color: var(--opal); }

/* ---------- Botões / chips compartilhados ---------- */
.btn { border: 0; cursor: pointer; border-radius: 14px; font-family: var(--fd); font-weight: 600;
  color: #fff; background: var(--opal); box-shadow: 0 12px 22px -10px var(--opal); transition: .18s;
  padding: 12px 22px; font-size: 1rem; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: #fff; color: var(--indigo); border: 1.5px solid var(--plum-line); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  font-family: var(--fd); font-weight: 600; font-size: .74rem; padding: 6px 12px;
  background: var(--plum-soft); color: var(--plum); }

/* status pills */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700;
  padding: 4px 9px; border-radius: 999px; }
.status.ok   { background: var(--mint-soft);  color: var(--mint); }
.status.due  { background: var(--amber-soft); color: var(--amber); }
.status.late { background: var(--opal-soft);  color: var(--opal); }
.status.muted{ background: var(--cultured);   color: #8576a0; }

/* avatar */
.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff;
  font-family: var(--fd); font-weight: 600; flex: none; background: var(--plum); background-size: cover; background-position: center;
  position: relative; overflow: hidden; }
/* foto sobre o degradê de fallback: cobre o círculo e carrega preguiçoso */
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: inherit; display: block; }
/* anel branco com halo lilás (detalhe de marca) — box-shadow não é cortado pelo overflow */
.avatar-ring { box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px var(--plum-line), var(--shadow-card); }

/* Recorte de foto (modal) — assets/js/foto-cropper.js */
.cropper-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: rgba(34,17,52,.55); padding: 16px; }
.cropper-box { background: #fff; border-radius: var(--radius); padding: 18px; width: min(92vw, 380px);
  box-shadow: var(--shadow-pop); text-align: center; }
.cropper-titulo { font-family: var(--fd); font-weight: 600; color: var(--indigo); margin-bottom: 12px; }
.cropper-stage { position: relative; width: min(78vw, 320px); aspect-ratio: 1; margin: 0 auto;
  border-radius: 12px; overflow: hidden; background: #1a1030; touch-action: none; }
.cropper-canvas { display: block; cursor: grab; }
.cropper-canvas:active { cursor: grabbing; }
/* guia circular: escurece fora do círculo inscrito no quadrado */
.cropper-ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(26,16,48,.5); }
.cropper-zoom { display: flex; align-items: center; gap: 10px; margin: 14px 2px 4px; font-size: .8rem; color: #4a3a63; }
.cropper-zoom input { flex: 1; }
.cropper-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.cropper-dica { font-size: .72rem; color: #7a6b90; margin-top: 10px; }
.foto-preview { margin-bottom: 8px; }

/* chip de cargo/papel (no hero) */
.rolechip { background: rgba(255,255,255,.2); color: #fff; }
.rolechip svg { width: 14px; height: 14px; }

/* =============================================================================
   COMPONENTES — stat, faixa de Filhas, cta-card (do protótipo)
   ============================================================================= */
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; position: relative; z-index: 2; }
.section-link { color: var(--plum); font-size: .82rem; font-weight: 600; text-decoration: none; }
.section-link:hover { color: var(--indigo); }

/* faixa horizontal de Filhas (avatares) — "Filhas no centro" */
.filhas-strip { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scroll-snap-type: x mandatory; }
.filhas-strip::-webkit-scrollbar { height: 0; }
.fcard { flex: none; width: 76px; text-align: center; scroll-snap-align: start; text-decoration: none; }
.fcard .avatar { margin: 0 auto 7px; }
.fcard span { display: block; font-size: .74rem; font-weight: 600; color: #4a3a63; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard:hover span { color: var(--indigo); }

/* stat card (ícone colorido + valor) */
.stats { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 20px; }
.stat { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--plum-line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-card); transition: .18s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.stat-ic { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; }
.stat-ic svg { width: 22px; height: 22px; }
.stat-ic.purple { background: var(--plum-soft); color: var(--plum); }
.stat-ic.coral { background: var(--opal-soft); color: var(--opal); }
.stat-ic.mint { background: var(--mint-soft); color: var(--mint); }
.stat-txt { display: flex; flex-direction: column; }
.stat-k { font-size: .76rem; color: #8576a0; font-weight: 600; }
.stat-v { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: 1.25rem; line-height: 1.2; }

/* cta-card (chamada destacada para cadastro) */
.cta-card { display: flex; align-items: center; gap: 14px; background: var(--plum-soft);
  border: 1.5px dashed var(--plum); border-radius: var(--radius); padding: 16px 18px; }
.cta-e { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: #fff; color: var(--plum); box-shadow: inset 0 0 0 2px var(--plum-line); }
.cta-e svg { width: 24px; height: 24px; }
.cta-txt { flex: 1; min-width: 0; }
.cta-txt b { font-family: var(--fd); font-weight: 600; color: var(--indigo); display: block; }
.cta-txt p { font-size: .8rem; color: #6a5b86; margin: 2px 0 0; }
.cta-card .btn { flex: none; padding: 10px 18px; font-size: .9rem; }

/* =============================================================================
   PAINEL — dashboard adaptativo (1 coluna no celular, 2 colunas no PC)
   ============================================================================= */
.dash { display: flex; flex-direction: column; }
.dash-side { display: flex; flex-direction: column; gap: 16px; }
a.stat { text-decoration: none; color: inherit; }
.stat-sub { font-size: .74rem; font-weight: 500; color: #9a8bb3; }

/* Acesso rápido (atalhos RBAC) */
.atalhos { display: grid; gap: 8px; }
.atalho { display: flex; align-items: center; gap: 11px; text-decoration: none; padding: 10px 12px;
  border: 1.5px solid var(--plum-line); border-radius: 13px; color: var(--indigo); transition: .14s; }
.atalho:hover { border-color: var(--plum); background: var(--plum-soft); transform: translateX(2px); }
.atalho-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--plum-soft); color: var(--plum); }
.atalho-ic svg { width: 18px; height: 18px; }
.atalho-lbl { flex: 1; font-family: var(--fd); font-weight: 500; font-size: .9rem; }
.atalho-seta { color: var(--plum); font-size: 1.1rem; }

/* card "Próximos eventos" (painel) */
.section-h-card { margin: 0 0 12px; }
.section-h-card .card-titulo { margin: 0; }
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ev-item { display: flex; align-items: center; gap: 12px; }
.ev-date { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--opal-soft); color: var(--opal); line-height: 1; text-align: center; }
.ev-d { font-family: var(--fd); font-weight: 700; font-size: 1.15rem; }
.ev-m { font-size: .6rem; font-weight: 700; letter-spacing: .05em; }
.ev-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ev-t { font-family: var(--fd); font-weight: 600; font-size: .92rem; color: var(--indigo);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-sub { font-size: .76rem; color: #9a8bb3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 1080px) {
  .painel .dash { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
  /* faixa de Filhas vira GRADE no PC — todas visíveis, sem rolagem lateral */
  .painel .filhas-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 16px 8px; overflow: visible; }
  .painel .fcard { width: auto; }
  .dash-side .cta-card { flex-direction: column; text-align: center; padding: 22px 18px; }
  .dash-side .cta-card .btn { width: 100%; justify-content: center; }
}

/* =============================================================================
   LAYOUT APP — shell responsivo (rail desktop + bottomnav mobile)
   ============================================================================= */
.app-shell { min-height: 100vh; min-height: 100dvh; }

/* Barra superior (marca + sair) — some no login */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--plum-line); position: sticky; top: 0; z-index: 20; }
.topbar-marca { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: .95rem; }
.topbar-marca .emblema { flex: none; }
/* título da página e pílula da usuária: só aparecem em tablet/PC */
.topbar-titulo { display: none; }
.topbar-dir { display: flex; align-items: center; gap: 10px; }
.topbar-user { display: none; align-items: center; gap: 9px; text-decoration: none;
  background: var(--cultured); border: 1px solid var(--plum-line); border-radius: 999px;
  padding: 4px 14px 4px 4px; transition: .16s; }
.topbar-user:hover { border-color: var(--plum); }
.tu-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-family: var(--fd); font-weight: 600; font-size: .82rem; }
.tu-nome { font-family: var(--fd); font-weight: 500; color: var(--indigo); font-size: .85rem; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* topo do rail (desktop): marca; escondido no mobile (bottomnav) */
.menu-marca { display: none; }
/* cabeçalho da usuária dentro do menu: só na gaveta (celular) */
.menu-user { display: none; }
.btn-sair { font-family: var(--fd); font-size: .85rem; background: #fff; color: var(--indigo);
  border: 1.5px solid var(--plum-line); border-radius: 999px; padding: 7px 16px; cursor: pointer; text-decoration: none; }
.btn-sair:hover { border-color: var(--plum); }

/* Conteúdo */
.conteudo { padding: 18px 16px 96px; max-width: 920px; margin: 0 auto; }

/* Cartões */
.card { background: #fff; border: 1px solid var(--plum-line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-card); }

/* Títulos de seção */
.painel-titulo { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: 1.4rem; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 14px; }
.section-h h3 { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: 1.05rem; }
.section-h .acc { font-family: var(--fh); color: var(--opal); font-size: 1.3rem; }

/* =============================================================================
   HERO (cabeçalho com gradiente) — saudação no painel, título nas telas
   ============================================================================= */
.hero { background: var(--grad); color: #fff; padding: 26px 22px; border-radius: var(--radius);
  position: relative; overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 150px; height: 150px;
  border-radius: 50%; background: rgba(255,255,255,.08); }
.hero .greet { position: relative; z-index: 2; }
.hero .greet small { display: block; font-size: .85rem; opacity: .92; }
.hero .greet b { font-family: var(--fh); font-weight: 700; font-size: 2.1rem; line-height: 1.05; display: block; }
.hero .hero-sub { position: relative; z-index: 2; margin-top: 6px; font-size: .82rem; opacity: .92; }

/* =============================================================================
   WORDMARK (marca/logo_brilha_bethel.html) — Fredoka
   "Brilha" índigo (ls -.01em, lh .9) · "Bethel" coral (ls 3px) · sparkle coral
   ============================================================================= */
.wordmark { display: inline-flex; position: relative; line-height: 1; }
.wordmark.empilhado { flex-direction: column; align-items: flex-start; }
.wordmark.inline { flex-direction: column; align-items: flex-start; } /* lockup é sempre 2 linhas */
.wm-brilha { font-family: var(--fd); font-weight: 600; color: var(--indigo); letter-spacing: -.01em; line-height: .9; font-size: 1.5em; }
.wm-bethel { font-family: var(--fd); font-weight: 500; color: var(--opal); letter-spacing: 3px; line-height: 1; font-size: .62em; margin-top: .14em; padding-left: .06em; }
.wm-sparkle { position: absolute; top: -.35em; right: -.5em; width: .55em; height: .55em; }
/* variante fundo escuro: branco + pêssego (marca §fundo escuro) */
.wordmark.escuro .wm-brilha { color: #fff; }
.wordmark.escuro .wm-bethel { color: #ffb39c; }
.emblema { display: block; }

/* =============================================================================
   LOGIN
   ============================================================================= */
/* min-height 100dvh (não 100vh): no celular, 100vh inclui a área atrás da barra
   do navegador e empurrava o botão para fora da tela. dvh = viewport visível. */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
.login-hero { background: var(--grad); color: #fff; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: clamp(28px,7vh,56px) 24px clamp(22px,4vh,36px); text-align: center;
  position: relative; overflow: hidden; }
/* emblema e wordmark escalam com a tela p/ caber em telas baixas sem rolagem */
.login-hero .emblema { width: clamp(72px, 20vw, 100px); height: auto; }
.login-hero .wordmark { font-size: clamp(1.6rem, 7vw, 2rem); z-index: 1; }
.login-hero .bethel { font-size: .82rem; background: rgba(255,255,255,.18); padding: 5px 14px; border-radius: 999px; }
.card-login { background: #fff; border-radius: 30px 30px 0 0; flex: none;
  padding: 26px 22px calc(28px + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -14px 40px -18px rgba(0,0,0,.35); max-width: 460px; width: 100%; margin: 0 auto; }
.card-login h2 { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: 1.16rem; }
.card-login .hint { color: #7a6b91; font-size: .83rem; margin-bottom: 18px; }
.form-login { display: flex; flex-direction: column; gap: 14px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo span { font-size: .74rem; font-weight: 600; color: var(--indigo); }
.campo input, .campo select {
  /* 16px evita o zoom automático do iOS ao focar o campo (regra: <16px → zoom) */
  font-family: var(--fb); font-size: 16px; padding: 12px 13px; color: var(--ink);
  border: 1.5px solid var(--plum-line); border-radius: 12px; background: var(--cultured); outline: 0; transition: .16s; width: 100%; }
.campo input:focus, .campo select:focus { border-color: var(--plum); background: #fff; box-shadow: 0 0 0 4px var(--plum-soft); }
.btn-entrar { margin-top: 4px; font-family: var(--fd); font-weight: 600; font-size: 1rem; color: #fff;
  background: var(--opal); border: 0; border-radius: 14px; padding: 14px; cursor: pointer; box-shadow: 0 12px 22px -10px var(--opal); transition: .18s; }
.btn-entrar:hover { transform: translateY(-2px); }
.alerta-erro { background: var(--opal-soft); color: #b3261e; border: 1px solid #f5c6c2; border-radius: 12px;
  padding: 11px 13px; font-size: .9rem; margin: 0 0 16px; }
.alerta-erro ul { margin: 6px 0 0; padding-left: 20px; }
.alerta-inelegivel { background: #fff7e0; border-left-color: #c87800; color: #7a4a00; margin-top: 6px; }
[x-cloak] { display: none !important; }

/* =============================================================================
   KPIs / stat cards
   ============================================================================= */
/* 3 por linha já no celular (pílulas compactas do protótipo); crescem no PC */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--plum-line); border-radius: var(--radius);
  padding: 14px 10px; text-align: center; box-shadow: var(--shadow-card); transition: .18s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.kpi-num { display: block; font-family: var(--fd); font-weight: 600; color: var(--indigo); line-height: 1.2;
  font-size: clamp(1rem, 4.5vw, 1.7rem); overflow-wrap: break-word; }
.kpi-rot { display: block; font-size: .76rem; color: #8576a0; font-weight: 600; margin-top: 4px; }
.aviso-placeholder p { margin: 6px 0; }
.aviso-placeholder p:first-child { color: var(--indigo); }
.dica { color: #9a8bb3; font-size: .78rem; margin: 12px 0 0; }

/* =============================================================================
   LISTA DE FILHAS (drow — Filhas no centro)
   ============================================================================= */
.filhas-cab, .filhas-cab-dir { display: flex; align-items: center; }
.filhas-cab { justify-content: space-between; margin: 4px 0 16px; }
.filhas-cab-dir { gap: 12px; }
.filhas-contagem { color: #8576a0; font-size: .85rem; }
.btn-novo { font-family: var(--fd); font-weight: 600; font-size: .86rem; color: #fff; background: var(--opal);
  text-decoration: none; padding: 9px 16px; border-radius: 999px; white-space: nowrap; box-shadow: 0 10px 20px -10px var(--opal); }
.btn-novo:hover { transform: translateY(-1px); }

.filha-lista { list-style: none; display: grid; gap: 12px; }
.filha-card { background: #fff; border: 1px solid var(--plum-line); border-radius: 18px;
  box-shadow: 0 6px 16px -12px rgba(61,16,114,.4); transition: .18s; }
.filha-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.filha-card.inativa { opacity: .62; }
.filha-card-link { display: flex; align-items: center; gap: 13px; text-decoration: none; color: inherit; padding: 12px 14px; }
.filha-avatar { width: 48px; height: 48px; font-size: 1.15rem; }
.filha-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.filha-nome { font-family: var(--fd); font-weight: 500; font-size: .98rem; color: var(--ink); }
.filha-card-link:hover .filha-nome { color: var(--indigo); }
.filha-meta { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: #9a8bb3; }
.filha-status { font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--cultured); color: #8576a0; }
.filha-status.status-iniciada { background: var(--mint-soft); color: var(--mint); }
.filha-status.status-solicitacao { background: var(--amber-soft); color: var(--amber); }

/* =============================================================================
   FORMULÁRIO (Form 130)
   ============================================================================= */
.form-cab { margin: 4px 0 16px; }
.voltar { color: var(--plum); text-decoration: none; font-weight: 600; font-size: .82rem; }
.form-cadastro { display: flex; flex-direction: column; gap: 18px; }
.fsec { border: 1px solid var(--plum-line); border-radius: var(--radius); background: #fff; padding: 18px 18px 20px; box-shadow: var(--shadow-card); }
.fsec legend { font-family: var(--fd); font-weight: 600; color: var(--indigo); padding: 0 8px; font-size: 1.02rem; }
.fsec-nota { background: var(--plum-soft); border-left: 3px solid var(--plum); border-radius: 10px;
  padding: 9px 12px; font-size: .78rem; color: #5a4a76; margin: 0 0 14px; line-height: 1.45; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 13px; }
.resp-bloco { border-top: 1px dashed var(--plum-line); padding-top: 13px; margin-top: 12px; }
.resp-bloco:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.resp-bloco-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.resp-num { font-family: var(--fd); font-weight: 600; font-size: .82rem; color: var(--plum); }
.btn-remover { border: 1.5px solid var(--plum-line); background: #fff; color: #b3261e; font-size: .74rem;
  font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.btn-remover:hover { border-color: #f5c6c2; background: var(--opal-soft); }
.btn-add-resp { margin-top: 14px; border: 1.5px dashed var(--plum); background: var(--plum-soft); color: var(--indigo);
  font-family: var(--fd); font-weight: 600; font-size: .85rem; padding: 10px 16px; border-radius: 12px; cursor: pointer; width: 100%; }
.btn-add-resp:hover { background: #ece1fa; }

/* Seletor "pessoa única" do responsável (migr.032) — buscar existente ou criar novo */
.resp-busca { position: relative; margin-bottom: 4px; }
.resp-sugestoes { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0;
  list-style: none; padding: 4px; background: #fff; border: 1.5px solid var(--plum-line);
  border-radius: 12px; box-shadow: var(--shadow-card); max-height: 240px; overflow-y: auto; }
.resp-sugestoes li { margin: 0; }
.resp-sugestoes button { display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .82rem; color: var(--ink); }
.resp-sugestoes button:hover { background: var(--plum-soft); }
.resp-sugestoes strong { font-weight: 600; }
.resp-sugestoes span, .resp-sugestoes em { color: #6b6580; font-style: normal; }
.resp-vinculada { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font-size: .78rem; color: var(--indigo); }
/* Pessoa reaproveitada sem CPF (cadastro anterior à migr.032): sem preencher, a ficha não salva. */
.resp-aviso { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; font-size: .78rem;
  color: #8a3b16; background: #fff6f4; border: 1px solid #ffd6c9; }
.btn-link { border: 0; background: none; color: var(--plum); font-weight: 600; font-size: .78rem;
  text-decoration: underline; cursor: pointer; padding: 0; }
input[readonly] { background: var(--plum-soft); color: #6b6580; }

/* Upload de foto (gated por liberação de mídia) */
.foto-campo { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--plum-line); display: grid; gap: 8px; }
.foto-rotulo { font-size: .74rem; font-weight: 600; color: var(--indigo); }
.foto-atual { display: flex; align-items: center; gap: 10px; }
.foto-thumb { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; box-shadow: var(--shadow-card); }

/* Ficha (perfil) da Filha */
.ficha-hero { display: flex; align-items: center; gap: 16px; background: var(--grad); color: #fff;
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.ficha-hero .avatar { box-shadow: 0 0 0 3px rgba(255,255,255,.55); }
.ficha-id h1 { font-family: var(--fd); font-weight: 600; font-size: 1.5rem; line-height: 1.1; }
.ficha-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.ficha-pill { background: rgba(255,255,255,.22); color: #fff; font-size: .7rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; }
.ficha-pill.muted { background: rgba(255,255,255,.14); }
.ficha-pill.principal { background: var(--mint-soft); color: var(--mint); }
.ficha-hero .filha-status { font-size: .72rem; }
.ficha-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.ficha-card { padding: 16px 18px; }
.ficha-dl { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 8px; }
.ficha-dl > div { display: flex; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--plum-soft); }
.ficha-dl dt { font-size: .78rem; color: #8576a0; }
.ficha-dl dd { font-size: .85rem; color: var(--ink); font-weight: 500; text-align: right; }
.ficha-resps { list-style: none; display: grid; gap: 10px; margin-top: 8px; }
.ficha-resps li { display: flex; flex-direction: column; gap: 2px; padding: 9px 0; border-top: 1px dashed var(--plum-line); }
.ficha-resps li:first-child { border-top: 0; }
.ficha-resp-nome { font-family: var(--fd); font-weight: 500; color: var(--indigo); display: flex; align-items: center; gap: 8px; }
.ficha-resp-meta { font-size: .76rem; color: #8576a0; }
.ficha-cons { list-style: none; display: grid; gap: 6px; margin-top: 8px; font-size: .85rem; }
.ficha-cons li.sim { color: #0c6b50; font-weight: 600; }
.ficha-cons li.nao { color: #9a8bb3; }

/* Painel de Consentimentos 2.0 (base legal + evidência) */
.cons-nota { font-size: .76rem; color: #8576a0; margin: 2px 0 12px; }
.cons-lista { list-style: none; display: grid; gap: 12px; }
.cons-item { padding: 12px; border: 1px solid var(--plum-line); border-radius: 14px; background: #fff; }
.cons-item.cons-revogado { background: #fff8f6; border-color: var(--opal-soft); }
.cons-item.cons-ausente { background: #faf8fd; }
.cons-item-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cons-nome { font-family: var(--fd); font-weight: 500; color: var(--indigo); font-size: .92rem; }
.cons-obrig { color: var(--opal); }
.ficha-pill.cons-pill-vigente { background: var(--mint-soft); color: var(--mint); }
.ficha-pill.cons-pill-revogado { background: var(--opal-soft); color: #b23a26; }
.ficha-pill.cons-pill-ausente { background: var(--plum-soft); color: #8576a0; }
.cons-base { font-size: .74rem; color: #8576a0; margin: 6px 0 0; }
.cons-detalhe { display: grid; gap: 1px; margin-top: 8px; }
.cons-detalhe > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--plum-soft); }
.cons-detalhe dt { font-size: .74rem; color: #8576a0; }
.cons-detalhe dd { font-size: .8rem; color: var(--ink); font-weight: 500; text-align: right; }
.cons-acoes { margin-top: 10px; }
.cons-historico { margin-top: 14px; font-size: .82rem; }
.cons-historico summary { cursor: pointer; color: var(--indigo); font-weight: 600; font-size: .8rem; }
.cons-historico ul { list-style: none; margin-top: 8px; display: grid; gap: 6px; }
.cons-historico li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 5px 0; border-top: 1px dashed var(--plum-line); }
.cons-hist-acao { font-weight: 700; font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.cons-hist-concedido { background: var(--mint-soft); color: var(--mint); }
.cons-hist-revogado { background: var(--opal-soft); color: #b23a26; }
.cons-hist-tipo { color: var(--ink); }
.cons-hist-meta { color: #8576a0; font-size: .74rem; margin-left: auto; }
.campo-check { display: flex; align-items: flex-start; gap: 9px; font-size: .85rem; margin: 9px 0; cursor: pointer; color: #4a3a63; }
.campo-check input { margin-top: 3px; }
.campo-check b { color: var(--indigo); }
.seg { display: inline-flex; background: var(--cultured); border: 1.5px solid var(--plum-line); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.seg label { font-family: var(--fd); font-weight: 500; font-size: .84rem; padding: 8px 14px; border-radius: 9px; cursor: pointer; color: #7a6b91; display: flex; align-items: center; gap: 6px; }
.form-acoes { display: flex; gap: 12px; align-items: center; }
.form-acoes .btn-entrar { width: auto; padding: 13px 28px; }

/* =============================================================================
   TESOURARIA — matriz
   ============================================================================= */
.comp-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 18px;
  background: #fff; border: 1px solid var(--plum-line); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow-card); }
.comp-btn { text-decoration: none; color: var(--plum); background: var(--cultured); border-radius: 10px;
  width: 38px; height: 38px; display: grid; place-items: center; font-size: 1.1rem; box-shadow: 0 2px 6px rgba(61,16,114,.12); }
.comp-btn:hover { color: var(--indigo); }
.comp-atual { font-family: var(--fd); font-weight: 600; color: var(--indigo); min-width: 170px; text-align: center; }

.mens-lista { list-style: none; display: grid; gap: 10px; }
.mens-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--plum-line);
  border-radius: 18px; padding: 11px 14px; box-shadow: 0 6px 16px -12px rgba(61,16,114,.4); }
.mens-card.isenta { opacity: .7; }
.mens-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--plum); color: #fff; font-family: var(--fd); font-weight: 700; flex: none; }
.mens-pessoa { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mens-nome { font-family: var(--fd); font-weight: 500; }
.mens-cat { font-size: .72rem; color: #9a8bb3; }
.mens-valor { display: flex; align-items: center; gap: 8px; }
.mens-valor strong { font-family: var(--fd); color: var(--indigo); }
.tag-desc { font-size: .68rem; font-weight: 700; color: var(--mint); background: var(--mint-soft); padding: 2px 7px; border-radius: 999px; }
.tag-isenta { font-size: .72rem; color: #8576a0; background: var(--cultured); padding: 3px 9px; border-radius: 999px; }
.mens-status { font-size: .66rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--cultured); color: #8576a0; }
.mens-status.status-aberta { background: var(--amber-soft); color: var(--amber); }
.mens-status.status-paga { background: var(--mint-soft); color: var(--mint); }
.mens-status.status-isenta { background: var(--cultured); color: #8576a0; }
/* celular estreito: nome inteiro na 1ª linha; valor + ações descem para a 2ª,
   alinhados com o texto — em vez de espremer tudo numa linha só */
@media (max-width: 479.98px) {
  .mens-card { flex-wrap: wrap; row-gap: 8px; }
  .mens-pessoa { flex: 1 1 calc(100% - 54px); } /* 54px = avatar 42 + gap 12 */
  .mens-valor { margin-left: 54px; }
  .mens-acao { margin-left: auto; }
}

/* --- Tesouraria Fase 2: pagamentos, confirmação, recibo, inadimplência ------ */
.alerta-ok { background: var(--mint-soft); color: #0c6b50; border: 1px solid #bfe9da;
  border-radius: 12px; padding: 11px 13px; font-size: .9rem; margin: 0 0 16px; }

.tes-acoes { display: flex; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.btn-secundario { font-family: var(--fd); font-weight: 600; font-size: .85rem; color: var(--indigo);
  background: #fff; border: 1.5px solid var(--plum-line); border-radius: 999px; padding: 9px 16px;
  text-decoration: none; transition: .16s; }
.btn-secundario:hover { border-color: var(--plum); color: var(--plum); }
/* Atalho com fila esperando por alguém (ex.: declarações da família a conferir). */
.btn-secundario.com-aviso { border-color: var(--coral, #ef6351); color: var(--coral, #ef6351); background: #fff6f4; }

.painel-confirmar { margin-bottom: 18px; }
.bloco-titulo { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: 1.05rem; margin: 0 0 4px; }
.conf-lista { list-style: none; display: grid; gap: 8px; margin-top: 10px; }
.conf-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--plum-line); }
.conf-pessoa { flex: 1; font-family: var(--fd); font-weight: 500; min-width: 0; }
.conf-valor { font-family: var(--fd); color: var(--indigo); }
.conf-form { margin: 0; }
.btn-mini { padding: 8px 16px; font-size: .82rem; border-radius: 999px; margin: 0; }

.mens-acao { display: flex; align-items: center; justify-content: flex-end; min-width: 92px; }
.mens-card.paga { opacity: .85; }
.btn-registrar { font-family: var(--fd); font-weight: 600; font-size: .8rem; color: #fff; background: var(--opal);
  text-decoration: none; padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 8px 16px -9px var(--opal); }
.btn-registrar:hover { transform: translateY(-1px); }
.tag-recibo { font-size: .68rem; font-weight: 700; color: var(--mint); background: var(--mint-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag-aguardando { font-size: .66rem; font-weight: 700; color: var(--amber); background: var(--amber-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }

.pagar-item span { font-size: .9rem; }
.pagar-total { display: flex; align-items: center; justify-content: space-between; background: var(--plum-soft);
  border-radius: 12px; padding: 12px 16px; margin: 4px 0 4px; }
.pagar-total span { font-size: .8rem; font-weight: 600; color: var(--indigo); }
.pagar-total strong { font-family: var(--fd); font-size: 1.3rem; color: var(--indigo); }

.regua-legenda p { font-size: .82rem; color: #6b5b86; margin: 0; }
.tag-meses { font-size: .68rem; font-weight: 700; color: var(--amber); background: var(--amber-soft); padding: 2px 7px; border-radius: 999px; }
.inad-card { border-left: 4px solid var(--plum-line); }
.inad-card.inad-aviso1 { border-left-color: var(--amber); }
.inad-card.inad-aviso2 { border-left-color: #d96b1f; }
.inad-card.inad-suspensao { border-left-color: #c0392b; }
.inad-badge { font-size: .64rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; text-align: center; }
.badge-pendente { background: var(--cultured); color: #8576a0; }
.badge-aviso1 { background: var(--amber-soft); color: var(--amber); }
.badge-aviso2 { background: #fbe2cf; color: #c45e16; }
.badge-suspensao { background: #fbe0dc; color: #c0392b; }

/* =============================================================================
   CONTROLE FINANCEIRO (cf-*) — sistema visual dos protótipos
   Cards de KPI, cartão de registro de pagamento (chips de competência + forma +
   total) e linhas de inadimplência. Reaproveita os tokens da marca.
   ============================================================================= */
.cf-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
.cf-card { background: #fff; border: 1px solid var(--plum-line); border-radius: 18px; padding: 15px 16px; box-shadow: var(--shadow-card); }
.cf-card .k { font-size: .74rem; color: #8576a0; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.cf-card .k .dot { width: 9px; height: 9px; border-radius: 50%; }
.cf-card .v { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: 1.42rem; line-height: 1.15; margin-top: 5px; }
.cf-card .v small { font-size: .78rem; font-weight: 500; color: #9a8bb3; }
.cf-card .sub { font-size: .72rem; color: #9a8bb3; margin-top: 3px; }

/* Cartão de registro de pagamento (página, não modal) */
.cf-formcard { background: #fff; border: 1px solid var(--plum-line); border-radius: var(--radius);
  box-shadow: var(--shadow-card); overflow: hidden; max-width: 620px; }
.cf-pay-head { background: var(--grad); color: #fff; padding: 18px 20px; }
.cf-pay-head h3 { font-family: var(--fd); font-weight: 600; font-size: 1.12rem; }
.cf-pay-head .sub { font-size: .78rem; opacity: .92; margin-top: 3px; }
.cf-pay-body { padding: 18px 20px; }
.cf-fhead { display: flex; align-items: center; gap: 12px; background: var(--plum-soft); border-radius: 14px; padding: 11px 14px; margin-bottom: 16px; }
.cf-fhead b { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: 1rem; display: block; }
.cf-fhead .val { font-size: .76rem; color: #7a6b91; font-weight: 600; }
.cf-flabel { font-size: .78rem; font-weight: 700; color: #6a5b86; margin: 0 0 9px; }
.cf-mchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 7px; margin-bottom: 18px; }
.cf-mchip { border: 1.5px solid var(--plum-line); border-radius: 11px; padding: 8px 4px; text-align: center; cursor: pointer; transition: .12s; background: #fff; display: block; }
.cf-mchip .mm { font-family: var(--fd); font-weight: 600; font-size: .82rem; color: var(--indigo); }
.cf-mchip .ss { font-size: .58rem; font-weight: 700; margin-top: 2px; text-transform: uppercase; color: #b3a6c9; }
.cf-mchip.atraso .ss { color: var(--opal); }
.cf-mchip.vencer .ss { color: var(--amber); }
.cf-mchip.sel { border-color: var(--opal); background: #fff6f4; box-shadow: 0 4px 10px -5px var(--opal); }
.cf-mchip.sel .ss { color: var(--opal); }
.cf-methods { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.cf-method { border: 1.5px solid var(--plum-line); background: #fff; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-family: var(--fb); font-weight: 600; font-size: .8rem; color: #6a5b86; }
.cf-method.on { border-color: var(--indigo); background: var(--plum-soft); color: var(--indigo); }
.cf-totbar { display: flex; align-items: center; justify-content: space-between; background: var(--plum-soft); border-radius: 13px; padding: 12px 15px; }
.cf-totbar span { font-size: .78rem; color: #6a5b86; font-weight: 600; }
.cf-totbar b { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: 1.3rem; }

/* Linhas de inadimplência (estilo cf) */
.cf-mrow { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--plum-line);
  border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-card); }
.cf-mrow.atraso-aviso1 { box-shadow: inset 3px 0 0 var(--amber), var(--shadow-card); }
.cf-mrow.atraso-aviso2 { box-shadow: inset 3px 0 0 #d96b1f, var(--shadow-card); }
.cf-mrow.atraso-suspensao { box-shadow: inset 3px 0 0 #c0392b, var(--shadow-card); }
.cf-mrow .nm { flex: 1; min-width: 0; }
.cf-mrow .nm b { font-family: var(--fd); font-weight: 500; display: block; line-height: 1.15; }
.cf-mrow .nm small { font-size: .7rem; color: #9a8bb3; }
.cf-mrow .val { font-family: var(--fd); font-weight: 600; color: var(--indigo); white-space: nowrap; }
.cf-stat { font-size: .64rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; text-align: center; }
.cf-stat.st-pendente { background: var(--cultured); color: #8576a0; }
.cf-stat.st-aviso1 { background: var(--amber-soft); color: var(--amber); }
.cf-stat.st-aviso2 { background: #fbe2cf; color: #c45e16; }
.cf-stat.st-suspensao { background: #fbe0dc; color: #c0392b; }
.cf-mrow .notif-form { margin: 0; flex-shrink: 0; }

/* Confirmação (dupla checagem) — botão Tesouraria em verde-menta */
.btn-confirmar { font-family: var(--fd); font-weight: 600; font-size: .82rem; color: #fff; background: var(--mint);
  border: 0; border-radius: 10px; padding: 9px 18px; cursor: pointer; box-shadow: 0 8px 16px -9px var(--mint); }
.btn-confirmar:hover { transform: translateY(-1px); }

/* Linhas com valor por competência (registrar pagamento / cancelar-estornar) */
.pg-lista { display: grid; gap: 8px; margin-bottom: 16px; }
.pg-row { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--plum-line);
  border-radius: 12px; padding: 9px 12px; cursor: pointer; transition: .12s; background: #fff; }
.pg-row.sel { border-color: var(--opal); background: #fff6f4; }
.pg-check { flex: none; }
.pg-comp { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pg-comp b { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: .9rem; }
.pg-comp small { font-size: .7rem; color: #8576a0; }
.pg-parcial { color: var(--amber); font-weight: 700; }
.pg-atraso { color: var(--opal); font-weight: 700; }
.pg-valor { display: flex; align-items: center; gap: 5px; }
.pg-cifra { font-size: .76rem; color: #8576a0; font-weight: 600; }
.pg-valor input { width: 92px; padding: 8px 10px; border: 1.5px solid var(--plum-line); border-radius: 10px;
  font-family: var(--fd); font-weight: 600; color: var(--indigo); text-align: right; background: var(--cultured); }
.pg-valor input:disabled { opacity: .45; }
.pg-row.sel .pg-valor input { background: #fff; border-color: var(--opal); }

/* Selo parcial na matriz + detalhe do pagamento */
.tag-parcial { font-size: .66rem; font-weight: 700; color: var(--amber); background: var(--amber-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.det-linhas { list-style: none; display: grid; gap: 6px; margin-bottom: 12px; }
.det-linhas li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--plum-soft); }
.det-comp { font-family: var(--fd); font-weight: 600; color: var(--indigo); }
.det-val { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.det-meta { font-size: .76rem; color: #8576a0; margin: 6px 0 4px; line-height: 1.5; }
.det-canc { list-style: none; display: grid; gap: 8px; margin-bottom: 6px; }
.det-canc li { background: var(--cultured); border-radius: 10px; padding: 9px 12px; font-size: .82rem; color: #5a4a76; }
.det-hr { border: 0; border-top: 1px dashed var(--plum-line); margin: 16px 0; }

@media (min-width: 640px) {
  .cf-cards { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================================================
   NAVEGAÇÃO — modelo do protótipo
   Mobile : gaveta (drawer) deslizante + scrim, aberta pelo hambúrguer.
   Desktop/tablet: sidebar colapsável (ícone+rótulo ↔ só ícone).
   ============================================================================= */
.menu { display: flex; flex-direction: column; background: #fff; }
.menu-head { display: flex; align-items: center; gap: 8px; }
.menu-marca { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 1; min-width: 0; }
.menu-marca .emblema { flex: none; }
.menu-itens { display: flex; flex-direction: column; gap: 4px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: transparent; cursor: pointer; text-decoration: none;
  padding: 11px 12px; border-radius: 13px; color: #6a5b86;
  font-family: var(--fd); font-weight: 500; font-size: .92rem; white-space: nowrap; transition: .14s; }
.menu-ic { display: inline-flex; flex: none; }
.menu-ic svg { width: 21px; height: 21px; }
.menu-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.menu-item:hover { background: var(--plum-soft); color: var(--plum); }
.menu-item.ativo { background: var(--grad); color: #fff; box-shadow: var(--shadow-card); }
.menu-item.ativo .menu-ic { color: #fff; }
.menu-sair { color: var(--opal); }
.menu-sair:hover { background: var(--opal-soft); color: var(--opal); }
.menu-foot { margin-top: auto; }
.menu-toggle, .menu-fechar { flex: none; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--plum-line); background: var(--cultured); color: var(--indigo);
  cursor: pointer; display: none; align-items: center; justify-content: center; transition: .14s; }
.menu-toggle svg, .menu-fechar svg { width: 18px; height: 18px; transition: transform .2s; }
.menu-toggle:hover, .menu-fechar:hover { background: var(--plum-soft); }

.burger { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--plum-line);
  background: var(--cultured); color: var(--indigo); cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center; transition: .14s; }
.burger:hover { background: var(--plum-soft); }

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(28,10,52,.45);
  opacity: 0; pointer-events: none; transition: opacity .3s; }

/* barra inferior de atalhos — só no celular (escondida por padrão) */
.bottomnav { display: none; }

/* ---------- MOBILE: gaveta + barra inferior ---------- */
@media (max-width: 759.98px) {
  .topbar { display: flex; align-items: center; gap: 12px; }
  .topbar-marca { flex: 1; justify-content: flex-start; }
  .menu { position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: 86%; max-width: 320px;
    padding: 0 0 14px; border-radius: 0 24px 24px 0; overflow-y: auto;
    transform: translateX(-104%); transition: transform .32s cubic-bezier(.4,0,.2,1);
    box-shadow: 16px 0 44px -16px rgba(61,16,114,.55); }
  .app-shell.drawer-open .menu { transform: none; }
  .app-shell.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  /* topo da gaveta: gradiente cobrindo marca + cabeçalho da usuária (protótipo) */
  .menu-top { background: var(--grad); padding: 34px 16px 14px; }
  .menu-head { padding: 0; }
  .menu-head .menu-marca .wm-brilha, .menu-head .menu-marca .wm-bethel { color: #fff; }
  .menu-head .emblema { filter: brightness(0) invert(1); }
  .menu-fechar { display: flex; background: rgba(255,255,255,.18); border-color: transparent; color: #fff; }
  .menu-user { display: flex; align-items: center; gap: 11px; margin-top: 14px; text-decoration: none;
    background: rgba(255,255,255,.14); border-radius: 14px; padding: 9px 12px; }
  .mu-avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: rgba(255,255,255,.22); color: #fff; font-family: var(--fd); font-weight: 600; font-size: 1rem;
    box-shadow: 0 0 0 2.5px rgba(255,255,255,.55); }
  .mu-txt { display: flex; flex-direction: column; min-width: 0; }
  .mu-txt b { font-family: var(--fd); font-weight: 600; color: #fff; font-size: .95rem; line-height: 1.15;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mu-txt small { font-size: .72rem; color: rgba(255,255,255,.85); }
  .menu-itens { padding: 12px; }
  .menu-foot { padding: 0 12px; }

  /* barra inferior de atalhos */
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; height: 66px;
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--plum-line);
    padding-bottom: env(safe-area-inset-bottom, 0); }
  .bnav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: transparent; cursor: pointer; text-decoration: none;
    color: #a89cbd; font-family: var(--fd); font-weight: 500; font-size: .64rem; transition: .16s; }
  .bnav-ic svg { width: 22px; height: 22px; }
  .bnav-item.ativo { color: var(--indigo); }
  .bnav-item.ativo .bnav-ic { color: var(--opal); }
  /* botão central destacado "Nova" (cadastrar Filha) — modelo do protótipo */
  .bnav-add { color: var(--indigo); }
  .bnav-plus { width: 50px; height: 50px; border-radius: 50%; margin-top: -26px;
    background: var(--opal); color: #fff; display: grid; place-items: center;
    border: 4px solid #fff; box-shadow: 0 12px 22px -8px var(--opal); }
  .bnav-plus svg { width: 22px; height: 22px; }
  .bnav-add:active .bnav-plus { transform: scale(.94); }
  /* espaço para a barra não cobrir o conteúdo */
  .conteudo { padding-bottom: 86px; }
}

/* ---------- DESKTOP/TABLET: sidebar colapsável ---------- */
@media (min-width: 760px) {
  /* Menu + conteúdo formam UM bloco, centralizado quando a tela é mais larga
     que o bloco. Assim o menu fica grudado no conteúdo (como no protótipo) —
     sem o vão que aparecia ao centralizar só o conteúdo. */
  .app-shell { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: auto 1fr;
    min-height: 100vh; max-width: 1472px; margin-inline: auto;
    transition: grid-template-columns .26s ease; }
  .app-shell.is-colapsado,
  html.pre-colapsado .app-shell { grid-template-columns: 76px 1fr; }
  /* sem transição no primeiro paint (estado pré-aplicado), evita "abrir e fechar" */
  html.pre-colapsado .app-shell { transition: none; }
  .burger { display: none; }
  .topbar { grid-column: 2; grid-row: 1; justify-content: space-between; padding: 12px clamp(20px, 3vw, 40px); }
  .topbar-marca { display: none; }
  .topbar-titulo { display: block; font-family: var(--fd); font-weight: 600; color: var(--indigo);
    font-size: 1.15rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-user { display: inline-flex; }
  /* no tablet/PC, Sair fica na topbar — o rodapé do menu mantém só "Minha conta" */
  .menu-foot form { display: none; }
  /* Conteúdo preenche a faixa ao lado do menu (margin:0 sobrepõe o auto do mobile),
     ficando colado ao menu; o teto de leitura vem do max-width do app-shell.
     min-width:0 é OBRIGATÓRIO: sem ele, conteúdo largo (faixa de Filhas, tabelas)
     alarga a coluna 1fr além da tela — era o estouro do Painel no PC. */
  .conteudo { grid-column: 2; grid-row: 2; margin: 0; max-width: none; min-width: 0;
    padding: 22px clamp(20px, 3vw, 40px) 40px; align-self: start; }
  .scrim { display: none; }

  .menu { grid-row: 1 / 3; grid-column: 1; position: sticky; top: 0; height: 100vh;
    padding: 16px 12px; border-right: 1px solid var(--plum-line); overflow: hidden; }
  .menu-head { padding: 4px 4px 16px; margin-bottom: 10px; border-bottom: 1px solid var(--plum-line); }
  .menu-toggle { display: flex; }
  .menu-fechar { display: none; }

  .is-colapsado .menu-lbl, html.pre-colapsado .menu-lbl,
  .is-colapsado .menu-marca-txt, html.pre-colapsado .menu-marca-txt { display: none; }
  .is-colapsado .menu-item, html.pre-colapsado .menu-item { justify-content: center; padding: 11px 0; }
  .is-colapsado .menu-marca, html.pre-colapsado .menu-marca { justify-content: center; }
  .is-colapsado .menu-toggle svg, html.pre-colapsado .menu-toggle svg { transform: rotate(180deg); }
  .is-colapsado .menu-head, html.pre-colapsado .menu-head { flex-direction: column; gap: 10px; }

  /* Login no desktop: card centralizado, não hero full-height. */
  .login-wrap { justify-content: center; align-items: center; padding: 40px; }
  .login-hero { flex: none; border-radius: 26px 26px 0 0; max-width: 460px; width: 100%; padding: 48px 30px 32px; }
  .card-login { border-radius: 0 0 26px 26px; box-shadow: var(--shadow-pop); }
}

/* ---------- TABLET: rail fixo de ícones (modelo do protótipo, 84px) ----------
   Entre o celular e o PC o menu vira um rail compacto sempre colapsado —
   mais área útil para o conteúdo; os rótulos ficam nos tooltips (title). */
@media (min-width: 760px) and (max-width: 1023.98px) {
  .app-shell, .app-shell.is-colapsado, html.pre-colapsado .app-shell { grid-template-columns: 84px 1fr; }
  .app-shell .menu-lbl, .app-shell .menu-marca-txt { display: none; }
  .app-shell .menu-item { justify-content: center; padding: 11px 0; }
  .app-shell .menu-marca { justify-content: center; }
  .app-shell .menu-toggle { display: none; }
  .app-shell .menu-head { flex-direction: column; gap: 10px; }
}

/* =============================================================================
   Telas maiores — grids
   ============================================================================= */
@media (min-width: 640px) {
  .kpis { gap: 12px; }
  .kpi { padding: 16px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .filha-lista { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .ficha-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* PC largo: mais colunas onde a densidade ajuda a ler, teto de leitura nos forms */
@media (min-width: 760px) {
  .form-cadastro, .sistema-jurisdicao { max-width: 900px; }
  .comp-nav { max-width: 440px; margin-inline: auto; }
}
@media (min-width: 1100px) {
  .filha-lista { grid-template-columns: repeat(3, 1fr); }
  .mens-lista { grid-template-columns: 1fr 1fr; }
}

/* Tabelas largas (reunião, despesas, relatórios): a rolagem horizontal vem do
   wrapper .table-wrap (display:block na própria <table> impedia as células de
   preencherem 100% do card). No PC a coluna de conteúdo tem teto (min-width:0). */

/* =============================================================================
   SISTEMA — Jurisdição (Bloco 4)
   ============================================================================= */
.sistema-jurisdicao { display: flex; flex-direction: column; gap: 16px; padding-bottom: 32px; }
.card-titulo { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: 1.05rem; margin: 0 0 14px; }

/* Cadeia hierárquica: Grande/Jurisdicional → Bethel */
.jurisdicao-chain { display: flex; flex-direction: column-reverse; gap: 0; margin-bottom: 14px; }
.jchain-item { padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--plum-line); background: var(--cultured); }
.jchain-item.jchain-acima { border-color: var(--plum); background: #f7f2ff; }
.jchain-item.jchain-bethel { border-color: var(--opal); background: #fff6f4; }
.jchain-item.jchain-indefinido { border-style: dashed; background: #fafafa; color: #9a8aaa; }
.jchain-tipo { display: block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--plum); margin-bottom: 2px; }
.jchain-nome { font-family: var(--fd); font-weight: 600; color: var(--indigo); font-size: .97rem; }
.jchain-sigla { font-size: .8rem; color: #7a6b91; margin-left: 6px; }
.jchain-seta { text-align: center; color: var(--plum); font-size: .9rem; padding: 2px 0; opacity: .6; }
.jurisdicao-nota { font-size: .82rem; color: #7a6b91; margin: 0; line-height: 1.5; }

/* Form de edição */
.form-jurisdicao { display: flex; flex-direction: column; gap: 16px; }
.campo-toggle { display: flex; flex-direction: column; gap: 4px; }
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.toggle-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--plum); cursor: pointer; }

/* Oculta o hidden dentro do toggle para evitar duplicação visual */
.campo-toggle input[type="hidden"] { display: none; }

/* =============================================================================
   TELAS INTERNAS — componentes compartilhados (Reunião, Gestão, Sistema, Conta)
   Fonte única do visual dessas telas; as views não redefinem card/tabela/campo.
   ============================================================================= */
/* Botões utilitários */
.btn-sm { padding: 8px 14px; font-size: .84rem; border-radius: 11px; }
.btn-perigo { background: #fff; color: #b3261e; border: 1.5px solid #f5c6c2; box-shadow: none; }
.btn-perigo:hover { background: var(--opal-soft); }
.btn-ok { background: var(--mint-soft); color: var(--mint); border: 1.5px solid #bfe9da; box-shadow: none; }
.btn-ok:hover { background: #d3f0e5; }

/* Cabeçalho de card com ações à direita */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head .card-titulo { margin: 0; }
.head-acoes { display: flex; gap: 6px; flex-wrap: wrap; }

/* Cabeçalho de lista (título + ação principal), como na tela Filhas */
.lista-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }

/* Tabelas da marca (gestões, usuários, reuniões, despesas, relatórios) */
.tabela-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabela, .tabela-dados { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela th, .tabela-dados th { text-align: left; padding: 11px 14px; background: var(--plum-soft);
  font-family: var(--fd); font-weight: 600; font-size: .78rem; color: var(--indigo); white-space: nowrap; }
.tabela td, .tabela-dados td { padding: 10px 14px; border-top: 1px solid var(--plum-soft); vertical-align: middle; }
.tabela tbody tr:hover td, .tabela-dados tbody tr:hover td { background: #faf7ff; }
.celula-sub { color: #9a8bb3; font-size: .8rem; }
.tr-inativo td { opacity: .55; }
.acoes { white-space: nowrap; }
.acoes form, .form-inline { display: inline; }

/* Campos de formulário (complementa o .campo do login) */
.campo label { font-size: .74rem; font-weight: 600; color: var(--indigo); }
.campo textarea { font-family: var(--fb); font-size: 16px; padding: 12px 13px; color: var(--ink);
  border: 1.5px solid var(--plum-line); border-radius: 12px; background: var(--cultured); outline: 0;
  transition: .16s; width: 100%; resize: vertical; }
.campo textarea:focus { border-color: var(--plum); background: #fff; box-shadow: 0 0 0 4px var(--plum-soft); }
.campo small, .card-desc { color: #8576a0; font-size: .78rem; line-height: 1.45; }
.card-desc { display: block; margin: -6px 0 14px; }
.campo-grid { display: grid; grid-template-columns: 1fr; gap: 13px; }
@media (min-width: 520px) { .campo-grid { grid-template-columns: 1fr 1fr; } }
/* pilha de campos dentro de um card */
.fcampos { display: grid; gap: 14px; }
.obrig { color: var(--opal); }
.radio-group { display: flex; gap: 18px; flex-wrap: wrap; }
.radio-item, .label-check { display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: .9rem; font-weight: 500; color: var(--ink); }
.radio-item input, .label-check input[type="checkbox"] { accent-color: var(--plum); width: 17px; height: 17px; }

/* Formulário em coluna com teto de leitura (cards empilhados com respiro) */
.form-estreito { max-width: 640px; display: flex; flex-direction: column; gap: 18px; }
.form-estreito .form-acoes { justify-content: flex-end; }

/* Badges de situação (tokens da marca) */
.badge-status { font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-status.ativo { background: var(--mint-soft); color: var(--mint); }
.badge-status.inativo { background: var(--cultured); color: #8576a0; }
.vazio { color: #8576a0; font-style: italic; padding: 16px 0; }

/* Barra de salvar/resumo que acompanha a rolagem (chamada, configurações) */
.barra-fixa { position: sticky; bottom: 12px; z-index: 5; background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px); border: 1.5px solid var(--plum-line); border-radius: 14px;
  padding: 12px 16px; box-shadow: var(--shadow-pop); }
@media (max-width: 759.98px) {
  /* acima do bottomnav no celular */
  .barra-fixa { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* Abas internas (Sistema e Gestão) — antes duplicadas inline nos partials */
.sistema-tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 2px solid var(--plum-line); }
.stab { font-family: var(--fd); font-size: .92rem; font-weight: 600; color: var(--indigo);
  padding: 8px 18px 9px; border-radius: 10px 10px 0 0; border: 1.5px solid transparent;
  border-bottom: none; text-decoration: none; transition: background .15s; }
.stab:hover { background: var(--plum-soft); }
.stab-ativo { background: #fff; border-color: var(--plum-line); border-bottom: 2px solid #fff;
  margin-bottom: -2px; color: var(--plum); }

/* =============================================================================
   MOVIMENTO — micro-interações, entrada de conteúdo e ambiente (login/hero).
   Adaptado dos protótipos. Tudo desligado em prefers-reduced-motion (acessível).
   ============================================================================= */

/* Micro-interações: hover/foco já têm transition nos componentes; reforços: */
.kpi, .filha-card, .mens-card, .btn, .btn-novo, .btn-entrar, .comp-btn,
.menu-item, .campo input, .campo select, .btn-sair { transition: transform .18s ease, box-shadow .18s ease, background-color .16s ease, color .16s ease, border-color .16s ease; }
.comp-btn:hover { transform: translateY(-1px); }
.menu-item:hover { color: var(--indigo); }

/* Entrada suave do conteúdo ao carregar a página */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.conteudo > section { animation: fadeUp .42s ease both; }
/* escalona a entrada de listas (cards entram em cascata) */
.filha-lista > li, .mens-lista > li, .kpis > .kpi { animation: fadeUp .42s ease both; }
.filha-lista > li:nth-child(2), .mens-lista > li:nth-child(2), .kpis > .kpi:nth-child(2) { animation-delay: .05s; }
.filha-lista > li:nth-child(3), .mens-lista > li:nth-child(3), .kpis > .kpi:nth-child(3) { animation-delay: .10s; }
.filha-lista > li:nth-child(4), .mens-lista > li:nth-child(4) { animation-delay: .15s; }
.filha-lista > li:nth-child(n+5), .mens-lista > li:nth-child(n+5) { animation-delay: .20s; }

/* ---- Ambiente decorativo (camada de fundo do login/hero) ---- */
.fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; border-radius: inherit; }
.fx > * { position: absolute; }
.login-hero > *:not(.fx) { position: relative; z-index: 1; }
.hero > *:not(.fx) { position: relative; z-index: 2; }

/* aurora: blobs de gradiente que derivam lentamente */
.aurora { border-radius: 50%; filter: blur(60px); will-change: transform; }
.aurora.a1 { width: 60%; height: 90%; left: -12%; top: -20%; opacity: .5; background: radial-gradient(circle at 35% 35%, #b389ff, transparent 70%); animation: drift1 28s ease-in-out infinite; }
.aurora.a2 { width: 55%; height: 80%; right: -14%; top: -10%; opacity: .5; background: radial-gradient(circle at 60% 40%, #ff9d86, transparent 70%); animation: drift2 32s ease-in-out infinite; }
.aurora.a3 { width: 70%; height: 90%; left: 20%; bottom: -40%; opacity: .35; background: radial-gradient(circle at 50% 50%, #7c5cff, transparent 70%); animation: drift3 36s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(8%,6%) scale(1.12); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-7%,7%) scale(1.08); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-6%,-7%) scale(1.1); } }

/* halo: brilho central que respira (login) */
.halo { left: 50%; top: 14%; width: 280px; height: 280px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.45), rgba(255,255,255,0) 64%); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: .5; transform: translateX(-50%) scale(1); } 50% { opacity: .9; transform: translateX(-50%) scale(1.12); } }

/* bokeh: bolhas de luz subindo */
.bokeh { bottom: -10%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.85), rgba(255,255,255,0) 72%); animation: rise linear infinite; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 14% { opacity: .7; } 86% { opacity: .4; } 100% { transform: translateY(-320px); opacity: 0; } }

/* spark: cintilação */
.spark { opacity: 0; color: #fff; animation: twinkle ease-in-out infinite; }
.spark svg { display: block; width: 100%; height: 100%; }
@keyframes twinkle { 0%,100% { opacity: 0; transform: scale(.35) rotate(0); } 50% { opacity: .95; transform: scale(1) rotate(35deg); } }

/* sweep: brilho diagonal passando pelo hero */
.sweep { top: 0; bottom: 0; left: -65%; width: 40%; transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  animation: sweep 9s ease-in-out infinite; }
@keyframes sweep { 0% { left: -65%; } 55%,100% { left: 135%; } }

/* glow: emblema do login pulsando luz */
.login-hero .emblema { animation: glow 4.5s ease-in-out infinite; }
@keyframes glow {
  0%,100% { filter: drop-shadow(0 6px 14px rgba(0,0,0,.28)); }
  50% { filter: drop-shadow(0 6px 14px rgba(0,0,0,.28)) drop-shadow(0 0 22px rgba(255,255,255,.55)); }
}

/* =============================================================================
   NAVEGAÇÃO FLUIDA — View Transitions entre páginas (progressivo: navegadores
   sem suporte simplesmente ignoram). O truque: menu, topbar e bottomnav têm
   nome próprio e ficam PARADOS enquanto só o conteúdo faz o crossfade —
   sensação de app, sem virar SPA (continua HTML puro, sem build).
   ============================================================================= */
@view-transition { navigation: auto; }
.menu { view-transition-name: menu; }
.topbar { view-transition-name: topbar; }
.bottomnav { view-transition-name: bottomnav; }
::view-transition-old(root) { animation-duration: .16s; }
::view-transition-new(root) { animation-duration: .22s; }

/* =============================================================================
   ACABAMENTO — micro-interações, scrollbar e seleção com a cara da marca
   ============================================================================= */
/* pressionar = afundar de leve (resposta tátil) */
.btn:active, .btn-novo:active, .btn-entrar:active, .btn-registrar:active,
.btn-confirmar:active, .btn-secundario:active, .btn-sair:active, .comp-btn:active,
.menu-item:active, .atalho:active { transform: translateY(0) scale(.97); }

::selection { background: #e6d6f7; color: var(--indigo); }
html { scrollbar-color: #cbb8ea #f4eefb; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--plum-line); border-radius: 8px; border: 2px solid #f4eefb; }
::-webkit-scrollbar-thumb:hover { background: var(--plum); }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; }

/* Acessibilidade: desliga TODO movimento se o usuário pedir */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ── 2FA (passkeys) ─────────────────────────────────────────────────────────
   Nudge opcional (login sem 2FA) + listagem de chaves de acesso. */
.nudge-2fa {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 14px 16px 0; padding: 10px 14px; border-radius: 12px;
  background: linear-gradient(90deg, #f3ecfa, #fff6f4);
  border: 1px solid #e3d3f2; color: #3d1072; font-size: .92rem;
}
.nudge-2fa a { color: #ef6351; font-weight: 600; text-decoration: none; white-space: nowrap; }
.nudge-2fa a:hover { text-decoration: underline; }
.conta-2fa .lista-passkeys li:first-child { border-top: none; }
