/* ═══════════════════════════════════
   SECCIÓN ENCABEZADO DE PÁGINA
   ═══════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-header-title-row h2 {
  margin: 0;
}

.page-header-left h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--g800);
  letter-spacing: -.01em;
}

.page-header-left p {
  font-size: 12.5px;
  color: var(--g400);
  margin-top: 3px;
}

/* ═══════════════════════════════════
   BOLETIN — TABLA DE COMPETENCIAS
   ═══════════════════════════════════ */
.boletin-wrap {
  background: var(--g0);
  border: 1px solid var(--g150);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-md);
  margin-bottom: 14px;
}

.bol-header {
  background: linear-gradient(135deg, #0A2555, #1B4FD8);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bol-header-left .name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.bol-header-left .meta {
  font-size: 11.5px;
  color: rgba(255, 255, 255, .65);
  margin-top: 3px;
}

.bol-status-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(4px);
}

.bol-status-chip.promovido {
  background: rgba(5, 150, 105, .25);
  border-color: rgba(5, 150, 105, .5);
}

.bol-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, .45);
  margin-top: 3px;
}

.bol-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 20px;
  background: var(--primary-light);
  border-bottom: 1px solid var(--g150);
}

.bol-period-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary-mid);
}

.bol-legend-note {
  font-size: 11px;
  color: var(--g400);
  margin-left: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Inputs de la tabla de competencias */
.nota-input {
  width: 36px;
  padding: 3px 1px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: inherit;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  display: block;
  margin: 0 auto;
  -moz-appearance: textfield;
  border-radius: 3px;
  cursor: pointer;
}

.nota-input::-webkit-inner-spin-button,
.nota-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.nota-input:focus {
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 0 0 2px rgba(27, 79, 216, .3);
  border-radius: 4px;
}

/* ═══════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════ */
.prog-row {
  margin-bottom: 12px;
}

.prog-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 5px;
}

.prog-label {
  color: var(--g600);
  font-weight: 500;
}

.prog-val {
  color: var(--g700);
  font-weight: 700;
}

.prog-track {
  height: 7px;
  background: var(--g150);
  border-radius: 4px;
  overflow: hidden;
}

.prog-fill {
  height: 100%;
  border-radius: 4px;
}

/* ═══════════════════════════════════
   LEGEND
   ═══════════════════════════════════ */
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--g500);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ═══════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════ */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--g400);
}

.empty i {
  font-size: 36px;
  margin-bottom: 10px;
  display: block;
  opacity: .5;
}

.empty h4 {
  font-size: 14px;
  color: var(--g500);
  margin-bottom: 6px;
}

.empty p {
  font-size: 12.5px;
}

/* ═══════════════════════════════════
   INFO ROWS
   ═══════════════════════════════════ */
.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--g100);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 12px;
  color: var(--g400);
  flex-shrink: 0;
  width: 150px;
  font-weight: 500;
}

.info-val {
  font-size: 13px;
  color: var(--g700);
  font-weight: 500;
}

.info-val[contenteditable="true"] {
  background: var(--g50);
  border: 1px dashed var(--primary);
  border-radius: 6px;
  padding: 3px 8px;
  outline: none;
  cursor: text;
}



/* ═══════════════════════════════════════════════
   Ciclos y niveles — layout más institucional
   ═══════════════════════════════════════════════ */
.nivel-config-row {
  background: #fff
}

.nivel-config-row+.nivel-config-row {
  margin-top: 0
}

.secciones-config {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.secciones-config>div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  border: 1px solid var(--g100);
  border-radius: 12px;
  background: var(--g50)
}

.secciones-config b {
  min-width: 170px;
  color: var(--g700)
}

.secciones-config label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  font-size: 12px;
  color: var(--g500)
}


/* ═══════════════════════════════════
   CICLOS Y NIVELES — UX PRO
   ═══════════════════════════════════ */
.ciclos-card {
  padding: 0;
  overflow: hidden
}

