/* ==========================================================================
   SISTEMA DINÁMICO DE MODO NOCHE (DARK MODE) POR USUARIO - IEESSPP
   Archivo: moodle_darkmode_executive.css
   Arquitectura:
   - Aislamiento estricto por usuario mediante la clase `body.ieesspp-dark-mode`
     y el atributo `html[data-ieesspp-theme="dark"]`.
   - Si el usuario actual NO tiene activo su modo noche, NINGUNA regla de tema
     oscuro se aplica (0% impacto colateral en otros usuarios).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BOTÓN CONMUTADOR EN EL NAVBAR (.ieesspp-theme-toggle-btn)
   Visible en modo claro y modo oscuro con micro-interacción ejecutiva
   -------------------------------------------------------------------------- */
.ieesspp-theme-toggle-btn {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    height: 36px !important;
    padding: 0 0.75rem !important;
    border-radius: 40px !important;
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    color: #0F2C59 !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
    flex-shrink: 0 !important;
    outline: none !important;
}

.ieesspp-theme-toggle-btn:hover {
    background: #E2E8F0 !important;
    border-color: #94A3B8 !important;
    color: #071933 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(15, 44, 89, 0.1) !important;
}

.ieesspp-theme-toggle-btn svg {
    width: 15px !important;
    height: 15px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2.1 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    flex-shrink: 0 !important;
    transition: transform 0.25s ease !important;
}

.ieesspp-theme-toggle-btn:hover svg {
    transform: rotate(-12deg) scale(1.06) !important;
}

.ieesspp-theme-toggle-btn .dm-icon-sun {
    display: none !important;
}

.ieesspp-theme-toggle-btn .dm-icon-moon {
    display: inline-flex !important;
}

/* Estado cuando el Modo Noche está ACTIVO para el usuario */
body.ieesspp-dark-mode .ieesspp-theme-toggle-btn,
html[data-ieesspp-theme="dark"] .ieesspp-theme-toggle-btn {
    background: rgba(212, 175, 55, 0.14) !important;
    border-color: rgba(212, 175, 55, 0.45) !important;
    color: #FBBF24 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
}

body.ieesspp-dark-mode .ieesspp-theme-toggle-btn:hover,
html[data-ieesspp-theme="dark"] .ieesspp-theme-toggle-btn:hover {
    background: rgba(212, 175, 55, 0.24) !important;
    border-color: #D4AF37 !important;
    color: #FDE047 !important;
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.28) !important;
}

body.ieesspp-dark-mode .ieesspp-theme-toggle-btn .dm-icon-moon,
html[data-ieesspp-theme="dark"] .ieesspp-theme-toggle-btn .dm-icon-moon {
    display: none !important;
}

body.ieesspp-dark-mode .ieesspp-theme-toggle-btn .dm-icon-sun,
html[data-ieesspp-theme="dark"] .ieesspp-theme-toggle-btn .dm-icon-sun {
    display: inline-flex !important;
}

