/*
 * Modo oscuro de todo el panel: todo cuelga de html.dark (lo pone window.feTheme, ver layouts/theme).
 * Colores con las variables de public/css/theme.css.
 *
 * Orden: Bootstrap 5.3 (variables) → base de Tailwind → campos → utilidades de Tailwind sin variante dark:
 * → componentes de Bootstrap → DataTables → select2 → daterangepicker → SweetAlert2.
 *
 * Las utilidades van con :where(html.dark) (misma especificidad que la clase de Tailwind) para que las
 * variantes dark: explícitas y los estilos propios de cada pantalla sigan ganando; las de librerías usan
 * html.dark (más específico) porque sus hojas se cargan después.
 */

/* ---------- Bootstrap 5.3: variables del tema oscuro ---------- */
html.dark {
    --bs-body-color: var(--fe-text);
    --bs-body-color-rgb: 229, 231, 235;
    --bs-body-bg: var(--fe-surface);
    --bs-body-bg-rgb: 17, 24, 39;
    --bs-emphasis-color: #f8fafc;
    --bs-emphasis-color-rgb: 248, 250, 252;
    --bs-secondary-color: var(--fe-muted);
    --bs-secondary-color-rgb: 148, 163, 184;
    --bs-secondary-bg: var(--fe-surface-3);
    --bs-secondary-bg-rgb: 30, 41, 59;
    --bs-tertiary-color: var(--fe-faint);
    --bs-tertiary-color-rgb: 100, 116, 139;
    --bs-tertiary-bg: var(--fe-surface-2);
    --bs-tertiary-bg-rgb: 15, 23, 42;
    --bs-heading-color: inherit;
    --bs-link-color: var(--fe-accent-text);
    --bs-link-color-rgb: 147, 197, 253;
    --bs-link-hover-color: #bfdbfe;
    --bs-link-hover-color-rgb: 191, 219, 254;
    --bs-border-color: var(--fe-border-strong);
    --bs-border-color-translucent: rgba(148, 163, 184, .18);
    --bs-code-color: #f9a8d4;
    --bs-highlight-color: var(--fe-text);
    --bs-highlight-bg: rgba(245, 158, 11, .3);
    --bs-box-shadow: 0 0 0 1px var(--fe-border), 0 .5rem 1rem rgba(0, 0, 0, .45);
    --bs-box-shadow-sm: 0 0 0 1px var(--fe-border), 0 .125rem .25rem rgba(0, 0, 0, .4);
    --bs-box-shadow-lg: 0 0 0 1px var(--fe-border), 0 1rem 3rem rgba(0, 0, 0, .55);
    --bs-focus-ring-color: rgba(59, 130, 246, .35);

    --bs-primary-text-emphasis: var(--fe-accent-text);
    --bs-primary-bg-subtle: var(--fe-accent-soft);
    --bs-primary-border-subtle: rgba(59, 130, 246, .4);
    --bs-secondary-text-emphasis: var(--fe-text-2);
    --bs-secondary-bg-subtle: var(--fe-surface-3);
    --bs-secondary-border-subtle: var(--fe-border-strong);
    --bs-success-text-emphasis: var(--fe-success-text);
    --bs-success-bg-subtle: var(--fe-success-soft);
    --bs-success-border-subtle: rgba(16, 185, 129, .4);
    --bs-info-text-emphasis: var(--fe-info-text);
    --bs-info-bg-subtle: var(--fe-info-soft);
    --bs-info-border-subtle: rgba(59, 130, 246, .4);
    --bs-warning-text-emphasis: var(--fe-warning-text);
    --bs-warning-bg-subtle: var(--fe-warning-soft);
    --bs-warning-border-subtle: rgba(245, 158, 11, .4);
    --bs-danger-text-emphasis: var(--fe-danger-text);
    --bs-danger-bg-subtle: var(--fe-danger-soft);
    --bs-danger-border-subtle: rgba(239, 68, 68, .4);
    --bs-light-text-emphasis: var(--fe-text);
    --bs-light-bg-subtle: var(--fe-surface-3);
    --bs-light-border-subtle: var(--fe-border-strong);
    --bs-dark-text-emphasis: var(--fe-text);
    --bs-dark-bg-subtle: var(--fe-surface-2);
    --bs-dark-border-subtle: var(--fe-border-strong);

    --bs-form-valid-color: var(--fe-success-text);
    --bs-form-valid-border-color: var(--fe-success);
    --bs-form-invalid-color: var(--fe-danger-text);
    --bs-form-invalid-border-color: var(--fe-danger);

    scrollbar-color: var(--fe-border-strong) var(--fe-bg);
}

/* ---------- base de Tailwind (preflight) ---------- */
:where(html.dark) *,
:where(html.dark) ::before,
:where(html.dark) ::after {
    border-color: var(--fe-border);
    --tw-ring-offset-color: var(--fe-surface);
}

/* sombras de Tailwind: un borde de 1px para separar la superficie del fondo */
:where(html.dark) .shadow-sm,
:where(html.dark) .focus\:shadow-sm:focus {
    --tw-shadow: 0 0 0 1px var(--fe-border), 0 1px 2px 0 rgb(0 0 0 / .4);
}
:where(html.dark) .shadow,
:where(html.dark) .focus\:shadow:focus,
:where(html.dark) .shadow-md {
    --tw-shadow: 0 0 0 1px var(--fe-border), 0 4px 10px -2px rgb(0 0 0 / .5);
}
:where(html.dark) .shadow-lg,
:where(html.dark) .shadow-xl,
:where(html.dark) .shadow-2xl,
:where(html.dark) .hover\:shadow-lg:hover,
:where(html.dark) .hover\:shadow-xl:hover {
    --tw-shadow: 0 0 0 1px var(--fe-border), 0 16px 36px -8px rgb(0 0 0 / .6);
}

/* ---------- campos (Tailwind forms, Bootstrap y sin clase) ---------- */
:where(html.dark) :is([type='text'], input:where(:not([type])), [type='email'], [type='url'], [type='password'],
    [type='number'], [type='date'], [type='datetime-local'], [type='month'], [type='search'], [type='tel'],
    [type='time'], [type='week'], [multiple], textarea, select, .form-control, .form-select) {
    background-color: var(--fe-field-bg);
    border-color: var(--fe-field-border);
    color: var(--fe-field-text);
}
:where(html.dark) .form-control:focus,
:where(html.dark) .form-select:focus {
    background-color: var(--fe-field-bg);
    color: var(--fe-field-text);
}
:where(html.dark) :is(input, textarea, select):disabled:not([type='checkbox'], [type='radio'], [type='file'], [type='range']) {
    background-color: var(--fe-field-disabled-bg);
    color: var(--fe-muted);
}
:where(html.dark) :is([type='checkbox'], [type='radio']):not(:checked) {
    background-color: var(--fe-field-bg);
    border-color: var(--fe-border-strong);
}
:where(html.dark) option,
:where(html.dark) optgroup {
    background-color: var(--fe-surface);
    color: var(--fe-text);
}
html.dark input:-webkit-autofill,
html.dark input:-webkit-autofill:hover,
html.dark input:-webkit-autofill:focus,
html.dark textarea:-webkit-autofill,
html.dark select:-webkit-autofill {
    -webkit-text-fill-color: var(--fe-field-text);
    -webkit-box-shadow: 0 0 0 1000px var(--fe-field-bg) inset;
    caret-color: var(--fe-field-text);
}