#page-ciclos .nivel-config-row {
  padding: 18px 20px !important;
  background: linear-gradient(180deg, #fff, rgba(248, 250, 252, .92));
  transition: background var(--t), opacity var(--t)
}

#page-ciclos .nivel-config-row:nth-child(even) {
  background: linear-gradient(180deg, rgba(248, 250, 252, .95), rgba(255, 255, 255, .98))
}

#page-ciclos .nivel-config-row.is-off {
  opacity: .78
}

#page-ciclos .nivel-config-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px !important
}

#page-ciclos .nivel-secciones-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
  padding: 5px 10px;
  border-radius: 999px
}

#page-ciclos .secciones-grid {
  padding-left: 52px !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px !important
}

#page-ciclos .grado-seccion-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 10px !important;
  padding: 14px 14px 12px;
  border: 1px solid var(--g150);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--sh-sm)
}

#page-ciclos .grado-seccion-title {
  font-size: 13px;
  color: var(--g700)
}

#page-ciclos .sec-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--g150);
  border-radius: 999px;
  background: var(--g50);
  font-size: 12px;
  font-weight: 600;
  color: var(--g600);
  cursor: pointer
}

#page-ciclos .sec-chip input {
  accent-color: var(--primary)
}

#page-ciclos .grado-seccion-card label {
  margin-right: 4px
}

.chart-scroll-y {
  max-height: 380px;
  overflow: auto;
  padding-right: 6px
}

.chart-scroll-x {
  overflow-x: auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 8px
}

.empty.compact {
  padding: 18px 12px;
  font-size: 12px
}

@media (max-width: 900px) {
  #page-ciclos .secciones-grid {
    padding-left: 0 !important;
    grid-template-columns: 1fr
  }

  #page-ciclos .nivel-secciones-count {
    margin-left: 0
  }
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN — Fondo fijo (collage de la escuela) + tarjeta glassmorphism
   ═══════════════════════════════════════════════════════════════ */

/* Fondo único y permanente: el collage de fotos de la escuela.
   El linear-gradient oscuro se pinta SOBRE la foto (misma capa),
   así el backdrop-filter del card difumina foto + oscurecido juntos. */
#login-overlay {
  position: fixed !important;
  background-color: #0A2555;
  background-repeat:
    no-repeat,
    no-repeat,
    no-repeat,
    no-repeat;
  background-position:
    center,
    center,
    left center,
    right center;
  background-size:
    cover,
    contain,
    50% 100%,
    50% 100%;
  background-image:
    linear-gradient(rgba(10, 37, 85, 0.32), rgba(10, 37, 85, 0.32)),
    url('../images/escuela-collage.jpg'),
    url('../images/escuela-edificio.jpg'),
    url('../images/escuela-puerta.jpg');
  overflow: hidden;
}

/* El card debe quedar por encima del fondo (z-index) */
#login-overlay > div {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   ASISTENCIA — HISTORIAL MENSUAL EDITABLE
   ═══════════════════════════════════════════════════════════════ */
.att-month-scroll {
  overflow: auto;
  max-height: 560px;
}

.att-month-table {
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
  width: 100%;
}

.att-month-table th,
.att-month-table td {
  border: 1px solid var(--g100);
  padding: 4px 5px;
  text-align: center;
}

.att-month-sticky-col {
  position: sticky;
  left: 0;
  background: var(--g0);
  z-index: 2;
  text-align: left !important;
  font-weight: 600;
  min-width: 150px;
  color: var(--g700);
}

.att-month-table thead th {
  position: sticky;
  top: 0;
  background: var(--g50);
  z-index: 1;
}

.att-month-table thead .att-month-sticky-col {
  z-index: 3;
}

.att-month-day-h {
  min-width: 26px;
  font-weight: 600;
  color: var(--g500);
}

.att-month-weekend {
  background: var(--g100) !important;
  color: var(--g400);
}

