html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: hidden;
}

:root {
    --igim-input-focus-border: var(--igim-ui-accent, #f58220);
    --igim-input-focus-ring: transparent;
    --dxbl-text-edit-focus-border-color: var(--igim-ui-accent, #f58220);
    --dxbl-text-edit-focus-shadow-color: transparent;
}

body.app-menu-open {
    overflow: hidden;
}

/* Shell principal estilo Lansweeper (global: aplica a componentes hijos) */
#app-topbar.app-topbar {
    flex: 0 0 auto;
    height: var(--app-topbar-height, 2.85rem);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0 1rem;
    background: var(--igim-topbar-gradient, linear-gradient(90deg, #0b4f8a 0%, #0c528d 100%));
    color: #ffffff;
    border-bottom: 2px solid var(--igim-topbar-border, #f58220);
    z-index: 50;
}

#app-menu-toggle.app-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    margin: 0;
}

.app-menu-toggle-caption {
    display: none;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
    white-space: nowrap;
}

#app-menu-toggle.app-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.app-menu-toggle-icon {
    width: 1.15rem;
    height: 1.15rem;
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M2 3h12M2 8h12M2 13h12'/%3e%3c/svg%3e") no-repeat center/contain;
}

.app-topbar-brand {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    min-width: 0;
}

.app-logo-main {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
}

.app-logo-accent {
    color: var(--igim-wordmark-accent, #f58220);
    font-size: 1rem;
    font-weight: 700;
}

.app-topbar-version {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.68);
    white-space: nowrap;
}

.app-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.app-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-topbar-link i {
    color: #9ca3af;
    font-size: 0.95rem;
}

.app-topbar-link-text {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 42vw;
}

.app-topbar-action {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.app-topbar-action:hover,
.app-topbar-action:focus-visible {
    color: #ffffff;
    text-decoration: none;
}

a.app-topbar-action:link,
a.app-topbar-action:visited {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
}

#app-sidebar.app-sidebar {
    background: var(--igim-sidebar-gradient, linear-gradient(180deg, #0b4f8a 0%, #08365f 100%));
    --sb-pad-l1-y: 12px;
    --sb-pad-l1-x: 20px;
}

/* Cabecera interna del menú eliminada: ocultar si queda HTML en caché */
#app-sidebar .nav-menu-header,
#app-sidebar .nav-menu-title,
#app-sidebar .nav-sidebar-collapse-btn,
#app-sidebar .nav-collapse-caption {
    display: none !important;
}

#app-shell .app-content {
    background: #ffffff;
}

#app-shell .app-content:has(.report-workspace-active) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#app-shell .app-content:has(.report-workspace-active) > .exportacion-excel-page,
#app-shell .app-content:has(.report-workspace-active) > .cartera-page,
#app-shell .app-content:has(.report-workspace-active) > .ccs-consulta {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

/* Colapso del menú lateral */
@media (min-width: 769px) {
    #app-shell:has(#app-sidebar-state:checked) {
        --sidebar-current-width: 64px;
    }

    html[data-sidebar-collapsed="true"] #app-menu-toggle.app-menu-toggle {
        width: auto;
        min-width: 2rem;
        padding: 0 0.55rem 0 0.35rem;
    }

    html[data-sidebar-collapsed="true"] .app-menu-toggle-caption {
        display: inline;
    }
}

@media (max-width: 768px) {
    .app-topbar-version,
    .app-topbar-link-text {
        display: none;
    }
}

@media (max-width: 768px) {
    #app-shell:has(#app-sidebar-state:checked) #app-sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.22);
    }

    #app-shell:has(#app-sidebar-state:checked) #app-sidebar-backdrop {
        display: block;
    }
}