/* ---------- utilidades de Tailwind sin variante dark: ---------- */
/* grises: fondos */
:where(html.dark) .bg-white {
    background-color: var(--fe-surface) !important;
}
:where(html.dark) .bg-transparent {
    background-color: transparent;
}
:where(html.dark) .bg-gray-50, :where(html.dark) .bg-slate-50 {
    background-color: var(--fe-surface-2);
}
:where(html.dark) .bg-gray-100, :where(html.dark) .bg-slate-100 {
    background-color: var(--fe-surface-3);
}
:where(html.dark) .bg-gray-200, :where(html.dark) .bg-slate-200 {
    background-color: var(--fe-surface-4);
}
:where(html.dark) .bg-gray-300, :where(html.dark) .bg-slate-300 {
    background-color: var(--fe-border-strong);
}
/* grises: texto */
:where(html.dark) .text-black {
    color: var(--fe-text) !important;
}
:where(html.dark) .text-gray-800, :where(html.dark) .text-gray-900, :where(html.dark) .text-slate-800,
:where(html.dark) .text-slate-900 {
    color: var(--fe-text);
}
:where(html.dark) .text-gray-600, :where(html.dark) .text-gray-700, :where(html.dark) .text-slate-600,
:where(html.dark) .text-slate-700 {
    color: var(--fe-text-2);
}
:where(html.dark) .text-gray-400, :where(html.dark) .text-gray-500, :where(html.dark) .text-slate-400,
:where(html.dark) .text-slate-500 {
    color: var(--fe-muted);
}
:where(html.dark) .text-gray-300, :where(html.dark) .text-slate-300 {
    color: var(--fe-faint);
}
/* grises: bordes, divisores y anillos */
:where(html.dark) .border-gray-50, :where(html.dark) .border-gray-100, :where(html.dark) .border-gray-200,
:where(html.dark) .border-slate-50, :where(html.dark) .border-slate-100, :where(html.dark) .border-slate-200 {
    border-color: var(--fe-border);
}
:where(html.dark) .border-gray-300, :where(html.dark) .border-gray-400, :where(html.dark) .border-slate-300,
:where(html.dark) .border-slate-400 {
    border-color: var(--fe-border-strong);
}
:where(html.dark) .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
:where(html.dark) .divide-gray-200 > :not([hidden]) ~ :not([hidden]),
:where(html.dark) .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
:where(html.dark) .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--fe-border);
}
:where(html.dark) .divide-gray-300 > :not([hidden]) ~ :not([hidden]),
:where(html.dark) .divide-slate-300 > :not([hidden]) ~ :not([hidden]) {
    border-color: var(--fe-border-strong);
}
:where(html.dark) .ring-gray-100, :where(html.dark) .ring-gray-200, :where(html.dark) .ring-gray-300,
:where(html.dark) .ring-slate-100, :where(html.dark) .ring-slate-200, :where(html.dark) .ring-slate-300 {
    --tw-ring-color: var(--fe-border-strong);
}
:where(html.dark) .ring-black {
    --tw-ring-color: rgb(255 255 255 / .1);
}
:where(html.dark) .ring-white {
    --tw-ring-color: var(--fe-surface);
}
:where(html.dark) .placeholder-gray-300::placeholder, :where(html.dark) .placeholder-gray-400::placeholder,
:where(html.dark) .placeholder-gray-500::placeholder, :where(html.dark) .placeholder-gray-600::placeholder,
:where(html.dark) .placeholder-slate-300::placeholder, :where(html.dark) .placeholder-slate-400::placeholder,
:where(html.dark) .placeholder-slate-500::placeholder, :where(html.dark) .placeholder-slate-600::placeholder {
    color: var(--fe-field-placeholder);
}
/* grises: estados (con !important para ganar al .bg-white de Bootstrap) */
:where(html.dark) .hover\:bg-white:hover, :where(html.dark) .focus\:bg-white:focus,
:where(html.dark) .active\:bg-white:active, :where(html.dark) .hover\:bg-gray-50:hover,
:where(html.dark) .hover\:bg-gray-100:hover, :where(html.dark) .hover\:bg-slate-50:hover,
:where(html.dark) .hover\:bg-slate-100:hover, :where(html.dark) .focus\:bg-gray-50:focus,
:where(html.dark) .focus\:bg-gray-100:focus, :where(html.dark) .focus\:bg-slate-50:focus,
:where(html.dark) .focus\:bg-slate-100:focus, :where(html.dark) .active\:bg-gray-50:active,
:where(html.dark) .active\:bg-gray-100:active, :where(html.dark) .active\:bg-slate-50:active,
:where(html.dark) .active\:bg-slate-100:active {
    background-color: var(--fe-surface-3) !important;
}
:where(html.dark) .hover\:bg-gray-200:hover, :where(html.dark) .hover\:bg-gray-300:hover,
:where(html.dark) .hover\:bg-slate-200:hover, :where(html.dark) .hover\:bg-slate-300:hover,
:where(html.dark) .focus\:bg-gray-200:focus, :where(html.dark) .focus\:bg-gray-300:focus,
:where(html.dark) .focus\:bg-slate-200:focus, :where(html.dark) .focus\:bg-slate-300:focus,
:where(html.dark) .active\:bg-gray-200:active, :where(html.dark) .active\:bg-gray-300:active,
:where(html.dark) .active\:bg-slate-200:active, :where(html.dark) .active\:bg-slate-300:active {
    background-color: var(--fe-surface-4) !important;
}
:where(html.dark) .hover\:text-gray-700:hover, :where(html.dark) .hover\:text-gray-800:hover,
:where(html.dark) .hover\:text-gray-900:hover, :where(html.dark) .hover\:text-slate-700:hover,
:where(html.dark) .hover\:text-slate-800:hover, :where(html.dark) .hover\:text-slate-900:hover,
:where(html.dark) .focus\:text-gray-700:focus, :where(html.dark) .focus\:text-gray-800:focus,
:where(html.dark) .focus\:text-gray-900:focus, :where(html.dark) .focus\:text-slate-700:focus,
:where(html.dark) .focus\:text-slate-800:focus, :where(html.dark) .focus\:text-slate-900:focus,
:where(html.dark) .active\:text-gray-700:active, :where(html.dark) .active\:text-gray-800:active,
:where(html.dark) .active\:text-gray-900:active, :where(html.dark) .active\:text-slate-700:active,
:where(html.dark) .active\:text-slate-800:active, :where(html.dark) .active\:text-slate-900:active,
:where(html.dark) .hover\:text-black:hover, :where(html.dark) .focus\:text-black:focus,
:where(html.dark) .active\:text-black:active {
    color: var(--fe-text);
}
:where(html.dark) .hover\:text-gray-400:hover, :where(html.dark) .hover\:text-gray-500:hover,
:where(html.dark) .hover\:text-gray-600:hover, :where(html.dark) .hover\:text-slate-400:hover,
:where(html.dark) .hover\:text-slate-500:hover, :where(html.dark) .hover\:text-slate-600:hover,
:where(html.dark) .focus\:text-gray-400:focus, :where(html.dark) .focus\:text-gray-500:focus,
:where(html.dark) .focus\:text-gray-600:focus, :where(html.dark) .focus\:text-slate-400:focus,
:where(html.dark) .focus\:text-slate-500:focus, :where(html.dark) .focus\:text-slate-600:focus,
:where(html.dark) .active\:text-gray-400:active, :where(html.dark) .active\:text-gray-500:active,
:where(html.dark) .active\:text-gray-600:active, :where(html.dark) .active\:text-slate-400:active,
:where(html.dark) .active\:text-slate-500:active, :where(html.dark) .active\:text-slate-600:active {
    color: var(--fe-text-2);
}
:where(html.dark) .hover\:border-gray-200:hover, :where(html.dark) .hover\:border-gray-300:hover,
:where(html.dark) .hover\:border-gray-400:hover, :where(html.dark) .hover\:border-slate-200:hover,
:where(html.dark) .hover\:border-slate-300:hover, :where(html.dark) .hover\:border-slate-400:hover,
:where(html.dark) .focus\:border-gray-200:focus, :where(html.dark) .focus\:border-gray-300:focus,
:where(html.dark) .focus\:border-gray-400:focus, :where(html.dark) .focus\:border-slate-200:focus,
:where(html.dark) .focus\:border-slate-300:focus, :where(html.dark) .focus\:border-slate-400:focus,
:where(html.dark) .active\:border-gray-200:active, :where(html.dark) .active\:border-gray-300:active,
:where(html.dark) .active\:border-gray-400:active, :where(html.dark) .active\:border-slate-200:active,
:where(html.dark) .active\:border-slate-300:active, :where(html.dark) .active\:border-slate-400:active {
    border-color: var(--fe-border-strong);
}
/* colores: fondos suaves (50-200), texto (500-900) y bordes suaves (100-400). Los sólidos (500+) quedan igual */
/* red */
:where(html.dark) .bg-red-50 {
    background-color: rgb(239 68 68 / .10);
}
:where(html.dark) .bg-red-100 {
    background-color: rgb(239 68 68 / .16);
}
:where(html.dark) .bg-red-200 {
    background-color: rgb(239 68 68 / .24);
}
:where(html.dark) .text-red-500, :where(html.dark) .text-red-600, :where(html.dark) .text-red-700,
:where(html.dark) .text-red-800, :where(html.dark) .text-red-900, :where(html.dark) .text-red-950 {
    color: var(--fe-danger-text);
}
:where(html.dark) .border-red-100, :where(html.dark) .border-red-200, :where(html.dark) .border-red-300,
:where(html.dark) .border-red-400 {
    border-color: rgb(239 68 68 / .45);
}
:where(html.dark) .hover\:bg-red-50:hover, :where(html.dark) .hover\:bg-red-100:hover,
:where(html.dark) .hover\:bg-red-200:hover, :where(html.dark) .focus\:bg-red-50:focus,
:where(html.dark) .focus\:bg-red-100:focus, :where(html.dark) .focus\:bg-red-200:focus {
    background-color: rgb(239 68 68 / .28);
}
:where(html.dark) .hover\:text-red-600:hover, :where(html.dark) .hover\:text-red-700:hover,
:where(html.dark) .hover\:text-red-800:hover, :where(html.dark) .hover\:text-red-900:hover,
:where(html.dark) .focus\:text-red-600:focus, :where(html.dark) .focus\:text-red-700:focus,
:where(html.dark) .focus\:text-red-800:focus, :where(html.dark) .focus\:text-red-900:focus {
    color: color-mix(in srgb, var(--fe-danger-text) 75%, #fff);
}
/* rose */
:where(html.dark) .bg-rose-50 {
    background-color: rgb(244 63 94 / .10);
}
:where(html.dark) .bg-rose-100 {
    background-color: rgb(244 63 94 / .16);
}
:where(html.dark) .bg-rose-200 {
    background-color: rgb(244 63 94 / .24);
}
:where(html.dark) .text-rose-500, :where(html.dark) .text-rose-600, :where(html.dark) .text-rose-700,
:where(html.dark) .text-rose-800, :where(html.dark) .text-rose-900, :where(html.dark) .text-rose-950 {
    color: #fda4af;
}
:where(html.dark) .border-rose-100, :where(html.dark) .border-rose-200, :where(html.dark) .border-rose-300,
:where(html.dark) .border-rose-400 {
    border-color: rgb(244 63 94 / .45);
}
:where(html.dark) .hover\:bg-rose-50:hover, :where(html.dark) .hover\:bg-rose-100:hover,
:where(html.dark) .hover\:bg-rose-200:hover, :where(html.dark) .focus\:bg-rose-50:focus,
:where(html.dark) .focus\:bg-rose-100:focus, :where(html.dark) .focus\:bg-rose-200:focus {
    background-color: rgb(244 63 94 / .28);
}
:where(html.dark) .hover\:text-rose-600:hover, :where(html.dark) .hover\:text-rose-700:hover,
:where(html.dark) .hover\:text-rose-800:hover, :where(html.dark) .hover\:text-rose-900:hover,
:where(html.dark) .focus\:text-rose-600:focus, :where(html.dark) .focus\:text-rose-700:focus,
:where(html.dark) .focus\:text-rose-800:focus, :where(html.dark) .focus\:text-rose-900:focus {
    color: color-mix(in srgb, #fda4af 75%, #fff);
}
/* pink */
:where(html.dark) .bg-pink-50 {
    background-color: rgb(236 72 153 / .10);
}
:where(html.dark) .bg-pink-100 {
    background-color: rgb(236 72 153 / .16);
}
:where(html.dark) .bg-pink-200 {
    background-color: rgb(236 72 153 / .24);
}
:where(html.dark) .text-pink-500, :where(html.dark) .text-pink-600, :where(html.dark) .text-pink-700,
:where(html.dark) .text-pink-800, :where(html.dark) .text-pink-900, :where(html.dark) .text-pink-950 {
    color: #f9a8d4;
}
:where(html.dark) .border-pink-100, :where(html.dark) .border-pink-200, :where(html.dark) .border-pink-300,
:where(html.dark) .border-pink-400 {
    border-color: rgb(236 72 153 / .45);
}
:where(html.dark) .hover\:bg-pink-50:hover, :where(html.dark) .hover\:bg-pink-100:hover,
:where(html.dark) .hover\:bg-pink-200:hover, :where(html.dark) .focus\:bg-pink-50:focus,
:where(html.dark) .focus\:bg-pink-100:focus, :where(html.dark) .focus\:bg-pink-200:focus {
    background-color: rgb(236 72 153 / .28);
}
:where(html.dark) .hover\:text-pink-600:hover, :where(html.dark) .hover\:text-pink-700:hover,
:where(html.dark) .hover\:text-pink-800:hover, :where(html.dark) .hover\:text-pink-900:hover,
:where(html.dark) .focus\:text-pink-600:focus, :where(html.dark) .focus\:text-pink-700:focus,
:where(html.dark) .focus\:text-pink-800:focus, :where(html.dark) .focus\:text-pink-900:focus {
    color: color-mix(in srgb, #f9a8d4 75%, #fff);
}
/* orange */
:where(html.dark) .bg-orange-50 {
    background-color: rgb(249 115 22 / .10);
}
:where(html.dark) .bg-orange-100 {
    background-color: rgb(249 115 22 / .16);
}
:where(html.dark) .bg-orange-200 {
    background-color: rgb(249 115 22 / .24);
}
:where(html.dark) .text-orange-500, :where(html.dark) .text-orange-600, :where(html.dark) .text-orange-700,
:where(html.dark) .text-orange-800, :where(html.dark) .text-orange-900, :where(html.dark) .text-orange-950 {
    color: #fdba74;
}
:where(html.dark) .border-orange-100, :where(html.dark) .border-orange-200,
:where(html.dark) .border-orange-300, :where(html.dark) .border-orange-400 {
    border-color: rgb(249 115 22 / .45);
}
:where(html.dark) .hover\:bg-orange-50:hover, :where(html.dark) .hover\:bg-orange-100:hover,
:where(html.dark) .hover\:bg-orange-200:hover, :where(html.dark) .focus\:bg-orange-50:focus,
:where(html.dark) .focus\:bg-orange-100:focus, :where(html.dark) .focus\:bg-orange-200:focus {
    background-color: rgb(249 115 22 / .28);
}
:where(html.dark) .hover\:text-orange-600:hover, :where(html.dark) .hover\:text-orange-700:hover,
:where(html.dark) .hover\:text-orange-800:hover, :where(html.dark) .hover\:text-orange-900:hover,
:where(html.dark) .focus\:text-orange-600:focus, :where(html.dark) .focus\:text-orange-700:focus,
:where(html.dark) .focus\:text-orange-800:focus, :where(html.dark) .focus\:text-orange-900:focus {
    color: color-mix(in srgb, #fdba74 75%, #fff);
}
/* amber */
:where(html.dark) .bg-amber-50 {
    background-color: rgb(245 158 11 / .10);
}
:where(html.dark) .bg-amber-100 {
    background-color: rgb(245 158 11 / .16);
}
:where(html.dark) .bg-amber-200 {
    background-color: rgb(245 158 11 / .24);
}
:where(html.dark) .text-amber-500, :where(html.dark) .text-amber-600, :where(html.dark) .text-amber-700,
:where(html.dark) .text-amber-800, :where(html.dark) .text-amber-900, :where(html.dark) .text-amber-950 {
    color: var(--fe-warning-text);
}
:where(html.dark) .border-amber-100, :where(html.dark) .border-amber-200, :where(html.dark) .border-amber-300,
:where(html.dark) .border-amber-400 {
    border-color: rgb(245 158 11 / .45);
}
:where(html.dark) .hover\:bg-amber-50:hover, :where(html.dark) .hover\:bg-amber-100:hover,
:where(html.dark) .hover\:bg-amber-200:hover, :where(html.dark) .focus\:bg-amber-50:focus,
:where(html.dark) .focus\:bg-amber-100:focus, :where(html.dark) .focus\:bg-amber-200:focus {
    background-color: rgb(245 158 11 / .28);
}
:where(html.dark) .hover\:text-amber-600:hover, :where(html.dark) .hover\:text-amber-700:hover,
:where(html.dark) .hover\:text-amber-800:hover, :where(html.dark) .hover\:text-amber-900:hover,
:where(html.dark) .focus\:text-amber-600:focus, :where(html.dark) .focus\:text-amber-700:focus,
:where(html.dark) .focus\:text-amber-800:focus, :where(html.dark) .focus\:text-amber-900:focus {
    color: color-mix(in srgb, var(--fe-warning-text) 75%, #fff);
}
/* yellow */
:where(html.dark) .bg-yellow-50 {
    background-color: rgb(234 179 8 / .10);
}
:where(html.dark) .bg-yellow-100 {
    background-color: rgb(234 179 8 / .16);
}
:where(html.dark) .bg-yellow-200 {
    background-color: rgb(234 179 8 / .24);
}
:where(html.dark) .text-yellow-500, :where(html.dark) .text-yellow-600, :where(html.dark) .text-yellow-700,
:where(html.dark) .text-yellow-800, :where(html.dark) .text-yellow-900, :where(html.dark) .text-yellow-950 {
    color: #fde047;
}
:where(html.dark) .border-yellow-100, :where(html.dark) .border-yellow-200,
:where(html.dark) .border-yellow-300, :where(html.dark) .border-yellow-400 {
    border-color: rgb(234 179 8 / .45);
}
:where(html.dark) .hover\:bg-yellow-50:hover, :where(html.dark) .hover\:bg-yellow-100:hover,
:where(html.dark) .hover\:bg-yellow-200:hover, :where(html.dark) .focus\:bg-yellow-50:focus,
:where(html.dark) .focus\:bg-yellow-100:focus, :where(html.dark) .focus\:bg-yellow-200:focus {
    background-color: rgb(234 179 8 / .28);
}
:where(html.dark) .hover\:text-yellow-600:hover, :where(html.dark) .hover\:text-yellow-700:hover,
:where(html.dark) .hover\:text-yellow-800:hover, :where(html.dark) .hover\:text-yellow-900:hover,
:where(html.dark) .focus\:text-yellow-600:focus, :where(html.dark) .focus\:text-yellow-700:focus,
:where(html.dark) .focus\:text-yellow-800:focus, :where(html.dark) .focus\:text-yellow-900:focus {
    color: color-mix(in srgb, #fde047 75%, #fff);
}
/* lime */
:where(html.dark) .bg-lime-50 {
    background-color: rgb(132 204 22 / .10);
}
:where(html.dark) .bg-lime-100 {
    background-color: rgb(132 204 22 / .16);
}
:where(html.dark) .bg-lime-200 {
    background-color: rgb(132 204 22 / .24);
}
:where(html.dark) .text-lime-500, :where(html.dark) .text-lime-600, :where(html.dark) .text-lime-700,
:where(html.dark) .text-lime-800, :where(html.dark) .text-lime-900, :where(html.dark) .text-lime-950 {
    color: #bef264;
}
:where(html.dark) .border-lime-100, :where(html.dark) .border-lime-200, :where(html.dark) .border-lime-300,
:where(html.dark) .border-lime-400 {
    border-color: rgb(132 204 22 / .45);
}
:where(html.dark) .hover\:bg-lime-50:hover, :where(html.dark) .hover\:bg-lime-100:hover,
:where(html.dark) .hover\:bg-lime-200:hover, :where(html.dark) .focus\:bg-lime-50:focus,
:where(html.dark) .focus\:bg-lime-100:focus, :where(html.dark) .focus\:bg-lime-200:focus {
    background-color: rgb(132 204 22 / .28);
}
:where(html.dark) .hover\:text-lime-600:hover, :where(html.dark) .hover\:text-lime-700:hover,
:where(html.dark) .hover\:text-lime-800:hover, :where(html.dark) .hover\:text-lime-900:hover,
:where(html.dark) .focus\:text-lime-600:focus, :where(html.dark) .focus\:text-lime-700:focus,
:where(html.dark) .focus\:text-lime-800:focus, :where(html.dark) .focus\:text-lime-900:focus {
    color: color-mix(in srgb, #bef264 75%, #fff);
}
/* green */
:where(html.dark) .bg-green-50 {
    background-color: rgb(34 197 94 / .10);
}
:where(html.dark) .bg-green-100 {
    background-color: rgb(34 197 94 / .16);
}
:where(html.dark) .bg-green-200 {
    background-color: rgb(34 197 94 / .24);
}
:where(html.dark) .text-green-500, :where(html.dark) .text-green-600, :where(html.dark) .text-green-700,
:where(html.dark) .text-green-800, :where(html.dark) .text-green-900, :where(html.dark) .text-green-950 {
    color: #86efac;
}
:where(html.dark) .border-green-100, :where(html.dark) .border-green-200, :where(html.dark) .border-green-300,
:where(html.dark) .border-green-400 {
    border-color: rgb(34 197 94 / .45);
}
:where(html.dark) .hover\:bg-green-50:hover, :where(html.dark) .hover\:bg-green-100:hover,
:where(html.dark) .hover\:bg-green-200:hover, :where(html.dark) .focus\:bg-green-50:focus,
:where(html.dark) .focus\:bg-green-100:focus, :where(html.dark) .focus\:bg-green-200:focus {
    background-color: rgb(34 197 94 / .28);
}
:where(html.dark) .hover\:text-green-600:hover, :where(html.dark) .hover\:text-green-700:hover,
:where(html.dark) .hover\:text-green-800:hover, :where(html.dark) .hover\:text-green-900:hover,
:where(html.dark) .focus\:text-green-600:focus, :where(html.dark) .focus\:text-green-700:focus,
:where(html.dark) .focus\:text-green-800:focus, :where(html.dark) .focus\:text-green-900:focus {
    color: color-mix(in srgb, #86efac 75%, #fff);
}
/* emerald */
:where(html.dark) .bg-emerald-50 {
    background-color: rgb(16 185 129 / .10);
}
:where(html.dark) .bg-emerald-100 {
    background-color: rgb(16 185 129 / .16);
}
:where(html.dark) .bg-emerald-200 {
    background-color: rgb(16 185 129 / .24);
}
:where(html.dark) .text-emerald-500, :where(html.dark) .text-emerald-600, :where(html.dark) .text-emerald-700,
:where(html.dark) .text-emerald-800, :where(html.dark) .text-emerald-900, :where(html.dark) .text-emerald-950 {
    color: var(--fe-success-text);
}
:where(html.dark) .border-emerald-100, :where(html.dark) .border-emerald-200,
:where(html.dark) .border-emerald-300, :where(html.dark) .border-emerald-400 {
    border-color: rgb(16 185 129 / .45);
}
:where(html.dark) .hover\:bg-emerald-50:hover, :where(html.dark) .hover\:bg-emerald-100:hover,
:where(html.dark) .hover\:bg-emerald-200:hover, :where(html.dark) .focus\:bg-emerald-50:focus,
:where(html.dark) .focus\:bg-emerald-100:focus, :where(html.dark) .focus\:bg-emerald-200:focus {
    background-color: rgb(16 185 129 / .28);
}
:where(html.dark) .hover\:text-emerald-600:hover, :where(html.dark) .hover\:text-emerald-700:hover,
:where(html.dark) .hover\:text-emerald-800:hover, :where(html.dark) .hover\:text-emerald-900:hover,
:where(html.dark) .focus\:text-emerald-600:focus, :where(html.dark) .focus\:text-emerald-700:focus,
:where(html.dark) .focus\:text-emerald-800:focus, :where(html.dark) .focus\:text-emerald-900:focus {
    color: color-mix(in srgb, var(--fe-success-text) 75%, #fff);
}
/* teal */
:where(html.dark) .bg-teal-50 {
    background-color: rgb(20 184 166 / .10);
}
:where(html.dark) .bg-teal-100 {
    background-color: rgb(20 184 166 / .16);
}
:where(html.dark) .bg-teal-200 {
    background-color: rgb(20 184 166 / .24);
}
:where(html.dark) .text-teal-500, :where(html.dark) .text-teal-600, :where(html.dark) .text-teal-700,
:where(html.dark) .text-teal-800, :where(html.dark) .text-teal-900, :where(html.dark) .text-teal-950 {
    color: #5eead4;
}
:where(html.dark) .border-teal-100, :where(html.dark) .border-teal-200, :where(html.dark) .border-teal-300,
:where(html.dark) .border-teal-400 {
    border-color: rgb(20 184 166 / .45);
}
:where(html.dark) .hover\:bg-teal-50:hover, :where(html.dark) .hover\:bg-teal-100:hover,
:where(html.dark) .hover\:bg-teal-200:hover, :where(html.dark) .focus\:bg-teal-50:focus,
:where(html.dark) .focus\:bg-teal-100:focus, :where(html.dark) .focus\:bg-teal-200:focus {
    background-color: rgb(20 184 166 / .28);
}
:where(html.dark) .hover\:text-teal-600:hover, :where(html.dark) .hover\:text-teal-700:hover,
:where(html.dark) .hover\:text-teal-800:hover, :where(html.dark) .hover\:text-teal-900:hover,
:where(html.dark) .focus\:text-teal-600:focus, :where(html.dark) .focus\:text-teal-700:focus,
:where(html.dark) .focus\:text-teal-800:focus, :where(html.dark) .focus\:text-teal-900:focus {
    color: color-mix(in srgb, #5eead4 75%, #fff);
}
/* cyan */
:where(html.dark) .bg-cyan-50 {
    background-color: rgb(6 182 212 / .10);
}
:where(html.dark) .bg-cyan-100 {
    background-color: rgb(6 182 212 / .16);
}
:where(html.dark) .bg-cyan-200 {
    background-color: rgb(6 182 212 / .24);
}
:where(html.dark) .text-cyan-500, :where(html.dark) .text-cyan-600, :where(html.dark) .text-cyan-700,
:where(html.dark) .text-cyan-800, :where(html.dark) .text-cyan-900, :where(html.dark) .text-cyan-950 {
    color: #67e8f9;
}
:where(html.dark) .border-cyan-100, :where(html.dark) .border-cyan-200, :where(html.dark) .border-cyan-300,
:where(html.dark) .border-cyan-400 {
    border-color: rgb(6 182 212 / .45);
}
:where(html.dark) .hover\:bg-cyan-50:hover, :where(html.dark) .hover\:bg-cyan-100:hover,
:where(html.dark) .hover\:bg-cyan-200:hover, :where(html.dark) .focus\:bg-cyan-50:focus,
:where(html.dark) .focus\:bg-cyan-100:focus, :where(html.dark) .focus\:bg-cyan-200:focus {
    background-color: rgb(6 182 212 / .28);
}
:where(html.dark) .hover\:text-cyan-600:hover, :where(html.dark) .hover\:text-cyan-700:hover,
:where(html.dark) .hover\:text-cyan-800:hover, :where(html.dark) .hover\:text-cyan-900:hover,
:where(html.dark) .focus\:text-cyan-600:focus, :where(html.dark) .focus\:text-cyan-700:focus,
:where(html.dark) .focus\:text-cyan-800:focus, :where(html.dark) .focus\:text-cyan-900:focus {
    color: color-mix(in srgb, #67e8f9 75%, #fff);
}
/* sky */
:where(html.dark) .bg-sky-50 {
    background-color: rgb(14 165 233 / .10);
}
:where(html.dark) .bg-sky-100 {
    background-color: rgb(14 165 233 / .16);
}
:where(html.dark) .bg-sky-200 {
    background-color: rgb(14 165 233 / .24);
}
:where(html.dark) .text-sky-500, :where(html.dark) .text-sky-600, :where(html.dark) .text-sky-700,
:where(html.dark) .text-sky-800, :where(html.dark) .text-sky-900, :where(html.dark) .text-sky-950 {
    color: #7dd3fc;
}
:where(html.dark) .border-sky-100, :where(html.dark) .border-sky-200, :where(html.dark) .border-sky-300,
:where(html.dark) .border-sky-400 {
    border-color: rgb(14 165 233 / .45);
}
:where(html.dark) .hover\:bg-sky-50:hover, :where(html.dark) .hover\:bg-sky-100:hover,
:where(html.dark) .hover\:bg-sky-200:hover, :where(html.dark) .focus\:bg-sky-50:focus,
:where(html.dark) .focus\:bg-sky-100:focus, :where(html.dark) .focus\:bg-sky-200:focus {
    background-color: rgb(14 165 233 / .28);
}
:where(html.dark) .hover\:text-sky-600:hover, :where(html.dark) .hover\:text-sky-700:hover,
:where(html.dark) .hover\:text-sky-800:hover, :where(html.dark) .hover\:text-sky-900:hover,
:where(html.dark) .focus\:text-sky-600:focus, :where(html.dark) .focus\:text-sky-700:focus,
:where(html.dark) .focus\:text-sky-800:focus, :where(html.dark) .focus\:text-sky-900:focus {
    color: color-mix(in srgb, #7dd3fc 75%, #fff);
}
/* blue */
:where(html.dark) .bg-blue-50 {
    background-color: rgb(59 130 246 / .10);
}
:where(html.dark) .bg-blue-100 {
    background-color: rgb(59 130 246 / .16);
}
:where(html.dark) .bg-blue-200 {
    background-color: rgb(59 130 246 / .24);
}
:where(html.dark) .text-blue-500, :where(html.dark) .text-blue-600, :where(html.dark) .text-blue-700,
:where(html.dark) .text-blue-800, :where(html.dark) .text-blue-900, :where(html.dark) .text-blue-950 {
    color: var(--fe-info-text);
}
:where(html.dark) .border-blue-100, :where(html.dark) .border-blue-200, :where(html.dark) .border-blue-300,
:where(html.dark) .border-blue-400 {
    border-color: rgb(59 130 246 / .45);
}
:where(html.dark) .hover\:bg-blue-50:hover, :where(html.dark) .hover\:bg-blue-100:hover,
:where(html.dark) .hover\:bg-blue-200:hover, :where(html.dark) .focus\:bg-blue-50:focus,
:where(html.dark) .focus\:bg-blue-100:focus, :where(html.dark) .focus\:bg-blue-200:focus {
    background-color: rgb(59 130 246 / .28);
}
:where(html.dark) .hover\:text-blue-600:hover, :where(html.dark) .hover\:text-blue-700:hover,
:where(html.dark) .hover\:text-blue-800:hover, :where(html.dark) .hover\:text-blue-900:hover,
:where(html.dark) .focus\:text-blue-600:focus, :where(html.dark) .focus\:text-blue-700:focus,
:where(html.dark) .focus\:text-blue-800:focus, :where(html.dark) .focus\:text-blue-900:focus {
    color: color-mix(in srgb, var(--fe-info-text) 75%, #fff);
}
/* indigo */
:where(html.dark) .bg-indigo-50 {
    background-color: rgb(99 102 241 / .10);
}
:where(html.dark) .bg-indigo-100 {
    background-color: rgb(99 102 241 / .16);
}
:where(html.dark) .bg-indigo-200 {
    background-color: rgb(99 102 241 / .24);
}
:where(html.dark) .text-indigo-500, :where(html.dark) .text-indigo-600, :where(html.dark) .text-indigo-700,
:where(html.dark) .text-indigo-800, :where(html.dark) .text-indigo-900, :where(html.dark) .text-indigo-950 {
    color: #a5b4fc;
}
:where(html.dark) .border-indigo-100, :where(html.dark) .border-indigo-200,
:where(html.dark) .border-indigo-300, :where(html.dark) .border-indigo-400 {
    border-color: rgb(99 102 241 / .45);
}
:where(html.dark) .hover\:bg-indigo-50:hover, :where(html.dark) .hover\:bg-indigo-100:hover,
:where(html.dark) .hover\:bg-indigo-200:hover, :where(html.dark) .focus\:bg-indigo-50:focus,
:where(html.dark) .focus\:bg-indigo-100:focus, :where(html.dark) .focus\:bg-indigo-200:focus {
    background-color: rgb(99 102 241 / .28);
}
:where(html.dark) .hover\:text-indigo-600:hover, :where(html.dark) .hover\:text-indigo-700:hover,
:where(html.dark) .hover\:text-indigo-800:hover, :where(html.dark) .hover\:text-indigo-900:hover,
:where(html.dark) .focus\:text-indigo-600:focus, :where(html.dark) .focus\:text-indigo-700:focus,
:where(html.dark) .focus\:text-indigo-800:focus, :where(html.dark) .focus\:text-indigo-900:focus {
    color: color-mix(in srgb, #a5b4fc 75%, #fff);
}
/* violet */
:where(html.dark) .bg-violet-50 {
    background-color: rgb(139 92 246 / .10);
}
:where(html.dark) .bg-violet-100 {
    background-color: rgb(139 92 246 / .16);
}
:where(html.dark) .bg-violet-200 {
    background-color: rgb(139 92 246 / .24);
}
:where(html.dark) .text-violet-500, :where(html.dark) .text-violet-600, :where(html.dark) .text-violet-700,
:where(html.dark) .text-violet-800, :where(html.dark) .text-violet-900, :where(html.dark) .text-violet-950 {
    color: #c4b5fd;
}
:where(html.dark) .border-violet-100, :where(html.dark) .border-violet-200,
:where(html.dark) .border-violet-300, :where(html.dark) .border-violet-400 {
    border-color: rgb(139 92 246 / .45);
}
:where(html.dark) .hover\:bg-violet-50:hover, :where(html.dark) .hover\:bg-violet-100:hover,
:where(html.dark) .hover\:bg-violet-200:hover, :where(html.dark) .focus\:bg-violet-50:focus,
:where(html.dark) .focus\:bg-violet-100:focus, :where(html.dark) .focus\:bg-violet-200:focus {
    background-color: rgb(139 92 246 / .28);
}
:where(html.dark) .hover\:text-violet-600:hover, :where(html.dark) .hover\:text-violet-700:hover,
:where(html.dark) .hover\:text-violet-800:hover, :where(html.dark) .hover\:text-violet-900:hover,
:where(html.dark) .focus\:text-violet-600:focus, :where(html.dark) .focus\:text-violet-700:focus,
:where(html.dark) .focus\:text-violet-800:focus, :where(html.dark) .focus\:text-violet-900:focus {
    color: color-mix(in srgb, #c4b5fd 75%, #fff);
}
/* purple */
:where(html.dark) .bg-purple-50 {
    background-color: rgb(168 85 247 / .10);
}
:where(html.dark) .bg-purple-100 {
    background-color: rgb(168 85 247 / .16);
}
:where(html.dark) .bg-purple-200 {
    background-color: rgb(168 85 247 / .24);
}
:where(html.dark) .text-purple-500, :where(html.dark) .text-purple-600, :where(html.dark) .text-purple-700,
:where(html.dark) .text-purple-800, :where(html.dark) .text-purple-900, :where(html.dark) .text-purple-950 {
    color: #d8b4fe;
}
:where(html.dark) .border-purple-100, :where(html.dark) .border-purple-200,
:where(html.dark) .border-purple-300, :where(html.dark) .border-purple-400 {
    border-color: rgb(168 85 247 / .45);
}
:where(html.dark) .hover\:bg-purple-50:hover, :where(html.dark) .hover\:bg-purple-100:hover,
:where(html.dark) .hover\:bg-purple-200:hover, :where(html.dark) .focus\:bg-purple-50:focus,
:where(html.dark) .focus\:bg-purple-100:focus, :where(html.dark) .focus\:bg-purple-200:focus {
    background-color: rgb(168 85 247 / .28);
}
:where(html.dark) .hover\:text-purple-600:hover, :where(html.dark) .hover\:text-purple-700:hover,
:where(html.dark) .hover\:text-purple-800:hover, :where(html.dark) .hover\:text-purple-900:hover,
:where(html.dark) .focus\:text-purple-600:focus, :where(html.dark) .focus\:text-purple-700:focus,
:where(html.dark) .focus\:text-purple-800:focus, :where(html.dark) .focus\:text-purple-900:focus {
    color: color-mix(in srgb, #d8b4fe 75%, #fff);
}
/* fuchsia */
:where(html.dark) .bg-fuchsia-50 {
    background-color: rgb(217 70 239 / .10);
}
:where(html.dark) .bg-fuchsia-100 {
    background-color: rgb(217 70 239 / .16);
}
:where(html.dark) .bg-fuchsia-200 {
    background-color: rgb(217 70 239 / .24);
}
:where(html.dark) .text-fuchsia-500, :where(html.dark) .text-fuchsia-600, :where(html.dark) .text-fuchsia-700,
:where(html.dark) .text-fuchsia-800, :where(html.dark) .text-fuchsia-900, :where(html.dark) .text-fuchsia-950 {
    color: #f0abfc;
}
:where(html.dark) .border-fuchsia-100, :where(html.dark) .border-fuchsia-200,
:where(html.dark) .border-fuchsia-300, :where(html.dark) .border-fuchsia-400 {
    border-color: rgb(217 70 239 / .45);
}
:where(html.dark) .hover\:bg-fuchsia-50:hover, :where(html.dark) .hover\:bg-fuchsia-100:hover,
:where(html.dark) .hover\:bg-fuchsia-200:hover, :where(html.dark) .focus\:bg-fuchsia-50:focus,
:where(html.dark) .focus\:bg-fuchsia-100:focus, :where(html.dark) .focus\:bg-fuchsia-200:focus {
    background-color: rgb(217 70 239 / .28);
}
:where(html.dark) .hover\:text-fuchsia-600:hover, :where(html.dark) .hover\:text-fuchsia-700:hover,
:where(html.dark) .hover\:text-fuchsia-800:hover, :where(html.dark) .hover\:text-fuchsia-900:hover,
:where(html.dark) .focus\:text-fuchsia-600:focus, :where(html.dark) .focus\:text-fuchsia-700:focus,
:where(html.dark) .focus\:text-fuchsia-800:focus, :where(html.dark) .focus\:text-fuchsia-900:focus {
    color: color-mix(in srgb, #f0abfc 75%, #fff);
}


/* ---------- utilidades y componentes de Bootstrap con colores fijos ---------- */
:where(html.dark) .bg-light { background-color: var(--fe-surface-2) !important; }
:where(html.dark) .text-dark,
:where(html.dark) .text-body { color: var(--fe-text) !important; }
:where(html.dark) .text-secondary { color: var(--fe-muted) !important; }
:where(html.dark) .text-primary { color: var(--fe-accent-text) !important; }
:where(html.dark) .text-success { color: var(--fe-success-text) !important; }
:where(html.dark) .text-danger { color: var(--fe-danger-text) !important; }
:where(html.dark) .text-warning { color: var(--fe-warning-text) !important; }
:where(html.dark) .text-info { color: var(--fe-info-text) !important; }
:where(html.dark) .border-light { border-color: var(--fe-border) !important; }

html.dark .table {
    --bs-table-color: var(--fe-text);
    --bs-table-striped-color: var(--fe-text);
    --bs-table-hover-color: var(--fe-text);
    --bs-table-active-color: var(--fe-text);
    --bs-table-border-color: var(--fe-border);
    --bs-table-striped-bg: rgba(148, 163, 184, .06);
    --bs-table-hover-bg: rgba(148, 163, 184, .1);
}
html.dark .table-light,
html.dark .thead-light th {
    --bs-table-color: var(--fe-text);
    --bs-table-bg: var(--fe-surface-3);
    --bs-table-border-color: var(--fe-border-strong);
    background-color: var(--fe-surface-3);
    color: var(--fe-text);
}

html.dark .btn-light {
    --bs-btn-color: var(--fe-text);
    --bs-btn-bg: var(--fe-surface-3);
    --bs-btn-border-color: var(--fe-border-strong);
    --bs-btn-hover-color: var(--fe-text);
    --bs-btn-hover-bg: var(--fe-surface-4);
    --bs-btn-hover-border-color: var(--fe-border-strong);
    --bs-btn-active-color: var(--fe-text);
    --bs-btn-active-bg: var(--fe-surface-4);
    --bs-btn-active-border-color: var(--fe-border-strong);
}
html.dark .btn-outline-secondary,
html.dark .btn-outline-dark,
html.dark .btn-default {
    --bs-btn-color: var(--fe-text-2);
    --bs-btn-border-color: var(--fe-border-strong);
    --bs-btn-hover-color: var(--fe-text);
    --bs-btn-hover-bg: var(--fe-surface-3);
    --bs-btn-hover-border-color: var(--fe-border-strong);
    --bs-btn-active-color: var(--fe-text);
    --bs-btn-active-bg: var(--fe-surface-4);
    --bs-btn-active-border-color: var(--fe-border-strong);
    --bs-btn-disabled-color: var(--fe-faint);
    --bs-btn-disabled-border-color: var(--fe-border);
}
html.dark .pagination {
    --bs-pagination-color: var(--fe-text-2);
    --bs-pagination-bg: var(--fe-surface);
    --bs-pagination-border-color: var(--fe-border-strong);
    --bs-pagination-hover-color: var(--fe-text);
    --bs-pagination-hover-bg: var(--fe-surface-3);
    --bs-pagination-hover-border-color: var(--fe-border-strong);
    --bs-pagination-focus-color: var(--fe-text);
    --bs-pagination-focus-bg: var(--fe-surface-3);
    --bs-pagination-active-color: var(--fe-on-primary);
    --bs-pagination-active-bg: var(--fe-primary);
    --bs-pagination-active-border-color: var(--fe-primary);
    --bs-pagination-disabled-color: var(--fe-faint);
    --bs-pagination-disabled-bg: var(--fe-surface-2);
    --bs-pagination-disabled-border-color: var(--fe-border);
}
html.dark .dropdown-menu {
    --bs-dropdown-bg: var(--fe-surface);
    --bs-dropdown-border-color: var(--fe-border-strong);
    --bs-dropdown-link-color: var(--fe-text);
    --bs-dropdown-link-hover-bg: var(--fe-surface-3);
    --bs-dropdown-link-hover-color: var(--fe-text);
    --bs-dropdown-divider-bg: var(--fe-border);
}
html.dark .modal {
    --bs-modal-bg: var(--fe-surface);
    --bs-modal-border-color: var(--fe-border-strong);
    --bs-modal-header-border-color: var(--fe-border);
    --bs-modal-footer-border-color: var(--fe-border);
}
html.dark .modal-backdrop {
    --bs-backdrop-bg: #020617;
    --bs-backdrop-opacity: .7;
}
html.dark .list-group {
    --bs-list-group-bg: var(--fe-surface);
    --bs-list-group-color: var(--fe-text);
    --bs-list-group-border-color: var(--fe-border);
    --bs-list-group-action-hover-bg: var(--fe-surface-3);
    --bs-list-group-action-color: var(--fe-text-2);
}
html.dark .card {
    --bs-card-bg: var(--fe-surface);
    --bs-card-border-color: var(--fe-border);
    --bs-card-cap-bg: var(--fe-surface-2);
}
html.dark .badge.bg-warning,
html.dark .badge.text-bg-warning {
    color: #1f1300 !important;
}

/* ---------- DataTables (bs4 + responsive) ---------- */
html.dark div.dataTables_wrapper div.dataTables_info,
html.dark div.dataTables_wrapper div.dataTables_length label,
html.dark div.dataTables_wrapper div.dataTables_filter label {
    color: var(--fe-muted);
}
html.dark div.dataTables_wrapper div.dataTables_processing,
html.dark div.dataTables_processing {
    background: var(--fe-surface) !important;
    border-color: var(--fe-border-strong) !important;
    color: var(--fe-text) !important;
    box-shadow: var(--fe-shadow-lg) !important;
}
html.dark table.dataTable thead th,
html.dark table.dataTable thead td {
    border-bottom-color: var(--fe-border-strong);
}
html.dark table.dataTable > tbody > tr.child ul.dtr-details > li {
    border-bottom-color: var(--fe-border);
}
html.dark table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
html.dark table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > td:first-child:before,
html.dark table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child:before,
html.dark table.dataTable.dtr-column > tbody > tr > td.control:before {
    border-color: var(--fe-surface);
    box-shadow: 0 0 0 1px var(--fe-border-strong);
}
html.dark div.dtr-modal div.dtr-modal-display {
    background-color: var(--fe-surface);
    border-color: var(--fe-border-strong);
    color: var(--fe-text);
}
html.dark div.dtr-modal div.dtr-modal-close {
    background-color: var(--fe-surface-3);
    border-color: var(--fe-border-strong);
    color: var(--fe-text);
}
html.dark div.dtr-modal div.dtr-modal-background {
    background: var(--fe-backdrop);
}

/* ---------- select2 (tema default; el desplegable cuelga del body) ---------- */
html.dark .select2-container--default .select2-selection--single,
html.dark .select2-container--default .select2-selection--multiple {
    background-color: var(--fe-field-bg) !important;
    border-color: var(--fe-field-border) !important;
    color: var(--fe-field-text);
}
html.dark .select2-container--default.select2-container--focus .select2-selection--multiple,
html.dark .select2-container--default.select2-container--focus .select2-selection--single,
html.dark .select2-container--default.select2-container--open .select2-selection--single,
html.dark .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--fe-accent) !important;
}
html.dark .select2-container--default.select2-container--disabled .select2-selection--single,
html.dark .select2-container--default.select2-container--disabled .select2-selection--multiple {
    background-color: var(--fe-field-disabled-bg) !important;
}
html.dark .select2-container--default .select2-selection--single .select2-selection__rendered,
html.dark .select2-container--default .select2-selection--multiple .select2-selection__rendered {
    color: var(--fe-field-text);
}
html.dark .select2-container--default .select2-selection--single .select2-selection__placeholder,
html.dark .select2-container--default .select2-search--inline .select2-search__field::placeholder {
    color: var(--fe-field-placeholder);
}
html.dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--fe-muted) transparent transparent transparent;
}
html.dark .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--fe-muted) transparent;
}
html.dark .select2-container--default .select2-selection--single .select2-selection__clear,
html.dark .select2-container--default .select2-selection__choice__remove {
    color: var(--fe-muted);
}
html.dark .select2-container--default .select2-selection__choice__remove:hover {
    color: var(--fe-text);
    background-color: var(--fe-surface-4);
}
html.dark .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--fe-surface-3);
    border-color: var(--fe-border-strong);
    color: var(--fe-text);
}
/* chips con color propio (documentos) */
html.dark .select2-selection__choice.bg-green-100 { background-color: var(--fe-success-soft) !important; color: var(--fe-success-text); }
html.dark .select2-selection__choice.bg-red-100 { background-color: var(--fe-danger-soft) !important; color: var(--fe-danger-text); }
html.dark .select2-selection__choice.border-green-300 { border-color: rgba(16, 185, 129, .45) !important; }
html.dark .select2-selection__choice.border-red-300 { border-color: rgba(239, 68, 68, .45) !important; }
html.dark .select2-container--default .select2-search--inline .select2-search__field {
    background: transparent;
    color: var(--fe-field-text);
}
html.dark .select2-dropdown {
    background-color: var(--fe-surface) !important;
    border-color: var(--fe-border-strong) !important;
    color: var(--fe-text);
    box-shadow: var(--fe-shadow-lg);
}
html.dark .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--fe-field-bg);
    border-color: var(--fe-field-border);
    color: var(--fe-field-text);
}
html.dark .select2-container--default .select2-results__option {
    color: var(--fe-text);
}
html.dark .select2-container--default .select2-results__option[aria-selected='true'],
html.dark .select2-container--default .select2-results__option--selected {
    background-color: var(--fe-surface-3) !important;
    color: var(--fe-text) !important;
}
html.dark .select2-container--default .select2-results__option--highlighted[aria-selected],
html.dark .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
html.dark .select2-container--default .select2-results__option--highlighted {
    background-color: var(--fe-accent-soft) !important;
    color: var(--fe-text) !important;
}
html.dark .select2-container--default .select2-results__option[aria-disabled='true'],
html.dark .select2-container--default .select2-results__option--disabled {
    color: var(--fe-faint);
}
html.dark .select2-container--default .select2-results__group {
    color: var(--fe-muted);
}
html.dark .select2-container--default .select2-results__option.loading-results,
html.dark .select2-container--default .select2-results__message {
    color: var(--fe-muted);
}

/* ---------- daterangepicker ---------- */
html.dark .daterangepicker {
    background-color: var(--fe-surface);
    border-color: var(--fe-border-strong);
    color: var(--fe-text);
    box-shadow: var(--fe-shadow-lg);
}
html.dark .daterangepicker:before { border-bottom-color: var(--fe-border-strong); }
html.dark .daterangepicker:after { border-bottom-color: var(--fe-surface); }
html.dark .daterangepicker.drop-up:before { border-top-color: var(--fe-border-strong); }
html.dark .daterangepicker.drop-up:after { border-top-color: var(--fe-surface); }
html.dark .daterangepicker .calendar-table {
    background-color: var(--fe-surface);
    border-color: var(--fe-surface);
}
html.dark .daterangepicker .calendar-table .next span,
html.dark .daterangepicker .calendar-table .prev span {
    border-color: var(--fe-text-2);
}
html.dark .daterangepicker td.available:hover,
html.dark .daterangepicker th.available:hover {
    background-color: var(--fe-surface-3);
}
html.dark .daterangepicker td.week,
html.dark .daterangepicker th.week,
html.dark .daterangepicker td.disabled,
html.dark .daterangepicker option.disabled,
html.dark .daterangepicker .calendar-time select.disabled {
    color: var(--fe-faint);
}
html.dark .daterangepicker td.off,
html.dark .daterangepicker td.off.in-range,
html.dark .daterangepicker td.off.start-date,
html.dark .daterangepicker td.off.end-date {
    background-color: var(--fe-surface);
    color: var(--fe-faint);
}
html.dark .daterangepicker td.in-range {
    background-color: var(--fe-surface-3);
    color: var(--fe-text);
}
html.dark .daterangepicker td.active,
html.dark .daterangepicker td.active:hover {
    background-color: var(--fe-primary);
    color: var(--fe-on-primary);
}
html.dark .daterangepicker select.hourselect,
html.dark .daterangepicker select.minuteselect,
html.dark .daterangepicker select.secondselect,
html.dark .daterangepicker select.ampmselect,
html.dark .daterangepicker select.monthselect,
html.dark .daterangepicker select.yearselect {
    background-color: var(--fe-field-bg);
    border-color: var(--fe-field-border);
    color: var(--fe-field-text);
}
html.dark .daterangepicker .drp-buttons,
html.dark .daterangepicker .calendar-time {
    border-color: var(--fe-border);
}
html.dark .daterangepicker.show-ranges .drp-calendar.left,
html.dark .daterangepicker.show-ranges .drp-calendar.right {
    border-color: var(--fe-border);
}
html.dark .daterangepicker .ranges li:hover {
    background-color: var(--fe-surface-3);
}
html.dark .daterangepicker .ranges li.active {
    background-color: var(--fe-primary);
    color: var(--fe-on-primary);
}

/* ---------- SweetAlert2 (variables propias de la librería) ---------- */
html.dark {
    --swal2-background: var(--fe-surface);
    --swal2-color: var(--fe-text-2);
    --swal2-backdrop: var(--fe-backdrop);
    --swal2-footer-border-color: var(--fe-border);
    --swal2-input-background: var(--fe-field-bg);
    --swal2-input-border: 1px solid var(--fe-field-border);
    --swal2-input-focus-border: 1px solid var(--fe-accent);
    --swal2-validation-message-background: var(--fe-surface-3);
    --swal2-validation-message-color: var(--fe-text);
    --swal2-close-button-color: var(--fe-muted);
    --swal2-timer-progress-bar-background: rgba(255, 255, 255, .6);
    --swal2-toast-box-shadow: 0 0 0 1px var(--fe-border), 0 10px 30px rgba(0, 0, 0, .55);
}
html.dark .swal2-popup {
    box-shadow: 0 0 0 1px var(--fe-border), var(--fe-shadow-lg);
}
html.dark .swal2-title {
    color: var(--fe-text);
}
html.dark .swal2-close:hover {
    color: var(--fe-text);
}
