/* ============================================================
   FASE 79 - HOTFIX GLOBAL DE LEGIBILIDAD Y CONTRASTE
   LMS SAAS ENTERPRISE EDUCATIVO
   Objetivo: corregir textos lavados/blancos sobre fondos claros en paneles.
   No modifica BD. Compatible Hostinger.
   ============================================================ */

:root{
  --lms-fix-text:#071733;
  --lms-fix-title:#06122e;
  --lms-fix-muted:#1e3a5f;
  --lms-fix-bg:#eef4ff;
  --lms-fix-card:#ffffff;
  --lms-fix-line:#c7d7ee;
  --lms-fix-primary:#2563eb;
  --lms-fix-dark:#071426;
}

html,body{
  opacity:1 !important;
  filter:none !important;
  text-shadow:none !important;
}

/* ---------- Layout general ---------- */
body:not(.landing-page):not(.public-page),
body:not(.landing-page):not(.public-page) main,
body:not(.landing-page):not(.public-page) .content,
body:not(.landing-page):not(.public-page) .main,
body:not(.landing-page):not(.public-page) .page,
body:not(.landing-page):not(.public-page) .wrapper,
body:not(.landing-page):not(.public-page) .content-wrapper{
  color:var(--lms-fix-text) !important;
  opacity:1 !important;
  filter:none !important;
}

