/* Ajustements adaptatifs globaux pour téléphones et petits écrans tactiles. */
@media (max-width: 768px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .app, .main, #appView, .content { min-width: 0; width: 100%; }
  .content { box-sizing: border-box; }
  .card, .card-head, .card-body, .grid, .page-heading, .toolbar, .advanced-filters, .bulk-table-toolbar { min-width: 0; }
  .page-heading > div:first-child { min-width: 0; max-width: 100%; }
  .page-heading p, .card-head p { line-height: 1.55; overflow-wrap: anywhere; }
  .heading-actions { display: flex; flex-wrap: wrap; gap: 7px; }
  .heading-actions .btn { flex: 1 1 145px; min-height: 40px; justify-content: center; }
  .table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .table-wrap table { width: max-content; min-width: 100%; }
  .table-wrap th, .table-wrap td { padding: 9px 10px; }
  .table-actions, .ai-actions, .bulk-actions { flex-wrap: wrap; }
  .toolbar, .advanced-filter-grid, .ai-toolbar, .camera-check-controls { align-items: stretch; }
  .toolbar > *, .ai-toolbar > *, .camera-check-controls > * { min-width: 0; max-width: 100%; }
  .ai-toolbar input[type=search] { flex: 1 1 100%; min-width: 0; }
  .advanced-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-field { min-width: 0; }
  .filter-field .input, .filter-field .select, .field .input, .field .select, .field .textarea { box-sizing: border-box; width: 100%; min-width: 0; }
  .btn, .icon-btn { min-height: 38px; }
  .icon-btn { min-width: 38px; }
  .modal-backdrop { align-items: flex-end; padding: 8px; }
  .modal { width: 100%; max-width: 100%; max-height: 94dvh; border-radius: 16px 16px 10px 10px; }
  .modal-content { overflow-x: hidden; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1 1 130px; min-height: 42px; }
  .asset-photo-editor, .company-profile-editor { align-items: flex-start; flex-wrap: wrap; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-pagination { flex-wrap: wrap; }
  .table-pagination-actions { flex-wrap: wrap; }
  .tracking-subnav, .module-tabs { width: 100%; box-sizing: border-box; }
  .camera-date-field, .camera-date-field .input, .camera-check-state, .camera-check-note { min-width: 0; width: 100%; }
}
@media (max-width: 480px) {
  .content { padding-left: 11px; padding-right: 11px; }
  .topbar { gap: 7px; }
  .top-left { gap: 7px; }
  .breadcrumb { font-size: 10px; }
  .top-right { min-width: 0; }
  .user-menu { gap: 5px; }
  .avatar { width: 31px; height: 31px; }
  .heading-actions .btn { flex-basis: 100%; }
  .kpi-grid, .ai-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi, .ai-stat { padding: 11px; }
  .kpi-value, .ai-stat strong { font-size: 20px; }
  .quick-actions { grid-template-columns: 1fr; }
  .advanced-filter-grid, .detail-grid { grid-template-columns: 1fr; }
  .bulk-table-toolbar { align-items: stretch; }
  .bulk-actions .btn { flex: 1 1 100%; }
  .permission-grid { grid-template-columns: 1fr; }
  .ai-toolbar select { width: 100%; min-width: 0; }
}
