/* Documentos escolares: A4, sem dependências externas (serve para tela, impressão e PDF). */
:root { --azul: #007CFC; --azul-escuro: #0A4A94; --tinta: #111; --suave: #EAF3FF; }
* { box-sizing: border-box; }
body { margin: 0; background: #EEF3FA; color: var(--tinta); font-family: Georgia, "Times New Roman", serif; font-size: 12pt; line-height: 1.5; }
h1, h2, h3, .barra, .doc-escola, th { font-family: "Helvetica Neue", Arial, sans-serif; }

/* barra de ações (só na tela) */
.barra { max-width: 210mm; margin: 1rem auto 0; padding: 0 .5rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: 14px; }
.barra .btn { display: inline-block; padding: .45rem 1rem; border-radius: 999px; border: 2px solid var(--azul); background: #fff; color: var(--azul-escuro); font-weight: 700; text-decoration: none; cursor: pointer; font-family: inherit; font-size: 14px; }
.barra .btn-primario { background: var(--azul); color: #fff; }
.barra form { display: inline-flex; gap: .4rem; align-items: center; }
.barra input[type=text] { padding: .4rem .7rem; border: 2px solid #B9D6FA; border-radius: 10px; font-size: 14px; }
.barra .btn-perigo { border-color: #B33; color: #8A1C1C; }
.aviso { max-width: 210mm; margin: .6rem auto 0; padding: .6rem 1rem; background: #FFF3B0; border: 2px solid #E8CC1A; border-radius: 10px; font-family: Arial, sans-serif; font-size: 13px; }
.mensagens { max-width: 210mm; margin: .6rem auto 0; font-family: Arial, sans-serif; font-size: 13px; }
.mensagens p { margin: .2rem 0; padding: .5rem 1rem; border-radius: 10px; background: var(--suave); }
.mensagens .error { background: #FFD9D9; }

/* folha */
.doc { position: relative; max-width: 210mm; margin: 1rem auto 2rem; padding: 16mm; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.doc-head { display: flex; gap: 14px; align-items: center; border-bottom: 3px solid var(--azul); padding-bottom: 8px; margin-bottom: 18px; }
.doc-logo { width: 22mm; height: auto; flex: none; }
.doc-escola { font-size: 17pt; font-weight: 700; color: var(--azul-escuro); line-height: 1.15; }
.doc-linha { font-size: 9pt; color: #333; line-height: 1.35; }
.doc-titulo { text-align: center; text-transform: uppercase; letter-spacing: .04em; font-size: 15pt; margin: 6mm 0 8mm; }
.doc-texto { text-align: justify; text-indent: 12mm; margin: 0 0 4mm; }
.doc-sem-recuo { text-indent: 0; }
.doc h2 { font-size: 11pt; margin: 6mm 0 2mm; padding: 1mm 2.5mm; background: var(--suave); border-left: 4px solid var(--azul); text-transform: uppercase; letter-spacing: .03em; }
.doc-tabela { width: 100%; border-collapse: collapse; font-size: 10pt; margin-bottom: 3mm; }
.doc-tabela th, .doc-tabela td { border: 1px solid #888; padding: 1mm 2mm; vertical-align: top; text-align: left; }
.doc-tabela th { background: #F3F8FF; font-size: 9pt; }
.doc-tabela .num { text-align: center; }
.periodo { break-inside: avoid; margin-bottom: 5mm; }
.parecer { font-size: 10.5pt; text-align: justify; border: 1px solid #888; padding: 2mm 3mm; margin: 0 0 3mm; white-space: pre-line; }
.nota { font-size: 9.5pt; color: #333; font-style: italic; margin: 3mm 0; }
.local-data { margin-top: 10mm; text-align: center; }
.assinaturas { display: flex; gap: 14mm; margin-top: 18mm; break-inside: avoid; }
.assinaturas > div { flex: 1; text-align: center; border-top: 1px solid #000; padding-top: 1.5mm; font-size: 10pt; line-height: 1.3; }
.doc-rodape { margin-top: 10mm; padding-top: 2mm; border-top: 1px solid #aaa; font-size: 8.5pt; color: #444; display: flex; justify-content: space-between; gap: 8px; }
.foto-3x4 { width: 28mm; height: 37mm; border: 1px solid #888; display: flex; align-items: center; justify-content: center; font-size: 8pt; color: #777; flex: none; overflow: hidden; }
.foto-3x4 img { width: 100%; height: 100%; object-fit: cover; }
.topo-ficha { display: flex; gap: 6mm; align-items: flex-start; }
.topo-ficha > div:first-child { flex: 1; }
.destaque-saude { border: 2px solid #E8CC1A; background: #FFFBD1; padding: 2mm 3mm; margin-bottom: 3mm; font-size: 10.5pt; }
.watermark { position: fixed; top: 38%; left: 0; right: 0; text-align: center; font: 700 100pt Arial, sans-serif; color: rgba(190, 0, 0, .16); transform: rotate(-24deg); pointer-events: none; z-index: 5; }
.anulado-faixa { border: 3px solid #B00; color: #B00; text-align: center; font: 700 12pt Arial, sans-serif; padding: 2mm; margin-bottom: 5mm; }

@page { size: A4; margin: 16mm 14mm 18mm; @bottom-center { content: "Página " counter(page) " de " counter(pages); font: 8.5pt Arial, sans-serif; color: #555; } }
@media print {
  body { background: #fff; }
  .barra, .aviso, .mensagens { display: none !important; }
  .doc { margin: 0; padding: 0; max-width: none; box-shadow: none; }
  .doc h2, .doc-tabela th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Folha de ponto (uma página A4 por professor) ---------- */
.doc-compacto .doc-head { margin-bottom: 6px; padding-bottom: 5px; gap: 10px; }
.doc-compacto .doc-logo { width: 13mm; }
.doc-compacto .doc-escola { font-size: 13pt; }
.doc-compacto .doc-linha { font-size: 7.5pt; line-height: 1.2; }
.doc-compacto .doc-titulo { margin: 1.5mm 0 2.5mm; font-size: 12.5pt; }
.doc-compacto .doc-tabela.ident { font-size: 9pt; margin-bottom: 2mm; }
.doc-compacto .doc-tabela.ident th, .doc-compacto .doc-tabela.ident td { padding: .5mm 2mm; }
.ponto { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8.5pt; font-family: Arial, sans-serif; }
.ponto th, .ponto td { border: 1px solid #666; padding: 0 1.2mm; height: 5.2mm; text-align: center; overflow: hidden; }
.ponto th { background: #F3F8FF; font-size: 7.5pt; height: 6mm; line-height: 1.1; }
.ponto tr.fechado td { background: #EEF1F5; color: #444; font-size: 7.5pt; }
.ponto td.rotulo { text-align: left; font-style: italic; white-space: nowrap; text-overflow: ellipsis; }
.ponto-totais { display: flex; gap: 8mm; margin-top: 2.5mm; font-size: 9pt; font-family: Arial, sans-serif; }
.ponto-totais span { flex: 1; border-bottom: 1px solid #000; padding-bottom: 1mm; }
.doc-compacto .assinaturas { margin-top: 8mm; }
.folha-ponto + .folha-ponto { break-before: page; }
