/* EduGestión PRO — Fase 4R: capa común de legibilidad, sin Javascript ni cambios de datos.
   Ubicar después de los CSS legacy. Colores semánticos, badges, íconos y controles nativos
   se conservan; corregimos textos apagados en superficies oscuras de la app. */
:root { --eg-text:#f5f9ff; --eg-muted:#d6e5f8; --eg-border:#648ab4; }
body.app-auth-layout, body:not(.public-auth-layout) { --text:#f5f9ff; --text-muted:#d6e5f8; }
body.app-auth-layout :is(.muted,.text-muted,.mutednote,.help-text,.hint,.subtext,.small.muted),
body.app-auth-layout :is(.card,.panel,.box,.stat,.kpi,.sec-v173,.dir-contrast-4o,.iv4i,.iv4q) :is(.muted,.text-muted,small,.small,.hint,.help-text,.lead,.foot),
body.app-auth-layout :is(.iv4i,.iv4q) :is(p,li,label,.lead,.foot),
body.app-auth-layout :is(.sec-v173,.dir-contrast-4o) :is(p,label,.kpi-label,.kpi-desc) {
  color:var(--eg-muted) !important;
  -webkit-text-fill-color:var(--eg-muted) !important;
  opacity:1 !important;
}
body.app-auth-layout :is(.card,.panel,.box,.sec-v173,.dir-contrast-4o,.iv4i,.iv4q) :is(h1,h2,h3,h4,h5,h6),
body.app-auth-layout :is(.iv4i,.iv4q) :is(strong,.value),
body.app-auth-layout :is(.sec-v173,.dir-contrast-4o) :is(strong,.kpi-value) {
  color:var(--eg-text) !important;
  -webkit-text-fill-color:var(--eg-text) !important;
  opacity:1 !important;
}
body.app-auth-layout :is(.iv4i,.iv4q) :is(input,textarea,select),
body.app-auth-layout :is(.sec-v173,.dir-contrast-4o) :is(input,textarea,select) {
  color:#f5f9ff !important; -webkit-text-fill-color:#f5f9ff !important;
  background-color:#0b1d35 !important; border-color:#7ba3d4 !important;
}
body.app-auth-layout :is(.iv4i,.iv4q,.sec-v173,.dir-contrast-4o) :is(input,textarea)::placeholder {
  color:#cbdcf0 !important; -webkit-text-fill-color:#cbdcf0 !important;opacity:1 !important;
}
body.app-auth-layout :is(.iv4i,.iv4q) :is(a.btn,button,.btn),
body.app-auth-layout :is(.sec-v173,.dir-contrast-4o) :is(a.btn,button.btn,.btn-primary) {
  color:#ffffff !important;-webkit-text-fill-color:#ffffff !important;opacity:1 !important;
}
/* Estados de atención y selección mantienen contraste, sin borrar su color de fondo. */
body.app-auth-layout :is(.iv4i,.iv4q,.sec-v173,.dir-contrast-4o) :is(a,button,input,select,textarea):focus-visible {
  outline:2px solid #a5ceff !important;outline-offset:2px;
}
/* Corrige el encabezado institucional del aviso 403, sin afectar badges o fondos. */
body.app-auth-layout .iv4q :is(.lead,.foot,.roles,.roles li) {
  color:#dfebff !important;-webkit-text-fill-color:#dfebff !important;
}

/* Fase 4S: menú empresarial, visible sin seleccionar texto ni pasar el mouse.
   Se limita al shell autenticado y no altera pantallas públicas o botones de acción. */
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-section > summary,
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-section > summary .section-title,
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-section > summary .section-title *,
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-section > summary .section-count,
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-link,
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-link > span:not(.link-dot),
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-brand-box :is(strong,small,p),
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-context-box :is(strong,small,p) {
  color:#f1f7ff !important;
  -webkit-text-fill-color:#f1f7ff !important;
  opacity:1 !important;
  text-shadow:none !important;
}
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-link:hover,
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-link:focus-visible,
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-link.active {
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-section > summary:focus-visible,
body.app-auth-layout .lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-link:focus-visible {
  outline:2px solid #afd4ff !important;
  outline-offset:2px;
}

/* Fase 4T - encabezados del menu lateral. Selectores anclados a la
   estructura del menu, sin depender de clases adicionales del body. */
.lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-section > summary .section-title,
.lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-section > summary .section-count,
.lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-section > summary .section-icon,
.lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-link > span:not(.link-dot) {
  color:#f5f9ff !important;
  -webkit-text-fill-color:#f5f9ff !important;
  opacity:1 !important;
  visibility:visible !important;
  filter:none !important;
  mix-blend-mode:normal !important;
  text-shadow:none !important;
}
.lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-section > summary {
  color:#f5f9ff !important;
  -webkit-text-fill-color:#f5f9ff !important;
  opacity:1 !important;
}
.lms-enterprise-shell-v82 .lms-enterprise-sidebar .lms-sidebar-link:focus-visible {
  outline:2px solid #aacfff !important;
  outline-offset:2px;
}