a, .btn-link {
    color: var(--igim-btn-primary-bg, #0b4f8a);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-check-input:focus {
    box-shadow: var(--igim-btn-focus-ring, 0 0 0 0.2rem rgba(11, 79, 138, 0.25));
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus,
input.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus,
.reporte-grilla-buscar:focus {
    border-color: var(--igim-input-focus-border) !important;
    outline: none !important;
    box-shadow: none !important;
}

.content {
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: none;
    border-color: #c8ced6;
    box-shadow: none;
}

.login-form .login-input,
.login-form select.login-input {
    outline: none;
    box-shadow: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.login-form .login-input:focus,
.login-form select.login-input:focus,
.login-form .login-input:focus-visible,
.login-form select.login-input:focus-visible {
    outline: none !important;
    border: 1px solid var(--igim-input-focus-border, #f58220) !important;
    box-shadow: none !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
}

.login-form .login-input.valid.modified:not([type=checkbox]),
.login-form .login-input.modified.valid:not([type=checkbox]),
.login-form select.login-input.valid.modified:not([type=checkbox]) {
    outline: none;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    background: #ffffff;
}

.login-form .login-input.invalid,
.login-form select.login-input.invalid {
    outline: none;
    border-color: #d9534f;
    box-shadow: none;
}

/* DevExpress: solo borde naranja al foco, sin sombra */
.dxbl-text-edit.dxbl-focused,
.dxbl-text-edit-input:focus,
.dxbl-text-edit-input:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.cartera-grid-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid #dbe3ee;
    background: #f8fafc;
}

.cartera-grid-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.85rem;
    min-width: 0;
}

.cartera-grid-toolbar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.cartera-grid-toolbar-meta {
    font-size: 0.82rem;
    color: #6b7280;
}

.cartera-grid-toolbar-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.cartera-grid {
    flex: 1 1 auto;
    height: calc(100vh - var(--app-topbar-height, 3.5rem) - var(--app-footer-height, 2rem) - var(--app-content-chrome, 8.5rem));
    min-height: 420px;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    padding-bottom: 0.5rem;
}

.cartera-grid .dxbl-grid {
    height: 100%;
}

.cartera-dx-grid .dxbl-grid-footer,
.cartera-dx-grid .dxbl-grid-group-footer {
    font-weight: 600;
    background-color: #f1f5f9;
}

.cartera-dx-grid .dxbl-grid-footer .dxbl-grid-summary-item,
.cartera-dx-grid .dxbl-grid-group-footer .dxbl-grid-summary-item {
    color: #0f172a;
    overflow: visible;
    white-space: nowrap;
    line-height: 1.35;
    padding: 0.2rem 0.35rem;
}

.cartera-dx-grid .dxbl-grid-footer-row,
.cartera-dx-grid .dxbl-grid-group-footer-row {
    min-height: 2.25rem;
}

.cartera-dx-grid .dxbl-grid-footer-cell,
.cartera-dx-grid .dxbl-grid-group-footer-cell {
    overflow: visible !important;
    vertical-align: middle;
}

.cartera-footer-cell {
    min-height: 1.5rem;
    cursor: context-menu;
    overflow: visible;
    white-space: nowrap;
    line-height: 1.35;
    padding: 0.15rem 0;
}

.cartera-header-caption {
    display: inline-block;
    width: 100%;
    cursor: context-menu;
}

.cartera-resumen-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
}

.cartera-resumen-menu-panel {
    position: fixed;
    z-index: 10050;
    min-width: 11rem;
    max-height: calc(100vh - 1rem);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.35rem 0;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1.25rem rgba(33, 37, 41, 0.2);
}

.cartera-resumen-menu-panel--arriba {
    transform: translateY(calc(-100% - 8px));
    transform-origin: bottom left;
}

html.igim-resumen-menu-open,
html.igim-resumen-menu-open body {
    overflow: visible !important;
}

.cartera-resumen-menu-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.85rem;
    border: 0;
    background: transparent;
    color: #212529;
    text-align: left;
    font-size: 0.925rem;
}

.cartera-resumen-menu-item:hover,
.cartera-resumen-menu-item:focus-visible {
    background-color: #f8f9fa;
}

.cartera-resumen-menu-section {
    padding: 0.35rem 0.85rem 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #6c757d;
}

.cartera-resumen-menu-divider {
    margin: 0.25rem 0;
    border-top: 1px solid #e9ecef;
}

.cartera-resumen-menu-hint {
    padding: 0.15rem 0.85rem 0.35rem;
    font-size: 0.78rem;
    color: #6c757d;
    line-height: 1.3;
}

.filter-panel {
    margin-bottom: 1rem;
    padding: 1rem;
}

.filter-panel .cartera-fecha-edit {
    width: 100%;
}

.report-export-menu {
    position: relative;
}

.report-export-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 8.5rem;
}

.report-export-trigger .bi-download {
    font-size: 1rem;
}

.report-export-chevron {
    font-size: 0.75rem;
    margin-left: 0.15rem;
    opacity: 0.75;
}

.report-export-menu-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 1050;
    min-width: 11.5rem;
    padding: 0.35rem 0;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.35rem 1rem rgba(33, 37, 41, 0.12);
}

.report-export-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.45rem 0.85rem;
    border: 0;
    background: transparent;
    color: #212529;
    text-align: left;
    font-size: 0.925rem;
}

.report-export-item:hover:not(:disabled),
.report-export-item:focus-visible:not(:disabled) {
    background-color: #f8f9fa;
    color: #212529;
}

.report-export-item:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.report-export-item .bi {
    font-size: 1rem;
    line-height: 1;
    color: #495057;
}

.report-export-toggle-item .bi-check-square-fill {
    color: #376da7;
}

.report-resumen-opciones-panel {
    min-width: 13rem;
}

.report-actions-menus {
    flex-shrink: 0;
}

.report-export-divider {
    height: 1px;
    margin: 0.35rem 0;
    background-color: #dee2e6;
}

