.vbc-validation-alert {
    color: red;
}
.bg-auth {background:url(/assets/img/bg-auth.jpg);}
.vbc-btn-48{
    width: 48px;
    height: 48px;
    cursor: pointer;
    margin: 5px;
}
.vbc-btn-32{
    width: 32px;
    height: 32px;
    cursor: pointer;
    margin: 3px;
}
.vbc-btn-24{
    width: 24px;
    height: 24px;
    cursor: pointer;
    margin: 2px;
}
.vbc-btn-sm{
    width: 32px;
    height: 32px;
    padding: 2px;
    border-radius: 5px;
}
.vbc-btn-xs{
    width: 24px;
    height: 24px;
    padding: 1px;
    border-radius: 3px;
}
.vbc-i-frame-box {
    margin: 0px,0px,0px,10px;
    padding: 0px;
    width: 100%;
    height: 100%;
}
.vbc-i-frame-link {
    cursor: pointer;
}

/* Base option styles */
select option,
.form-select option,
.form-control option,
.form-delicate-control option {
    background-color: #ffffff;
    color: #1e293b;
}

/* ==========================================================================
   Modo Oscuro Estándar del Sistema (Tokens y Superficies Unificadas)
   ========================================================================== */
html[data-theme="dark"] {
    color-scheme: dark !important;
    --dm-bg-canvas: #0b1120;
    --dm-surface-1: #151c2c;
    --dm-surface-2: #1b2436;
    --dm-surface-inset: #1e293b;
    --dm-surface-hover: #253249;
    --dm-border: #28354d;
    --dm-border-strong: #364665;
    --dm-text-primary: #f1f5f9;
    --dm-text-secondary: #cbd5e1;
    --dm-text-muted: #94a3b8;
    --dm-accent: #10b981;
    --dm-accent-hover: #059669;
    --dm-accent-soft: rgba(16, 185, 129, 0.14);
    --dm-focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .dashboard-main,
html[data-theme="dark"] .dashboard-main-body {
    background-color: var(--dm-bg-canvas) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] .navbar-header {
    background-color: var(--dm-surface-1) !important;
    border-bottom: 1px solid var(--dm-border) !important;
}

html[data-theme="dark"] .sidebar {
    background-color: var(--dm-surface-1) !important;
    border-right: 1px solid var(--dm-border) !important;
}

html[data-theme="dark"] .d-footer {
    background-color: var(--dm-surface-1) !important;
    border-top: 1px solid var(--dm-border) !important;
    color: var(--dm-text-muted) !important;
}

/* Scrollbar sutil en modo oscuro */
html[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--dm-bg-canvas);
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* 1. Modal Overlay & Contenedores Principales (Bootstrap & Delicate Modals) */
[data-theme="dark"] .delicate-modal-overlay,
[data-theme="dark"] .modal-backdrop {
    background-color: rgba(4, 8, 18, 0.78) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

html body .modal-content,
html body .delicate-modal-card {
    border-radius: 18px !important;
    overflow: hidden !important;
    border: 0 !important;
}

[data-theme="dark"] .modal-content,
[data-theme="dark"] .delicate-modal-card {
    background-color: var(--dm-surface-1) !important;
    color: var(--dm-text-primary) !important;
    border: 1px solid var(--dm-border) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.72) !important;
    border-radius: 18px !important;
    overflow: hidden !important;
}

/* Encabezado uniforme verde esmeralda en todos los formularios modales (claro y oscuro) */
html body .modal-header,
html body .delicate-modal-header,
html[data-theme="dark"] body .modal-header,
html[data-theme="dark"] body .delicate-modal-header {
    background: linear-gradient(135deg, #065f46 0%, #059669 100%) !important;
    background-color: #065f46 !important;
    border: 0 !important;
    border-bottom: none !important;
    padding: 16px 22px !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
}

[data-theme="dark"] .modal-body,
[data-theme="dark"] .delicate-modal-body {
    background-color: var(--dm-surface-1) !important;
    color: var(--dm-text-secondary) !important;
}

[data-theme="dark"] .modal-footer,
[data-theme="dark"] .delicate-modal-footer {
    border-top: 1px solid var(--dm-border) !important;
    background-color: var(--dm-surface-2) !important;
}

html body .modal-header :is(h1, h2, h3, h4, h5, h6, .modal-title, strong, strong p),
html body .delicate-modal-header :is(h1, h2, h3, h4, h5, h6, .modal-title, strong, strong p),
html[data-theme="dark"] body .modal-header :is(h1, h2, h3, h4, h5, h6, .modal-title, strong, strong p),
html[data-theme="dark"] body .delicate-modal-header :is(h1, h2, h3, h4, h5, h6, .modal-title, strong, strong p) {
    color: #ffffff !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    margin-top: 0;
    margin-bottom: 0;
}

html body .modal-header :is(p:not(#messageSubject), small, .text-secondary-light, .text-muted),
html body .delicate-modal-header :is(p, small, .text-secondary-light, .text-muted),
html[data-theme="dark"] body .modal-header :is(p:not(#messageSubject), small, .text-secondary-light, .text-muted),
html[data-theme="dark"] body .delicate-modal-header :is(p, small, .text-secondary-light, .text-muted) {
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}

html body .modal-header :is(i, iconify-icon, .text-success, .text-primary, .text-neutral-900),
html body .delicate-modal-header :is(i, iconify-icon, .text-success, .text-primary, .text-neutral-900),
html[data-theme="dark"] body .modal-header :is(i, iconify-icon, .text-success, .text-primary, .text-neutral-900),
html[data-theme="dark"] body .delicate-modal-header :is(i, iconify-icon, .text-success, .text-primary, .text-neutral-900) {
    color: #ffffff !important;
}

html body .modal-header :is(.modal-icon-badge, .bg-success-subtle),
html body .delicate-modal-header :is(.modal-icon-badge, .bg-success-subtle),
html[data-theme="dark"] body .modal-header :is(.modal-icon-badge, .bg-success-subtle),
html[data-theme="dark"] body .delicate-modal-header :is(.modal-icon-badge, .bg-success-subtle) {
    background-color: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

/* Botón de cierre uniforme en todos los encabezados de modales/formularios */
html body .modal-header .btn-close,
html body .delicate-modal-header .btn-close,
html[data-theme="dark"] body .modal-header .btn-close,
html[data-theme="dark"] body .delicate-modal-header .btn-close {
    margin: 0 0 0 auto !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    border-radius: 8px !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M3 3L13 13M13 3L3 13'/%3E%3C/svg%3E") !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 14px 14px !important;
    filter: none !important;
    opacity: 0.92 !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
}

html body .modal-header .btn-close:hover,
html body .delicate-modal-header .btn-close:hover,
html[data-theme="dark"] body .modal-header .btn-close:hover,
html[data-theme="dark"] body .delicate-modal-header .btn-close:hover {
    border-color: rgba(255, 255, 255, 0.95) !important;
    background-color: rgba(255, 255, 255, 0.22) !important;
    opacity: 1 !important;
}

html body .modal-header .btn-close:focus,
html body .delicate-modal-header .btn-close:focus,
html[data-theme="dark"] body .modal-header .btn-close:focus,
html[data-theme="dark"] body .delicate-modal-header .btn-close:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25) !important;
}

/* 2. Tarjetas, Contenedores de Módulos y Utilidades Bootstrap en Modo Oscuro */
html[data-theme="dark"] body :is(.card, .custom-card-container, .cg-panel-card, .cg-group-card, .ca-card, .sesion-table-card, .inst-direct-group-card, .day-column-card, .dash-disc-summary-card, .dash-disc-drawer, .card-profile-box) {
    background-color: var(--dm-surface-1) !important;
    background-image: none !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] body .card-body {
    background-color: transparent !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] body .modal-content :is(.card, .card-body) {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body :is(.card-header, .card-footer, .cg-group-card-header, .inst-direct-group-header, .day-column-header) {
    background-color: var(--dm-surface-2) !important;
    background-image: none !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-primary) !important;
}

html[data-theme="dark"] body .sesion-header-card {
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.22) 0%, var(--dm-surface-1) 65%) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: var(--dm-text-primary) !important;
}

html[data-theme="dark"] body :is(.day-column-body, .inst-meta-pill, .ca-rule-box, .facilitated-box, .time-slot-card, .dash-horario-chip) {
    background-color: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] body .time-slot-card {
    border-left: 4px solid var(--dm-accent) !important;
}

html[data-theme="dark"] body :is(.slot-time, .day-column-title) {
    color: #34d399 !important;
}

html[data-theme="dark"] body :is(.slot-instructor, .dash-group-title) {
    color: var(--dm-text-primary) !important;
}

html[data-theme="dark"] body :is(.slot-area, .slot-academia, .no-practice-text) {
    color: var(--dm-text-muted) !important;
}

html[data-theme="dark"] body .slot-actions {
    border-top-color: var(--dm-border) !important;
}

html[data-theme="dark"] body .dash-horario-day-badge {
    background-color: var(--dm-accent-soft) !important;
    color: #34d399 !important;
}

html[data-theme="dark"] body .dash-disc-chevron {
    background-color: var(--dm-surface-inset) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] body .dash-disc-summary-card.is-expanded {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.14) 0%, var(--dm-surface-1) 100%) !important;
    border-color: var(--dm-accent) !important;
}

html[data-theme="dark"] body .bg-white:not(.btn-close),
html[data-theme="dark"] body .bg-light,
html[data-theme="dark"] body .bg-body {
    background-color: var(--dm-surface-2) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] body .academia-item {
    background-color: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-primary) !important;
}

