.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
    grid-template-rows: var(--app-header-height) minmax(0, 1fr);
}

.app-shell:not(.app-shell--with-sidebar) {
    grid-template-columns: minmax(0, 1fr);
}

.app-shell:not(.app-shell--with-sidebar) .app-header,
.app-shell:not(.app-shell--with-sidebar) .app-main {
    grid-column: 1;
}

.app-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    grid-row: 1 / -1;
    width: var(--app-sidebar-width);
    height: 100vh;
    overflow: hidden auto;
    border-right: 1px solid var(--app-color-border);
    background: #202937;
    color: #f4f7fb;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-width: 0;
    height: var(--app-header-height);
    align-items: center;
    justify-content: space-between;
    gap: var(--app-space-4);
    padding: 0 var(--app-space-5);
    border-bottom: 1px solid var(--app-color-border);
    background: rgba(255, 255, 255, 0.96);
}

.app-main {
    min-width: 0;
    padding: var(--app-space-5);
}

.app-main__inner {
    width: min(100%, var(--app-content-max-width));
    margin: 0 auto;
}

.app-page-header {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--app-space-4);
    margin-bottom: var(--app-space-4);
}

.app-page-title {
    margin: 0;
    font-size: 22px;
    font-weight: 650;
    line-height: 1.35;
}

.app-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--app-space-2);
}

.app-mobile-overlay {
    display: none;
}

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

    .app-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        transition: transform var(--app-transition-fast);
    }

    .app-shell[data-sidebar-open="true"] .app-sidebar {
        transform: translateX(0);
    }

    .app-mobile-overlay {
        position: fixed;
        inset: 0;
        z-index: 25;
        display: block;
        border: 0;
        background: rgba(10, 18, 30, 0.48);
    }

    .app-header,
    .app-main {
        grid-column: 1;
    }

    .app-main {
        padding: var(--app-space-4);
    }
}

@media (max-width: 560px) {
    .app-header {
        padding: 0 var(--app-space-3);
    }

    .app-main {
        padding: var(--app-space-3);
    }

    .app-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .app-page-actions {
        justify-content: flex-start;
    }
}
