/**
 * Sidebar HIF — azul-negro pastel (sincronizado con hif-ui-finance)
 */
:root {
    --hif-sidebar-pro-width: 280px;
}

body.hif-premium .sidebar.hif-sidebar,
body.hif-premium .sidebar-offcanvas {
    width: var(--hif-sidebar-pro-width) !important;
}

body.hif-premium .main-content {
    margin-left: var(--hif-sidebar-pro-width);
}

@media (max-width: 991.98px) {
    body.hif-premium .main-content {
        margin-left: 0;
    }
}

body.hif-premium .sidebar.hif-sidebar {
    display: flex;
    flex-direction: column;
    z-index: 1030;
    background: #2A3544 !important;
    border-right: 0 !important;
    box-shadow: 4px 0 20px rgba(28, 36, 48, 0.14);
}

body.hif-premium .sidebar-offcanvas.hif-sidebar-offcanvas {
    background: #2A3544 !important;
    width: min(280px, 88vw) !important;
}

body.hif-premium .sidebar-offcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(232, 238, 244, 0.08) !important;
    background: #2A3544 !important;
}

body.hif-premium .sidebar-offcanvas .btn-close {
    filter: invert(1) grayscale(1) brightness(1.6);
}

.hif-sidebar-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.hif-sidebar-brand {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(232, 238, 244, 0.08);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    min-height: 56px;
}

.hif-sidebar-brand__link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    line-height: 1;
    width: 100%;
}

.hif-sidebar-brand__logo,
.hif-sidebar-brand .hif-institution-logo {
    max-height: 36px;
    height: 36px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
    display: block;
    filter: none;
}

.hif-offcanvas-logo {
    max-height: 36px;
    height: 36px;
    width: auto;
    object-fit: contain;
    object-position: left center;
    display: block;
}

.hif-sidebar-search__wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.hif-sidebar-search__wrap > .bi-search {
    position: absolute;
    left: 12px;
    font-size: 0.875rem;
    color: #A8B5C4;
    pointer-events: none;
    z-index: 1;
}

.hif-sidebar-search__input {
    background: rgba(232, 238, 244, 0.08) !important;
    border: 1px solid rgba(232, 238, 244, 0.14) !important;
    color: #E8EEF4 !important;
    border-radius: 8px !important;
    padding-left: 2.25rem !important;
    min-height: 40px;
    font-size: 0.875rem;
}

.hif-sidebar-search__input::placeholder {
    color: #A8B5C4;
}

.hif-sidebar-search__input:focus {
    background: rgba(232, 238, 244, 0.12) !important;
    border-color: rgba(230, 238, 245, 0.35) !important;
    box-shadow: none !important;
    color: #fff !important;
}

.hif-sidebar-search__clear {
    position: absolute;
    right: 8px;
    color: #A8B5C4;
}

.hif-sidebar-scroll {
    padding-bottom: 8px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.hif-sidebar-scroll::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

body.hif-premium .hif-sidebar-nav .sidebar-section {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 16px 16px 6px;
}

body.hif-premium .hif-sidebar-nav .nav-link {
    color: #FFFFFF;
    border-radius: 10px;
    margin: 2px 10px;
    padding: 10px 12px;
    font-weight: 500;
    font-size: 0.875rem;
    border-left: 0;
    white-space: normal;
    word-break: break-word;
}

body.hif-premium .hif-sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

body.hif-premium .hif-sidebar-nav .nav-link.active {
    background: #E6EEF5;
    color: #1C2430;
    border-left: 0;
    font-weight: 600;
    box-shadow: none;
}

body.hif-premium .hif-sidebar-nav .nav-link i.bi {
    color: #FFFFFF;
    width: 1.35rem;
}

body.hif-premium .hif-sidebar-nav .nav-link.active i.bi {
    color: #3D5A73;
}

body.hif-premium .hif-sidebar-flow-hint {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.75rem;
}

.hif-sidebar-footer {
    border-top: 1px solid rgba(232, 238, 244, 0.08);
    padding: 10px 12px 14px;
    flex-shrink: 0;
    background: transparent;
    margin-top: 4px;
}

/* Desktop: sidebar a pantalla completa (sin franja blanca abajo) */
@media (min-width: 992px) {
    body.hif-premium .sidebar.hif-sidebar {
        top: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        padding-top: var(--header-height, 60px) !important;
        box-sizing: border-box !important;
        background: #2A3544 !important;
    }

    body.hif-premium .sidebar.hif-sidebar .hif-sidebar-shell {
        height: 100%;
        min-height: 0;
        background: #2A3544 !important;
    }
}

.hif-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #FFFFFF;
    transition: background 0.15s ease;
}

.hif-sidebar-user:hover {
    background: rgba(255, 255, 255, 0.08);
}

.hif-sidebar-user__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #FFFFFF;
    display: block;
}

.hif-sidebar-user__role {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.72);
    display: block;
}

.hif-sidebar-user__chevron {
    margin-left: auto;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
}

.hif-sidebar-logout-btn {
    margin-top: 8px;
    border: 1px solid rgba(196, 91, 91, 0.55);
    background: transparent;
    color: #E8B4B4;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s ease;
}

.hif-sidebar-logout-btn:hover {
    background: rgba(196, 91, 91, 0.14);
    color: #fff;
}

.hif-sidebar-theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px 4px;
    font-size: 0.8125rem;
    color: #A8B5C4;
}