.att-month-cell {
  cursor: pointer;
  font-weight: 700;
  min-width: 26px;
  color: var(--g300);
  user-select: none;
  transition: filter var(--t);
}

.att-month-cell:hover {
  outline: 2px solid var(--primary-mid);
  outline-offset: -2px;
}

.att-month-cell.sel-P {
  background: var(--ok-bg);
  color: var(--ok-txt);
}

.att-month-cell.sel-T {
  background: var(--warn-bg);
  color: var(--warn-txt);
}

.att-month-cell.sel-A {
  background: var(--bad-bg);
  color: var(--bad-txt);
}

.att-month-cell.sel-E {
  background: var(--primary-light);
  color: var(--primary-dark);
}
/* ═══════════════════════════════════════════════
   ORIENTACIÓN
   ═══════════════════════════════════════════════ */

.orient-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.orient-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--g0);
  border: 1px solid var(--g150);
  box-shadow: var(--sh-xs);
}

.orient-kpi i { font-size: 22px; flex-shrink: 0; }
.orient-kpi strong { display: block; font-size: 20px; font-weight: 800; line-height: 1.1; color: var(--g800); }
.orient-kpi span { font-size: 12px; color: var(--g500); font-weight: 600; }

.orient-kpi-red    i { color: var(--bad); }
.orient-kpi-amber  i { color: var(--warn); }
.orient-kpi-green  i { color: var(--ok); }
.orient-kpi-blue   i { color: var(--info); }

.orient-riesgo-card { margin-bottom: 16px; border-left: 3px solid var(--warn); }

.orient-riesgo-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }

.orient-riesgo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--g50);
  flex-wrap: wrap;
}

.orient-riesgo-nombre { font-weight: 700; color: var(--g800); }
.orient-riesgo-meta { color: var(--g500); font-size: 12.5px; }
.orient-riesgo-item .btn { margin-left: auto; }

.orient-motivo-cell { max-width: 260px; color: var(--g600); }

.orient-notas-lista {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px;
}

.orient-nota {
  background: var(--g50);
  border: 1px solid var(--g150);
  border-radius: var(--r);
  padding: 8px 10px;
}

.orient-nota-meta { font-size: 11.5px; color: var(--g500); margin-bottom: 3px; }
.orient-nota-texto { font-size: 13px; color: var(--g800); white-space: pre-wrap; }
.orient-notas-vacio { color: var(--g400); font-size: 13px; font-style: italic; }

@media (max-width: 900px) {
  .orient-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════
   BOLETINES OFICIALES MINERD — INFORME DE APRENDIZAJE (NIVEL PRIMARIO)
   Diseño de alta fidelidad basado en especificaciones del MINERD
   (1ro, 2do, 3ro, 4to, 5to, 6to de Primaria - Ordenanza 04-2023)
   ═══════════════════════════════════════════════════════════════════ */

.minerd-sheet-page {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto 24px auto;
  background: #ffffff;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border-radius: 6px;
  padding: 24px 30px;
  box-sizing: border-box;
  page-break-after: always;
  break-after: page;
}

.minerd-sheet-page:last-child {
  margin-bottom: 0;
}

/* ── Página 1: Portada y Datos Generales ── */
.minerd-p1-grid {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 26px;
  align-items: stretch;
}

.minerd-box {
  border: 1.5px solid #111;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}

.minerd-box-header {
  padding: 6px 10px;
  color: #fff;
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: center;
}

.minerd-box-body {
  padding: 10px 12px;
  font-size: 11.5px;
}

.minerd-periodo-firma-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 11px;
  color: #222;
}

.minerd-periodo-firma-label {
  font-weight: 600;
  white-space: nowrap;
  min-width: 105px;
}

.minerd-line-fill {
  flex: 1;
  border-bottom: 1px solid #444;
  height: 14px;
}

.minerd-lines-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.minerd-ruled-line {
  border-bottom: 1px solid #777;
  height: 18px;
}

.minerd-status-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  margin-bottom: 12px;
  border: 1px solid #333;
}

