/* ============================================================
   Base responsive compartida (celulares y tablets) — MDTec Sentinel IA
   Se incluye en el <head> de cada módulo. Son reglas de seguridad: no cambian el diseño de escritorio,
   solo evitan los problemas típicos del celular (zoom al escribir, tablas que se salen, ventanas que no entran).
   ============================================================ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img { max-width: 100%; height: auto; }
pre, code { white-space: pre-wrap; word-break: break-word; }

@media (max-width: 767px) {
  body { overflow-x: hidden; }

  /* iOS hace zoom al tocar un campo con letra menor a 16 px: se evita */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select, textarea { font-size: 16px !important; }

  /* Tablas: nunca ensanchan la pantalla; se desplazan hacia el costado dentro de su recuadro */
  main table, .tab-content table, .modal-body table, section table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Ventanas emergentes: caben en pantalla y se pueden desplazar */
  .fixed.inset-0 { padding: 8px; }
  .fixed.inset-0 > div { max-height: 96vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

  /* Zonas táctiles: botones y enlaces con tamaño cómodo para el dedo */
  button:not(.fc-button):not([class*="w-6"]):not([class*="w-5"]):not([class*="w-4"]), .btn { min-height: 40px; }

  /* Textos largos (nombres, direcciones, mails) no rompen el diseño */
  td, th, p, h1, h2, h3, h4, label, span, a { overflow-wrap: anywhere; }
  td, th { overflow-wrap: break-word; word-break: normal; }
}

/* Pantallas muy angostas: menos relleno lateral en los contenedores principales */
@media (max-width: 380px) {
  main, section.tab-content { padding-left: 6px !important; padding-right: 6px !important; }
}

/* Con teclado visible o tablets horizontales, la barra inferior no tapa los botones de las ventanas */
@supports (padding: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}
