/* One Class — App Taller en el celular (agregado 2026-10-21).
   Solo se aplica en pantallas chicas: en la PC no cambia nada. */
@media (max-width: 820px) {
  html, body { overflow-x: hidden; overflow-x: clip; }
  body { min-width: 0 !important; }
  #root > div { flex-direction: column !important; height: auto !important; min-height: 100dvh; }

  /* Menú lateral -> barra de íconos abajo */
  .sidebar {
    position: fixed !important; left: 0; right: 0; bottom: 0; top: auto;
    width: 100% !important; height: auto !important;
    padding: 0 0 env(safe-area-inset-bottom, 0px) !important;
    flex-direction: row !important; border-right: 0 !important;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(11, 15, 25, .98) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    box-shadow: 0 -10px 30px rgba(0,0,0,.45) !important; z-index: 1000 !important;
  }
  .sidebar h2 { display: none !important; }
  .sidebar nav { flex-direction: row !important; margin-top: 0 !important; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .nav-link {
    flex: 1 0 72px; flex-direction: column; justify-content: center; text-align: center;
    gap: 4px !important; padding: 9px 4px 8px !important; margin: 0 !important;
    font-size: 10.5px !important; line-height: 1.15; font-weight: 600 !important;
    border-left: 0 !important; border-top: 3px solid transparent !important; transform: none !important;
  }
  .nav-link:hover { transform: none !important; background: none !important; }
  .nav-link.active { border-top-color: #ff4655 !important; background: rgba(227,18,43,.12) !important; text-shadow: none !important; }
  .nav-link svg { width: 22px; height: 22px; flex: none; }

  /* Contenido: todo el ancho, con lugar para la barra de abajo */
  .main-content { width: 100% !important; height: auto !important; overflow: visible !important;
    padding: 16px 14px calc(86px + env(safe-area-inset-bottom, 0px)) !important; }
  .main-content * { box-sizing: border-box; }
  .main-content :not(table):not(thead):not(tbody):not(tr):not(td):not(th) { max-width: 100%; min-width: 0; }
  h1 { font-size: 1.55rem !important; line-height: 1.2; margin-bottom: 14px !important; }
  h2 { font-size: 1.25rem !important; }
  h3 { font-size: 1.08rem !important; }

  /* Columnas -> una debajo de la otra */
  .main-content [style*="grid-template-columns"], .form-grid { grid-template-columns: 1fr !important; }
  .main-content [style*="display: flex"] { flex-wrap: wrap; }
  .main-content [style*="width: 300px"], .main-content [style*="width: 350px"], .main-content [style*="width: 400px"],
  .main-content [style*="width: 450px"], .main-content [style*="width: 500px"], .main-content [style*="width: 600px"] { width: 100% !important; }

  /* Tablas: se deslizan de costado sin romper la pantalla */
  .main-content table, .data-table { display: block !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; white-space: nowrap; }

  /* Paneles, campos y botones cómodos para el dedo */
  .glass-panel { padding: 14px !important; border-radius: 14px !important; }
  .input-field, input, select, textarea { font-size: 16px !important; } /* evita el zoom automático del iPhone */
  .btn, .btn-primary, .btn-secondary, button { min-height: 42px; }

  /* Ventanas emergentes: ocupan el ancho del celular */
  .main-content [style*="position: fixed"] > div { width: 100% !important; max-width: 100% !important; max-height: 92dvh; overflow-y: auto; }

  /* Barra de abajo: indicar que hay más opciones a la derecha */
  .sidebar::after { content: '›'; position: absolute; right: 0; top: 0; bottom: env(safe-area-inset-bottom, 0px); width: 34px;
    display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-size: 26px; color: #ff4655;
    background: linear-gradient(90deg, rgba(11,15,25,0), rgba(11,15,25,.98) 60%); pointer-events: none; transition: opacity .2s; }
  .sidebar.oc-fin::after { opacity: 0; }

  /* Clientes: las dos listas una debajo de la otra */
  .main-content [style*="gap: 20px"][style*="align-items: flex-start"] > * { flex: 1 1 100% !important; width: 100% !important; }
  /* Turnos: botones de arriba */
  .header-actions { flex-wrap: wrap; gap: 10px; margin-bottom: 1.2rem !important; }
  /* Asistente IA: el dibujo más chico y el chat a lo largo */
  .main-content [style*="calc(100vh - 100px)"] { height: auto !important; }
  .main-content [style*="height: 300px"][style*="radial-gradient"] { height: 160px !important; position: relative; }
}