html[data-theme="dark"] body .academia-item.bg-primary-subtle,
html[data-theme="dark"] body .academia-item.border-primary {
    background-color: rgba(16, 185, 129, 0.14) !important;
    border-color: var(--dm-accent) !important;
}

html[data-theme="dark"] body .dropdown-menu {
    background-color: var(--dm-surface-1) !important;
    border: 1px solid var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5) !important;
}

html[data-theme="dark"] body .dropdown-item {
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] body .dropdown-item:hover,
html[data-theme="dark"] body .dropdown-item:focus {
    background-color: var(--dm-surface-hover) !important;
    color: var(--dm-text-primary) !important;
}

html[data-theme="dark"] body :is(.list-group-item, .accordion-item, .accordion-button) {
    background-color: var(--dm-surface-2) !important;
    border-color: var(--dm-border) !important;
    color: var(--dm-text-secondary) !important;
}

html[data-theme="dark"] body :is(.text-dark, .text-black, .text-neutral-900, .text-primary-light) {
    color: var(--dm-text-primary) !important;
}

html[data-theme="dark"] body :is(.text-muted, .text-secondary, .text-secondary-light, .text-neutral-600, .text-neutral-700) {
    color: var(--dm-text-muted) !important;
}

html[data-theme="dark"] body :is(.border, .border-top, .border-bottom, .border-light, .border-neutral-200, .border-neutral-300) {
    border-color: var(--dm-border) !important;
}

