/*
|--------------------------------------------------------------------------
| Royal Servicess LLC
| Professional Context-Aware Application Header V3
|--------------------------------------------------------------------------
|
| Control Center:
| Dashboard · Operations
|
| Operations:
| Pickups · Returns · Agreements · Licences · Requests · Control Center
|
| Utilities:
| Account dropdown containing Notifications, Security and Sign out
|
*/

.app-shell-header,
.app-shell-header * {
    box-sizing: border-box;
}

.app-shell-header {
    --shell-bg: rgba(8, 9, 10, .97);
    --shell-panel: #15171a;
    --shell-panel-raised: #1a1c20;

    --shell-line: rgba(255, 255, 255, .085);
    --shell-line-strong: rgba(255, 255, 255, .13);

    --shell-text: #f4f2ed;
    --shell-soft: #bebdb8;
    --shell-muted: #848580;

    --shell-gold: #d7b449;
    --shell-gold-soft: #f0d677;
    --shell-gold-bg: rgba(215, 180, 73, .075);

    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;

    border-bottom:
        1px solid
        rgba(215, 180, 73, .13);

    background:
        var(--shell-bg);

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, .16);

    backdrop-filter:
        blur(16px);
}

.app-shell-header__inner {
    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 26px;

    width: min(
        1540px,
        calc(100vw - 36px)
    );

    min-height: 78px;

    margin: 0 auto;
}


/*
|--------------------------------------------------------------------------
| Brand
|--------------------------------------------------------------------------
*/

.app-shell-brand-group {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
}

.app-shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;

    min-width: 0;

    color:
        var(--shell-text);

    text-decoration: none;
}

.app-shell-brand__mark {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    flex:
        0
        0
        36px;

    border:
        1px solid
        rgba(215, 180, 73, .45);

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(215, 180, 73, .12),
            rgba(215, 180, 73, .025)
        );

    box-shadow:
        inset
        0
        0
        18px
        rgba(215, 180, 73, .04);
}

.app-shell-brand__mark::before,
.app-shell-brand__mark::after {
    position: absolute;

    background:
        var(--shell-gold);

    content: "";
}

.app-shell-brand__mark::before {
    width: 13px;
    height: 1px;
}

.app-shell-brand__mark::after {
    width: 1px;
    height: 13px;
}

.app-shell-brand__name {
    overflow: hidden;

    color:
        var(--shell-text);

    font-family:
        var(
            --font-heading,
            Georgia,
            serif
        );

    font-size: 20px;
    font-weight: 700;

    line-height: 1;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-shell-context {
    display: inline-flex;
    align-items: center;

    min-height: 25px;

    padding:
        5px
        8px;

    border:
        1px solid
        var(--shell-line);

    border-radius: 999px;

    background:
        rgba(255, 255, 255, .02);

    color:
        var(--shell-muted);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: .08em;

    text-transform: uppercase;
}


/*
|--------------------------------------------------------------------------
| Context Navigation
|--------------------------------------------------------------------------
*/

.app-shell-nav {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    min-width: 0;
}

.app-shell-nav__link {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 39px;

    padding:
        8px
        12px;

    border:
        1px solid
        transparent;

    border-radius: 8px;

    color:
        var(--shell-soft);

    font-size: 11px;
    font-weight: 750;

    line-height: 1;

    text-decoration: none;

    white-space: nowrap;

    transition:
        color .15s ease,
        background .15s ease,
        border-color .15s ease;
}

.app-shell-nav__link:hover,
.app-shell-nav__link:focus-visible {
    border-color:
        var(--shell-line);

    background:
        rgba(255, 255, 255, .025);

    color:
        var(--shell-text);

    outline: none;
}

.app-shell-nav__link.is-active {
    border-color:
        rgba(215, 180, 73, .28);

    background:
        var(--shell-gold-bg);

    color:
        var(--shell-gold-soft);
}

.app-shell-nav__link.is-active::after {
    position: absolute;

    right: 11px;
    bottom: -1px;
    left: 11px;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--shell-gold),
            transparent
        );

    content: "";
}


/*
|--------------------------------------------------------------------------
| Account Menu
|--------------------------------------------------------------------------
*/

.app-shell-user {
    position: relative;

    flex:
        0
        0
        auto;
}

.app-shell-user > summary {
    display: flex;
    align-items: center;
    gap: 9px;

    min-width: 192px;
    min-height: 45px;

    padding:
        6px
        9px
        6px
        7px;

    border:
        1px solid
        var(--shell-line);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, .025);

    cursor: pointer;

    list-style: none;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.app-shell-user > summary::-webkit-details-marker {
    display: none;
}

.app-shell-user > summary:hover,
.app-shell-user > summary:focus-visible,
.app-shell-user[open] > summary {
    border-color:
        rgba(215, 180, 73, .28);

    background:
        rgba(215, 180, 73, .045);

    outline: none;
}

.app-shell-user__avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 31px;
    height: 31px;

    flex:
        0
        0
        31px;

    border:
        1px solid
        rgba(215, 180, 73, .25);

    border-radius: 9px;

    background:
        var(--shell-gold-bg);

    color:
        var(--shell-gold-soft);
}

.app-shell-user__avatar svg {
    width: 16px;
    height: 16px;
}

.app-shell-user__identity {
    display: grid;
    gap: 2px;

    min-width: 0;

    flex: 1;
}

