/* V03: final mobile overrides; preserve desktop and print layouts. */
@media screen and (max-width: 991.98px) {
  .main-content, .content-wrapper, .card, .card-body, .row > *, .modal-body { min-width: 0; }
  .table-responsive:not(.table-stack-active), .v03-table-scroll { max-width: 100%; overflow-x: auto !important; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
  .table-responsive:not(.table-stack-active) > table, .v03-table-scroll > table { width: 100%; min-width: max-content; }
  .table-responsive:not(.table-stack-active) th, .table-responsive:not(.table-stack-active) td { white-space: nowrap; }
  .modal.show .modal-dialog { max-width: calc(100% - 1rem); }
  .modal.show .modal-content { max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); display: flex; flex-direction: column; }
  .modal.show .modal-body { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
  .modal.show .modal-header, .modal.show .modal-footer { flex-shrink: 0; }
  .modal-footer { flex-wrap: wrap; }
  .form-control, .form-select, input:not([type=checkbox]):not([type=radio]):not([type=hidden]), textarea, select { max-width: 100%; }
  .pagination { flex-wrap: wrap; }
  .card-title, .modal-title, .alert, .page-title { overflow-wrap: anywhere; }
  .table-stack-active tbody td[hidden], .table-stack-active tbody tr[hidden], .table-stack-active .d-none { display: none !important; }
}
@media screen and (max-width: 575.98px) {
  .form-control, .form-select, textarea { font-size: 16px; }
  .modal-footer > .btn, .page-actions > .btn, .header-actions > .btn { min-height: 44px; white-space: normal; }
  .input-group > .btn { min-width: 44px; }
  .page-header, .card-header { flex-wrap: wrap; min-width: 0; }
  .page-header > *, .card-header > * { min-width: 0; max-width: 100%; }
  .modal.show .modal-dialog { margin: .5rem; }
}
