/* ═══════════════════════════════════════════════════════════════
   lb-app.css — LetsBoxIt · app del cliente, reserva y panel (2027)
   Móvil primero. Usa los colores y formas de lb-tokens.css.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --a-fondo: #F5F5F7;
  --a-tarjeta: #FFFFFF;
  --a-tinta: #1D1D1F;
  --a-gris: #6E6E73;
  --a-linea: #E5E5EA;
  --a-acento: #1BA2A0;
  --a-acento-texto: #0E5F5E;
  --a-acento-suave: #E8F6F6;
  --a-ok: #14804A;
  --a-ok-suave: #E7F6EE;
  --a-aviso: #9A5B00;
  --a-aviso-suave: #FFF6DB;
  --a-mal: #C2261C;
  --a-mal-suave: #FDECEA;
  --a-azul: #1F4FD1;
  --a-azul-suave: #EAF0FF;
  --a-r: 20px;
  --a-ease: cubic-bezier(.16, 1, .3, 1);
  --a-sombra: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.lbapp {
  margin: 0; background: var(--a-fondo); color: var(--a-tinta);
  font: 16px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
.lbapp h1, .lbapp h2, .lbapp h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
.lbapp h1 { font-size: 28px; font-weight: 700; }
.lbapp h2 { font-size: 20px; font-weight: 700; }
.lbapp h3 { font-size: 16px; font-weight: 600; }
.lbapp p { margin: 0; }
a { color: inherit; }
.lbapp img { max-width: 100%; }
.gris { color: var(--a-gris); }
.peq { font-size: 14px; }
.mini { font-size: 12.5px; }
.centro { text-align: center; }
.fila { display: flex; align-items: center; gap: 12px; }
.fila.entre { justify-content: space-between; }
.crece { flex: 1; min-width: 0; }
.pila { display: grid; gap: 14px; }
.pila.junta { gap: 8px; }
.oculto { display: none !important; }

/* ── Marco ───────────────────────────────────────────────── */
.a-marco { max-width: 560px; margin: 0 auto; padding: 18px 16px 110px; }
.a-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.a-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.02em; font-size: 19px; text-decoration: none; color: var(--a-tinta); }
.a-logo svg { width: 27px; height: 30px; color: var(--a-acento); flex: none; }
.a-atras { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 0; }

