/* 
 * AGGRESSIVE DARK MODE OVERRIDES 
 * Forcefully override Bootstrap and custom styles when [data-bs-theme="dark"] is active.
 * Palette: Slate (Blue-Grey)
 */

[data-bs-theme="dark"] {
    /* Core Colors & Variables Override for Dashboard */
    --bs-body-bg: #0f172a !important;
    --bs-body-color: #f1f5f9 !important;
    --bs-secondary-bg: #1e293b !important;
    --bs-tertiary-bg: #334155 !important;
    --bs-border-color: #334155 !important;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.1) !important;

    /* LIGHTER BLUE GRADIENT OVERRIDE */
    /* Changed from deep indigo to Bright Sky/Blue gradient */
    --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%) !important;

    /* Variable Overrides for fichar/index.php Glassmorphism */
    --glass: rgba(30, 41, 59, 0.7) !important;
    --glass-border: 1px solid rgba(255, 255, 255, 0.08) !important;
    --border: 1px solid rgba(255, 255, 255, 0.08) !important;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5) !important;
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5) !important;
    --glass-hover: rgba(30, 41, 59, 0.9) !important;

    /* Text Colors */
    --bs-heading-color: #ffffff !important;
    --bs-link-color: #38bdf8 !important;
    /* Lighter Blue */
    --bs-link-hover-color: #7dd3fc !important;
    --bs-primary: #38bdf8 !important;
    /* Override Bootstrap Primary to Sky Blue */
    --bs-primary-rgb: 56, 189, 248 !important;

    /* Global Variables override */
    --card-bg: #1e293b;
    --input-bg: #0f172a;
    --input-border: #334155;
    --input-focus-border: #38bdf8;
}

/* GLOBAL BODY & RESET */
[data-bs-theme="dark"] body {
    background: #0f172a !important;
    /* Overrides the linear-gradient */
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] html::before {
    display: none !important;
    /* Remove the light background bubbles */
}