/* 3. Etiquetas y Títulos de Campos */
html[data-theme="dark"] body :is(label, .form-label, .modal-body label) {
    color: var(--dm-text-secondary) !important;
    text-shadow: none !important;
}

html[data-theme="dark"] body .form-delicate-label {
    color: var(--dm-text-muted) !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-shadow: none !important;
}

/* 4. Campos de Entrada (sin alterar padding de búsqueda ni checkboxes) */
html[data-theme="dark"] body :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not(.custom-form-control),
    select,
    textarea,
    .form-control:not(.custom-form-control),
    .form-select,
    .form-delicate-control,
    .filter-delicate-select,
    .filter-delicate-select-wide,
    .ca-input-number
) {
    background-color: var(--dm-surface-inset) !important;
    color: var(--dm-text-primary) !important;
    border-color: var(--dm-border-strong) !important;
}

html[data-theme="dark"] body :is(.form-control:not(.form-control-sm):not(.custom-form-control):not(.search-delicate-input), .form-select:not(.form-select-sm), .form-delicate-control) {
    border-radius: 8px !important;
    padding: 9px 14px !important;
    font-size: 13.5px !important;
}

html[data-theme="dark"] body :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not(.custom-form-control):focus,
    select:focus,
    textarea:focus,
    .form-control:not(.custom-form-control):focus,
    .form-select:focus,
    .form-delicate-control:focus,
    .filter-delicate-select:focus,
    .filter-delicate-select-wide:focus
) {
    background-color: #243047 !important;
    color: #ffffff !important;
    border-color: var(--dm-accent) !important;
    box-shadow: var(--dm-focus-ring) !important;
    outline: none !important;
}