.a-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--a-linea); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.a-nav div { max-width: 560px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.a-nav a {
  display: grid; justify-items: center; gap: 2px; padding: 6px 0; text-decoration: none;
  font-size: 11.5px; font-weight: 600; color: var(--a-gris); border-radius: 12px;
}
.a-nav a svg { width: 24px; height: 24px; }
.a-nav a.activo { color: var(--a-acento-texto); }
.a-nav a.escanear { color: var(--a-acento-texto); }

/* ── Piezas ──────────────────────────────────────────────── */
.tarjeta {
  background: var(--a-tarjeta); border-radius: var(--a-r); padding: 18px;
  box-shadow: var(--a-sombra); animation: sube .5s var(--a-ease) both;
}
.tarjeta.plana { box-shadow: none; border: 1px solid var(--a-linea); }
.tarjeta.acento { background: var(--a-acento-suave); box-shadow: inset 0 0 0 1.5px rgba(27, 162, 160, .25); }
.tarjeta.acento .gris { color: #3F5B5A; }
a.tarjeta { display: block; text-decoration: none; transition: transform .2s var(--a-ease); }
a.tarjeta:active { transform: scale(.985); }
@keyframes sube { from { transform: translateY(10px); } }
.pila > .tarjeta:nth-child(2) { animation-delay: .05s; }
.pila > .tarjeta:nth-child(3) { animation-delay: .1s; }
.pila > .tarjeta:nth-child(4) { animation-delay: .15s; }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--a-acento); color: #fff; font: inherit; font-weight: 600; text-decoration: none;
  transition: transform .2s var(--a-ease), opacity .2s; width: 100%;
}
.boton:active { transform: scale(.97); }
.boton:hover { background: #178B89; }
.boton.suave:hover { background: #E2E2E7; }
.boton.linea:hover { background: #F5F5F7; }
.boton.suave { background: #ECECEF; color: var(--a-tinta); }
.boton.linea { background: transparent; color: var(--a-tinta); box-shadow: inset 0 0 0 1.5px var(--a-linea); }
.boton.peque { min-height: 40px; padding: 0 16px; font-size: 14px; width: auto; white-space: nowrap; flex: none; }
.boton[disabled] { opacity: .4; pointer-events: none; }
.boton.cargando { pointer-events: none; opacity: .7; }

.campo { display: grid; gap: 6px; }
.campo label, .etiqueta { font-size: 13.5px; font-weight: 600; }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 52px; padding: 12px 16px; border: 1.5px solid var(--a-linea); border-radius: 14px;
  background: #fff; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; appearance: none;
}
.campo textarea { min-height: 92px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: 0; border-color: var(--a-acento); box-shadow: 0 0 0 4px rgba(27, 162, 160, .15);
}
.campo.mal input, .campo.mal select { border-color: var(--a-mal); }
.dos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.dos > *, .campo input { min-width: 0; }
.dos .dos { grid-template-columns: minmax(0, 1fr); }

.aviso { border-radius: 14px; padding: 12px 14px; font-size: 14.5px; background: var(--a-azul-suave); color: var(--a-azul); }
.aviso.ok { background: var(--a-ok-suave); color: var(--a-ok); }
.aviso.mal { background: var(--a-mal-suave); color: var(--a-mal); }
.aviso.ojo { background: var(--a-aviso-suave); color: var(--a-aviso); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: #ECECEF; color: var(--a-tinta); white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.e-sin_asignar { background: #ECECEF; color: var(--a-gris); }
.chip.e-camino_cliente, .chip.e-camino_almacen, .chip.e-camino_entrega { background: var(--a-azul-suave); color: var(--a-azul); }
.chip.e-con_cliente { background: var(--a-aviso-suave); color: var(--a-aviso); }
.chip.e-lista { background: var(--a-acento-suave); color: var(--a-acento-texto); }
.chip.e-almacen, .chip.e-entregada, .chip.ok { background: var(--a-ok-suave); color: var(--a-ok); }
.chip.mal { background: var(--a-mal-suave); color: var(--a-mal); }
.chip.e-camino_cliente::before, .chip.e-camino_almacen::before, .chip.e-camino_entrega::before { animation: late 1.4s infinite; }
@keyframes late { 50% { opacity: .2; transform: scale(.7); } }

/* ── Línea de tiempo ─────────────────────────────────────── */
.pasos { list-style: none; margin: 0; padding: 0; display: grid; }
.pasos li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; position: relative; padding-bottom: 18px; }
.pasos li:last-child { padding-bottom: 0; }
.pasos li::before {
  content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--a-linea);
}
.pasos li:last-child::before { display: none; }
.pasos .punto {
  width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--a-linea);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--a-gris); z-index: 1;
}
.pasos li.hecho .punto { background: var(--a-ok); border-color: var(--a-ok); color: #fff; }
.pasos li.hecho::before { background: var(--a-ok); }
.pasos li.ahora .punto { background: var(--a-acento); border-color: var(--a-acento); color: #fff; box-shadow: 0 0 0 6px var(--a-acento-suave); animation: pulso 2s infinite; }
@keyframes pulso { 50% { box-shadow: 0 0 0 10px rgba(27, 162, 160, 0); } }
.pasos b { display: block; font-weight: 600; }
.pasos li:not(.hecho):not(.ahora) b { color: var(--a-gris); }

/* ── Cajas ───────────────────────────────────────────────── */
.caja-fila {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--a-linea); text-decoration: none;
}
.caja-fila:first-child { border-top: 0; padding-top: 0; }
.caja-ico {
  width: 46px; height: 46px; border-radius: 13px; background: var(--a-acento-suave); color: var(--a-acento-texto);
  display: grid; place-items: center; flex: none;
}
.caja-ico svg { width: 24px; height: 24px; }
.codigo { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; letter-spacing: .04em; overflow-wrap: anywhere; }
.p-main p, .p-main .peq, .p-main .mini { overflow-wrap: anywhere; }

/* ── Explicación animada (cómo funciona) ─────────────────── */
.anima { position: relative; height: 150px; border-radius: 16px; background: linear-gradient(#F4FBFB, #DDF1F1); overflow: hidden; }
.anima .suelo { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: #C4E4E3; }
.anima .cosa { position: absolute; bottom: 30px; }
.anima .resi { left: 14px; width: 54px; height: 84px; background: #fff; border-radius: 8px 8px 0 0; box-shadow: inset 0 0 0 2px var(--a-tinta); }
.anima .resi::after { content: ""; position: absolute; inset: 12px 10px auto; height: 44px; background: repeating-linear-gradient(90deg, var(--a-tinta) 0 8px, transparent 8px 17px) top/100% 8px repeat-y; background-size: 100% 18px; opacity: .25; }
.anima .nave { right: 14px; width: 78px; height: 62px; background: var(--a-tinta); border-radius: 8px 8px 0 0; }
.anima .nave::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 34px; background: var(--a-acento); border-radius: 4px 4px 0 0; }
.anima .furgo { bottom: 26px; left: 70px; width: 56px; height: 32px; animation: ruta 6s var(--a-ease) infinite; }
.anima .furgo i { position: absolute; inset: 0 12px 6px 0; background: #fff; border-radius: 5px; box-shadow: inset 0 0 0 2px var(--a-tinta); }
.anima .furgo b { position: absolute; right: 0; bottom: 6px; width: 16px; height: 18px; background: var(--a-acento); border-radius: 3px 7px 3px 0; box-shadow: inset 0 0 0 2px var(--a-tinta); }
.anima .furgo::before, .anima .furgo::after { content: ""; position: absolute; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--a-tinta); }
.anima .furgo::before { left: 7px; } .anima .furgo::after { right: 5px; }
.anima .cajita { bottom: 36px; left: 84px; width: 18px; height: 16px; background: #D9A066; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--a-tinta); animation: ruta 6s var(--a-ease) infinite, cajita 6s infinite; }
@keyframes ruta { 0%, 12% { transform: translateX(0); } 50%, 62% { transform: translateX(calc(min(560px, 100vw) - 300px)); } 100% { transform: translateX(0); } }
@keyframes cajita { 0%, 8% { opacity: 0; } 14%, 56% { opacity: 1; } 62%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .anima .furgo, .anima .cajita, .pasos li.ahora .punto, .tarjeta, .r-paso, .confeti, .visor .marco::after { animation: none; }
  .anima .cajita { opacity: 1; }
}
.como { display: grid; gap: 0; counter-reset: como; }
.como div { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--a-linea); }
.como div:first-child { border-top: 0; }
.como div::before {
  counter-increment: como; content: counter(como); width: 34px; height: 34px; border-radius: 50%;
  background: var(--a-acento-suave); color: var(--a-acento-texto); font-weight: 700; display: grid; place-items: center;
}

/* ── Escáner ─────────────────────────────────────────────── */
.visor { position: relative; aspect-ratio: 1; border-radius: 24px; overflow: hidden; background: #000; }
.visor video { width: 100%; height: 100%; object-fit: cover; }
.visor .marco { position: absolute; inset: 18%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .45), inset 0 0 0 3px #fff; }
.visor .marco::after { content: ""; position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: var(--a-acento); animation: barrido 2s ease-in-out infinite; }
@keyframes barrido { 0%, 100% { transform: translateY(-60px); } 50% { transform: translateY(60px); } }

.subefoto {
  display: grid; place-items: center; gap: 6px; min-height: 150px; border: 2px dashed var(--a-linea); border-radius: 16px;
  background: #fff; cursor: pointer; text-align: center; padding: 14px; overflow: hidden; position: relative;
}
.subefoto input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.subefoto img { max-height: 220px; border-radius: 10px; }
.subefoto.con { border-style: solid; border-color: var(--a-ok); }

/* ── Reserva por pasos ───────────────────────────────────── */
.r-barra { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 18px; }
.r-barra i { height: 5px; border-radius: 9px; background: var(--a-linea); transition: background .4s var(--a-ease); }
.r-barra i.on { background: var(--a-acento); }
.r-paso { display: none; animation: sube .45s var(--a-ease) both; }
.r-paso.on { display: grid; gap: 16px; }
.r-pie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--a-linea);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.r-pie > div { max-width: 560px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.r-pie .precio { flex: 1; min-width: 0; line-height: 1.2; }
.r-pie .precio b { font-size: 20px; letter-spacing: -.02em; }
.r-pie .boton { width: auto; flex: none; }

.opciones { display: grid; gap: 10px; }
.opcion {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: #fff;
  border: 1.5px solid var(--a-linea); cursor: pointer; transition: border-color .15s, background .15s, transform .2s var(--a-ease); text-align: left; font: inherit; color: inherit; width: 100%;
}
.opcion:active { transform: scale(.985); }
.opcion.on { border-color: var(--a-acento); background: #F7FCFC; box-shadow: 0 0 0 3px rgba(27, 162, 160, .12); }
.opcion .marca { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--a-linea); flex: none; transition: all .15s; }
.opcion.on .marca { border: 7px solid var(--a-acento); }
.opcion small { display: block; color: var(--a-gris); font-size: 13.5px; }

.contador { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.contador .mas-menos { display: flex; align-items: center; gap: 4px; }
.contador button {
  width: 46px; height: 46px; border-radius: 50%; border: 0; background: #ECECEF; font-size: 24px; line-height: 1; cursor: pointer; color: inherit;
}
.contador output { min-width: 44px; text-align: center; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }

.dias { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scroll-snap-type: x proximity; scrollbar-width: none; }
.dias::-webkit-scrollbar { display: none; }
.dia {
  flex: none; width: 64px; padding: 10px 0; border-radius: 16px; border: 1.5px solid var(--a-linea); background: #fff;
  text-align: center; cursor: pointer; scroll-snap-align: start; font: inherit; color: inherit; transition: all .15s;
}
.dia small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--a-gris); }
.dia b { display: block; font-size: 20px; }
.dia.on { background: var(--a-acento-texto); border-color: var(--a-acento-texto); color: #fff; }
.dia.on small { color: rgba(255, 255, 255, .7); }
.dia[disabled] { opacity: .35; cursor: default; }
.horas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hora {
  min-height: 46px; border-radius: 12px; border: 1.5px solid var(--a-linea); background: #fff; font: inherit; font-weight: 600;
  cursor: pointer; color: inherit; position: relative; transition: all .15s;
}
.hora.on { background: var(--a-acento-texto); border-color: var(--a-acento-texto); color: #fff; }
.hora.cerca::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--a-ok); }
.hora[disabled] { opacity: .3; text-decoration: line-through; cursor: default; }

.ticket { background: #fff; border-radius: 18px; padding: 18px; position: relative; box-shadow: var(--a-sombra); }
.ticket dl { margin: 0; display: grid; gap: 8px; }
.ticket dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.ticket dt { color: var(--a-gris); }
.ticket dd { margin: 0; font-weight: 600; text-align: right; }
.ticket hr { border: 0; border-top: 1.5px dashed var(--a-linea); margin: 14px 0; }
.ticket .total { font-size: 18px; }
.ticket .hoy { background: var(--a-acento-suave); color: var(--a-acento-texto); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }

.articulo { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--a-linea); }
.articulo:first-child { border-top: 0; }
.articulo button { border: 0; background: none; color: var(--a-gris); font-size: 20px; cursor: pointer; padding: 4px 8px; }

.resena { background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--a-sombra); flex: none; width: 280px; scroll-snap-align: start; }
.resena .estrellas { color: #F5A623; letter-spacing: 2px; }
.carrusel { display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 12px; margin: 0 -16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carrusel::-webkit-scrollbar { display: none; }

.confeti { font-size: 44px; animation: salto .9s var(--a-ease) both; display: inline-block; }
@keyframes salto { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.15) rotate(6deg); } }

/* ── Panel de administración ─────────────────────────────── */
body.panel { background: #F7F7F9; }
.p-shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.p-lado {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--a-linea);
  display: flex; overflow-x: auto; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); scrollbar-width: none;
}
.p-lado::-webkit-scrollbar { display: none; }
.p-lado .marca, .p-lado .abajo { display: none; }
.p-lado a {
  flex: 1 0 auto; min-width: 62px; display: grid; justify-items: center; gap: 2px; padding: 6px 8px; border-radius: 12px;
  text-decoration: none; font-size: 11px; font-weight: 600; color: var(--a-gris); position: relative;
}
.p-lado a svg { width: 22px; height: 22px; }
.p-lado a.activo { color: var(--a-acento-texto); background: var(--a-acento-suave); }
.p-lado a em { position: absolute; top: 2px; right: 8px; background: var(--a-acento); color: #fff; font-style: normal; font-size: 10px; border-radius: 9px; padding: 1px 5px; }
.p-main { padding: 18px 16px 96px; max-width: 1180px; width: 100%; min-width: 0; margin: 0 auto; }
.p-main .tarjeta, .p-cols > *, .p-cab > *, .pila > * { min-width: 0; }
.p-cab .fila { flex-wrap: wrap; }
.p-main input, .p-main select, .p-main textarea { max-width: 100%; }
.p-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.p-cab p { color: var(--a-gris); margin-top: 4px; }
.p-rej { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.p-dato { background: #fff; border-radius: 18px; padding: 16px; box-shadow: var(--a-sombra); text-decoration: none; display: block; }
.p-dato b { display: block; font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.p-dato span { font-size: 13.5px; color: var(--a-gris); }
.p-cols { display: grid; gap: 14px; }
.p-tabla { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.p-tabla th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--a-gris); padding: 8px 10px; font-weight: 600; }
.p-tabla td { padding: 12px 10px; border-top: 1px solid var(--a-linea); vertical-align: middle; }
.p-tabla tr[data-href] { cursor: pointer; }
.p-tabla tr[data-href]:hover td { background: #FAFAFB; }
.p-scroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.p-filtros { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.p-filtros a { flex: none; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--a-linea); text-decoration: none; font-size: 14px; font-weight: 600; }
.p-filtros a.on { background: var(--a-acento-texto); color: #fff; border-color: var(--a-acento-texto); }
.p-hora { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--a-linea); }
.p-hora:first-child { border-top: 0; }
.p-hora time { font-weight: 700; font-variant-numeric: tabular-nums; }
.p-parada { background: #FAFAFB; border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; border-left: 4px solid var(--a-acento); }
.p-parada.t-material { border-left-color: var(--a-azul); }
.p-parada.t-devolucion { border-left-color: var(--a-ok); }
.p-chat { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.p-burbuja { max-width: 86%; padding: 10px 14px; border-radius: 16px; background: #EFEFF2; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.p-burbuja.sale { justify-self: end; background: var(--a-acento-texto); color: #fff; }
.p-burbuja.borrador { justify-self: end; background: var(--a-acento-suave); color: var(--a-tinta); border: 1.5px dashed var(--a-acento); }
.p-burbuja small { display: block; opacity: .65; font-size: 11.5px; margin-top: 4px; }
.etiquetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.etiqueta-qr { background: #fff; border: 1.5px dashed #999; border-radius: 10px; padding: 10px; text-align: center; break-inside: avoid; }
.etiqueta-qr .qr { width: 110px; height: 110px; margin: 0 auto 6px; }
.etiqueta-qr .qr img, .etiqueta-qr .qr canvas { width: 100% !important; height: 100% !important; }

@media (min-width: 900px) {
  .p-shell { grid-template-columns: 232px minmax(0, 1fr); }
  .p-lado {
    position: sticky; top: 0; height: 100vh; flex-direction: column; border-top: 0; border-right: 1px solid var(--a-linea);
    padding: 20px 12px; gap: 2px; background: #fff; overflow: visible;
  }
  .p-lado .marca { display: block; padding: 4px 12px 18px; }
  .p-lado a { flex: none; display: flex; align-items: center; justify-items: start; gap: 12px; padding: 10px 12px; font-size: 14.5px; }
  .p-lado a em { position: static; margin-left: auto; font-size: 11.5px; }
  .p-lado .abajo { display: block; margin-top: auto; }
  .p-main { padding: 32px 32px 60px; }
  .p-rej { grid-template-columns: repeat(4, 1fr); }
  .p-cols { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .lbapp h1 { font-size: 32px; }
}
@media print {
  .p-lado, .p-cab, .no-imprime { display: none !important; }
  body.panel { background: #fff; }
  .p-main { padding: 0; max-width: none; }
  .etiquetas { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   Explicación animada del servicio (lib/sistema-ui.php)
   Seis escenas grandes; en cada una las piezas entran de una en una.
   ═══════════════════════════════════════════════════════════════ */
.historia { display: grid; gap: 10px; }
.h-barra { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.h-barra i { height: 4px; border-radius: 4px; background: #E1E4E8; overflow: hidden; }
.h-barra b { display: block; height: 100%; width: 0; background: var(--a-acento); border-radius: 4px; }
.h-barra i.hecho b { width: 100%; }
.h-barra i.ahora b { animation: h-llena 3.4s linear both; }
.historia.quieta .h-barra i.ahora b { animation: none; width: 100%; }
@keyframes h-llena { from { width: 0; } to { width: 100%; } }
.h-escena { position: relative; aspect-ratio: 320 / 200; border-radius: 20px; overflow: hidden; background: linear-gradient(160deg, #EAF7F7, #F7FBFB 70%); }
.h-e { position: absolute; inset: 0; opacity: 0; transform: scale(.97); transition: opacity .28s ease, transform .28s ease; }
.h-e.on { opacity: 1; transform: none; transition-delay: .28s; }
.h-e svg { display: block; width: 100%; height: 100%; }
.h-sombra { fill: rgba(29, 29, 31, .09); }
.h-pill { fill: #1D1D1F; }
.h-pill-t { fill: #fff; font: 700 13px "Inter", system-ui, sans-serif; text-anchor: middle; }
.h-toast { fill: #fff; filter: drop-shadow(0 4px 10px rgba(29, 29, 31, .14)); }
.h-t { font: 700 11.5px "Inter", system-ui, sans-serif; fill: #1D1D1F; }
.h-t.h-gris { fill: #6E6E73; font-weight: 500; font-size: 10.5px; }
.h-t.h-acento { fill: #0E5F5E; font-size: 12.5px; }
.h-t.h-blanco { fill: #fff; font-size: 12.5px; }
.h-t.h-marca { font-size: 15px; letter-spacing: -.02em; }
.h-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .03em; }
.h-t.h-mes { font-size: 21px; opacity: 0; }
.h-visor { stroke: #1BA2A0; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.h-linea { stroke: #fff; stroke-width: 4; stroke-dasharray: 22 18; }
.h-cor { fill: #E5484D; }
.h-flash { fill: #fff; opacity: 0; pointer-events: none; }
.h-rayo { fill: #1BA2A0; opacity: 0; }

/* Las piezas entran de una en una cuando la escena está activa */
.h-e .a, .h-cinta, .h-van { transform-box: fill-box; transform-origin: center; }
.h-e .a { opacity: 0; }
.h-e.on .a { animation: h-entra .55s cubic-bezier(.2, 1.35, .4, 1) both; }
.h-e.on .a1 { animation-delay: .4s; }
.h-e.on .a2 { animation-delay: .62s; }
.h-e.on .a3 { animation-delay: .84s; }
.h-e.on .a4 { animation-delay: 1.2s; }
.h-e.on .a5 { animation-delay: 1.7s; }
@keyframes h-entra { from { opacity: 0; transform: translateY(-16px) scale(.9); } to { opacity: 1; transform: none; } }
/* 2 · escanear: aparece el móvil, barre el código y sale «Es tuya» */
.h-e:nth-child(2).on .a2 { animation-delay: .55s; }
.h-e:nth-child(2).on .h-rayo { animation: h-barre 1s ease-in-out .95s 1 both; }
.h-e:nth-child(2).on .a3 { animation-delay: 1.85s; }
@keyframes h-barre { 0% { opacity: 0; transform: translateY(0); } 15%, 85% { opacity: 1; } 50% { transform: translateY(40px); } 100% { opacity: 0; transform: translateY(0); } }
/* 3 · cerrar: la cinta cruza la caja, sale su número y la foto */
.h-cinta { transform-origin: left top; transform: scaleX(0); }
.h-e:nth-child(3).on .h-cinta { animation: h-cinta .7s var(--a-ease) .5s both; }
.h-e:nth-child(3).on .a3 { animation-delay: 1.25s; }
.h-e:nth-child(3).on .h-flash { animation: h-flash .45s ease-out 1.95s both; }
.h-e:nth-child(3).on .a5 { animation-delay: 2.2s; }
@keyframes h-cinta { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes h-flash { 0% { opacity: 0; } 25% { opacity: .85; } 100% { opacity: 0; } }
/* 4 · recogida: entra la furgoneta y llega el aviso */
.h-van { transform: translateX(-230px); }
.h-e:nth-child(4).on .h-van { animation: h-van 1.1s cubic-bezier(.2, .9, .3, 1) .35s both; }
.h-e:nth-child(4).on .h-linea { animation: h-carretera 1.1s linear .35s both; }
.h-e:nth-child(4).on .a4 { animation-delay: 1.45s; }
@keyframes h-van { from { transform: translateX(-230px); } to { transform: translateX(68px); } }
@keyframes h-carretera { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 120; } }
/* 5 · almacén: se llenan las baldas y pasan los meses */
.h-e:nth-child(5).on .a4 { animation-delay: 1s; }
.h-e:nth-child(5).on .a5 { animation-delay: 1.3s; }
.h-e:nth-child(5).on .h-mes { animation: h-mes .5s ease both; }
.h-e:nth-child(5).on .h-mes.m1 { animation-delay: 1.2s; }
.h-e:nth-child(5).on .h-mes.m2 { animation-delay: 1.7s; }
.h-e:nth-child(5).on .h-mes.m3 { animation-delay: 2.2s; }
.h-e:nth-child(5).on .h-mes.m4 { animation: h-mes-fin .4s ease 2.7s both; }
.h-e:nth-child(5).on .h-mes:only-of-type { animation: h-mes-fin .4s ease 1.3s both; }
@keyframes h-mes { 0% { opacity: 0; transform: translateY(8px); } 20%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes h-mes-fin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.h-mes { transform-box: fill-box; }
/* 6 · de vuelta */
.h-e:nth-child(6).on .a5 { animation: h-late .6s cubic-bezier(.2, 1.8, .4, 1) 1.75s both; }
@keyframes h-late { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }

.h-texto { margin: 2px 0 0; text-align: center; font-weight: 700; font-size: 17px; letter-spacing: -.015em; min-height: 2.7em; display: grid; place-items: center; }
.h-nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.h-nav button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #EFEFF2; font-size: 19px; cursor: pointer; color: inherit; }
.h-cuenta { font-size: 13px; color: var(--a-gris); font-weight: 600; min-width: 52px; text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .h-e, .h-e.on { transition: none; }
  .h-e.on .a, .h-e.on .h-cinta, .h-e.on .h-van, .h-e.on .h-mes.m4, .h-e.on .h-mes:only-of-type { animation: none !important; opacity: 1; transform: none; }
  .h-e.on .h-van { transform: translateX(68px); }
  .h-barra i.ahora b { animation: none; width: 100%; }
}

/* ── Botón de información ────────────────────────────────── */
.info {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--a-acento); background: #fff; color: var(--a-acento-texto);
  font: 700 13px/1 Georgia, serif; font-style: italic; cursor: pointer; flex: none; padding: 0; vertical-align: middle;
}
.info[aria-expanded="true"] { background: var(--a-acento); color: #fff; }
.info-texto { background: var(--a-acento-suave); color: #24403F; border-radius: 12px; padding: 12px 14px; font-size: 14px; animation: sube .3s var(--a-ease) both; }
.con-info { display: flex; align-items: center; gap: 8px; }

/* ── Calendario de mes ───────────────────────────────────── */
.cal { display: grid; gap: 10px; }
.cal-cab { display: flex; align-items: center; justify-content: space-between; }
.cal-cab b { font-size: 16px; text-transform: capitalize; }
.cal-cab button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #EFEFF2; font-size: 18px; cursor: pointer; color: inherit; }
.cal-cab button[disabled] { opacity: .3; cursor: default; }
.cal-red { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-red span { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--a-gris); padding: 4px 0; text-transform: uppercase; }
.cal-dia {
  aspect-ratio: 1; border-radius: 50%; border: 0; background: var(--a-acento-suave); color: var(--a-acento-texto); font: inherit; font-weight: 700;
  cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .15s; max-width: 48px; width: 100%; justify-self: center;
}
.cal-dia:hover { background: #CFECEB; }
.cal-dia.on { background: var(--a-acento-texto); color: #fff; transform: scale(1.06); }
.cal-dia[disabled] { background: none; color: #C2C2C8; font-weight: 500; cursor: default; }

/* ── Reserva: piezas nuevas ──────────────────────────────── */
.tramos { display: grid; gap: 6px; }
.tramos div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 12px; font-size: 14.5px; background: #F5F5F7; transition: background .25s, color .25s; }
.tramos div.on { background: var(--a-acento-suave); color: var(--a-acento-texto); font-weight: 700; box-shadow: inset 0 0 0 1.5px rgba(27, 162, 160, .35); }
.bultos { display: flex; flex-wrap: wrap; gap: 8px; }
.bulto { border: 1.5px solid var(--a-linea); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: inherit; transition: all .15s; }
.bulto small { color: var(--a-gris); font-weight: 500; }
.bulto:active { transform: scale(.96); }
.cabe { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.cabe svg { width: 96px; height: 96px; }
.cabe .c-caja { fill: #E3B27A; stroke: #1D1D1F; stroke-width: 2.5; stroke-linejoin: round; }
.cabe .c-tapa { fill: #D29A5E; stroke: #1D1D1F; stroke-width: 2.5; stroke-linejoin: round; }
.cabe .c-cosa { animation: c-cae 4.5s var(--a-ease) infinite; transform-box: fill-box; opacity: 0; }
.cabe .c-cosa.c2 { animation-delay: 1.5s; }
.cabe .c-cosa.c3 { animation-delay: 3s; }
@keyframes c-cae { 0% { transform: translateY(-30px); opacity: 0; } 10% { opacity: 1; } 28% { transform: translateY(20px); opacity: 1; } 34%, 100% { transform: translateY(20px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cabe .c-cosa { animation: none; opacity: 0; } }
.modos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.modos button { border: 1.5px solid var(--a-linea); background: #fff; border-radius: 14px; padding: 12px 6px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; color: inherit; display: grid; gap: 4px; justify-items: center; }
.modos button.on { border-color: var(--a-acento); background: #F7FCFC; color: var(--a-acento-texto); box-shadow: 0 0 0 3px rgba(27, 162, 160, .12); }
.modos svg { width: 26px; height: 26px; }
.plegable summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--a-acento-texto); list-style: none; }
.plegable summary::-webkit-details-marker { display: none; }
.plegable summary::before { content: "+ "; }
.plegable[open] summary::before { content: "− "; }
.sacude { animation: sacude .45s; }
@keyframes sacude { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.ver { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; font-size: 14.5px; color: var(--a-acento-texto); cursor: pointer; text-align: left; }
.ver::before { content: "+ "; }
.ver[aria-expanded="true"]::before { content: "− "; }

/* ── Sin barra de desplazamiento a la vista (se sigue pudiendo desplazar) ── */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ── Ventana que sube desde abajo (información, resumen) ── */
.hoja-fondo { position: fixed; inset: 0; z-index: 60; background: rgba(29, 29, 31, .38); opacity: 0; transition: opacity .25s ease; display: flex; align-items: flex-end; justify-content: center; }
.hoja-fondo.on { opacity: 1; }
.hoja {
  background: #fff; width: 100%; max-width: 560px; max-height: 82vh; overflow-y: auto; scrollbar-width: none;
  border-radius: 26px 26px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .35s var(--a-ease); box-shadow: 0 -10px 40px rgba(0, 0, 0, .16);
}
.hoja::-webkit-scrollbar { display: none; }
.hoja-fondo.on .hoja { transform: none; }
.hoja::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 5px; background: #D9D9DE; margin: 0 auto 14px; }
.hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hoja-cab h2 { font-size: 19px; }
.hoja-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #EFEFF2; font-size: 18px; cursor: pointer; color: inherit; flex: none; }
.hoja .ticket { box-shadow: none; padding: 0; }
.hoja p { font-size: 15.5px; line-height: 1.5; }
@media (min-width: 700px) {
  .hoja-fondo { align-items: center; }
  .hoja { border-radius: 26px; transform: translateY(24px) scale(.97); }
  .hoja::before { display: none; }
  .hoja { padding-top: 22px; }
}
.r-pie .precio { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.r-pie .precio .gris::after { content: " ⌃"; font-weight: 700; }
.r-pie .precio:empty, .r-pie .precio.vacio { visibility: hidden; }
.grupo-t { display: grid; gap: 2px; padding: 2px 2px 0; }
/* ── Panel de dirección (Resumen, Calendario, Cobros) y panel lateral ── */
.p-hoja-fondo { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .22s; }
.p-hoja-fondo[hidden] { display: none; }
.p-hoja-fondo.abierta { background: rgba(0, 0, 0, .32); }
.p-hoja {
  background: var(--a-fondo); width: 100%; max-height: 88vh; max-height: 88dvh; overflow-y: auto; border-radius: 24px 24px 0 0;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .28s var(--a-ease);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .16); overscroll-behavior: contain;
}
.p-hoja-fondo.abierta .p-hoja { transform: none; }
.p-hoja-x { display: block; margin: 0 0 10px auto; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: #E4E4E8; font: inherit; font-size: 14px; font-weight: 600; color: inherit; cursor: pointer; }
.p-hoja .p-parada { background: #fff; }
.p-hoja h2, .p-hoja p { overflow-wrap: anywhere; }
body.con-hoja { overflow: hidden; }
.p-rej.dos { grid-template-columns: repeat(2, 1fr); }
.p-rej.tres { grid-template-columns: 1fr; }
.p-dato.plano { box-shadow: none; background: #F5F5F7; }
.p-dato.plano b { color: var(--a-gris); }
.p-dato.ojo { background: var(--a-mal-suave); }
.p-dato.ojo b { color: var(--a-mal); }
.p-dato { overflow-wrap: anywhere; }
.p-dinero > div { display: grid; grid-template-columns: minmax(0, 1.15fr) repeat(3, minmax(0, 1fr)); gap: 6px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--a-linea); font-size: 14.5px; }
.p-dinero > .cab { border-top: 0; padding: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--a-gris); font-weight: 600; }
.p-dinero > div > :not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-dinero a { text-decoration: none; font-weight: 600; }
.p-dinero a:hover { text-decoration: underline; }
.p-dinero a.debe { color: var(--a-mal); }
.p-dinero a.gris { font-weight: 500; }
.p-dinero > .total { font-weight: 700; }
.p-dinero > .total a { font-weight: 800; }
.p-importe { white-space: nowrap; font-variant-numeric: tabular-nums; }
.p-parada.t-mudanza { border-left-color: var(--a-tinta); }
.p-ruta { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #F5F5F7; font-size: 14.5px; overflow-wrap: anywhere; }
.p-ruta > div + div { border-top: 1px dashed #D2D2D7; padding-top: 10px; }
.p-mes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.p-mes .sem { text-align: center; font-size: 11px; font-weight: 600; color: var(--a-gris); padding-bottom: 4px; }
.p-diam {
  position: relative; display: grid; align-content: start; justify-items: center; gap: 3px; min-height: 58px; padding: 6px 2px; border-radius: 12px;
  text-decoration: none; background: #F5F5F7; transition: background .15s, transform .2s var(--a-ease); min-width: 0;
}
.p-diam:hover { background: #ECECEF; }
.p-diam:active { transform: scale(.96); }
.p-diam b { font-size: 14px; font-weight: 600; }
.p-diam i { font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 22px; padding: 1px 6px; border-radius: 999px; text-align: center; color: #fff; background: var(--a-acento); }
.p-diam i.n1 { background: #8FD0CF; color: var(--a-acento-texto); }
.p-diam i.n3 { background: var(--a-acento-texto); }
.p-diam small { font-size: 9.5px; color: var(--a-gris); max-width: 100%; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.p-diam.pasado { opacity: .5; }
.p-diam.cerrado { background: repeating-linear-gradient(135deg, #F5F5F7 0 6px, #E6E6EA 6px 12px); }
.p-diam.cerrado b { color: var(--a-gris); }
.p-diam.hoy { box-shadow: inset 0 0 0 2px var(--a-acento); }
.p-diam.on { background: var(--a-acento-suave); box-shadow: inset 0 0 0 2px var(--a-acento-texto); }
.p-leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; align-items: center; }
.p-leyenda i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -1px; margin-right: 4px; background: var(--a-acento); }
.p-leyenda i.cer { background: repeating-linear-gradient(135deg, #F5F5F7 0 3px, #D2D2D7 3px 6px); }
.p-huecos { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.p-huecos span { text-align: center; padding: 7px 2px; border-radius: 10px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; background: #fff; color: var(--a-gris); }
.p-huecos span.on { background: var(--a-acento-texto); color: #fff; }
@media (min-width: 700px) {
  .p-rej.tres { grid-template-columns: repeat(3, 1fr); }
  .p-diam { min-height: 84px; padding: 10px 4px; }
  .p-diam b { font-size: 16px; }
  .p-diam small { font-size: 11px; }
}
@media (min-width: 900px) {
  .p-hoja-fondo { align-items: stretch; justify-content: flex-end; }
  .p-hoja { width: 460px; max-height: none; height: 100%; border-radius: 0; padding: 24px; transform: translateX(100%); box-shadow: -8px 0 40px rgba(0, 0, 0, .14); }
  .p-rej.dos { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .p-hoja, .p-hoja-fondo { transition: none; } }
.p-parada > .fila { flex-wrap: wrap; gap: 8px 10px; }
.p-parada > .fila > .crece { flex: 1 1 170px; min-width: 0; }
@media (max-width: 699px) {
  /* Tablas de 5 columnas (cliente, qué, cuándo, cuánto, estado) como fichas: nada se sale en el móvil. */
  .p-tabla.apila, .p-tabla.apila tbody { display: block; }
  .p-tabla.apila thead { display: none; }
  .p-tabla.apila tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 12px 0; border-top: 1px solid var(--a-linea); align-items: center; }
  .p-tabla.apila tr:first-child { border-top: 0; padding-top: 0; }
  .p-tabla.apila td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .p-tabla.apila td:nth-child(1) { grid-area: 1 / 1; }
  .p-tabla.apila td:nth-child(5) { grid-area: 1 / 2; justify-self: end; }
  .p-tabla.apila td:nth-child(2) { grid-area: 2 / 1; color: var(--a-gris); font-size: 13.5px; }
  .p-tabla.apila td:nth-child(3) { grid-area: 2 / 2; justify-self: end; font-size: 13.5px; }
  .p-tabla.apila td:nth-child(4) { grid-area: 3 / 1 / 4 / 3; color: var(--a-gris); font-size: 13.5px; }
  .p-tabla.apila td:nth-child(2) br, .p-tabla.apila td:nth-child(4) br { display: none; }
  .p-tabla.apila tr[data-href]:hover td { background: none; }
}

/* ── Panel · Almacén (vista 3D, huecos, sugerencia de ubicación) ── */
.alm-3d { position: relative; border-radius: 16px; overflow: hidden; background: linear-gradient(#F8F9FB, #ECEEF2); min-height: 280px; }
.alm-3d canvas { display: block; width: 100% !important; cursor: grab; outline: 0; }
.alm-ctl { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2; }
.alm-ctl button { min-width: 40px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); font: inherit; font-size: 14px; font-weight: 700; color: inherit; cursor: pointer; }
.alm-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--a-tinta); color: #fff; font-size: 12.5px; font-weight: 600; padding: 5px 9px; border-radius: 8px; white-space: nowrap; }
.alm-barra { display: block; height: 6px; border-radius: 9px; background: #E9EAEE; overflow: hidden; margin-top: 6px; }
.alm-barra i { display: block; height: 100%; border-radius: 9px; background: var(--a-acento); }
.alm-barra.llena i { background: var(--a-acento-texto); }
.alm-barra.pasa i { background: var(--a-mal); }
.alm-cuanto { flex: none; width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.alm-hi { background: #FFF4DC; box-shadow: -8px 0 0 #FFF4DC, 8px 0 0 #FFF4DC; }
.alm-det { border-top: 1px solid var(--a-linea); padding: 10px 0; }
.alm-det:first-of-type { border-top: 0; }
.alm-det > summary { cursor: pointer; list-style: none; font-size: 15px; }
.alm-det > summary::-webkit-details-marker { display: none; }
.alm-det > summary::before { content: "›"; display: inline-block; width: 16px; color: var(--a-gris); transition: transform .2s var(--a-ease); }
.alm-det[open] > summary::before { transform: rotate(90deg); }
.alm-det > summary .alm-barra { margin-left: 16px; }
.alm-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.alm-campos .campo label { font-size: 13px; }
.alm-cosa { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--a-linea); align-items: flex-start; }
.alm-cosa:first-of-type { border-top: 0; }
.alm-cosa img, .alm-sinfoto { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: #F0F1F4; display: grid; place-items: center; color: #B4B7BD; font-size: 22px; }
.alm-cosa .crece { min-width: 0; }
.alm-mini { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.alm-mini input { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 0 12px; border: 1.5px solid var(--a-linea); border-radius: 12px; font: inherit; background: #fff; }
.alm-sug { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; }
.alm-sug button { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--a-acento-suave); color: var(--a-acento-texto); font: inherit; font-size: 14px; cursor: pointer; }
.alm-cam { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .86); display: grid; place-items: center; align-content: center; gap: 14px; padding: 16px; }
.alm-cam video { width: min(100%, 420px); border-radius: 18px; background: #000; }
.alm-donde { text-decoration: none; background: var(--a-acento-suave); color: var(--a-acento-texto); }
.alm-donde b { margin-left: 4px; }

/* ── Panel · Negocio (canales y zonas) y prueba de entrega ── */
.neg-fila { padding: 12px 0; border-top: 1px solid var(--a-linea); }
.neg-fila:first-of-type { border-top: 0; }
.neg-fila .crece { min-width: 0; overflow-wrap: anywhere; }
.neg-ok { color: var(--a-ok); }
.neg-mal { color: var(--a-mal); }
.p-firma { display: block; width: 100%; height: auto; aspect-ratio: 5 / 2; background: #fff; border: 1.5px dashed #C7C7CC; border-radius: 14px; touch-action: none; cursor: crosshair; }
.p-firma-borrar { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.p-prueba img { width: 120px; height: 90px; object-fit: cover; border-radius: 12px; background: #F0F1F4; }
.p-prueba img.firma { object-fit: contain; background: #fff; border: 1px solid var(--a-linea); }
.neg-listas { display: grid; gap: 16px; margin-top: 16px; }
.neg-lista h3 { font-size: 14px; margin-bottom: 6px; }
.neg-lista .fila { padding: 5px 0; border-top: 1px solid var(--a-linea); gap: 10px; }
.neg-lista .crece { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 700px) { .neg-listas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Panel: botón informativo (se abre y explica) y carga del histórico ── */
.p-info { margin: 0 0 12px; }
.p-info > summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; padding: 7px 12px; border-radius: 999px;
  background: var(--a-acento-suave); color: var(--a-acento-texto); font-size: 13px; font-weight: 600; user-select: none; -webkit-tap-highlight-color: transparent; }
.p-info > summary::-webkit-details-marker { display: none; }
.p-info > summary::before { content: "i"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--a-acento-texto);
  color: #fff; font-size: 12px; font-weight: 700; font-style: normal; flex: none; }
.p-info[open] > summary { margin-bottom: 8px; }
.p-info-txt { background: var(--a-acento-suave); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.p-info-txt p + p { margin-top: 8px; }
.p-info-txt input[type=file] { width: 100%; font-size: 13px; }
.p-info-txt textarea { width: 100%; font: inherit; font-size: 13px; padding: 10px; border: 1px solid var(--a-linea); border-radius: 10px; background: #fff; }
.p-filtros { flex-wrap: wrap; }

/* Reserva a medida (panel/_medida.php) */
.m-fila { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--a-linea); border-radius: 14px; background: #fff; }
.m-fila > * { min-width: 0; }
.m-linea { display: grid; grid-template-columns: minmax(0, 1fr) 104px 44px; gap: 8px; align-items: end; }
.m-linea > * { min-width: 0; }
.m-linea .boton { min-height: 48px; }
.m-totales { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: #F5F5F7; }

/* ── Panel: mensajes automáticos (panel/automatismos.php) y «le escribo yo» (panel/reserva.php) ── */
.pasos.flujo li { grid-template-columns: 28px minmax(0, 1fr); }
.pasos.flujo li > div { min-width: 0; }
.pasos.flujo li > div > div:first-child b { display: block; font-size: 17px; color: var(--a-tinta); }
.pasos.flujo li:not(.hecho):not(.ahora) b { color: var(--a-tinta); }
.pasos.flujo li > div > div:first-child .gris { display: block; margin-top: 2px; }
.pasos.flujo li { padding-bottom: 26px; }
.auto { border: 1.5px solid var(--a-linea); border-radius: 16px; padding: 14px; background: #fff; display: grid; gap: 6px; min-width: 0; }
.auto.apagado { background: #FAFAFB; border-color: #D9D9DE; }
.auto.apagado .auto-cab b { color: var(--a-gris); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.auto-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.auto-cab > b { overflow-wrap: anywhere; }
.auto p { margin: 0; overflow-wrap: anywhere; }
.auto-texto { margin-top: 8px; padding: 12px 14px; border-radius: 14px; background: #F5F5F7; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; word-break: break-word; }
.inter { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 40px; padding: 4px 12px 4px 4px; border: 0; border-radius: 999px;
  background: #E3E3E8; color: var(--a-gris); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .2s var(--a-ease), color .2s; -webkit-tap-highlight-color: transparent; }
.inter .rodillo { width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--a-ease); }
.inter.on { background: var(--a-ok); color: #fff; }
.inter:not(.on) { padding: 4px 12px 4px 4px; }
.inter.on { padding: 4px 4px 4px 12px; flex-direction: row-reverse; }
.inter:active { transform: scale(.97); }
.auto-yo { border: 1.5px dashed var(--a-acento); background: var(--a-acento-suave); }
.auto-yo.on { border-style: solid; }
.yo-texto { margin-top: 6px; padding: 12px 14px; border-radius: 14px; background: #fff; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.yo-ejemplo { padding: 12px 14px; border-radius: 14px; background: #F5F5F7; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
