/* Sticky table header: on long lists the header row stays under the admin header (50px) while the page scrolls.
   position: sticky only works when no ancestor between the table and the page is a scroll container,
   so each wrapper is opened (overflow visible) only from the width where the table fits without horizontal scroll;
   below that width the wrapper keeps its horizontal scroll and the header simply scrolls with the page. */

body.admin-new-theme.orderList-css #orders > thead > tr > th,
body.admin-new-theme.customerList-css #customers > thead > tr > th,
body.admin-new-theme.supplierOrders-css .supplierOrders-table > thead > tr > th,
body.admin-new-theme.priceListView-css #products-price-table > thead > tr > th,
body.admin-new-theme.showSupplierInvoicesByDates-css .table-show-supplier-invoices-by-dates > thead > tr > th,
body.admin-new-theme.usersList-css .users-list > thead > tr > th
{
    position: sticky;
    top: 50px;
    z-index: 3;
    background-clip: padding-box;
    box-shadow: inset 0 -1px 0 var(--adm-border);
}

:where(
    body.admin-new-theme.customerList-css #customers,
    body.admin-new-theme.supplierOrders-css .supplierOrders-table,
    body.admin-new-theme.priceListView-css #products-price-table,
    body.admin-new-theme.showSupplierInvoicesByDates-css .table-show-supplier-invoices-by-dates,
    body.admin-new-theme.usersList-css .users-list
) > thead > tr > th
{
    background-color: var(--adm-surface-head);
}

body.admin-new-theme.orderList-css #orders > thead > tr > th
{
    background-color: var(--adm-surface-alt);
}

body.admin-new-theme.orderList-css #orders > thead > tr > th:first-of-type::before
{
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -16px;
    width: 16px;
    background-color: var(--adm-surface);
}

body.admin-new-theme.priceListView-css .plv-shell
{
    overflow: clip;
}

@media (min-width: 992px)
{
    body.admin-new-theme.supplierOrders-css .table-responsive
    {
        overflow: visible;
    }
}

@media (min-width: 1200px)
{
    body.admin-new-theme.priceListView-css .plv-products-table-wrap
    {
        overflow: visible;
    }
}

@media (min-width: 1440px)
{
    body.admin-new-theme.orderList-css .table-order-list
    {
        overflow: visible;
    }
}

@media (min-width: 1600px)
{
    body.admin-new-theme.customerList-css .table-responsive:has(> .table-customer-list),
    body.admin-new-theme.showSupplierInvoicesByDates-css .table-responsive:has(> .table-show-supplier-invoices-by-dates)
    {
        overflow: visible;
    }
}