.minerd-status-table th {
  background: #f8fafc;
  padding: 6px 4px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid #333;
}

.minerd-status-table td {
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid #333;
  height: 24px;
}

.minerd-status-active {
  background: #f0fdf4;
  color: #15803d;
}

.minerd-condicion-title {
  font-size: 11px;
  font-weight: 700;
  margin: 8px 0 4px 0;
}

.minerd-signatures-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
  text-align: center;
}

.minerd-sig-line {
  border-top: 1px solid #333;
  padding-top: 5px;
  font-size: 10.5px;
  font-style: italic;
  color: #333;
}

/* ── Portada: Columna Derecha ── */
.minerd-cover-right {
  display: flex;
  flex-direction: column;
}

.minerd-instituto-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}

.minerd-logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  width: 100%;
}

.minerd-gob-line {
  font-size: 8px !important;
  font-weight: 700 !important;
  letter-spacing: 1.6px !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  color: #002D62 !important;
  text-transform: uppercase !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.minerd-rep-dom {
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 1.8px !important;
  margin: 1px 0 0 0 !important;
  line-height: 1.2 !important;
  color: #002D62 !important;
  text-transform: uppercase !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.minerd-divider-red {
  width: 32px;
  height: 2px;
  background-color: #C4122D;
  margin: 4px auto 3px auto;
  border-radius: 1px;
}

.minerd-educacion {
  font-size: 13.5px !important;
  font-weight: 900 !important;
  letter-spacing: 2px !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  color: #C4122D !important;
  text-transform: uppercase !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.minerd-viceministerio {
  font-size: 8.5px !important;
  color: #374151 !important;
  margin: 4px 0 0 0 !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

.minerd-direccion {
  font-size: 8.5px !important;
  color: #374151 !important;
  margin: 1px 0 0 0 !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

.minerd-title-main {
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.8px;
  margin: 8px 0 4px 0;
  text-transform: uppercase;
}

.minerd-kids-art {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 4px 0 6px 0;
}

.minerd-grade-title {
  text-align: center;
  font-size: 19px;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.minerd-grade-sub {
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
  text-transform: uppercase;
}

.minerd-info-form {
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.minerd-form-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.minerd-form-label {
  font-weight: 600;
  color: #222;
  white-space: nowrap;
}

.minerd-form-val {
  flex: 1;
  border-bottom: 1px solid #444;
  padding: 0 4px 1px 4px;
  font-weight: 700;
  color: #111;
  min-height: 15px;
}

/* ── Página 2: Desempeño Individual ── */
.minerd-p2-banner {
  padding: 6px 12px;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
  margin-bottom: 8px;
  border-radius: 3px;
}

.minerd-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 10px;
}

.minerd-main-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  border: 1.5px solid #222;
  text-align: center;
}

.minerd-main-table th,
.minerd-main-table td {
  border: 1px solid #4b5563;
  padding: 3px 2px;
  vertical-align: middle;
}

.minerd-main-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #111;
}

.minerd-main-table .th-competencia {
  font-size: 9.5px;
  line-height: 1.15;
  padding: 4px 3px;
}

.minerd-main-table .th-area {
  font-size: 10px;
  width: 115px;
  min-width: 115px;
  max-width: 130px;
  text-align: left;
  padding: 3px 6px;
  font-weight: 700;
}

.minerd-main-table .col-sub {
  font-size: 9px;
  min-width: 17px;
  max-width: 22px;
  padding: 2px 1px;
}

.minerd-main-table .col-rp {
  background: #fefce8;
  color: #854d0e;
  font-size: 8.5px;
}

.minerd-main-table .col-calc-c {
  background: #eff6ff;
  font-weight: 700;
  color: #1e3a8a;
  min-width: 20px;
}

.minerd-main-table .col-calc-final {
  background: #f0fdf4;
  font-weight: 800;
  color: #166534;
  min-width: 24px;
}

.minerd-main-table .col-calc-recup {
  background: #fffbeb;
  font-weight: 700;
  color: #92400e;
  min-width: 24px;
}

/* ── Observaciones (Página 2) ── */
.minerd-obs-box {
  border: 1.5px solid #222;
  border-radius: 3px;
  display: flex;
  margin-bottom: 10px;
  overflow: hidden;
}

.minerd-obs-header {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 8px 4px;
  color: #fff;
}

.minerd-obs-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.minerd-obs-row {
  display: flex;
  border-bottom: 1px solid #4b5563;
  min-height: 22px;
}

.minerd-obs-row:last-child {
  border-bottom: none;
}

.minerd-obs-tag {
  width: 32px;
  background: #f8fafc;
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #4b5563;
}

.minerd-obs-content {
  flex: 1;
  padding: 3px 8px;
  font-size: 10.5px;
  color: #374151;
}

/* ── Bottom Grid (Asistencia, Leyenda, Escala) ── */
.minerd-bottom-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.75fr 1.6fr;
  gap: 12px;
  align-items: stretch;
}

.minerd-bottom-card {
  border: 1.5px solid #222;
  border-radius: 3px;
  overflow: hidden;
  font-size: 10px;
}

.minerd-bottom-card-header {
  padding: 4px 6px;
  font-weight: 800;
  color: #fff;
  font-size: 10px;
  text-align: center;
}

.minerd-bottom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.minerd-bottom-table th,
.minerd-bottom-table td {
  border: 1px solid #4b5563;
  padding: 3px 2px;
}

.minerd-bottom-table th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 9px;
}

.minerd-leyenda-list {
  padding: 6px 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
  font-size: 9px;
  color: #222;
}

.minerd-escala-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.minerd-escala-table th,
.minerd-escala-table td {
  border: 1px solid #4b5563;
  padding: 3px 4px;
}

.minerd-escala-table th {
  background: #f8fafc;
  font-weight: 700;
}

.minerd-escala-num {
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  vertical-align: top;
  padding-top: 4px;
}

.minerd-doc-footer-tag {
  margin-top: 10px;
  font-size: 9px;
  color: #6b7280;
  font-family: monospace;
  text-align: right;
}

/* ── Modal de Vista Previa del Boletín Oficial ── */
#modal-boletin-oficial .modal-container {
  max-width: 1140px;
  width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--g0, #ffffff);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  z-index: 2001;
}

#boletin-oficial-preview-area {
  flex: 1;
  overflow-y: auto;
  background: #e2e8f0;
  padding: 20px;
}

