/* Meu Prontuário — identidade aprovada na primeira versão: papel creme, verde
   profundo, sálvia e argila; Fraunces nos títulos. Pensado primeiro para o
   celular (barra de abas embaixo); no computador vira menu lateral. */
:root {
  --bg: #FAF7F2; --ink: #2B3B35; --sage: #7C9885; --sage-deep: #5C7A66; --clay: #C97D60;
  --danger: #B7543F; --danger-bg: #F6DED7; --line: #E4DFD5; --muted: #686E67; --panel: #FFFFFF;
  --suave: #F3EFE8; --hoje: #EEF3EF; --wa: #1E6B3A; --wa-bg: #E3F2E7; --video: #2F5C94; --video-bg: #E6EEF8;
  --sombra: 0 1px 2px rgba(43, 59, 53, .05), 0 6px 18px rgba(43, 59, 53, .06);
  --sombra-forte: 0 2px 4px rgba(43, 59, 53, .05), 0 18px 40px rgba(43, 59, 53, .13);
  --acesso-fundo: rgba(250, 247, 242, .97); --acesso-cartao: #fff; --acesso-texto: var(--ink); --acesso-fraco: var(--muted);
  --acesso-destaque: var(--sage-deep); --acesso-texto-botao: #fff; --acesso-borda: var(--line); --acesso-campo: #fff;
  --acesso-erro: var(--danger); --acesso-fonte: 'Inter', system-ui, sans-serif;
  --campo: #FFFFFF; --mistura: #FFFFFF; --contraste: #000000; --divisoria: #F1ECE3; --hover: #F1ECE3;
  --aviso-bg: #FBF1EA; --aviso-borda: #F1DDCF; --aviso-texto: #A2593C; --ok-bg: #E4EEE7; --listra: #FBF3EE;
  --fora: #FCFBF8; --fora-texto: #B9B5AC; --hoje-col: #FBFCFB; --barra-abas: rgba(255, 255, 255, .93);
  --festa-1: #FBEBDD; --festa-2: #F4F0E6; --festa-borda: #EFD6C3; --pagamento-bg: #F4EEDC; --pagamento-texto: #7A5B12;
  --lateral: #2B3B35; --sobre-cor: #FFFFFF;
}
/* Tema escuro: à noite (automático) ou fixo nos Ajustes — html[data-tema="escuro"]. */
:root[data-tema="escuro"] {
  --bg: #151D1A; --ink: #E9E4DA; --sage: #8FAD98; --sage-deep: #A8C6B1; --clay: #D58C70;
  --danger: #E5917A; --danger-bg: #3B2621; --line: #2F3B35; --muted: #9DA79F; --panel: #1E2824;
  --suave: #26312C; --hoje: #22302A; --wa: #8ED3A5; --wa-bg: #1C3226; --video: #A3C1EA; --video-bg: #1E2938;
  --sombra: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .25);
  --sombra-forte: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .45);
  --acesso-fundo: rgba(21, 29, 26, .97); --acesso-cartao: #1E2824; --acesso-texto-botao: #151D1A; --acesso-campo: #26312C;
  --campo: #26312C; --mistura: #1E2824; --contraste: #FFFFFF; --divisoria: #29342F; --hover: #2A3631;
  --aviso-bg: #3A2B21; --aviso-borda: #56402F; --aviso-texto: #EDAA88; --ok-bg: #22362B; --listra: #2A2521;
  --fora: #19221E; --fora-texto: #5E6862; --hoje-col: #1B2521; --barra-abas: rgba(21, 29, 26, .93);
  --festa-1: #3A2B22; --festa-2: #26312C; --festa-borda: #56402F; --pagamento-bg: #383120; --pagamento-texto: #E7CA74;
  --lateral: #101714; --sobre-cor: #151D1A;
  color-scheme: dark;
}
:root[data-tema="escuro"] .ceu .engrenagem { color: rgba(250, 247, 242, .75); background: rgba(255, 255, 255, .08); }
:root[data-tema="escuro"] .abas .mais { background: var(--sage); color: #151D1A; }
:root[data-tema="escuro"] .btn.primario:hover { background: var(--sage); border-color: var(--sage); color: #151D1A; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: 'Inter', system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.ic.p { width: 18px; height: 18px; }
.ponto { width: 10px; height: 10px; border-radius: 50%; background: var(--sage); animation: respirar 4s ease-in-out infinite; flex: 0 0 auto; }
@keyframes respirar { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.35); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ponto, .tl-ponto { animation: none !important; } }

/* ---------- moldura: abas (celular) e menu lateral (computador) ---------- */
#tela { padding: 0 16px calc(104px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; }
.lateral { display: none; }
.abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--barra-abas); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
        border-top: 1px solid var(--line); }
.abas a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; font-size: 11px; font-weight: 500; color: var(--muted); }
.abas a.ativa { color: var(--sage-deep); }
.abas a.ativa .ic { stroke-width: 2.3; }
.abas .mais { justify-self: center; width: 56px; height: 56px; margin-top: -24px; border-radius: 50%; border: 4px solid var(--bg); background: var(--lateral); color: #FAF7F2;
              display: grid; place-items: center; box-shadow: 0 8px 20px rgba(43, 59, 53, .3); }
