/* T1-Revised-D — restore responsive tables for report pages without breaking cards */
@media (max-width: 1199.98px) {
  .report-toolbar,
  .report-filters,
  .filters-row,
  .report-actions,
  .report-export-actions,
  form[action*="reports"] .row,
  .card .row.g-3,
  .card .row.g-2 {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
  }

  .report-toolbar > *,
  .report-filters > *,
  .filters-row > *,
  .report-actions > *,
  .report-export-actions > *,
  form[action*="reports"] .row > [class*="col-"],
  .card .row.g-3 > [class*="col-"],
  .card .row.g-2 > [class*="col-"] {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .report-kpi-grid,
  .kpi-grid,
  .summary-cards,
  .report-summary-grid,
  .row.report-cards,
  .row.kpi-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Direct report pages with plain tables */
  .pagetitle + .card > .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pagetitle + .card > .card-body > table.table,
  .pagetitle + .card > .card-body .table-responsive table,
  .report-table-wrap table,
  .table-responsive table,
  .card .table-responsive table {
    min-width: 760px;
    width: max-content;
    max-width: none;
  }

  .report-table-wrap,
  .table-responsive,
  .card .table-responsive {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  .pagetitle + .card > .card-body > table.table th,
  .pagetitle + .card > .card-body > table.table td,
  .report-table-wrap th,
  .report-table-wrap td,
  .table-responsive th,
  .table-responsive td,
  .card .table-responsive th,
  .card .table-responsive td {
    white-space: nowrap;
    vertical-align: middle;
  }

  .report-title-bar,
  .page-title,
  .report-header,
  .pagetitle {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    align-items: flex-start;
  }

  .report-export-actions .btn,
  .report-actions .btn,
  .filters-row .btn,
  .report-toolbar .btn,
  form[action*="reports"] .btn {
    min-height: 44px;
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .pagetitle + .card > .card-body > table.table,
  .pagetitle + .card > .card-body .table-responsive table,
  .report-table-wrap table,
  .table-responsive table,
  .card .table-responsive table {
    min-width: 680px;
  }
}