/* ═══════════════════════════════════════════════════════════════════
   REGLAS DE IMPRESIÓN (PRINT)
   ═══════════════════════════════════════════════════════════════════ */
@page {
  size: letter landscape;
  margin: 5mm;
}

@media print {
  body.printing-boletin-oficial * {
    visibility: hidden;
  }
  body.printing-boletin-oficial #boletin-oficial-print-container,
  body.printing-boletin-oficial #boletin-oficial-print-container * {
    visibility: visible;
  }
  body.printing-boletin-oficial #boletin-oficial-print-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    display: block !important;
    background: #fff;
  }
  body.printing-boletin-oficial .minerd-sheet-page {
    box-shadow: none;
    border-radius: 0;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    page-break-after: always !important;
    break-after: page !important;
  }
}


/* ══════════════════════════════════════════════════════════════════
   ESTILOS OFICIALES PARA BOLETINES DE SECUNDARIA (PRIMER CICLO)
   RÉPLICA FÍSICA EXACTA MINERD (ORDENANZA 04-2023)
   ══════════════════════════════════════════════════════════════════ */

.minerd-secundaria-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #111827;
  padding: 20px 24px !important;
  box-sizing: border-box;
}

/* ── SECUNDARIA PÁGINA 1: PORTADA Y FIRMAS ── */
.sec-p1-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.35fr;
  gap: 28px;
  align-items: stretch;
}