.abas .mais .ic { width: 26px; height: 26px; stroke-width: 2.2; }
@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 236px 1fr; }
  .abas { display: none; }
  .lateral { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 26px 14px 20px; background: var(--lateral); color: #FAF7F2; }
  .lateral .marca { display: flex; align-items: center; gap: 10px; padding: 0 10px; margin-bottom: 28px; font-family: 'Fraunces', serif; font-size: 19px; font-weight: 500; }
  .lateral .marca img { width: 30px; height: 30px; border-radius: 8px; flex: none; }
  .lateral a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: rgba(250, 247, 242, .72); font-weight: 500; font-size: 15px; }
  .lateral a:hover { background: rgba(255, 255, 255, .06); color: #FAF7F2; }
  .lateral a.ativa { background: rgba(124, 152, 133, .3); color: #fff; }
  .lateral .nova { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 0; border-radius: 12px; background: var(--sage); color: #fff; font-weight: 600; }
  .lateral .nova:hover { background: var(--sage-deep); }
  #tela { width: 100%; padding: 26px 34px 48px; }
}
/* Notebook pequeno e tablet deitado: menu lateral só com os ícones, para a
   tela ter espaço (o nome aparece ao parar o mouse em cima). */
@media (min-width: 900px) and (max-width: 1199px) {
  .app { grid-template-columns: 76px 1fr; }
  .lateral { align-items: center; padding: 22px 10px 18px; }
  .lateral .marca { padding: 0; margin-bottom: 22px; }
  .lateral .marca span, .lateral a span, .lateral .nova span { display: none; }
  .lateral a { justify-content: center; width: 52px; padding: 13px 0; }
  .lateral .nova { width: 52px; height: 52px; padding: 0; border-radius: 50%; }
  #tela { padding: 22px 24px 40px; }
}

/* ---------- peças comuns ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 9px 14px; font-weight: 500; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primario { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primario:hover { background: var(--sage-deep); border-color: var(--sage-deep); }
.btn.perigo { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn.icone { width: 40px; padding: 9px 0; }
.pagina-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(18px + env(safe-area-inset-top)) 0 14px; }
.pagina-topo h1 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 30px; margin: 0; letter-spacing: -.01em; }
@media (min-width: 900px) { .pagina-topo { padding-top: 0; } }
.voltar { display: inline-flex; align-items: center; gap: 2px; color: var(--sage-deep); font-weight: 600; font-size: 15px; margin-left: -6px; padding: 6px; }
.cartao { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--sombra); }
.cartao + .cartao { margin-top: 12px; }
.cartao h2 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 18px; margin: 0 0 12px; }
.avatar { --tam: 42px; width: var(--tam); height: var(--tam); border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-weight: 600; font-size: calc(var(--tam) * .36);
          background: color-mix(in srgb, var(--cor, var(--sage)) 20%, var(--mistura)); color: color-mix(in srgb, var(--cor, var(--sage)) 78%, var(--contraste)); letter-spacing: .02em; }
.chip { font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--suave); color: var(--muted); white-space: nowrap; }
.chip.confirmado { background: var(--ok-bg); color: var(--sage-deep); }
.chip.faltou { background: var(--danger-bg); color: var(--danger); }
.chip.cancelado { text-decoration: line-through; }
.chip.aguardando { background: var(--aviso-bg); color: var(--aviso-texto); }
.vazio { display: block; text-align: center; color: var(--muted); padding: 26px 16px; font-size: 14px; line-height: 1.55; }
a.vazio b { color: var(--sage-deep); }
.vazio .ic { width: 34px; height: 34px; color: var(--sage); display: block; margin: 0 auto 8px; stroke-width: 1.5; }
.secao { margin-top: 26px; }
.secao-titulo { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; margin: 0 2px 10px; }
.secao-titulo h2 { white-space: nowrap; }
.secao-titulo h2 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 21px; margin: 0; }
.secao-titulo small { font-size: 13px; color: var(--muted); }
.secao-titulo a { font-size: 13.5px; color: var(--sage-deep); font-weight: 600; }
.redondo { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: 0 0 auto; background: var(--suave); color: var(--ink); }
.redondo.whats { background: var(--wa-bg); color: var(--wa); }
.redondo.ok { background: var(--ink); color: var(--bg); }

/* ---------- início ---------- */
.ceu { position: relative; overflow: hidden; margin: 0 -16px; padding: calc(20px + env(safe-area-inset-top)) 22px 84px; border-radius: 0 0 34px 34px; }
.ceu.manha { background: linear-gradient(165deg, #F6E1CB 0%, #F5ECDF 50%, #E3ECE2 100%); }
.ceu.tarde { background: linear-gradient(165deg, #D5E5D9 0%, #ECF1E6 55%, #F7ECDC 100%); }
.ceu.noite { background: linear-gradient(165deg, #1E2A26 0%, #2B3B35 58%, #3B4F46 100%); color: #FAF7F2; }
.ceu > * { position: relative; }
.ceu .enfeite { position: absolute; right: -12px; top: -8px; width: 200px; height: 200px; color: var(--sage-deep); pointer-events: none; }
.ceu.noite .enfeite { color: #A9C3B0; }
.marca-mini img { width: 20px; height: 20px; border-radius: 5px; }
.marca-mini { display: inline-flex; align-items: center; gap: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; letter-spacing: .04em; color: var(--muted); }
.ceu.noite .marca-mini, .ceu.noite .data { color: rgba(250, 247, 242, .68); }
.ceu .data { margin: 30px 0 6px; font-size: 14.5px; color: var(--muted); }
.saudacao { font-family: 'Fraunces', serif; font-weight: 500; font-size: 36px; line-height: 1.06; margin: 0; letter-spacing: -.015em; }
.saudacao em { font-style: italic; color: var(--sage-deep); }
.ceu.noite .saudacao em { color: #B9D2C0; }
.saudacao .poe-nome { display: block; margin-top: 8px; font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 500; color: var(--sage-deep); letter-spacing: 0; text-decoration: underline; text-underline-offset: 3px; }
.ceu.noite .saudacao .poe-nome { color: #B9D2C0; }
.resumo-dia { margin: 14px 0 0; font-size: 15.5px; line-height: 1.5; max-width: 32ch; }
.resumo-dia b { font-weight: 600; }

.proxima { position: relative; margin-top: -58px; background: var(--panel); border-radius: 24px; padding: 18px 18px 16px 22px; box-shadow: var(--sombra-forte); overflow: hidden; }
.proxima::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--cor, var(--sage)); opacity: .85; }
.proxima-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.falta { text-transform: none; letter-spacing: 0; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
         background: color-mix(in srgb, var(--cor, var(--sage)) 15%, var(--mistura)); color: color-mix(in srgb, var(--cor, var(--sage)) 70%, var(--contraste)); }
.proxima-corpo { display: flex; align-items: center; gap: 16px; margin: 14px 0 16px; cursor: pointer; }
.proxima-hora { flex: 0 0 auto; padding-right: 16px; border-right: 1px solid var(--line); }
.proxima-hora b { display: block; font-family: 'Fraunces', serif; font-size: 40px; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.proxima-hora small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.proxima-quem { display: flex; align-items: center; gap: 11px; min-width: 0; }
.proxima-quem b { display: block; font-size: 16.5px; font-weight: 600; line-height: 1.25; }
.proxima-quem small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.progresso { height: 5px; background: var(--suave); border-radius: 5px; overflow: hidden; margin: -4px 0 14px; }
.progresso i { display: block; height: 100%; background: var(--cor, var(--sage)); border-radius: 5px; }
.proxima-acoes { display: flex; gap: 8px; }
.acao { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 8px; border-radius: 13px; border: 0;
        background: var(--suave); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.acao.whats { background: var(--wa-bg); color: var(--wa); }
.acao.video { background: var(--video-bg); color: var(--video); }
.acao.confirmar { background: var(--ink); color: var(--bg); }
.proxima.livre { text-align: center; padding: 26px 20px; }
.proxima.livre p { margin: 6px 0 16px; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.proxima.livre .ic { width: 34px; height: 34px; color: var(--sage); stroke-width: 1.5; margin-bottom: 6px; }
.proxima.livre h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 22px; margin: 0; }

.numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.numeros > * { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 12px 13px 11px; text-align: left; }
.numeros b { display: block; font-family: 'Fraunces', serif; font-size: 28px; font-weight: 500; line-height: 1.1; }
.numeros span { font-size: 12px; color: var(--muted); }
.numeros .destaque { background: var(--aviso-bg); border-color: var(--aviso-borda); }
.numeros .destaque b { color: var(--aviso-texto); }

.linha-tempo { list-style: none; margin: 0; padding: 0; }
.linha-tempo li { position: relative; display: grid; grid-template-columns: 46px 20px 1fr; align-items: center; gap: 6px; padding: 5px 0; cursor: pointer; }
.linha-tempo li::before { content: ''; position: absolute; left: 61px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.linha-tempo li:first-child::before { top: 50%; }
.linha-tempo li:last-child::before { bottom: 50%; }
.linha-tempo li:only-child::before { display: none; }
.tl-hora { font-family: 'IBM Plex Mono', monospace; font-size: 13px; text-align: right; }
.tl-ponto { position: relative; z-index: 1; justify-self: center; width: 13px; height: 13px; border-radius: 50%; background: var(--panel); border: 3px solid var(--cor); }
.tl-card { display: flex; align-items: center; gap: 10px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 10px 12px; }
.tl-card .nome { flex: 1; min-width: 0; }
.tl-card b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-card small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.linha-tempo li.passou { opacity: .5; }
.linha-tempo li.passou .tl-ponto { background: var(--cor); }
.linha-tempo li.agora .tl-card { border-color: var(--cor); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor) 18%, transparent); }
.linha-tempo li.agora .tl-ponto { background: var(--cor); animation: pulsar 2s ease-out infinite; }
.linha-tempo li.st-cancelado .tl-card b { text-decoration: line-through; }
@keyframes pulsar { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cor) 45%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

.lista-linhas { list-style: none; margin: 0; padding: 4px 14px; }
.lista-linhas li { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--divisoria); }
.lista-linhas li:last-child { border-bottom: 0; }
.lista-linhas .texto { flex: 1; min-width: 0; cursor: pointer; }
.lista-linhas b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lista-linhas small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.lista-linhas .acoes-linha { display: flex; gap: 8px; }

.aniversarios { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
.aniversarios::-webkit-scrollbar { display: none; }
.aniv { scroll-snap-align: start; flex: 0 0 150px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.aniv b { font-weight: 600; font-size: 14.5px; }
.aniv small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.aniv.hoje { background: linear-gradient(160deg, var(--festa-1), var(--festa-2)); border-color: var(--festa-borda); }
.aniv.passou { opacity: .6; }
.aniv .parabens { margin-top: auto; font-size: 12.5px; font-weight: 600; color: var(--wa); }
@media (min-width: 900px) {
  .ceu { margin: 0; border-radius: 30px; padding: 30px 36px 34px; }
  .ceu .marca-mini { display: none; }
  .ceu .data { margin-top: 6px; }
  .inicio { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .inicio .col-a > .proxima { margin: 16px 0 0; }
  .inicio .col-b { padding-top: 4px; }
  .inicio .col-b > .secao:first-child { margin-top: 0; }
  .aniversarios { margin: 0; padding: 2px 0 8px; flex-wrap: wrap; }
}

/* ---------- topo do início e financeiro ---------- */
.ceu-topo { display: flex; align-items: center; justify-content: space-between; }
.engrenagem { width: 40px; height: 40px; margin: -8px -8px -8px 0; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: rgba(255, 255, 255, .45); }
.ceu.noite .engrenagem { color: rgba(250, 247, 242, .75); background: rgba(255, 255, 255, .08); }
@media (min-width: 900px) { .engrenagem { display: none; } }
.numeros .recebido b { color: var(--sage-deep); }
.numeros b { overflow-wrap: anywhere; }
.financeiro .numeros b { font-size: clamp(17px, 5.4vw, 26px); line-height: 1.3; white-space: nowrap; }
.ficha .numeros b { font-size: 21px; line-height: 1.35; }
.lista-linhas .texto small.situacao { font-weight: 500; color: var(--ink); }
.lista-linhas .texto small.situacao.pendente, .lista-linhas .texto small.situacao.parcial { color: var(--aviso-texto); }
.lista-linhas .texto small.situacao.sem_valor { color: var(--danger); }
.lista-linhas .acoes-linha { align-items: center; }
.lista-linhas.compacta { padding: 0; }
.lista-linhas.compacta li { padding: 9px 0; }
.dado dd .chip { margin-left: 6px; }
.contador { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.contador button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--campo); font-size: 22px; line-height: 1; }
.contador output { min-width: 32px; text-align: center; font-family: 'Fraunces', serif; font-size: 28px; }
.botao-pagamento { width: 100%; border: 0; background: var(--pagamento-bg); color: var(--pagamento-texto); font: inherit; font-weight: 600; font-size: 14px; }

/* ---------- gráficos e cartões do início ---------- */
.titulo-acoes { display: flex; align-items: center; gap: 10px; }
.olho { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; color: var(--muted); }
.painel-mes { display: grid; grid-template-columns: 104px 1fr; gap: 16px; align-items: center; }
.anel-caixa { position: relative; width: 104px; height: 104px; }
.anel { width: 100%; height: 100%; }
.anel-fundo { fill: none; stroke: var(--suave); stroke-width: 9; }
.anel-valor { fill: none; stroke: var(--sage-deep); stroke-width: 9; stroke-linecap: round; stroke-dasharray: var(--cheio) var(--volta); }
.animar .anel-valor { animation: encher 1s cubic-bezier(.2, .7, .3, 1); }
@keyframes encher { from { stroke-dasharray: 0 var(--volta); } }
.anel-centro { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.anel-centro b { font-family: 'Fraunces', serif; font-weight: 500; font-size: 24px; line-height: 1; }
.anel-centro small { font-size: 11px; color: var(--muted); margin-top: 3px; }
.painel-valores { margin: 0; display: grid; gap: 9px; }
.painel-valores div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.painel-valores dt { font-size: 13px; color: var(--muted); }
.painel-valores dd { margin: 0; font-family: 'Fraunces', serif; font-size: 19px; font-weight: 500; white-space: nowrap; }
.painel-valores .v-recebido { color: var(--sage-deep); font-size: 22px; }
.painel-valores .v-receber { color: var(--aviso-texto); }
.alerta-linha { display: block; margin-top: 8px; padding: 10px 14px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: 13.5px; font-weight: 600; }
.grafico-semana, .grafico-meses .colunas { display: flex; align-items: flex-end; gap: 6px; }
.grafico-semana { padding: 14px 12px 10px; }
.coluna-dia-sem, .coluna-mes { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: none; padding: 0; color: var(--ink); }
.coluna-dia-sem .valor, .coluna-mes .valor { font-size: 12px; font-weight: 600; min-height: 15px; white-space: nowrap; }
.coluna-dia-sem small, .coluna-mes small { font-size: 11.5px; color: var(--muted); }
.trilho { position: relative; width: 100%; max-width: 34px; height: 88px; border-radius: 9px; background: var(--suave); overflow: hidden; }
.trilho i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 9px; transform-origin: bottom; }
.coluna-dia-sem .trilho i { background: var(--sage); }
.coluna-dia-sem.passou .trilho i { background: color-mix(in srgb, var(--sage) 45%, var(--mistura)); }
.coluna-dia-sem.hoje .trilho i { background: var(--ink); }
.coluna-dia-sem.hoje small { color: var(--ink); font-weight: 700; }
.grafico-meses { padding: 14px 12px 10px; }
.coluna-mes .trilho { height: 104px; background: transparent; }
.coluna-mes .trilho .prev { background: color-mix(in srgb, var(--sage) 22%, var(--mistura)); border: 1px dashed color-mix(in srgb, var(--sage) 55%, var(--mistura)); }
.coluna-mes .trilho .rec { background: var(--sage-deep); }
.coluna-mes.atual .trilho .rec { background: var(--clay); }
.coluna-mes.atual small { color: var(--ink); font-weight: 700; }
.animar .trilho i { animation: crescer .8s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes crescer { from { transform: scaleY(0); } }
.legenda { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0; font-size: 11.5px; color: var(--muted); }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.legenda i.rec { background: var(--sage-deep); }
.legenda i.prev { background: color-mix(in srgb, var(--sage) 22%, var(--mistura)); border: 1px dashed color-mix(in srgb, var(--sage) 55%, var(--mistura)); }
@media (prefers-reduced-motion: reduce) { .animar .trilho i, .animar .anel-valor { animation: none; } }
/* No celular: uma coluna, com o dinheiro logo depois da próxima sessão. */
@media (max-width: 899px) {
  .inicio { display: flex; flex-direction: column; }
  .inicio .col-a, .inicio .col-b { display: contents; }
  .inicio .o-ceu { order: 1; } .inicio .proxima { order: 2; } .inicio .o-mes { order: 3; } .inicio .o-hoje { order: 4; }
  .inicio .o-semana { order: 5; } .inicio .o-hist { order: 6; } .inicio .o-conf { order: 7; } .inicio .o-aniv { order: 8; }
}

/* ---------- horários livres, folgas, expediente ---------- */
.ferramentas { display: flex; gap: 8px; margin: -4px 0 14px; flex-wrap: wrap; }
.ferramentas .btn { font-size: 13.5px; padding: 8px 12px; }
.livre-dia { padding: 10px 0; border-bottom: 1px solid var(--divisoria); }
.livre-dia:last-child { border-bottom: 0; }
.livre-dia b { display: block; font-size: 14px; margin-bottom: 8px; }
.horarios { display: flex; flex-wrap: wrap; gap: 6px; }
.horarios button { min-width: 56px; padding: 7px 10px; border-radius: 10px; border: 1px dashed var(--line); background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: line-through; }
.horarios button.ativo { border: 1px solid var(--sage); background: color-mix(in srgb, var(--sage) 16%, var(--mistura)); color: var(--ink); text-decoration: none; }
#lvLista { max-height: 46vh; overflow-y: auto; margin-bottom: 4px; }
.linha-exp { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--divisoria); }
.linha-exp .marcar { margin: 0; }
.linha-exp input[type="time"] { font-size: 15px; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--campo); color: var(--ink); }
.linha-exp input:disabled { opacity: .35; }
.linha-exp span { font-size: 13px; color: var(--muted); }

/* ---------- documentos ---------- */
.botao-documento { width: 100%; border: 0; background: var(--suave); color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; }
.pdf-pronto { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--sage-deep); font-weight: 600; }
.ir-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--ok-bg); }
.ir-total span { font-size: 13px; color: var(--muted); }
.ir-total b { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500; }
.redondo[data-copiar] { font-size: 11.5px; font-weight: 700; }

/* ---------- ficha por link ---------- */
@media (max-width: 480px) { .so-largo { display: none; } }
.link-ficha { padding: 12px; border-radius: 11px; background: var(--suave); font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.ficha-rodape { flex-wrap: wrap; }
.ficha-publica { max-width: 600px; margin: 0 auto; padding: calc(22px + env(safe-area-inset-top)) 16px 48px; }
.ficha-topo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ficha-topo h1 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 26px; margin: 0; }
.ficha-topo p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.ficha-intro { font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
.consentimento { align-items: flex-start; margin: 16px 2px; line-height: 1.5; font-size: 14px; }
.consentimento input { margin-top: 3px; flex: 0 0 auto; }
.ficha-aviso { text-align: center; padding: 30px 20px; }
.ficha-aviso h2 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 22px; margin: 0 0 8px; }
.ficha-aviso p { color: var(--muted); line-height: 1.55; margin: 0; }
.ficha-publica .acoes .btn { width: 100%; padding: 14px; font-size: 15.5px; }

/* ---------- prontuário (evoluções) ---------- */
.botao-evolucao { width: 100%; border: 0; background: var(--ink); color: var(--bg); font: inherit; font-weight: 600; font-size: 14px; }
.cofre-fechado { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px; border: 1px dashed var(--line); background: var(--panel); color: var(--ink); text-align: center; }
.cofre-fechado .ic { width: 30px; height: 30px; color: var(--sage-deep); }
.cofre-fechado span { font-size: 13px; color: var(--muted); }
.evolucoes { display: grid; gap: 8px; }
.evolucao { width: 100%; text-align: left; display: block; padding: 13px 14px; }
.evolucao + .evolucao { margin-top: 0; }
.ev-data { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.ev-texto { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; }
.texto-evolucao { min-height: 42vh !important; font-size: 16px; line-height: 1.55; }
#fev.trancado .campo:has(.texto-evolucao) { filter: blur(7px); pointer-events: none; user-select: none; }
.senha-cofre .nota { display: flex; gap: 6px; align-items: flex-start; }

/* ---------- Face ID ---------- */
.botao-faceid { width: 100%; margin: 4px 0 14px; display: inline-flex; justify-content: center; gap: 8px; }
#fev .botao-faceid { margin: 0 0 10px; }
.acesso-faceid { width: 100%; margin-top: 10px; padding: 13px; border-radius: 14px; border: 1px solid var(--acesso-borda); background: transparent;
  color: var(--acesso-texto); font: 600 15px var(--acesso-fonte); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.acesso-faceid .ic { width: 20px; height: 20px; }
.aparelhos { display: grid; gap: 4px; }
.aparelho { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.aparelho:last-child { border-bottom: 0; }
.aparelho > .ic { width: 22px; height: 22px; color: var(--sage-deep); flex: none; }
.aparelho .texto { flex: 1; min-width: 0; }
.aparelho .texto b { display: block; }
.aparelho .texto small { color: var(--muted); font-size: 12.5px; }
.cartao h2 .ic { vertical-align: -3px; }

/* ---------- perfil (foto) ---------- */
.foto-perfil { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; flex: none;
  background: var(--suave); color: var(--sage-deep); font-weight: 600; font-size: 15px; }
.foto-perfil.grande { width: 84px; height: 84px; font-size: 28px; font-family: 'Fraunces', serif; font-weight: 500; }
.foto-perfil.grande .ic { width: 34px; height: 34px; }
.perfil-foto { display: flex; align-items: center; gap: 16px; margin: 0 0 14px; }
.foto-grande { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; }
.foto-grande .foto-perfil { box-shadow: 0 0 0 4px var(--panel), 0 0 0 5px var(--line); }
.foto-camera { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); box-shadow: 0 0 0 3px var(--panel); }
.foto-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.foto-texto small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.link-acao { align-self: flex-start; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--danger); font-size: 13px; font-weight: 600; cursor: pointer; }
.engrenagem.com-foto { background: none; width: 44px; height: 44px; }
.engrenagem.com-foto .foto-perfil { width: 42px; height: 42px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); }
.perfil-lateral, .lateral .perfil-lateral[hidden] { display: none !important; }
@media (min-width: 900px) {
  .lateral .perfil-lateral:not([hidden]) { display: flex !important; align-items: center; gap: 10px; margin-top: auto; margin-bottom: 10px; padding: 10px; border-radius: 12px;
    color: #FAF7F2; background: rgba(255, 255, 255, .05); }
  .perfil-lateral:hover { background: rgba(255, 255, 255, .1); }
  .perfil-lateral span { display: flex; flex-direction: column; min-width: 0; }
  .perfil-lateral b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .perfil-lateral small { font-size: 12px; color: rgba(250, 247, 242, .6); }
  .perfil-lateral:not([hidden]) + .nova { margin-top: 0; }
  .lateral .perfil-lateral .foto-perfil { width: 36px; height: 36px; font-size: 13px; background: rgba(255, 255, 255, .12); color: #FAF7F2; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .lateral .perfil-lateral:not([hidden]) { padding: 6px; background: none; justify-content: center; }
  .perfil-lateral span { display: none !important; }
}
.ficha-topo .foto-perfil { width: 52px; height: 52px; }
/* Dois campos lado a lado só com espaço (e-mail é comprido). */
@media (max-width: 560px) { .linha.linha-larga { grid-template-columns: 1fr; } }

/* ---------- trava do app ---------- */
.trava { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; overflow-y: auto;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); }
.trava-caixa { width: min(360px, 100%); text-align: center; }
.trava-caixa img { border-radius: 18px; box-shadow: var(--sombra-forte); margin-bottom: 16px; }
.trava-caixa h1 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 28px; margin: 0; }
.trava-caixa > p { color: var(--muted); margin: 6px 0 24px; line-height: 1.5; }
.trava-face { width: 100%; padding: 15px; font-size: 16px; border-radius: 14px; }
.trava-senha { text-align: left; margin-top: 14px; }
.trava-senha .btn { width: 100%; padding: 13px; font-size: 15px; border-radius: 13px; margin-top: 4px; }
.trava-link { margin-top: 16px; background: none; border: 0; color: var(--sage-deep); font-weight: 600; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.trava-erro { color: var(--danger); min-height: 1.4em; margin: 12px 0 0; font-size: 14px; }
body.travado { overflow: hidden; }
body.escondido #app, body.escondido #modal { filter: blur(18px); }
.trava-ajuste { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--divisoria); }
.trava-ajuste .marcar { margin: 0 0 10px; }
/* Login: ícone do app; Face ID na frente, a senha como reserva. */
#acesso-tela .acesso-icone img { display: block; width: 34px; height: 34px; border-radius: 9px; }
#acesso-tela .acesso-faceid { margin: 4px 0 0; background: var(--acesso-destaque); color: var(--acesso-texto-botao); border: 0; }
#acesso-tela .acesso-ou { text-align: center; color: var(--acesso-fraco); font-size: 13px; margin: 18px 0 2px; }
#acesso-tela .acesso-botao.secundario { background: transparent; color: var(--acesso-texto); border: 1px solid var(--acesso-borda); }
.ok-linha { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; color: var(--sage-deep); font-weight: 600; font-size: 14px; }
/* QR code da ficha. */
.qr-ficha { margin-top: 14px; text-align: center; }
.qr-ficha svg { display: block; width: min(260px, 100%); height: auto; margin: 0 auto 8px; border-radius: 12px; border: 1px solid var(--line); }
.btn.ativo { background: var(--suave); border-color: var(--sage); }

/* ---------- avisos ---------- */
.linha-aviso { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 10px; }
.linha-aviso .marcar { margin: 0; }
.linha-aviso input[type="time"] { width: auto; min-width: 110px; font-size: 16px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--campo); color: var(--ink); }
.push-estado { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--suave); font-size: 14.5px; }
.push-estado .ic { width: 20px; height: 20px; color: var(--sage-deep); flex: none; }
.push-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.push-acoes .btn { flex: 1 1 auto; }

/* ---------- agenda ---------- */
.barra-agenda { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.barra-agenda .titulo { font-family: 'Fraunces', serif; font-size: 18px; margin-left: 6px; }
.visoes { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.visoes button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.visoes button.ativo { background: var(--ink); color: var(--bg); }
.grade { display: grid; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.grade .cab { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: center; font-size: 13px; }
.grade .cab b { display: block; font-family: 'Fraunces', serif; font-size: 18px; font-weight: 500; }
.grade .cab.hoje { background: var(--hoje); }
.grade .cab .feriado { display: block; color: var(--clay); font-size: 11px; margin-top: 2px; }
.coluna-horas { position: relative; border-right: 1px solid var(--line); }
.coluna-horas span { position: absolute; right: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); transform: translateY(-50%); }
.coluna-dia { position: relative; border-right: 1px solid var(--line); cursor: copy; }
.coluna-dia:last-child { border-right: 0; }
.coluna-dia.hoje { background: var(--hoje-col); }
.coluna-dia.feriado { background: repeating-linear-gradient(135deg, var(--panel), var(--panel) 8px, var(--listra) 8px, var(--listra) 16px); }
.linha-hora { position: absolute; left: 0; right: 0; border-top: 1px solid var(--divisoria); }
.agora { position: absolute; left: 0; right: 0; border-top: 2px solid var(--clay); z-index: 3; }
.bloco { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 4px 7px; font-size: 12.5px; line-height: 1.25; overflow: hidden; cursor: pointer; z-index: 2;
         background: color-mix(in srgb, var(--cor) 16%, var(--mistura)); border-left: 4px solid var(--cor); box-shadow: 0 1px 2px rgba(43, 59, 53, .08); }
.bloco b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bloco small { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); }
/* Na grade: tracejado = ainda não confirmou; riscado = cancelada. */
.bloco.st-aguardando { outline: 1.5px dashed color-mix(in srgb, var(--cor) 70%, var(--mistura)); outline-offset: -2px; }
.bloco.st-faltou { background: var(--danger-bg); border-left-color: var(--danger); }
.bloco.st-cancelado, .item.st-cancelado .nome { opacity: .5; text-decoration: line-through; }
.dia-lista { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; overflow: hidden; }
.dia-lista header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.dia-lista header b { font-family: 'Fraunces', serif; font-weight: 500; font-size: 16px; }
.dia-lista header .feriado { color: var(--clay); font-size: 12px; }
.dia-lista.hoje header { background: var(--hoje); }
.dia-lista .livre { padding: 12px 14px; color: var(--muted); font-size: 13px; }
.item { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--divisoria); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item .faixa { width: 5px; align-self: stretch; border-radius: 3px; background: var(--cor); flex: 0 0 auto; }
.item .hora { font-family: 'IBM Plex Mono', monospace; font-size: 13px; width: 50px; flex: 0 0 auto; }
.item .nome { flex: 1; min-width: 0; font-weight: 500; }
.item .nome small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.mes { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.mes .sem { padding: 8px 4px; text-align: center; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em; }
.mes .cel { min-height: 96px; border-right: 1px solid var(--divisoria); border-bottom: 1px solid var(--divisoria); padding: 6px; cursor: pointer; overflow: hidden; }
.mes .cel:nth-child(7n) { border-right: 0; }
.mes .cel.fora { background: var(--fora); color: var(--fora-texto); }
.mes .cel.hoje .num { background: var(--ink); color: var(--bg); border-radius: 50%; }
.mes .num { display: inline-grid; place-items: center; width: 24px; height: 24px; font-size: 13px; font-weight: 600; }
.mes .fer { display: block; color: var(--clay); font-size: 10.5px; line-height: 1.2; margin: 1px 0 3px; }
.mes .ev { display: flex; align-items: center; gap: 4px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mes .ev i { width: 7px; height: 7px; border-radius: 50%; background: var(--cor); flex: 0 0 auto; }
.mes .ev.st-cancelado { opacity: .45; text-decoration: line-through; }
.mes .ev.st-faltou span { color: var(--danger); }
.mes .mais { font-size: 11px; color: var(--muted); margin-top: 2px; }
@media (max-width: 640px) {
  .mes .cel { min-height: 62px; padding: 4px; }
  .mes .num { display: grid; margin-bottom: 3px; }
  .mes .ev span { display: none; }
  .mes .ev { display: inline-flex; margin-right: 2px; }
  .mes .fer { display: none; }
  .mes .cel.tem-feriado .num { color: var(--clay); }
}

/* ---------- pacientes ---------- */
.busca { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; color: var(--muted); }
.busca input { flex: 1; border: 0; outline: 0; background: transparent; padding: 12px 0; font-size: 16px; color: var(--ink); min-width: 0; }
.filtros { display: flex; gap: 6px; margin: 12px 0 6px; }
.filtros button { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; color: var(--muted); font-weight: 500; }
.filtros button.ativo { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.letra { font-family: 'Fraunces', serif; font-size: 15px; color: var(--sage-deep); margin: 16px 4px 6px; }
.lista-pacientes { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.linha-paciente { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--divisoria); }
.lista-pacientes li:last-child .linha-paciente { border-bottom: 0; }
.linha-paciente .texto { flex: 1; min-width: 0; }
.linha-paciente b { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha-paciente small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha-paciente .ic { color: #C2BDB2; }
.linha-paciente.arquivado { opacity: .6; }
@media (min-width: 900px) and (max-width: 1199px) { .pacientes-corpo { max-width: 720px; } }

.ficha { max-width: 720px; }
.ficha-capa { text-align: center; padding: 4px 0 6px; }
.ficha-capa .avatar { --tam: 84px; margin: 0 auto 12px; font-family: 'Fraunces', serif; font-weight: 500; box-shadow: 0 0 0 6px color-mix(in srgb, var(--cor) 10%, transparent); }
.ficha-capa h1 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 27px; margin: 0; line-height: 1.15; }
.ficha-capa p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ficha-acoes { display: flex; justify-content: center; gap: 22px; margin: 18px 0 4px; }
.ficha-acoes > * { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink); background: none; border: 0; padding: 0; }
.ficha-acoes .redondo { width: 50px; height: 50px; }
.ficha-acoes .off { opacity: .35; pointer-events: none; }
.dados { margin: 0; display: grid; gap: 0; }
.dado { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--divisoria); }
.dado:last-child { border-bottom: 0; padding-bottom: 2px; }
.dado:first-child { padding-top: 2px; }
.dado dt { color: var(--muted); font-size: 13.5px; flex: 0 0 auto; }
.dado dd { margin: 0; text-align: right; font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.dado dd a { color: var(--sage-deep); }
.ficha .nada { color: var(--muted); font-size: 13.5px; margin: 0; }
.ficha .nada a { color: var(--sage-deep); font-weight: 600; }
.texto-livre { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; margin: 0; }
.ficha-rodape { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }

/* ---------- formulários (tela cheia e janelas) ---------- */
.campo { display: grid; align-content: start; gap: 5px; font-size: 13px; color: var(--muted); margin-bottom: 12px; min-width: 0; }
.campo input, .campo select, .campo textarea { font-size: 16px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--campo); color: var(--ink); width: 100%; min-width: 0; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid color-mix(in srgb, var(--sage) 45%, transparent); outline-offset: 0; border-color: var(--sage); }
.campo input, .campo select { height: 46px; }
.campo input[type="checkbox"] { height: auto; }
.campo textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
.campo .dica { font-size: 12px; color: var(--muted); }
.linha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.linha3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; }
.cartao > .campo:last-child { margin-bottom: 0; }
.segmentos { display: flex; background: var(--suave); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.segmentos button { flex: 1; border: 0; background: transparent; padding: 9px 8px; border-radius: 9px; color: var(--muted); font-weight: 500; font-size: 14px; }
.segmentos button.ativo { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(43, 59, 53, .12); }
.rotulo { font-size: 13px; color: var(--muted); margin: 0 0 5px; }
.opcoes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.opcoes button { padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--campo); font-size: 13px; color: var(--muted); }
.opcoes button.ativo { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cores { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; justify-items: center; }
.cores button { width: 100%; max-width: 36px; aspect-ratio: 1; padding: 0; border-radius: 50%; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--line); }
.cores button.ativo { box-shadow: 0 0 0 2px var(--ink); }
.marcar { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }
.marcar input { width: 18px; height: 18px; accent-color: var(--sage-deep); }
.form-paciente { max-width: 720px; }
.form-paciente h2 small { font-family: 'Inter', sans-serif; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.barra-salvar { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; margin-top: 16px; padding: 10px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.barra-salvar .btn { width: 100%; padding: 14px; font-size: 15.5px; border-radius: 14px; }
@media (min-width: 900px) { .barra-salvar { bottom: 0; } .barra-salvar .btn { width: auto; padding: 12px 28px; } }

.fundo-modal { position: fixed; inset: 0; z-index: 50; background: rgba(43, 59, 53, .45); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .fundo-modal { align-items: center; } }
.janela { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--panel); border-radius: 22px 22px 0 0; padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 20px 60px rgba(43, 59, 53, .25); }
@media (min-width: 640px) { .janela { border-radius: 22px; } }
.janela h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 22px; margin: 0 0 14px; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.acoes .btn.primario { flex: 1; }
.nota { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin: -4px 0 12px; }
.whats-link { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--wa-bg); color: var(--wa); border-radius: 11px; padding: 11px 14px; font-weight: 600; font-size: 14px; margin-top: 4px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 13px 14px; margin-top: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--campo); font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 11px 16px;
         border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100vw - 32px); }
.toast.visivel { opacity: 1; }
.toast.erro { background: var(--danger); color: var(--sobre-cor); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- tela larga (fica no fim: vale sobre as larguras de cima) ---------- */
/* Formulários (cadastro, ajustes): duas colunas na tela larga. */
.colunas-form .col + .col { margin-top: 12px; }
@media (min-width: 1200px) {
  .ficha, .form-paciente, .pacientes-corpo { max-width: 1120px; }
  .ficha-grade { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 26px; align-items: start; }
  .ficha .numeros { max-width: 640px; margin-left: auto; margin-right: auto; }
  .colunas-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
  .colunas-form .col + .col { margin-top: 0; }
  .grupos-pacientes { columns: 2; column-gap: 22px; }
  .grupo-letra { break-inside: avoid; -webkit-column-break-inside: avoid; display: inline-block; width: 100%; }
  .grupo-letra .letra { margin-top: 6px; }
}
