
/* =========================
   SIAC — DARK THEME (agresivo y deduplicado)
   Coloca este bloque DESPUÉS de tus overrides dark actuales.
   ========================= */

/* 0) Normaliza texto genérico en dark */
:root[data-bs-theme="dark"] .text-dark,
:root[data-bs-theme="dark"] .text-body,
:root[data-bs-theme="dark"] .text-black { color:#e6e9ef !important; }
:root[data-bs-theme="dark"] .text-white { color:#cbd5e1 !important; }

/* 1) FONDOS CLAROS INLINE → Oscuro (override duro) */
:root[data-bs-theme="dark"] [style*="background:#fff"],
:root[data-bs-theme="dark"] [style*="background: #fff"],
:root[data-bs-theme="dark"] [style*="background:#ffffff"],
:root[data-bs-theme="dark"] [style*="background: #ffffff"],
:root[data-bs-theme="dark"] [style*="background:rgb(255,255,255)"],
:root[data-bs-theme="dark"] [style*="background:#f8f9fa"],
:root[data-bs-theme="dark"] [style*="background: #f8f9fa"],
:root[data-bs-theme="dark"] [style*="background:#F2F4F7"],
:root[data-bs-theme="dark"] [style*="background: #F2F4F7"],
:root[data-bs-theme="dark"] [style*="background-color:#fff"],
:root[data-bs-theme="dark"] [style*="background-color: #fff"],
:root[data-bs-theme="dark"] [style*="background-color:#ffffff"],
:root[data-bs-theme="dark"] [style*="background-color: #ffffff"],
:root[data-bs-theme="dark"] [style*="background-color:rgb(255,255,255)"],
:root[data-bs-theme="dark"] [style*="background-color:#f8f9fa"],
:root[data-bs-theme="dark"] [style*="background-color: #f8f9fa"],
:root[data-bs-theme="dark"] [style*="background-color:#F2F4F7"],
:root[data-bs-theme="dark"] [style*="background-color: #F2F4F7"]{
  background:#0f1626 !important; color:#e6e9ef !important;
  border-color: rgba(255,255,255,.10) !important;
}

/* 2) Utilidades Bootstrap claras → Dark */
:root[data-bs-theme="dark"] .bg-white,
:root[data-bs-theme="dark"] .bg-light,
:root[data-bs-theme="dark"] .bg-body,
:root[data-bs-theme="dark"] .bg-body-tertiary,
:root[data-bs-theme="dark"] .bg-secondary-subtle,
:root[data-bs-theme="dark"] .bg-success-subtle,
:root[data-bs-theme="dark"] .bg-warning-subtle,
:root[data-bs-theme="dark"] .bg-danger-subtle,
:root[data-bs-theme="dark"] .bg-info-subtle,
:root[data-bs-theme="dark"] .bg-primary-subtle {
  background:#111b2a !important; color:#e6e9ef !important;
  border-color: rgba(255,255,255,.08) !important;
}

/* 3) Cards (cuerpo + headers/footers) */
:root[data-bs-theme="dark"] .card {
  background:#0f1626 !important;
  border:1px solid rgba(255,255,255,.08) !important;
  color:#e6e9ef !important;
}
:root[data-bs-theme="dark"] .card-header,
:root[data-bs-theme="dark"] .card-footer {
  background:#0c1321 !important;
  border-color:rgba(255,255,255,.08) !important;
  color:#e6e9ef !important;
}
:root[data-bs-theme="dark"] .card h5,
:root[data-bs-theme="dark"] .card h6,
:root[data-bs-theme="dark"] .card .card-title,
:root[data-bs-theme="dark"] .card .card-subtitle { color:#e6e9ef !important; }
:root[data-bs-theme="dark"] .card .text-muted,
:root[data-bs-theme="dark"] .card small { color:#9aa7bd !important; }

/* Íconos circulares dentro de cards */
:root[data-bs-theme="dark"] .card .rounded-circle {
  background:#1f2937 !important; color:#93c5fd !important;
}

/* 4) Tablas (estilo uniforme + thead sticky si aplica) */
:root[data-bs-theme="dark"] table td,
:root[data-bs-theme="dark"] table th {
  background-color:#0f1626 !important;
  color:#e6e9ef !important;
  border-color:rgba(255,255,255,.12) !important;
}
:root[data-bs-theme="dark"] table thead th {
  background:#0c1321 !important; color:#e6e9ef !important;
  font-weight:600; border-color:rgba(255,255,255,.10) !important;
}
:root[data-bs-theme="dark"] .table-bordered,
:root[data-bs-theme="dark"] .table-bordered > :not(caption) > * {
  border-color:rgba(255,255,255,.12) !important;
}
:root[data-bs-theme="dark"] table tbody tr:hover td {
  background-color:#152033 !important; color:#ffffff !important;
}

:root[data-bs-theme="dark"] .table > tfoot {
  --bs-table-bg: #0f1626;
  --bs-table-border-color: rgba(255,255,255,.12);
}

:root[data-bs-theme="dark"] .table > tfoot > tr,
:root[data-bs-theme="dark"] .table > tfoot > tr > * {
  border-color: rgba(255,255,255,.12) !important;
}

:root[data-bs-theme="dark"] .table > tfoot > tr > :is(td, th).text-end:not(.table-success) {
  --bs-table-bg: #1d3550;
  color: #8ac7f0 !important;
}

:root[data-bs-theme="dark"] .table {
  --bs-table-border-color: rgba(255,255,255,.12);
}

:root[data-bs-theme="dark"] .table .badge.bg-success-subtle {
  border-color: #245d43;
  background-color: #143526 !important;
  color: #6ee7a8 !important;
}

:root[data-bs-theme="dark"] .table .badge.bg-danger-subtle {
  border-color: #66313c;
  background-color: #3c1b23 !important;
  color: #fda4af !important;
}

:root[data-bs-theme="dark"] .table .badge.bg-secondary-subtle {
  border-color: #3b4657;
  background-color: #222c3a !important;
  color: #cbd5e1 !important;
}

:root[data-bs-theme="dark"] .table .badge.bg-warning-subtle {
  border-color: #654d20;
  background-color: #382d18 !important;
  color: #f6cf72 !important;
}

:root[data-bs-theme="dark"] .table .badge.bg-primary-subtle {
  border-color: #284f7b;
  background-color: #172f4b !important;
  color: #8ac7f0 !important;
}

:root[data-bs-theme="dark"] .table .badge.bg-info-subtle {
  border-color: #275866;
  background-color: #17343c !important;
  color: #83d8e7 !important;
}

/* Controles dentro de celdas */
:root[data-bs-theme="dark"] table td .form-control,
:root[data-bs-theme="dark"] table td .btn {
  background-color:#0b1220 !important; color:#e6e9ef !important;
  border-color:rgba(255,255,255,.15) !important;
}
:root[data-bs-theme="dark"] table td .btn:hover {
  background-color:#1d4ed8 !important; color:#fff !important;
}
/* Mantener headers personalizados incluso en DARK */
:root[data-bs-theme="dark"] .title-table-list tr th{
    background-color: rgb(2, 25, 41) !important; 
    color: #ffffff !important; 
    border: 1px solid rgba(255,255,255,.10) !important;
}

:root[data-bs-theme="dark"] .title-table-delete tr th{
    background-color: #C5172E !important; 
    color: #ffffff !important; 
    border: 1px solid #D2665A !important;
}

/* 5) Formularios */
:root[data-bs-theme="dark"] .form-control,
:root[data-bs-theme="dark"] .form-select,
:root[data-bs-theme="dark"] .input-group-text,
:root[data-bs-theme="dark"] .form-control:focus,
:root[data-bs-theme="dark"] .form-select:focus {
  background:#0f1626 !important; color:#e6e9ef !important;
  border-color:rgba(255,255,255,.12) !important;
  box-shadow:0 0 0 .2rem rgba(59,130,246,.15) !important; /* anillo azul suave */
}
:root[data-bs-theme="dark"] ::placeholder { color:#9aa7bd !important; opacity:1; }

/* ===== CHECKBOX DARK PRO ===== */

:root[data-bs-theme="dark"] .form-check-input {
  background-color: #0f1626 !important;
  border-color: rgba(255,255,255,.25) !important;
  box-shadow: none !important;
}

/* Hover */
:root[data-bs-theme="dark"] .form-check-input:hover {
  border-color: #3b82f6 !important;
}

/* Checked */
:root[data-bs-theme="dark"] .form-check-input:checked {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

/* Focus elegante */
:root[data-bs-theme="dark"] .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(59,130,246,.25) !important;
  border-color: #3b82f6 !important;
}

/* Disabled */
:root[data-bs-theme="dark"] .form-check-input:disabled {
  opacity: .5 !important;
}

/* 6) Botones Bootstrap base */
:root[data-bs-theme="dark"] .btn { border:1px solid transparent; color:#e6e9ef;
  transition:all .15s ease-in-out; text-shadow:none; box-shadow:none !important; }
:root[data-bs-theme="dark"] .btn i { color:inherit !important; }
:root[data-bs-theme="dark"] .btn:focus-visible {
  outline:0; box-shadow:0 0 0 .2rem rgba(148,163,184,.25) !important;
}
:root[data-bs-theme="dark"] .btn:disabled { opacity:.65; filter:saturate(.8); }

:root[data-bs-theme="dark"] .btn-primary   { background:#2563eb !important; border-color:#1e40af !important; color:#e6e9ef !important;}
:root[data-bs-theme="dark"] .btn-secondary { background:#334155 !important; border-color:#1f2937 !important; color:#e6e9ef !important;}
:root[data-bs-theme="dark"] .btn-success   { background:#16a34a !important; border-color:#15803d !important; color:#e6e9ef !important;}
:root[data-bs-theme="dark"] .btn-danger    { background:#dc2626 !important; border-color:#b91c1c !important; color:#e6e9ef !important;}
:root[data-bs-theme="dark"] .btn-warning   { background:#eab308 !important; border-color:#ca8a04 !important; color:#1f2937 !important; }
:root[data-bs-theme="dark"] .btn-info      { background:#0ea5e9 !important; border-color:#0284c7 !important; color:#e6e9ef !important;}
:root[data-bs-theme="dark"] .btn-light     { background:#334155 !important; border-color:#1f2937 !important; color:#e6e9ef !important; }

:root[data-bs-theme="dark"] .btn-outline-primary   { color:#93c5fd !important; border-color:#3b82f6 !important; }
:root[data-bs-theme="dark"] .btn-outline-secondary { color:#cbd5e1 !important; border-color:#475569 !important; }
:root[data-bs-theme="dark"] .btn-outline-success   { color:#86efac !important; border-color:#16a34a !important; }
:root[data-bs-theme="dark"] .btn-outline-danger    { color:#fecaca !important; border-color:#ef4444 !important; }
:root[data-bs-theme="dark"] .btn-outline-warning   { color:#fde68a !important; border-color:#eab308 !important; }
:root[data-bs-theme="dark"] .btn-outline-info      { color:#bae6fd !important; border-color:#0ea5e9 !important; }
:root[data-bs-theme="dark"] .btn-outline-light     { color:#e2e8f0 !important; border-color:#94a3b8 !important; }

/* 7) Botones personalizados (acciones) */
:root[data-bs-theme="dark"] .btn-dark-ghost{ background:transparent !important; border-color:rgba(255,255,255,.18) !important; color:#cbd5e1 !important; }
:root[data-bs-theme="dark"] .btn-dark-ghost:hover{ background:rgba(255,255,255,.06) !important; }

:root[data-bs-theme="dark"] .btn-add{ background:#10b981 !important; border-color:#0f9e72 !important; color:#0b1220 !important; }
:root[data-bs-theme="dark"] .btn-add:hover{ background:#34d399 !important; color:#0b1220 !important; }
:root[data-bs-theme="dark"] .btn-add:active{ background:#059669 !important; color:#e6e9ef !important; }

/* DARK — btn-edit manteniendo estilo light pero adaptado */
:root[data-bs-theme="dark"] a.btn.btn-edit{
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8) !important;
    color: #ffffff !important;
    border: 1px solid #1e40af !important;
}

:root[data-bs-theme="dark"] a.btn.btn-edit:hover{
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    color:#ffffff !important;
}

:root[data-bs-theme="dark"] a.btn.btn-edit:active{
    background:#1e40af !important;
}

:root[data-bs-theme="dark"] .btn-delete{ background:#ec2626 !important; border-color:#dc2626 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-delete:hover{ background:#dc2626 !important; color:#fff !important; }
:root[data-bs-theme="dark"] .btn-delete:active{ background:#b91c1c !important; color:#fff !important; }

:root[data-bs-theme="dark"] .btn-update{ background:#eab308 !important; border-color:#ca8a04 !important; color:#1f2937 !important; }
:root[data-bs-theme="dark"] .btn-update:hover{ background:#facc15 !important; color:#111827 !important; }
:root[data-bs-theme="dark"] .btn-update:active{ background:#d97706 !important; color:#0b1220 !important; }

:root[data-bs-theme="dark"] .btn-save{ background:#16a34a !important; border-color:#15803d !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-save:hover{ background:#22c55e !important; color:#fff !important; }
:root[data-bs-theme="dark"] .btn-save:active{ background:#15803d !important; color:#fff !important; }

:root[data-bs-theme="dark"] .btn-cancel{ background:#374151 !important; border-color:#1f2937 !important; color:#fff!important;}
:root[data-bs-theme="dark"] .btn-cancel:hover{ background:#4b5563 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-cancel:active{ background:#1f2937 !important; color:#fff !important;}

/* Especiales */
:root[data-bs-theme="dark"] .btn-pdf{ background:#b91c1c !important; border-color:#991b1b !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-pdf:hover{ background:#dc2626 !important; color:#fff !important;}

:root[data-bs-theme="dark"] .btn-excel{ background:#15803d !important; border-color:#166534 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-excel:hover{ background:#16a34a !important; color:#fff !important; }

:root[data-bs-theme="dark"] .btn-whatsapp{ background:#16a34a !important; border-color:#15803d !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-whatsapp:hover{ background:#22c55e !important; color:#fff !important; }

/* Paletas extra */
:root[data-bs-theme="dark"] .btn-gris{ background:#6b7280 !important; border-color:#4b5563 !important; color:#fff !important; }
:root[data-bs-theme="dark"] .btn-gris:hover{ background:#9ca3af !important; color:#fff !important; }
:root[data-bs-theme="dark"] .btn-naranja{ background:#ea580c !important; border-color:#c2410c !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-naranja:hover{ background:#f97316 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-cafe{ background:#8b5e3c !important; border-color:#6b4428 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-cafe:hover{ background:#a06b46 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-amarillo{ background:#f59e0b !important; border-color:#d97706 !important; color:#1f2937 !important; }
:root[data-bs-theme="dark"] .btn-amarillo:hover{ background:#fbbf24 !important; color:#000 !important; }
:root[data-bs-theme="dark"] .btn-morado{ background:#7c3aed !important; border-color:#6d28d9 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-morado:hover{ background:#8b5cf6 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-cielo{ background:#0ea5e9 !important; border-color:#0284c7 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-cielo:hover{ background:#38bdf8 !important; color:#fff !important; }
:root[data-bs-theme="dark"] .btn-verde-agua{ background:#079e71 !important; border-color:#079b76 !important;  color:#fff !important;}
:root[data-bs-theme="dark"] .btn-verde-agua:hover{ background:#079e71 !important; color:#fff !important; }
:root[data-bs-theme="dark"] .btn-azul{ background:#1e90ff !important; border-color:#1b75d1 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-azul:hover{ background:#60a5fa !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-rosa{ background:#e83e8c !important; border-color:#c2185b !important; color:#000 !important;}
:root[data-bs-theme="dark"] .btn-rosa:hover{ background:#f472b6 !important; }
:root[data-bs-theme="dark"] .btn-guinda{ background:#800020 !important; border-color:#5e0018 !important; color:#fff !important;}
:root[data-bs-theme="dark"] .btn-guinda:hover{ background:#a80a3a !important; }
:root[data-bs-theme="dark"] .btn-coral{ background:#ff7f50 !important; border-color:#f9735f !important; color:#000 !important; }
:root[data-bs-theme="dark"] .btn-coral:hover{ background:#ff9a7a !important; color:#000 !important; }
/* Variante “rojo suave” en dark como ghost */
:root[data-bs-theme="dark"] .btn-rojo-suave{ background:#4c1d1d !important; border-color:#7f1d1d !important; color:#fecaca !important; }
:root[data-bs-theme="dark"] .btn-rojo-suave:hover{ background:#7f1d1d !important; color:#fff !important; }

/* ===== Botones UPDATE y DELETE dentro de tabla (dark premium) ===== */

:root[data-bs-theme="dark"] table .btn-update{
    background: linear-gradient(135deg, #b45309, #eab308) !important;
    color: #1f2937 !important;
}

:root[data-bs-theme="dark"] table .btn-update:hover{
    background: linear-gradient(135deg, #d97706, #facc15) !important;
    color:#111827 !important;
}

:root[data-bs-theme="dark"] table .btn-delete{
    background: linear-gradient(135deg, #b91c1c, #ef4444) !important;
    color: #ffffff !important;
}

:root[data-bs-theme="dark"] table .btn-delete:hover{
    background: linear-gradient(135deg, #dc2626, #f87171) !important;
    color:#ffffff !important;
}

/* ===== Botón AZUL dentro de tabla (dark) ===== */
:root[data-bs-theme="dark"] table .btn-azul{
    background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
    color: #ffffff !important;
}

:root[data-bs-theme="dark"] table .btn-azul:hover{
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    color:#ffffff !important;
}

/* ===== Botón GRIS dentro de tabla (dark) ===== */
:root[data-bs-theme="dark"] table .btn-gris{
    background: linear-gradient(135deg, #374151, #6b7280) !important;
    color: #ffffff !important;
}

:root[data-bs-theme="dark"] table .btn-gris:hover{
    background: linear-gradient(135deg, #4b5563, #9ca3af) !important;
    color:#ffffff !important;
}

/* ===== Botón VERDE-AGUA dentro de tabla (dark) ===== */
:root[data-bs-theme="dark"] table .btn-verde-agua{
    background: linear-gradient(135deg, #0f766e, #20c997) !important;
    color: #ffffff !important;
}

:root[data-bs-theme="dark"] table .btn-verde-agua:hover{
    background: linear-gradient(135deg, #14b8a6, #34e5b6) !important;
    color:#0b1220 !important;
}

/* ===== Botón LIGHT dentro de tabla (dark) ===== */
:root[data-bs-theme="dark"] table .btn-light{
    background: linear-gradient(135deg, #334155, #475569) !important;
    color: #e6e9ef !important;
}

:root[data-bs-theme="dark"] table .btn-light:hover{
    background: linear-gradient(135deg, #475569, #64748b) !important;
    color:#ffffff !important;
}

/* ===== SweetAlert DARK ===== */
:root[data-bs-theme="dark"] .swal2-popup{
    background: #0f1626 !important;
    color: #e6e9ef !important;
}

:root[data-bs-theme="dark"] .swal2-title{
    color: #ffffff !important;
}

:root[data-bs-theme="dark"] .swal2-html-container{
    color: #cbd5e1 !important;
}

:root[data-bs-theme="dark"] .swal2-icon{
    border-color: rgba(255,255,255,.25) !important;
}
/* ===== SweetAlert botones texto blanco en DARK ===== */

:root[data-bs-theme="dark"] .swal2-confirm{
    color: #ffffff !important;
}

:root[data-bs-theme="dark"] .swal2-cancel{
    color: #ffffff !important;
}

:root[data-bs-theme="dark"] .swal2-deny{
    color: #ffffff !important;
}


/*para el selct2*/
/* ===========================
   SELECT2 DARK — limpio
=========================== */

/* Fondo dropdown */
:root[data-bs-theme="dark"] 
.select2-container--bootstrap-5 
.select2-dropdown{
    background: #0f1626 !important;
    border: 1px solid rgba(255,255,255,.08) !important;
}

/* Opciones base */
:root[data-bs-theme="dark"] 
.select2-container--bootstrap-5 
.select2-results__option{
    background: #0f1626 !important;
    color: #e6e9ef !important;
}

/* Hover (gris elegante, no azulado feo) */
/* HOVER SELECT2 DARK — FIX REAL */
html[data-bs-theme="dark"] 
.select2-container--bootstrap-5 
.select2-results__option--highlighted[aria-selected="false"]{
    background-color: #1e293b !important;
    color: #ffffff !important;
}

/* Seleccionado (azul suave moderno) */
:root[data-bs-theme="dark"] 
.select2-container--bootstrap-5 
.select2-results__option[aria-selected="true"]{
    background: #1e40af !important;  /* azul profundo suave */
    color: #ffffff !important;
}

/* Input búsqueda */
:root[data-bs-theme="dark"] 
.select2-container--bootstrap-5 
.select2-search__field{
    background: #111827 !important;
    color: #e6e9ef !important;
    border: 1px solid rgba(255,255,255,.08) !important;
}
/* 8) Badges */
:root[data-bs-theme="dark"] .badge.bg-light-subtle{
    background: rgba(148,163,184,.12) !important;
    color:#cbd5e1 !important;
}

:root[data-bs-theme="dark"] .badge.bg-white-subtle{
    background: rgba(255,255,255,.08) !important;
    color:#e5e7eb !important;
}

:root[data-bs-theme="dark"] .badge.bg-primary-subtle{
    background: rgba(59,130,246,.18) !important;
    color:#93c5fd !important;
}

:root[data-bs-theme="dark"] .badge.bg-success-subtle{
    background: rgba(16,185,129,.18) !important;
    color:#6ee7b7 !important;
}

:root[data-bs-theme="dark"] .badge.bg-danger-subtle{
    background: rgba(239,68,68,.18) !important;
    color:#fca5a5 !important;
}

:root[data-bs-theme="dark"] .badge.bg-warning-subtle{
    background: rgba(245,158,11,.18) !important;
    color:#fcd34d !important;
}

:root[data-bs-theme="dark"] .badge.bg-secondary-subtle{
    background: rgba(100,116,139,.18) !important;
    color:#cbd5e1 !important;
}

/* 9) Paginación */
:root[data-bs-theme="dark"] .page-link{ background:#0f1626 !important; color:#cbd5e1 !important; border-color:#22314a !important; }
:root[data-bs-theme="dark"] .page-link:hover{ background:#152033 !important; color:#e6e9ef !important; }
:root[data-bs-theme="dark"] .page-item.active .page-link{ background:#2563eb !important; border-color:#1e40af !important; }

/* 10) Nav tabs / pills */
:root[data-bs-theme="dark"] .nav-tabs .nav-link{
  background:#0f1626 !important; color:#cbd5e1 !important; border-color:#22314a !important;
}
:root[data-bs-theme="dark"] .nav-tabs .nav-link.active{
  background:#0c1321 !important; color:#e6e9ef !important; border-bottom-color:#0c1321 !important;
}
:root[data-bs-theme="dark"] .nav-pills .nav-link{ background:#0f1626 !important; color:#cbd5e1 !important; }
:root[data-bs-theme="dark"] .nav-pills .nav-link.active{ background:#2563eb !important; color:#fff !important; }

/* 11) Alerts */
:root[data-bs-theme="dark"] .alert{
  background:#111b2a !important; color:#e6e9ef !important;
  border-color:rgba(255,255,255,.12) !important;
}

/* 12) Modal / Offcanvas / List group */
:root[data-bs-theme="dark"] .modal-content,
:root[data-bs-theme="dark"] .offcanvas,
:root[data-bs-theme="dark"] .list-group-item{
  background:#0f1626 !important; color:#e6e9ef !important;
  border-color:rgba(255,255,255,.12) !important;
}

/* 13) Tooltips / Popovers */
:root[data-bs-theme="dark"] .tooltip .tooltip-inner{ background:#0b1220 !important; color:#e6e9ef !important; }
:root[data-bs-theme="dark"] .popover{ background:#0f1626 !important; color:#e6e9ef !important; border-color:rgba(255,255,255,.12) !important; }

/* 14) Breadcrumb */
:root[data-bs-theme="dark"] .breadcrumb{ --bs-breadcrumb-divider-color:#94a3b8; }
:root[data-bs-theme="dark"] .breadcrumb .breadcrumb-item,
:root[data-bs-theme="dark"] .breadcrumb a { color:#cbd5e1 !important; }

/* 15) DataTables (header sticky) */
:root[data-bs-theme="dark"] .dt-scroll-head,
:root[data-bs-theme="dark"] .dt-scroll-head .dataTables_scrollHeadInner{
  background:#0c1321 !important; border-bottom:1px solid rgba(255,255,255,.10) !important;
}
:root[data-bs-theme="dark"] .dataTables_info,
:root[data-bs-theme="dark"] .dataTables_paginate { color:#cbd5e1 !important; }

/* 16) Select2 (tema bootstrap-5) */
:root[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection{
  background-color:#0f1626 !important; color:#e6e9ef !important;
  border:1px solid rgba(255,255,255,.15) !important;
}
:root[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__rendered{
  color:#ffffff !important; font-weight:500;
}
:root[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__placeholder{
  color:#9aa7bd !important;
}

/* 17) Bordes / HR suaves */
:root[data-bs-theme="dark"] hr,
:root[data-bs-theme="dark"] .border,
:root[data-bs-theme="dark"] .border-top,
:root[data-bs-theme="dark"] .border-bottom,
:root[data-bs-theme="dark"] .border-start,
:root[data-bs-theme="dark"] .border-end {
  border-color:rgba(255,255,255,.12) !important;
}

/* 18) Links */
:root[data-bs-theme="dark"] a { color:#93c5fd; }
:root[data-bs-theme="dark"] a:hover { color:#bfdbfe; }
:root[data-bs-theme="dark"] button {
    color: #93c5fd;
}

:root[data-bs-theme="dark"] button:hover {
    color: #bfdbfe;
}
/* 19) Navbar (AdminLTE .app-header) */
:root[data-bs-theme="dark"] .app-header.navbar{
  background-color:#0b0f1a !important;
  border-bottom:1px solid rgba(255,255,255,.08) !important;
  color:#e6e9ef !important;
}
:root[data-bs-theme="dark"] .app-header .nav-link,
:root[data-bs-theme="dark"] .app-header .navbar-brand,
:root[data-bs-theme="dark"] .app-header .navbar-text { color:#e6e9ef !important; }
:root[data-bs-theme="dark"] .app-header .nav-link:hover { color:#93c5fd !important; }

/* 20) Footer */
:root[data-bs-theme="dark"] .app-footer{
  background-color:#0b0f1a !important;
  border-top:1px solid rgba(255,255,255,.08) !important;
  color:#e6e9ef !important;
}
:root[data-bs-theme="dark"] .app-footer small,
:root[data-bs-theme="dark"] .app-footer .text-muted { color:#9aa7bd !important; }
:root[data-bs-theme="dark"] .app-footer i { color:#93c5fd !important; }
/* === Fix: textos dentro de botones (dark) === */
:root[data-bs-theme="dark"] .btn small,
:root[data-bs-theme="dark"] .btn .small,
:root[data-bs-theme="dark"] .btn .text-muted {
  color: currentColor !important;   /* usa el color del botón (texto del botón) */
  opacity: 1 !important;            /* evita que se vea deslavado */
}

/* Íconos ya heredan color, reforzamos para anchors también */
:root[data-bs-theme="dark"] .btn i,
:root[data-bs-theme="dark"] a.btn i {
  color: inherit !important;
}

/* Opcional: si los botones están dentro de .card, subimos especificidad */
:root[data-bs-theme="dark"] .card .btn small,
:root[data-bs-theme="dark"] .card a.btn small {
  color: currentColor !important;
}

/* ===== SIAC — Fix filas claras en DARK (Bootstrap + DataTables) ===== */

/* 1) Bootstrap .table-striped: define el stripe oscuro */
:root[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > *{
  --bs-table-striped-bg: #0f1b2a !important;
  --bs-table-accent-bg: #0f1b2a !important;   /* stripe oscuro */
  color: #e6e9ef !important;
}

/* 2) DataTables agrega .odd/.even: neutraliza fondo claro */
:root[data-bs-theme="dark"] table.dataTable.stripe tbody tr.odd > *,
:root[data-bs-theme="dark"] table.dataTable.display tbody tr.odd > *{
  background-color: #0f1b2a !important;
  color: #e6e9ef !important;
}
:root[data-bs-theme="dark"] table.dataTable.stripe tbody tr.even > *,
:root[data-bs-theme="dark"] table.dataTable.display tbody tr.even > *{
  background-color: #0f1626 !important; /* base oscuro */
  color: #e6e9ef !important;
}

/* 3) DataTables hover (por si usas .table-hover) */
:root[data-bs-theme="dark"] .table-hover > tbody > tr:hover > *{
  --bs-table-accent-bg: #152033 !important;
  color: #ffffff !important;
}

/* 4) Si alguna fila/celda trae gradient inline, lo apagamos en tablas */
:root[data-bs-theme="dark"] table [style*="linear-gradient"],
:root[data-bs-theme="dark"] table [style*="background-image"]{
  background-image: none !important;
}

/* 5) Selección global legible en modo oscuro */
:root[data-bs-theme="dark"] table tbody tr.fila-seleccionada > * {
  background-color: #172b45 !important;
  background-image: none !important;
  color: #f1f5f9 !important;
  border-color: #34465c !important;
  box-shadow:
    inset 0 1px 0 rgba(96, 165, 250, .34),
    inset 0 -1px 0 rgba(96, 165, 250, .34) !important;
}

:root[data-bs-theme="dark"] table tbody tr.fila-seleccionada:hover > * {
  background-color: #1b3352 !important;
}

:root[data-bs-theme="dark"] table tbody tr.fila-seleccionada .text-primary {
  color: #93c5fd !important;
}

:root[data-bs-theme="dark"] table tbody tr.fila-seleccionada .text-muted {
  color: #cbd5e1 !important;
}


/* ===== Loader overlay DARK ===== */
:root[data-bs-theme="dark"] #loadingOverlay{
    background: rgba(3, 7, 18, 0.85) !important; /* casi negro elegante */
}

:root[data-bs-theme="dark"] #loadingOverlay > div{
    background: #0f1626 !important;
    color: #e6e9ef !important;
    border: 1px solid rgba(255,255,255,.08) !important;
    box-shadow: 0 15px 40px rgba(0,0,0,.6) !important;
}

/* barra más acorde a dark */
:root[data-bs-theme="dark"] #loadingOverlay > div > div > div{
    background: linear-gradient(90deg,#1d4ed8,#3b82f6) !important;
}
/* ===== Loader text fix DARK ===== */
:root[data-bs-theme="dark"] #loadingOverlay{
    color: #e6e9ef !important;
}

:root[data-bs-theme="dark"] #loadingOverlay div[style*="color:#0f172a"]{
    color: #e6e9ef !important;
}

:root[data-bs-theme="dark"] #loadingOverlay div[style*="#64748b"]{
    color: #94a3b8 !important;
}


/* ===== HEADER DARK MODE ===== */
:root[data-bs-theme="dark"] .app-content-header h3 {
    color: #e6e9ef !important;
}

:root[data-bs-theme="dark"] .app-content-header .rounded-circle {
    background: linear-gradient(135deg,#0f172a,#1e293b) !important;
    color: #38bdf8 !important;
    box-shadow: 0 3px 10px rgba(0,0,0,.6) !important;
}

:root[data-bs-theme="dark"] .app-content-header a.btn-link-loading {
    background: rgba(59,130,246,.12) !important;
    color: #e6e9ef !important;
}

:root[data-bs-theme="dark"] .app-content-header a.btn-link-loading:hover {
    background: rgba(59,130,246,.25) !important;
}


/* ==============================
   FULLCALENDAR DARK MODE
============================== */

:root[data-bs-theme="dark"] .fc {

  --fc-border-color: rgba(255,255,255,.08);
  --fc-page-bg-color: #0f1626;
  --fc-neutral-bg-color: #0c1321;
  --fc-today-bg-color: rgba(59,130,246,.15);
  --fc-list-event-hover-bg-color: #152033;
}

/* Fondo general */
:root[data-bs-theme="dark"] .fc-theme-standard td,
:root[data-bs-theme="dark"] .fc-theme-standard th {
  border-color: rgba(255,255,255,.08) !important;
}

/* Toolbar */
:root[data-bs-theme="dark"] .fc-toolbar-title {
  color: #e6e9ef !important;
}

:root[data-bs-theme="dark"] .fc-button {
  background: #1e293b !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  color: #e6e9ef !important;
}

:root[data-bs-theme="dark"] .fc-button:hover {
  background: #2563eb !important;
  border-color: #1e40af !important;
  color: #fff !important;
}

/* Días */
:root[data-bs-theme="dark"] .fc-daygrid-day {
  background-color: #0f1626 !important;
}

:root[data-bs-theme="dark"] .fc-daygrid-day-number {
  color: #cbd5e1 !important;
}

:root[data-bs-theme="dark"] .fc-col-header-cell-cushion {
  color: #e6e9ef !important;
}

/* Día actual */
:root[data-bs-theme="dark"] .fc-day-today {
  background: rgba(59,130,246,.15) !important;
}

/* Eventos */
:root[data-bs-theme="dark"] .fc-event {
  color: #ffffff !important;
  border: none !important;
}

/* Hover evento */
:root[data-bs-theme="dark"] .fc-event:hover {
  filter: brightness(1.1);
}

/* Botón eliminar ✕ */
:root[data-bs-theme="dark"] .fc-event span {
  color: #f87171 !important;
}

:root[data-bs-theme="dark"] .btn-dots:hover {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

:root[data-bs-theme="dark"] .btn-dots:active {
  background: #273449 !important;
}

:root[data-bs-theme="dark"] .dropdown:has(> .btn-dots) > .dropdown-menu {
  border-color: #334155;
  background: #111827;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34) !important;
}

:root[data-bs-theme="dark"] .dropdown:has(> .btn-dots) > .dropdown-menu .dropdown-header {
  border-top-color: #273449;
  color: #94a3b8;
}

:root[data-bs-theme="dark"] .dropdown:has(> .btn-dots) > .dropdown-menu .dropdown-item {
  background: transparent;
  color: #dbe4ee;
}

:root[data-bs-theme="dark"] .dropdown:has(> .btn-dots) > .dropdown-menu .dropdown-item:hover,
:root[data-bs-theme="dark"] .dropdown:has(> .btn-dots) > .dropdown-menu .dropdown-item:focus {
  background: #1e293b !important;
  color: #ffffff !important;
}

/* === Sistema global de formularios SIAC · dark === */
:root[data-bs-theme="dark"]
:where(.app-content, .modal) form .form-label,
:root[data-bs-theme="dark"]
:where(.app-content, .modal) form.siac-form label:not(.form-check-label) {
  color: #94a3b8;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form .form-label:has(.text-danger),
:root[data-bs-theme="dark"]
:where(.app-content, .modal) form.siac-form label.text-danger {
  color: #dbe4ee;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form
:is(.form-control, .form-select):not([placeholder^="Buscar"]) {
  border-color: #334155 !important;
  background-color: #111827 !important;
  color: #e5e7eb !important;
  box-shadow: none !important;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form
:is(.form-control, .form-select):not([placeholder^="Buscar"]):hover:not(:disabled):not([readonly]) {
  border-color: #475569 !important;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form
:is(.form-control, .form-select):not([placeholder^="Buscar"]):focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16) !important;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form
:is(.form-control, .form-select):is(:disabled, [readonly]),
:root[data-bs-theme="dark"]
:where(.app-content, .modal) form .form-control.disabled {
  border-color: #53333d !important;
  background-color: #1b151c !important;
  color: #b9a3a9 !important;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form .input-group-text {
  border-color: #334155 !important;
  background: #172033 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form .form-control::file-selector-button {
  border-color: #334155;
  background: #172033;
  color: #cbd5e1;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form
.select2-container--bootstrap-5 .select2-selection {
  border-color: #334155 !important;
  background-color: #111827 !important;
  box-shadow: none !important;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form
.select2-container--bootstrap-5 .select2-selection:hover {
  border-color: #475569 !important;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
:root[data-bs-theme="dark"]
:where(.app-content, .modal) form
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16) !important;
}

:root[data-bs-theme="dark"]
:where(.app-content, .modal) form
.select2-container--bootstrap-5 .select2-selection__rendered {
  color: #e5e7eb !important;
}

/* Summernote integrado al modo oscuro */
:root[data-bs-theme="dark"] .note-editor.note-frame,
:root[data-bs-theme="dark"] .note-editor.note-airframe {
  border-color: #334155 !important;
  background: #111827 !important;
}

:root[data-bs-theme="dark"] .note-editor .note-toolbar,
:root[data-bs-theme="dark"] .note-popover .popover-content {
  border-color: #334155 !important;
  background: #172033 !important;
}

:root[data-bs-theme="dark"] .note-editor .note-toolbar .note-btn {
  border-color: #334155 !important;
  background: #1e293b !important;
  color: #cbd5e1 !important;
  box-shadow: none !important;
}

:root[data-bs-theme="dark"] .note-editor .note-toolbar .note-btn:hover,
:root[data-bs-theme="dark"] .note-editor .note-toolbar .note-btn:focus,
:root[data-bs-theme="dark"] .note-editor .note-toolbar .note-btn.active {
  border-color: #475569 !important;
  background: #2a3a50 !important;
  color: #fff !important;
}

:root[data-bs-theme="dark"] .note-editor .note-editing-area,
:root[data-bs-theme="dark"] .note-editor .note-editable {
  background: #111827 !important;
  color: #e5e7eb !important;
  caret-color: #fff;
}

:root[data-bs-theme="dark"] .note-editor .note-placeholder {
  color: #78879a !important;
}

:root[data-bs-theme="dark"] .note-editor .note-statusbar {
  border-color: #334155 !important;
  background: #172033 !important;
}

:root[data-bs-theme="dark"] .note-editor .note-status-output {
  color: #cbd5e1 !important;
}

:root[data-bs-theme="dark"] .note-editor .note-dropdown-menu,
:root[data-bs-theme="dark"] .note-editor .dropdown-menu,
:root[data-bs-theme="dark"] .note-popover {
  border-color: #334155 !important;
  background: #172033 !important;
  color: #e5e7eb !important;
}

:root[data-bs-theme="dark"] .note-editor .note-dropdown-item:hover,
:root[data-bs-theme="dark"] .note-editor .dropdown-item:hover {
  background: #273449 !important;
  color: #fff !important;
}

:root[data-bs-theme="dark"] .note-modal-content {
  border-color: #334155 !important;
  background: #111827 !important;
  color: #e5e7eb !important;
}

:root[data-bs-theme="dark"] .note-modal-header,
:root[data-bs-theme="dark"] .note-modal-footer {
  border-color: #334155 !important;
}

:root[data-bs-theme="dark"] .note-form-control {
  border-color: #334155 !important;
  background: #0f172a !important;
  color: #e5e7eb !important;
}

/* === Sistema global de modales SIAC · dark === */
:root[data-bs-theme="dark"] .modal .modal-content {
  border-color: #334155 !important;
  background: #111827 !important;
  color: #dbe4ee !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42) !important;
}

:root[data-bs-theme="dark"] .modal .modal-header,
:root[data-bs-theme="dark"] .modal .modal-footer {
  border-color: #2b3749 !important;
}

:root[data-bs-theme="dark"] .modal .modal-header:not([class*="bg-"]),
:root[data-bs-theme="dark"] .modal .modal-footer:not([class*="bg-"]),
:root[data-bs-theme="dark"] .modal .modal-header.bg-light,
:root[data-bs-theme="dark"] .modal .modal-footer.bg-light,
:root[data-bs-theme="dark"] .modal .modal-footer.bg-white {
  background: #151e2d !important;
}

:root[data-bs-theme="dark"] .modal .modal-title {
  color: #edf3f9;
}

:root[data-bs-theme="dark"] .modal .modal-header[class*="bg-"] .modal-title {
  color: inherit;
}

:root[data-bs-theme="dark"] .modal .modal-header.bg-light .modal-title,
:root[data-bs-theme="dark"] .modal .modal-header.bg-light .text-dark {
  color: #edf3f9 !important;
}

:root[data-bs-theme="dark"] .modal .modal-header .btn-close {
  background-color: #243044;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23dbe4ee' d='M.293 1.293a1 1 0 0 1 1.414 0L8 6.586l6.293-6.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
  filter: none;
  opacity: 0.78;
}

:root[data-bs-theme="dark"] .modal .modal-header .btn-close:hover,
:root[data-bs-theme="dark"] .modal .modal-header .btn-close:focus {
  background-color: #3b2630;
  opacity: 1;
}

:root[data-bs-theme="dark"] .modal .modal-header[class*="bg-"] .btn-close {
  background-color: rgba(255, 255, 255, 0.16);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23ffffff' d='M.293 1.293a1 1 0 0 1 1.414 0L8 6.586l6.293-6.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
  filter: none !important;
}

/* Salida común de los sidebars CRM, TASK y ASIST en modo oscuro. */
:root[data-bs-theme="dark"] .siac-sidebar-exit {
  border-top-color:#273449 !important;
  background:#111827 !important;
}
:root[data-bs-theme="dark"] .siac-sidebar-exit__link {
  border-color:#713445 !important;
  background:#1e293b !important;
  color:#fda4af !important;
  box-shadow:none !important;
}
:root[data-bs-theme="dark"] .siac-sidebar-exit__link:hover {
  border-color:#a94d62 !important;
  background:#2b1d29 !important;
  color:#fecdd3 !important;
  box-shadow:0 8px 17px rgba(0,0,0,.18) !important;
}
:root[data-bs-theme="dark"] .siac-sidebar-exit__icon {
  background:rgba(244,63,94,.12) !important;
  color:#fb7185 !important;
}