html[data-theme="dark"] body :is(
    input[readonly],
    select[readonly],
    textarea[readonly],
    .form-control[readonly],
    .form-delicate-control[readonly],
    .form-delicate-control:disabled,
    .read-only-field
) {
    background-color: #131a29 !important;
    color: var(--dm-text-muted) !important;
    border-color: var(--dm-border) !important;
    cursor: not-allowed !important;
}

html[data-theme="dark"] body :is(input, select, textarea, .form-control, .form-delicate-control)::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] body .input-group-text {
    background-color: var(--dm-surface-2) !important;
    border-color: var(--dm-border-strong) !important;
    color: var(--dm-text-muted) !important;
}

html[data-theme="dark"] body .form-check-input {
    background-color: var(--dm-surface-inset) !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] body .form-check-input:checked {
    background-color: var(--dm-accent-hover) !important;
    border-color: var(--dm-accent) !important;
}

/* 5. Opciones Desplegables de los Selects */
html[data-theme="dark"] body :is(select, option, .form-select, .form-control, .form-delicate-control, .form-select option, .form-control option, .form-delicate-control option) {
    color-scheme: dark !important;
}

html[data-theme="dark"] body :is(select option, option, .form-select option, .form-control option, .form-delicate-control option) {
    background-color: var(--dm-surface-inset) !important;
    color: var(--dm-text-primary) !important;
}

html[data-theme="dark"] body :is(select option:checked, option:checked, .form-select option:checked, .form-delicate-control option:checked) {
    background-color: #065f46 !important;
    color: #ffffff !important;
}

/* 6. Botones, Píldoras, Pestañas y Controles Interactivos */
html[data-theme="dark"] body :is(.btn-secondary, .btn-modal-cancel, .cg-year-btn, .cg-month-btn, .asist-filter-pill, .day-chip, .slot-action-btn, .facilitated-slot-btn) {
    background-color: var(--dm-surface-2) !important;
    color: var(--dm-text-secondary) !important;
    border-color: var(--dm-border-strong) !important;
}

html[data-theme="dark"] body :is(.btn-secondary:hover, .btn-modal-cancel:hover, .cg-year-btn:hover, .cg-month-btn:hover, .asist-filter-pill:hover, .day-chip:hover:not(.active), .slot-action-btn:hover, .facilitated-slot-btn:hover) {
    background-color: var(--dm-surface-hover) !important;
    color: #ffffff !important;
    border-color: #4b5d82 !important;
}

html[data-theme="dark"] body :is(.cg-year-btn.active, .cg-month-btn.active, .asist-filter-pill.active, .day-chip.active) {
    background-color: var(--dm-accent-hover) !important;
    border-color: var(--dm-accent) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] body :is(.custom-tabs-line-wrapper, .modal-tabs-container, .delicate-tabs, .nav-tabs) {
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] body :is(.tab-link-line, .modal-tab-item, .delicate-tab-btn, .nav-tabs .nav-link, .nav-tabs-custom .nav-link) {
    color: var(--dm-text-muted) !important;
    background-color: transparent !important;
}

html[data-theme="dark"] body :is(.tab-link-line:hover, .modal-tab-item:hover, .delicate-tab-btn:hover, .nav-tabs .nav-link:hover, .nav-tabs-custom .nav-link:hover) {
    color: #34d399 !important;
}

