/* ==================================================================
   TELÉFONO (≤ 760 px) — capa v12
   ------------------------------------------------------------------
   El celular se usa parado, con una mano, entre una cosa y otra:
   - Navegación abajo, al alcance del pulgar (js/ui/04-mobile.js).
   - Arranca en "Hoy" (quién llega, quién se va, qué falta cobrar).
   - Los formularios ocupan la pantalla y los botones de guardar quedan
     siempre a la vista, abajo.
   - Nada de zoom raro: los campos van en 16 px (iOS hace zoom si son
     más chicos) y todo lo que se toca mide al menos 44 px.
   - En la ficha de una reserva, la plata va primero.
   - En Mensajes: la lista, y al tocar una conversación, sólo esa.
   En escritorio nada de esto aplica.
   ================================================================== */

.mnav, .mtop-acts, .cx-back { display: none; }

@media (max-width: 760px){

  /* ---------- Barra de pestañas ---------- */
  .mnav{
    display: flex; align-items: center; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 190;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 4px 6px env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,.96);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--hairline);
    box-shadow: 0 -6px 24px rgba(14,33,72,.06);
  }
  .mnav-b{
    flex: 1; position: relative; min-height: 52px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
    font: 600 10.5px/1 var(--font-body); color: var(--color-text-subtle);
  }
  .mnav-b .ico{ width: 22px; height: 22px; }
  .mnav-b.on{ color: var(--color-primary); }
  .mnav-b.on .ico{ color: #1d4ed8; }
  .mnav-b.on::before{ content: ''; position: absolute; top: 2px; width: 22px; height: 3px; border-radius: 3px; background: #1d4ed8; }
  .mnav-plus{
    flex-shrink: 0; width: 56px; height: 56px; margin: -20px 4px 0;
    border: 0; border-radius: 19px; cursor: pointer; color: #fff;
    background: var(--color-primary);
    box-shadow: 0 10px 22px rgba(14,33,72,.28), 0 0 0 5px var(--bg-canvas, #f6f5f1);
    display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
  }
  .mnav-plus .ico{ width: 25px; height: 25px; }
  .mnav-plus:active{ transform: scale(.94); }
  .mnav-badge{
    position: absolute; top: 3px; left: calc(50% + 5px);
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    background: #e11d48; color: #fff; font: 700 9.5px/17px var(--font-body); font-style: normal; text-align: center;
  }
  .mnav-dot{ position: absolute; top: 7px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: #e11d48; }
  body.mnav-on{ padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

  /* La hamburguesa la reemplaza "Más"; arriba, lupa y campanita */
  .nav-toggle{ display: none !important; }
  .mtop-acts{ display: flex; gap: 2px; margin-left: auto; }
  .mtop-b{
    position: relative; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none;
    display: grid; place-items: center; color: var(--color-primary); cursor: pointer;
  }
  .mtop-b:active{ background: var(--color-surface-2, #f3f4f6); }
  .mtop-b svg, .mtop-b .ico{ width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .mtop-b .mnav-badge{ top: 4px; left: 24px; }

  /* Ari flotante por encima de la barra */
  .ari-fab{ bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important; right: 14px !important; }

  /* ---------- Reservas ---------- */
  #section-reservas .toggle-view,
  #section-reservas .toolbar > .nbtn.green{ display: none !important; }   /* están en la barra de abajo */
  #section-reservas .toolbar{ flex-wrap: nowrap; gap: 6px; padding-bottom: 2px; }
  #section-reservas .nav-dates{ flex-wrap: nowrap; gap: 6px; flex: 1; min-width: 0; }
  #section-reservas .nav-dates .nbtn{ min-height: 40px; }
  #days-visible-sel{ display: none !important; }
  #section-reservas .date-pick-btn{ flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Aviso de pre-reservas: una sola fila que se desliza */
  .pa-strip{ flex-wrap: nowrap; padding: 7px 8px; gap: 8px; }
  .pa-t{ font-size: 12px; white-space: nowrap; }
  .pa-t em{ display: none; }
  .pa-chips{ flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg,#000 85%,transparent); mask-image: linear-gradient(90deg,#000 85%,transparent); }
  .pa-chips::-webkit-scrollbar{ display: none; }
  .pa-chip{ flex-shrink: 0; white-space: nowrap; }
  .pa-ic{ display: none; }

  /* Vista de hoy: encabezado más bajo, filas cómodas para el dedo */
  .tv-head{ padding: 18px !important; }
  .tv-head h2{ font-size: 1.5rem !important; }
  .tv-head p{ display: none; }
  .tv-row{ min-height: 56px; }
  .tv-row-acts{ opacity: 1 !important; position: static !important; background: none !important; }

  /* ---------- Formularios y fichas: hoja a pantalla completa ---------- */
  .modal-overlay{ align-items: flex-end !important; padding: 0 !important; }
  .modal-box{
    width: 100% !important; max-width: none !important; margin: 0 !important;
    max-height: 94dvh !important; border-radius: 22px 22px 0 0 !important;
    padding: 18px 16px 0 !important;
    animation: mnav-sheet .22s cubic-bezier(.2,.8,.2,1) !important;
  }
  .modal-box::before{ content: ''; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--hairline-strong, #d9dde4); margin: -8px auto 12px; }
  .mactions{
    position: sticky; bottom: 0; z-index: 3; margin: 14px -16px 0 !important;
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--color-surface); border-top: 1px solid var(--hairline);
    display: flex; gap: 8px; flex-wrap: wrap;
  }
  .mactions .mb{ flex: 1 1 auto; min-height: 46px; justify-content: center; }
  /* Asistente de nueva reserva: "Continuar" siempre abajo; los pasos, en una tira */
  .wz-actions{
    position: sticky; bottom: 0; z-index: 3; margin: 14px -16px 0 !important;
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--color-surface); border-top: 1px solid var(--hairline);
  }
  .wz-actions .mb{ min-height: 48px; }
  .wz-steps{ display: flex !important; flex-direction: row !important; gap: 6px !important; }
  .wz-step{ flex: 1; min-width: 0; padding: 8px 9px !important; display: flex !important; align-items: center; gap: 6px; }
  .wz-step > span{ position: static !important; flex-shrink: 0; margin: 0 !important; }
  .wz-step em{ display: none !important; }

  /* "Más" (panel lateral): los íconos sueltos llevan nombre, como en un menú */
  .topbar-panels .notif-wrap, .topbar-panels #voice-btn, .topbar-panels #snav-settings{ align-self: stretch !important; }
  .topbar-panels #notif-btn, .topbar-panels #voice-btn, .topbar-panels #snav-settings{
    width: 100% !important; height: 48px !important; justify-content: flex-start !important; gap: 12px; padding: 0 12px !important;
    border-radius: 12px; font: 600 14px var(--font-body); color: var(--color-text-secondary);
  }
  .topbar-panels .notif-wrap{ width: 100% !important; display: block !important; position: relative; }
  .topbar-panels #notif-btn .notif-badge{ left: 26px; right: auto; }
  .topbar-panels #notif-btn::after{ content: 'Avisos'; }
  .topbar-panels #voice-btn::after{ content: 'Comando por voz'; }
  .topbar-panels #snav-settings::after{ content: 'Configuración'; }
  .topbar-panels .topbar-right{ gap: 2px !important; }
  .topbar-panels .snav-btn{ min-height: 48px; font-size: 15px !important; }
  .two-col{ grid-template-columns: 1fr !important; }
  input, select, textarea{ font-size: 16px !important; }
  .mb, .nbtn, .ui-dlg-b, .st-btn, .ops-btn, .cx-btn{ min-height: 44px; }

  /* Ficha de reserva */
  .modal-box.bkc-box{ padding: 0 !important; }
  .modal-box.bkc-box::before{ margin: 8px auto 4px; }
  .bk-2col{ display: flex !important; flex-direction: column; }
  .bk-2col > .bk-col:last-child{ order: -1; }         /* la plata primero */
  .bkc-foot{ position: sticky !important; bottom: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important; }
  .bkc-foot-l .mb.sec{ flex: 1; justify-content: center; }
  .bkc-more-menu{ position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); min-width: 0; }
  .bkc-more-menu button{ min-height: 48px; font-size: 15px; }

  /* Diálogos */
  .ui-dlg-f.many{ flex-direction: column-reverse; }
  .ui-dlg-f.many .ui-dlg-b{ width: 100%; }

  /* ---------- Mensajes: lista ↔ conversación ---------- */
  .cx-board-sub, .cx-board-eyebrow{ display: none !important; }
  .cx-board{ padding: 14px 16px !important; gap: 10px !important; }
  .cx-board-title{ font-size: 1.25rem !important; margin: 0 !important; }
  #section-crm:has(.cx-desk) .cx-pulses{ display: none !important; }   /* en la bandeja los números ya están en la lista */
  .cx-board-actions{ display: flex !important; flex-wrap: nowrap !important; gap: 8px !important; overflow-x: auto; width: 100%; }
  .cx-board-actions .cx-search{ flex: 1 1 100%; }
  #section-crm .cx-board-actions{ flex-wrap: wrap !important; }
  .cx-desk.has-thread .cx-rail, .cx-desk.has-thread .cx-list{ display: none !important; }
  .cx-desk:not(.has-thread) .cx-convo{ display: none !important; }
  .cx-desk.has-thread ~ *, #section-crm .cx-desk.has-thread{ margin-top: 0; }
  #section-crm:has(.cx-desk.has-thread) .cx-board, #section-crm:has(.cx-desk.has-thread) .admin-tabs{ display: none !important; }
  .cx-back{
    display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; min-height: 44px; padding: 0 14px;
    border: 1px solid var(--hairline); border-radius: 12px; background: var(--color-surface);
    font: 600 14px var(--font-body); color: var(--color-primary); cursor: pointer;
  }
  .cx-back .ico{ width: 17px; height: 17px; }
  #reply-body{ min-height: 96px; }

  /* ---------- Encabezados de sección ---------- */
  .st-hero{ grid-template-columns: 1fr !important; }
  .st-hero-art{ display: none !important; }
  .st-hero-sub, .ops-sub, .an-head-sub, .fl-hero-sub, .ct-hero-sub, .tp-hero-sub, .rv-hero-sub, .ac-hero-sub{ display: none !important; }
  .an-head-motif{ display: none !important; }

  /* Pestañas de sección: una tira que se desliza, sin cortar texto */
  .admin-tabs{ flex-wrap: nowrap !important; overflow-x: auto !important; scrollbar-width: none; }
  .admin-tabs::-webkit-scrollbar{ display: none; }

  /* Notificaciones como hoja */
  #notif-panel{ width: auto !important; }

  /* ---------- Pulidos de pantalla angosta (2026-10-18) ---------- */
  /* Cuadrículas con columnas mínimas de 280–460 px: en un teléfono la página se ensanchaba y deslizaba de costado.
     Acá pasan a una sola columna que respeta el ancho de la pantalla. */
  .an-grid.two, .an-grid.three, .an-mypanel, .an-card-body, .an-xp-blocks.two, .an-files, .till-row-wrap, .cost-areas,
  .emer-groups, .ota-grid, .fx-desk, .review-grid, .content-grid, .tp-grid, .cx-cards, .cx-conn-grid, .cx-brain,
  .st-sec, .st-conns, .kb-grid, .integration-grid, .template-grid, .prov-grid, .shelf-items, .rr-help-tools{
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .flow-hub-ring{ display: none; }      /* adorno de 490 px que ensanchaba Canales */
  /* Ficha de reserva: las columnas se miden por lo que entra, no por su contenido más ancho */
  .bk-2col{ align-items: stretch !important; }
  .bk-col{ min-width: 0; max-width: 100%; }
  .bkc-money-top{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bkc-money-top b{ font-size: 15px; overflow-wrap: anywhere; }
  /* Analytics: los períodos en una sola tira que se desliza (antes eran una cápsula con chips apilados) */
  .an-period-picks{ flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-radius: 14px; }
  .an-period-picks::-webkit-scrollbar{ display: none; }
  .an-pick{ flex-shrink: 0; white-space: nowrap; }
  /* Tarjetas de Configuración: el botón baja en vez de aplastar el texto */
  .st-card-head{ flex-wrap: wrap; }
  .st-card-id{ flex: 1 1 170px; min-width: 0; }
  .st-card-head > .st-btn{ margin-left: auto; }
  /* Cifras de los encabezados (Tareas, Consumos…): cuadrícula de dos, no una tira que se corta */
  .ops-readouts{ display: grid !important; grid-template-columns: 1fr 1fr; gap: 14px 0; }
  .ops-readout:nth-child(odd){ border-left: 0; padding-left: 0; }
}

/* Grilla: con columnas angostas (teléfono, tablet, panel de Ari abierto) sólo cabe "N libres" */
.ghc-sm .ghc-occ b em{ display: none; }
.ghc-sm .ghc-occ b{ font-size: 9px; letter-spacing: 0; }
/* Mensajes: la hora no se pisa con el punto de "sin leer" */
.cx-thread-when{ flex-shrink: 0; white-space: nowrap; }
.cx-thread.unread .cx-thread-when{ margin-right: 16px; }

@keyframes mnav-sheet{ from{ transform: translateY(40px); opacity: 0; } to{ transform: none; opacity: 1; } }

/* ---------- Subir fotos desde el celular (archivos de reserva, archivos del equipo) ---------- */
.up-cam{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  min-height: 46px; padding: 0 16px; border-radius: 12px; font: 600 14px var(--font-body);
  border: 1px solid var(--hairline); background: var(--color-surface); color: var(--color-primary);
}
.up-cam .ico{ width: 18px; height: 18px; }
.up-cam.primary{ background: var(--color-primary); color: #fff; border-color: transparent; }
.up-row{ display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.up-row > *{ flex: 1 1 140px; }
.up-note{ font-size: 12px; color: var(--color-text-muted); }