/* En laptops compactas, tablets y móviles: botón circular compacto solo con ícono */
@media (max-width: 1400px) {
    .ieesspp-theme-toggle-btn {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }
    .ieesspp-theme-toggle-btn .dm-toggle-label {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   2. VARIABLES GLOBALES Y LIENZO BASE EN MODO NOCHE
   -------------------------------------------------------------------------- */
html[data-ieesspp-theme="dark"],
body.ieesspp-dark-mode {
    --primary: #3B82F6 !important;
    --primary-dark: #0B1120 !important;
    --primary-light: #60A5FA !important;
    --accent-gold: #D4AF37 !important;
    --slate-bg: #0B1120 !important;
    --slate-card: #111827 !important;
    --text-main: #F1F5F9 !important;
    --text-muted: #94A3B8 !important;
    --border-subtle: #1E293B !important;

    --ie-slate-bg: #0B1120 !important;
    --ie-slate-border: #1E293B !important;
    --ie-slate-text: #F1F5F9 !important;
    --ie-slate-muted: #94A3B8 !important;
    color-scheme: dark;
}

html[data-ieesspp-theme="dark"],
body.ieesspp-dark-mode,
body.ieesspp-dark-mode#page-my-index,
body.ieesspp-dark-mode.pagelayout-mycourses,
body.ieesspp-dark-mode#page-user-profile,
body.ieesspp-dark-mode.pagelayout-mypublic,
body.ieesspp-dark-mode[class*="path-course-"],
body.ieesspp-dark-mode[class*="path-mod-"],
body.ieesspp-dark-mode[class*="path-grade-"],
body.ieesspp-dark-mode[class*="path-report-"],
body.ieesspp-dark-mode.path-admin {
    background-color: #0B1120 !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode #page,
body.ieesspp-dark-mode #page.drawers,
body.ieesspp-dark-mode #page-wrapper,
body.ieesspp-dark-mode #topofscroll,
body.ieesspp-dark-mode #topofscroll.main-inner,
body.ieesspp-dark-mode .main-inner,
body.ieesspp-dark-mode #page.drawers .main-inner,
body.ieesspp-dark-mode #page-content,
body.ieesspp-dark-mode #region-main,
body.ieesspp-dark-mode #region-main-box,
html[data-ieesspp-theme="dark"] #page,
html[data-ieesspp-theme="dark"] #page.drawers,
html[data-ieesspp-theme="dark"] .main-inner,
html[data-ieesspp-theme="dark"] #region-main {
    background-color: #0B1120 !important;
    color: #F1F5F9 !important;
}

/* --------------------------------------------------------------------------
   3. NAVBAR PRINCIPAL Y MENÚS DESPLEGABLES SUPERIORES
   -------------------------------------------------------------------------- */
body.ieesspp-dark-mode .main-header,
body.ieesspp-dark-mode header.ieesspp-navbar,
body.ieesspp-dark-mode .navbar.fixed-top,
body.ieesspp-dark-mode nav.navbar {
    background: #0F172A !important;
    background-color: #0F172A !important;
    border-bottom: 1px solid #1E293B !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

body.ieesspp-dark-mode .brand-titles h1 {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .brand-titles span {
    color: #D4AF37 !important;
}

body.ieesspp-dark-mode .brand-divider {
    background-color: #334155 !important;
}

body.ieesspp-dark-mode .ieesspp-drawer-btn i {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .nav-links a,
body.ieesspp-dark-mode .nav-links .nav-link,
body.ieesspp-dark-mode .navbar .nav-link {
    color: #CBD5E1 !important;
}

body.ieesspp-dark-mode .nav-links a:hover,
body.ieesspp-dark-mode .nav-links .nav-link:hover,
body.ieesspp-dark-mode .nav-links a.active,
body.ieesspp-dark-mode .nav-links .nav-link.active,
body.ieesspp-dark-mode .navbar .nav-link:hover {
    color: #FFFFFF !important;
    background-color: transparent !important;
}

body.ieesspp-dark-mode .nav-links a.active::after,
body.ieesspp-dark-mode .nav-links .nav-link.active::after {
    background-color: #D4AF37 !important;
}

/* Iconos de Notificaciones y Mensajes en Navbar */
body.ieesspp-dark-mode .header-actions .popover-region-toggle,
body.ieesspp-dark-mode .header-actions .nav-link,
body.ieesspp-dark-mode .header-actions .popover-region i.icon {
    color: #CBD5E1 !important;
}

body.ieesspp-dark-mode .header-actions .popover-region-toggle:hover,
body.ieesspp-dark-mode .header-actions .nav-link:hover {
    color: #FBBF24 !important;
}

body.ieesspp-dark-mode .header-actions .edit-switch-wrapper {
    border-left-color: #1E293B !important;
}

body.ieesspp-dark-mode .editmode-switch-form label,
body.ieesspp-dark-mode .edit-switch-wrapper label {
    color: #CBD5E1 !important;
}

/* Menú desplegable de usuario, notificaciones y cajón de mensajes */
body.ieesspp-dark-mode #user-action-menu,
body.ieesspp-dark-mode .usermenu .dropdown-menu,
body.ieesspp-dark-mode .dropdown-menu,
body.ieesspp-dark-mode .popover-region-container {
    background: #111827 !important;
    background-color: #111827 !important;
    border: 1px solid #1E293B !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55) !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode .popover-region-header-container,
body.ieesspp-dark-mode .popover-region-footer-container {
    background: #0F172A !important;
    border-color: #1E293B !important;
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .popover-region-header-text {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .dropdown-item,
body.ieesspp-dark-mode #user-action-menu .dropdown-item {
    color: #E2E8F0 !important;
    background: transparent !important;
}

body.ieesspp-dark-mode .dropdown-item:hover,
body.ieesspp-dark-mode .dropdown-item:focus,
body.ieesspp-dark-mode #user-action-menu .dropdown-item:hover {
    background: #1E293B !important;
    background-color: #1E293B !important;
    color: #FBBF24 !important;
}

body.ieesspp-dark-mode .dropdown-divider {
    border-top-color: #1E293B !important;
}

/* Gaveta móvil de navegación primaria */
body.ieesspp-dark-mode #theme_boost-drawers-primary,
body.ieesspp-dark-mode #theme_boost-drawers-primary .drawerheader,
body.ieesspp-dark-mode #theme_boost-drawers-primary .drawercontent,
body.ieesspp-dark-mode #theme_boost-drawers-primary .list-group-item {
    background-color: #0F172A !important;
    color: #F1F5F9 !important;
    border-color: #1E293B !important;
}

/* --------------------------------------------------------------------------
   4. INICIO / FRONTPAGE (OFERTA ACADÉMICA Y MATERIAS)
   -------------------------------------------------------------------------- */
body.ieesspp-dark-mode .ieesspp-courses-showcase-section,
body.ieesspp-dark-mode .sitetopic {
    background-color: #0B1120 !important;
    border-color: #1E293B !important;
}

body.ieesspp-dark-mode .ieesspp-academic-title {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .ieesspp-academic-tabs {
    background: #111827 !important;
    border: 1px solid #1E293B !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

body.ieesspp-dark-mode .ieesspp-tab-btn {
    color: #CBD5E1 !important;
    background: transparent !important;
}

body.ieesspp-dark-mode .ieesspp-tab-btn:hover {
    background: #1E293B !important;
    color: #FFFFFF !important;
    border-color: #334155 !important;
}

body.ieesspp-dark-mode .ieesspp-tab-btn.is-active {
    background: linear-gradient(135deg, #1E3A8A 0%, #0F2C59 100%) !important;
    color: #FFFFFF !important;
    border-color: rgba(212, 175, 55, 0.5) !important;
}

body.ieesspp-dark-mode .ieesspp-tab-btn .tab-counter {
    background: #1E293B !important;
    color: #CBD5E1 !important;
}

body.ieesspp-dark-mode .ieesspp-tab-btn.is-active .tab-counter {
    background: #D4AF37 !important;
    color: #071933 !important;
}

body.ieesspp-dark-mode .ieesspp-course-card {
    background: #111827 !important;
    border: 1px solid #1E293B !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45) !important;
}

body.ieesspp-dark-mode .ieesspp-card-body {
    background: #111827 !important;
}

body.ieesspp-dark-mode .ieesspp-program-type {
    color: #94A3B8 !important;
}

body.ieesspp-dark-mode .ieesspp-card-title,
body.ieesspp-dark-mode .ieesspp-title-link {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .ieesspp-title-link:hover {
    color: #FBBF24 !important;
}

body.ieesspp-dark-mode .ieesspp-card-description {
    color: #94A3B8 !important;
}

body.ieesspp-dark-mode .ieesspp-card-footer {
    background: #0F172A !important;
    border-top: 1px solid #1E293B !important;
}

body.ieesspp-dark-mode .ieesspp-btn-access-course {
    background: #1E293B !important;
    border: 1px solid #334155 !important;
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .ieesspp-btn-access-course:hover {
    background: #1E3A8A !important;
    border-color: #D4AF37 !important;
    color: #FDE047 !important;
}

/* Bloque Informativo Institucional del Inicio (#block06 / ¿QUÉ ES EL IEESSPP?) */
body.ieesspp-dark-mode #block06,
body.ieesspp-dark-mode .block06design1,
body.ieesspp-dark-mode .block06design2,
body.ieesspp-dark-mode .working-with-us-area,
body.ieesspp-dark-mode .working-with-us-area.gray-bg,
body.ieesspp-dark-mode .gray-bg,
html[data-ieesspp-theme="dark"] #block06,
html[data-ieesspp-theme="dark"] .working-with-us-area {
    background: #0B1120 !important;
    background-color: #0B1120 !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode #block06 .section-title-fp h4,
body.ieesspp-dark-mode #block06 .hire-us-content h4,
body.ieesspp-dark-mode #block06 .hire-us-content h6,
body.ieesspp-dark-mode .working-with-us-area h4 {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode #block06 .hire-us-content,
body.ieesspp-dark-mode #block06 .hire-us-content div,
body.ieesspp-dark-mode #block06 .hire-us-content p,
body.ieesspp-dark-mode .working-with-us-area p {
    color: #94A3B8 !important;
}

body.ieesspp-dark-mode #block06 a.hire-us-btn,
body.ieesspp-dark-mode #block06 a.hire-us-button {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
    color: #FFFFFF !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

/* --------------------------------------------------------------------------
   5. TABLERO EJECUTIVO (/my/) Y MIS CURSOS (/my/courses.php)
   -------------------------------------------------------------------------- */
body.ieesspp-dark-mode#page-my-index .dashboard-main-title,
body.ieesspp-dark-mode .page-header-headings h1,
body.ieesspp-dark-mode section.block_myoverview h5.card-title {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode#page-my-index .dashboard-main-subtitle,
body.ieesspp-dark-mode .breadcrumb,
body.ieesspp-dark-mode .breadcrumb a {
    color: #94A3B8 !important;
}

body.ieesspp-dark-mode .breadcrumb span.current,
body.ieesspp-dark-mode .breadcrumb a:hover {
    color: #60A5FA !important;
}

body.ieesspp-dark-mode#page-my-index .dashboard-header-actions .btn,
body.ieesspp-dark-mode.pagelayout-mycourses #page-header a[href*="manage"] {
    background: #1E293B !important;
    color: #F8FAFC !important;
    border-color: #334155 !important;
}

body.ieesspp-dark-mode#page-my-index .dashboard-header-actions .btn:hover {
    background: #1E3A8A !important;
    border-color: #3B82F6 !important;
    color: #FFFFFF !important;
}

/* Eliminación de tarjeta blanca nativa y fondos en Mis Cursos (/my/courses.php) */
body.ieesspp-dark-mode.pagelayout-mycourses section.block_myoverview,
body.ieesspp-dark-mode.pagelayout-mycourses section.block_myoverview.card,
body.ieesspp-dark-mode.pagelayout-mycourses section.block_myoverview > .card-body,
body.ieesspp-dark-mode section.block_myoverview,
body.ieesspp-dark-mode section.block_myoverview.card,
body.ieesspp-dark-mode section.block_myoverview > .card-body,
body.ieesspp-dark-mode .block_myoverview.card,
body.ieesspp-dark-mode .block_myoverview,
body.ieesspp-dark-mode .block_myoverview .content,
body.ieesspp-dark-mode .block_myoverview .paged-content-page-container,
body.ieesspp-dark-mode.pagelayout-mycourses #region-main .card,
body.ieesspp-dark-mode.pagelayout-mycourses #region-main .block,
html[data-ieesspp-theme="dark"] section.block_myoverview,
html[data-ieesspp-theme="dark"] section.block_myoverview.card {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline,
body.ieesspp-dark-mode#page-my-index .block_calendar_month,
body.ieesspp-dark-mode#page-my-index .block_calendar_upcoming,
body.ieesspp-dark-mode#page-my-index .dashboard-upcoming-card,
body.ieesspp-dark-mode#page-my-index .kpi-card,
body.ieesspp-dark-mode [data-region="filter"],
body.ieesspp-dark-mode .block_myoverview [data-region="filter"],
body.ieesspp-dark-mode .block_myoverview .filter-container,
body.ieesspp-dark-mode .card.dashboard-card,
body.ieesspp-dark-mode .card.course-card,
html[data-ieesspp-theme="dark"] [data-region="filter"] {
    background: #111827 !important;
    background-color: #111827 !important;
    border-color: #1E293B !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline h5.card-title,
body.ieesspp-dark-mode#page-my-index .block_calendar_month h5.card-title,
body.ieesspp-dark-mode#page-my-index .block_calendar_upcoming h5.card-title,
body.ieesspp-dark-mode#page-my-index .upcoming-title-group .card-title,
body.ieesspp-dark-mode#page-my-index .kpi-value {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline [data-region="timeline-view"] .dropdown-toggle,
body.ieesspp-dark-mode#page-my-index .block_timeline [data-region="timeline-view"] input.form-control,
body.ieesspp-dark-mode#page-my-index .block_calendar_month select.form-control,
body.ieesspp-dark-mode [data-region="filter"] .dropdown-toggle,
body.ieesspp-dark-mode .block_myoverview [data-region="filter"] .dropdown-toggle,
body.ieesspp-dark-mode .block_myoverview [data-action="grouping-selector"] .btn,
body.ieesspp-dark-mode .block_myoverview [data-action="sort-selector"] .btn,
body.ieesspp-dark-mode .block_myoverview [data-action="display-selector"] .btn,
body.ieesspp-dark-mode .block_myoverview input[data-action="search-input"],
body.ieesspp-dark-mode [data-region="filter"] input.form-control {
    background: #1E293B !important;
    background-color: #1E293B !important;
    border: 1.5px solid #334155 !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline .timeline-event-list-item,
body.ieesspp-dark-mode#page-my-index .block_timeline [data-region="event-list-item"] {
    background: #161F33 !important;
    border-color: #1E293B !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline [data-region="event-list-item"]:hover {
    border-color: #334155 !important;
    border-left-color: #38BDF8 !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline [data-region="event-list-item"] h6.event-name,
body.ieesspp-dark-mode#page-my-index .block_timeline h6.event-name a {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline h6.event-name a:hover {
    color: #38BDF8 !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline .timeline-name > small.text-nowrap {
    background: #1E293B !important;
    color: #CBD5E1 !important;
    border-color: #334155 !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline .activityiconcontainer.small {
    background: rgba(30, 58, 138, 0.35) !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline .event-name-container small.mb-0 {
    background: rgba(30, 58, 138, 0.3) !important;
    color: #93C5FD !important;
}

body.ieesspp-dark-mode#page-my-index .block_timeline .empty-placeholder-image-lg,
body.ieesspp-dark-mode#page-my-index .upcoming-empty-item,
body.ieesspp-dark-mode#page-my-index .block_calendar_upcoming .event {
    background: #161F33 !important;
    border-color: #1E293B !important;
    color: #E2E8F0 !important;
}

body.ieesspp-dark-mode#page-my-index .upcoming-empty-main,
body.ieesspp-dark-mode#page-my-index .block_calendar_upcoming .event a {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode#page-my-index .upcoming-header-bar,
body.ieesspp-dark-mode#page-my-index .upcoming-footer-bar {
    border-color: #1E293B !important;
}

/* Calendario en Tablero */
body.ieesspp-dark-mode#page-my-index .block_calendar_month .maincalendar .current,
body.ieesspp-dark-mode#page-my-index .block_calendar_month .maincalendar .current a {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode#page-my-index .block_calendar_month .maincalendar .previous,
body.ieesspp-dark-mode#page-my-index .block_calendar_month .maincalendar .next {
    color: #94A3B8 !important;
}

body.ieesspp-dark-mode#page-my-index .block_calendar_month table.calendarmonth td .day-number-circle,
body.ieesspp-dark-mode#page-my-index .block_calendar_month table.calendarmonth td a {
    color: #CBD5E1 !important;
}

body.ieesspp-dark-mode#page-my-index .block_calendar_month table.calendarmonth td:hover:not(.empty) {
    background: #1E293B !important;
    color: #FFFFFF !important;
}

body.ieesspp-dark-mode#page-my-index .block_calendar_month table.calendarmonth td.today .day-number-circle {
    background: #D4AF37 !important;
    color: #071933 !important;
}

/* Tarjetas en Mis Cursos */
body.ieesspp-dark-mode .card.dashboard-card .coursename,
body.ieesspp-dark-mode .card.dashboard-card a.coursename {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .card.dashboard-card:hover a.coursename {
    color: #FBBF24 !important;
}

body.ieesspp-dark-mode .card.dashboard-card .categoryname {
    color: #94A3B8 !important;
}

body.ieesspp-dark-mode .card.course-card .progress {
    background: #1E293B !important;
}

body.ieesspp-dark-mode .card.dashboard-card .card-footer {
    background: #0F172A !important;
    border-top-color: #1E293B !important;
    color: #94A3B8 !important;
}

body.ieesspp-dark-mode .card.dashboard-card .card-footer .dropdown-toggle:hover {
    background: #1E293B !important;
    color: #F8FAFC !important;
}

/* Vista de Lista o Resumen en Mis Cursos */
body.ieesspp-dark-mode .block_myoverview .list-group-item,
body.ieesspp-dark-mode .block_myoverview .course-listitem {
    background: #111827 !important;
    border-color: #1E293B !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode .block_myoverview .course-listitem a.coursename {
    color: #F8FAFC !important;
}

/* --------------------------------------------------------------------------
   6. CURSOS, MENÚ LATERAL (#courseindex), SECCIONES Y ACTIVIDADES
   -------------------------------------------------------------------------- */
/* Barra de pestañas secundarias (Curso, Configuración, Participantes, Calificaciones...) */
body.ieesspp-dark-mode .secondary-navigation .moremenu {
    background: #111827 !important;
    border-color: #1E293B !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

body.ieesspp-dark-mode .secondary-navigation .nav-tabs .nav-link,
body.ieesspp-dark-mode .secondary-navigation .dropdown-item {
    color: #94A3B8 !important;
    background: transparent !important;
}

body.ieesspp-dark-mode .secondary-navigation .nav-tabs .nav-link:hover,
body.ieesspp-dark-mode .secondary-navigation a:hover {
    background: #1E293B !important;
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .secondary-navigation .nav-link[aria-selected="true"],
body.ieesspp-dark-mode .secondary-navigation .nav-link.active {
    background: linear-gradient(135deg, #1E3A8A 0%, #0F2C59 100%) !important;
    color: #FFFFFF !important;
    border-color: rgba(212, 175, 55, 0.45) !important;
}

/* Menú lateral izquierdo de índice del curso (Drawer) */
body.ieesspp-dark-mode .drawer.drawer-left,
body.ieesspp-dark-mode .drawer.drawer-left .drawerheader,
body.ieesspp-dark-mode .drawer.drawer-left .drawercontent,
body.ieesspp-dark-mode #courseindex {
    background: #0F172A !important;
    background-color: #0F172A !important;
    border-color: #1E293B !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode .drawer.drawer-left .drawerheader button.drawertoggle {
    background: #1E293B !important;
    color: #CBD5E1 !important;
    border-color: #334155 !important;
}

body.ieesspp-dark-mode #courseindex .courseindex-section {
    background: #111827 !important;
    border-color: #1E293B !important;
}

body.ieesspp-dark-mode #courseindex .courseindex-section:hover {
    border-color: #334155 !important;
}

body.ieesspp-dark-mode #courseindex .courseindex-item.courseindex-section-title {
    background: #161F33 !important;
    border-bottom-color: #1E293B !important;
}

body.ieesspp-dark-mode #courseindex .courseindex-section-title a.courseindex-link,
body.ieesspp-dark-mode #courseindex .courseindex-chevron {
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode #courseindex .courseindex-chevron:hover {
    background: #1E293B !important;
    color: #FBBF24 !important;
}

body.ieesspp-dark-mode #courseindex .courseindex-sectioncontent {
    background: #111827 !important;
}

body.ieesspp-dark-mode #courseindex .courseindex-sectioncontent a.courseindex-link {
    color: #94A3B8 !important;
}

body.ieesspp-dark-mode #courseindex .courseindex-sectioncontent a.courseindex-link:hover {
    background: #1E293B !important;
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode #courseindex .courseindex-sectioncontent li.courseindex-item.pageitem a.courseindex-link {
    background: #0284C7 !important;
    color: #FFFFFF !important;
}

/* Cabeceras de Sección / Unidad en Curso */
body.ieesspp-dark-mode.path-course-view .course-content .course-section .course-section-header,
body.ieesspp-dark-mode.path-course-section .course-section .course-section-header,
body.ieesspp-dark-mode .course-section .course-section-header {
    background: #111827 !important;
    border-color: #1E293B !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

body.ieesspp-dark-mode .course-section-header h3,
body.ieesspp-dark-mode .course-section-header .sectionname,
body.ieesspp-dark-mode .course-section-header .sectionname a {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode a[data-action="collapse-all"],
body.ieesspp-dark-mode a[data-action="expand-all"] {
    background: #1E293B !important;
    color: #CBD5E1 !important;
    border-color: #334155 !important;
}

body.ieesspp-dark-mode a[data-action="collapse-all"]:hover,
body.ieesspp-dark-mode a[data-action="expand-all"]:hover {
    background: #1E3A8A !important;
    color: #FFFFFF !important;
    border-color: #3B82F6 !important;
}

/* Tarjetas de Actividad en Curso (Sobrescribe con máxima especificidad moodle_course_clean_executive.css) */
body.ieesspp-dark-mode.path-course-view .activity-item,
body.ieesspp-dark-mode.path-course-section .activity-item,
body.ieesspp-dark-mode.pagelayout-course .activity-item,
body.ieesspp-dark-mode.pagelayout-incourse .activity-item,
body.ieesspp-dark-mode[class*="path-mod-"] .activity-item,
body.ieesspp-dark-mode .activity-item,
body.ieesspp-dark-mode li.activity,
html[data-ieesspp-theme="dark"] .activity-item {
    background: #111827 !important;
    background-color: #111827 !important;
    border: 1px solid #1E293B !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode.path-course-view .activity-item:hover,
body.ieesspp-dark-mode.path-course-section .activity-item:hover,
body.ieesspp-dark-mode .activity-item:hover {
    background: #161F33 !important;
    background-color: #161F33 !important;
    border-color: #334155 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
}

body.ieesspp-dark-mode .activity-item .instancename,
body.ieesspp-dark-mode .activity-item .activityname a,
body.ieesspp-dark-mode .activity-item a.aalink {
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode .activity-item .activityname a:hover,
body.ieesspp-dark-mode .activity-item a.aalink:hover,
body.ieesspp-dark-mode .activity-item .activityname a:hover .instancename {
    color: #38BDF8 !important;
}

body.ieesspp-dark-mode .activity-item .activityname a:hover,
body.ieesspp-dark-mode .activity-item .activityname a:hover .instancename {
    color: #38BDF8 !important;
}

body.ieesspp-dark-mode .activity-item .description .course-description-item,
body.ieesspp-dark-mode .activity-item .activity-altcontent,
body.ieesspp-dark-mode .activity-item .activity-availability {
    background: #161F33 !important;
    color: #CBD5E1 !important;
    border-color: #1E293B !important;
}

body.ieesspp-dark-mode .section-modchooser-link {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #60A5FA !important;
}

body.ieesspp-dark-mode .section-modchooser-link:hover {
    background: #1E293B !important;
    border-color: #60A5FA !important;
    color: #FFFFFF !important;
}

/* --------------------------------------------------------------------------
   7. INTERIOR DE ACTIVIDADES (PÁGINAS, TAREAS, FOROS, EXÁMENES, CALIFICACIONES)
   -------------------------------------------------------------------------- */
body.ieesspp-dark-mode[class*="path-mod-"] #region-main,
body.ieesspp-dark-mode .card,
body.ieesspp-dark-mode .box.generalbox,
body.ieesspp-dark-mode .grade-report-user .user-report-container {
    background: #111827 !important;
    background-color: #111827 !important;
    border-color: #1E293B !important;
    color: #E2E8F0 !important;
}

body.ieesspp-dark-mode[class*="path-mod-"] .activity-header,
body.ieesspp-dark-mode[class*="path-mod-"] .activity-information,
body.ieesspp-dark-mode[class*="path-mod-"] .activity-description {
    background: #161F33 !important;
    border-color: #1E293B !important;
    color: #CBD5E1 !important;
}

body.ieesspp-dark-mode[class*="path-mod-"] .activity-header h2,
body.ieesspp-dark-mode #region-main h2,
body.ieesspp-dark-mode #region-main h3,
body.ieesspp-dark-mode #region-main h4 {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode[class*="path-mod-"] .section-navigation .btn {
    background: #111827 !important;
    border-color: #1E293B !important;
    color: #E2E8F0 !important;
}

body.ieesspp-dark-mode[class*="path-mod-"] .section-navigation .btn:hover {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #FBBF24 !important;
}

/* Adaptación inteligente de tarjetas HTML inline dentro de mod_page (ej. Currículas y Calendarios) */
body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background: #FFFFFF"],
body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background:#FFFFFF"],
body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background: #ffffff"],
body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background:#ffffff"],
body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background-color: #ffffff"],
body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background-color:#ffffff"] {
    background: #161F33 !important;
    border-color: #26334D !important;
    color: #E2E8F0 !important;
}

body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background: #F8FAFC"],
body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background:#F8FAFC"],
body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background: #f8fafc"],
body.ieesspp-dark-mode #region-main .box.generalbox div[style*="background: #F1F5F9"],
body.ieesspp-dark-mode #region-main .box.generalbox a[style*="background: #FFFFFF"] {
    background: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode #region-main .box.generalbox [style*="color: #0F2C59"],
body.ieesspp-dark-mode #region-main .box.generalbox [style*="color:#0F2C59"],
body.ieesspp-dark-mode #region-main .box.generalbox [style*="color: #071933"],
body.ieesspp-dark-mode #region-main .box.generalbox [style*="color:#071933"],
body.ieesspp-dark-mode #region-main .box.generalbox [style*="color: #0F172A"],
body.ieesspp-dark-mode #region-main .box.generalbox [style*="color:#0F172A"],
body.ieesspp-dark-mode #region-main .box.generalbox [style*="color: #1E293B"] {
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode #region-main .box.generalbox [style*="color: #475569"],
body.ieesspp-dark-mode #region-main .box.generalbox [style*="color: #64748B"],
body.ieesspp-dark-mode #region-main .box.generalbox [style*="color:#64748B"] {
    color: #94A3B8 !important;
}

/* Tablas Generales, Calificador, Entregas de Tareas y Foros */
body.ieesspp-dark-mode .gradingtable,
body.ieesspp-dark-mode table#submissions,
body.ieesspp-dark-mode .generaltable,
body.ieesspp-dark-mode .forumheaderlist,
body.ieesspp-dark-mode body[class*="path-mod-quiz"] .no-overflow {
    background: #111827 !important;
    border-color: #1E293B !important;
    color: #E2E8F0 !important;
}

body.ieesspp-dark-mode table.generaltable,
body.ieesspp-dark-mode .submissionstatustable table.generaltable,
body.ieesspp-dark-mode .submissionsummarytable table.generaltable,
body.ieesspp-dark-mode .feedback table.generaltable,
body.ieesspp-dark-mode #page-mod-assign-view .submissionstatustable table.generaltable,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionstatustable table.generaltable,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionsummarytable table.generaltable {
    background: #111827 !important;
    background-color: #111827 !important;
    border: 1px solid #1E293B !important;
    color: #E2E8F0 !important;
}

body.ieesspp-dark-mode table.generaltable th,
body.ieesspp-dark-mode .forumheaderlist th,
body.ieesspp-dark-mode .submissionstatustable th,
body.ieesspp-dark-mode .submissionstatustable th.c0,
body.ieesspp-dark-mode .submissionsummarytable th,
body.ieesspp-dark-mode .feedback table.generaltable th,
body.ieesspp-dark-mode .feedback table.generaltable th.c0,
body.ieesspp-dark-mode #page-mod-assign-view .submissionstatustable th,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionstatustable th,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionstatustable th.c0,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionstatustable table.generaltable th,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionstatustable table.generaltable th.c0,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionsummarytable table.generaltable th,
body.ieesspp-dark-mode[class*="path-mod-assign"] .feedback table.generaltable th,
body.ieesspp-dark-mode .path-grade-report-grader .gradeparent th#studentheader,
body.ieesspp-dark-mode .path-grade-report-grader .gradeparent tr.heading th {
    background: #161F33 !important;
    background-color: #161F33 !important;
    color: #F8FAFC !important;
    border-color: #1E293B !important;
}

body.ieesspp-dark-mode table.generaltable td,
body.ieesspp-dark-mode .forumheaderlist td,
body.ieesspp-dark-mode .submissionstatustable td,
body.ieesspp-dark-mode .submissionstatustable td.c1,
body.ieesspp-dark-mode .submissionsummarytable td,
body.ieesspp-dark-mode .feedback table.generaltable td,
body.ieesspp-dark-mode .feedback table.generaltable td.c1,
body.ieesspp-dark-mode #page-mod-assign-view .submissionstatustable td,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionstatustable td,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionstatustable td.c1,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionstatustable table.generaltable td,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionstatustable table.generaltable td.c1,
body.ieesspp-dark-mode[class*="path-mod-assign"] .submissionsummarytable table.generaltable td,
body.ieesspp-dark-mode[class*="path-mod-assign"] .feedback table.generaltable td,
body.ieesspp-dark-mode .grade-report-user table.user-grade td,
body.ieesspp-dark-mode .grade-report-user table.user-grade th {
    background: #111827 !important;
    background-color: #111827 !important;
    color: #CBD5E1 !important;
    border-color: #1E293B !important;
}

body.ieesspp-dark-mode table.generaltable tbody tr:hover td,
body.ieesspp-dark-mode #submissions tbody tr:hover td,
body.ieesspp-dark-mode .forumheaderlist tbody tr:hover td,
body.ieesspp-dark-mode .submissionstatustable tbody tr:hover td,
body.ieesspp-dark-mode .submissionsummarytable tbody tr:hover td {
    background-color: #1A243B !important;
}

body.ieesspp-dark-mode table.generaltable td a,
body.ieesspp-dark-mode .gradingtable td.c1 a,
body.ieesspp-dark-mode .forumheaderlist td a,
body.ieesspp-dark-mode .path-grade-report-user table.user-grade td.column-itemname a {
    color: #60A5FA !important;
}

body.ieesspp-dark-mode table.generaltable .fileuploadsubmission a {
    background: #1E293B !important;
    color: #93C5FD !important;
    border-color: #334155 !important;
}

/* Mensajes y Discusiones en Foros + Módulo de Depuración Masiva */
body.ieesspp-dark-mode .forumpost,
body.ieesspp-dark-mode [data-region-content="forum-post-core"],
body.ieesspp-dark-mode .ieesspp-bulk-delete-wrapper .card {
    background: #161F33 !important;
    border-color: #26334D !important;
    color: #E2E8F0 !important;
}

body.ieesspp-dark-mode .forumpost .header h3,
body.ieesspp-dark-mode [data-region-content="forum-post-core"] h3 {
    color: #F8FAFC !important;
}

/* Cuestionarios / Exámenes (.que) */
body.ieesspp-dark-mode .que .info,
body.ieesspp-dark-mode .que .content,
body.ieesspp-dark-mode .que .formulation {
    background: #161F33 !important;
    border-color: #26334D !important;
    color: #F1F5F9 !important;
}

/* --------------------------------------------------------------------------
   8. PERFIL DE USUARIO (#page-user-profile) Y ADMINISTRACIÓN DEL SITIO
   -------------------------------------------------------------------------- */
body.ieesspp-dark-mode#page-user-profile .profile-hero-card,
body.ieesspp-dark-mode#page-user-profile .profile_tree .node_category.card,
body.ieesspp-dark-mode.pagelayout-mypublic .profile_tree .node_category.card {
    background: #111827 !important;
    border-color: #1E293B !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

body.ieesspp-dark-mode#page-user-profile .profile-user-name,
body.ieesspp-dark-mode#page-user-profile .section-headline h2,
body.ieesspp-dark-mode#page-user-profile .profile_tree .node_category h3.lead {
    color: #F8FAFC !important;
    border-bottom-color: #1E293B !important;
}

body.ieesspp-dark-mode#page-user-profile .micro-kicker,
body.ieesspp-dark-mode#page-user-profile .profile_tree .node_category h3.lead a,
body.ieesspp-dark-mode#page-user-profile .profile_tree a[href*="edit.php"] {
    color: #60A5FA !important;
    background: transparent !important;
}

body.ieesspp-dark-mode#page-user-profile .profile_tree li,
body.ieesspp-dark-mode#page-user-profile .profile_tree dd,
body.ieesspp-dark-mode#page-user-profile .profile_tree li a {
    color: #E2E8F0 !important;
    border-bottom-color: #1E293B !important;
}

body.ieesspp-dark-mode#page-user-profile .profile_tree dd a,
body.ieesspp-dark-mode#page-user-profile .profile_tree li a:hover {
    color: #60A5FA !important;
}

body.ieesspp-dark-mode#page-user-profile .btn-profile-outline {
    background: #1E293B !important;
    color: #F8FAFC !important;
    border-color: #334155 !important;
}