@media print {
    body.igim-print-mode #app-topbar,
    body.igim-print-mode #app-sidebar,
    body.igim-print-mode .app-footer,
    body.igim-print-mode .filter-panel,
    body.igim-print-mode .page-title {
        display: none !important;
    }

    body.igim-print-mode .app-shell,
    body.igim-print-mode .app-body,
    body.igim-print-mode .app-main,
    body.igim-print-mode .app-content {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    body.igim-print-mode .igim-print-target {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    body.igim-print-mode .cartera-grid,
    body.igim-print-mode .cartera-grid .dxbl-grid {
        height: auto !important;
        overflow: visible !important;
    }

    body.igim-print-mode .dxbl-grid-pager,
    body.igim-print-mode .dxbl-pager {
        display: none !important;
    }
}

/* Menú colapsado en escritorio: solo íconos + panel flotante */
@media (min-width: 769px) {
    html[data-sidebar-collapsed="true"] #app-sidebar .nav-sidebar-expand-hint {
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        width: 100%;
        padding: 0.55rem 0.25rem 0.65rem;
        margin: 0;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.14);
        background: rgba(0, 0, 0, 0.12);
        color: rgba(255, 255, 255, 0.92);
        cursor: pointer;
        text-decoration: none;
        font-family: inherit;
        appearance: none;
        -webkit-appearance: none;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-sidebar-expand-hint:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-sidebar-expand-hint .menu-icon {
        font-size: 1.15rem;
        color: var(--igim-ui-accent, #74b9ff);
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-sidebar-expand-caption {
        font-size: 0.62rem;
        font-weight: 600;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        line-height: 1.1;
        text-align: center;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-scrollable {
        overflow-x: hidden;
        overflow-y: auto;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-caption,
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-caret,
    html[data-sidebar-collapsed="true"] #app-sidebar .nav-footer-caption {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 {
        margin-bottom: 0.15rem;
        padding-bottom: 0;
        border-bottom: none;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo {
        padding-left: 0 !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-link,
    html[data-sidebar-collapsed="true"] #app-sidebar .nav-footer-link {
        justify-content: center !important;
        align-items: center !important;
        width: 2.75rem !important;
        min-width: 2.75rem !important;
        max-width: 2.75rem !important;
        height: 2.75rem !important;
        min-height: 2.75rem !important;
        margin: 0.15rem auto !important;
        padding: 0 !important;
        gap: 0 !important;
        border-left: none !important;
        border-radius: 6px;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-menu-footer {
        display: flex;
        justify-content: center;
        align-items: center;
        padding-left: 0;
        padding-right: 0;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-menu-footer .nav-menu-footer-item {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-menu-footer .nav-footer-link {
        text-align: center !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-menu-footer .nav-footer-link .menu-icon {
        flex: 0 0 auto !important;
        width: auto !important;
        margin: 0 !important;
        line-height: 1;
        text-align: center;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .nav-menu-footer .nav-footer-link.active,
    html[data-sidebar-collapsed="true"] #app-sidebar .nav-menu-footer-item > .nav-footer-link.active {
        box-shadow: inset 0 0 0 2px var(--sb-active) !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-icon {
        margin: 0 auto;
        font-size: 1.15rem;
    }

    /* Ocultar submenús en barra; panel flotante al hover o clic */
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0.menu-nodo-has-children {
        position: relative;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-expander,
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-expander-leaf {
        display: none !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 > .menu-group,
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 > .menu-leaf {
        justify-content: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 > .menu-tree-children {
        display: none !important;
        position: fixed !important;
        left: 64px;
        top: 0;
        min-width: 280px;
        max-width: 300px;
        width: 280px;
        max-height: min(
            calc(100vh - var(--app-topbar-height, 2.85rem) - var(--app-footer-height, 1.85rem) - 1rem),
            520px
        );
        margin: 0;
        padding: 0.35rem 0 !important;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-left: 3px solid var(--igim-flyout-border, #f58220);
        border-radius: 0 6px 6px 0;
        background: var(--igim-flyout-gradient, linear-gradient(180deg, #0c4a86 0%, #08365f 100%));
        box-shadow: 8px 8px 28px rgba(0, 0, 0, 0.45);
        z-index: 1050;
        overflow-x: hidden;
        overflow-y: auto;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 > .menu-tree-children > .menu-nodo-level-1:first-child {
        margin-top: 0;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 > .menu-tree-children::before {
        content: attr(data-menu-title);
        display: block;
        padding: 0.65rem 1.25rem 0.5rem;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #adb5bd;
        border-bottom: 1px solid #495057;
        margin-bottom: 0.25rem;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0.menu-nodo-has-children:hover > .menu-tree-children,
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0.menu-flyout-open > .menu-tree-children {
        display: block !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-children .menu-caption,
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-children .nav-footer-caption {
        display: block !important;
        visibility: visible !important;
        width: auto !important;
        height: auto !important;
        overflow: hidden !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-children .menu-caret {
        display: inline-block !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-children .menu-tree-children:not(.is-expanded-open) {
        display: none !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-children .menu-tree-children.is-expanded-open {
        display: block !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-children .nav-link,
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-children .nav-footer-link {
        justify-content: flex-start !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        min-height: unset !important;
        margin: 0 !important;
        padding: 0.55rem 1.25rem !important;
        gap: 0.65rem !important;
        border-radius: 0 !important;
    }

    /* Tooltip para íconos sin submenú */
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-leaf > .nav-link[title]:hover::after,
    html[data-sidebar-collapsed="true"] #app-sidebar .nav-footer-link[title]:hover::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 0.55rem);
        top: 50%;
        transform: translateY(-50%);
        z-index: 1300;
        padding: 0.4rem 0.65rem;
        background: #1f2937;
        color: #ffffff;
        font-size: 0.82rem;
        white-space: nowrap;
        border-radius: 4px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
        pointer-events: none;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0.menu-nodo-has-children > .menu-group[title]:hover::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 0.55rem);
        top: 50%;
        transform: translateY(-50%);
        z-index: 1300;
        padding: 0.4rem 0.65rem;
        background: #1f2937;
        color: #ffffff;
        font-size: 0.82rem;
        white-space: nowrap;
        border-radius: 4px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
        pointer-events: none;
    }

    html[data-sidebar-collapsed="true"] #app-shell:has(#app-sidebar-state:checked) #app-sidebar-backdrop {
        display: none !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 > .menu-leaf.active,
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 > .menu-group.menu-group-active {
        background: var(--sb-active-bg) !important;
        box-shadow: inset 0 0 0 2px var(--sb-active) !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 > .menu-leaf.active .menu-icon,
    html[data-sidebar-collapsed="true"] #app-sidebar .menu-nodo-level-0 > .menu-group.menu-group-active .menu-icon {
        color: #ffffff !important;
    }

    html[data-sidebar-collapsed="true"] #app-sidebar .menu-tree-children a.nav-link.active {
        color: #ffffff !important;
        background: var(--sb-active-bg) !important;
        box-shadow: inset 3px 0 0 var(--sb-active) !important;
    }
}

/* ── Menú lateral 3 niveles (global: aplica a MenuNodoItem recursivo) ── */
#app-sidebar .menu-tree-view {
    --sb-text-l1: #ffffff;
    --sb-text-l2: #dee2e6;
    --sb-text-l3: #a5d8ff;
    --sb-muted: #adb5bd;
    --sb-line: rgba(255, 255, 255, 0.22);
    --sb-hover: rgba(255, 255, 255, 0.06);
    --sb-active: var(--igim-ui-accent, #74b9ff);
    --sb-active-bg: color-mix(in srgb, var(--igim-ui-accent, #74b9ff) 32%, transparent);
    --sb-active-bg-group: color-mix(in srgb, var(--igim-ui-accent, #74b9ff) 20%, transparent);
    --sb-indent-l2: 20px;
    --sb-indent-l3: 15px;
    --sb-pad-l1-y: 12px;
    --sb-pad-l1-x: 20px;
}

#app-sidebar .menu-tree-view .menu-nodo {
    display: block;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    clear: both;
}

#app-sidebar .menu-tree-view .menu-tree-node {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 2.35rem;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: left;
    line-height: 1.35;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Nivel 1 — cabecera raíz */
#app-sidebar .menu-tree-view .menu-nodo-level-0 > .menu-tree-node {
    padding: var(--sb-pad-l1-y) var(--sb-pad-l1-x);
    color: var(--sb-text-l1);
    font-size: 0.95rem;
}

#app-sidebar .menu-tree-view .menu-nodo-level-0 > .menu-tree-node .menu-icon {
    flex: 0 0 1.125rem;
    width: 1.125rem;
    font-size: 1.05rem;
    color: var(--sb-muted);
}

/* Acceso rápido Exportar Excel — misma alineación que ítems raíz del menú */
#app-sidebar .nav-menu-footer .nav-menu-footer-item {
    width: 100%;
    padding: 0;
    margin: 0;
}

#app-sidebar .nav-menu-footer .menu-nodo-level-0 > .nav-footer-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: var(--sb-pad-l1-y) var(--sb-pad-l1-x) !important;
    color: var(--sb-text-l1);
    font-size: 0.95rem;
}

#app-sidebar .nav-menu-footer .menu-nodo-level-0 > .nav-footer-link .menu-icon {
    flex: 0 0 1.125rem;
    width: 1.125rem;
    font-size: 1.05rem;
    color: var(--sb-muted);
}

/* Contenedores hijos — flujo normal solo con sidebar expandido */
html:not([data-sidebar-collapsed="true"]) #app-sidebar .menu-tree-view .menu-tree-children {
    position: static !important;
    float: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-height: none !important;
    overflow: visible;
    box-shadow: none !important;
    z-index: auto !important;
    left: auto !important;
    top: auto !important;
    margin: 0 0 0.2rem 0;
    clear: both;
}

#app-sidebar .menu-tree-view .menu-tree-depth-1,
#app-sidebar .menu-tree-view .menu-nodo-level-0 > .menu-tree-children {
    padding: 0.15rem 0 0.35rem var(--sb-indent-l2);
    border-left: 2px solid var(--sb-line);
    margin-left: var(--sb-pad-l1-x);
}

#app-sidebar .menu-tree-view .menu-tree-depth-2,
#app-sidebar .menu-tree-view .menu-nodo-level-1 > .menu-tree-children {
    padding: 0.15rem 0 0.3rem var(--sb-indent-l3);
    border-left: 2px solid rgba(222, 226, 230, 0.28);
    margin-left: calc(var(--sb-pad-l1-x) - 4px);
}

#app-sidebar .menu-tree-view .menu-tree-depth-3,
#app-sidebar .menu-tree-view .menu-nodo-level-2 > .menu-tree-children {
    padding: 0.2rem 0 0.35rem 14px;
    border-left: 2px solid rgba(222, 226, 230, 0.28);
    margin-left: calc(var(--sb-pad-l1-x) - 2px);
    background: transparent;
}

#app-sidebar .menu-tree-view .menu-tree-depth-4,
#app-sidebar .menu-tree-view .menu-nodo-level-3 > .menu-tree-children {
    padding: 0.15rem 0 0.25rem 12px;
    border-left: 2px solid rgba(222, 226, 230, 0.28);
    margin-left: calc(var(--sb-pad-l1-x) - 6px);
    background: transparent;
}

#app-sidebar .menu-tree-view .menu-tree-depth-5,
#app-sidebar .menu-tree-view .menu-nodo-level-4 > .menu-tree-children {
    padding: 0.1rem 0 0.2rem 10px;
    border-left: 2px solid rgba(222, 226, 230, 0.28);
    margin-left: calc(var(--sb-pad-l1-x) - 8px);
    background: transparent;
}

/* Sin guión horizontal delante del texto */
#app-sidebar .menu-tree-view .menu-tree-depth-2 .menu-nodo::before,
#app-sidebar .menu-tree-view .menu-tree-depth-3 .menu-nodo::before,
#app-sidebar .menu-tree-view .menu-tree-depth-4 .menu-nodo::before,
#app-sidebar .menu-tree-view .menu-tree-depth-5 .menu-nodo::before {
    content: none;
    display: none;
}

#app-sidebar .menu-tree-view .menu-tree-depth-2 .menu-nodo,
#app-sidebar .menu-tree-view .menu-tree-depth-3 .menu-nodo,
#app-sidebar .menu-tree-view .menu-tree-depth-4 .menu-nodo,
#app-sidebar .menu-tree-view .menu-tree-depth-5 .menu-nodo {
    position: relative;
}

/* Nivel 2 — ítems bajo cabecera (ej. Ahorros) */
#app-sidebar .menu-tree-view .menu-nodo-level-1 > .menu-tree-node {
    padding: 0.5rem 1rem 0.5rem 0.65rem;
    color: var(--sb-text-l2);
    font-size: 0.875rem;
}

/* Nivel 3 — subgrupo (ej. Reportes de Ahorros) */
#app-sidebar .menu-tree-view .menu-nodo-level-2 > .menu-tree-node {
    padding: 0.45rem 0.85rem 0.45rem 0.55rem;
    color: var(--sb-text-l2);
    font-size: 0.84375rem;
}

#app-sidebar .menu-tree-view .menu-nodo-level-2 > .menu-tree-node.menu-tree-node-subgroup {
    color: var(--sb-text-l2);
    font-size: 0.8125rem;
}

#app-sidebar .menu-tree-view .menu-nodo-level-2 > .menu-tree-node.menu-tree-node-subgroup.open {
    background: var(--sb-hover) !important;
}

/* Nivel 4+ — hojas finales (ej. Capitaliza Intereses) */
#app-sidebar .menu-tree-view .menu-nodo-level-3 > .menu-tree-node,
#app-sidebar .menu-tree-view .menu-nodo-level-4 > .menu-tree-node,
#app-sidebar .menu-tree-view .menu-tree-node-l3,
#app-sidebar .menu-tree-view .menu-tree-node-deep {
    padding: 0.4rem 0.75rem 0.4rem 0.85rem;
    color: var(--sb-text-l2);
    font-size: 0.8125rem;
}

#app-sidebar .menu-tree-view .menu-tree-node-deep {
    padding-left: 1rem;
    font-size: 0.8rem;
}

#app-sidebar .menu-tree-view .menu-caret {
    flex: 0 0 auto;
    width: 0.45rem;
    height: 0.45rem;
    margin-left: auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.65;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#app-sidebar .menu-tree-view .menu-caret.open {
    transform: rotate(45deg);
    margin-top: -0.15rem;
    opacity: 1;
}

#app-sidebar .menu-tree-view .menu-caption {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Títulos de menú (con submenú) — negrita | Opciones finales — normal */
#app-sidebar .menu-tree-view .menu-group,
#app-sidebar .menu-tree-view .menu-group .menu-caption {
    font-weight: 700 !important;
}

#app-sidebar .menu-tree-view .menu-leaf,
#app-sidebar .menu-tree-view .menu-leaf .menu-caption {
    font-weight: 400 !important;
}

#app-sidebar .menu-tree-view .menu-leaf.active,
#app-sidebar .menu-tree-view .menu-leaf.active .menu-caption {
    font-weight: 600 !important;
}

#app-sidebar .menu-tree-view .menu-tree-node:hover,
#app-sidebar .menu-tree-view .menu-group:hover {
    background: var(--sb-hover) !important;
}

