html[data-theme="dark"] .k-alert{
    background:#20262d!important;
    color:#f1f5f9!important;
    border-color:#46515d!important;
}
html[data-theme="dark"] .k-alert.k-ok{
    background:#173d25!important;
    color:#e3f9e9!important;
}
html[data-theme="dark"] .k-alert.k-warn{
    background:#493815!important;
    color:#fff1c7!important;
}
html[data-theme="dark"] .k-alert.k-bad{
    background:#4a2024!important;
    color:#ffe7e9!important;
}

/* =========================================================
   KAHUIDE DARK FIX 2 - CUADROS INFORMATIVOS
   Solo presentación en modo oscuro
   ========================================================= */

html[data-theme="dark"] .k-info,
html[data-theme="dark"] .k-data,
html[data-theme="dark"] .k-program-preview,
html[data-theme="dark"] .k-basket,
html[data-theme="dark"] .k-example,
html[data-theme="dark"] .year-note,
html[data-theme="dark"] .k-year-note,
html[data-theme="dark"] .k-period-hint,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .k-mass-note,
html[data-theme="dark"] .k-directory-note,
html[data-theme="dark"] .k-note:not(.warn):not(.ok):not(.hist) {
    background:#1d2d36!important;
    color:#edf6fa!important;
    border-color:#3d6678!important;
}

/* Texto dentro de esos cuadros */
html[data-theme="dark"] .k-data strong,
html[data-theme="dark"] .k-data span,
html[data-theme="dark"] .k-data p,
html[data-theme="dark"] .k-data small,
html[data-theme="dark"] .k-program-preview label,
html[data-theme="dark"] .k-program-preview small,
html[data-theme="dark"] .k-program-preview p,
html[data-theme="dark"] .k-basket h2,
html[data-theme="dark"] .k-basket h3,
html[data-theme="dark"] .k-basket p,
html[data-theme="dark"] .year-note strong,
html[data-theme="dark"] .k-year-note strong,
html[data-theme="dark"] .k-note strong {
    color:inherit!important;
}

/* Cuadros verdes */
html[data-theme="dark"] .k-result,
html[data-theme="dark"] .linked-note,
html[data-theme="dark"] .credentials,
html[data-theme="dark"] .wa-message,
html[data-theme="dark"] .wa-unified-message,
html[data-theme="dark"] .k-wa-text,
html[data-theme="dark"] .k-preprod-safe {
    background:#173d25!important;
    color:#e3f9e9!important;
    border-color:#367d4b!important;
}

/* Cuadros amarillos / advertencia */
html[data-theme="dark"] .k-warning,
html[data-theme="dark"] .k-preprod-warning,
html[data-theme="dark"] .k-close-note,
html[data-theme="dark"] .k-note.warn {
    background:#493815!important;
    color:#fff1c7!important;
    border-color:#8f6c25!important;
}

/* Mantener los verdes semánticos */
html[data-theme="dark"] .k-note.ok {
    background:#173d25!important;
    color:#e3f9e9!important;
    border-color:#367d4b!important;
}

/* Ayuda grande dentro de tarjetas */
html[data-theme="dark"] .card > .help {
    background:#1d2d36!important;
    color:#edf6fa!important;
    border-color:#3d6678!important;
}

/* Cajas de operaciones especiales */
html[data-theme="dark"] .kp-box {
    background:#252a31!important;
    color:#edf1f5!important;
    border-color:#4b5563!important;
}

html[data-theme="dark"] .kp-info {
    background:#173948!important;
    color:#e6f6fc!important;
    border-color:#356d82!important;
}

html[data-theme="dark"] .kp-safe {
    background:#173d25!important;
    color:#e3f9e9!important;
    border-color:#367d4b!important;
}

html[data-theme="dark"] .kp-danger {
    background:#4a2024!important;
    color:#ffe7e9!important;
    border-color:#93434a!important;
}

/* FIX 2A - cuadros claros restantes */

html[data-theme="dark"] .k-program-preview,
html[data-theme="dark"] .k-note {
    background:#1d2d36!important;
    color:#edf6fa!important;
    border-color:#3d6678!important;
}

html[data-theme="dark"] .k-close-note {
    background:#493815!important;
    color:#fff1c7!important;
    border-color:#8f6c25!important;
}

/* FIX 3 - selector principal de programa en matrícula */
html[data-theme="dark"] .k-selector-primary,
body[data-theme="dark"] .k-selector-primary {
    background:#20262d !important;
    border-color:#46515d !important;
    color:#f1f5f9 !important;
}

html[data-theme="dark"] .k-selector-primary .k-field label,
body[data-theme="dark"] .k-selector-primary .k-field label {
    color:#f8fafc !important;
}

html[data-theme="dark"] .k-selector-primary .k-help,
body[data-theme="dark"] .k-selector-primary .k-help {
    color:#cbd5e1 !important;
}

/* FIX 4 - vacios de ficha y tarjetas de cursos sueltos */

/* Ficha consolidada:
   No hay cursos / matrículas / pagos */
html[data-theme="dark"] .empty,
body[data-theme="dark"] .empty {
    background:#20262d !important;
    color:#f1f5f9 !important;
    border-color:#46515d !important;
}

/* Reporte de cursos sueltos */
html[data-theme="dark"] .loose-course,
body[data-theme="dark"] .loose-course {
    background:#20262d !important;
    color:#f1f5f9 !important;
    border-color:#46515d !important;
}

html[data-theme="dark"] .loose-course strong,
body[data-theme="dark"] .loose-course strong {
    color:#f8fafc !important;
}

html[data-theme="dark"] .loose-course small,
body[data-theme="dark"] .loose-course small {
    color:#cbd5e1 !important;
}

/* ==========================================================
   FIX 5 - MODO OSCURO AUTOMATICO
   Ficha consolidada (.empty)
   Cursos sueltos (.loose-course)
   No modifica lógica ni datos.
   ========================================================== */

/* Modo oscuro seleccionado explícitamente */
html[data-theme="dark"] .empty,
html[data-theme="dark"] .loose-course {
    background:#20262d !important;
    color:#f1f5f9 !important;
    border-color:#46515d !important;
}

html[data-theme="dark"] .empty *,
html[data-theme="dark"] .loose-course strong {
    color:#f8fafc !important;
}

html[data-theme="dark"] .loose-course small {
    color:#cbd5e1 !important;
}

/* Modo oscuro AUTOMATICO del navegador / Windows */
@media (prefers-color-scheme: dark) {

    html:not([data-theme="light"]) .empty,
    html:not([data-theme="light"]) .loose-course {
        background:#20262d !important;
        color:#f1f5f9 !important;
        border-color:#46515d !important;
    }

    html:not([data-theme="light"]) .empty *,
    html:not([data-theme="light"]) .loose-course strong {
        color:#f8fafc !important;
    }

    html:not([data-theme="light"]) .loose-course small {
        color:#cbd5e1 !important;
    }
}