/* Administración del Sitio (Sobrescribe selectores #page-admin-search y #page-admin-index de moodle_global_executive.css) */
body.ieesspp-dark-mode#page-admin-search .tab-content,
body.ieesspp-dark-mode#page-admin-index .tab-content,
body.ieesspp-dark-mode.pagelayout-admin .tab-content,
body.ieesspp-dark-mode #adminsettings,
body.ieesspp-dark-mode .settingsform,
body.ieesspp-dark-mode.pagelayout-admin #region-main,
body.ieesspp-dark-mode#page-admin-search #region-main,
html[data-ieesspp-theme="dark"] #page-admin-search .tab-content,
html[data-ieesspp-theme="dark"] body.pagelayout-admin .tab-content {
    background: #111827 !important;
    background-color: #111827 !important;
    border: 1px solid #1E293B !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.45) !important;
}

body.ieesspp-dark-mode#page-admin-search .tab-pane .row > .col-sm-3 h4,
body.ieesspp-dark-mode#page-admin-search .tab-pane .row > .col-sm-3 .category-name,
body.ieesspp-dark-mode.pagelayout-admin .tab-pane .row > .col-sm-3 h4,
body.ieesspp-dark-mode.pagelayout-admin .tab-pane .row > .col-sm-3 .category-name,
body.ieesspp-dark-mode.pagelayout-admin .tab-pane .row > .col-sm-3 h3 {
    color: #60A5FA !important;
}

