/* Collapsible navigation sidebar */
.portal-header {
    position: sticky;
    top: 0px;
    z-index: 1300;
    padding-left: 13px; /* Center the toggle above the collapsed menu icons. */
}

:root {
    --portal-header-height: 50px;
}

.portal-sidebar-open .portal-header {
    padding-left: 14.5px; /* Match the expanded navigation icon center. */
}

.portal-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    flex: 0 0 42px;
    border: 1px solid #ffffff3b;
    border-radius: 9px;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 1;
}

.portal-sidebar-toggle:hover {
    background: #ffffff1c;
}

.portal-header-spacer {
    flex: 1 1 auto;
}

.portal-logout-form {
    flex: 0 0 auto;
    margin: 0;
}

.portal-sidebar {
    position: fixed;
    z-index: 1200;
    top: var(--portal-header-height);
    bottom: 0;
    left: 0;
    width: 260px;
    overflow: visible;
    padding: 18px 12px;
    background: #101a28;
    border-right: 1px solid #314257;
    transform: translateX(-100%);
    transition: transform 180ms ease;
}

.portal-sidebar-open .portal-sidebar {
    width: 260px;
    transform: translateX(0);
}

.portal-sidebar-collapsed .portal-sidebar {
    width: 68px;
    transform: translateX(0);
}

.portal-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.portal-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 44px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #e8eef5;
    font-weight: 600;
    text-decoration: none;
}

.portal-sidebar nav a:hover,
.portal-sidebar nav a[aria-current="page"] {
    background: #26384e;
    color: #fff;
    text-decoration: none;
}

.portal-sidebar-collapsed .portal-sidebar nav a {
    position: relative;
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
}

.portal-sidebar-collapsed .portal-sidebar nav a > span:not(.portal-sidebar-icon) {
    display: none;
}

.portal-sidebar-collapsed .portal-sidebar nav a::after {
    content: attr(data-label);
    position: absolute;
    z-index: 1400;
    top: 50%;
    left: calc(100% + 10px);
    display: none;
    transform: translateY(-50%);
    padding: 8px 11px;
    border: 1px solid #43566d;
    border-radius: 7px;
    background: #101a28;
    box-shadow: 0 5px 18px #07101d66;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}

.portal-sidebar-collapsed .portal-sidebar nav a:hover::after,
.portal-sidebar-collapsed .portal-sidebar nav a:focus-visible::after {
    display: block;
}

.portal-sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    flex: 0 0 23px;
    color: #b8c8d9;
    font-size: 20px;
}

.portal-sidebar-backdrop {
    display: none;
}

.portal-sidebar-backdrop[hidden] {
    display: none !important;
}

@media (min-width: 900px) {
    .portal-sidebar-open main {
        max-width: none;
        margin: 28px 22px 28px 282px;
    }

    .portal-sidebar-collapsed main {
        max-width: none;
        margin: 28px 22px 28px 90px;
    }

    .portal-sidebar-open footer {
        margin-left: 260px;
    }

    .portal-sidebar-collapsed footer {
        margin-left: 68px;
    }
}

@media (max-width: 899px) {
    .portal-sidebar-backdrop:not([hidden]) {
        display: block;
        position: fixed;
        z-index: 1190;
        inset: var(--portal-header-height) 0 0;
        background: #07101db0;
    }

    .portal-header {
        gap: 12px;
        padding-left: 13px;
        padding-right: 14px;
    }

    .portal-header > strong {
        font-size: 17px;
    }

    .portal-brand-subtitle {
        display: none;
    }

    .portal-user {
        overflow: hidden;
        max-width: 120px;
        text-overflow: ellipsis;
    }
}

@media (max-width: 760px) {
    :root {
        --portal-header-height: 86px;
    }

    .portal-header {
        flex-wrap: nowrap;
    }
}

@media (max-width: 520px) {
    .portal-header > strong {
        display: none;
    }

    .portal-user {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-sidebar {
        transition: none;
    }
}
.portal-logout-form button {
    height: 30px;
    padding-top: 0;
    padding-bottom: 0;
}