.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

main {
    flex: 1;
}

.sidebar {
    background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.app-sidebar {
    background: #0a2135;
    border-right: 1px solid rgba(120, 190, 222, .16);
    flex: 0 0 220px;
    min-height: calc(100vh - 52px);
    padding: 2.5rem 1.25rem 2rem;
}

.app-sidebar__brand {
    color: #f2f7f9;
    display: block;
    font-size: .92rem;
    font-weight: 750;
    margin: 0 .75rem 2rem;
    text-decoration: none;
}

.app-sidebar nav {
    display: grid;
    gap: .25rem;
}

.app-sidebar nav a {
    border-radius: 7px;
    color: #9eb7c7;
    font-size: .86rem;
    padding: .7rem .75rem;
    text-decoration: none;
}

.app-sidebar nav a:hover {
    background: rgba(65, 126, 158, .18);
    color: #f2f7f9;
}

.app-sidebar nav a.is-active {
    background: #153d5a;
    color: #fff;
    font-weight: 700;
}

.app-sidebar__help {
    border-top: 1px solid rgba(120, 190, 222, .16);
    margin: 2rem .75rem 0;
    padding-top: 1.25rem;
}

.app-sidebar__help span {
    color: #dceaf0;
    display: block;
    font-size: .82rem;
    font-weight: 700;
}

.app-sidebar__help small {
    color: #7897aa;
    display: block;
    font-size: .74rem;
    line-height: 1.5;
    margin-top: .4rem;
}

.top-row {
    align-items: center;
    background: #0b2035;
    border-bottom: 1px solid rgba(151, 202, 231, .18);
    color: #eaf3f8;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    min-height: 56px;
}

    .top-row a, .top-row .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
        text-decoration: none;
    }

    .top-row a:hover, .top-row .btn-link:hover {
        color: #fff;
        text-decoration: none;
    }

    .top-row a:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-row .customer-nav {
        align-items: center;
        display: flex;
        flex: 1;
        gap: .25rem;
    }

    .top-row .customer-nav a {
        border-radius: 6px;
        color: #bdd0de;
        font-size: .86rem;
        font-weight: 650;
        margin-left: 0;
        padding: .5rem .7rem;
    }

    .top-row .customer-nav a:hover,
    .top-row .customer-nav a.is-active {
        background: #153d5a;
        color: #fff;
    }

    .top-row .customer-nav .customer-nav__action {
        background: #f2b51d;
        color: #132a3d;
        margin-left: auto;
    }

    .top-row .customer-nav .customer-nav__action:hover,
    .top-row .customer-nav .customer-nav__action.is-active {
        background: #ffc62e;
        color: #132a3d;
    }

    .top-row .customer-nav-menu {
        display: none;
    }

@media (max-width: 640.98px) {
    .content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .top-row {
        justify-content: space-between;
    }

    .top-row .site-brand {
        max-width: calc(100vw - 8rem);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-row .customer-nav {
        display: none;
    }

    .top-row .customer-nav-menu {
        display: block;
        margin-left: auto;
        position: relative;
    }

    .top-row .customer-nav-menu summary {
        border: 1px solid rgba(151, 202, 231, .35);
        border-radius: 6px;
        color: #eaf3f8;
        cursor: pointer;
        font-size: .84rem;
        font-weight: 700;
        list-style: none;
        padding: .45rem .65rem;
    }

    .top-row .customer-nav-menu summary::-webkit-details-marker {
        display: none;
    }

    .top-row .customer-nav-menu nav {
        background: #102d45;
        border: 1px solid rgba(151, 202, 231, .25);
        border-radius: 8px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .2);
        display: grid;
        gap: .25rem;
        min-width: 190px;
        padding: .5rem;
        position: absolute;
        right: 0;
        top: calc(100% + .5rem);
        z-index: 10;
    }

    .top-row .customer-nav-menu nav a {
        border-radius: 5px;
        color: #dceaf0;
        font-size: .86rem;
        margin-left: 0;
        padding: .6rem .7rem;
    }

    .top-row .customer-nav-menu nav a.is-active,
    .top-row .customer-nav-menu nav a:hover {
        background: #153d5a;
    }

    .app-sidebar {
        border-bottom: 1px solid rgba(120, 190, 222, .16);
        border-right: 0;
        min-height: auto;
        position: static;
        padding: 1.25rem;
    }

    .app-sidebar__brand {
        margin-bottom: 1rem;
    }

    .app-sidebar nav {
        display: flex;
        margin: 0 -1.25rem;
        overflow-x: auto;
        padding: 0 1.25rem .25rem;
        scroll-snap-type: x proximity;
    }

    .app-sidebar nav a {
        flex: 0 0 auto;
        scroll-snap-align: start;
        white-space: nowrap;
    }

    .app-sidebar__help {
        display: none;
    }

    .top-row a, .top-row .btn-link {
        margin-left: 0;
    }

    .top-row .site-nav {
        gap: .5rem;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .app-sidebar {
        bottom: 0;
        left: 0;
        min-height: 0;
        overflow-y: auto;
        position: fixed;
        top: 52px;
        width: 220px;
        z-index: 2;
    }

    .page:has(.app-sidebar) > main {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

    .page:has(.app-sidebar) > main > .top-row {
        margin-left: -220px;
        width: calc(100% + 220px);
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row, article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }
}

.content:has(.home-page),
.content:has(.auth-page) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
}
