/* R69: mejoras limitadas a pantallas pequeñas. No modifica scripts ni estilos de escritorio. */
@media screen and (max-width: 700px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  main.wrap { width: 100% !important; max-width: 100% !important; padding: 8px 8px 24px !important; }
  #view, #view > .panel { min-width: 0 !important; max-width: 100% !important; }
  #view > .panel { padding: 12px; }
  #view .panel { min-width: 0; padding: 12px; }
  #view > .panel > h2:first-child { font-size: 20px; line-height: 1.25; }
  #view .grid { grid-template-columns: minmax(0, 1fr); }
  #view input, #view select, #view textarea { font-size: 16px; }
  #view input, #view select { min-height: 44px; }
  #view button { min-height: 42px; touch-action: manipulation; }
  nav.tabs { display: flex; flex-wrap: nowrap; gap: 6px; width: 100%; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 7px; margin: 0 0 10px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .nav-group { display: contents; }
  .nav-group-title { display: none; }
  nav.tabs button { flex: 0 0 auto; width: auto; min-width: max-content; min-height: 40px; text-align: center; font-size: 13px; }
  #cloudBanner { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  #cloudBanner #cloudLogout { margin-left: 0; }
  .tsrb48-oc-scroll, .tsrb100-table-wrap { max-width: 100%; overflow-x: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .tsrb48-oc-table { min-width: 1100px; }
  .tsrb100-register { min-width: 1050px; }
  .tsrb100-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .tsrb100-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .tsrb100-head, .tsrb100-list-head { align-items: stretch; flex-direction: column; }
  .tsrb100-order summary { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 380px) {
  #view > .panel, #view .panel { padding: 9px; }
  .tsrb100-stats { grid-template-columns: minmax(0, 1fr) !important; }
}
/* R371 (28-11-2026): filas de repuestos de la OT tenían columnas de ancho fijo (inline) y se salían de la pantalla del teléfono. */
@media screen and (max-width: 700px) {
  #cloudOTForm .tsrb24-part-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  #cloudOTForm .tsrb24-part-row > label:nth-child(1),
  #cloudOTForm .tsrb24-part-row > label:nth-child(2) { grid-column: 1 / -1; }
  #cloudOTForm .tsrb24-part-row select, #cloudOTForm .tsrb24-part-row input { min-width: 0; max-width: 100%; }
}

/* R381: en el telefono los botones de accion de las listas (Editar, Eliminar, Situacion, Ir, Trazar) median 28-30 px; se agrandan a 40 px y se separan para no tocar el equivocado. */
@media (max-width:760px){#view .t148-act,#view .t133-btn.mini{min-height:40px!important;padding:6px 12px!important;font-size:14px!important;margin:0 8px 8px 0!important}}
/* R381: en el telefono el listado de ingresos (1.282 px de ancho) se ve como tarjetas, sin deslizar hacia el lado. */
@media (max-width:760px){#view .t148-table,#view .t148-table tbody{display:block;width:100%!important;min-width:0!important}#view .t148-table thead{display:none}#view .t148-table tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2px 10px;border:1px solid #dbe5ec;border-radius:12px;padding:8px 10px;margin:0 0 10px;background:#fff}#view .t148-table tr[hidden],#view .t148-table tr[style*="display: none"]{display:none!important}#view .t148-table td{display:block;border:0!important;padding:3px 0!important;min-width:0;width:auto!important;font-size:14px}#view .t148-table td:nth-child(2){grid-row:1;grid-column:1}#view .t148-table td:nth-child(1){grid-row:1;grid-column:2;text-align:right}#view .t148-table td:nth-child(3),#view .t148-table td:nth-child(4),#view .t148-table td:last-child{grid-column:1/-1}#view .t148-table td:last-child{display:flex;flex-wrap:wrap;gap:0;padding-top:6px!important}#view .t148-table td:nth-child(2)>*:first-child{font-size:16px}}
/* R382: telefono - botones de al menos 40 px, letra minima 12 px y espacio al final para la campana y la lupa flotantes. */
@media (max-width:760px){#view button,#view .button,#view [role=button]{min-height:40px}#view .t133-link{display:inline-flex;align-items:center;min-height:40px}#view small,#view th,#view .t136-sub-title,#view [class*="-tag"],#view [class*="-pill"],#view .t133-eyebrow{font-size:12px!important}main.wrap{padding-bottom:130px!important}}
@media (max-width:760px){#view button,#view [role=button]{min-height:40px!important;height:auto!important}#view button{font-size:max(13px,1em)}#view .oc41Save,#view .t145-mini,#view .t133-btn,#view .t137-doc{font-size:13px!important;padding-top:6px!important;padding-bottom:6px!important}#view .t133-link{display:inline-flex!important;align-items:center;min-height:40px!important}}
@media (max-width:760px){#view button{font-size:max(13px,1em)!important}}
/* R382: detalle de una OC en Compras (Registro de ordenes): la tabla media min. 500 px dentro de una columna de ~140 px y se montaba sobre Fecha/Vencimiento/Total. Ahora cada articulo es una linea dentro de su columna (PC y telefono). */
#view .tsrb100-row-detail table.tsrb100-lines{min-width:0!important;width:100%!important;display:block;margin-top:6px}
#view .tsrb100-row-detail table.tsrb100-lines thead{display:none}
#view .tsrb100-row-detail table.tsrb100-lines tbody{display:block}
#view .tsrb100-row-detail table.tsrb100-lines tr{display:block;padding:5px 0;border-top:1px solid #e5edf2;font-size:12px;line-height:1.35}
#view .tsrb100-row-detail table.tsrb100-lines td{display:inline;padding:0!important;border:0!important;white-space:normal!important}
#view .tsrb100-row-detail table.tsrb100-lines td:first-child{display:block;font-weight:600}
#view .tsrb100-row-detail table.tsrb100-lines td:nth-child(2)::before{content:"Cant. "}
#view .tsrb100-row-detail table.tsrb100-lines td:nth-child(3)::before{content:" x "}
#view .tsrb100-row-detail table.tsrb100-lines td:nth-child(4)::before{content:" = "}
#view .tsrb100-row-detail table.tsrb100-lines td:nth-child(4){font-weight:700}
#view table.tsrb100-register td:nth-child(4),#view table.tsrb100-register td:nth-child(5){white-space:nowrap}
@media (min-width:761px){#view .t148-table td:last-child{white-space:normal!important;width:150px;min-width:150px}#view .t148-table td:last-child .t148-act{display:inline-flex;margin:0 4px 6px 0}}
@media (min-width:761px){#view .t148-table{min-width:0!important;width:100%!important}#view .t148-table td:nth-child(5){white-space:normal!important}#view .t148-table td:nth-child(4){min-width:160px}}
/* R382: la campana flotante (z 9998) quedaba encima de 9 ventanas emergentes (situacion, IA, informe, avisos, camara de fotos...) y podia tapar sus botones. Se baja bajo todas ellas (la mas baja es 998). */
.tsrb232-campana{z-index:990!important}
/* R383: telefono - (1) campos con letra de 16 px: con menos, el iPhone agranda la pantalla al tocarlos (OC y facturas, Avance, Hojas de trabajo tenian 12,5-14 px). (2) grillas fijas escritas en el codigo (p. ej. lista de PDF de OC con minimo 180 px) pasan a una columna; las que ya se adaptan solas (auto-fit) no se tocan. */
@media (max-width:760px){#view input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),#view select,#view textarea,.r333-modal input,.r333-modal select,.r333-modal textarea{font-size:16px!important}}
@media (max-width:600px){#view [style*="grid-template-columns"]:not([style*="auto-fit"]):not([style*="auto-fill"]):not([style*="grid-template-columns:1fr"]):not([style*="grid-template-columns: 1fr"]){grid-template-columns:minmax(0,1fr)!important}#view [style*="grid-template-columns"]>*{min-width:0;overflow-wrap:anywhere}}
/* R383: filtros de Registro de salidas: 8 columnas fijas (1.086 px) no cabian y corrian toda la pagina hacia el lado en el computador. */
#view .tsrb24-exit-filters{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important}
/* R383: Control de OC tiene 14 columnas con ancho fijo; la 14.a (PDF cotizacion) no tenia ancho y en notebooks de 1.366 px quedaba en 0 px con el boton aplastado. */
#view .tsrb48-oc-table th:nth-child(7),#view .tsrb48-oc-table td:nth-child(7){width:78px!important;min-width:70px!important}
#view .tsrb48-oc-table th:nth-child(14),#view .tsrb48-oc-table td:nth-child(14){width:96px!important;min-width:96px!important}
#view .tsrb48-oc-table td:nth-child(14) button{white-space:normal!important;max-width:100%!important}
