/**
 * IEPROES — Sistema de temas (claro / oscuro / sistema)
 */

:root {
    --ie-body-bg: #f4f6f9;
    --ie-surface: #ffffff;
    --ie-surface-2: #f8fafc;
    --ie-surface-3: #f1f5f9;
    --ie-text: #1e293b;
    --ie-text-muted: #64748b;
    --ie-border: #e2e8f0;
    --ie-input-bg: #ffffff;
    --ie-input-border: #ced4da;
    --ie-shadow: rgba(15, 23, 42, 0.06);
    --ie-link: #1565c0;
    --ie-header-bg: #ffffff;
    --ie-header-border: #e2e8f0;
    --ie-header-text: #1565c0;
    --ie-header-muted: #64748b;
    --ie-header-toggle-bg: #f8fafc;
    --ie-footer-bg: #ffffff;
    --ie-footer-text: #6c757d;
    --ie-dropdown-bg: #ffffff;
    --ie-dropdown-hover: #f1f5f9;
    --ie-overlay: rgba(15, 23, 42, 0.45);
    --ie-scrollbar: rgba(21, 101, 192, 0.22);
    --ie-scrollbar-hover: rgba(21, 101, 192, 0.38);

    /* Paneles / filtros embebidos en vistas admin */
    --ie-filter-panel-bg: #f8f9fa;
    --ie-filter-label: #495057;
    --ie-stat-bg: #ffffff;
    --ie-stat-border: #e9ecef;
    --ie-stat-label: #6c757d;
    --ie-stat-value: #2c3e50;
    --ie-meta-box-bg: #f8f9fa;
    --ie-table-row-hover: #f4f7fb;
    --ie-panel-header-bg: #f8fafc;
    --ie-panel-header-text: #2c3e50;
    --ie-chip-bg: #f8f9fa;
    --ie-chip-text: #495057;
    --ie-chip-border: #d6d8db;
    --ie-empty-bg: #fbfcfd;
    --ie-empty-border: #ced4da;
    --ie-table-shell-bg: #ffffff;
    --ie-toolbar-bg: #fcfdff;
    --ie-tag-bg: #eef2f7;
    --ie-tag-text: #334155;
    --ie-strip-bg: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    --ie-tab-muted: #6c757d;
    --ie-tab-active: #1d3557;
    --ie-progress-track: #e9ecef;
    --ie-section-header-bg: #f4f6f9;

    /* Maestrías / ciclos / distribución */
    --ie-ciclo-header-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --ie-ciclo-num-bg: linear-gradient(135deg, #343a40 0%, #495057 100%);
    --ie-ciclo-num-sm-bg: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    --ie-selected-row-bg: #e8f5e9;
    --ie-selected-row-border: #28a745;
    --ie-selected-row-hover: #dcedc8;
    --ie-info-badge-bg: #e3f2fd;
    --ie-info-badge-text: #1565c0;
    --ie-muted-badge-bg: #f0f0f0;
    --ie-muted-badge-text: #999999;
    --ie-accent-bar-bg: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    --ie-accent-bar-border: #3f51b5;
    --ie-dist-card-border: #e8edf3;
    --ie-dist-header-bg: #f9fbfd;
    --ie-dist-section-bg: #fcfdff;
    --ie-dist-label: #475569;
    --ie-dist-section-title: #64748b;
    --ie-empty-icon-bg: #e8f2ff;
    --ie-empty-icon-color: #2b7db8;
    --ie-sticky-col-bg: #ffffff;
    --ie-hero-bg: linear-gradient(135deg, #1f4e79 0%, #2b7db8 100%);
    --ie-hero-pill-bg: rgba(255, 255, 255, 0.16);
    --ie-hero-pill-border: rgba(255, 255, 255, 0.2);
    --ie-doc-badge-bg: #e8f2ff;
    --ie-doc-badge-text: #1f4e79;
    --ie-placeholder-bg: #f8f9fa;
    --ie-placeholder-icon: #dddddd;
    --ie-horario-hover: #bbdefb;
    --ie-pill-info-bg: #e9f2ff;
    --ie-pill-info-text: #0b5ed7;
    --ie-pill-info-count-bg: #0b5ed7;
    --ie-pensum-header-bg: linear-gradient(135deg, #343a40 0%, #212529 100%);
    --ie-pensum-header-edit-bg: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    --ie-readonly-input-bg: #e9ecef;
    --ie-row-divider: #f0f0f0;
    --ie-warning-soft-bg: #fffbf0;
    --ie-danger-soft-bg: #fff5f5;

    /* Maestrías / ciclos / distribución */
    --ie-ciclo-header-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --ie-ciclo-num-bg: linear-gradient(135deg, #343a40 0%, #495057 100%);
    --ie-ciclo-num-sm-bg: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    --ie-selected-row-bg: #e8f5e9;
    --ie-selected-row-border: #28a745;
    --ie-selected-row-hover: #dcedc8;
    --ie-info-badge-bg: #e3f2fd;
    --ie-info-badge-text: #1565c0;
    --ie-muted-badge-bg: #f0f0f0;
    --ie-muted-badge-text: #999999;
    --ie-accent-bar-bg: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    --ie-accent-bar-border: #3f51b5;
    --ie-dist-card-border: #e8edf3;
    --ie-dist-header-bg: #f9fbfd;
    --ie-dist-section-bg: #fcfdff;
    --ie-dist-label: #475569;
    --ie-dist-section-title: #64748b;
    --ie-empty-icon-bg: #e8f2ff;
    --ie-empty-icon-color: #2b7db8;
    --ie-sticky-col-bg: #ffffff;
    --ie-hero-bg: linear-gradient(135deg, #1f4e79 0%, #2b7db8 100%);
    --ie-hero-pill-bg: rgba(255, 255, 255, 0.16);
    --ie-hero-pill-border: rgba(255, 255, 255, 0.2);
    --ie-doc-badge-bg: #e8f2ff;
    --ie-doc-badge-text: #1f4e79;
    --ie-placeholder-bg: #f8f9fa;
    --ie-placeholder-icon: #dddddd;
    --ie-horario-hover: #bbdefb;
    --ie-pill-info-bg: #e9f2ff;
    --ie-pill-info-text: #0b5ed7;
    --ie-pill-info-count-bg: #0b5ed7;
    --ie-pensum-header-bg: linear-gradient(135deg, #343a40 0%, #212529 100%);
    --ie-pensum-header-edit-bg: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    --ie-readonly-input-bg: #e9ecef;
    --ie-row-divider: #f0f0f0;
}

[data-ie-theme="dark"] {
    color-scheme: dark;

    /* Paleta refinada: navy profundo con capas de elevación */
    --ie-body-bg: #0a0f1a;
    --ie-surface: #121a2b;
    --ie-surface-2: #1a2438;
    --ie-surface-3: #222e47;
    --ie-text: #eef2f8;
    --ie-text-muted: #8b9cb5;
    --ie-border: rgba(148, 163, 184, 0.14);
    --ie-input-bg: #0d1424;
    --ie-input-border: rgba(148, 163, 184, 0.22);
    --ie-shadow: rgba(0, 0, 0, 0.42);
    --ie-link: #6eb6ff;
    --ie-accent: #3b82f6;
    --ie-accent-soft: rgba(59, 130, 246, 0.14);
    --ie-accent-glow: rgba(59, 130, 246, 0.28);
    --ie-header-bg: #0f1628;
    --ie-header-border: rgba(148, 163, 184, 0.12);
    --ie-header-text: #93c5fd;
    --ie-header-muted: #8b9cb5;
    --ie-header-toggle-bg: #1a2438;
    --ie-footer-bg: #0f1628;
    --ie-footer-text: #8b9cb5;
    --ie-dropdown-bg: #151d2e;
    --ie-dropdown-hover: #1e2a42;
    --ie-overlay: rgba(2, 6, 23, 0.72);
    --ie-scrollbar: rgba(148, 163, 184, 0.22);
    --ie-scrollbar-hover: rgba(148, 163, 184, 0.38);

    /* Sidebar — ligeramente más profundo que el contenido */
    --ie-aside-bg: #070b14;
    --ie-aside-surface: #101827;
    --ie-aside-text: #e8edf5;
    --ie-aside-muted: #8b9cb5;
    --ie-aside-border: rgba(148, 163, 184, 0.14);
    --ie-aside-blue: #5eb0ff;
    --ie-aside-blue-light: #93c5fd;
    --ie-aside-rail-active: rgba(94, 176, 255, 0.16);
    --ie-aside-active-bar: #5eb0ff;
    --ie-aside-hover-bg: rgba(94, 176, 255, 0.11);
    --ie-aside-hover-text: #cfe4ff;
    --ie-aside-submenu-bg: rgba(12, 20, 36, 0.88);
    --ie-aside-submenu-border: rgba(94, 176, 255, 0.32);
    --ie-aside-submenu-text: #a8b8cf;
    --ie-aside-submenu-text-active: #e3efff;
    --ie-aside-icon-bg: rgba(94, 176, 255, 0.13);
    --ie-aside-icon-hover: rgba(94, 176, 255, 0.22);
    --ie-aside-hero-from: #0b1a33;
    --ie-aside-hero-mid: #12325e;
    --ie-aside-hero-to: #1a4d85;
    --ie-aside-menu-open-bg: rgba(16, 24, 40, 0.96);
    --ie-aside-menu-open-border: rgba(94, 176, 255, 0.2);
    --ie-aside-menu-open-shadow: 0 4px 18px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --ie-aside-chevron-bg: rgba(148, 163, 184, 0.12);
    --ie-aside-chevron-border: rgba(148, 163, 184, 0.2);
    /* Maestrías / ciclos / distribución */
    --ie-ciclo-header-bg: linear-gradient(135deg, #1a2438 0%, #121a2b 100%);
    --ie-ciclo-num-bg: linear-gradient(135deg, #222e47 0%, #1a2438 100%);
    --ie-ciclo-num-sm-bg: linear-gradient(135deg, #2a3650 0%, #1a2438 100%);
    --ie-selected-row-bg: rgba(40, 167, 69, 0.15);
    --ie-selected-row-border: #28a745;
    --ie-selected-row-hover: rgba(40, 167, 69, 0.22);
    --ie-info-badge-bg: rgba(59, 130, 246, 0.18);
    --ie-info-badge-text: #93c5fd;
    --ie-muted-badge-bg: rgba(148, 163, 184, 0.14);
    --ie-muted-badge-text: #8b9cb5;
    --ie-accent-bar-bg: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(59, 130, 246, 0.08) 100%);
    --ie-accent-bar-border: #3b82f6;
    --ie-dist-card-border: rgba(148, 163, 184, 0.16);
    --ie-dist-header-bg: #1a2438;
    --ie-dist-section-bg: #121a2b;
    --ie-dist-label: #94a3b8;
    --ie-dist-section-title: #8b9cb5;
    --ie-empty-icon-bg: rgba(59, 130, 246, 0.14);
    --ie-empty-icon-color: #6eb6ff;
    --ie-sticky-col-bg: #121a2b;
    --ie-hero-bg: linear-gradient(135deg, #0f2d4a 0%, #1a4d7a 100%);
    --ie-hero-pill-bg: rgba(255, 255, 255, 0.12);
    --ie-hero-pill-border: rgba(255, 255, 255, 0.18);
    --ie-doc-badge-bg: rgba(59, 130, 246, 0.18);
    --ie-doc-badge-text: #93c5fd;
    --ie-placeholder-bg: #1a2438;
    --ie-placeholder-icon: #475569;
    --ie-horario-hover: rgba(59, 130, 246, 0.22);
    --ie-pill-info-bg: rgba(59, 130, 246, 0.18);
    --ie-pill-info-text: #93c5fd;
    --ie-pill-info-count-bg: #2563eb;
    --ie-pensum-header-bg: linear-gradient(135deg, #0f1628 0%, #1a2d4a 100%);
    --ie-pensum-header-edit-bg: linear-gradient(135deg, #1a237e 0%, #1e3a6e 100%);
    --ie-readonly-input-bg: #0d1424;
    --ie-row-divider: rgba(148, 163, 184, 0.12);

    /* Combobox / select — tono surface (no negro puro) para integrarse con cards y filtros */
    --ie-select-bg: #1a2438;
    --ie-select-bg-hover: #222e47;
    --ie-select-bg-focus: #1e2a42;
    --ie-select-border: rgba(148, 163, 184, 0.32);
    --ie-select-border-hover: rgba(148, 163, 184, 0.45);
    --ie-select-text: #eef2f8;
    --ie-select-muted: #8b9cb5;
    --ie-select-dropdown-bg: #151d2e;
    --ie-select-option-bg: #151d2e;
    --ie-select-option-hover: rgba(59, 130, 246, 0.2);
    --ie-select-option-selected: rgba(59, 130, 246, 0.32);
    --ie-select-chevron: #94a3b8;

    --ie-warning-soft-bg: rgba(255, 193, 7, 0.12);
    --ie-danger-soft-bg: rgba(220, 53, 69, 0.12);

    --ie-aside-chevron-color: #94a3b8;
    --ie-aside-chevron-bg-hover: rgba(94, 176, 255, 0.16);
    --ie-aside-chevron-border-hover: rgba(94, 176, 255, 0.32);
    --ie-aside-chevron-color-hover: #bfdbfe;
    --ie-aside-chevron-bg-open: rgba(59, 130, 246, 0.28);
    --ie-aside-chevron-border-open: rgba(94, 176, 255, 0.42);
    --ie-aside-chevron-color-open: #e0f0ff;
    --ie-aside-treeview-bg: rgba(8, 14, 28, 0.55);
    --ie-aside-treeview-border: rgba(94, 176, 255, 0.28);
    --ie-aside-treeview-text: #9fb0c9;

    /* Paneles / filtros embebidos en vistas admin */
    --ie-filter-panel-bg: #1a2438;
    --ie-filter-label: #94a3b8;
    --ie-stat-bg: #121a2b;
    --ie-stat-border: rgba(148, 163, 184, 0.16);
    --ie-stat-label: #8b9cb5;
    --ie-stat-value: #eef2f8;
    --ie-meta-box-bg: #1a2438;
    --ie-table-row-hover: rgba(59, 130, 246, 0.1);
    --ie-panel-header-bg: #1a2438;
    --ie-panel-header-text: #eef2f8;
    --ie-chip-bg: #222e47;
    --ie-chip-text: #cbd5e1;
    --ie-chip-border: rgba(148, 163, 184, 0.22);
    --ie-empty-bg: #121a2b;
    --ie-empty-border: rgba(148, 163, 184, 0.28);
    --ie-table-shell-bg: #121a2b;
    --ie-toolbar-bg: #1a2438;
    --ie-tag-bg: rgba(148, 163, 184, 0.14);
    --ie-tag-text: #cbd5e1;
    --ie-strip-bg: linear-gradient(135deg, #1a2438 0%, #121a2b 100%);
    --ie-tab-muted: #8b9cb5;
    --ie-tab-active: #93c5fd;
    --ie-progress-track: rgba(148, 163, 184, 0.18);
    --ie-section-header-bg: #1a2438;

    /* Tablas — paleta unificada */
    --ie-table-header-bg: #1a2438;
    --ie-table-header-text: #c8d4e6;
    --ie-table-row-bg: #121a2b;
    --ie-table-row-even: #121a2b;
    --ie-table-stripe: #1a2438;
    --ie-table-hover: rgba(59, 130, 246, 0.12);
    --ie-table-selected: rgba(59, 130, 246, 0.16);
    --ie-table-secondary-bg: var(--ie-table-row-even);
    --ie-table-secondary-text: #7d8fa8;
    --ie-table-warning-bg: rgba(255, 193, 7, 0.14);
    --ie-table-warning-text: #fcd34d;
    --ie-table-success-bg: rgba(40, 167, 69, 0.14);
    --ie-table-success-text: #86efac;
    --ie-table-danger-bg: rgba(220, 53, 69, 0.14);
    --ie-table-danger-text: #fca5a5;
    --ie-table-info-bg: rgba(23, 162, 184, 0.14);
    --ie-table-info-text: #67e8f9;
    --ie-table-primary-bg: rgba(59, 130, 246, 0.14);
    --ie-table-primary-text: #93c5fd;
    --ie-table-active-bg: rgba(59, 130, 246, 0.18);
    --ie-table-active-text: #eef2f8;
    --ie-table-checkbox-size: 14px;
    --ie-table-checkbox-border: rgba(148, 163, 184, 0.5);
    --ie-table-checkbox-bg: #0f1729;
    --ie-table-checkbox-checked-bg: #2563eb;
    --ie-table-checkbox-checked-border: #3b82f6;
    --ie-table-checkbox-check: #f8fafc;
}

/* Utilidades compartidas entre vistas admin */
.ie-section-accent {
    width: 4px;
    height: 24px;
    background: var(--ie-ciclo-num-bg, linear-gradient(135deg, #343a40, #495057));
    border-radius: 2px;
    margin-right: 10px;
    flex-shrink: 0;
}

.ie-section-title-text {
    color: var(--ie-panel-header-text, #343a40);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
}

.opacity-75 {
    opacity: 0.75;
}

.ie-pensum-collapse-header {
    cursor: pointer;
    background: var(--ie-ciclo-header-bg, linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%));
    border-bottom: 2px solid var(--ie-border, #dee2e6);
}

.ie-pensum-header {
    background: var(--ie-pensum-header-bg, linear-gradient(135deg, #343a40 0%, #212529 100%));
}

.ie-pensum-header-edit {
    background: var(--ie-pensum-header-edit-bg, linear-gradient(135deg, #1a237e 0%, #283593 100%));
}

.ie-pensum-section-card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ie-pensum-section-card .card-header {
    background: var(--ie-panel-header-bg, #f8f9fa);
    border-bottom: 2px solid var(--ie-border, #e9ecef);
    padding: 0.75rem 1.25rem;
}

.ie-pensum-section-card .card-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--ie-filter-label, #495057);
}

.ie-pensum-ciclo-badge {
    display: inline-flex;
    align-items: center;
    background: var(--ie-ciclo-num-bg, linear-gradient(135deg, #343a40 0%, #495057 100%));
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.95rem;
}

.ie-pensum-progress-bar {
    height: 8px;
    border-radius: 4px;
}

.ie-pensum-stat-box {
    background: var(--ie-filter-panel-bg, #f8f9fa);
    border: 1px solid var(--ie-border, #e9ecef);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: center;
}

.ie-pensum-stat-box .stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ie-text, #212529);
}

.ie-pensum-stat-box .stat-label {
    font-size: 0.75rem;
    color: var(--ie-text-muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ie-pensum-form-actions {
    border-top: 2px solid var(--ie-border, #e9ecef);
    background: var(--ie-filter-panel-bg, #f8f9fa);
    padding: 1rem 1.25rem;
    border-radius: 0 0 8px 8px;
}

/* Página y formulario de pensum */
.ie-pensum-page-header {
    padding: 0.25rem 0;
}

.ie-pensum-page-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
}

.ie-pensum-form-card {
    border-radius: 12px;
    overflow: hidden;
}

.ie-pensum-form-section {
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--ie-border, #e9ecef);
}

.ie-pensum-form-section--last {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.ie-pensum-form-section__head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0.65rem 0.85rem;
    margin-left: -0.85rem;
    margin-right: -0.85rem;
    border-radius: 8px;
    background: var(--ie-filter-panel-bg, #f8f9fa);
}

.ie-pensum-form-section__num {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: #007bff;
    color: #fff;
}

.ie-pensum-form-section__num--muted {
    background: #e9ecef;
    color: #6c757d;
}

.ie-pensum-field {
    border-radius: 6px;
}

.ie-pensum-field:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.ie-pensum-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.15rem 1.5rem;
    background: #fff;
    border-top: 1px solid var(--ie-border, #e9ecef);
}

.ie-pensum-footer-hint {
    font-size: 0.8125rem;
    color: var(--ie-text-muted, #6c757d);
    flex: 1;
    min-width: 180px;
    line-height: 1.45;
}

.ie-pensum-footer-hint i {
    margin-right: 0.35rem;
    opacity: 0.75;
}

.ie-pensum-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.ie-pensum-btn-cancel {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ie-text-muted, #6c757d);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.ie-pensum-btn-cancel:hover {
    color: var(--ie-text, #212529);
    background: var(--ie-filter-panel-bg, #f8f9fa);
    text-decoration: none;
}

.ie-pensum-btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 42px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
    background: #0d6efd;
    border: 1px solid #0d6efd;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ie-pensum-btn-submit:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    color: #fff;
}

.ie-pensum-btn-submit:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.35);
}

.ie-pensum-btn-submit:active {
    background: #0a58ca;
    border-color: #0a53be;
}

.ie-pensum-btn-submit--continue i:last-child {
    font-size: 0.8rem;
    opacity: 0.9;
}

.ie-pensum-btn-submit--success {
    background: #2d6a4f;
    border-color: #2d6a4f;
}

.ie-pensum-btn-submit--success:hover {
    background: #40916c;
    border-color: #40916c;
}

.ie-pensum-btn-submit--success:focus {
    box-shadow: 0 0 0 0.2rem rgba(45, 106, 79, 0.3);
}

html[data-ie-theme="dark"] .ie-pensum-btn-submit--success {
    background: #2d6a4f !important;
    border-color: #40916c !important;
    color: #d8f3dc !important;
}

html[data-ie-theme="dark"] .ie-pensum-btn-submit--success:hover,
html[data-ie-theme="dark"] .ie-pensum-btn-submit--success:focus {
    background: #40916c !important;
    border-color: #52b788 !important;
    color: #f1faee !important;
    box-shadow: 0 0 0 0.2rem rgba(64, 145, 108, 0.25) !important;
}

.ie-pensum-ciclo-picker select {
    background-color: var(--ie-input-bg, #fff);
    border-color: var(--ie-input-border, #ced4da);
    color: var(--ie-text, #212529);
}

html[data-ie-theme="dark"] .ie-pensum-ciclo-picker select {
    background-color: var(--ie-input-bg);
    border-color: var(--ie-input-border);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .ie-pensum-ciclo-picker select:focus {
    border-color: #40916c;
    box-shadow: 0 0 0 0.15rem rgba(64, 145, 108, 0.25);
}

.ie-optativas-panel .ie-optativas-resumen {
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    font-size: 0.875rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.25);
    color: var(--ie-text, #212529);
}

html[data-ie-theme="dark"] .ie-optativas-panel .ie-optativas-resumen {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.2);
    color: var(--ie-text-muted);
}

.ie-optativas-panel .ie-optativas-switch {
    border-color: var(--ie-border, #dee2e6) !important;
}

.ie-optativas-panel .input-group-text {
    font-size: 0.875rem;
    background: var(--ie-surface-2, #f8f9fa);
    border-color: var(--ie-input-border, #ced4da);
    color: var(--ie-text-muted, #6c757d);
}

html[data-ie-theme="dark"] .ie-optativas-panel .input-group-text {
    background: var(--ie-surface-3);
    border-color: var(--ie-input-border);
    color: var(--ie-text-muted);
}

.ie-materia-form-grid > [class*="col-"] {
    display: flex;
}

.ie-materia-form-grid > [class*="col-"] > .card,
.ie-materia-form-grid .card.flex-fill {
    width: 100%;
}

.ie-materia-form-grid .ie-materia-num-input {
    font-size: 1.05rem;
    font-weight: 600;
    min-height: 42px;
}

.ie-optativas-switch-bar {
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    background: var(--ie-surface-2, rgba(0, 0, 0, 0.03));
    border: 1px solid var(--ie-border, #dee2e6);
    min-height: 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

html[data-ie-theme="dark"] .ie-optativas-switch-bar {
    background: var(--ie-surface-3);
    border-color: var(--ie-border);
}

@media (max-width: 767.98px) {
    .ie-optativas-switch-bar {
        margin-top: 0.5rem;
        min-height: auto;
    }
}

@media (max-width: 575.98px) {
    .ie-pensum-footer-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .ie-pensum-footer-hint {
        min-width: 0;
        text-align: center;
    }

    .ie-pensum-footer-actions {
        width: 100%;
        margin-left: 0;
        justify-content: stretch;
    }

    .ie-pensum-btn-submit {
        flex: 1;
    }
}

.ie-pensum-input-hint {
    font-size: 0.78rem;
    color: var(--ie-text-muted, #6c757d);
    margin-top: 4px;
}

/* Tarjetas por ciclo (pregrado / maestría) */
.ciclo-card {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.ciclo-header {
    background: var(--ie-ciclo-header-bg, linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%));
    border-bottom: 2px solid var(--ie-border, #dee2e6);
    padding: 0.85rem 1.25rem;
}

.ciclo-numero {
    width: 44px;
    height: 44px;
    background: var(--ie-ciclo-num-bg, linear-gradient(135deg, #343a40 0%, #495057 100%));
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.modulos-table thead {
    background-color: var(--ie-panel-header-bg, #f8f9fa);
}

.modulos-table thead th {
    border-top: none;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--ie-text-muted, #6c757d);
    padding: 0.65rem 0.75rem;
}

.modulos-table tbody td {
    vertical-align: middle;
    padding: 0.65rem 0.75rem;
}

.modulos-table tbody tr:hover {
    background-color: var(--ie-table-row-hover, #f8f9fa);
}

.codigo-modulo {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.empty-ciclo {
    background: var(--ie-filter-panel-bg, #f8f9fa);
}

.btn-modulo-accion {
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1.4;
    border-radius: 3px;
}

/* Tablas sin selección masiva (evita checkbox fantasma de DataTables Select) */
.ie-datatable-no-select td.select-checkbox:before,
.ie-datatable-no-select td.select-checkbox:after,
.ie-datatable-no-select th.select-checkbox:before,
.ie-datatable-no-select th.select-checkbox:after {
    display: none !important;
    content: none !important;
}

.ie-datatable-no-select td.select-checkbox,
.ie-datatable-no-select th.select-checkbox {
    pointer-events: none;
}

/* Wizard de pensum */
.ie-pensum-wizard {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 1rem 1.25rem;
    background: var(--ie-filter-panel-bg, #f8f9fa);
    border: 1px solid var(--ie-border, #e9ecef);
    border-radius: 10px;
}

.ie-pensum-wizard-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    text-decoration: none !important;
    color: inherit;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.ie-pensum-wizard-step:not(.is-disabled):hover {
    background: rgba(0, 123, 255, 0.06);
}

.ie-pensum-wizard-step.is-disabled {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.ie-pensum-wizard-step.is-active .step-circle {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.35);
}

.ie-pensum-wizard-step.is-done .step-circle {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: #fff;
}

.ie-pensum-wizard-step .step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
    background: var(--ie-border, #dee2e6);
    color: var(--ie-text-muted, #6c757d);
}

.ie-pensum-wizard-step .step-title {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ie-text, #212529);
}

.ie-pensum-wizard-step .step-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--ie-text-muted, #6c757d);
}

.ie-pensum-wizard-line {
    width: 48px;
    height: 3px;
    background: var(--ie-border, #dee2e6);
    border-radius: 2px;
    flex-shrink: 0;
    margin: 0 0.5rem;
}

.ie-pensum-wizard-line.is-done {
    background: linear-gradient(90deg, #28a745, #20c997);
}

/* Stats mejoradas */
.ie-pensum-stat-box.is-highlight {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.ie-pensum-stat-box .stat-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    opacity: 0.7;
}

/* Tabs formulario materia */
.ie-pensum-form-tabs .nav-link {
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--ie-text-muted, #6c757d);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.65rem 1rem;
}

.ie-pensum-form-tabs .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: transparent;
}

.ie-pensum-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1030;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 123, 255, 0.4);
}

.ie-pensum-table-toolbar {
    background: var(--ie-filter-panel-bg, #f8f9fa);
    border-bottom: 1px solid var(--ie-border, #e9ecef);
    padding: 0.75rem 1rem;
}

.ie-pensum-ciclo-chip {
    cursor: pointer;
    transition: all 0.15s ease;
}

.ie-pensum-ciclo-chip.active,
.ie-pensum-ciclo-chip:hover {
    background: #007bff !important;
    color: #fff !important;
    border-color: #007bff !important;
}

.ie-modulo-cell {
    background-color: var(--ie-info-badge-bg, #e3f2fd) !important;
    color: var(--ie-text, inherit);
}

.ie-row-inactivo {
    background-color: var(--ie-filter-panel-bg, #f8f9fa) !important;
}

.ie-input-readonly-generated {
    background-color: var(--ie-readonly-input-bg, #e9ecef) !important;
    color: var(--ie-text-muted, #6c757d);
}

.info-item-highlight {
    background-color: #e7f3ff;
    border-left: 4px solid #007bff;
}

.info-item {
    align-items: flex-start;
    min-width: 0;
}

.info-item > i {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.info-item > .flex-grow-1 {
    min-width: 0;
    flex: 1 1 auto;
}

.info-item .badge,
.info-item .availability-indicator {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    text-align: left;
    line-height: 1.35;
    vertical-align: top;
}

.hover-card .card-body {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ── Base ─────────────────────────────────────────────────────── */
html[data-ie-theme="dark"] body,
html[data-ie-theme="dark"] .content-wrapper {
    background-color: var(--ie-body-bg) !important;
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .content {
    color: var(--ie-text);
}

html[data-ie-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.ie-aside-logout) {
    color: var(--ie-link);
}

/* ── Header ───────────────────────────────────────────────────── */
html[data-ie-theme="dark"] .main-header.ie-main-header {
    background: var(--ie-header-bg) !important;
    border-bottom: 1px solid var(--ie-header-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 4px 18px var(--ie-shadow);
}

html[data-ie-theme="dark"] .ie-header-toggle {
    background: var(--ie-header-toggle-bg);
    border-color: var(--ie-border);
    color: var(--ie-header-text);
}

html[data-ie-theme="dark"] .ie-header-toggle:hover {
    background: var(--ie-accent-soft);
    border-color: rgba(96, 165, 250, 0.32);
    color: #dbeafe;
}

html[data-ie-theme="dark"] .ie-main-header__title {
    color: var(--ie-header-text);
}

html[data-ie-theme="dark"] .ie-main-header__subtitle,
html[data-ie-theme="dark"] .ie-main-header__actions .nav-link {
    color: var(--ie-header-muted) !important;
}

html[data-ie-theme="dark"] .ie-main-header__logo {
    background: var(--ie-surface-2);
    box-shadow: 0 2px 8px var(--ie-shadow);
}

/* ── Footer ───────────────────────────────────────────────────── */
html[data-ie-theme="dark"] .main-footer {
    background: var(--ie-footer-bg) !important;
    border-top: 1px solid var(--ie-border);
    color: var(--ie-footer-text) !important;
}

/* ── Cards ────────────────────────────────────────────────────── */
html[data-ie-theme="dark"] .content .card {
    background: linear-gradient(180deg, var(--ie-surface) 0%, #10182a 100%);
    border-color: var(--ie-border);
    color: var(--ie-text);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 8px 24px -12px var(--ie-shadow);
}

html[data-ie-theme="dark"] .content .card > .card-header:not(.bg-secondary):not(.bg-dark):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info):not(.bg-primary) {
    background: linear-gradient(180deg, var(--ie-surface-2) 0%, var(--ie-surface) 100%);
    border-bottom-color: var(--ie-border);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .card-body,
html[data-ie-theme="dark"] .card-footer {
    background: var(--ie-surface);
    border-color: var(--ie-border);
    color: var(--ie-text);
}

/* ── Tablas ───────────────────────────────────────────────────── */
html[data-ie-theme="dark"] .table,
html[data-ie-theme="dark"] table.dataTable {
    color: var(--ie-text);
    background-color: transparent;
}

html[data-ie-theme="dark"] .table td,
html[data-ie-theme="dark"] .table th,
html[data-ie-theme="dark"] .table thead th,
html[data-ie-theme="dark"] table.dataTable td,
html[data-ie-theme="dark"] table.dataTable th {
    border-color: var(--ie-border);
    vertical-align: middle;
}

html[data-ie-theme="dark"] .table thead th,
html[data-ie-theme="dark"] table.dataTable thead th,
html[data-ie-theme="dark"] table.dataTable thead td {
    background: linear-gradient(180deg, var(--ie-surface-3) 0%, var(--ie-table-header-bg) 100%) !important;
    color: var(--ie-table-header-text) !important;
    font-weight: 600;
    border-bottom: 1px solid var(--ie-border) !important;
}

/* Reset fondos claros de DataTables / Bootstrap en filas y celdas */
html[data-ie-theme="dark"] table.dataTable tbody tr,
html[data-ie-theme="dark"] table.dataTable tbody tr > td,
html[data-ie-theme="dark"] table.dataTable tbody tr > th,
html[data-ie-theme="dark"] .table tbody tr,
html[data-ie-theme="dark"] .table tbody tr > td,
html[data-ie-theme="dark"] .table tbody tr > th {
    background-color: var(--ie-table-row-bg) !important;
    color: var(--ie-text);
}

/* Filas alternas: Bootstrap table-striped + DataTables stripe/display (.odd) */
html[data-ie-theme="dark"] .table-striped tbody tr:nth-of-type(odd),
html[data-ie-theme="dark"] .table-striped tbody tr:nth-of-type(odd) > td,
html[data-ie-theme="dark"] .table-striped tbody tr:nth-of-type(odd) > th,
html[data-ie-theme="dark"] table.dataTable.stripe tbody tr.odd,
html[data-ie-theme="dark"] table.dataTable.stripe tbody tr.odd > td,
html[data-ie-theme="dark"] table.dataTable.stripe tbody tr.odd > th,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.odd,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.odd > td,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.odd > th,
html[data-ie-theme="dark"] table.dataTable.stripe tbody tr:nth-of-type(odd),
html[data-ie-theme="dark"] table.dataTable.display tbody tr:nth-of-type(odd) {
    background-color: var(--ie-table-stripe) !important;
}

/* Filas pares — tono base alineado con la superficie de la card */
html[data-ie-theme="dark"] .table-striped tbody tr:nth-of-type(even),
html[data-ie-theme="dark"] .table-striped tbody tr:nth-of-type(even) > td,
html[data-ie-theme="dark"] .table-striped tbody tr:nth-of-type(even) > th,
html[data-ie-theme="dark"] table.dataTable.stripe tbody tr.even,
html[data-ie-theme="dark"] table.dataTable.stripe tbody tr.even > td,
html[data-ie-theme="dark"] table.dataTable.stripe tbody tr.even > th,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.even,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.even > td,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.even > th {
    background-color: var(--ie-table-row-even) !important;
}

/* Filas contextuales Bootstrap (p. ej. inactivos con table-secondary) */
html[data-ie-theme="dark"] .table tbody tr.table-secondary,
html[data-ie-theme="dark"] .table tbody tr.table-secondary > td,
html[data-ie-theme="dark"] .table tbody tr.table-secondary > th,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-secondary,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-secondary > td,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-secondary > th,
html[data-ie-theme="dark"] thead.table-secondary th,
html[data-ie-theme="dark"] thead.table-secondary td {
    background-color: var(--ie-table-secondary-bg) !important;
    color: var(--ie-table-secondary-text) !important;
    opacity: 1 !important;
}

html[data-ie-theme="dark"] .table tbody tr.table-warning,
html[data-ie-theme="dark"] .table tbody tr.table-warning > td,
html[data-ie-theme="dark"] .table tbody tr.table-warning > th,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-warning,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-warning > td,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-warning > th {
    background-color: var(--ie-table-warning-bg) !important;
    color: var(--ie-table-warning-text) !important;
}

html[data-ie-theme="dark"] .table tbody tr.table-success,
html[data-ie-theme="dark"] .table tbody tr.table-success > td,
html[data-ie-theme="dark"] .table tbody tr.table-success > th,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-success,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-success > td,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-success > th {
    background-color: var(--ie-table-success-bg) !important;
    color: var(--ie-table-success-text) !important;
}

html[data-ie-theme="dark"] .table tbody tr.table-danger,
html[data-ie-theme="dark"] .table tbody tr.table-danger > td,
html[data-ie-theme="dark"] .table tbody tr.table-danger > th,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-danger,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-danger > td,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-danger > th {
    background-color: var(--ie-table-danger-bg) !important;
    color: var(--ie-table-danger-text) !important;
}

html[data-ie-theme="dark"] .table tbody tr.table-info,
html[data-ie-theme="dark"] .table tbody tr.table-info > td,
html[data-ie-theme="dark"] .table tbody tr.table-info > th,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-info,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-info > td,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-info > th {
    background-color: var(--ie-table-info-bg) !important;
    color: var(--ie-table-info-text) !important;
}

html[data-ie-theme="dark"] .table tbody tr.table-primary,
html[data-ie-theme="dark"] .table tbody tr.table-primary > td,
html[data-ie-theme="dark"] .table tbody tr.table-primary > th,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-primary,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-primary > td,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-primary > th {
    background-color: var(--ie-table-primary-bg) !important;
    color: var(--ie-table-primary-text) !important;
}

html[data-ie-theme="dark"] .table tbody tr.table-active,
html[data-ie-theme="dark"] .table tbody tr.table-active > td,
html[data-ie-theme="dark"] .table tbody tr.table-active > th,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-active,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-active > td,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-active > th {
    background-color: var(--ie-table-active-bg) !important;
    color: var(--ie-table-active-text) !important;
}

html[data-ie-theme="dark"] .table tbody tr.table-light,
html[data-ie-theme="dark"] .table tbody tr.table-light > td,
html[data-ie-theme="dark"] .table tbody tr.table-light > th,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-light,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-light > td,
html[data-ie-theme="dark"] table.dataTable tbody tr.table-light > th,
html[data-ie-theme="dark"] .table thead th.table-light,
html[data-ie-theme="dark"] table.dataTable thead th.table-light {
    background-color: var(--ie-surface-2) !important;
    color: var(--ie-text) !important;
}

/* Celdas de ordenamiento (DataTables order-column / display) */
html[data-ie-theme="dark"] table.dataTable.order-column tbody tr > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.order-column tbody tr > .sorting_2,
html[data-ie-theme="dark"] table.dataTable.order-column tbody tr > .sorting_3,
html[data-ie-theme="dark"] table.dataTable.display tbody tr > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.display tbody tr > .sorting_2,
html[data-ie-theme="dark"] table.dataTable.display tbody tr > .sorting_3,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.odd > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.odd > .sorting_2,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.odd > .sorting_3,
html[data-ie-theme="dark"] table.dataTable.order-column.stripe tbody tr.odd > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.order-column.stripe tbody tr.odd > .sorting_2,
html[data-ie-theme="dark"] table.dataTable.order-column.stripe tbody tr.odd > .sorting_3,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.even > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.even > .sorting_2,
html[data-ie-theme="dark"] table.dataTable.display tbody tr.even > .sorting_3,
html[data-ie-theme="dark"] table.dataTable.order-column.stripe tbody tr.even > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.order-column.stripe tbody tr.even > .sorting_2,
html[data-ie-theme="dark"] table.dataTable.order-column.stripe tbody tr.even > .sorting_3 {
    background-color: transparent !important;
}

html[data-ie-theme="dark"] .table-hover tbody tr:hover,
html[data-ie-theme="dark"] .table-hover tbody tr:hover > td,
html[data-ie-theme="dark"] .table-hover tbody tr:hover > th,
html[data-ie-theme="dark"] table.dataTable.hover tbody tr:hover,
html[data-ie-theme="dark"] table.dataTable.hover tbody tr:hover > td,
html[data-ie-theme="dark"] table.dataTable.hover tbody tr:hover > th,
html[data-ie-theme="dark"] table.dataTable.display tbody tr:hover,
html[data-ie-theme="dark"] table.dataTable.display tbody tr:hover > td,
html[data-ie-theme="dark"] table.dataTable.display tbody tr:hover > th {
    background-color: var(--ie-table-hover) !important;
    color: var(--ie-text);
}

/* Filas seleccionadas (DataTables Select) */
html[data-ie-theme="dark"] table.dataTable tbody > tr.selected,
html[data-ie-theme="dark"] table.dataTable tbody > tr > .selected,
html[data-ie-theme="dark"] table.dataTable.stripe tbody > tr.odd.selected,
html[data-ie-theme="dark"] table.dataTable.display tbody > tr.odd.selected,
html[data-ie-theme="dark"] table.dataTable.hover tbody > tr.selected:hover,
html[data-ie-theme="dark"] table.dataTable.display tbody > tr.selected:hover,
html[data-ie-theme="dark"] table.dataTable.order-column tbody > tr.selected > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.order-column tbody > tr.selected > .sorting_2,
html[data-ie-theme="dark"] table.dataTable.order-column tbody > tr.selected > .sorting_3,
html[data-ie-theme="dark"] table.dataTable.display tbody > tr.selected > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.display tbody > tr.selected > .sorting_2,
html[data-ie-theme="dark"] table.dataTable.display tbody > tr.selected > .sorting_3,
html[data-ie-theme="dark"] table.dataTable.display tbody > tr.odd.selected > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.order-column.stripe tbody > tr.odd.selected > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.display tbody > tr.even.selected > .sorting_1,
html[data-ie-theme="dark"] table.dataTable.order-column.stripe tbody > tr.even.selected > .sorting_1 {
    background-color: var(--ie-table-selected) !important;
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] table.dataTable tbody > tr.selected a,
html[data-ie-theme="dark"] table.dataTable tbody > tr.selected i {
    color: inherit;
}

html[data-ie-theme="dark"] .thead-light th {
    background: linear-gradient(180deg, var(--ie-surface-3) 0%, var(--ie-table-header-bg) 100%) !important;
    color: var(--ie-table-header-text) !important;
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] table.dataTable thead th {
    border-bottom-color: var(--ie-border);
}

/* Iconos de ordenamiento DataTables */
html[data-ie-theme="dark"] table.dataTable thead .sorting:before,
html[data-ie-theme="dark"] table.dataTable thead .sorting:after,
html[data-ie-theme="dark"] table.dataTable thead .sorting_asc:before,
html[data-ie-theme="dark"] table.dataTable thead .sorting_asc:after,
html[data-ie-theme="dark"] table.dataTable thead .sorting_desc:before,
html[data-ie-theme="dark"] table.dataTable thead .sorting_desc:after {
    color: #64748b !important;
    opacity: 0.85;
}

html[data-ie-theme="dark"] table.dataTable thead .sorting_asc:before,
html[data-ie-theme="dark"] table.dataTable thead .sorting_desc:after {
    color: #93c5fd !important;
    opacity: 1;
}

html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_length,
html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_filter,
html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_info,
html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_paginate {
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--ie-text) !important;
    background: var(--ie-surface) !important;
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--ie-accent) !important;
    border-color: var(--ie-accent) !important;
    color: #f8fafc !important;
    box-shadow: 0 2px 8px var(--ie-accent-glow);
}

html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--ie-surface-2) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background: var(--ie-surface-2) !important;
    border-color: var(--ie-border) !important;
    color: var(--ie-text-muted) !important;
    opacity: 0.55;
}

html[data-ie-theme="dark"] .dataTables_wrapper.no-footer .dataTables_scrollBody {
    border-bottom-color: var(--ie-border);
}

html[data-ie-theme="dark"] .table-responsive {
    background: transparent;
}

/* Checkboxes DataTables Select */
html[data-ie-theme="dark"] table.dataTable tbody td.select-checkbox,
html[data-ie-theme="dark"] table.dataTable tbody th.select-checkbox {
    position: relative;
}

html[data-ie-theme="dark"] table.dataTable tbody td.select-checkbox:before,
html[data-ie-theme="dark"] table.dataTable tbody th.select-checkbox:before,
html[data-ie-theme="dark"] table.dataTable tbody td.select-checkbox:after,
html[data-ie-theme="dark"] table.dataTable tbody th.select-checkbox:after {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--ie-table-checkbox-size);
    height: var(--ie-table-checkbox-size);
    box-sizing: border-box;
    margin-top: calc(var(--ie-table-checkbox-size) / -2);
    margin-left: calc(var(--ie-table-checkbox-size) / -2);
}

html[data-ie-theme="dark"] table.dataTable tbody td.select-checkbox:before,
html[data-ie-theme="dark"] table.dataTable tbody th.select-checkbox:before {
    content: ' ';
    border: 1.5px solid var(--ie-table-checkbox-border);
    border-radius: 4px;
    background: var(--ie-table-checkbox-bg);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

html[data-ie-theme="dark"] table.dataTable tbody tr:hover td.select-checkbox:before,
html[data-ie-theme="dark"] table.dataTable tbody tr:hover th.select-checkbox:before {
    border-color: rgba(148, 163, 184, 0.65);
}

html[data-ie-theme="dark"] table.dataTable tr.selected td.select-checkbox:before,
html[data-ie-theme="dark"] table.dataTable tr.selected th.select-checkbox:before {
    background: var(--ie-table-checkbox-checked-bg);
    border-color: var(--ie-table-checkbox-checked-border);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

html[data-ie-theme="dark"] table.dataTable tr.selected td.select-checkbox:after,
html[data-ie-theme="dark"] table.dataTable tr.selected th.select-checkbox:after {
    content: '\2714';
    margin-top: calc(var(--ie-table-checkbox-size) / -2 - 1px);
    margin-left: calc(var(--ie-table-checkbox-size) / -2 + 1px);
    width: var(--ie-table-checkbox-size);
    height: var(--ie-table-checkbox-size);
    line-height: var(--ie-table-checkbox-size);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    color: var(--ie-table-checkbox-check);
    text-shadow: none;
}

/* Checkboxes nativos y Bootstrap */
html[data-ie-theme="dark"] input[type="checkbox"],
html[data-ie-theme="dark"] input[type="radio"] {
    accent-color: var(--ie-accent);
}

html[data-ie-theme="dark"] .custom-control-input ~ .custom-control-label::before {
    background-color: var(--ie-table-checkbox-bg);
    border: 1.5px solid var(--ie-table-checkbox-border);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

html[data-ie-theme="dark"] .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px var(--ie-accent-soft);
    border-color: var(--ie-accent);
}

html[data-ie-theme="dark"] .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--ie-table-checkbox-checked-bg);
    border-color: var(--ie-table-checkbox-checked-border);
}

html[data-ie-theme="dark"] .custom-control-input:disabled ~ .custom-control-label::before {
    background-color: var(--ie-surface-2);
    border-color: var(--ie-border);
    opacity: 0.6;
}

html[data-ie-theme="dark"] .form-check-input {
    background-color: var(--ie-table-checkbox-bg);
    border: 1.5px solid var(--ie-table-checkbox-border);
}

html[data-ie-theme="dark"] .form-check-input:checked {
    background-color: var(--ie-table-checkbox-checked-bg);
    border-color: var(--ie-table-checkbox-checked-border);
}

html[data-ie-theme="dark"] .form-check-input:focus {
    border-color: var(--ie-accent);
    box-shadow: 0 0 0 3px var(--ie-accent-soft);
}

/* Badges en tablas — tonos suaves coherentes */
html[data-ie-theme="dark"] .badge {
    font-weight: 600;
    letter-spacing: 0.01em;
}

html[data-ie-theme="dark"] .badge-primary {
    background: rgba(59, 130, 246, 0.22) !important;
    color: #bfdbfe !important;
    border: 1px solid rgba(96, 165, 250, 0.35);
}

html[data-ie-theme="dark"] .badge-secondary {
    background: rgba(148, 163, 184, 0.16) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(148, 163, 184, 0.28);
}

html[data-ie-theme="dark"] .badge-success {
    background: rgba(34, 197, 94, 0.18) !important;
    color: #86efac !important;
    border: 1px solid rgba(74, 222, 128, 0.32);
}

html[data-ie-theme="dark"] .badge-info {
    background: rgba(14, 165, 233, 0.2) !important;
    color: #7dd3fc !important;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

html[data-ie-theme="dark"] .badge-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

html[data-ie-theme="dark"] .badge-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

html[data-ie-theme="dark"] .badge-dark {
    background: rgba(15, 23, 42, 0.65) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

/* Botones de acción en tablas */
html[data-ie-theme="dark"] .table .btn-xs,
html[data-ie-theme="dark"] table.dataTable .btn-xs {
    border-radius: 6px;
    min-width: 26px;
}

html[data-ie-theme="dark"] .table .btn-warning,
html[data-ie-theme="dark"] table.dataTable .btn-warning {
    background: rgba(245, 158, 11, 0.88);
    border-color: rgba(251, 191, 36, 0.45);
    color: #1e293b;
}

html[data-ie-theme="dark"] .table .btn-warning:hover,
html[data-ie-theme="dark"] table.dataTable .btn-warning:hover {
    background: #fbbf24;
    border-color: #f59e0b;
    color: #0f172a;
}

html[data-ie-theme="dark"] .table .btn-info,
html[data-ie-theme="dark"] table.dataTable .btn-info {
    background: rgba(59, 130, 246, 0.85);
    border-color: rgba(96, 165, 250, 0.4);
    color: #f8fafc;
}

html[data-ie-theme="dark"] .table .btn-success,
html[data-ie-theme="dark"] table.dataTable .btn-success {
    background: rgba(34, 197, 94, 0.85);
    border-color: rgba(74, 222, 128, 0.4);
    color: #f0fdf4;
}

html[data-ie-theme="dark"] .table .btn-danger,
html[data-ie-theme="dark"] table.dataTable .btn-danger {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fef2f2;
}

/* Toolbar DataTables */
html[data-ie-theme="dark"] .dt-buttons {
    margin-bottom: 0.5rem;
}

html[data-ie-theme="dark"] .dt-buttons .btn {
    margin-right: 0.3rem;
    margin-bottom: 0.3rem;
    border-radius: 7px !important;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.38rem 0.72rem;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

html[data-ie-theme="dark"] .dt-buttons .btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-color: rgba(96, 165, 250, 0.45);
    color: #f8fafc;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

html[data-ie-theme="dark"] .dt-buttons .btn-primary:hover,
html[data-ie-theme="dark"] .dt-buttons .btn-primary:focus {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    border-color: rgba(147, 197, 253, 0.5);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

html[data-ie-theme="dark"] .dt-buttons .btn-primary + .btn-primary {
    background: var(--ie-surface-2);
    border-color: rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    box-shadow: none;
}

html[data-ie-theme="dark"] .dt-buttons .btn-primary + .btn-primary:hover {
    background: var(--ie-surface-3);
    border-color: rgba(148, 163, 184, 0.42);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .btn-primary {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-color: rgba(96, 165, 250, 0.45);
    color: #f8fafc;
}

html[data-ie-theme="dark"] .btn-primary:hover,
html[data-ie-theme="dark"] .btn-primary:focus {
    background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    border-color: rgba(147, 197, 253, 0.5);
    color: #fff;
}

/* Botones semánticos — contraste legible fuera de tablas también */
html[data-ie-theme="dark"] .btn-warning {
    background: #f59e0b !important;
    border-color: #d97706 !important;
    color: #1e293b !important;
}

html[data-ie-theme="dark"] .btn-warning:hover,
html[data-ie-theme="dark"] .btn-warning:focus {
    background: #fbbf24 !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
}

html[data-ie-theme="dark"] .btn-success {
    background: #16a34a !important;
    border-color: #15803d !important;
    color: #f0fdf4 !important;
}

html[data-ie-theme="dark"] .btn-success:hover,
html[data-ie-theme="dark"] .btn-success:focus {
    background: #22c55e !important;
    border-color: #16a34a !important;
    color: #fff !important;
}

html[data-ie-theme="dark"] .btn-info {
    background: #0891b2 !important;
    border-color: #0e7490 !important;
    color: #ecfeff !important;
}

html[data-ie-theme="dark"] .btn-info:hover,
html[data-ie-theme="dark"] .btn-info:focus {
    background: #06b6d4 !important;
    border-color: #0891b2 !important;
    color: #fff !important;
}

html[data-ie-theme="dark"] .btn-danger {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #fef2f2 !important;
}

html[data-ie-theme="dark"] .btn-danger:hover,
html[data-ie-theme="dark"] .btn-danger:focus {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
}

html[data-ie-theme="dark"] .btn-outline-warning {
    color: #fcd34d !important;
    border-color: rgba(251, 191, 36, 0.55) !important;
    background: transparent !important;
}

html[data-ie-theme="dark"] .btn-outline-warning:hover,
html[data-ie-theme="dark"] .btn-outline-warning:focus {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: #fbbf24 !important;
    color: #fde68a !important;
}

html[data-ie-theme="dark"] .btn-outline-success {
    color: #86efac !important;
    border-color: rgba(74, 222, 128, 0.45) !important;
    background: transparent !important;
}

html[data-ie-theme="dark"] .btn-outline-success:hover,
html[data-ie-theme="dark"] .btn-outline-success:focus {
    background: rgba(34, 197, 94, 0.16) !important;
    border-color: #4ade80 !important;
    color: #bbf7d0 !important;
}

html[data-ie-theme="dark"] .btn-outline-danger {
    color: #fca5a5 !important;
    border-color: rgba(248, 113, 113, 0.45) !important;
    background: transparent !important;
}

html[data-ie-theme="dark"] .btn-outline-danger:hover,
html[data-ie-theme="dark"] .btn-outline-danger:focus {
    background: rgba(239, 68, 68, 0.16) !important;
    border-color: #f87171 !important;
    color: #fecaca !important;
}

html[data-ie-theme="dark"] .btn-outline-info {
    color: #7dd3fc !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
    background: transparent !important;
}

html[data-ie-theme="dark"] .btn-outline-info:hover,
html[data-ie-theme="dark"] .btn-outline-info:focus {
    background: rgba(59, 130, 246, 0.16) !important;
    border-color: #38bdf8 !important;
    color: #bae6fd !important;
}

html[data-ie-theme="dark"] .btn-outline-primary {
    color: #93c5fd !important;
    border-color: rgba(96, 165, 250, 0.45) !important;
    background: transparent !important;
}

html[data-ie-theme="dark"] .btn-outline-primary:hover,
html[data-ie-theme="dark"] .btn-outline-primary:focus {
    background: rgba(59, 130, 246, 0.16) !important;
    border-color: #60a5fa !important;
    color: #dbeafe !important;
}

/* Badges personalizados en tarjetas de inscripción */
html[data-ie-theme="dark"] .badge-warning-custom {
    background: #f59e0b !important;
    color: #1e293b !important;
}

html[data-ie-theme="dark"] .badge-success-custom {
    background: #16a34a !important;
    color: #f0fdf4 !important;
}

html[data-ie-theme="dark"] .badge-danger-custom {
    background: #dc2626 !important;
    color: #fef2f2 !important;
}

html[data-ie-theme="dark"] .badge-info-custom {
    background: #0891b2 !important;
    color: #ecfeff !important;
}

html[data-ie-theme="dark"] .badge-primary-custom {
    background: #2563eb !important;
    color: #eff6ff !important;
}

html[data-ie-theme="dark"] .badge-secondary-custom {
    background: #475569 !important;
    color: #f1f5f9 !important;
}

/* ── Formularios ──────────────────────────────────────────────── */
html[data-ie-theme="dark"] .form-control,
html[data-ie-theme="dark"] .custom-file-label {
    background-color: var(--ie-input-bg);
    border-color: var(--ie-input-border);
    color: var(--ie-text);
}

/* Combobox nativos — alineados con paneles/filtros (--ie-surface-2) */
html[data-ie-theme="dark"] select.form-control,
html[data-ie-theme="dark"] select.custom-select,
html[data-ie-theme="dark"] .custom-select {
    background-color: var(--ie-select-bg);
    border-color: var(--ie-select-border);
    color: var(--ie-select-text);
}

html[data-ie-theme="dark"] select.form-control:not([multiple]):not([size]),
html[data-ie-theme="dark"] select.custom-select:not([multiple]):not([size]),
html[data-ie-theme="dark"] .custom-select:not([multiple]):not([size]) {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 14px 10px;
    padding-right: 2.1rem;
}

html[data-ie-theme="dark"] select.form-control:hover,
html[data-ie-theme="dark"] select.custom-select:hover,
html[data-ie-theme="dark"] .custom-select:hover {
    background-color: var(--ie-select-bg-hover);
    border-color: var(--ie-select-border-hover);
}

html[data-ie-theme="dark"] select.form-control option,
html[data-ie-theme="dark"] select.custom-select option,
html[data-ie-theme="dark"] .custom-select option {
    background-color: var(--ie-select-option-bg);
    color: var(--ie-select-text);
}

html[data-ie-theme="dark"] .form-control:focus,
html[data-ie-theme="dark"] .custom-select:focus {
    background-color: var(--ie-input-bg);
    border-color: var(--ie-accent);
    color: var(--ie-text);
    box-shadow: 0 0 0 3px var(--ie-accent-soft);
}

html[data-ie-theme="dark"] select.form-control:focus,
html[data-ie-theme="dark"] select.custom-select:focus,
html[data-ie-theme="dark"] .custom-select:focus {
    background-color: var(--ie-select-bg-focus);
    border-color: var(--ie-accent);
    color: var(--ie-select-text);
    box-shadow: 0 0 0 3px var(--ie-accent-soft);
}

html[data-ie-theme="dark"] select.form-control:disabled,
html[data-ie-theme="dark"] select.custom-select:disabled,
html[data-ie-theme="dark"] .custom-select:disabled {
    background-color: var(--ie-surface);
    border-color: var(--ie-border);
    color: var(--ie-select-muted);
    opacity: 0.85;
}

html[data-ie-theme="dark"] .form-control::placeholder {
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] .form-control:disabled,
html[data-ie-theme="dark"] .form-control[readonly] {
    background-color: var(--ie-surface-2);
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] .input-group-text {
    background: var(--ie-surface-2);
    border-color: var(--ie-input-border);
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] label,
html[data-ie-theme="dark"] .col-form-label {
    color: var(--ie-text);
}

/* ── Select2 ──────────────────────────────────────────────────── */
html[data-ie-theme="dark"] .select2-container--default .select2-selection--single,
html[data-ie-theme="dark"] .select2-container--default .select2-selection--multiple,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--single,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--multiple {
    background-color: var(--ie-select-bg) !important;
    border-color: var(--ie-select-border) !important;
    color: var(--ie-select-text);
    min-height: calc(1.5em + 0.75rem + 2px);
}

html[data-ie-theme="dark"] .select2-container--default .select2-selection--single:hover,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--single:hover,
html[data-ie-theme="dark"] .select2-container--default.select2-container--focus .select2-selection--single,
html[data-ie-theme="dark"] .select2-container--bootstrap4.select2-container--focus .select2-selection--single {
    background-color: var(--ie-select-bg-hover) !important;
    border-color: var(--ie-select-border-hover) !important;
}

html[data-ie-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    color: var(--ie-select-text) !important;
}

html[data-ie-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    color: var(--ie-select-muted) !important;
}

html[data-ie-theme="dark"] .select2-dropdown,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-dropdown {
    background-color: var(--ie-select-dropdown-bg) !important;
    border-color: var(--ie-select-border) !important;
    box-shadow: 0 10px 28px var(--ie-shadow);
}

html[data-ie-theme="dark"] .select2-container--default .select2-results__option,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-results__option {
    color: var(--ie-select-text);
    background-color: transparent;
}

html[data-ie-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--ie-select-option-hover) !important;
    color: var(--ie-select-text) !important;
}

html[data-ie-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"],
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-results__option[aria-selected="true"] {
    background-color: var(--ie-select-option-selected) !important;
    color: #e0f0ff !important;
}

html[data-ie-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-search--dropdown .select2-search__field {
    background: var(--ie-input-bg);
    border-color: var(--ie-input-border);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    background: var(--ie-surface-3) !important;
    border-color: var(--ie-select-border) !important;
    color: var(--ie-select-text) !important;
}

html[data-ie-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--ie-select-muted) !important;
}

html[data-ie-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fca5a5 !important;
}

/* Select2 multiple: campo de búsqueda inline sin cuadrito visible */
.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field,
.select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    margin-top: 0;
    padding: 0 4px;
    min-width: 6em;
    height: calc(1.5em + 2px);
}

html[data-ie-theme="dark"] .select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--multiple .select2-search--inline .select2-search__field {
    background: transparent !important;
    color: var(--ie-select-text);
}

/* Select2 multiple vacío: un solo placeholder, sin texto duplicado */
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    min-height: calc(1.5em + 0.5rem);
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__placeholder {
    color: #6c757d;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--multiple .select2-selection__placeholder {
    color: var(--ie-select-muted) !important;
}

.select2-container--bootstrap4 .select2-selection--multiple:not(.select2-selection--clearable) .select2-search--inline .select2-search__field {
    width: 100% !important;
    margin: 0;
    padding: 0;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    margin: 2px 0;
    padding: 2px 8px;
    font-size: 0.875rem;
    border-radius: 4px;
}

.select2-container--bootstrap4 .select2-selection--single {
    height: calc(1.5em + 0.75rem + 2px) !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.5em + 0.75rem);
    padding-left: 0.75rem;
    padding-right: 2rem;
}

.select2-container--bootstrap4 .select2-selection--multiple {
    min-height: calc(1.5em + 0.75rem + 2px);
    border-radius: 0.25rem;
}

.ie-pensum-section-card .select2-container {
    font-size: 0.9375rem;
}

/* ── Modales ──────────────────────────────────────────────────── */
html[data-ie-theme="dark"] .modal-content {
    background: var(--ie-surface);
    border-color: var(--ie-border);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .modal-header,
html[data-ie-theme="dark"] .modal-footer {
    border-color: var(--ie-border);
}

html[data-ie-theme="dark"] .modal-body.bg-light,
html[data-ie-theme="dark"] .modal-footer.bg-light,
html[data-ie-theme="dark"] .modal-body:not(.bg-dark):not(.bg-primary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info) {
    background: var(--ie-surface) !important;
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .close {
    color: var(--ie-text);
    text-shadow: none;
    opacity: 0.75;
}

/* ── Dropdowns ────────────────────────────────────────────────── */
html[data-ie-theme="dark"] .dropdown-menu {
    background: var(--ie-dropdown-bg);
    border-color: var(--ie-border);
    box-shadow: 0 12px 32px -12px var(--ie-shadow);
}

html[data-ie-theme="dark"] .dropdown-menu.ie-theme-panel {
    background: var(--ie-dropdown-bg, #151d2e) !important;
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] .dropdown-item {
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .dropdown-item:hover,
html[data-ie-theme="dark"] .dropdown-item:focus {
    background: var(--ie-dropdown-hover);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .dropdown-divider {
    border-color: var(--ie-border);
}

/* ── Utilidades Bootstrap ─────────────────────────────────────── */
html[data-ie-theme="dark"] .bg-light {
    background-color: var(--ie-surface-2) !important;
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] .bg-white {
    background-color: var(--ie-surface) !important;
    color: var(--ie-text) !important;
}

/* ── Paneles de filtro, stats y bloques embebidos (vistas admin) ─ */
html[data-ie-theme="dark"] .bitacora-filters,
html[data-ie-theme="dark"] .bitacora-meta-box,
html[data-ie-theme="dark"] .diff-table th {
    background: var(--ie-filter-panel-bg) !important;
    border: 1px solid var(--ie-border);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .bitacora-filters label,
html[data-ie-theme="dark"] .ie-filter-panel label {
    color: var(--ie-filter-label) !important;
}

html[data-ie-theme="dark"] .bitacora-stat,
html[data-ie-theme="dark"] .content .card.bitacora-stat {
    background: var(--ie-stat-bg) !important;
    border-color: var(--ie-stat-border) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

html[data-ie-theme="dark"] .bitacora-stat:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
    border-color: rgba(148, 163, 184, 0.28) !important;
}

html[data-ie-theme="dark"] .bitacora-stat .stat-label {
    color: var(--ie-stat-label) !important;
}

html[data-ie-theme="dark"] .bitacora-stat .stat-value {
    color: var(--ie-stat-value) !important;
}

html[data-ie-theme="dark"] .bitacora-stat.active {
    border-color: #60a5fa !important;
    box-shadow:
        0 0 0 1px #60a5fa,
        0 4px 16px rgba(59, 130, 246, 0.2) !important;
}

html[data-ie-theme="dark"] .bitacora-table thead th {
    color: var(--ie-text-muted) !important;
    background: var(--ie-surface-2) !important;
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] .bitacora-table tbody tr:hover {
    background-color: var(--ie-table-row-hover) !important;
}

html[data-ie-theme="dark"] .bitacora-empty {
    color: var(--ie-text-muted) !important;
}

html[data-ie-theme="dark"] .bitacora-meta-box small {
    color: var(--ie-text-muted) !important;
}

html[data-ie-theme="dark"] .bitacora-meta-box strong {
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] .diff-old {
    color: #fca5a5 !important;
}

html[data-ie-theme="dark"] .diff-new {
    color: #86efac !important;
}

html[data-ie-theme="dark"] .diff-table td {
    border-color: var(--ie-border);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .stat-card.bg-light,
html[data-ie-theme="dark"] .card.stat-card {
    background: var(--ie-surface) !important;
    border-color: var(--ie-border) !important;
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .input-group-text.bg-white {
    background: var(--ie-surface-2) !important;
    border-color: var(--ie-input-border) !important;
    color: var(--ie-text-muted) !important;
}

html[data-ie-theme="dark"] .card-header.bg-white,
html[data-ie-theme="dark"] .card-footer.bg-white {
    background: var(--ie-surface-2) !important;
    color: var(--ie-text) !important;
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] .ie-filter-panel {
    background: var(--ie-filter-panel-bg) !important;
    border: 1px solid var(--ie-border) !important;
    border-radius: 8px;
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .modal-body.bg-light,
html[data-ie-theme="dark"] .modal-footer.bg-light {
    background: var(--ie-surface) !important;
    color: var(--ie-text);
    border-color: var(--ie-border);
}

html[data-ie-theme="dark"] tr.bg-light,
html[data-ie-theme="dark"] tr.bg-light td,
html[data-ie-theme="dark"] tr.bg-light th {
    background-color: var(--ie-surface-2) !important;
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] .card.border-0.bg-light {
    background: var(--ie-surface-2) !important;
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .card-header.bg-light {
    background: var(--ie-surface-2) !important;
    color: var(--ie-text) !important;
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] .text-dark:not(.btn):not(.badge) {
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] .text-muted {
    color: var(--ie-text-muted) !important;
}

html[data-ie-theme="dark"] .border,
html[data-ie-theme="dark"] .border-top,
html[data-ie-theme="dark"] .border-bottom,
html[data-ie-theme="dark"] .border-left,
html[data-ie-theme="dark"] .border-right {
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] .badge-light {
    background: rgba(148, 163, 184, 0.12) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
}

html[data-ie-theme="dark"] pre.bg-light {
    background: var(--ie-surface-2) !important;
    color: var(--ie-text) !important;
    border: 1px solid var(--ie-border);
}

html[data-ie-theme="dark"] .list-group-item {
    background: var(--ie-surface);
    border-color: var(--ie-border);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .nav-tabs {
    border-color: var(--ie-border);
}

html[data-ie-theme="dark"] .nav-tabs .nav-link {
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] .nav-tabs .nav-link.active {
    background: var(--ie-surface);
    border-color: var(--ie-border) var(--ie-border) var(--ie-surface);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .page-item.disabled .page-link {
    background: var(--ie-surface-2);
    border-color: var(--ie-border);
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] .page-link {
    background: var(--ie-surface);
    border-color: var(--ie-border);
    color: var(--ie-link);
}

html[data-ie-theme="dark"] .page-item.active .page-link {
    background: var(--ie-accent);
    border-color: var(--ie-accent);
    box-shadow: 0 4px 14px var(--ie-accent-glow);
}

/* ── Alertas (mantener colores semánticos, ajustar contraste) ── */
html[data-ie-theme="dark"] .alert-light {
    background: var(--ie-surface-2) !important;
    border-color: var(--ie-border) !important;
    color: var(--ie-text) !important;
}

/* ── Login ────────────────────────────────────────────────────── */
html[data-ie-theme="dark"] body.login-page {
    background: var(--ie-body-bg) !important;
}

html[data-ie-theme="dark"] .login-box .card {
    background: var(--ie-surface);
    border-color: var(--ie-border);
}

html[data-ie-theme="dark"] .login-card-body {
    background: var(--ie-surface);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .login-logo a {
    color: var(--ie-header-text);
}

html[data-ie-theme="dark"] .login-box-msg {
    color: var(--ie-text-muted);
}

/* ── Sidebar modo oscuro (completo) ───────────────────────────── */
html[data-ie-theme="dark"] .main-sidebar.ie-app-sidebar {
    background-image:
        radial-gradient(ellipse 130% 90% at 100% 0%, rgba(94, 176, 255, 0.1) 0%, transparent 58%),
        radial-gradient(ellipse 90% 60% at 0% 100%, rgba(37, 99, 235, 0.08) 0%, transparent 52%),
        linear-gradient(180deg, var(--ie-aside-bg) 0%, #04070f 100%) !important;
    border-right-color: var(--ie-aside-border) !important;
    box-shadow:
        inset -1px 0 0 rgba(255, 255, 255, 0.04),
        8px 0 32px rgba(0, 0, 0, 0.45) !important;
}

html[data-ie-theme="dark"] .ie-aside__hero {
    background: linear-gradient(152deg, var(--ie-aside-hero-from) 0%, var(--ie-aside-hero-mid) 42%, var(--ie-aside-hero-to) 72%, #1e5f9e 100%) !important;
    box-shadow:
        0 6px 22px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

html[data-ie-theme="dark"] .ie-aside__user-strip,
html[data-ie-theme="dark"] a.ie-aside__user-strip {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

html[data-ie-theme="dark"] .ie-aside__user-strip:hover,
html[data-ie-theme="dark"] a.ie-aside__user-strip:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

html[data-ie-theme="dark"] .ie-aside__user-strip--active,
html[data-ie-theme="dark"] a.ie-aside__user-strip.ie-aside__user-strip--active {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(148, 197, 255, 0.35) !important;
}

html[data-ie-theme="dark"] .ie-aside__avatar--hero {
    background: rgba(255, 255, 255, 0.92) !important;
    color: #1a4d85 !important;
}

html[data-ie-theme="dark"] .ie-aside__user-name {
    color: #f1f5f9 !important;
}

html[data-ie-theme="dark"] .ie-aside__user-role {
    color: rgba(226, 236, 248, 0.72) !important;
}

html[data-ie-theme="dark"] .ie-aside__brand-name,
html[data-ie-theme="dark"] .ie-aside__brand-tag {
    color: #f8fafc !important;
}

html[data-ie-theme="dark"] .ie-aside__nav-label {
    color: var(--ie-aside-muted) !important;
}

html[data-ie-theme="dark"] .ie-aside__scroll {
    scrollbar-color: var(--ie-scrollbar) transparent;
}

html[data-ie-theme="dark"] .ie-aside__scroll::-webkit-scrollbar-thumb {
    background: var(--ie-scrollbar);
}

html[data-ie-theme="dark"] .ie-aside__scroll::-webkit-scrollbar-thumb:hover {
    background: var(--ie-scrollbar-hover);
}

html[data-ie-theme="dark"] .ie-aside__scroll.ie-aside-is-scrolled {
    box-shadow: inset 0 8px 8px -8px rgba(0, 0, 0, 0.35);
}

html[data-ie-theme="dark"] .ie-aside__footer {
    border-top: 1px solid var(--ie-aside-border);
    background: linear-gradient(180deg, transparent 0%, rgba(4, 7, 15, 0.75) 100%);
}

html[data-ie-theme="dark"] .ie-aside-logout {
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.22) 0%, rgba(69, 10, 10, 0.14) 100%) !important;
    border: 1px solid rgba(248, 113, 113, 0.28) !important;
    color: #fecdd3 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-ie-theme="dark"] .ie-aside-logout:hover {
    background: linear-gradient(135deg, rgba(185, 28, 28, 0.28) 0%, rgba(127, 29, 29, 0.2) 100%) !important;
    border-color: rgba(252, 165, 165, 0.42) !important;
    color: #ffe4e6 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 4px 14px rgba(220, 38, 38, 0.18);
}

html[data-ie-theme="dark"] .ie-aside-logout__icon {
    background: rgba(220, 38, 38, 0.22) !important;
    color: #fda4af !important;
    border: 1px solid rgba(248, 113, 113, 0.22);
}

html[data-ie-theme="dark"] .ie-aside-logout:hover .ie-aside-logout__icon {
    background: linear-gradient(145deg, #ef4444 0%, #dc2626 100%) !important;
    color: #fff !important;
    border-color: rgba(252, 165, 165, 0.35);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}

html[data-ie-theme="dark"] .ie-aside-logout__label {
    color: #fda4af !important;
}

html[data-ie-theme="dark"] .ie-aside-logout:hover .ie-aside-logout__label {
    color: #ffe4e6 !important;
}

html[data-ie-theme="dark"] #sidebar-overlay {
    background: var(--ie-overlay);
}

html[data-ie-theme="dark"] .ie-aside__section-title {
    color: var(--ie-aside-muted);
}

/* Dashboard home */
html[data-ie-theme="dark"] .ie-app-sidebar--legacy .ie-aside-nav-home-item {
    border-bottom-color: var(--ie-aside-border);
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .ie-aside-nav-home {
    background: rgba(16, 24, 39, 0.9) !important;
    border: 1px solid var(--ie-aside-border) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .ie-aside-nav-home .nav-icon:not(.right) {
    background: linear-gradient(135deg, rgba(94, 176, 255, 0.2) 0%, rgba(59, 130, 246, 0.14) 100%) !important;
    color: var(--ie-aside-blue-light) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .ie-aside-nav-home.active {
    background: linear-gradient(90deg, rgba(94, 176, 255, 0.18) 0%, rgba(59, 130, 246, 0.09) 100%) !important;
    box-shadow: inset 0 0 0 1px rgba(94, 176, 255, 0.24) !important;
    border-color: rgba(94, 176, 255, 0.3) !important;
}

/* Ítems principales del menú */
html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar .nav-link {
    color: var(--ie-aside-text) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar .nav-link p {
    color: #b8c9de !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar .nav-link:not(.active):hover p {
    color: #dce9f8 !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar .nav-icon:not(.right) {
    background: var(--ie-aside-icon-bg) !important;
    color: var(--ie-aside-blue-light) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar .nav-link:not(.active):hover {
    background: var(--ie-aside-hover-bg) !important;
    color: var(--ie-aside-hover-text) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar .nav-link:not(.active):hover .nav-icon:not(.right) {
    background: var(--ie-aside-icon-hover) !important;
    color: #dbeafe !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(94, 176, 255, 0.2) 0%, rgba(59, 130, 246, 0.09) 100%) !important;
    box-shadow: inset 0 0 0 1px rgba(94, 176, 255, 0.22) !important;
    color: var(--ie-aside-hover-text) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar .nav-link.active p {
    color: #e3efff !important;
    font-weight: 600 !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar .nav-link.active .nav-icon:not(.right) {
    background: linear-gradient(135deg, #3b82f6 0%, #5eb0ff 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

/* Padre con submenú abierto / hijo activo */
html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar > .nav-item.menu-open {
    background: var(--ie-aside-menu-open-bg) !important;
    border-color: var(--ie-aside-menu-open-border) !important;
    box-shadow: var(--ie-aside-menu-open-shadow) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-sidebar > .nav-item.menu-open::before {
    background: var(--ie-aside-blue) !important;
    opacity: 0.85;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-item:has(.nav-treeview .nav-link.active) > .nav-link.nav-dropdown-toggle,
html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-item.menu-open > .nav-link:not(.active) {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ie-aside-hover-text) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-item:has(.nav-treeview .nav-link.active) > .nav-link.nav-dropdown-toggle p,
html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-item.menu-open > .nav-link:not(.active) p {
    color: #d4e4f8 !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-item:has(.nav-treeview .nav-link.active) > .nav-link.nav-dropdown-toggle .nav-icon:not(.right),
html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-item.menu-open > .nav-link:not(.active) .nav-icon:not(.right) {
    background: var(--ie-aside-icon-hover) !important;
    color: #dbeafe !important;
}

/* Chevrones — heredan variables oscuras */
html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-item.menu-open > .nav-link .ie-aside-chevron {
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.22);
}

/* ── Submenús desplegables (treeview) ─────────────────────────── */
html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-item.menu-open > .nav-treeview {
    margin: 0.06rem 0.35rem 0.32rem !important;
    padding: 0.22rem 0.3rem 0.3rem 0.42rem !important;
    border-left-color: var(--ie-aside-treeview-border) !important;
    background: var(--ie-aside-treeview-bg) !important;
    border-radius: 0 8px 8px 0 !important;
    box-shadow: inset 3px 0 12px -5px rgba(59, 130, 246, 0.18) !important;
}

html[data-ie-theme="dark"] body.sidebar-mini:not(.sidebar-collapse) .main-sidebar.ie-app-sidebar--legacy:hover .nav-item.menu-open > .nav-treeview,
html[data-ie-theme="dark"] body.sidebar-mini:not(.sidebar-collapse) .main-sidebar.ie-app-sidebar--legacy.ie-aside-is-hover .nav-item.menu-open > .nav-treeview {
    background: var(--ie-aside-treeview-bg) !important;
    border-left-color: var(--ie-aside-treeview-border) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview .nav-link p {
    color: var(--ie-aside-treeview-text) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview .nav-icon:not(.right) {
    background: rgba(94, 176, 255, 0.1) !important;
    color: #7d93b0 !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview > .nav-item > .nav-link:not(.active):hover {
    background: rgba(94, 176, 255, 0.12) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview > .nav-item > .nav-link:not(.active):hover p {
    color: #d4e4f8 !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview > .nav-item > .nav-link.active {
    background: rgba(59, 130, 246, 0.2) !important;
    box-shadow: inset 0 0 0 1px rgba(94, 176, 255, 0.24) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview > .nav-item > .nav-link.active p {
    color: #e8f2ff !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview .nav-link.active .nav-icon:not(.right) {
    background: linear-gradient(135deg, #2563eb 0%, #5eb0ff 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview > .nav-item > .nav-link::before {
    background: rgba(125, 147, 176, 0.5) !important;
}

html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview > .nav-item > .nav-link:hover::before,
html[data-ie-theme="dark"] .ie-app-sidebar--legacy .nav-treeview > .nav-item > .nav-link.active::before {
    background: var(--ie-aside-blue) !important;
    box-shadow: 0 0 6px rgba(94, 176, 255, 0.4);
}

/* Tarjetas legacy del sidebar */
html[data-ie-theme="dark"] .ie-aside-link:hover {
    border-color: rgba(94, 176, 255, 0.32) !important;
}

html[data-ie-theme="dark"] .ie-aside-link__icon--blue {
    background: rgba(94, 176, 255, 0.16);
    color: #93c5fd;
}

html[data-ie-theme="dark"] .ie-aside-link__icon--indigo {
    background: rgba(129, 140, 248, 0.16);
    color: #a5b4fc;
}

html[data-ie-theme="dark"] .ie-aside-link__icon--teal {
    background: rgba(45, 212, 191, 0.14);
    color: #5eead4;
}

html[data-ie-theme="dark"] .ie-aside-link__icon--amber {
    background: rgba(251, 191, 36, 0.14);
    color: #fcd34d;
}

html[data-ie-theme="dark"] .ie-aside-link__icon--violet {
    background: rgba(192, 132, 252, 0.14);
    color: #d8b4fe;
}

html[data-ie-theme="dark"] .ie-aside-link__icon--slate {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

/* ── CKEditor / Dropzone / SweetAlert básico ──────────────────── */
html[data-ie-theme="dark"] .ck.ck-editor__main > .ck-editor__editable {
    background: var(--ie-input-bg);
    color: var(--ie-text);
    border-color: var(--ie-border);
}

html[data-ie-theme="dark"] .ck.ck-toolbar {
    background: var(--ie-surface-2);
    border-color: var(--ie-border);
}

html[data-ie-theme="dark"] .dropzone {
    background: var(--ie-surface-2);
    border-color: var(--ie-border);
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] .swal2-popup {
    background: var(--ie-surface);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .login-box .card {
    background: linear-gradient(180deg, var(--ie-surface) 0%, #10182a 100%);
    border-color: var(--ie-border);
    box-shadow: 0 16px 40px -20px var(--ie-shadow);
}

html[data-ie-theme="dark"] .btn-default {
    background: var(--ie-surface-2);
    border-color: var(--ie-border);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .btn-default:hover {
    background: var(--ie-surface-3);
    border-color: rgba(148, 163, 184, 0.28);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] #titulo {
    color: #93c5fd !important;
}

html[data-ie-theme="dark"] .dropdown-menu:not(.ie-theme-panel) {
    background: var(--ie-dropdown-bg);
    border-color: var(--ie-border);
    box-shadow: 0 12px 32px -12px var(--ie-shadow);
}

html[data-ie-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.28) !important;
    color: #86efac !important;
}

html[data-ie-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.28) !important;
    color: #fca5a5 !important;
}

html[data-ie-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.28) !important;
    color: #fcd34d !important;
}

html[data-ie-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.28) !important;
    color: #93c5fd !important;
}

html[data-ie-theme="dark"] .alert-info strong,
html[data-ie-theme="dark"] .alert-warning strong,
html[data-ie-theme="dark"] .alert-success strong,
html[data-ie-theme="dark"] .alert-danger strong,
html[data-ie-theme="dark"] .alert-light strong {
    color: inherit;
}

/* Callouts AdminLTE */
html[data-ie-theme="dark"] .callout {
    background-color: var(--ie-surface-2) !important;
    border-left-color: var(--ie-border) !important;
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] .callout p,
html[data-ie-theme="dark"] .callout strong,
html[data-ie-theme="dark"] .callout h4,
html[data-ie-theme="dark"] .callout h5 {
    color: inherit !important;
}

html[data-ie-theme="dark"] .callout-info {
    background-color: rgba(23, 162, 184, 0.14) !important;
    border-left-color: #17a2b8 !important;
    color: #7dd3fc !important;
}

html[data-ie-theme="dark"] .callout-warning {
    background-color: rgba(255, 193, 7, 0.14) !important;
    border-left-color: #ffc107 !important;
    color: #fcd34d !important;
}

html[data-ie-theme="dark"] .callout-danger {
    background-color: rgba(220, 53, 69, 0.14) !important;
    border-left-color: #dc3545 !important;
    color: #fca5a5 !important;
}

html[data-ie-theme="dark"] .callout-success {
    background-color: rgba(40, 167, 69, 0.14) !important;
    border-left-color: #28a745 !important;
    color: #86efac !important;
}

/* Tarjetas de inscripción / secciones */
html[data-ie-theme="dark"] .hover-card,
html[data-ie-theme="dark"] .hover-card .card-body {
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .hover-card .text-muted,
html[data-ie-theme="dark"] .seccion-materias .text-muted {
    color: var(--ie-text-muted) !important;
}

html[data-ie-theme="dark"] .hover-card strong,
html[data-ie-theme="dark"] .info-item strong {
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .info-item {
    background-color: var(--ie-filter-panel-bg) !important;
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] .info-item[style],
html[data-ie-theme="dark"] .info-item.info-item-highlight {
    background-color: rgba(59, 130, 246, 0.14) !important;
    border-left: 4px solid #3b82f6 !important;
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] .availability-high {
    background-color: rgba(40, 167, 69, 0.2) !important;
    color: #86efac !important;
}

html[data-ie-theme="dark"] .availability-medium {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: #fcd34d !important;
}

html[data-ie-theme="dark"] .availability-low {
    background-color: rgba(220, 53, 69, 0.2) !important;
    color: #fca5a5 !important;
}

html[data-ie-theme="dark"] .availability-full {
    background-color: #dc3545 !important;
    color: #fff !important;
}

html[data-ie-theme="dark"] .uv-stat-box.inscritas {
    background: rgba(59, 130, 246, 0.14) !important;
}

html[data-ie-theme="dark"] .uv-stat-box.nuevas {
    background: rgba(40, 167, 69, 0.14) !important;
}

html[data-ie-theme="dark"] .uv-stat-box.total {
    background: rgba(148, 163, 184, 0.12) !important;
}

html[data-ie-theme="dark"] .uv-stat-box .uv-stat-num,
html[data-ie-theme="dark"] .uv-stat-box .uv-stat-lbl {
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .badge-light,
html[data-ie-theme="dark"] .badge.badge-light {
    background-color: var(--ie-surface-3) !important;
    color: var(--ie-text) !important;
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] .input-group-text.bg-white {
    background-color: var(--ie-input-bg) !important;
    color: var(--ie-text-muted) !important;
    border-color: var(--ie-input-border) !important;
}

html[data-ie-theme="dark"] .estudiante-strip .dato-value {
    color: var(--ie-text) !important;
}

html[data-ie-theme="dark"] .estudiante-strip .dato-label {
    color: var(--ie-text-muted) !important;
}

/* ── Componentes globales adicionales ─────────────────────────── */
html[data-ie-theme="dark"] hr {
    border-top-color: var(--ie-border);
}

html[data-ie-theme="dark"] small,
html[data-ie-theme="dark"] .small {
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] .form-text,
html[data-ie-theme="dark"] .text-secondary {
    color: var(--ie-text-muted) !important;
}

html[data-ie-theme="dark"] .custom-control-label,
html[data-ie-theme="dark"] .custom-file-label,
html[data-ie-theme="dark"] .custom-file-label::after {
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .custom-file-label,
html[data-ie-theme="dark"] .custom-file-label::after {
    background: var(--ie-surface-2);
    border-color: var(--ie-input-border);
}

html[data-ie-theme="dark"] .btn-light {
    background: var(--ie-surface-2);
    border-color: var(--ie-border);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .btn-light:hover {
    background: var(--ie-surface-3);
    border-color: rgba(148, 163, 184, 0.28);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .btn-secondary {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

html[data-ie-theme="dark"] .btn-secondary:hover {
    background: #3f4f67;
    border-color: #64748b;
    color: #f1f5f9;
}

html[data-ie-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.35);
}

html[data-ie-theme="dark"] .btn-outline-secondary:hover {
    background: var(--ie-surface-2);
    border-color: rgba(148, 163, 184, 0.45);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .breadcrumb {
    background: var(--ie-surface-2);
}

html[data-ie-theme="dark"] .breadcrumb-item a {
    color: var(--ie-link);
}

html[data-ie-theme="dark"] .breadcrumb-item.active {
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] .dataTables_filter input,
html[data-ie-theme="dark"] .dataTables_length select {
    background-color: var(--ie-select-bg);
    border: 1px solid var(--ie-select-border);
    border-radius: 7px;
    color: var(--ie-select-text);
    padding: 0.32rem 0.55rem;
}

html[data-ie-theme="dark"] .dataTables_length select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.45rem center;
    background-size: 12px 9px;
    padding-right: 1.6rem;
}

html[data-ie-theme="dark"] .dataTables_filter input:focus,
html[data-ie-theme="dark"] .dataTables_length select:focus {
    border-color: var(--ie-accent);
    box-shadow: 0 0 0 3px var(--ie-accent-soft);
    outline: none;
}

html[data-ie-theme="dark"] .dt-buttons .btn {
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .dt-buttons .btn-default {
    background: var(--ie-surface-2);
    border-color: rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

html[data-ie-theme="dark"] .dt-buttons .btn-default:hover {
    background: var(--ie-surface-3);
    border-color: rgba(148, 163, 184, 0.42);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .dt-buttons .btn-secondary {
    background: #2a3548;
    border-color: rgba(148, 163, 184, 0.32);
    color: #e2e8f0;
}

html[data-ie-theme="dark"] .dt-buttons .btn-secondary:hover {
    background: #334155;
    border-color: rgba(148, 163, 184, 0.45);
    color: #f8fafc;
}

html[data-ie-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b,
html[data-ie-theme="dark"] .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    border-color: var(--ie-select-chevron) transparent transparent transparent !important;
}

html[data-ie-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b,
html[data-ie-theme="dark"] .select2-container--bootstrap4.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--ie-select-chevron) transparent !important;
}

html[data-ie-theme="dark"] .modal-header.bg-dark,
html[data-ie-theme="dark"] .modal-content.border-0.rounded.shadow-lg.bg-dark {
    background: #0f1628 !important;
}

html[data-ie-theme="dark"] .swal2-title,
html[data-ie-theme="dark"] .swal2-content {
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .swal2-styled.swal2-confirm {
    background: var(--ie-accent) !important;
}

html[data-ie-theme="dark"] .multi-select-container {
    background: var(--ie-select-bg);
    border-color: var(--ie-select-border);
    color: var(--ie-select-text);
}

html[data-ie-theme="dark"] .searchable-link:hover {
    background: var(--ie-surface-2);
}

html[data-ie-theme="dark"] .buttons-columnVisibility.active {
    background-color: var(--ie-accent-soft);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .buttons-columnVisibility {
    color: var(--ie-text-muted);
}

html[data-ie-theme="dark"] .buttons-columnVisibility:hover {
    background: var(--ie-surface-2);
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .bootstrap-datetimepicker-widget {
    background: var(--ie-surface);
    color: var(--ie-text);
    border-color: var(--ie-border);
}

html[data-ie-theme="dark"] .bootstrap-datetimepicker-widget table td.day:hover,
html[data-ie-theme="dark"] .bootstrap-datetimepicker-widget table td.hour:hover,
html[data-ie-theme="dark"] .bootstrap-datetimepicker-widget table td.minute:hover,
html[data-ie-theme="dark"] .bootstrap-datetimepicker-widget table td.second:hover {
    background: var(--ie-surface-2);
}

html[data-ie-theme="dark"] .bootstrap-datetimepicker-widget table td.active,
html[data-ie-theme="dark"] .bootstrap-datetimepicker-widget table td.active:hover {
    background-color: var(--ie-accent);
}

html[data-ie-theme="dark"] .dt-button-collection {
    background: var(--ie-surface);
    border-color: var(--ie-border);
}

html[data-ie-theme="dark"] .dt-button-collection .dt-button {
    color: var(--ie-text);
}

html[data-ie-theme="dark"] .dt-button-collection .dt-button:hover {
    background: var(--ie-surface-2);
}

html[data-ie-theme="dark"] .thead-dark th {
    background: #0f1628 !important;
    color: #cbd5e1 !important;
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] .table-bordered,
html[data-ie-theme="dark"] .table-bordered td,
html[data-ie-theme="dark"] .table-bordered th,
html[data-ie-theme="dark"] table.dataTable.table-bordered td,
html[data-ie-theme="dark"] table.dataTable.table-bordered th {
    border-color: var(--ie-border);
}

html[data-ie-theme="dark"] table.dataTable.no-footer {
    border-bottom-color: var(--ie-border);
}

html[data-ie-theme="dark"] .card-body .table-responsive {
    border-radius: 8px;
}

html[data-ie-theme="dark"] .dataTables_scrollHead table.dataTable thead th,
html[data-ie-theme="dark"] .dataTables_scrollFoot table.dataTable tfoot th {
    background: linear-gradient(180deg, var(--ie-surface-3) 0%, var(--ie-table-header-bg) 100%) !important;
    color: var(--ie-table-header-text) !important;
    border-color: var(--ie-border) !important;
}

html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_length label,
html[data-ie-theme="dark"] .dataTables_wrapper .dataTables_filter label {
    color: var(--ie-text-muted);
    font-weight: 500;
}

html[data-ie-theme="dark"] .dataTables_processing {
    background: rgba(18, 26, 43, 0.92) !important;
    color: var(--ie-text) !important;
    border: 1px solid var(--ie-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--ie-shadow);
}

html[data-ie-theme="dark"] .table-sm td,
html[data-ie-theme="dark"] .table-sm th {
    padding: 0.42rem 0.55rem;
}

html[data-ie-theme="dark"] .card-tools .btn,
html[data-ie-theme="dark"] .card-header .btn-tool {
    color: rgba(255, 255, 255, 0.85);
}

html[data-ie-theme="dark"] .content .card-header.bg-secondary,
html[data-ie-theme="dark"] .content h5.card-header.bg-secondary {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

html[data-ie-theme="dark"] .invalid-feedback,
html[data-ie-theme="dark"] .valid-feedback {
    color: #fca5a5;
}

html[data-ie-theme="dark"] .is-invalid ~ .invalid-feedback {
    color: #fca5a5;
}

/* Evitar recorte del panel de tema por contenedores del layout */
.layout-fixed .wrapper,
.main-header,
.main-header.navbar,
.wrapper > .main-header {
    overflow: visible !important;
}

.ie-theme-panel__header,
.ie-theme-panel__hint {
    overflow: visible;
}

.ie-theme-panel__preview {
    overflow: hidden;
}

/* ── Selector de apariencia ───────────────────────────────────── */
.ie-theme-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--ie-border, #e2e8f0);
    border-radius: 10px;
    background: var(--ie-header-toggle-bg, #f8fafc);
    color: var(--ie-header-text, #1565c0);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ie-theme-toggle__btn::after {
    display: none !important;
}

.ie-theme-toggle__btn:hover,
.ie-theme-toggle__btn[aria-expanded="true"] {
    background: rgba(21, 101, 192, 0.1);
    border-color: rgba(21, 101, 192, 0.22);
    color: #0d47a1;
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.14);
    transform: translateY(-1px);
}

html[data-ie-theme="dark"] .ie-theme-toggle__btn:hover,
html[data-ie-theme="dark"] .ie-theme-toggle__btn[aria-expanded="true"] {
    background: var(--ie-accent-soft);
    border-color: rgba(96, 165, 250, 0.32);
    color: #dbeafe;
    box-shadow: 0 4px 18px var(--ie-accent-glow);
}

.ie-theme-toggle__btn:focus-visible {
    outline: 2px solid rgba(21, 101, 192, 0.45);
    outline-offset: 2px;
}

.ie-theme-toggle__icon {
    position: relative;
    width: 1rem;
    height: 1rem;
    display: block;
}

.ie-theme-toggle__glyph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.92rem;
    opacity: 0;
    transform: scale(0.72) rotate(-12deg);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.ie-theme-toggle[data-ie-theme-pref="light"] .ie-theme-toggle__glyph--light,
.ie-theme-toggle[data-ie-theme-pref="dark"] .ie-theme-toggle__glyph--dark,
.ie-theme-toggle[data-ie-theme-pref="system"] .ie-theme-toggle__glyph--system,
html[data-ie-theme-pref="light"] .ie-theme-toggle__glyph--light,
html[data-ie-theme-pref="dark"] .ie-theme-toggle__glyph--dark,
html[data-ie-theme-pref="system"] .ie-theme-toggle__glyph--system,
.ie-theme-toggle:not([data-ie-theme-pref]) .ie-theme-toggle__glyph--light {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Panel desplegable */
.ie-theme-toggle {
    position: static;
    flex-shrink: 0;
}

.ie-theme-toggle.show .ie-theme-panel,
.ie-theme-toggle .ie-theme-panel.show {
    display: block;
}

.ie-theme-panel {
    width: 326px;
    max-width: calc(100vw - 1.25rem);
    padding: 0 !important;
    margin-top: 0.5rem !important;
    border: 1px solid var(--ie-border, #e2e8f0) !important;
    border-radius: 16px !important;
    background: var(--ie-dropdown-bg, #fff) !important;
    box-shadow:
        0 18px 48px -16px rgba(15, 23, 42, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset !important;
    overflow: visible;
    z-index: 1060 !important;
    animation: ie-theme-panel-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ie-main-header__actions .ie-theme-panel.dropdown-menu-right {
    right: 0 !important;
    left: auto !important;
}

html[data-ie-theme="dark"] .ie-theme-panel {
    box-shadow:
        0 22px 56px -18px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
}

@keyframes ie-theme-panel-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ie-theme-panel__header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1rem 0.75rem;
    border-bottom: 1px solid var(--ie-border, #e2e8f0);
    background: linear-gradient(180deg, var(--ie-surface-2, #f8fafc) 0%, var(--ie-dropdown-bg, #fff) 100%);
}

.ie-theme-panel__header-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(21, 101, 192, 0.14) 0%, rgba(66, 165, 245, 0.12) 100%);
    color: #1565c0;
    font-size: 0.85rem;
    flex-shrink: 0;
}

html[data-ie-theme="dark"] .ie-theme-panel__header-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(96, 165, 250, 0.12) 100%);
    color: #93c5fd;
}

.ie-theme-panel__title {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--ie-text, #1e293b);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.ie-theme-panel__subtitle {
    margin: 0.12rem 0 0;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ie-text-muted, #64748b);
    line-height: 1.3;
}

.ie-theme-panel__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.8rem 0.75rem 0.65rem;
}

.ie-theme-panel__option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.4rem 0.35rem 0.45rem;
    border: 1.5px solid var(--ie-border, #e2e8f0);
    border-radius: 12px;
    background: var(--ie-surface, #fff);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ie-theme-panel__option:hover {
    border-color: rgba(21, 101, 192, 0.28);
    background: var(--ie-surface-2, #f8fafc);
    transform: translateY(-1px);
}

html[data-ie-theme="dark"] .ie-theme-panel__option {
    background: var(--ie-surface-2);
}

html[data-ie-theme="dark"] .ie-theme-panel__option:hover {
    border-color: rgba(96, 165, 250, 0.32);
    background: var(--ie-surface-3);
}

.ie-theme-panel__option.active {
    border-color: #1565c0;
    background: linear-gradient(180deg, rgba(21, 101, 192, 0.08) 0%, rgba(21, 101, 192, 0.03) 100%);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

html[data-ie-theme="dark"] .ie-theme-panel__option.active {
    border-color: #60a5fa;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0.06) 100%);
    box-shadow: 0 0 0 3px var(--ie-accent-soft);
}

.ie-theme-panel__option:focus-visible {
    outline: 2px solid rgba(21, 101, 192, 0.45);
    outline-offset: 2px;
}

/* Mini previews */
.ie-theme-panel__preview {
    display: block;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.ie-theme-panel__preview--light {
    background: #f4f6f9;
}

.ie-theme-panel__preview--light .ie-theme-panel__preview-bar {
    height: 14px;
    background: linear-gradient(90deg, #fff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
}

.ie-theme-panel__preview--light .ie-theme-panel__preview-body {
    padding: 6px 7px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ie-theme-panel__preview--light .ie-theme-panel__preview-line {
    height: 4px;
    border-radius: 99px;
    background: #e2e8f0;
}

.ie-theme-panel__preview--light .ie-theme-panel__preview-line--short {
    width: 62%;
    background: #cbd5e1;
}

.ie-theme-panel__preview--dark {
    background: #0a0f1a;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ie-theme-panel__preview--dark .ie-theme-panel__preview-bar {
    height: 14px;
    background: linear-gradient(90deg, #0f1628 0%, #121a2b 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.ie-theme-panel__preview--dark .ie-theme-panel__preview-body {
    padding: 6px 7px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ie-theme-panel__preview--dark .ie-theme-panel__preview-line {
    height: 4px;
    border-radius: 99px;
    background: rgba(148, 163, 184, 0.18);
}

.ie-theme-panel__preview--dark .ie-theme-panel__preview-line--short {
    width: 62%;
    background: rgba(96, 165, 250, 0.35);
}

.ie-theme-panel__preview--system {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.ie-theme-panel__preview-split {
    display: flex;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.ie-theme-panel__preview-half {
    flex: 1;
}

.ie-theme-panel__preview-half--light {
    background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
}

.ie-theme-panel__preview-half--dark {
    background: linear-gradient(180deg, #121a2b 0%, #080d18 100%);
}

.ie-theme-panel__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
    padding: 0 0.1rem;
}

.ie-theme-panel__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ie-text, #1e293b);
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.2;
}

.ie-theme-panel__label i {
    font-size: 0.68rem;
    opacity: 0.8;
    color: var(--ie-header-text, #1565c0);
}

html[data-ie-theme="dark"] .ie-theme-panel__label i {
    color: #93c5fd;
}

.ie-theme-panel__check {
    position: absolute;
    top: 0.42rem;
    right: 0.42rem;
    z-index: 2;
    width: 16px;
    height: 16px;
    border-radius: 99px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: transparent;
    font-size: 0.55rem;
    flex-shrink: 0;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.ie-theme-panel__option.active .ie-theme-panel__check {
    display: flex;
    background: #1565c0;
    color: #fff;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.35);
}

html[data-ie-theme="dark"] .ie-theme-panel__option.active .ie-theme-panel__check {
    background: #3b82f6;
    box-shadow: 0 2px 10px var(--ie-accent-glow);
}

.ie-theme-panel__hint {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    padding: 0.65rem 1rem 0.85rem;
    border-top: 1px solid var(--ie-border, #e2e8f0);
    font-size: 0.68rem;
    line-height: 1.45;
    color: var(--ie-text-muted, #64748b);
    background: var(--ie-surface-2, #f8fafc);
}

.ie-theme-panel__hint i {
    margin-top: 0.1rem;
    opacity: 0.75;
    flex-shrink: 0;
}

.ie-main-header__actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

/* Login: toggle flotante */
.ie-theme-toggle--login {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
}

.ie-theme-toggle--login .ie-theme-panel {
    margin-top: 0.55rem !important;
}

@media (max-width: 767.98px) {
    .ie-theme-toggle__btn {
        width: 36px;
        height: 36px;
    }

    .ie-theme-panel {
        width: min(326px, calc(100vw - 1.25rem));
    }

    .ie-theme-panel__grid {
        gap: 0.45rem;
        padding: 0.7rem 0.7rem 0.55rem;
    }

    .ie-theme-panel__preview {
        height: 46px;
    }

    .ie-theme-panel__label {
        font-size: 0.69rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ie-theme-panel {
        animation: none;
    }

    .ie-theme-toggle__btn,
    .ie-theme-panel__option,
    .ie-theme-toggle__glyph {
        transition-duration: 0.01ms;
    }
}

@media (max-width: 767.98px) {
    .ie-theme-toggle__btn {
        width: 36px;
        height: 36px;
    }
}
