/* v180.6.24.2 - HARD DARK FINAL OVERRIDE
   Carga al final del body para ganar contra estilos inline de vistas admin/secretaria.
   Objetivo: eliminar tablas/formularios blancos legacy en todos los roles e instituciones. */
:root{
  --final-bg:#06101e;
  --final-panel:#0b172a;
  --final-panel-2:#0f2038;
  --final-panel-3:#132946;
  --final-line:rgba(148,163,184,.30);
  --final-line-blue:rgba(96,165,250,.44);
  --final-text:#f8fbff;
  --final-soft:#dbeafe;
  --final-muted:#aebed4;
  --final-blue:#3b82f6;
  --final-violet:#7c3aed;
  --final-green:#22c55e;
  --final-red:#ef4444;
  --final-shadow:0 18px 46px rgba(0,0,0,.40);
}

html,body{background:var(--final-bg)!important;color:var(--final-text)!important;color-scheme:dark!important;}
body{background:radial-gradient(circle at 12% -10%,rgba(37,99,235,.18),transparent 30%),linear-gradient(180deg,#06101e,#071120)!important;}

/* Estructuras de roles */
body .page,body main,body .container,body .container-fluid,body .admin-view,body .secretaria-view,body .director-view,body .superadmin-view,
body [class*="admin"],body [class*="secretaria"],body [class*="director"],body [class*="superadmin"]{
  color:var(--final-text)!important;
}

/* Cards/paneles heredados */
body .admin-view .panel-card,body .admin-view .kpi,body .admin-view .hero-side,
body .secretaria-view .panel-card,body .director-view .panel-card,body .superadmin-view .panel-card,
body .card,body .card-body,body .card-header,body .card-footer,body .panel,body .box,body .module,body .widget,
body .section,body .section-card,body .table-card,body .filter-card,body .form-card,body .create-card,body .edit-card,
body form:not(.navbar-form):not(.inline):not([style*="display:inline"]):not([style*="display: inline"]){
  background:linear-gradient(180deg,rgba(15,29,51,.96),rgba(8,17,31,.99))!important;
  color:var(--final-text)!important;
  border-color:var(--final-line)!important;
}

/* Heroes */
body .admin-view .hero-main,body .secretaria-view .hero-main,body .director-view .hero-main,
body .hero,body .page-hero,body .admin-hero,body .secretaria-hero,body .dashboard-hero{
  background:linear-gradient(135deg,rgba(30,64,175,.96),rgba(15,23,42,.98) 58%,rgba(8,17,31,.98))!important;
  color:#fff!important;
  border-color:var(--final-line-blue)!important;
}

/* Typography */
body h1,body h2,body h3,body h4,body h5,body h6,body .title,body .page-title,body .section-title,body label,body th,body strong,body b{
  color:#f8fbff!important;
}
body p,body small,body .muted,body .text-muted,body .description,body .subtitle,body .help,body .hint{
  color:var(--final-muted)!important;
}
body a:not(.btn):not(.mode-btn):not(.nav-link){color:#93c5fd!important;}

/* TABLAS: capa final, específica y agresiva */
body .admin-view .table-wrap,body .admin-view .mobile-table-scroll,body .admin-view .table-responsive,
body .secretaria-view .table-wrap,body .secretaria-view .mobile-table-scroll,body .secretaria-view .table-responsive,
body .director-view .table-wrap,body .superadmin-view .table-wrap,
body .table-wrap,body .table-responsive,body .table-container,body .table-shell,body .data-table-wrap,body .tabla-wrap,body .listado{
  background:linear-gradient(180deg,rgba(7,16,30,.98),rgba(5,12,24,1))!important;
  color:var(--final-text)!important;
  border:1px solid var(--final-line)!important;
  border-radius:18px!important;
  overflow:auto!important;
  box-shadow:var(--final-shadow)!important;
}
body .admin-view table,body .secretaria-view table,body .director-view table,body .superadmin-view table,
body table.table,body .table,body table{
  background:#071120!important;
  color:var(--final-text)!important;
  border-collapse:separate!important;
  border-spacing:0!important;
}
body .admin-view table thead,body .admin-view table thead tr,body .admin-view .table thead,body .admin-view .table thead tr,
body table thead,body table thead tr,body .table thead,body .table thead tr,body thead,body thead tr{
  background:linear-gradient(180deg,#172a46,#0b172a)!important;
  color:#fff!important;
}
body .admin-view table th,body .admin-view .table th,body .secretaria-view table th,body .secretaria-view .table th,
body table th,body .table th,body thead th{
  background:linear-gradient(180deg,#172a46,#0b172a)!important;
  color:#f8fbff!important;
  border-color:rgba(96,165,250,.36)!important;
  font-weight:900!important;
  text-transform:uppercase!important;
  letter-spacing:.035em!important;
}
body .admin-view table tbody,body .admin-view table tbody tr,body .secretaria-view table tbody,body .secretaria-view table tbody tr,
body table tbody,body table tbody tr,body .table tbody,body .table tbody tr{
  background:#0b172a!important;
  color:#e6f0ff!important;
}
body .admin-view table td,body .admin-view .table td,body .secretaria-view table td,body .secretaria-view .table td,
body .director-view table td,body .superadmin-view table td,body table td,body .table td,body tbody td{
  background:rgba(11,23,42,.96)!important;
  color:#e6f0ff!important;
  border-color:rgba(148,163,184,.18)!important;
}
body .admin-view table tr:nth-child(even) td,body .secretaria-view table tr:nth-child(even) td,body table tr:nth-child(even) td{
  background:rgba(15,31,54,.96)!important;
}
body .admin-view table tr:hover td,body .secretaria-view table tr:hover td,body table tr:hover td{
  background:rgba(37,99,235,.20)!important;
  color:#fff!important;
}
body table td *,body .table td *,body tbody td *{color:inherit!important;}

/* Mata blancos legacy por clases Bootstrap y por estilos inline generados antes */
body .bg-white,body .bg-light,body .table-light,body .table-white,body .list-group,body .list-group-item,
body .dropdown-menu,body .dropdown-item,body .modal-content,body .modal-body,body .modal-header,body .modal-footer,
body [style*="background:#fff"],body [style*="background: #fff"],body [style*="background:white"],body [style*="background: white"],
body [style*="background-color:#fff"],body [style*="background-color: #fff"],body [style*="background-color:white"],body [style*="background-color: white"],
body [style*="background:#f8"],body [style*="background: #f8"],body [style*="background-color:#f8"],body [style*="background-color: #f8"],
body [style*="background:#e5"],body [style*="background: #e5"],body [style*="background-color:#e5"],body [style*="background-color: #e5"]{
  background:linear-gradient(180deg,rgba(15,29,51,.96),rgba(8,17,31,.99))!important;
  color:var(--final-text)!important;
  border-color:var(--final-line)!important;
}

/* Formularios y controles */
body input,body select,body textarea,body .form-control,body .form-select,body .inputx,body .selectx,body .textarea,
body input[type="text"],body input[type="email"],body input[type="password"],body input[type="number"],body input[type="date"],body input[type="datetime-local"],body input[type="search"],body input[type="tel"],body input[type="url"]{
  background:#0d1b2f!important;
  color:#f8fbff!important;
  border:1px solid rgba(148,163,184,.42)!important;
  border-radius:12px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04)!important;
  outline:none!important;
}
body input:not([type="checkbox"]):not([type="radio"]),body select,body textarea,body .form-control,body .form-select,body .inputx,body .selectx{min-height:42px!important;}
body input:focus,body select:focus,body textarea:focus,body .form-control:focus,body .form-select:focus,body .inputx:focus,body .selectx:focus{
  background:#10213a!important;
  color:#fff!important;
  border-color:#60a5fa!important;
  box-shadow:0 0 0 3px rgba(59,130,246,.24)!important;
}
body input::placeholder,body textarea::placeholder{color:#9fb0c8!important;opacity:1!important;}
body select option{background:#0b172a!important;color:#f8fbff!important;}
body input:-webkit-autofill,body input:-webkit-autofill:hover,body input:-webkit-autofill:focus{
  -webkit-text-fill-color:#f8fbff!important;
  -webkit-box-shadow:0 0 0 1000px #0d1b2f inset!important;
}
body input[type="checkbox"],body input[type="radio"]{accent-color:#3b82f6!important;}

/* Botones y badges */
body button,body .btn,body a.btn,body input[type="submit"],body input[type="button"],body .button,body .ui-btn{
  border-radius:12px!important;
  font-weight:900!important;
  border:1px solid rgba(148,163,184,.34)!important;
  color:#fff!important;
}
body .btn-primary,body .btn,body button[type="submit"],body input[type="submit"],body .primary{
  background:linear-gradient(135deg,var(--final-blue),var(--final-violet))!important;
  color:#fff!important;
  box-shadow:0 12px 28px rgba(37,99,235,.27)!important;
}
body .btn-secondary,body .btn-light,body .secondary,body .volver,body .back{
  background:rgba(15,29,51,.96)!important;
  color:#eaf2ff!important;
}
body .badge,body .pill,body .tag,body .chip,body .status,body [class*="badge"],body [class*="pill"]{
  background:rgba(37,99,235,.18)!important;
  color:#dbeafe!important;
  border:1px solid rgba(96,165,250,.34)!important;
  border-radius:999px!important;
  font-weight:900!important;
  text-shadow:none!important;
}

/* Navegación */
body .topbar,body .nav,body .navbar,body .tabs,body .area-nav,body .role-nav,body .admin-tabs,body .secretaria-tabs,body .panel-tabs,body .menu-tabs{
  background:rgba(8,17,31,.82)!important;
  border-color:var(--final-line)!important;
  color:var(--final-text)!important;
}

/* Mobile administración */
@media (max-width:900px){
  body main,body .container,body .container-fluid,body .page{padding-left:10px!important;padding-right:10px!important;}
  body .admin-view .hero,body .secretaria-view .hero,body .director-view .hero,body .superadmin-view .hero,
  body .admin-view .grid,body .secretaria-view .grid,body .director-view .grid,body .superadmin-view .grid,
  body .admin-view .kpis,body .secretaria-view .kpis,body .create-grid,body .form-grid,body .rowx{
    display:grid!important;grid-template-columns:1fr!important;
  }
  body table,body .table{min-width:760px!important;font-size:12px!important;}
  body th,body td,body .table th,body .table td{padding:10px 11px!important;}
  body input,body select,body textarea,body .form-control,body .form-select,body .inputx,body .selectx{font-size:14px!important;min-height:44px!important;}
}