.sec-box {
  border: 1.5px solid #222;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}

.sec-box-header {
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
  text-align: center;
  padding: 5px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sec-box-body {
  padding: 10px 14px;
}

.sec-firma-title {
  font-weight: 800;
  font-size: 11px;
  color: #111;
  margin-bottom: 10px;
}

.sec-firma-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 11px;
}

.sec-firma-lbl {
  font-size: 10.5px;
  font-weight: 600;
  min-width: 95px;
  white-space: nowrap;
  color: #222;
}

.sec-firma-line {
  flex: 1;
  border-bottom: 1px solid #333;
  height: 14px;
}

.sec-box-obs {
  margin-bottom: 0;
}

.sec-obs-body {
  padding: 12px 14px;
}

.sec-ruled-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sec-line {
  border-bottom: 1px solid #64748b;
  height: 12px;
}

/* Columna Derecha Portada */
.sec-cover-header {
  text-align: center;
  margin-bottom: 16px;
}

.sec-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.sec-minerd-text {
  text-align: center;
  margin-bottom: 10px;
}

.sec-minerd-vicemin {
  font-size: 9.5px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.2;
}

.sec-minerd-dir {
  font-size: 9.5px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.2;
}

.sec-boletin-title {
  font-size: 14px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.8px;
  margin: 10px 0 12px 0;
}

.sec-grade-badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.sec-grade-display {
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.sec-num {
  font-size: 42px;
  font-weight: 900;
}

.sec-suffix {
  font-size: 20px;
  font-weight: 800;
  vertical-align: super;
}

.sec-word {
  font-size: 32px;
  font-weight: 900;
  margin-left: 4px;
}

.sec-grade-ciclo {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 2px;
}

.sec-grade-nivel {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.5px;
}

/* Ficha de Datos del Estudiante */
.sec-student-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 10.5px;
}

.sec-form-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.sec-form-lbl {
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

.sec-sub-lbl {
  font-weight: normal;
  font-size: 9.5px;
  color: #475569;
}

.sec-form-line {
  flex: 1;
  border-bottom: 1px solid #333;
  padding: 0 4px 1px 4px;
  min-height: 16px;
  color: #0f172a;
}

.sec-line-short {
  flex: none;
  width: 32px;
  text-align: center;
}

.sec-line-num {
  flex: none;
  width: 40px;
  text-align: center;
}

/* ── SECUNDARIA PÁGINA 2: TABLA DE CALIFICACIONES DE RENDIMIENTO ── */
.sec-p2-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
}

.sec-top-student {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sec-top-lbl {
  font-weight: 700;
  color: #1e293b;
}

.sec-top-val {
  color: #0f172a;
  border-bottom: 1px solid #333;
  padding: 0 8px;
  flex: 1;
  max-width: 320px;
}

.sec-top-center-banner {
  color: #ffffff;
  font-weight: 900;
  font-size: 11.5px;
  padding: 4px 14px;
  border-radius: 2px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.sec-top-grade-info {
  display: flex;
  align-items: center;
  color: #1e293b;
}

/* Tabla de Calificaciones */
.sec-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 10px;
}

.sec-main-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #111;
  text-align: center;
  font-size: 9.5px;
}

.sec-main-table th, .sec-main-table td {
  border: 1px solid #475569;
  padding: 2px 1px;
  vertical-align: middle;
}

.sec-main-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
}

.sec-th-asig {
  width: 130px;
  min-width: 125px;
  max-width: 140px;
  font-size: 9px;
  line-height: 1.1;
  padding: 3px 4px !important;
  text-align: left;
}

.sec-td-asig {
  text-align: left;
  padding: 3px 5px !important;
  font-weight: 600;
  font-size: 9px;
  color: #1e293b;
}

.sec-th-comp-header {
  font-size: 9.5px;
  padding: 3px !important;
}

