/* ================================================================
   Estilos compartidos para PDF profesional
   Solo se activan en modo print (body.print-mode), generado por
   Puppeteer al apuntar a *.html?print=ID&u=USER.
   No afectan la vista en navegador en uso normal.
   ================================================================ */

body.print-mode {
  font-family: 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif !important;
  font-size: 10.5pt;
  color: #1f2937;
  background: #fff !important;
  line-height: 1.55;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Eliminar adornos web (sombras, transiciones, animaciones) */
body.print-mode * {
  box-shadow: none !important;
  text-shadow: none !important;
  transition: none !important;
  animation: none !important;
}

/* Tipografía formal */
body.print-mode h1,
body.print-mode h2,
body.print-mode h3,
body.print-mode h4 {
  color: #0f172a !important;
  font-weight: 700 !important;
  page-break-after: avoid;
  break-after: avoid;
}
body.print-mode h1 { font-size: 18pt !important; }
body.print-mode h2 { font-size: 14pt !important; }
body.print-mode h3 { font-size: 12pt !important; margin-top: 6mm; }
body.print-mode h4 { font-size: 11pt !important; }

/* Tablas formales: bordes finos, cabecera diferenciada, filas alternadas */
body.print-mode table {
  border-collapse: collapse !important;
  width: 100%;
  font-size: 9.5pt !important;
  margin: 4mm 0 6mm;
  page-break-inside: auto;
}
body.print-mode th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  border: 1px solid #cbd5e1 !important;
  padding: 6px 9px !important;
  text-align: left !important;
  vertical-align: middle !important;
}
body.print-mode td {
  border: 1px solid #e2e8f0 !important;
  padding: 6px 9px !important;
  color: #1f2937 !important;
  vertical-align: top !important;
}
body.print-mode tbody tr:nth-child(even) td {
  background: #f8fafc !important;
}
body.print-mode thead {
  display: table-header-group;
}

/* Bordes finos en vez de sombras para los "cards" comunes a los módulos */
body.print-mode .card,
body.print-mode .results-section,
body.print-mode .total-card,
body.print-mode .dim-card,
body.print-mode .interp-card,
body.print-mode .chart-sec,
body.print-mode .tbl-sec,
body.print-mode .interpretation-card,
body.print-mode .chart-wrapper,
body.print-mode .candidate-info-box,
body.print-mode .results-header-card,
body.print-mode .validity-card,
body.print-mode .descriptor-cell,
body.print-mode .factor-interp-row,
body.print-mode .profile-interp-block,
body.print-mode .interp-box,
body.print-mode .global-card,
body.print-mode .stat-card {
  border: 1px solid #cbd5e1 !important;
  border-radius: 3px !important;
  background: #ffffff !important;
  margin: 0 0 6mm 0 !important;
  padding: 5mm 6mm !important;
}

/* Cabeceras con datos del candidato → ocultas en PDF
   (la portada ya muestra esa información de forma formal) */
body.print-mode .res-hdr,
body.print-mode .report-hdr,
body.print-mode .results-header,
body.print-mode .results-header-card,
body.print-mode .candidate-info-box {
  display: none !important;
}

/* .total-card en MOSS es el resumen global, no es header — mantenerla plana */
body.print-mode .total-card {
  background: #0f172a !important;
  color: #fff !important;
  border: none !important;
}
body.print-mode .total-card * {
  color: #fff !important;
}

/* Charts (canvas): centrarlos y bordearlos discretos */
body.print-mode canvas {
  display: block !important;
  margin: 0 auto !important;
  max-width: 100% !important;
}

/* Listas */
body.print-mode ul, body.print-mode ol {
  padding-left: 5mm;
}

/* Párrafos con tipografía legible */
body.print-mode p {
  margin: 2mm 0;
  font-size: 10.5pt;
  color: #1f2937;
}

/* ================================================================
   PORTADA — insertada por JS en bootstrap modo print
   ================================================================ */
.pdf-cover {
  min-height: 235mm;
  padding: 28mm 18mm 16mm;
  background: #fff;
  page-break-after: always;
  break-after: page;
  display: flex;
  flex-direction: column;
  color: #1f2937;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}
.pdf-cover .brand {
  font-size: 10pt;
  letter-spacing: 0.22em;
  color: #475569;
  text-transform: uppercase;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 4mm;
  margin-bottom: 22mm;
  font-weight: 700;
}
.pdf-cover .title {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 30pt;
  color: #0f172a;
  margin: 0 0 6mm 0;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pdf-cover .module {
  font-size: 13pt;
  color: #475569;
  margin-bottom: 26mm;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.pdf-cover .candidate-info {
  margin-top: auto;
  border-top: 1px solid #cbd5e1;
  padding-top: 8mm;
}
.pdf-cover .candidate-info .row {
  display: grid;
  grid-template-columns: 36mm 1fr;
  gap: 4mm;
  margin-bottom: 3mm;
  font-size: 10.5pt;
  align-items: baseline;
}
.pdf-cover .candidate-info .label {
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 8.5pt;
  font-weight: 700;
}
.pdf-cover .candidate-info .value {
  color: #0f172a;
  font-weight: 600;
  font-size: 11.5pt;
}
.pdf-cover .footer-note {
  text-align: center;
  font-size: 8.5pt;
  color: #94a3b8;
  margin-top: 12mm;
  font-style: italic;
  border-top: 1px solid #e2e8f0;
  padding-top: 5mm;
}

/* Primera página del CONTENIDO arranca sin "borde superior" agresivo */
body.print-mode .pdf-cover + * {
  page-break-before: avoid;
}
