/* The signed-in area: navigation down the side on wide screens, above the page on narrow ones. As in helpdesk. */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-layout__nav {
    flex-shrink: 0;
    border-bottom: var(--border-width) solid var(--color-border);
}

.app-layout__nav-inner {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
}

.app-layout__nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

/* Inset like a button's label, so the brand, headings and nav links all start on one line. */
.app-layout__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-on-surface);
    text-decoration: none;
}

.app-layout__brand-mark {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-primary);
}

.app-layout__nav-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.app-layout__nav-sections[hidden] {
    display: none;
}

/* Set off from the navigation above it by a divider across the whole sidebar: our staff's switch between views. */
.app-layout__nav-footer {
    margin-inline: calc(-1 * var(--spacing-md));
    margin-bottom: calc(-1 * var(--spacing-md));
    padding: var(--spacing-md);
    border-top: var(--border-width) solid var(--color-border);
}

.app-layout__nav-primary-section {
    flex-grow: 1;
}

/* A column, so whatever follows the page (the staff bar) sits at the bottom of a short one. */
.app-layout__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

@media (min-width: 48rem) {
    .app-layout {
        flex-direction: row;
    }

    .app-layout__nav {
        position: sticky;
        top: 0;
        width: 16rem;
        height: 100vh;
        border-right: var(--border-width) solid var(--color-border);
        border-bottom: none;
    }

    .app-layout__nav-inner {
        height: 100%;
        overflow-y: auto;
    }

    .app-layout__nav-sections,
    .app-layout__nav-sections[hidden] {
        display: flex;
        flex-grow: 1;
    }
}
