/* Adaptación específica del constructor progresivo de horarios. */
.schedule-slot-row[hidden] {
  display: none;
}

/* Los recreos se distinguen sin abandonar la paleta institucional. */
.recess-row {
  border-left: 4px solid #d69e00;
}

.course-grid-row {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}

.schedule-guidance {
  background: #f3f5ff;
  border-left: 4px solid var(--blue);
  border-radius: .5rem;
  margin: 1rem 0;
  padding: 1rem;
}

.schedule-guidance p {
  margin: .35rem 0;
}

.schedule-grid td small,
.schedule-grid td strong,
.schedule-grid td span {
  display: block;
}

/* Lectura consolidada para autoridades: una sola tabla cambia por jornada y
   día, preservando siempre el curso y el horario de referencia. */
.schedule-overview-stack {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.authority-schedule {
  min-width: 0;
}

.authority-schedule-heading {
  margin-bottom: 18px;
}

.schedule-overview-controls,
.schedule-overview-control-group {
  display: grid;
  gap: 8px;
}

.schedule-overview-controls {
  margin-bottom: 16px;
}

.schedule-overview-control-group > strong {
  color: var(--ink);
  font-size: 13px;
}

.schedule-day-control {
  margin-bottom: 14px;
}

.schedule-overview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-overview-tab {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.schedule-overview-tab:hover {
  border-color: var(--blue);
  background: #f3f5ff;
}

.schedule-overview-tab.is-active,
.schedule-overview-tab[aria-selected="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.schedule-overview-tabs.compact .schedule-overview-tab {
  min-width: 94px;
}

.schedule-group-panel[hidden],
.schedule-day-panel[hidden] {
  display: none;
}

.consolidated-schedule-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-gutter: stable;
}

/* Encabezado + diez bloques lectivos: once filas completas antes de que la
   tabla necesite desplazamiento vertical interno. */
.consolidated-schedule-wrap.has-vertical-overflow {
  max-height: 694px;
  overflow-y: auto;
}

.consolidated-schedule {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.consolidated-schedule th,
.consolidated-schedule td {
  box-sizing: border-box;
  min-width: 190px;
  max-width: 190px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  vertical-align: middle;
}

.consolidated-schedule thead tr {
  height: 52px;
}

.consolidated-schedule tbody tr {
  height: 64px;
}

.consolidated-schedule thead th {
  position: sticky;
  z-index: 3;
  top: 0;
  overflow: hidden;
  background: #f1f3fa;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consolidated-schedule .schedule-corner,
.consolidated-schedule .schedule-time {
  position: sticky;
  left: 0;
  min-width: 132px;
  max-width: 132px;
  white-space: nowrap;
}

.consolidated-schedule .schedule-corner {
  z-index: 5;
  background: #e8ebf8;
  color: var(--blue);
}

.consolidated-schedule .schedule-time {
  z-index: 2;
  background: #f7f8fc;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.consolidated-schedule th:last-child,
.consolidated-schedule td:last-child {
  border-right: 0;
}

.consolidated-schedule tbody tr:last-child th,
.consolidated-schedule tbody tr:last-child td {
  border-bottom: 0;
}

.schedule-cell strong,
.schedule-cell small,
.schedule-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-cell strong {
  color: var(--ink);
}

.schedule-cell small,
.schedule-cell span {
  margin-top: 3px;
  color: var(--muted);
}

.schedule-cell.unassigned {
  background: #fbfbfd;
}

.schedule-cell.outside {
  background: #f5f6f9;
  text-align: center;
}

/* Cada docente de apoyo ocupa una fila visual separada y puede ocultarse al
   marcar su eliminación mediante el formset dinámico. */
.support-row {
  border-bottom: 1px solid #e4e6f0;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.support-row[hidden] {
  display: none;
}

/* La información secundaria del alumno se mantiene disponible sin recargar la
   ficha ni competir visualmente con los datos prioritarios. */
.more-information {
  margin-top: 1.25rem;
}

.more-information summary {
  list-style: none;
  width: fit-content;
}

.more-information summary::-webkit-details-marker {
  display: none;
}

.more-information[open] summary {
  margin-bottom: 1rem;
}

/* El buscador de hermanos presenta resultados como acciones compactas y deja
   siempre visibles el nombre y el curso antes de confirmar el vínculo. */
.sibling-results {
  display: grid;
  gap: .5rem;
  margin: .75rem 0 1rem;
  max-height: 18rem;
  overflow: auto;
}

.sibling-result {
  background: #f3f5ff;
  border: 1px solid #d9dce9;
  border-radius: .6rem;
  color: #1e2440;
  cursor: pointer;
  display: grid;
  padding: .75rem 1rem;
  text-align: left;
}

.sibling-result:hover {
  border-color: var(--blue);
}

.sibling-result small {
  color: #666c84;
}

@media (max-width: 700px) {
  .schedule-builder .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-slot-row {
    grid-template-columns: 1fr;
  }

  .schedule-overview-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .schedule-overview-tab {
    flex: 0 0 auto;
  }

  .consolidated-schedule th,
  .consolidated-schedule td {
    min-width: 172px;
    max-width: 172px;
  }
}
