/* Shared table viewport for admin, panel and applicant screens. */
:root { --app-table-max-height: min(60vh, 40rem); }
.app-table-viewport {
  display: block;
  max-width: 100%;
  min-width: 0;
  max-height: var(--app-table-max-height);
  overflow: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.app-table-viewport:focus-visible,
.dt-scroll-body:focus-visible,
.dataTables_scrollBody:focus-visible { outline: 2px solid var(--bs-primary, #348fe2); outline-offset: 2px; }
.app-table-viewport > table { margin-bottom: 0; }
.app-table-viewport > table > thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bs-body-bg, #fff);
}
/* Let DataTables own its body scroll, leaving search, headers and pagination outside. */
.app-table-host-datatable { max-height: none !important; overflow: visible !important; }
.dt-container, .dataTables_wrapper { min-width: 0; max-width: 100%; }
.dt-scroll-body, .dataTables_scrollBody {
  max-height: var(--app-table-max-height) !important;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}
@media print {
  .app-table-viewport, .app-table-host-datatable,
  .dt-scroll-body, .dataTables_scrollBody {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    scrollbar-gutter: auto;
  }
  .app-table-viewport > table > thead { position: static; }
}
