/* Page shells: public site (MainLayout, EmptyLayout) and console (ConsoleLayout, ConsoleSideMenu). */

.layout-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout-main {
    flex: 1 0 auto;
}

/* Public header and footer */
.sh-public-bar.mud-appbar {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

.sh-header-user .mud-button-label {
    gap: 10px;
}

.sh-public-footer.mud-paper {
    background: var(--mud-palette-surface);
    border-radius: 0;
}

.sh-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.sh-footer-brand img {
    display: block;
    height: 24px;
}

.sh-footer-brand .sh-footer-lics img {
    height: 16px;
}

/* Footer Tools: a details element whose list opens above the button. The button keeps to the right, so the list has room on phones. */
.sh-tools-menu {
    position: relative;
    margin-left: auto;
}

.sh-tools-button {
    height: 28px;
    padding: 0 8px;
    border-radius: var(--sh-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--mud-palette-tertiary);
}

.sh-tools-button::-webkit-details-marker {
    display: none;
}

.sh-tools-button:hover,
.sh-tools-menu[open] .sh-tools-button {
    background: var(--sh-raised);
    color: var(--mud-palette-text-primary);
}

.sh-tools-button .mud-icon-root {
    font-size: 16px;
}

.sh-tools-menu[open] .sh-tools-chevron {
    transform: rotate(180deg);
}

.sh-tools-list {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 10;
    width: 260px;
    box-sizing: border-box;
    padding: 6px;
    border-radius: var(--sh-radius);
    background: var(--sh-raised);
    box-shadow: var(--sh-shadow-overlay);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sh-tools-item {
    height: 36px;
    padding: 0 8px;
    border-radius: var(--sh-radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
}

.sh-tools-item:hover {
    background: var(--sh-control);
}

.sh-tools-item .sh-tools-out {
    margin-left: auto;
    color: var(--mud-palette-text-disabled);
}

.sh-tools-divider {
    height: 1px;
    margin: 4px 6px;
    background: var(--sh-control);
}

/* Console drawer: rounded panel with a scrolling menu and the user card below it. */
.sh-console .mud-drawer.sh-drawer {
    background: var(--mud-palette-background);
    border: 0;
    overscroll-behavior: contain;
}

/* Phones: while the menu is open over the page, the page doesn't scroll, so the browser bars don't move and resize the menu. */
html:has(.mud-drawer-overlay--open),
html:has(.mud-drawer-overlay--open) body {
    overflow: hidden;
}

.mud-drawer-overlay {
    touch-action: none;
}

.sh-drawer .mud-drawer-content {
    padding: 8px 0 8px 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.sh-nav-panel {
    height: 100%;
    box-sizing: border-box;
    padding: 10px 8px 8px;
    border-radius: var(--sh-radius-lg);
    background: var(--mud-palette-surface);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sh-nav {
    flex: 1;
    min-height: 0;
    margin-right: -6px;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.sh-brand {
    height: 36px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--mud-palette-text-primary);
    font-size: 14px;
    font-weight: 600;
}

.sh-brand sup {
    font-size: 10px;
}

.sh-grp {
    padding: 10px 8px 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--mud-palette-text-disabled);
}

.sh-nav .mud-nav-item {
    padding: 0;
}

.sh-nav .mud-nav-link {
    height: 32px;
    padding: 0 6px;
    align-items: center;
    border-radius: var(--sh-radius-sm);
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

.mud-navmenu.sh-nav .mud-nav-link:hover:not(.mud-nav-link-disabled),
.mud-navmenu.sh-nav .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: var(--sh-raised);
    color: var(--mud-palette-text-primary);
}

/* The link icon is drawn as the section's pastel tile; ConsoleNavLink sets --sh-tile. */
.sh-nav .mud-nav-link .mud-nav-link-icon {
    width: 22px;
    height: 22px;
    box-sizing: border-box;
    padding: 3px;
    margin: 0;
    border-radius: var(--sh-radius-sm);
    background: var(--sh-tile, var(--sh-control));
}

/* MudBlazor colours nav icons with a more specific rule. */
.mud-navmenu.sh-nav .mud-nav-link .mud-nav-link-icon.mud-nav-link-icon-default {
    color: var(--sh-on-tile);
}

.sh-nav .mud-nav-link .mud-nav-link-text {
    margin: 0;
}

.sh-app-switch-wrap {
    position: relative;
    margin: 6px 0 4px;
}

.sh-app-switch.mud-button-root {
    height: 40px;
    padding: 0 8px 0 6px;
    border-radius: var(--sh-radius);
    background: var(--sh-raised);
    color: var(--mud-palette-text-primary);
    box-shadow: none;
}

.sh-app-switch.mud-button-root:hover {
    background: var(--sh-control);
}

.sh-app-switch .mud-button-icon-end {
    margin-left: auto;
    color: var(--mud-palette-text-secondary);
}

.sh-app-switch-name {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
}

.sh-app-switch-popover.mud-popover {
    width: 300px;
    max-height: 460px;
}

.sh-app-switch-search.mud-input-control {
    margin: 0;
}

.sh-app-switch-list.mud-list {
    max-height: 320px;
    overflow-y: auto;
}

.sh-app-switch-item.mud-list-item {
    padding: 4px 12px;
}

.sh-app-switch-star.mud-icon-button {
    min-width: 0;
    padding: 4px;
}

.sh-user {
    flex: none;
    height: 44px;
    padding: 0 2px 0 6px;
    border-radius: var(--sh-radius);
    background: var(--sh-raised);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sh-user-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--sh-radius-sm);
}

.sh-user-name {
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
}

/* Mobile top bar, only below the desktop breakpoint where the drawer is temporary. */
.sh-mobilebar.mud-appbar {
    background: var(--mud-palette-background);
}

@media (min-width: 960px) {
    .sh-mobilebar.mud-appbar {
        display: none;
    }

    .sh-console .mud-main-content {
        padding-top: 0;
    }
}

@media (max-width: 599.98px) {
    .sh-header-user .mud-button-label > span {
        display: none;
    }
}
