/* Static copy of MainLayout.razor.css; used because scoped CSS bundle isn't emitted */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    /* Remove extra top padding that caused a thin black strip above the sidebar */
    padding-top: 0;
}

.main {
    scrollbar-gutter: stable;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background-color: #121416;
    font-size: 0.9375rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Force a visible scrollbar lane on desktop Chromium/WebKit so toolbar width stays perceptually stable. */
.main::-webkit-scrollbar {
    width: 12px;
}

.main::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

.main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.page[data-theme="light"] .main::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.08);
}

.page[data-theme="light"] .main::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.28);
    border: 2px solid transparent;
    background-clip: content-box;
}

.sidebar {
    background-color: rgb(82, 96, 113);
    flex-shrink: 0;
    z-index: 1000;
}

.top-row {
    /* Match sidebar grey so header + sidebar are one block, and remove divider line */
    background-color: rgb(82, 96, 113);
    border-bottom: none;
    height: 3.5rem;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.top-row-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem 1rem;
    width: 100%;
    min-width: 0;
    height: 100%;
}

.top-row-inner > * {
    align-self: center;
}

.top-row-username {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

.top-row a,
.top-row .btn-link {
    white-space: nowrap;
}

.top-row form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    height: 2.25rem;
}

.btn-logout-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 0.75rem;
    margin: 0;
    border-radius: 8px;
    border: none;
    background-color: #1976d2;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
}

.btn-logout-small:hover {
    background-color: #1565c0;
}

.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    box-sizing: border-box;
}

.btn-theme-toggle:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.page[data-theme="light"] .main {
    background-color: #f5f5f5;
    color: #212529;
}

.page[data-theme="light"] .top-row {
    background-color: #e9ecef;
    border-bottom-color: #dee2e6;
    color: #212529;
}

.page[data-theme="light"] .sidebar {
    background-color: #dee2e6 !important;
}

.page[data-theme="light"] .btn-theme-toggle {
    border-color: rgba(0,0,0,0.2);
    color: #212529;
}

.page[data-theme="light"] .btn-theme-toggle:hover {
    background: rgba(0,0,0,0.08);
    color: #000;
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 175px;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        height: 100vh;
        height: 100dvh;
    }

    .main > .content {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
        padding-top: 1rem;
    }
}

@media (max-width: 640.98px) {
    .page {
        overflow-x: hidden;
        overflow-y: hidden;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        height: 100vh;
        height: 100dvh;
    }

    .top-row:not(.auth) {
        display: none;
    }

    .top-row.auth .top-row-inner {
        justify-content: flex-end;
        padding: 0.5rem 0;
    }

    .top-row a,
    .top-row .btn-link {
        margin-left: 0;
    }

    .main > .content {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0));
    }
}


