/* Page lists share the available workspace. Keep dialogs and printed documents
   outside this screen-only layer, and retain each list's native scroll region. */
@media screen {
  html body #root .content-body:has(> .settings-preferences-page :is(.user-list, .settings-auxiliary-list, .settings-product-list, .audit-list)),
  html body #root .content-body:has(> :is(
    .people-page, .products-page, .registration-records-page, .orders-page,
    .production-unified-workspace, .material-flow-page, .current-stock-page, .movement-page,
    .ready-stock-reservations, .financial-page, .report-page-shell, .reporting-page
  )) {
    padding: 12px 20px 16px !important;
  }

  html body #root .content-body :is(
    .people-list-panel, .products-page > .product-list,
    .registration-records-page > .registration-existing-list,
    .input-list-scroll, .order-table-shell,
    .production-operations-panel, .production-manager-orders-card,
    .material-flow-panel, .ready-stock-reservations,
    .ready-stock-reservation-scroll, .current-stock-table-scroll,
    .financial-panel, .report-results-card, .report-table,
    .reporting-result, .reporting-card:has(.reporting-table-scroll), .reporting-results,
    .reporting-table-wrap, .reporting-table-scroll,
    .settings-preferences-content:has(.user-list, .settings-auxiliary-list, .settings-product-list, .audit-list),
    .settings-preferences-body .panel-card:has(> :is(.settings-product-list, .settings-auxiliary-list, .audit-list)),
    .settings-users-list-card, .access-role-card
  ):not(:where([role='dialog'] *, [aria-modal='true'] *, .details-panel *, .adi-pdf-document *)) {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body #root .content-body :is(
    .people-page, .products-page, .registration-records-page, .orders-page,
    .production-unified-workspace .page-shell, .current-stock-page,
    .material-flow-page, .financial-page, .report-page-shell
  ) { gap: 10px !important; }

  html body #root .content-body :is(
    .people-list-heading, .registration-list-toolbar,
    .products-page > .list-toolbar, .financial-panel-title
  ) { margin-bottom: 0 !important; }

  html body #root .content-body :is(.people-pagination, .financial-panel > .panel-title) {
    margin-top: 0;
    margin-bottom: 8px;
  }

  /* Table-like lists use dividers instead of a separate box around every row. */
  html body #root .content-body :is(.input-list-body, .order-list) { gap: 0 !important; }
  html body #root .content-body :is(.input-list-row, .order-swipe-shell) {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  html body #root .content-body :is(.input-list-row, .order-list-row) {
    border: 0 !important;
    border-bottom: 1px solid var(--line, #dce5ef) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  html body #root .content-body .current-stock-table {
    border-collapse: separate;
    border-spacing: 0;
  }
  html body #root .content-body .current-stock-table td {
    border: 0;
    border-bottom: 1px solid var(--stock-border);
    border-radius: 0;
    background: transparent;
  }
  html body #root .content-body .current-stock-table tr:is(:hover, :focus-within) td {
    background: var(--stock-hover);
  }
  html[data-theme='dark'] body #root .content-body :is(.input-list-row, .order-list-row) {
    border-bottom-color: var(--adi-dark-border, #333) !important;
  }

  @media (max-width: 820px) {
    html body #root .content-body:has(> .settings-preferences-page :is(.user-list, .settings-auxiliary-list, .settings-product-list, .audit-list)),
    html body #root .content-body:has(> :is(
      .people-page, .products-page, .registration-records-page, .orders-page,
      .production-unified-workspace, .material-flow-page, .current-stock-page, .movement-page,
      .ready-stock-reservations, .financial-page, .report-page-shell, .reporting-page
    )) {
      padding: 8px 12px calc(var(--mobile-nav-height, 52px) + max(12px, var(--safe-bottom, 0px)) + 12px) !important;
    }
  }
}
