/* Layout: topo fixo + área rolável abaixo */
.main-content.page-scroll-layout {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100vw - var(--sidebar-width));
}

.sidebar.collapsed ~ .main-content.page-scroll-layout,
.collapsed ~ .main-content.page-scroll-layout {
    width: calc(100% - var(--sidebar-width-collapsed));
    max-width: calc(100vw - var(--sidebar-width-collapsed));
}

.page-sticky-top {
    flex-shrink: 0;
    z-index: 20;
}

.page-sticky-top--homepage {
    background: #ffffff;
    padding-bottom: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.page-sticky-top--homepage .page-header {
    margin-bottom: 0 !important;
}

.page-sticky-top--list {
    background: #ffffff;
    padding-bottom: 0.35rem;
}

.page-scroll-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

/* Tabela: seção ocupa o restante da viewport; corpo com scroll */
.table-section.table-section--scroll {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    padding: 0.55rem 0.75rem;
}

.table-section.table-section--scroll .table-body-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.table-section.table-section--scroll .modern-table-wrapper {
    overflow: visible;
    border-radius: 0;
}

.table-section.table-section--scroll .table-body-scroll.table-responsive {
    overflow: auto;
}

.table-section.table-section--scroll .empty-state {
    flex-shrink: 0;
}

.modern-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
    .main-content.page-scroll-layout {
        height: 100dvh;
        width: 100%;
        max-width: 100%;
    }
}