#app-sidebar .menu-tree-view .menu-nodo-level-1 > .menu-tree-node:hover {
    color: var(--sb-text-l2);
}

#app-sidebar .menu-tree-view .menu-nodo-level-2 > .menu-tree-node:hover,
#app-sidebar .menu-tree-view .menu-tree-node-l3:hover {
    color: var(--sb-text-l2);
}

#app-sidebar .menu-tree-view .menu-tree-node-subgroup:hover,
#app-sidebar .menu-tree-view .menu-tree-node-deep:hover {
    color: var(--sb-text-l2);
}

/* Colapsar hijos (sidebar expandido) — flujo normal, sin solapamiento */
html:not([data-sidebar-collapsed="true"]) #app-sidebar .menu-tree-view .menu-tree-children {
    position: static !important;
    display: block;
    max-height: none !important;
    overflow: visible;
    left: auto !important;
    top: auto !important;
}

html:not([data-sidebar-collapsed="true"]) #app-sidebar .menu-tree-view .menu-tree-children:not(.is-expanded-open) {
    display: none;
}

html:not([data-sidebar-collapsed="true"]) #app-sidebar .menu-tree-view .menu-tree-children.is-expanded-open {
    display: block;
}

/* Resaltado activo global (NavLink fuera de CSS aislado) */
#app-sidebar a.nav-link.active,
#app-sidebar .nav-footer-link.active {
    color: #ffffff !important;
    background: var(--sb-active-bg) !important;
    font-weight: 600 !important;
    box-shadow: inset 3px 0 0 var(--sb-active) !important;
    text-decoration: none !important;
}

