/**
 * HIF — Solo modo claro (sin modo oscuro).
 * Cargar al final de la cadena CSS del layout.
 */

html {
    color-scheme: light only;
}

html[data-hif-theme="dark"],
html[data-hif-theme] {
    color-scheme: light only;
}

html[data-hif-theme="dark"] {
    /* Neutralizar atributo residual de sesiones antiguas */
}

html[data-hif-theme="dark"] body.hif-app {
    --hif-bg: #f5f7fa;
    --hif-surface: #ffffff;
    --hif-border: #dce3ea;
    --hif-text: #0f172a;
    --hif-text-secondary: #475569;
    --hif-text-disabled: #94a3b8;
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-light: #dce3ea;
    --nav-bg: #ffffff;
    --nav-text: #0f172a;
    background: var(--bg-page) !important;
    color: var(--text-primary) !important;
}

body.hif-app {
    background: var(--bg-page, #f5f7fa) !important;
    color: var(--text-primary, #0f172a) !important;
}

/* Sin forzar texto oscuro en chrome oscuro (navbar / sidebar / portal header) */
body.hif-app,
body.hif-app .main-content,
body.hif-app .content-wrapper,
body.hif-app .modal-content,
body.hif-app .modal-title,
body.hif-app .modal-body,
body.hif-app .card,
body.hif-app .card-body,
body.hif-app .table,
body.hif-app .form-label,
body.hif-app .form-control,
body.hif-app .form-select {
    color: var(--text-primary, #1C2430);
}

body.hif-app .text-muted {
    color: var(--text-muted, #5A6A7A) !important;
}

/* Chrome azul-negro pastel: texto claro solo en navbar/portal (no en menú activo claro) */
body.hif-app .navbar-hif .text-white,
body.hif-app .navbar-hif .navbar-text,
body.hif-app .hif-portal-header .text-white {
    color: #E8EEF4 !important;
}

body.hif-app.hif-ds-2026 .sidebar.hif-sidebar,
body.hif-app.hif-ds-2026 .sidebar-offcanvas,
body.hif-app.hif-ds-2026 .navbar-hif {
    background: #2A3544 !important;
    color: #E8EEF4 !important;
    border-color: transparent !important;
}

body.hif-app.hif-ds-2026 .hif-sidebar-nav .nav-link,
body.hif-app.hif-ds-2026 .hif-sidebar-nav .nav-link span {
    color: #FFFFFF !important;
}

body.hif-app.hif-ds-2026 .navbar-hif .navbar-text,
body.hif-app.hif-ds-2026 .navbar-hif .nav-link,
body.hif-app.hif-ds-2026 .navbar-hif .btn-link {
    color: #FFFFFF !important;
}

body.hif-app.hif-ds-2026 .hif-sidebar-nav .nav-link:hover {
    color: #FFFFFF !important;
}

/* Activo: pastel claro + texto oscuro (legible) */
body.hif-app.hif-ds-2026 .hif-sidebar-nav .nav-link.active {
    background: #E6EEF5 !important;
    color: #1C2430 !important;
}

body.hif-app.hif-ds-2026 .hif-sidebar-nav .nav-link.active span,
body.hif-app.hif-ds-2026 .hif-sidebar-nav .nav-link.active i.bi {
    color: #1C2430 !important;
}

/* Botones pastel navy */
body.hif-app .btn-primary,
body.hif-app .btn-primary:hover,
body.hif-app .btn-primary:focus,
body.hif-app .btn-primary:active {
    background-color: #4A6B86 !important;
    border-color: #4A6B86 !important;
    color: #fff !important;
}

body.hif-app .btn-success,
body.hif-app .btn-success:hover {
    background-color: #3D8B6E !important;
    border-color: #3D8B6E !important;
    color: #fff !important;
}

body.hif-app .btn-danger,
body.hif-app .btn-danger:hover {
    background-color: #C45B5B !important;
    border-color: #C45B5B !important;
    color: #fff !important;
}

body.hif-app .btn-warning,
body.hif-app .btn-warning:hover {
    background-color: #C48A2A !important;
    border-color: #C48A2A !important;
    color: #fff !important;
}

body.hif-app .btn-info,
body.hif-app .btn-info:hover,
body.hif-app .btn-dark,
body.hif-app .btn-dark:hover {
    background-color: #2A3544 !important;
    border-color: #2A3544 !important;
    color: #fff !important;
}

body.hif-app .badge.bg-primary { background-color: #E6EEF5 !important; color: #2A3544 !important; }
body.hif-app .badge.bg-success { background-color: #EAF6F1 !important; color: #1F5C45 !important; }
body.hif-app .badge.bg-danger { background-color: #F9EEEE !important; color: #8B3030 !important; }
body.hif-app .badge.bg-warning { background-color: #FBF5E9 !important; color: #7A5614 !important; }
body.hif-app .badge.bg-info { background-color: #E6EEF5 !important; color: #2A3544 !important; }
body.hif-app .badge.bg-dark { background-color: #2A3544 !important; color: #E8EEF4 !important; }

body.hif-app .cr-wizard-pills .badge.active-step {
    background: #4A6B86 !important;
    color: #fff !important;
    border: 1px solid #4A6B86;
}

/* —— Modal de notificación: texto siempre legible —— */
body.hif-app .hif-notification-modal .modal-content,
body.hif-app .hif-notification-modal .modal-header,
body.hif-app .hif-notification-modal .modal-body,
body.hif-app .hif-notification-modal .modal-footer {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.hif-app .hif-notification-modal .modal-header,
body.hif-app .hif-notification-modal .modal-footer {
    background: #f8fafc !important;
}

body.hif-app .hif-notification-modal .modal-title,
body.hif-app .hif-notification-modal__text,
body.hif-app .hif-notification-modal__text strong,
body.hif-app .hif-notification-modal__text span,
body.hif-app .hif-notification-modal__text li,
body.hif-app .hif-notification-modal .modal-body *:not(.bi) {
    color: #0f172a !important;
}

body.hif-app .hif-notification-modal__item--success,
body.hif-app .hif-notification-modal__item--success .hif-notification-modal__text,
body.hif-app .hif-notification-modal__item--success .hif-notification-modal__text strong,
body.hif-app .hif-notification-modal__item--success .hif-notification-modal__text span {
    background: #e8f8ed !important;
    color: #166534 !important;
}

body.hif-app .hif-notification-modal__item--success .hif-notification-modal__icon {
    color: #166534 !important;
}

body.hif-app .hif-notification-modal__item--error,
body.hif-app .hif-notification-modal__item--error .hif-notification-modal__text,
body.hif-app .hif-notification-modal__item--error .hif-notification-modal__text strong {
    background: #fde8e8 !important;
    color: #991b1b !important;
}

body.hif-app .hif-notification-modal__item--warning,
body.hif-app .hif-notification-modal__item--warning .hif-notification-modal__text,
body.hif-app .hif-notification-modal__item--warning .hif-notification-modal__text strong {
    background: #fef3c7 !important;
    color: #92400e !important;
}

body.hif-app .hif-notification-modal__item--info,
body.hif-app .hif-notification-modal__item--info .hif-notification-modal__text,
body.hif-app .hif-notification-modal__item--info .hif-notification-modal__text strong {
    background: #e0f2fe !important;
    color: #0c4a6e !important;
}

body.hif-app .hif-notification-modal .modal-footer .btn-primary {
    background: #dbeafe !important;
    border-color: #93c5fd !important;
    color: #0f3d5e !important;
}

body.hif-app .hif-notification-modal .modal-footer .btn-primary:hover {
    background: #bfdbfe !important;
    border-color: #60a5fa !important;
    color: #0f3d5e !important;
}

/* Confirmación */
body.hif-app .hif-confirm-modal .modal-content,
body.hif-app .hif-confirm-modal .modal-header,
body.hif-app .hif-confirm-modal .modal-body,
body.hif-app .hif-confirm-modal .modal-footer {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* Portal móvil: tipografía secundaria legible */
@media (max-width: 767.98px) {
    body.hif-app .hif-portal-body .portal-app-main > .text-muted:not(.hif-portal-card *),
    body.hif-app .hif-portal-body .cliente-main > .text-muted:not(.card *) {
        color: #64748b !important;
    }
}

/* Logos: variante clara */
html .hif-logo--dark {
    display: none !important;
}

html .hif-logo--light {
    display: inline-block !important;
}