/* Fondos claros de panel */
body:not(.landing-page):not(.public-page){
  background:linear-gradient(180deg,#eef4ff 0%,#f8fbff 52%,#eef4ff 100%) !important;
}

/* ---------- Topbar / header ---------- */
.topbar,
.sa-main-topbar{
  background:#ffffff !important;
  color:var(--lms-fix-title) !important;
  border-bottom:1px solid var(--lms-fix-line) !important;
  opacity:1 !important;
}
.topbar *,
.sa-main-topbar *,
.brand,
.brand *,
.sa-mobile-title,
.sa-mobile-title *,
.sa-top-actions,
.sa-top-actions *{
  color:var(--lms-fix-title) !important;
  -webkit-text-fill-color:var(--lms-fix-title) !important;
  opacity:1 !important;
  text-shadow:none !important;
}
.sa-top-avatar{
  background:#2563eb !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
.sa-top-bell{
  background:#eef4ff !important;
  border:1px solid #d6e3f7 !important;
}

/* ---------- Títulos y textos sobre tarjetas claras ---------- */
.card h1,.card h2,.card h3,.card h4,.card h5,.card h6,
.panel h1,.panel h2,.panel h3,.panel h4,.panel h5,.panel h6,
.box h1,.box h2,.box h3,.box h4,.box h5,.box h6,
.ui-card h1,.ui-card h2,.ui-card h3,.ui-card h4,
.sa-card h1,.sa-card h2,.sa-card h3,.sa-card h4,
.sa-pro-panel h1,.sa-pro-panel h2,.sa-pro-panel h3,.sa-pro-panel h4,
.sa-main h1,.sa-main h2,.sa-main h3,.sa-main h4,
.page-title,.section-title,.title{
  color:var(--lms-fix-title) !important;
  -webkit-text-fill-color:var(--lms-fix-title) !important;
  opacity:1 !important;
  font-weight:900 !important;
  text-shadow:none !important;
}

.card p,.card span,.card small,.card label,
.panel p,.panel span,.panel small,.panel label,
.box p,.box span,.box small,.box label,
.ui-card p,.ui-card span,.ui-card small,.ui-card label,
.sa-card p,.sa-card span,.sa-card small,.sa-card label,
.sa-pro-panel p,.sa-pro-panel span,.sa-pro-panel small,.sa-pro-panel label,
.muted,.text-muted,.small.muted,.help-text,.form-text,
.kpi-label,.kpi-subtitle,.stat-label,.stat-subtitle{
  color:var(--lms-fix-muted) !important;
  -webkit-text-fill-color:var(--lms-fix-muted) !important;
  opacity:1 !important;
  text-shadow:none !important;
}

/* ---------- Tarjetas y contenedores ---------- */
.card,.panel,.box,.ui-card,.sa-card,.sa-panel,.sa-pro-panel,
.sa-kpi-pro,.sa-quick-card,.sa-alert-item,.bi-shell .card{
  background:#ffffff !important;
  color:var(--lms-fix-text) !important;
  border:1px solid var(--lms-fix-line) !important;
  box-shadow:0 10px 26px rgba(15,23,42,.08) !important;
  opacity:1 !important;
  filter:none !important;
}

/* ---------- Formularios ---------- */
label,.form-label{
  color:var(--lms-fix-title) !important;
  -webkit-text-fill-color:var(--lms-fix-title) !important;
  font-weight:800 !important;
  opacity:1 !important;
}
input,select,textarea,.input,.form-control,.form-select{
  background:#071426 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border:1px solid #5b7aa6 !important;
  opacity:1 !important;
  text-shadow:none !important;
  box-shadow:0 6px 14px rgba(15,23,42,.12) !important;
}
input::placeholder,textarea::placeholder{
  color:#cbd5e1 !important;
  -webkit-text-fill-color:#cbd5e1 !important;
  opacity:1 !important;
}
select option{
  background:#071426 !important;
  color:#ffffff !important;
}
input[type="checkbox"],input[type="radio"]{
  box-shadow:none !important;
  -webkit-text-fill-color:initial !important;
  accent-color:#2563eb !important;
}

/* ---------- Botones y enlaces de acción ---------- */
.btn,.ui-btn,.sa-btn,.lms-btn,button,[type="submit"]{
  opacity:1 !important;
  text-shadow:none !important;
  font-weight:800 !important;
}
.btn-primary,.ui-btn,.sa-btn.primary,.lms-btn:not(.secondary),button[type="submit"]{
  background:#2563eb !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border-color:#2563eb !important;
}
.btn-secondary,.secondary{
  color:#0f2a55 !important;
  -webkit-text-fill-color:#0f2a55 !important;
  background:#eaf2ff !important;
  border-color:#bfdbfe !important;
}
a:not(.sa-side a):not(.btn):not(.ui-btn):not(.sa-btn){
  opacity:1 !important;
  text-shadow:none !important;
}

/* ---------- Tablas ---------- */
table,.table,.ui-table,.sa-table{
  opacity:1 !important;
  color:#ffffff !important;
}
table th,.table th,.ui-table th,.sa-table th{
  background:#071426 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border-color:#284763 !important;
  opacity:1 !important;
}
table td,.table td,.ui-table td,.sa-table td{
  background:#071426 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border-color:#284763 !important;
  opacity:1 !important;
}
table td *, .table td *, .ui-table td *, .sa-table td *{
  color:inherit !important;
  -webkit-text-fill-color:inherit !important;
  opacity:1 !important;
}

/* ---------- Superadmin específico ---------- */
body.sa-enterprise-pro .sa-main{
  background:linear-gradient(180deg,#eef4ff 0%,#f8fbff 52%,#eef4ff 100%) !important;
  color:var(--lms-fix-text) !important;
}
body.sa-enterprise-pro .sa-main > section,
body.sa-enterprise-pro .sa-main > div:not(.sa-alert):not(.sa-main-topbar){
  opacity:1 !important;
  filter:none !important;
}
body.sa-enterprise-pro .sa-hero-pro,
body.sa-enterprise-pro .sa-hero-pro *,
body.sa-enterprise-pro .sa-side,
body.sa-enterprise-pro .sa-side *{
  opacity:1 !important;
  text-shadow:none !important;
}
body.sa-enterprise-pro .sa-side,
body.sa-enterprise-pro .sa-side a,
body.sa-enterprise-pro .sa-side span,
body.sa-enterprise-pro .sa-side strong,
body.sa-enterprise-pro .sa-side h1{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
body.sa-enterprise-pro .sa-hero-pro h1,
body.sa-enterprise-pro .sa-hero-pro h2,
body.sa-enterprise-pro .sa-hero-pro h3,
body.sa-enterprise-pro .sa-hero-pro p,
body.sa-enterprise-pro .sa-hero-pro span,
body.sa-enterprise-pro .sa-hero-pro small{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
body.sa-enterprise-pro .sa-kpi-pro strong,
body.sa-enterprise-pro .sa-kpi-pro b,
body.sa-enterprise-pro .sa-card strong,
body.sa-enterprise-pro .sa-card b{
  color:#06122e !important;
  -webkit-text-fill-color:#06122e !important;
  font-weight:950 !important;
  opacity:1 !important;
}
body.sa-enterprise-pro .sa-kpi-pro span,
body.sa-enterprise-pro .sa-kpi-pro small{
  color:#1e3a5f !important;
  -webkit-text-fill-color:#1e3a5f !important;
  font-weight:800 !important;
}

/* ---------- Selección de texto: evita confundir con textos lavados ---------- */
::selection{
  background:#2563eb !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

/* ---------- Responsive ---------- */
@media(max-width:768px){
  .card,.panel,.box,.ui-card,.sa-card,.sa-panel,.sa-pro-panel{border-radius:14px !important;}
  .topbar,.sa-main-topbar{position:sticky;top:0;z-index:1000;}
}