#app-sidebar a.nav-link.active .menu-icon {
    color: #ffffff !important;
}

/* Pie del menú — Exportar al Excel (sin estilo de enlace azul de Bootstrap) */
#app-sidebar .nav-menu-footer a.nav-footer-link,
#app-sidebar .nav-menu-footer a.nav-footer-link:link,
#app-sidebar .nav-menu-footer a.nav-footer-link:visited {
    color: #adb5bd !important;
    text-decoration: none !important;
}

#app-sidebar .nav-menu-footer a.nav-footer-link:hover,
#app-sidebar .nav-menu-footer a.nav-footer-link:focus {
    color: #ffffff !important;
    text-decoration: none !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

#app-sidebar .nav-menu-footer a.nav-footer-link.active,
#app-sidebar .nav-menu-footer a.nav-footer-link.active:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

#app-sidebar .nav-menu-footer a.nav-footer-link .menu-icon,
#app-sidebar .nav-menu-footer a.nav-footer-link .nav-footer-caption {
    color: inherit !important;
    text-decoration: none !important;
}

#app-sidebar .menu-group.menu-group-active {
    color: #ffffff !important;
    background: var(--sb-active-bg-group) !important;
    font-weight: 700 !important;
    box-shadow: inset 3px 0 0 var(--sb-active) !important;
}

