/* =====================================================================
   Estilos de los documentos imprimibles (también usados en la vista previa).
   Las medidas se expresan en mm/pt para que el resultado impreso sea fiel.
   ===================================================================== */
/* Fuentes de los formularios originales (licencia OFL, ver fonts/LEEME.txt) */
@font-face { font-family: 'Montserrat'; src: url('../fonts/Montserrat-Bold.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: 'Roboto'; src: url('../fonts/Roboto-Regular.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: 'Roboto'; src: url('../fonts/Roboto-Bold.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: 'Roboto'; src: url('../fonts/Roboto-Italic.ttf') format('truetype'); font-weight: 400; font-style: italic; font-display: block; }
/* Réplica exacta: la hoja ya trae sus márgenes; se imprime con margen 0 */
.hoja-exacta { position: relative; overflow: hidden; padding: 0 !important; margin: 0; background: #fff; }
.hoja-exacta svg { display: block; }
.papel.papel-exacto { padding: 0; width: max-content; min-height: 0; }
/* Documentos de Word (medidas del original) */
.wd { color: #000; }
.wd-mem, .wd-cuerpo, .wd-pie { position: absolute; }
.wd p { margin: 0; }
.wd-sym { font-family: 'Segoe UI Symbol', 'Segoe UI', 'DejaVu Sans', sans-serif; font-weight: normal; }
.hoja.wd-permiso { font-family: 'Times New Roman', Times, serif; }
.wd-permiso .wd-cuerpo { font-size: 10.5pt; line-height: 12.06pt; text-align: justify; }
/* texto fijo: cada línea donde la cortó Word, justificada al ancho (Word comprime un poco los espacios) */
.wd-l { display: block; text-align: justify; text-align-last: justify; word-spacing: -1.2pt; white-space: nowrap; }
.wd-u { display: block; text-align: left; white-space: nowrap; }
.wd-ind { padding-left: 36pt; }
.wd-permiso .wd-cuerpo > p { margin-bottom: 2pt; }
.wd-permiso .wd-titulo { font-size: 13pt; line-height: 14.94pt; font-weight: bold; text-align: center; margin-bottom: 3.5pt !important; }
.wd-sangria { text-indent: 36pt; }
.wd-just { display: block; text-align: justify; text-align-last: justify; }
.wd-tabla { width: 441.6pt; border-collapse: collapse; table-layout: fixed; }
.wd-tabla th, .wd-tabla td { border: .4pt solid #000; padding: 0 5.4pt; text-align: left; font-weight: normal; }
.wd-tabla th { font-size: 9.6pt; line-height: 11pt; font-weight: bold; }
.wd-tabla td { line-height: 12.2pt; }
.wd-aprob { line-height: 13.6pt !important; }
/* «Observaciones» con interlineado 1.5: rayas a 1.15 pt bajo la línea base, separadas 18 pt */
.wd-obs { position: relative; height: 12.06pt; margin-bottom: 5.94pt !important; }
.wd-aprob + .wd-obs { margin-top: -1.45pt; }
.wd-raya { position: absolute; right: 9.45pt; top: 10.73pt; border-top: .6pt solid #000; }
.wd-obs-txt { position: absolute; left: 69pt; top: 0; right: 10pt; white-space: nowrap; overflow: hidden; text-align: left; }
.wd-obs-2 { left: 1pt; overflow: visible; }
.wd-firmas3 { position: relative; height: 24pt; margin-top: 35.93pt; }
.wd-firmas3 div { position: absolute; top: 0; width: 129.65pt; border-top: .4pt solid #000; text-align: center; padding-top: 0.6pt; }
.wd-firmas3 div:nth-child(1) { left: 12.22pt; } .wd-firmas3 div:nth-child(2) { left: 156.28pt; } .wd-firmas3 div:nth-child(3) { left: 300.33pt; }
.wd-pie { font-size: 10pt; line-height: 12pt; text-align: center; }
.hoja.wd-cert { font-family: Arial, 'Liberation Sans', Helvetica, sans-serif; }
.wd-cert .wd-cuerpo { font-size: 11pt; line-height: 15.8pt; text-align: justify; }
.wd-cert .wd-p18 { word-spacing: -0.5pt; }   /* Word comprime un poco los espacios al justificar */
.wd-cert .wd-titulo { font-size: 14pt; line-height: 20.11pt; font-weight: bold; text-align: center; margin-bottom: 18.75pt; }
.wd-cert .wd-dest, .wd-cert .wd-p15 { margin-bottom: 15pt; }
.wd-cert .wd-p18 { margin-bottom: 18.75pt; }
.wd-cert .wd-p45 { margin-bottom: 51.36pt; }
.wd-firmas2 { position: relative; height: 27pt; }
.wd-firmas2 div { position: absolute; top: 0; width: 225.67pt; border-top: .4pt solid #000; text-align: center; padding-top: 1.7pt; }
.wd-firmas2 div:nth-child(1) { left: 6.22pt; } .wd-firmas2 div:nth-child(2) { left: 255.1pt; }
.wd-firmas2 b { display: block; font-size: 10pt; line-height: 11.5pt; }
.wd-firmas2 small { display: block; font-size: 9pt; line-height: 13.2pt; color: #333; padding-top: 1.2pt; }
.wd-sello { margin-top: 37.5pt !important; text-align: center !important; font-size: 10pt; line-height: 11.5pt; font-weight: bold; color: #555; }

.hoja { font-family: "Times New Roman", Times, serif; font-size: 10.5pt; color: #000; background: #fff; }
.hoja + .hoja { break-before: page; page-break-before: always; }
.enc-oficial { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1mm; margin-bottom: 3mm; }
.enc-logo { max-width: 120mm; object-fit: contain; }
.enc-lineas { font-size: 10pt; line-height: 1.25; text-transform: uppercase; }
.enc-inst { font-weight: bold; }
.enc-centro { font-weight: bold; font-size: 11.5pt; }
.enc-codigo { text-transform: none; font-size: 9pt; }
.doc-titulo { text-align: center; font-size: 14pt; margin: 3mm 0 1mm; text-transform: uppercase; letter-spacing: .5pt; color: #000; }
.doc-sub { text-align: center; margin: 0 0 4mm; font-size: 10pt; }
.doc-nota { font-size: 8.5pt; margin-top: 3mm; }
.tabla-doc { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.tabla-doc th, .tabla-doc td { border: .3mm solid #000; padding: 1mm 1.5mm; color: #000; }
.tabla-doc th { background: #d9e2f3; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tabla-doc tfoot td { font-weight: bold; background: #f2f2f2; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tabla-doc .c { text-align: center; }
.tabla-doc tr { break-inside: avoid; }
.firmas { display: flex; justify-content: space-around; gap: 8mm; margin-top: 16mm; break-inside: avoid; }
.firma { flex: 1; text-align: center; display: flex; flex-direction: column; font-size: 9.5pt; }
.firma .linea { border-top: .3mm solid #000; margin-bottom: 1mm; }
.firma span { font-size: 8.5pt; }

/* ---------- Ficha oficial de inscripción (1 hoja carta, márgenes de 3 mm) ---------- */
.medidor-ficha { position: absolute; left: -10000px; top: 0; width: 209.9mm; visibility: hidden; }
.ficha-oficial { font-family: Arial, Helvetica, sans-serif; }
.fu { height: 273mm; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; font-size: 8.6pt; line-height: 1.14; color: #111; padding: .35em .5em; box-sizing: border-box; }
.fu * { box-sizing: border-box; }
.fu-hdr { display: flex; justify-content: space-between; align-items: center; gap: .8em; border-bottom: .15em solid #0f5c5a; padding-bottom: .25em; }
.fu-hdr-izq { flex: 1; min-width: 0; }
.fu-hdr-top { display: flex; align-items: center; gap: .7em; }
.fu-logo { max-height: 3.4em; width: auto; object-fit: contain; }
.fu-sub { font-size: .92em; font-weight: 700; color: #1e293b; }
.fu-centro { font-size: 1.25em; font-weight: 800; color: #0f5c5a; }
.fu-cintillo { background: #0f5c5a; color: #fff; font-weight: 800; padding: .18em .8em; margin-top: .22em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fu-foto { width: 7.2em; height: 8.2em; flex: 0 0 7.2em; border: 1px dashed #444; display: flex; align-items: center; justify-content: center; font-size: .82em; color: #333; background: #fafafa; }
.fu-sec { background: #e4eeec; color: #0f4c4a; border-left: .3em solid #0f5c5a; font-size: .94em; font-weight: 800; padding: .16em .45em; margin: .2em 0 .1em; text-transform: uppercase; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fu-tbl { width: 100%; table-layout: fixed; border-collapse: collapse; }
.fu-tbl th, .fu-tbl td { border: 1px solid #444; font-size: .94em; padding: .16em .38em; text-align: left; vertical-align: middle; overflow-wrap: anywhere; color: #111; }
.fu-tbl th { background: #f0f5f4; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fu-chk { display: inline-block; margin-right: .55em; }
.fu-decl { font-size: .88em; padding: .25em .45em; text-align: justify; }
.fu-firmas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4em; margin-top: 1.6em; font-size: .9em; text-align: center; }
.fu-firmas > div { border-top: 1px solid #000; padding-top: .25em; }
.fu-pie { font-size: .8em; color: #444; text-align: right; }
.papel:has(.ficha-oficial) { padding: 3mm; }   /* la ficha usa márgenes de 3 mm */
.matriz-doc th, .matriz-doc td { padding: .6mm .8mm; font-size: 8pt; }

/* ---------- Ficha de registro de personal ---------- */
.fper { font-family: Arial, Helvetica, sans-serif; font-size: 9.5pt; color: #111; }
.fper-h { display: flex; align-items: center; gap: 4mm; border-bottom: .6mm solid #0f5c5a; padding-bottom: 2mm; margin-bottom: 3mm; }
.fper-h img { max-height: 16mm; max-width: 40mm; object-fit: contain; }
.fper-h > div:nth-child(2), .fper-h > div:first-child:not(.fper-foto) { flex: 1; display: flex; flex-direction: column; }
.fper-h small { font-size: 7.5pt; font-weight: 700; }
.fper-h b { font-size: 12pt; color: #0f5c5a; }
.fper-h span { font-weight: 800; letter-spacing: .3pt; }
.fper-foto { width: 25mm; height: 30mm; border: 1px dashed #444; display: flex; align-items: center; justify-content: center; font-size: 8pt; flex: none; }
.fper h4 { background: #e4eeec; color: #0f4c4a; border-left: 1mm solid #0f5c5a; padding: .8mm 2mm; margin: 3mm 0 1mm; font-size: 9pt; text-transform: uppercase; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fper-t { width: 100%; border-collapse: collapse; }
.fper-t th, .fper-t td { border: .25mm solid #555; padding: .8mm 1.5mm; text-align: left; color: #111; }
.fper-t th { width: 32%; background: #f0f5f4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fper-g th { width: auto; }
.fper-docs { display: flex; flex-wrap: wrap; gap: 2mm 6mm; }
.fper-firmas { display: flex; justify-content: space-between; gap: 8mm; margin-top: 16mm; text-align: center; }
.fper-firmas > div { flex: 1; border-top: .3mm solid #000; padding-top: 1mm; font-size: 8.5pt; }

/* ---------- Listados oficiales (carta horizontal) ---------- */
.lis-hoja { font-family: Arial, Helvetica, sans-serif; font-size: 7.5pt; text-transform: uppercase; }
.lis-membrete { display: block; width: 100%; max-height: 25.4mm; object-fit: contain; margin: 0 auto 2mm; }
.lis-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 4mm; border-bottom: .6mm solid #002b66; padding-bottom: 1.5mm; margin-bottom: 2mm; }
.lis-sup { font-size: 7.5pt; font-weight: 700; color: #002b66; }
.lis-centro { font-size: 12pt; font-weight: 900; color: #0f172a; margin: .5mm 0; }
.lis-tit { font-size: 8pt; font-weight: 700; color: #0f5c5a; }
.lis-tot { text-align: right; font-size: 8pt; white-space: nowrap; }
.lis-tabla { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lis-tabla th, .lis-tabla td { border: .25mm solid #444; padding: .5mm 1mm; color: #000; overflow: hidden; text-overflow: ellipsis; }
.lis-tabla th { background: #f1f5f9; font-size: 7pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lis-tabla td { height: 5.2mm; }
.lis-tabla .c { text-align: center; }
.lis-no { width: 7mm; }
.lis-nota { width: 13mm; }
.lis-alta { height: 7mm; }
.lis-mono { font-family: Consolas, monospace; }
.lis-correo { text-transform: none; font-size: 6.5pt; }
.lis-mensual { font-size: 6.5pt; }
.lis-mensual th:nth-child(2) { width: 48mm; }
.lis-mensual .lis-puesto { font-size: 6pt; white-space: nowrap; }
.lis-mensual th.lis-dia { width: 5.4mm; padding: .3mm 0; font-size: 6pt; text-align: center; }
.lis-mensual th.lis-dia small { font-size: 5pt; font-weight: 800; }
.lis-mensual th[class^="lis-tot"], .lis-mensual th:last-child { width: 5.6mm; text-align: center; padding: .3mm 0; }
.lis-mensual td { padding: .2mm .4mm; text-align: center; }
.lis-mensual td.lis-nombre { text-align: left; white-space: nowrap; padding-left: 1mm; }
.lis-libre { background: #e2e8f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lis-fuera { background: #f8fafc; color: #cbd5e1; }
.lis-nd { color: #cbd5e1; }
.lis-m { font-weight: 800; }
.lis-P { color: #166534; } .lis-A { color: #b91c1c; background: #fef2f2; } .lis-E { color: #1d4ed8; } .lis-T { color: #b45309; background: #fffbeb; } .lis-L { color: #1d4ed8; }
.lis-firmas { display: flex; justify-content: space-around; gap: 8mm; margin-top: 9mm; break-inside: avoid; text-align: center; font-size: 7.5pt; }
.lis-firmas > div { flex: 1; max-width: 75mm; }
.lis-linea { border-top: .3mm solid #000; margin-bottom: 1mm; }
.lis-previa .lis-papel { padding: 5mm 7mm; margin-bottom: 18px; }
/* Encabezado con membrete de 8.5 × 1 pulgadas */
.enc-membrete { display: block; width: 100%; max-height: 25.4mm; object-fit: contain; margin: 0 auto 2mm; }

/* ---------- Documentos oficiales (pases, permisos, certificaciones, LP-001) ---------- */
.dc { font-size: 11pt; line-height: 1.45; }
.dc p { margin: 0 0 2mm; }
.dc-t { text-align: center; font-size: 13.5pt; margin: 3mm 0 4mm; letter-spacing: .3pt; color: #000; }
.dc-h { font-size: 10.5pt; margin: 4mm 0 1.5mm; padding-bottom: .5mm; border-bottom: .3mm solid #000; color: #000; text-transform: uppercase; }
.dc-j { text-align: justify; }
.dc-op { margin: 0 0 1mm 4mm !important; }
.dc-peq { font-size: 9pt; }
.ln { display: inline-block; border-bottom: .25mm solid #000; height: 1em; vertical-align: baseline; }
.dc-dest { font-weight: bold; margin: 6mm 0 4mm !important; }
.dc-certifican { text-align: center; font-weight: bold; font-size: 12pt; letter-spacing: 2pt; margin: 4mm 0 !important; }
.dc-caja { border: .3mm solid #000; padding: 3mm 4mm; margin: 3mm 0; line-height: 1.8; }
.dc-conducta { text-align: center; font-weight: bold; font-size: 13pt; margin: 5mm 0; padding: 3mm; border: .4mm double #000; }
.dc-bloque { border: .3mm solid #000; padding: 2.5mm 3.5mm; margin-bottom: 3mm; line-height: 1.7; }
.dc-bloque h3 { margin: 0 0 1.5mm; font-size: 10pt; background: #e9edf3; padding: .8mm 2mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.dc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5mm 6mm; margin: 1mm 0 1.5mm 3mm; }
.dc-firmas { display: flex; justify-content: space-around; gap: 8mm; margin-top: 16mm; text-align: center; break-inside: avoid; font-size: 9.5pt; }
.dc-firmas > div { flex: 1; display: flex; flex-direction: column; max-width: 75mm; }
.dc-linea { border-top: .3mm solid #000; margin-bottom: 1mm; }
.dc-firmas small { font-size: 8.5pt; }
.dc-sello { margin: 8mm auto 0; width: 34mm; height: 34mm; border: .3mm dashed #777; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 7pt; color: #777; padding: 4mm; }
.dc-firma-sello { display: flex; align-items: flex-end; justify-content: space-between; gap: 10mm; margin-top: 14mm; text-align: center; }
.dc-firma-sello > div:first-child { flex: 1; max-width: 95mm; }
.dc-firma-sello .dc-sello { margin: 0; }
.dc-pie { margin-top: 6mm; padding-top: 1.5mm; border-top: .3mm solid #000; text-align: center; font-size: 8pt; }
.dc-obs { min-height: 22mm; border: .3mm solid #000; padding: 2mm; }
.dc-ul { margin: 0 0 3mm; padding-left: 6mm; text-align: justify; }
.dc-ul li { margin-bottom: 1.5mm; }
.dc-rt td { padding: 1.4mm 2mm; }
/* Formulario LP-001 (MINERD · Gestión Humana) */
.lp { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; line-height: 1.35; }
.lp-cab { text-align: center; margin-bottom: 3mm; }
.lp-cab img { max-height: 18mm; display: block; margin: 0 auto 1mm; }
.lp-gob { font-size: 8pt; font-weight: bold; letter-spacing: .5pt; }
.lp-edu { font-size: 15pt; font-weight: 900; letter-spacing: 3pt; color: #002b66; }
.lp-dir { font-size: 9pt; font-weight: bold; }
.lp-tit { font-size: 10.5pt; font-weight: 900; margin-top: 2mm; }
.lp-cod { font-size: 8pt; text-align: right; font-weight: bold; }
.lp-sec { margin-bottom: 2.5mm; break-inside: avoid; }
.lp-sec > div { background: #002b66; color: #fff; font-weight: bold; padding: .8mm 2mm; font-size: 8.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lp-sec table { width: 100%; border-collapse: collapse; }
.lp-sec td { border: .25mm solid #444; padding: 1.2mm 2mm; vertical-align: top; color: #000; line-height: 1.6; }
.lp-firmas td { text-align: center; padding-top: 16mm; width: 33%; }
.lp-firmas td > div { border-top: .3mm solid #000; margin: 0 4mm 1mm; }

/* Paginación: cada .hoja va en su página (.pag), reducida si hace falta para caber en el papel elegido */
#area-impresion.midiendo { display: block !important; position: absolute; left: -30000px; top: 0; visibility: hidden; }
.pag > .hoja { display: flow-root; }
.pag { break-after: page; page-break-after: always; }
.pag:last-child { break-after: auto; page-break-after: auto; }
.pag-ajustada { overflow: hidden; }
.pag-exacta { display: flex; justify-content: center; align-items: flex-start; overflow: hidden; }
.pag-blanca { height: 5mm; }
.imp-opc { display: flex; flex-direction: column; gap: 10px; }
.imp-opc label:not(.check) { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.imp-caras { border: 1px solid var(--borde, #cbd5e1); border-radius: 8px; padding: 6px 12px 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.imp-caras legend { font-weight: 600; padding: 0 4px; }
.imp-sep { flex-basis: 100%; }
.imp-nota { font-size: .85em; background: var(--superficie2, #f1f5f9); border-radius: 8px; padding: 8px 10px; margin: 0; }

@media print {
  body.imprimiendo > *:not(#area-impresion) { display: none !important; }
  body.imprimiendo { background: #fff; }
  body.imprimiendo #area-impresion { display: block; }
}

/* ---------- Resumen diario de asistencia (Inicio) ---------- */
.resumen-diario { font-family: Arial, Helvetica, sans-serif; font-size: 9.5pt; }
.resumen-diario .rs-fecha { text-transform: capitalize; }
.resumen-diario h4 { margin: 3mm 0 1.2mm; font-size: 10pt; }
.rs-kpi { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2mm; margin: 2mm 0; }
.rs-kpi > div { border: .6pt solid #000; border-radius: 1.5mm; padding: 1.5mm; text-align: center; }
.rs-kpi small { display: block; font-size: 7.5pt; }
.rs-kpi b { font-size: 14pt; }
.rs-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 5mm; }
.rs-tb { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
.rs-tb th, .rs-tb td { border: .5pt solid #000; padding: .6mm 1.2mm; text-align: center; }
.rs-tb td:first-child, .rs-tb th:first-child { text-align: left; }
.rs-tb th { background: #e8e8e8; }
.rs-tb .tot td { font-weight: 700; background: #f3f3f3; }
.rs-ul { margin: 0; padding-left: 4mm; font-size: 8.5pt; }
.rs-mut { color: #444; font-style: italic; margin: 0; }
.rs-av { border: .6pt solid #000; padding: 1.2mm 2mm; margin: 2mm 0 0; font-weight: 700; }
.rs-emg { border: .8pt solid #000; padding: 1.5mm 2mm; margin: 1mm 0; }
.rs-obs { border: .5pt solid #000; height: 18mm; padding: 1mm 2mm; margin-top: 3mm; }
.resumen-diario .firmas { margin-top: 14mm; }

/* ---------- Acta de incidencia ---------- */
.acta-inc { font-size: 10.5pt; }
.acta-inc .enc-oficial, .acta-inc .enc-membrete { margin-bottom: 0; }
.acta-inc .doc-titulo { margin-top: 2mm; }
.acta-inc .acta-p { text-align: justify; line-height: 1.35; margin: 1.5mm 0; }
.acta-inc h4 { margin: 3mm 0 .5mm; font-size: 10.5pt; }
.acta-tb { width: 100%; border-collapse: collapse; margin: 3mm 0; font-size: 10pt; }
.acta-tb th, .acta-tb td { border: .5pt solid #000; padding: .8mm 2mm; text-align: left; vertical-align: top; }
.acta-tb th { width: 48mm; background: #eee; }
.acta-raya { border-bottom: .5pt solid #000; height: 6mm; }
.acta-pres { width: 100%; border-collapse: collapse; font-size: 10pt; }
.acta-pres td { border-bottom: .5pt solid #000; padding: 2.5mm 2mm .5mm; }
.acta-pres .acta-firma { width: 55mm; }
.acta-inc .firmas { margin-top: 12mm; }
.acta-sello { text-align: center; margin-top: 4mm; font-size: 9pt; letter-spacing: 1pt; color: #555; }
.acta-inc .enc-logo { height: 16mm !important; }
.acta-inc .doc-sub { margin: 0; }
.acta-inc .firmas { margin-top: 10mm; }
.acta-tb th, .acta-tb td { padding-top: .5mm; padding-bottom: .5mm; }
.acta-raya { height: 5.5mm; }
.acta-sello { margin-top: 2mm; }