.app-shell-user__context {
    overflow: hidden;

    color:
        var(--shell-text);

    font-size: 10px;
    font-weight: 800;

    line-height: 1.1;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-shell-user__email {
    overflow: hidden;

    max-width: 140px;

    color:
        var(--shell-muted);

    font-size: 9px;

    line-height: 1.1;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-shell-user__chevron {
    display: flex;
    align-items: center;
    justify-content: center;

    color:
        var(--shell-muted);

    transition:
        transform .15s ease;
}

.app-shell-user__chevron svg {
    width: 13px;
    height: 13px;
}

.app-shell-user[open]
.app-shell-user__chevron {
    transform:
        rotate(180deg);
}


/*
|--------------------------------------------------------------------------
| Account Dropdown
|--------------------------------------------------------------------------
*/

.app-shell-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;

    width: 280px;

    overflow: hidden;

    border:
        1px solid
        var(--shell-line-strong);

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            #1b1d21,
            #111316
        );

    box-shadow:
        0 22px 60px
        rgba(0, 0, 0, .45);
}

.app-shell-menu__header {
    padding:
        14px
        14px
        12px;

    border-bottom:
        1px solid
        var(--shell-line);

    background:
        rgba(255, 255, 255, .015);
}

.app-shell-menu__label {
    display: block;

    color:
        var(--shell-gold);

    font-size: 8px;
    font-weight: 850;

    letter-spacing: .11em;

    text-transform: uppercase;
}

.app-shell-menu__email {
    display: block;

    overflow: hidden;

    margin-top: 4px;

    color:
        var(--shell-text);

    font-size: 11px;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-shell-menu__items {
    display: grid;

    padding: 6px;
}

.app-shell-menu__item {
    display: grid;

    grid-template-columns:
        34px
        minmax(0, 1fr)
        auto;

    gap: 9px;

    align-items: center;

    width: 100%;

    min-height: 48px;

    padding:
        7px
        8px;

    border:
        1px solid
        transparent;

    border-radius: 8px;

    background:
        transparent;

    color:
        inherit;

    text-align: left;
    text-decoration: none;

    cursor: pointer;

    transition:
        border-color .15s ease,
        background .15s ease;
}

.app-shell-menu__item:hover,
.app-shell-menu__item:focus-visible {
    border-color:
        var(--shell-line);

    background:
        rgba(255, 255, 255, .025);

    outline: none;
}

.app-shell-menu__item.is-active {
    background:
        var(--shell-gold-bg);
}

.app-shell-menu__icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border:
        1px solid
        var(--shell-line);

    border-radius: 8px;

    background:
        rgba(255, 255, 255, .018);

    color:
        var(--shell-soft);
}

.app-shell-menu__icon svg {
    width: 16px;
    height: 16px;
}

.app-shell-menu__copy {
    display: grid;
    gap: 2px;

    min-width: 0;
}

.app-shell-menu__copy strong {
    color:
        var(--shell-text);

    font-size: 10px;
    font-weight: 750;
}

.app-shell-menu__copy small {
    color:
        var(--shell-muted);

    font-size: 8px;

    line-height: 1.3;
}

.app-shell-menu__arrow {
    color:
        var(--shell-muted);

    font-size: 12px;
}

.app-shell-menu__divider {
    height: 1px;

    margin:
        5px
        7px;

    background:
        var(--shell-line);
}

.app-shell-menu form {
    margin: 0;
}

.app-shell-menu__item--danger
.app-shell-menu__icon,
.app-shell-menu__item--danger
.app-shell-menu__copy strong {
    color: #e4a0a0;
}


/*
|--------------------------------------------------------------------------
| Medium Desktop
|--------------------------------------------------------------------------
*/

@media (max-width: 1220px) {
    .app-shell-header__inner {
        gap: 16px;

        width:
            calc(100vw - 24px);
    }

    .app-shell-context {
        display: none;
    }

    .app-shell-brand__name {
        font-size: 17px;
    }

    .app-shell-nav__link {
        padding:
            8px
            9px;

        font-size: 10px;
    }

    .app-shell-user > summary {
        min-width: 170px;
    }

    .app-shell-user__email {
        max-width: 110px;
    }
}


/*
|--------------------------------------------------------------------------
| Tablet
|--------------------------------------------------------------------------
*/

@media (max-width: 980px) {
    .app-shell-header__inner {
        grid-template-columns:
            minmax(0, 1fr)
            auto;

        gap:
            9px
            12px;

        min-height: 0;

        padding:
            10px
            0
            9px;
    }

    .app-shell-brand-group {
        grid-column: 1;
        grid-row: 1;
    }

    .app-shell-user {
        grid-column: 2;
        grid-row: 1;
    }

    .app-shell-nav {
        grid-column:
            1
            / -1;

        grid-row: 2;

        justify-content: flex-start;

        overflow-x: auto;

        padding-bottom: 1px;

        scrollbar-width: none;
    }

    .app-shell-nav::-webkit-scrollbar {
        display: none;
    }

    .app-shell-nav__link {
        flex:
            0
            0
            auto;
    }
}


/*
|--------------------------------------------------------------------------
| Phone
|--------------------------------------------------------------------------
*/

@media (max-width: 620px) {
    .app-shell-header__inner {
        width:
            calc(100vw - 16px);
    }

    .app-shell-brand {
        gap: 8px;
    }

    .app-shell-brand__mark {
        width: 32px;
        height: 32px;

        flex-basis: 32px;
    }

    .app-shell-brand__name {
        max-width: 175px;

        font-size: 15px;
    }

    .app-shell-user > summary {
        min-width: 43px;
        width: 43px;

        padding: 5px;
    }

    .app-shell-user__identity,
    .app-shell-user__chevron {
        display: none;
    }

    .app-shell-user__avatar {
        width: 31px;
        height: 31px;
    }

    .app-shell-menu {
        position: fixed;

        top: 62px;
        right: 8px;
        left: 8px;

        width: auto;
    }

    .app-shell-nav {
        gap: 4px;
    }

    .app-shell-nav__link {
        min-height: 35px;

        padding:
            7px
            9px;

        font-size: 9px;
    }
}