#app-sidebar .menu-group.menu-group-active .menu-icon {
    color: var(--sb-active) !important;
}

#app-sidebar .menu-group.menu-group-active.open {
    color: #ffffff !important;
    background: var(--sb-active-bg) !important;
}

.report-workspace-active .filter-panel {
    margin-bottom: 0.5rem;
    padding: 0.65rem 0.85rem;
}

.cartera-page.report-workspace-active .page-title,
.exportacion-excel-page.report-workspace-active .page-title {
    display: none;
}

.report-workspace-active .ccs-consulta-header {
    margin-bottom: 0.75rem;
}

.cartera-page.report-workspace-active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100vh - var(--app-topbar-height, 3.5rem) - var(--app-footer-height, 2rem) - 1rem);
}

.cartera-page.report-workspace-active .cartera-grid {
    flex: 1 1 auto;
    min-height: 0;
}

.exportacion-excel-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.exportacion-excel-page.report-workspace-active {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    height: calc(100vh - var(--app-topbar-height, 3.5rem) - var(--app-footer-height, 2rem) - 1rem);
    --exportacion-excel-grid-height: max(
        280px,
        calc(100vh - var(--app-topbar-height, 2.85rem) - var(--app-footer-height, 1.85rem) - 11rem)
    );
}

.exportacion-excel-page.report-workspace-active .exportacion-excel-layout {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.exportacion-excel-layout {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 0.75rem;
    flex: 1 1 auto;
    min-height: min(560px, calc(100vh - var(--app-topbar-height, 3.5rem) - var(--app-footer-height, 2rem) - 6rem));
}

.exportacion-excel-lista,
.exportacion-excel-detalle {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.exportacion-excel-lista-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
}

.exportacion-excel-lista-title {
    font-weight: 600;
    color: #374151;
}

.exportacion-excel-lista-grid {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

.exportacion-excel-detalle .filter-panel,
.exportacion-excel-detalle .alert {
    flex: 0 0 auto;
}

.exportacion-excel-grilla-wrapper {
    flex: 1 1 auto;
    min-height: 280px;
    height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.exportacion-excel-page.report-workspace-active .exportacion-excel-grilla-wrapper {
    min-height: var(--exportacion-excel-grid-height, 280px);
}

.exportacion-excel-detalle .cartera-grid,
.exportacion-excel-detalle .ccs-grid,
.exportacion-excel-detalle .exportacion-excel-grilla {
    flex: 1 1 auto;
    min-height: 280px;
    height: 100%;
    overflow: hidden;
    padding-bottom: 0;
}

.exportacion-excel-page.report-workspace-active .exportacion-excel-detalle .cartera-grid,
.exportacion-excel-page.report-workspace-active .exportacion-excel-detalle .ccs-grid,
.exportacion-excel-page.report-workspace-active .exportacion-excel-detalle .exportacion-excel-grilla {
    min-height: var(--exportacion-excel-grid-height, 280px);
}

.exportacion-excel-detalle .cartera-grid .dxbl-grid,
.exportacion-excel-detalle .ccs-grid .dxbl-grid,
.exportacion-excel-detalle .exportacion-excel-grilla .dxbl-grid {
    flex: 1 1 auto;
    height: 100%;
    min-height: 240px;
}

.exportacion-excel-detalle .dxbl-grid-pager,
.exportacion-excel-detalle .dxbl-pager {
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding-block: 0.35rem;
    overflow: visible;
}

.exportacion-excel-lista-grid .dxbl-grid-table tbody tr {
    cursor: pointer;
}

.exportacion-excel-lista-grid .dxbl-grid-table tbody tr.dxbl-grid-selected-row {
    background: color-mix(in srgb, var(--igim-ui-accent, #74b9ff) 22%, transparent);
}

.exportacion-excel-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    padding: 2rem;
    text-align: center;
}

.exportacion-excel-detalle .filter-panel {
    margin: 0;
}

.exportacion-excel-toolbar {
    padding: 0.75rem;
}

.exportacion-excel-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.exportacion-excel-toolbar-item {
    flex: 1 1 140px;
    min-width: 120px;
}

.exportacion-excel-toolbar-item--seleccion {
    flex: 2 1 220px;
    min-width: 180px;
}

.exportacion-excel-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: auto;
}

.exportacion-excel-atajos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.72rem;
}

.exportacion-excel-atajos--lista {
    padding: 0 0.75rem 0.5rem;
}

.exportacion-excel-atajos--detalle {
    padding-top: 0.35rem;
    border-top: 1px dashed #e5e7eb;
}

.exportacion-excel-header-caption {
    text-align: center;
}

.exportacion-excel-grilla .cartera-dx-grid {
    font-size: 0.82rem;
}

@media (max-width: 991px) {
    .exportacion-excel-layout {
        grid-template-columns: 1fr;
    }

    .exportacion-excel-lista {
        max-height: 280px;
    }
}

/* Barra superior de usuario */
.user-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #ffffff;
}

/* Barra inferior fija */
.app-footer {
    flex: 0 0 auto;
    min-height: var(--app-footer-height, 1.85rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 1rem;
    background: #f3f4f6;
    border-top: 1px solid #e5e7eb;
    color: #4b5563;
    font-size: 0.74rem;
    z-index: 40;
    position: relative;
}

@media (min-width: 769px) {
    .app-footer {
        z-index: 1200;
    }
}

.app-footer-start {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.app-footer-version {
    font-weight: 700;
    white-space: nowrap;
}

.app-footer-message {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-footer-session {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-footer-session-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

.app-footer-icon {
    flex: 0 0 auto;
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1;
}

.app-footer-sep {
    opacity: 0.45;
}

@media (max-width: 768px) {
    .app-footer {
        z-index: 1200;
    }

    #app-sidebar.app-sidebar {
        z-index: 1050;
    }
}

@media (max-width: 900px) {
    .app-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .app-footer-session {
        flex-wrap: wrap;
    }
}

/* Bloqueo temporal de pantalla durante consultas */
.igim-pantalla-bloqueo {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    pointer-events: all;
    cursor: wait;
}

body:has(.igim-pantalla-bloqueo) .dxbl-loading-panel,
body:has(.igim-pantalla-bloqueo) .dxbl-grid-loading-panel,
body:has(.igim-pantalla-bloqueo) .dx-loadpanel,
body:has(.igim-pantalla-bloqueo) .dxbl-wait-indicator {
    display: none !important;
}

.igim-pantalla-bloqueo-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    min-width: 240px;
}

.igim-pantalla-bloqueo-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: var(--igim-ui-accent, #f58220);
    border-radius: 50%;
    animation: igim-pantalla-bloqueo-giro 0.75s linear infinite;
}

.igim-pantalla-bloqueo-texto {
    margin: 0;
    font-size: 0.9rem;
    color: #374151;
    text-align: center;
}

/* Aviso previo al cierre por inactividad */
.igim-aviso-inactividad {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
}

.igim-aviso-inactividad-panel {
    width: min(420px, calc(100vw - 2rem));
    padding: 1.35rem 1.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.igim-aviso-inactividad-panel h2 {
    margin: 0 0 0.75rem;
    font-size: 1.15rem;
    color: #1f2937;
}

.igim-aviso-inactividad-panel p {
    margin: 0 0 0.65rem;
    color: #374151;
    line-height: 1.45;
}

.igim-aviso-inactividad-detalle {
    color: #6b7280 !important;
    font-size: 0.92rem;
}

.igim-aviso-inactividad-boton {
    margin-top: 0.85rem;
    min-height: var(--igim-btn-height);
    padding: 0 var(--igim-btn-padding-x);
    cursor: pointer;
}

.igim-aviso-inactividad-boton:hover {
    filter: none;
}

.igim-mensaje-flotante {
    position: fixed;
    top: calc(var(--app-topbar-height, 2.85rem) + 0.75rem);
    right: 1rem;
    z-index: 10070;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 240px;
    max-width: min(420px, calc(100vw - 2rem));
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    box-shadow: 0 0.75rem 1.75rem rgba(15, 23, 42, 0.18);
    animation: igim-mensaje-flotante-in 0.22s ease-out;
}

.igim-mensaje-flotante--success {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.igim-mensaje-flotante--info {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e40af;
}

.igim-mensaje-flotante--warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.igim-mensaje-flotante--danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.igim-mensaje-flotante-texto {
    flex: 1 1 auto;
    font-size: 0.92rem;
    line-height: 1.35;
}

.igim-mensaje-flotante-cerrar {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
}

.igim-mensaje-flotante-cerrar:hover {
    opacity: 1;
}

@keyframes igim-mensaje-flotante-in {
    from {
        opacity: 0;
        transform: translateY(-0.35rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes igim-pantalla-bloqueo-giro {
    to {
        transform: rotate(360deg);
    }
}

/* Consulta Cartera / Socio - portada tipo Previsión Social */
.ccs-portada .page-title {
    margin-bottom: 0.5rem;
}

.ccs-seccion {
    margin-top: 0.85rem;
}

.ccs-seccion:first-of-type {
    margin-top: 0.35rem;
}

.ccs-seccion-titulo {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--igim-heading, #0b4f8a);
    margin-bottom: 0.4rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid #d7e6f5;
}

.ccs-tarjetas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 1rem;
}

.ccs-tarjeta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.35rem 0.25rem;
    cursor: pointer;
}

.ccs-tarjeta:hover {
    background: #f0f6fc;
}

.ccs-tarjeta-icono {
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    background: #e8f1fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%230b4f8a' viewBox='0 0 16 16'%3E%3Cpath d='M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z'/%3E%3Cpath d='M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z'/%3E%3C/svg%3E") no-repeat center;
    border: 1px solid #c9dbef;
}

.ccs-tarjeta-texto {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.ccs-tarjeta-texto strong {
    color: var(--igim-heading, #0b4f8a);
    font-size: 0.92rem;
    line-height: 1.2;
}

.ccs-tarjeta-texto small {
    color: #6c7a89;
    font-size: 0.8rem;
}

.ccs-consulta-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e8eef4;
}

.ccs-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0;
    margin: 0 0 0.4rem;
    border: none;
    background: transparent;
    color: var(--igim-heading, #376da7);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.ccs-back-link:hover {
    color: #2a5580;
    text-decoration: underline;
}

.ccs-back-link:focus-visible {
    outline: 2px solid var(--igim-ui-accent, #74b9ff);
    outline-offset: 2px;
    border-radius: 2px;
}

.ccs-back-link i {
    font-size: 0.9rem;
    line-height: 1;
    margin-top: 0.05rem;
}

.ccs-consulta-page-title {
    font-size: 1.45rem;
    margin: 0;
    color: #1f2a37;
    font-weight: 700;
    line-height: 1.25;
}

.ccs-consulta {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
}

.ccs-filter-panel {
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.85rem;
}

.ccs-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.65rem;
}

.ccs-filter-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ccs-filter-field .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.ccs-filter-field--fecha {
    flex: 0 0 7.25rem;
    width: 7.25rem;
    max-width: 7.25rem;
}

.ccs-filter-field--contexto {
    flex: 0 0 8.75rem;
    width: 8.75rem;
    max-width: 8.75rem;
}

.ccs-filter-field--contexto .form-select {
    padding-right: 1.75rem;
}

.ccs-filter-field .ccs-fecha-edit,
.ccs-filter-field .form-select {
    min-height: 2.125rem;
    font-size: 0.875rem;
}

.ccs-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.ccs-consulta.report-workspace-active {
    height: calc(100vh - var(--app-topbar-height, 3.5rem) - var(--app-footer-height, 2rem) - 1rem);
}

.ccs-consulta.report-workspace-active .ccs-consulta-page-title {
    display: none;
}

.ccs-consulta.report-workspace-active .ccs-consulta-header {
    margin-bottom: 0.35rem;
    padding-bottom: 0.35rem;
}

.ccs-consulta.report-workspace-active .ccs-grid,
.ccs-consulta.report-workspace-active .cartera-grid {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

.ccs-grid {
    flex: 1 1 auto;
    height: calc(100vh - var(--app-topbar-height, 3.5rem) - var(--app-footer-height, 2rem) - var(--app-content-chrome, 8.5rem));
    min-height: 420px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: auto;
}

.ccs-grid .dxbl-grid,
.ccs-grid .cartera-dx-grid {
    height: 100%;
}

.reporte-grilla {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #ffffff;
}

.reporte-grilla-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.reporte-grilla-buscar {
    max-width: 320px;
}

.reporte-grilla-scroll {
    flex: 1 1 auto;
    overflow: auto;
}

.reporte-grilla-tabla thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--igim-grid-header, #0b4f8a);
    color: #ffffff;
    white-space: nowrap;
    vertical-align: middle;
}

.reporte-grilla-tabla td {
    white-space: nowrap;
    vertical-align: middle;
}

.reporte-grilla-pager {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

@media (max-width: 900px) {
    .ccs-tarjetas {
        grid-template-columns: 1fr;
    }
}

/* Perfil: cambio de fecha y contraseña */
.perfil-descripcion {
    margin: -0.35rem 0 1.25rem;
    color: #6c757d;
    font-size: 0.95rem;
}

.perfil-card {
    max-width: 520px;
    padding: 1.5rem;
}

.perfil-card--estrecha {
    max-width: 420px;
}

.perfil-cargando {
    display: flex;
    align-items: center;
    color: #6c757d;
    font-size: 0.95rem;
}

.perfil-resumen {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    background: #f8f9fa;
}

.perfil-resumen-label {
    display: block;
    margin-bottom: 0.15rem;
    color: #6c757d;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.perfil-field {
    margin-bottom: 1rem;
}

.perfil-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.perfil-input {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #ced4da;
    font-size: 0.95rem;
    line-height: 1.4;
    background: #ffffff;
}

.perfil-input:focus {
    outline: none;
    border-color: var(--igim-ui-accent, #f58220);
}

.perfil-ayuda {
    margin-bottom: 1.25rem;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.45;
}

.perfil-alerta {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
}

.perfil-alerta-error {
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
}

.perfil-alerta-success {
    color: #0f5132;
    background: #d1e7dd;
    border: 1px solid #badbcc;
}

.perfil-acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.5rem;
}
