/* PDF de padres · documento de acompañamiento
   Activación: PDFPadres.render() inyecta #pdfDoc, body.printing-padres dispara estilos.
*/

/* Por defecto, el #pdfDoc no se ve en pantalla — solo cuando printing-padres está activo */
#pdfDoc { display: none; }

@media print {
  @page { size: A4 portrait; margin: 0; }

  /* Ocultar TODO el dashboard */
  body.printing-padres .header,
  body.printing-padres .layout,
  body.printing-padres .toast,
  body.printing-padres #panelSesion,
  body.printing-padres #modalContainer { display: none !important; }

  /* Mostrar SOLO el doc PDF */
  body.printing-padres { background: #F7F4F0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing-padres #pdfDoc { display: grid !important; }
}

/* ====== Documento (forzado a 1 página A4) ====== */
.pdf-doc {
  display: grid;
  grid-template-columns: 30% 1fr;
  width: 210mm;
  height: 297mm;
  max-height: 297mm;
  overflow: hidden;
  background: #F7F4F0;
  color: #1A1A1A;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 9pt;
  line-height: 1.45;
  page-break-inside: avoid;
  page-break-after: avoid;
}

/* ====== Sidebar ====== */
.pdf-side {
  background: #1B6B8A;
  color: #FFFFFF;
  padding: 12mm 8mm 10mm 9mm;
  display: flex;
  flex-direction: column;
  gap: 6mm;
}

.pdf-brand { display: flex; align-items: center; gap: 8px; }
.pdf-logo { width: 32px; height: 32px; flex: 0 0 32px; }
.pdf-brand-name { font-size: 13pt; font-weight: 400; letter-spacing: -0.01em; }
.pdf-brand-name b { font-weight: 800; }
.pdf-brand-tag { font-size: 7.5pt; opacity: 0.75; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 1pt; }

.pdf-child { border-top: 0.6pt solid rgba(255,255,255,0.2); border-bottom: 0.6pt solid rgba(255,255,255,0.2); padding: 4mm 0; }
.pdf-eyebrow {
  font-size: 6.5pt;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #FAF0D7;
  margin-bottom: 2pt;
  font-weight: 600;
}
.pdf-child-name {
  font-size: 17pt;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 2pt;
}
.pdf-child-meta { font-size: 8pt; opacity: 0.82; }

.pdf-block { display: flex; flex-direction: column; gap: 0.5pt; }
.pdf-block-label {
  font-size: 6.5pt;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #C9A23C;
  font-weight: 700;
  margin-bottom: 2pt;
}
.pdf-block-value { font-size: 11pt; font-weight: 700; letter-spacing: -0.01em; }
.pdf-block-sub { font-size: 7.5pt; opacity: 0.75; }

.pdf-contact-name { font-size: 9pt; font-weight: 700; }
.pdf-contact-role { font-size: 7.5pt; opacity: 0.75; margin-bottom: 2pt; }
.pdf-contact-line { font-size: 7.5pt; opacity: 0.92; }

.pdf-foot { margin-top: auto; font-size: 6pt; opacity: 0.55; line-height: 1.35; }
.pdf-brand-name { font-size: 11pt; }
.pdf-brand-tag { font-size: 6.5pt; }

/* ====== Main ====== */
.pdf-main {
  padding: 12mm 10mm 10mm 10mm;
  display: flex;
  flex-direction: column;
  gap: 5mm;
  overflow: hidden;
}

.pdf-section { display: flex; flex-direction: column; gap: 2mm; }

.pdf-h2 {
  font-size: 11pt;
  font-weight: 700;
  color: #1B6B8A;
  letter-spacing: -0.015em;
  margin: 0;
  padding-bottom: 1.5pt;
  border-bottom: 0.6pt solid #E2DDD7;
}
.pdf-h2-soft { font-size: 9pt; color: #5C5C5C; font-weight: 600; border-bottom: 0.4pt solid #E2DDD7; }
.pdf-section-soft { margin-top: 1mm; }
.pdf-team-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5mm 6mm;
}
.pdf-team-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 8.5pt;
  border-bottom: 0.4pt dotted #D2C8B5;
  padding: 1.5pt 0;
}
.pdf-team-item .pdf-team-name { font-size: 9pt; }
.pdf-team-item .pdf-team-role { font-size: 8pt; color: #5C5C5C; font-weight: 400; }

.pdf-lead { font-size: 9pt; color: #5C5C5C; margin: 0; }

/* Resumen del mes */
.pdf-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3mm;
  margin-top: 1mm;
}
.pdf-stat {
  background: #FFFFFF;
  border: 0.6pt solid #E2DDD7;
  border-radius: 4pt;
  padding: 3mm 3mm;
  text-align: center;
}
.pdf-stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17pt;
  font-weight: 700;
  color: #1B6B8A;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 1pt;
}
.pdf-stat-label {
  font-size: 7.5pt;
  color: #5C5C5C;
  letter-spacing: 0.02em;
}
.pdf-lead { font-size: 8.5pt; color: #5C5C5C; margin: 1mm 0 0; }

/* Equipo */
.pdf-team {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3mm;
}
.pdf-team-card {
  display: flex;
  gap: 3mm;
  align-items: flex-start;
  background: #FFFFFF;
  border: 1pt solid #E2DDD7;
  border-radius: 6pt;
  padding: 3mm;
}
.pdf-team-avatar {
  width: 9mm;
  height: 9mm;
  flex: 0 0 9mm;
  background: #FAF0D7;
  color: #8A6A1C;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12pt;
}
.pdf-team-name { font-size: 9.5pt; font-weight: 700; color: #1A1A1A; line-height: 1.2; }
.pdf-team-role { font-size: 8.5pt; color: #5C5C5C; margin-top: 1pt; }
.pdf-team-meta { font-size: 7.5pt; color: #1B6B8A; margin-top: 2pt; font-weight: 600; }

/* Horario semanal · compactado para 1 página */
.pdf-week {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1mm;
  background: #FFFFFF;
  border: 0.6pt solid #E2DDD7;
  border-radius: 4pt;
  padding: 1.5mm;
}
.pdf-day { display: flex; flex-direction: column; gap: 1mm; min-width: 0; }
.pdf-day-head {
  text-align: center;
  background: #D6EBF2;
  border-radius: 3pt;
  padding: 1.2mm 0;
}
.pdf-day-name {
  font-size: 6.5pt;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #1B6B8A;
}
.pdf-day-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11pt;
  font-weight: 700;
  color: #1B6B8A;
  letter-spacing: -0.03em;
  line-height: 1;
}
.pdf-day-body { display: flex; flex-direction: column; gap: 0.8mm; }

.pdf-ses {
  background: #F7F4F0;
  border-left: 1.5pt solid #1B6B8A;
  border-radius: 2pt;
  padding: 1.2mm 1.5mm;
  font-size: 6.5pt;
  line-height: 1.25;
}
.pdf-ses.is-done { background: #EFF6F0; border-left-color: #4A8A55; opacity: 0.78; }
.pdf-ses.is-cancel { background: #FBEEEC; border-left-color: #C36B5E; opacity: 0.65; text-decoration: line-through; }
.pdf-ses.is-miss { background: #FAF0D7; border-left-color: #C9A23C; opacity: 0.75; }
.pdf-ses-time {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 7pt;
  color: #1B6B8A;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 2pt;
  margin-bottom: 0.5pt;
}
.pdf-ses.is-done .pdf-ses-time,
.pdf-ses.is-cancel .pdf-ses-time,
.pdf-ses.is-miss .pdf-ses-time { color: #5C5C5C; }
.pdf-ses-dur { font-size: 5.5pt; font-weight: 500; color: #8B92A0; }
.pdf-ses-esp { font-weight: 700; color: #1A1A1A; font-size: 7pt; }
.pdf-ses-sala { color: #5C5C5C; font-size: 6pt; }

.pdf-empty {
  text-align: center;
  font-size: 6.5pt;
  color: #A8A8A8;
  font-style: italic;
  padding: 2mm 0;
}

/* Reuniones */
.pdf-reu {
  display: grid;
  grid-template-columns: 28mm 1fr;
  gap: 3mm;
  background: #FAF0D7;
  border-radius: 4pt;
  padding: 2mm 3mm;
  margin-bottom: 1.5mm;
}
.pdf-reu-date { font-weight: 700; color: #8A6A1C; font-size: 8pt; }
.pdf-reu-body { font-size: 8pt; color: #1A1A1A; }
.pdf-reu-note { font-size: 7pt; color: #5C5C5C; margin-top: 1pt; }
.pdf-reu-empty { font-size: 8pt; color: #5C5C5C; margin: 0; font-style: italic; }

/* Cierre */
.pdf-closing {
  margin-top: auto;
  padding-top: 3mm;
  border-top: 0.6pt solid #E2DDD7;
  font-size: 8pt;
  color: #1B6B8A;
  font-style: italic;
  text-align: center;
}
