/* Customer navigation shell. Kept separate from page-level application styles. */
@font-face {
    font-family: "Poppins";
    src: url("assets/fonts/poppins-latin-600.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}
.app-shell {
    min-height: 100vh;
}

.sidebar {
    width: 224px;
    padding: 26px 16px 18px;
    gap: 14px;
}

.brand {
    padding: 0 10px 12px;
    font-size: 23px;
    font-family: "Poppins", system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: -.01em;
    gap: 1px;
}

.brand-mark {
    width: 26px;
    height: auto;
    background: radial-gradient(circle, #17251f 0 40%, transparent 41%);
}

.brand-wordmark {
    transform: translateY(-1px);
}

.side-nav {
    gap: 11px;
    overscroll-behavior: contain;
}

.nav-heading {
    padding: 10px 10px 3px;
    font-size: 10px;
    letter-spacing: .15em;
}

.side-nav > a,
.side-nav > .nav-disabled {
    min-height: 40px;
    border: 1px solid transparent;
    border-left: 2px solid transparent;
    border-radius: 7px;
    padding: 8px 10px;
    gap: 10px;
    font-size: 13px;
}

.side-nav > a.active {
    border-color: var(--border-soft);
    border-left: 2px solid var(--accent);
    border-radius: 7px;
    background: #eaf4ed;
    box-shadow: 0 3px 12px #152e2010;
    color: var(--text);
    font-weight: 650;
}

.side-nav > a.active .nav-icon {
    color: var(--accent);
}

.main-column {
    margin-left: 224px;
    min-width: 0;
}

.topbar {
    height: auto;
    min-height: 68px;
    padding: 12px 30px;
    gap: 18px;
    flex-wrap: wrap;
}

.shell-context {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    max-width: 100%;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.shell-tenant,
.shell-environment {
    min-width: 0;
    overflow-wrap: anywhere;
}

.shell-tenant {
    color: var(--text);
    font-weight: 650;
}

.shell-context-separator {
    color: var(--quiet);
}

.shell-environment {
    color: var(--muted);
}

.environment-kind {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border: 1px solid #cfe5d8;
    border-radius: 5px;
    color: #175339;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .04em;
    white-space: nowrap;
}

.shell-context-empty {
    color: var(--muted);
}

.context-toolbar {
    display: flex;
    flex: 1 1 auto;
    align-items: end;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
    margin-left: auto;
    flex-wrap: wrap;
}

.context-toolbar > * {
    min-width: 0;
}

.context-toolbar .culture-picker {
    flex: 0 0 auto;
    align-self: end;
}

.sidebar-bottom form {
    margin: 0;
}

.sidebar-bottom button.text-link {
    min-height: 40px;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    text-align: left;
}

.sidebar-bottom button.text-link:hover {
    color: var(--text);
}

@media (max-width: 1150px) and (min-width: 901px) {
    .topbar {
        align-items: flex-start;
    }

    .shell-context {
        flex: 1 1 100%;
    }

    .context-toolbar {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: sticky;
        inset: 0 0 auto;
        z-index: 10;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        height: auto;
        padding: 10px 16px 8px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .brand {
        display: flex;
        grid-column: 1;
        grid-row: 1;
        width: fit-content;
        padding: 0 3px 9px;
        margin: 0;
        font-size: 21px;
    }

    .side-nav {
        display: flex;
        grid-column: 1 / -1;
        grid-row: 2;
        flex-direction: row;
        align-items: center;
        gap: 5px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 2px 0 4px;
        scrollbar-width: thin;
        scrollbar-color: var(--border) transparent;
    }

    .side-nav::-webkit-scrollbar {
        display: block;
        height: 4px;
    }

    .side-nav::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }

    .nav-heading {
        display: none;
    }

    .side-nav > a,
    .side-nav > .nav-disabled {
        display: flex;
        flex: 0 0 auto;
        width: auto;
        min-height: 40px;
        white-space: nowrap;
    }

    /* Override the legacy mobile rule that hid all but the dataset link. */
    .side-nav > a:not([href="/"]) {
        display: flex;
    }

    .side-nav > .nav-disabled {
        display: none;
    }

    .side-nav > a.active {
        border-left-width: 2px;
    }

    .sidebar-bottom {
        display: block;
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .sidebar-bottom button.text-link {
        min-height: 36px;
        padding: 4px 10px;
    }

    .main-column {
        margin-left: 0;
    }

    .topbar {
        position: relative;
        min-height: 0;
        align-items: stretch;
        flex-direction: column;
        gap: 11px;
        padding: 13px 20px;
    }

    .shell-context {
        min-height: 28px;
    }

    .context-toolbar {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .sidebar {
        padding: 9px 12px 7px;
    }

    .brand {
        font-size: 20px;
        padding-bottom: 7px;
    }

    .side-nav {
        margin-right: -2px;
    }

    .topbar {
        padding: 12px 13px;
        gap: 10px;
    }

    .shell-context {
        flex-wrap: wrap;
        gap: 5px 8px;
        font-size: 12px;
    }

    .context-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
        align-items: stretch;
    }

    .context-toolbar > *,
    .context-toolbar .environment-switcher,
    .context-toolbar .scope-switcher {
        width: 100%;
        max-width: 100%;
    }

    .context-toolbar .culture-picker {
        justify-self: start;
        min-height: 36px;
    }
}

@media (max-width: 360px) {
    .sidebar {
        padding-right: 9px;
        padding-left: 9px;
    }

    .side-nav > a,
    .side-nav > .nav-disabled {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 11px;
    }
}