html[data-theme="dark"] body :is(.tab-link-line.active, .modal-tab-item.active, .delicate-tab-btn.active, .nav-tabs .nav-link.active) {
    color: #34d399 !important;
    border-color: var(--dm-accent) !important;
    background-color: rgba(16, 185, 129, 0.1) !important;
}

html[data-theme="dark"] body :is(.delicate-modal-footer .btn-dark-navy, .modal-footer .btn-primary) {
    background: var(--dm-accent-hover) !important;
    border: 1px solid var(--dm-accent-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35) !important;
    border-radius: 8px !important;
}

html[data-theme="dark"] body :is(.delicate-modal-footer .btn-dark-navy:hover, .modal-footer .btn-primary:hover) {
    background: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

/* 7. Alertas, Badges, Perfil y Terceros (Select2, SweetAlert2, Flatpickr) */
html[data-theme="dark"] body .alert-success {
    background-color: rgba(16, 185, 129, 0.14) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}
html[data-theme="dark"] body .alert-danger {
    background-color: rgba(239, 68, 68, 0.14) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}
html[data-theme="dark"] body .alert-warning {
    background-color: rgba(245, 158, 11, 0.14) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fcd34d !important;
}
html[data-theme="dark"] body .alert-info,
html[data-theme="dark"] body .info-box-notice {
    background-color: rgba(56, 189, 248, 0.12) !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
    color: #93c5fd !important;
}

html[data-theme="dark"] body .locked-badge-label {
    background-color: var(--dm-surface-inset) !important;
    color: var(--dm-text-muted) !important;
}

html[data-theme="dark"] body .profile-avatar-img {
    border-color: var(--dm-surface-1) !important;
    background-color: var(--dm-surface-2) !important;
}

html[data-theme="dark"] body :is(.status-badge-pendiente) {
    background-color: rgba(245, 158, 11, 0.16) !important;
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}
html[data-theme="dark"] body :is(.status-badge-aprobada) {
    background-color: rgba(16, 185, 129, 0.16) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}
html[data-theme="dark"] body :is(.status-badge-rechazada, .status-badge-retirado) {
    background-color: rgba(239, 68, 68, 0.16) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .select2-container--default .select2-selection--single,
[data-theme="dark"] .select2-container--default .select2-selection--multiple,
[data-theme="dark"] .select2-dropdown,
[data-theme="dark"] .select2-search--dropdown .select2-search__field {
    background-color: var(--dm-surface-inset) !important;
    color: var(--dm-text-primary) !important;
    border-color: var(--dm-border-strong) !important;
}

[data-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
[data-theme="dark"] .select2-results__option {
    color: var(--dm-text-primary) !important;
}

[data-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--dm-surface-hover) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .swal2-popup {
    background: var(--dm-surface-1) !important;
    color: var(--dm-text-primary) !important;
    border: 1px solid var(--dm-border) !important;
}

[data-theme="dark"] .swal2-title,
[data-theme="dark"] .swal2-html-container {
    color: var(--dm-text-primary) !important;
}

[data-theme="dark"] .flatpickr-calendar {
    background: var(--dm-surface-1) !important;
    border-color: var(--dm-border) !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .flatpickr-day,
[data-theme="dark"] .flatpickr-months .flatpickr-month,
[data-theme="dark"] span.flatpickr-weekday {
    color: var(--dm-text-secondary) !important;
    fill: var(--dm-text-secondary) !important;
}
[data-theme="dark"] .flatpickr-day:hover {
    background: var(--dm-surface-hover) !important;
    border-color: var(--dm-border-strong) !important;
}

/* ==========================================================================
   8. Tablas, Listados, Buscador y Paginación en Modo Oscuro
   ========================================================================== */
html[data-theme="dark"] body :is(.delicate-table, .cg-table, .sesion-table, .table) {
    background-color: var(--dm-surface-1) !important;
    color: var(--dm-text-secondary) !important;
    border-color: var(--dm-border) !important;
}

html[data-theme="dark"] body :is(.delicate-table, .cg-table, .sesion-table, .table) thead th {
    background: var(--dm-surface-2) !important;
    color: #34d399 !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid var(--dm-border) !important;
}

html[data-theme="dark"] body :is(.delicate-table, .cg-table, .sesion-table, .table) tbody td {
    border-bottom: 1px solid #222d42 !important;
    color: var(--dm-text-secondary) !important;
    background-color: transparent !important;
}

/* Filas Alternas Oscuras */
html[data-theme="dark"] body :is(.delicate-table, .cg-table, .table) tbody tr:nth-child(odd) td {
    background-color: var(--dm-surface-1) !important;
}

html[data-theme="dark"] body :is(.delicate-table, .cg-table, .table) tbody tr:nth-child(even) td {
    background-color: #192233 !important;
}

html[data-theme="dark"] body :is(.delicate-table, .cg-table, .sesion-table, .table) tbody tr:hover td {
    background-color: var(--dm-surface-hover) !important;
}

html[data-theme="dark"] body .sesion-student-row.row-presente td {
    background-color: rgba(16, 185, 129, 0.12) !important;
}

html[data-theme="dark"] body .sesion-student-row.row-justificada td {
    background-color: rgba(245, 158, 11, 0.12) !important;
}

html[data-theme="dark"] body .sesion-check-btn {
    background-color: var(--dm-surface-inset) !important;
    border-color: #475569 !important;
}

html[data-theme="dark"] body .table-warning-row td {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

/* Textos dentro de la Tabla */
html[data-theme="dark"] body .user-name-text {
    color: var(--dm-text-primary) !important;
    font-weight: 600 !important;
}

html[data-theme="dark"] body .user-secondary-text {
    color: var(--dm-text-muted) !important;
}

/* Botones de Acción (Editar, Usuario, Ficha y Eliminar) */
html[data-theme="dark"] body :is(.btn-action-edit, .btn-action-user) {
    background-color: var(--dm-surface-2) !important;
    border: 1px solid var(--dm-border-strong) !important;
    color: var(--dm-text-secondary) !important;
    border-radius: 8px !important;
    transition: all 0.15s ease-in-out !important;
}

html[data-theme="dark"] body :is(.btn-action-edit:hover, .btn-action-user:hover) {
    background-color: var(--dm-surface-hover) !important;
    border-color: #4b5d82 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] body .btn-action-ficha {
    background-color: rgba(59, 130, 246, 0.14) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
    border-radius: 8px !important;
}

html[data-theme="dark"] body .btn-action-ficha:hover {
    background-color: rgba(59, 130, 246, 0.25) !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
}

html[data-theme="dark"] body :is(.btn-action-delete, .slot-action-delete) {
    background-color: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.28) !important;
    color: #fca5a5 !important;
    border-radius: 8px !important;
    transition: all 0.15s ease-in-out !important;
}

html[data-theme="dark"] body :is(.btn-action-delete:hover, .slot-action-delete:hover) {
    background-color: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

html[data-theme="dark"] body .slot-action-instructor {
    background-color: var(--dm-accent-soft) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #34d399 !important;
}

/* Buscador por encima de la Tabla (Conserva padding izquierdo del ícono) */
html[data-theme="dark"] body .search-delicate-input {
    background-color: var(--dm-surface-inset) !important;
    border: 1px solid var(--dm-border-strong) !important;
    color: var(--dm-text-primary) !important;
    padding: 8px 14px 8px 36px !important;
    border-radius: 8px !important;
}

html[data-theme="dark"] body .search-delicate-input:focus {
    background-color: #243047 !important;
    border-color: var(--dm-accent) !important;
    box-shadow: var(--dm-focus-ring) !important;
    outline: none !important;
}

html[data-theme="dark"] body .search-delicate-input::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] body .search-icon-wrapper {
    color: var(--dm-text-muted) !important;
}

/* Paginación en Modo Oscuro */
html[data-theme="dark"] body :is(.pagination .page-item .page-link, .pagination .page-link) {
    background-color: var(--dm-surface-2) !important;
    border: 1px solid var(--dm-border-strong) !important;
    color: var(--dm-text-secondary) !important;
    border-radius: 6px !important;
    margin: 0 2px !important;
}

html[data-theme="dark"] body :is(.pagination .page-item.active .page-link, .pagination .active > .page-link) {
    background-color: var(--dm-accent-hover) !important;
    border-color: var(--dm-accent-hover) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] body :is(.pagination .page-item .page-link:hover, .pagination .page-link:hover) {
    background-color: var(--dm-surface-hover) !important;
    color: #ffffff !important;
    border-color: #4b5d82 !important;
}

html[data-theme="dark"] body .pagination .page-item.disabled .page-link {
    background-color: #121826 !important;
    border-color: var(--dm-border) !important;
    color: #64748b !important;
}

/* ==========================================================================
   Estilos de Menú Lateral (Sidebar) - Estado Activo en Verde (#166534)
   ========================================================================== */

/* Dropdowns y enlaces activos del menú lateral */
.sidebar-menu li.dropdown.open > a,
.sidebar-menu li.dropdown.dropdown-open > a,
.sidebar-menu li.dropdown.active > a,
.sidebar-menu li > a.active-page,
.sidebar-menu li a.active {
    background-color: #166534 !important;
    color: #ffffff !important;
}

.sidebar-menu li.dropdown.open > a .menu-icon,
.sidebar-menu li.dropdown.dropdown-open > a .menu-icon,
.sidebar-menu li.dropdown.active > a .menu-icon,
.sidebar-menu li > a.active-page .menu-icon,
.sidebar-menu li a.active .menu-icon {
    color: #ffffff !important;
}

/* Submenús activos (Verde más claro armónico: #16a34a) */
.sidebar-menu .sidebar-submenu li a.active-page,
.sidebar-menu .sidebar-submenu li.active-page > a,
.sidebar-menu .sidebar-submenu li a.active {
    background-color: #16a34a !important;
    color: #ffffff !important;
}

.sidebar-menu .sidebar-submenu li a.active-page .circle-icon,
.sidebar-menu .sidebar-submenu li a.active .circle-icon {
    color: #ffffff !important;
}

/* Hover de items del sidebar */
.sidebar-menu li a:hover {
    color: #166534 !important;
}

.sidebar-menu .sidebar-submenu li a:hover {
    color: #16a34a !important;
}

.sidebar-menu li.dropdown.open > a:hover,
.sidebar-menu li.dropdown.dropdown-open > a:hover,
.sidebar-menu li > a.active-page:hover,
.sidebar-menu li a.active:hover {
    background-color: #14532d !important;
    color: #ffffff !important;
}

.sidebar-menu .sidebar-submenu li a.active-page:hover {
    background-color: #15803d !important;
    color: #ffffff !important;
}

/* Viñetas en submenú */
.sidebar-menu .sidebar-submenu li a .circle-icon.text-primary-600 {
    color: #16a34a !important;
}

/* Modo Oscuro - Sidebar activo */
[data-theme="dark"] .sidebar-menu li.dropdown.open > a,
[data-theme="dark"] .sidebar-menu li.dropdown.dropdown-open > a,
[data-theme="dark"] .sidebar-menu li.dropdown.active > a,
[data-theme="dark"] .sidebar-menu li > a.active-page,
[data-theme="dark"] .sidebar-menu li a.active {
    background-color: #166534 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .sidebar-menu .sidebar-submenu li a.active-page {
    background-color: #16a34a !important;
    color: #ffffff !important;
}

[data-theme="dark"] .sidebar-menu .sidebar-submenu li a .circle-icon.text-primary-600 {
    color: #22c55e !important;
}

/* ==========================================================================
   Responsive Mobile & Tablet (<= 1199px, <= 767px, <= 575px)
   ========================================================================== */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.dashboard-main {
    max-width: 100%;
    overflow-x: clip;
}

.dashboard-main-body {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 1199.98px) {
    body.overlay-active {
        overflow: hidden !important;
    }

    body.overlay-active::after {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9990 !important;
        background: rgba(15, 23, 42, 0.55) !important;
        backdrop-filter: blur(2px);
    }

    .sidebar.sidebar-open {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        z-index: 9999 !important;
        max-width: 85vw !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35) !important;
    }
}

@media (max-width: 991.98px) {
    html body .page-content-wrapper {
        padding: 0 12px !important;
    }

    html body .pagos-page-wrapper,
    html body .cg-page-wrapper {
        padding: 0 8px !important;
    }

    html body .alumnos-list-scroll {
        max-height: 360px !important;
        min-height: 200px !important;
    }
}

@media (max-width: 767.98px) {
    .dashboard-main-body {
        padding: 14px 10px !important;
    }

    .navbar-header {
        padding: 10px 12px !important;
    }

    .d-footer {
        padding: 14px 12px !important;
        text-align: center;
    }

    .d-footer .row {
        flex-direction: column;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
    }

    html body .page-content-wrapper {
        padding: 0 4px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    html body .pagos-page-wrapper,
    html body .cg-page-wrapper {
        padding: 0 2px !important;
    }

    html body .custom-card-container .d-flex.flex-wrap > .btn-dark-navy {
        width: 100% !important;
        justify-content: center !important;
    }

    html body .custom-card-container .d-flex.flex-wrap > .d-flex.align-items-center.flex-wrap {
        width: 100% !important;
        gap: 10px !important;
    }

    html body .custom-card-container .d-flex.flex-wrap > div:has(> .search-delicate-input),
    html body .custom-card-container .d-flex.flex-wrap > div:has(> .filter-delicate-select),
    html body .custom-card-container .d-flex.flex-wrap > div:has(> .filter-delicate-select-wide),
    html body .custom-card-container .d-flex.flex-wrap > .position-relative {
        width: 100% !important;
        flex: 1 1 100% !important;
        flex-wrap: wrap !important;
    }

    html body .search-delicate-input,
    html body .filter-delicate-select,
    html body .filter-delicate-select-wide {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    html body .delicate-table thead th,
    html body .delicate-table tbody td {
        padding: 10px 12px !important;
    }

    html body .cg-table thead th,
    html body .cg-table tbody td,
    html body .sesion-table thead th,
    html body .sesion-table tbody td {
        padding: 9px 10px !important;
    }
}

@media (max-width: 575.98px) {
    html body .page-content-wrapper {
        padding: 0 !important;
    }

    html body .delicate-modal-overlay {
        padding: 8px !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
    }

    html body .delicate-modal-card {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 94vh !important;
        border-radius: 12px !important;
        margin: auto 0;
    }

    html body .delicate-modal-header {
        padding: 12px 14px !important;
        gap: 10px !important;
    }

    html body .delicate-modal-header h5,
    html body .delicate-modal-header h6 {
        font-size: 15px !important;
        line-height: 1.25 !important;
    }

    html body .delicate-modal-body {
        padding: 14px !important;
    }

    html body .delicate-modal-footer {
        padding: 12px 14px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: stretch !important;
    }

    html body .delicate-modal-footer > button,
    html body .delicate-modal-footer > .btn {
        flex: 1 1 auto !important;
        justify-content: center !important;
    }

    html body .delicate-modal-tabs,
    html body .modal-tabs-container,
    html body .custom-tabs-line-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        scrollbar-width: none;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    html body .delicate-modal-tabs::-webkit-scrollbar,
    html body .modal-tabs-container::-webkit-scrollbar,
    html body .custom-tabs-line-wrapper::-webkit-scrollbar {
        display: none;
    }

    html body .modal-tab-btn,
    html body .delicate-tab-btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 10px 12px !important;
        font-size: 12.5px !important;
    }

    html body .modal-dialog {
        margin: 8px !important;
        max-width: calc(100vw - 16px) !important;
    }

    html body .modal-body {
        padding: 14px !important;
    }

    html body .modal-footer {
        padding: 12px 14px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    html body .pagination {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 4px !important;
    }
}



