/* Phone layouts share the same data and actions as desktop. No overflow hiding. */
@media screen {
  .admin-grid > *, .dashboard-grid > *, .calculator-layout > * { min-width: 0; }
}
@media screen and (max-width: 700px) {
  .dashboard-shell, .admin-page .dashboard-shell { padding: 16px 12px 40px; }
  .dashboard-shell > *, .admin-grid > *, .dashboard-grid > *, .billing-grid > *,
  .calculator-layout > *, .form-group { min-width: 0; }
  .admin-grid, .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; max-width: 100%; }
  input:not([type=checkbox]):not([type=radio]), select { min-height: 44px; }
  button, .primary-button, .secondary-button, .home-nav a, .profile-edit-link,
  .workspace-nav a, .section-nav a, summary { min-height: 44px; }
  button, summary { touch-action: manipulation; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; flex-shrink: 0; }
  .billing-check, .bulk-review-table td > label { min-height: 44px; align-content: center; }
  .topbar { flex-wrap: wrap; padding: 12px; }
  .topbar-brand { min-width: 0; }
  .admin-page .topbar-logo { width: 140px; max-width: 43vw; }
  .section-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 6px 0; }
  .section-nav a { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 4px; font-size: 12px; }
  .admin-page [id] { scroll-margin-top: 118px; }
  .admin-card-heading, .billing-heading, .section-heading { flex-wrap: wrap; gap: 12px; }
  .admin-search { width: 100%; min-width: 0; }
  .admin-page .dashboard-card, .dashboard-card { padding: 16px; }
  .admin-table-wrapper { max-height: none; overflow: visible; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; min-width: 0; }
  .admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .admin-table tr { padding: 12px; margin: 0 0 12px; border: 1px solid var(--movag-border); border-radius: 10px; background: #fff; }
  .admin-table td { padding: 5px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .admin-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--movag-muted); margin-bottom: 3px; }
  .admin-table td:first-child { font-weight: 700; font-size: 16px; }
  .customer-details-button { width: 100%; margin-top: 6px; }
  .billing-queue, .billing-workflow { flex-wrap: wrap; }
  .billing-workflow button { flex: 1; }
  .billing-queue > button { width: 100%; }
  .billing-grid, .billing-settings-form, .bulk-config { grid-template-columns: minmax(0, 1fr); }
  .billing-report-toolbar { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .billing-report-toolbar > * { grid-column: 1 !important; min-width: 0; }
  .billing-preview .billing-heading { align-items: stretch; }
  .billing-preview-channel { width: 100%; }
  .bulk-preview-scroll { overflow: visible; }
  .bulk-review-table, .bulk-review-table tbody { display: block; width: 100%; min-width: 0; }
  .bulk-review-table thead, .bulk-review-table thead tr { display: block; }
  .bulk-review-table thead th { display: none; }
  .bulk-review-table thead th:first-child { display: flex; align-items: center; gap: 12px; min-height: 48px; }
  .bulk-review-table thead th:first-child::after { content: 'Seleccionar todos los clientes'; }
  .bulk-review-table tbody tr { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 0 8px; border: 1px solid var(--movag-border); border-radius: 12px; padding: 12px; margin: 12px 0; background: #fff; }
  .bulk-review-table td { display: block; min-width: 0; padding: 8px 0; border: 0; grid-column: 2; overflow-wrap: anywhere; }
  .bulk-review-table td:first-child { grid-column: 1; grid-row: 1; }
  .bulk-review-table td[data-label]::before { content: attr(data-label); display: block; font-weight: 600; color: var(--movag-muted); font-size: 12px; margin-bottom: 6px; }
  .bulk-review-table td > label { white-space: normal; }
  .bulk-review-table td > input:not([type=checkbox]) { width: 100%; }
  .bulk-review-table details { min-width: 0; }
  .bulk-review-table summary { padding: 10px 0; }
  .bulk-package-weight { line-height: 1.7; }
  .bulk-package-weight input { min-height: 44px; }
  .bulk-results { max-height: none; overflow: visible; }
  .bulk-results pre, .billing-text-preview { overflow-wrap: anywhere; }
  .admin-packages-container, #adminPackagesContainer { max-height: none; overflow: visible; }
  .admin-package-actions { flex-wrap: wrap; gap: 10px; }
  .admin-package-actions > *, .admin-package-status { min-width: 0; max-width: 100%; }
  .package-card-header, .package-status-summary { overflow-wrap: anywhere; }
  .profile-row { flex-wrap: wrap; gap: 6px; }
  .profile-row strong, #customerEmail, .warehouse-address-content { min-width: 0; overflow-wrap: anywhere; }
  .locker-card { min-width: 0; }
  .billing-dialog, .calculator-dialog { max-height: calc(100dvh - 24px); width: calc(100% - 24px); padding: 16px; overscroll-behavior: contain; }
  .customer-details-modal { padding: 10px; }
  .customer-details-dialog { max-height: calc(100dvh - 20px); padding: 16px; overscroll-behavior: contain; }
  .customer-details-modal-header { position: sticky; top: -16px; background: var(--movag-surface, #fff); z-index: 2; padding-top: 12px; }
  .billing-message-preview { min-height: 220px; max-height: 45dvh; }
  .saved-view-toolbar > div { width: 100%; }
  .saved-view-toolbar select { width: 100%; }
  .home-header { flex-wrap: wrap; }
  .home-nav { flex-wrap: wrap; }
  .auth-card { padding: 24px 18px; }
}
@media screen and (max-width: 360px) {
  .topbar-brand > span { max-width: 140px; }
  .workspace-nav a { font-size: 12px; padding: 10px 6px; }
  .billing-package-row { grid-template-columns: minmax(0,1fr) 80px; }
}
