/* Navegación de calificaciones: interfaz de consulta, sin alterar datos ni cálculos. */
html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-navigator {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #c8ddf4;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 58%, #fff9df 100%);
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-navigator-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-navigator-heading span:first-child {
  color: #0752a0;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-navigator h3 {
  margin: 2px 0;
  color: #073d7b;
  font-size: 1.1rem;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-navigator p {
  margin: 0;
  color: #4a6483;
  font-size: .86rem;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-navigator-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffe286;
  color: #543e00;
  font-size: .78rem;
  font-weight: 800;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(164px, 1fr));
  gap: 8px;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones :is(.grade-course-tile, .grade-subject-tile) {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbdff2;
  background: #fff;
  color: #073d7b;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones :is(.grade-course-tile, .grade-subject-tile):hover,
html body.is-authenticated:not(.report-print-body) #module-calificaciones :is(.grade-course-tile, .grade-subject-tile):focus-visible {
  border-color: #0a65bd;
  box-shadow: 0 4px 14px rgba(13, 91, 171, .16);
  outline: none;
  transform: translateY(-1px);
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-tile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  align-items: center;
  min-height: 74px;
  padding: 10px;
  border-radius: 10px;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-tile span {
  font-weight: 800;
  overflow-wrap: anywhere;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-tile small {
  grid-column: 1 / -1;
  color: #58708d;
  font-size: .74rem;
  overflow-wrap: anywhere;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-tile b,
html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-subject-tile b {
  color: #0752a0;
  font-variant-numeric: tabular-nums;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones :is(.grade-course-tile, .grade-subject-tile).is-active {
  border-color: #0752a0;
  background: #0752a0;
  color: #fff;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones :is(.grade-course-tile, .grade-subject-tile).is-active :is(small, b) {
  color: #fff7ce;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-directory-list {
  display: grid;
  gap: 7px;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-directory {
  overflow: clip;
  border: 1px solid #d5e4f3;
  border-radius: 9px;
  background: #fff;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-directory summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  color: #073d7b;
  cursor: pointer;
  list-style: none;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-directory summary::-webkit-details-marker { display: none; }
html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-directory[open] summary { background: #eef6ff; }
html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-directory[open] summary i { transform: rotate(180deg); }
html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-directory summary span { display: grid; gap: 1px; min-width: 0; }
html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-directory summary small { color: #58708d; font-size: .75rem; }

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-subject-directory-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 7px;
  padding: 9px;
  border-top: 1px solid #e5eef7;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-subject-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  align-items: center;
  min-height: 58px;
  padding: 8px 9px;
  border-radius: 8px;
}

html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-subject-tile span,
html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-subject-tile small { overflow-wrap: anywhere; }
html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-subject-tile small { color: #58708d; font-size: .72rem; }
html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-directory-empty { margin: 0; padding: 10px; color: #58708d; font-size: .85rem; }

/* En escritorio se preservan nombres completos y columnas de notas legibles. */
@media screen and (min-width: 901px) {
  html body.is-authenticated:not(.report-print-body) #appMain #module-calificaciones .grade-table-wrap { overflow-x: auto !important; }
  html body.is-authenticated:not(.report-print-body) #appMain #module-calificaciones #gradeSpreadsheet { min-width: 930px !important; table-layout: auto !important; }
  html body.is-authenticated:not(.report-print-body) #appMain #module-calificaciones #gradeSpreadsheet :is(th, td):nth-child(2) { min-width: 230px !important; width: auto !important; }
  html body.is-authenticated:not(.report-print-body) #appMain #module-calificaciones #gradeSpreadsheet :is(th, td):not(:nth-child(2)) { white-space: nowrap !important; }
  html body.is-authenticated:not(.report-print-body) #appMain #module-calificaciones #gradeSpreadsheet .student-cell { white-space: normal !important; overflow-wrap: anywhere !important; }
}

@media screen and (max-width: 640px) {
  html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-navigator { padding: 11px; }
  html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-navigator-heading { display: grid; gap: 7px; }
  html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-navigator-count { justify-self: start; }
  html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-course-tiles,
  html body.is-authenticated:not(.report-print-body) #module-calificaciones .grade-subject-directory-list { grid-template-columns: 1fr; }
}