body.ieesspp-dark-mode#page-admin-search .tab-pane .row > .col-sm-9 ul.list-unstyled li a,
body.ieesspp-dark-mode.pagelayout-admin .tab-pane .row > .col-sm-9 ul.list-unstyled li a {
    background: #161F33 !important;
    background-color: #161F33 !important;
    border: 1px solid #1E293B !important;
    color: #93C5FD !important;
}

body.ieesspp-dark-mode#page-admin-search .tab-pane .row > .col-sm-9 ul.list-unstyled li a:hover,
body.ieesspp-dark-mode.pagelayout-admin .tab-pane .row > .col-sm-9 ul.list-unstyled li a:hover {
    background: #1E293B !important;
    border-color: #D4AF37 !important;
    color: #FBBF24 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.ieesspp-dark-mode#page-admin-search .tab-pane .row > .col-sm-9 hr,
body.ieesspp-dark-mode.pagelayout-admin .tab-pane .row > .col-sm-9 hr {
    border-top: 1px solid #1E293B !important;
}

/* Banner de alertas en administración y sitio */
body.ieesspp-dark-mode.pagelayout-admin .alert-warning,
body.ieesspp-dark-mode#page-admin-search .alert-warning,
body.ieesspp-dark-mode .alert-info,
body.ieesspp-dark-mode .alert-warning {
    background-color: #161F33 !important;
    border-color: #334155 !important;
    color: #E2E8F0 !important;
}

/* --------------------------------------------------------------------------
   9. FORMULARIOS, INPUTS, SELECTS Y MODALES GENERALES
   -------------------------------------------------------------------------- */
body.ieesspp-dark-mode .form-control,
body.ieesspp-dark-mode .custom-select,
body.ieesspp-dark-mode select,
body.ieesspp-dark-mode input[type="text"],
body.ieesspp-dark-mode input[type="search"],
body.ieesspp-dark-mode input[type="number"],
body.ieesspp-dark-mode input[type="date"],
body.ieesspp-dark-mode textarea {
    background-color: #1E293B !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .form-control::placeholder,
body.ieesspp-dark-mode input::placeholder {
    color: #64748B !important;
}

body.ieesspp-dark-mode .modal-content,
body.ieesspp-dark-mode .moodle-dialogue-base .moodle-dialogue-wrap {
    background-color: #111827 !important;
    border-color: #1E293B !important;
    color: #F1F5F9 !important;
}

body.ieesspp-dark-mode .modal-header,
body.ieesspp-dark-mode .modal-footer,
body.ieesspp-dark-mode .moodle-dialogue-base .moodle-dialogue-wrap .moodle-dialogue-hd {
    background-color: #0F172A !important;
    border-color: #1E293B !important;
    color: #F8FAFC !important;
}

body.ieesspp-dark-mode .modal-title,
body.ieesspp-dark-mode .col-form-label,
body.ieesspp-dark-mode legend {
    color: #F8FAFC !important;
}
