/* App shell: lock to viewport, scroll inside content area */

html,
body {
    height: 100%;
    overflow: hidden;
}

.app-wrap {
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    grid-template-rows: var(--app-header-height) minmax(0, 1fr);
    grid-template-areas: 'header header' 'sidebar main';
}

/* Top-nav variant: sidebar sits between header and main */
.set-nav-top .app-wrap {
    grid-template-rows: var(--app-header-height) var(--menu-top-height) minmax(0, 1fr);
    grid-template-areas: 'header header' 'sidebar sidebar' 'main main';
}

/* Grid cell for main — allow flex children to constrain */
.app-body {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Flex column inside app-body (content + footer) */
.app-content {
    min-height: 0;
    overflow: hidden;
}

/* Actual scroll container for page content */
.app-content .content-wrapper {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar scrolls independently */
.app-sidebar {
    height: 100%;
    overflow-y: auto;
}

/* In top-nav mode the grid has an extra row — keep main area constrained */
.set-nav-top .app-body {
    height: 100%;
    min-height: 0;
}