.sec-th-c1, .sec-th-c2, .sec-th-c3, .sec-th-c4 {
  font-size: 8px;
  line-height: 1.1;
  padding: 2px 1px !important;
}

.sec-th-prom-comp {
  font-size: 7.5px;
  line-height: 1.1;
  width: 60px;
  padding: 2px 1px !important;
}

.sec-th-cf {
  font-size: 7.5px;
  line-height: 1.1;
  width: 32px;
  padding: 2px 1px !important;
}

.sec-th-asist {
  font-size: 7.5px;
  line-height: 1.1;
  width: 30px;
  padding: 2px 1px !important;
}

.sec-th-eval {
  font-size: 7.5px;
  line-height: 1.1;
  padding: 2px 1px !important;
}

.sec-th-sit-final {
  font-size: 7.5px;
  line-height: 1.1;
  width: 28px;
  padding: 2px 1px !important;
}

.sec-th-subeval {
  font-size: 7px;
  padding: 1px !important;
}

.sec-th-p {
  font-size: 8px;
  width: 16px;
  padding: 1px !important;
}

.sec-th-pc {
  font-size: 7.5px;
  width: 17px;
  padding: 1px !important;
}

.sec-th-code {
  font-size: 7px;
  padding: 1px !important;
}

.sec-td-p {
  font-size: 9px;
  color: #334155;
}

.sec-td-pc {
  font-size: 9px;
  font-weight: 700;
  color: #1e3a8a;
  background: #f8fafc;
}

.sec-td-cf {
  font-size: 9.5px;
  color: #166534;
  background: #f0fdf4;
}

.sec-td-asist {
  font-size: 8.5px;
  color: #334155;
}

.sec-td-comp {
  font-size: 8.5px;
  color: #854d0e;
}

.sec-td-extra {
  font-size: 8.5px;
  color: #991b1b;
}

.sec-td-esp {
  font-size: 8.5px;
}

.sec-td-st {
  font-size: 10px;
  font-weight: 900;
  width: 14px;
}

.sec-st-a {
  color: #15803d;
}

.sec-st-r {
  color: #dc2626;
}

/* ── Sección Inferior de 3 Columnas ── */
.sec-p2-bottom-grid {
  display: grid;
  grid-template-columns: 1.45fr 1.1fr 1.05fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.sec-bottom-box {
  border: 1.5px solid #111;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sec-bottom-box-header {
  color: #ffffff;
  font-weight: 800;
  font-size: 9.5px;
  text-align: center;
  padding: 4px 6px;
  text-transform: uppercase;
  line-height: 1.15;
}

.sec-ordenanza-body {
  padding: 6px 8px;
  font-size: 7.8px;
  line-height: 1.35;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.sec-ordenanza-body p {
  margin: 0;
}

.sec-leyenda-table-wrap {
  padding: 4px 6px;
  flex: 1;
}

.sec-leyenda-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8px;
}

.sec-leyenda-table td {
  padding: 1px 2px;
  vertical-align: top;
}

.sec-ley-code {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  width: 45px;
}

.sec-ley-desc {
  color: #334155;
}

.sec-condicion-body {
  padding: 10px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sec-condicion-title {
  font-size: 8.5px;
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  margin-bottom: 8px;
}

.sec-condicion-options {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.sec-cond-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.sec-cond-lbl {
  font-size: 9.5px;
  font-weight: 700;
  color: #1e293b;
}

.sec-radio-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #334155;
  display: inline-block;
  box-sizing: border-box;
  position: relative;
}

.sec-radio-circle.checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #111827;
}

/* Firmas al Pie */
.sec-footer-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 18px;
  padding: 0 20px;
}

.sec-sig-col {
  text-align: center;
}

.sec-sig-line {
  border-top: 1px solid #333;
  margin-bottom: 4px;
}

.sec-sig-lbl {
  font-size: 9.5px;
  font-style: italic;
  color: #334155;
}