/* HEADINGS */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .greeting-text h1,
[data-bs-theme="dark"] .brand-title,
[data-bs-theme="dark"] .leaves-header h3,
[data-bs-theme="dark"] .header-card h3,
[data-bs-theme="dark"] .form-title,
[data-bs-theme="dark"] .page-title,
[data-bs-theme="dark"] .company-title {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

[data-bs-theme="dark"] .page-subtitle {
    color: #cbd5e1 !important;
}

/* FORM TITLES */
[data-bs-theme="dark"] .form-section-title {
    color: #38bdf8 !important;
    /* Sky Blue */
}

[data-bs-theme="dark"] .form-section-title::after {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Overriding specific gradient text to use the new lighter gradient */
[data-bs-theme="dark"] .greeting-text strong,
[data-bs-theme="dark"] #clock-digitlal,
[data-bs-theme="dark"] .display-4,
/* Percentages */
[data-bs-theme="dark"] .navbar-brand {
    background: var(--gradient-primary) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* CARDS & CONTAINERS */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .glass-card,
[data-bs-theme="dark"] .header-greeting,
[data-bs-theme="dark"] .dashboard-card,
[data-bs-theme="dark"] .chart-box,
[data-bs-theme="dark"] .pe-card,
[data-bs-theme="dark"] .notif-card,
[data-bs-theme="dark"] #clockResult,
[data-bs-theme="dark"] .time-widget,
[data-bs-theme="dark"] .leaves-card,
[data-bs-theme="dark"] .calendar-card,
[data-bs-theme="dark"] .leaves-header,
[data-bs-theme="dark"] .summary-card,
[data-bs-theme="dark"] .header-card,
[data-bs-theme="dark"] .form-card,
[data-bs-theme="dark"] .company-header {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
    backdrop-filter: blur(20px) !important;
}

[data-bs-theme="dark"] .company-header::before {
    background: var(--gradient-primary) !important;
}

[data-bs-theme="dark"] .company-meta span {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-color: var(--bs-border-color) !important;
    color: #f8fafc !important;
}

/* INFO BOX & ALERTS OVERRIDE */
[data-bs-theme="dark"] .info-box,
[data-bs-theme="dark"] .alert-info {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    border-left-color: #38bdf8 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .alert-info strong {
    color: #fff !important;
}

/* NAVBAR SPECIFIC - OVERRIDE BLUE */
[data-bs-theme="dark"] .navbar,
[data-bs-theme="dark"] .modern-navbar {
    background: #0f172a !important;
    /* Solid Dark Slate */
    background-color: #0f172a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

/* OVERRIDE MODERN NAVBAR DROPDOWNS */
[data-bs-theme="dark"] .modern-navbar .dropdown-menu,
[data-bs-theme="dark"] .navbar .dropdown-menu {
    background-color: #1e293b !important;
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .modern-navbar .dropdown-item,
[data-bs-theme="dark"] .navbar .dropdown-item {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .modern-navbar .dropdown-item:hover,
[data-bs-theme="dark"] .modern-navbar .dropdown-item:focus,
[data-bs-theme="dark"] .navbar .dropdown-item:hover,
[data-bs-theme="dark"] .navbar .dropdown-item:focus {
    background-color: #334155 !important;
    background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .modern-navbar .dropdown-item i,
[data-bs-theme="dark"] .navbar .dropdown-item i {
    color: #38bdf8;
}

[data-bs-theme="dark"] .modern-navbar .dropdown-item:hover i,
[data-bs-theme="dark"] .navbar .dropdown-item:hover i {
    color: #fff !important;
}

[data-bs-theme="dark"] .modern-navbar .nav-link.active,
[data-bs-theme="dark"] .modern-navbar .dropdown-toggle:hover,
[data-bs-theme="dark"] .modern-navbar .dropdown.show .dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.1) !important;
    /* Subtle highlight instead of blue */
    color: #38bdf8 !important;
    /* Light blue text for active/hover */
    box-shadow: none !important;
}

[data-bs-theme="dark"] .modern-navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #38bdf8 !important;
}

/* FORMS & INPUTS */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: var(--input-focus-border) !important;
    background-color: var(--input-bg) !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3) !important;
    /* Sky Blue Glow */
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b !important;
}

[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] .col-form-label {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] .input-group .btn {
    background-color: #1e293b !important;
    border-color: var(--bs-border-color) !important;
    color: #f1f5f9 !important;
}

/* TABLES & LISTS (Including Leaves Table) */
[data-bs-theme="dark"] .table {
    --bs-table-color: #f1f5f9;
    --bs-table-bg: transparent;
    --bs-table-border-color: #334155;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>* {
    color: var(--bs-table-color);
    box-shadow: inset 0 0 0 9999px var(--bs-table-striped-bg) !important;
}

[data-bs-theme="dark"] .leaves-table tbody tr,
[data-bs-theme="dark"] .table tbody tr {
    background-color: rgba(255, 255, 255, 0.03) !important;
    box-shadow: none !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .leaves-table tbody tr:hover,
[data-bs-theme="dark"] .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .leaves-table td,
[data-bs-theme="dark"] .leaves-table td .text-dark,
[data-bs-theme="dark"] .table td,
[data-bs-theme="dark"] .table td .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .leaves-table thead th,
[data-bs-theme="dark"] .table thead th {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .table-light {
    background-color: rgba(30, 41, 59, 0.5) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .table-light th {
    background-color: rgba(30, 41, 59, 0.8) !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .pe-total,
[data-bs-theme="dark"] .pe-badge {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

/* BUTTON CHECK GROUPS */
[data-bs-theme="dark"] .btn-check:checked+.btn-outline-primary {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%) !important;
    border-color: transparent !important;
    color: #0f172a !important;
    /* Contrast text */
}

/* MODALS & ALERTS */
[data-bs-theme="dark"] .modal-content {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-bs-theme="dark"] .swal2-popup {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .swal2-title {
    color: #fff !important;
}

[data-bs-theme="dark"] .swal2-content,
[data-bs-theme="dark"] .swal2-html-container {
    color: #cbd5e1 !important;
}

/* DROPDOWNS */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* SPECIFIC UTILS */
[data-bs-theme="dark"] .bg-white {
    background-color: #0f172a !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .border-light {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .border {
    border-color: #334155 !important;
}

/* Text Utilities Override */
[data-bs-theme="dark"] .text-primary {
    color: #38bdf8 !important;
    /* Sky Blue 400 */
}

/* MAP SPECIFICS */
[data-bs-theme="dark"] #map,
[data-bs-theme="dark"] #mapa {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .leaflet-control-relocate {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .leaflet-control-relocate i {
    color: #fff !important;
}

[data-bs-theme="dark"] .map-stats-overlay {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(12px) !important;
}

[data-bs-theme="dark"] .map-stats-content h6 {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .map-stats-content span {
    color: #fff !important;
}

[data-bs-theme="dark"] .leaflet-popup-content-wrapper,
[data-bs-theme="dark"] .leaflet-popup-tip {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

/* BADGES PRESENCE */
[data-bs-theme="dark"] .badge-dentro {
    background-color: rgba(16, 185, 129, 0.2) !important;
    /* Green */
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

[data-bs-theme="dark"] .badge-fuera {
    background-color: rgba(239, 68, 68, 0.2) !important;
    /* Red */
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* FLATPICKR OVERRIDES */
[data-bs-theme="dark"] .flatpickr-calendar {
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .flatpickr-calendar.arrowTop:before,
[data-bs-theme="dark"] .flatpickr-calendar.arrowTop:after {
    border-bottom-color: #1e293b !important;
}

[data-bs-theme="dark"] .flatpickr-month {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    fill: #f1f5f9 !important;
}

[data-bs-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
[data-bs-theme="dark"] .flatpickr-current-month input.cur-year {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: #334155 !important;
}

[data-bs-theme="dark"] .flatpickr-weekday {
    background: #1e293b !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .flatpickr-day {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .flatpickr-day.prevMonthDay,
[data-bs-theme="dark"] .flatpickr-day.nextMonthDay {
    color: #475569 !important;
}

[data-bs-theme="dark"] .flatpickr-day:hover,
[data-bs-theme="dark"] .flatpickr-day:focus {
    background: #334155 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .flatpickr-day.selected,
[data-bs-theme="dark"] .flatpickr-day.startRange,
[data-bs-theme="dark"] .flatpickr-day.endRange,
[data-bs-theme="dark"] .flatpickr-day.selected.inRange,
[data-bs-theme="dark"] .flatpickr-day.startRange.inRange,
[data-bs-theme="dark"] .flatpickr-day.endRange.inRange,
[data-bs-theme="dark"] .flatpickr-day.today.selected,
[data-bs-theme="dark"] .flatpickr-day.today.inRange,
[data-bs-theme="dark"] .flatpickr-day.today:hover,
[data-bs-theme="dark"] .flatpickr-day.today:focus {
    background: #38bdf8 !important;
    border-color: #38bdf8 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .flatpickr-time {
    background: #1e293b !important;
    border-top-color: #334155 !important;
}

[data-bs-theme="dark"] .flatpickr-time .flatpickr-time-separator,
[data-bs-theme="dark"] .flatpickr-time .flatpickr-am-pm {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .flatpickr-time input {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .flatpickr-time input:hover,
[data-bs-theme="dark"] .flatpickr-time .flatpickr-am-pm:hover,
[data-bs-theme="dark"] .flatpickr-time input:focus,
[data-bs-theme="dark"] .flatpickr-time .flatpickr-am-pm:focus {
    background: #334155 !important;
}

/* SECTION: PERMISSIONS & SALDOS */

/* Calendar Overrides */
[data-bs-theme="dark"] #calendar {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .fc-toolbar-title {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .fc-col-header-cell-cushion {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .fc-daygrid-day-number {
    color: #94a3b8 !important;
}

/* Saldos Cards */
[data-bs-theme="dark"] .employee-card {
    background-color: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .employee-card:hover {
    background-color: rgba(30, 41, 59, 1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .employee-header {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .balance-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .balance-item:hover {
    background-color: #334155 !important;
    border-color: #38bdf8 !important;
}

[data-bs-theme="dark"] .progress-slim {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* TABS (Vacaciones) */
[data-bs-theme="dark"] .nav-tabs .nav-link {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%) !important;
    color: #0f172a !important;
    /* Contrast text */
    color: #ffffff !important;
    border-color: transparent !important;
}

/* CLOCK WIDGET SPECIFICS */
[data-bs-theme="dark"] #clock2 {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #fff !important;
}

/* BUTTONS */
[data-bs-theme="dark"] .avatar-fallback-32,
[data-bs-theme="dark"] .avatar-fallback-48 {
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .btn-link {
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .bg-white-glass {
    background: rgba(30, 41, 59, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Button Primary Gradient Override to Lighter Blue */
[data-bs-theme="dark"] .btn-primary,
[data-bs-theme="dark"] .btn-register,
[data-bs-theme="dark"] .btn-gradient,
[data-bs-theme="dark"] .btn-gradient-primary {
    background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%) !important;
    border: none !important;
    color: #0f172a !important;
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .btn-primary:hover,
[data-bs-theme="dark"] .btn-register:hover,
[data-bs-theme="dark"] .btn-gradient:hover,
[data-bs-theme="dark"] .btn-gradient-primary:hover {
    background: linear-gradient(135deg, #7dd3fc 0%, #60a5fa 100%) !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4) !important;
}

[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-clean,
[data-bs-theme="dark"] .btn-outline-glass,
[data-bs-theme="dark"] .btn-refresh {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark"] .btn-clean:hover,
[data-bs-theme="dark"] .btn-outline-glass:hover,
[data-bs-theme="dark"] .btn-refresh:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover,
[data-bs-theme="dark"] .btn-outline-primary.active {
    background-color: rgba(56, 189, 248, 0.1) !important;
    color: #fff !important;
}

/* Progress bars override */
[data-bs-theme="dark"] .progress-bar {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%) !important;
}

/* Calendar specific */
[data-bs-theme="dark"] .fc-theme-bootstrap5 .fc-scrollgrid {
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .fc-theme-bootstrap5 td,
[data-bs-theme="dark"] .fc-theme-bootstrap5 th,
[data-bs-theme="dark"] .fc-col-header-cell {
    border-color: #334155 !important;
    background-color: #1e293b !important;
}

[data-bs-theme="dark"] .fc-scrollgrid-sync-inner,
[data-bs-theme="dark"] .fc-col-header-cell-cushion {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    text-decoration: none !important;
}

[data-bs-theme="dark"] .fc-day-today {
    background-color: rgba(56, 189, 248, 0.1) !important;
}

[data-bs-theme="dark"] .fc-col-header-cell-cushion,
[data-bs-theme="dark"] .fc-daygrid-day-number {
    color: #f1f5f9 !important;
    text-decoration: none !important;
}

[data-bs-theme="dark"] .fc-button {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .fc-button-primary:not(:disabled).fc-button-active,
[data-bs-theme="dark"] .fc-button-primary:not(:disabled):active {
    background-color: #38bdf8 !important;
    color: #fff !important;
}

/* Limits Box */
[data-bs-theme="dark"] #limitInfo {
    background-color: rgba(30, 41, 59, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
}

/* SELECT2 OVERRIDES */
[data-bs-theme="dark"] .select2-container .select2-selection--single,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__rendered {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .select2-dropdown,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .select2-search__field {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .select2-results__option,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .select2-results__option--highlighted[aria-selected],
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: #38bdf8 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: #38bdf8 !important;
    color: #fff !important;
    border-color: #38bdf8 !important;
}

/* DATATABLES OVERRIDES */
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #64748b !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] table.dataTable tbody tr {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

[data-bs-theme="dark"] table.dataTable tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .page-link {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .page-item.active .page-link {
    background-color: #38bdf8 !important;
    border-color: #38bdf8 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
    background-color: #0f172a !important;
    color: #64748b !important;
    border-color: #334155 !important;
}

/* HELP CENTER SPECIFIC overrides (panel_ayuda) */
[data-bs-theme="dark"] .welcome-banner {
    background: rgba(30, 41, 59, 0.7) !important;
    backdrop-filter: blur(20px) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .welcome-banner p {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .quick-access-card {
    background: rgba(30, 41, 59, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .quick-access-card:hover {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: #38bdf8 !important;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .quick-access-card h3 {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .quick-access-card p {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .guide-section {
    background: rgba(30, 41, 59, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .accordion-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .accordion-button {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .accordion-body {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .accordion-body h4 {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .accordion-body p,
[data-bs-theme="dark"] .accordion-body li {
    color: #b5c7e0 !important;
}

[data-bs-theme="dark"] .accordion-body strong {
    color: #fff !important;
}

[data-bs-theme="dark"] .search-wrapper input {
    background: rgba(15, 23, 42, 0.8) !important;
    border-color: #334155 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .search-wrapper input:focus {
    border-color: #38bdf8 !important;
    background: #0f172a !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1) !important;
}

[data-bs-theme="dark"] .section-title {
    color: #f1f5f9 !important;
}

/* =========================================================================
   THEME SWITCH TRANSITION EFFECTS (The "Cool" Animation)
   ========================================================================= */

/* Native CSS View Transitions for supported browsers (Chrome 111+) */
::view-transition-group(root) {
    animation-duration: 0.5s;
    /* Global duration default */
}

/* Define the new view (dark/light overlay) growing from cursor */
::view-transition-new(root) {
    mix-blend-mode: normal;
    animation: none;
    /* JS handles the keyframes with clip-path */
}

/* Keep the old view static while the new one covers it */
::view-transition-old(root) {
    animation: none;
    z-index: -1;
}

/* FALLBACK: Simple transition for unsupported browsers */
/* This class is conceptually only needed if we used the body-class approach.
   Since View Transitions API handles the snapshotting, we don't need explicit
   transitions on * elements, which is better for performance.
*/
@media (prefers-reduced-motion: no-preference) {
    /* If View Transitions API is NOT supported, we could rely on a universal transition.
       However, universal transitions ( * { transition... } ) are heavy.
       For now, we rely on the JS check. If !startViewTransition, it just toggles instantly.
       If you really want a fallback Fade, uncomment below:
    */
    /*
    body:not(.view-transition-active) {
        transition: background-color 0.3s ease, color 0.3s ease;
    }
    */
}