/* =====================================================================
   Vala — sistema de diseño
   Idea: la etiqueta de góndola. La plata siempre se muestra como un precio
   colgado en el kiosco (amarillo, número angosto y pesado). Todo lo demás
   queda tranquilo: papel frío, tinta verde-negra y verde botella.
   ===================================================================== */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff2') format('woff2-variations'), url('/fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --papel: #EEF1EF;      /* fondo */
  --blanco: #FFFFFF;     /* superficies */
  --tinta: #13221E;      /* texto */
  --gris: #5F6F69;       /* texto secundario */
  --linea: #D3DBD7;      /* bordes */
  --linea-suave: #E4E9E6;
  --verde: #0E6B4E;      /* acciones */
  --verde-osc: #0A513B;
  --verde-claro: #E3F0EA;
  --etiqueta: #FFD43B;   /* solo precios */
  --rojo: #C8372A;
  --rojo-claro: #FBEAE7;

  --r-panel: 16px;
  --r-control: 10px;
  --rail: 92px;
  --tabbar: 64px;
  --sombra-flotante: 0 18px 50px rgba(19, 34, 30, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 100%;
  font-weight: 430;
  background: var(--papel);
  color: var(--tinta);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
input, select, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--verde); }
:focus-visible { outline: 3px solid var(--etiqueta); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.ico { width: 22px; height: 22px; flex-shrink: 0; }

h1, h2, h3 { font-stretch: 78%; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-txt { font-stretch: 70%; font-weight: 850; font-size: 30px; letter-spacing: -.02em; line-height: 1; color: var(--tinta); }
.marca-svg { display: block; flex-shrink: 0; }

/* ---------- Etiqueta de precio ---------- */
.tag {
  --hueco: var(--blanco);
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  background: var(--etiqueta);
  color: var(--tinta);
  font-stretch: 62%;
  font-weight: 850;
  line-height: .92;
  padding: .1em .3em .08em .62em;
  clip-path: polygon(.36em 0, 100% 0, 100% 100%, .36em 100%, 0 50%);
  white-space: nowrap;
}
.tag::before {
  content: '';
  position: absolute;
  left: .2em; top: 50%;
  width: .13em; height: .13em;
  margin-top: -.065em;
  border-radius: 50%;
  background: var(--hueco);
}
.tag-s { font-size: .48em; margin: .14em .06em 0 0; font-weight: 800; }
.tag-c { font-size: .46em; margin: .12em 0 0 .04em; text-decoration: underline; text-underline-offset: .12em; }
.tag-chico { font-size: 19px; }
.tag-medio { font-size: 26px; }
.tag-grande { font-size: 74px; }

/* ---------- Navegación: un botón flotante con la marca; despliega el menú ---------- */
:root { --gutter: 84px; }
body:has(#nav) { padding-left: var(--gutter); }
.menu-flotante { position: fixed; z-index: 40; left: 18px; top: 18px; }
.fab {
  position: relative; width: 52px; height: 52px; border-radius: 18px; padding: 0; display: grid; place-items: center;
  background: var(--blanco); border: 1px solid var(--linea); box-shadow: 0 6px 18px rgba(19, 34, 30, .10);
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s;
}
.fab:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(19, 34, 30, .16); }
.fab .marca-svg { transition: transform .22s ease, opacity .15s; }
.fab-x { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: rotate(-90deg); transition: transform .22s ease, opacity .15s; color: #fff; }
.fab-x .ico { width: 22px; height: 22px; }
.menu-flotante.abierto .fab { background: var(--tinta); border-color: var(--tinta); }
.menu-flotante.abierto .fab .marca-svg { opacity: 0; transform: rotate(90deg) scale(.6); }
.menu-flotante.abierto .fab-x { opacity: 1; transform: none; }

.menu-panel {
  position: absolute; left: 0; top: 64px; width: 300px; max-height: calc(100dvh - 100px); overflow-y: auto;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: 22px; padding: 10px;
  box-shadow: var(--sombra-flotante); transform-origin: 26px -20px; animation: menu-abre .2s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes menu-abre { from { opacity: 0; transform: scale(.85); } }
.menu-cab { padding: 10px 12px 12px; border-bottom: 1px solid var(--linea-suave); margin-bottom: 6px; }
.menu-cab b { display: block; font-size: 17px; font-weight: 760; line-height: 1.2; }
.menu-cab small { color: var(--gris); font-size: 13px; }
.menu-items { display: grid; gap: 2px; }
.menu-items a {
  display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 14px;
  color: var(--tinta); text-decoration: none; font-weight: 640; font-size: 16px;
  animation: item-entra .24s both; animation-delay: calc(var(--i) * 18ms);
}
@keyframes item-entra { from { opacity: 0; transform: translateY(-4px); } }
.menu-items a small { display: block; color: var(--gris); font-weight: 450; font-size: 13px; }
.menu-items a .ico { width: 22px; height: 22px; color: var(--verde); flex: none; }
.menu-items a:hover { background: var(--papel); }
.menu-items a.activo { background: var(--verde-claro); }
.menu-salir {
  display: flex; align-items: center; gap: 13px; width: 100%; margin-top: 6px; padding: 12px; border: 0; border-top: 1px solid var(--linea-suave);
  background: none; color: var(--rojo); font-weight: 600; font-size: 15px; border-radius: 0 0 12px 12px;
}
.menu-salir .ico { width: 20px; height: 20px; }

/* ---------- Controles ---------- */
label { display: block; font-size: 14px; font-weight: 560; color: var(--tinta); margin: 14px 0 6px; }
.input, select.input {
  width: 100%; padding: 12px 14px; font-size: 16px;
  background: var(--blanco); border: 1.5px solid var(--linea); border-radius: var(--r-control); outline: none;
  transition: border-color .15s;
}
.input:focus { border-color: var(--verde); box-shadow: 0 0 0 3px var(--verde-claro); }
.input:disabled { background: var(--papel); color: var(--gris); }
.check { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 450; }
.check input { width: 20px; height: 20px; accent-color: var(--verde); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--r-control);
  border: 1.5px solid var(--linea); background: var(--blanco);
  font-weight: 640; font-size: 15.5px; line-height: 1.2; text-decoration: none; color: var(--tinta);
}
.btn:hover { border-color: var(--tinta); }
.btn:active { transform: translateY(1px); }
.btn.primario { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.primario:hover { background: var(--verde-osc); border-color: var(--verde-osc); }
.btn.peligro { color: var(--rojo); border-color: color-mix(in srgb, var(--rojo) 45%, var(--linea)); }
.btn.peligro:hover { border-color: var(--rojo); background: var(--rojo-claro); }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-link { background: none; border: 0; color: var(--gris); }
kbd {
  font-family: inherit; font-size: 11.5px; font-weight: 600; padding: 1px 5px; border-radius: 5px;
  border: 1px solid currentColor; opacity: .55;
}

/* ---------- Ingreso / registro ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-lado {
  background: var(--verde); color: #fff; padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-lado .logo-txt { color: #fff; }
.auth-lado h2 { font-size: clamp(34px, 4.2vw, 56px); font-stretch: 68%; font-weight: 850; line-height: 1.02; max-width: 12ch; }
.auth-lado p { color: rgba(255,255,255,.78); max-width: 38ch; margin-top: 14px; font-size: 17px; }
.auth-precios { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin-top: 34px; }
.auth-precios .tag { --hueco: var(--verde); }
.auth-precios small { display: block; color: rgba(255,255,255,.72); font-size: 13px; margin-top: 6px; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo { display: none; margin-bottom: 26px; }
.auth-card h1 { font-size: 34px; margin-bottom: 6px; }
.auth-card p.sub { color: var(--gris); margin-bottom: 8px; }
.auth-card .btn { margin-top: 22px; }
.auth-card .alt { margin-top: 16px; color: var(--gris); font-size: 15px; }
.auth-card .alt a { color: var(--verde); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Caja ---------- */
.caja { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 100vh; }
.caja-izq { display: flex; flex-direction: column; padding: 24px 28px; gap: 16px; min-height: 0; height: 100vh; }
.scan-box { position: relative; }
.scan-box .ico-scan { position: absolute; left: 18px; top: 19px; width: 26px; height: 26px; color: var(--gris); pointer-events: none; }
.scan-box .input { font-size: 21px; padding: 17px 18px 17px 56px; border-width: 2px; border-radius: 14px; }
.scan-hint { font-size: 13.5px; color: var(--gris); margin-top: 8px; }
.scan-hint b { color: var(--tinta); font-weight: 650; }
.sugerencias {
  position: absolute; top: 66px; left: 0; right: 0; z-index: 5;
  background: var(--blanco); border: 1.5px solid var(--linea); border-radius: 12px; overflow: hidden; box-shadow: var(--sombra-flotante);
}
.sugerencias div { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.sugerencias div.sel, .sugerencias div:hover { background: var(--verde-claro); }

.carrito { flex: 1; overflow: auto; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-panel); }
.carrito .vacio { height: 100%; min-height: 220px; display: grid; place-content: center; text-align: center; color: var(--gris); gap: 10px; padding: 24px; }
.carrito .vacio .ico { width: 54px; height: 54px; margin: 0 auto; color: var(--linea); stroke-width: 1.4; }
.carrito .vacio b { color: var(--tinta); font-weight: 650; font-size: 17px; }
.item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 120px 32px; gap: 14px; align-items: center;
  padding: 13px 18px; border-bottom: 1px solid var(--linea-suave);
}
.item .nom { font-weight: 620; }
.item .uni { font-size: 13.5px; color: var(--gris); }
.badge18 {
  display: inline-block; font-size: 11.5px; font-weight: 750; padding: 1px 6px; margin-left: 8px; vertical-align: 2px;
  border-radius: 6px; background: var(--rojo); color: #fff; letter-spacing: .01em;
}
.qty { display: flex; align-items: center; gap: 4px; }
.qty button {
  width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid var(--linea); background: var(--blanco);
  display: grid; place-items: center; color: var(--tinta);
}
.qty button .ico { width: 16px; height: 16px; }
.qty button:hover { border-color: var(--tinta); }
.qty span { min-width: 34px; text-align: center; font-weight: 700; font-size: 17px; }
.item .sub { text-align: right; font-weight: 700; font-size: 17px; }
.item .quitar { background: none; border: 0; color: var(--gris); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.item .quitar:hover { color: var(--rojo); background: var(--rojo-claro); }
.item .quitar .ico { width: 18px; height: 18px; }
.item.flash { animation: entra .55s ease-out; }
@keyframes entra { from { background: color-mix(in srgb, var(--etiqueta) 45%, transparent); } to { background: transparent; } }

.caja-der {
  background: var(--blanco); border-left: 1px solid var(--linea);
  display: flex; flex-direction: column; padding: 24px; gap: 14px; height: 100vh; position: sticky; top: 0;
}
.turno-info { font-size: 14px; color: var(--gris); display: flex; align-items: center; gap: 8px; }
.turno-info::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); flex-shrink: 0; }
.turno-info.cerrada::before { background: var(--rojo); }
.total-box { padding: 6px 0 4px; }
.total-box .lbl { color: var(--gris); font-size: 15px; font-weight: 560; margin-bottom: 8px; }
.total-box .monto { display: block; min-height: 72px; }
.total-box .monto .tag { --hueco: var(--blanco); }
.total-box .cant { color: var(--gris); font-size: 14px; margin-top: 10px; }
.aviso18 {
  display: flex; align-items: center; gap: 10px;
  background: var(--rojo-claro); color: var(--rojo); border-radius: 10px; padding: 10px 12px; font-size: 14.5px; font-weight: 620;
}
.aviso18 .badge18 { margin: 0; }
.pagos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pagos .btn { padding: 15px 8px; flex-direction: column; gap: 2px; }
.pagos .btn.efectivo { grid-column: span 2; font-size: 19px; padding: 18px 8px; flex-direction: row; gap: 10px; }
.espacio { flex: 1; }
.atajos { font-size: 12.5px; color: var(--gris); line-height: 1.9; }
.acciones-turno { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(19, 34, 30, .45); z-index: 50;
  display: grid; place-items: center; padding: 20px; animation: fondo .15s ease-out;
}
@keyframes fondo { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 460px; background: var(--blanco); border-radius: 18px; padding: 26px;
  max-height: 90vh; overflow: auto; box-shadow: var(--sombra-flotante); animation: sube .2s ease-out;
}
@keyframes sube { from { transform: translateY(10px); opacity: 0; } }
.modal h2 { font-size: 26px; margin-bottom: 6px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modal h2 .tag { font-size: 34px; }
.modal p { color: var(--gris); }
.modal .fila { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .botones { display: flex; gap: 8px; margin-top: 22px; }
.modal .botones .btn { flex: 1; }
.vuelto { margin-top: 14px; font-size: 22px; font-weight: 750; color: var(--verde); }
.vuelto.mal { color: var(--rojo); }
.resumen-cierre { margin-top: 14px; display: grid; gap: 8px; }
.resumen-cierre div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.resumen-cierre .dif { font-size: 21px; font-weight: 800; padding-top: 10px; border-top: 1px solid var(--linea); }
.precio-preview { margin-top: 12px; color: var(--gris); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Páginas (productos, equipo) ---------- */
.pagina { padding: 28px 32px 48px; max-width: 1100px; }
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.encabezado h1 { font-size: 40px; }
.encabezado p { color: var(--gris); margin-top: 4px; }
.barra { display: flex; gap: 10px; margin-bottom: 16px; }
.barra .input { flex: 1; }
table.tabla { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-panel); overflow: hidden; }
.tabla th, .tabla td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--linea-suave); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla th { font-size: 13.5px; color: var(--gris); font-weight: 600; background: var(--blanco); border-bottom: 1px solid var(--linea); }
.tabla td.num, .tabla th.num { text-align: right; }
.tabla tr.click { cursor: pointer; }
.tabla tr.click:hover td { background: #F6F8F7; }
.tabla .bajo { color: var(--rojo); font-weight: 750; }
.tabla .cod { color: var(--gris); font-size: 13.5px; }
.tabla .tag { font-size: 20px; }
.aviso-ok {
  background: var(--verde-claro); color: var(--verde-osc); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; line-height: 1.5;
}

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; }
.toast {
  padding: 12px 18px; border-radius: 12px; background: var(--tinta); color: #fff; font-weight: 580;
  box-shadow: var(--sombra-flotante); display: flex; align-items: center; gap: 10px; animation: sube .2s ease-out;
}
.toast .ico { width: 18px; height: 18px; color: var(--etiqueta); }
.toast.error { background: var(--rojo); }
.toast.error .ico { color: #fff; }

/* ---------- Encargado (chat) ---------- */
.chat-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; max-width: 820px; margin: 0 auto; }
.mensajes { flex: 1; overflow-y: auto; padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; flex-direction: column; gap: 10px; max-width: 86%; }
.msg.yo { align-self: flex-end; align-items: flex-end; }
.msg.ia { align-self: flex-start; padding-left: 40px; position: relative; }
.msg.ia::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 28px; height: 28px;
  background: url('/img/marca.svg') center / contain no-repeat;
}
.burbuja { line-height: 1.5; word-wrap: break-word; }
.msg.yo .burbuja { background: var(--tinta); color: #fff; padding: 11px 15px; border-radius: 18px 18px 6px 18px; }
.msg.ia .burbuja { padding-top: 4px; }
.msg.ia .burbuja b { font-weight: 720; }
.msg.ia.error .burbuja { color: var(--rojo); }
.msg-foto { max-width: 220px; max-height: 280px; border-radius: 14px; border: 1px solid var(--linea); }
.pensando { display: flex; gap: 5px; padding: 12px 0 !important; }
.pensando span { width: 7px; height: 7px; border-radius: 50%; background: var(--verde); animation: late 1.1s infinite; }
.pensando span:nth-child(2) { animation-delay: .15s; } .pensando span:nth-child(3) { animation-delay: .3s; }
@keyframes late { 0%, 70%, 100% { opacity: .25; } 35% { opacity: 1; } }

/* Propuestas de la IA: se ven como un comprobante a confirmar */
.accion { width: min(440px, 80vw); background: var(--blanco); border: 1.5px solid var(--linea); border-radius: 16px; overflow: hidden; }
.accion.estado-pendiente { border-color: var(--verde); }
.acc-titulo { font-weight: 700; padding: 14px 16px 12px; font-size: 15.5px; line-height: 1.35; }
.acc-items { display: grid; padding: 4px 16px 6px; border-top: 1.5px dashed var(--linea); font-size: 15px; }
.fila-acc { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--linea-suave); }
.fila-acc:last-child { border-bottom: 0; }
.fila-acc.col { flex-direction: column; align-items: flex-start; gap: 2px; }
.fila-acc.total { font-weight: 700; border-top: 1px solid var(--linea); border-bottom: 0; margin-top: 2px; }
.fila-acc s { color: var(--gris); }
.fila-acc small, .sub-acc { color: var(--gris); font-size: 13.5px; }
.sub-acc { padding: 10px 0 2px; }
.cambio { display: inline-flex; align-items: center; gap: 8px; }
.cambio .tag { font-size: 20px; }
.cambio s { font-size: 14px; }
.nuevo { font-size: 11.5px; font-weight: 700; background: var(--verde-claro); color: var(--verde-osc); padding: 2px 7px; border-radius: 6px; margin-left: 6px; }
.acc-botones { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; padding: 12px 16px 16px; }
.acc-estado { padding: 12px 16px 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--linea-suave); color: var(--gris); flex-wrap: wrap; }
.acc-estado .ico { width: 18px; height: 18px; }
.estado-ejecutada .acc-estado { color: var(--verde); background: var(--verde-claro); }
.estado-error .acc-estado { color: var(--rojo); }
.acc-estado small { width: 100%; color: var(--gris); font-weight: 450; }

.banner {
  margin: 16px 20px 0; padding: 12px 14px; border-radius: 14px; background: var(--blanco); border: 1.5px solid var(--linea);
  display: flex; align-items: center; gap: 12px; font-size: 14.5px; line-height: 1.45;
}
.banner > .ico { color: var(--verde); }
.banner .btn { padding: 9px 16px; margin-left: auto; flex-shrink: 0; }

/* ---------- Equipo ---------- */
.seccion { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-panel); padding: 22px; margin-bottom: 18px; }
.seccion h2 { font-size: 24px; display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.seccion h2 .ico { color: var(--verde); width: 24px; height: 24px; }
.seccion > p { color: var(--gris); margin-bottom: 10px; }
.miembro { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linea-suave); }
.miembro:last-child { border-bottom: 0; }
.miembro small { color: var(--gris); display: block; font-size: 13.5px; }
.miembro .codigo-chico { font-stretch: 75%; font-weight: 800; font-size: 19px; letter-spacing: .12em; }
.codigo-grande {
  font-stretch: 70%; font-weight: 850; font-size: 46px; letter-spacing: .14em; text-align: center;
  padding: 16px; border-radius: 14px; margin: 16px 0 8px; background: var(--tinta); color: #fff;
}
.codigo-nota { color: var(--gris); font-size: 14px; text-align: center; }
.btn.whatsapp { background: #1F9D55; border-color: #1F9D55; color: #fff; margin-top: 12px; }
.fila-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.fila-form > div { flex: 1; min-width: 150px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--linea-suave); margin: 0; font-weight: 600; }
.switch small { color: var(--gris); display: block; font-size: 14px; font-weight: 430; margin-top: 2px; max-width: 52ch; }
.switch input[type=checkbox] {
  appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--linea); position: relative; flex-shrink: 0; cursor: pointer;
  transition: background .2s;
}
.switch input[type=checkbox]::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.switch input[type=checkbox]:checked { background: var(--verde); }
.switch input[type=checkbox]:checked::after { transform: translateX(18px); }
.switch input[type=checkbox]:disabled { opacity: .6; cursor: default; }
.seccion .acciones { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.seccion .acciones .btn.primario { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Celular ---------- */
@media (max-width: 820px) {
  /* En el celular el botón flota abajo a la derecha, a mano del pulgar */
  body:has(#nav) { padding-left: 0; padding-bottom: 88px; }
  .menu-flotante { left: auto; top: auto; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .menu-panel { top: auto; bottom: 64px; left: auto; right: 0; width: min(320px, calc(100vw - 32px)); transform-origin: calc(100% - 26px) calc(100% + 20px); }

  .auth-wrap { grid-template-columns: 1fr; }
  .auth-lado { display: none; }
  .auth-card .logo { display: inline-flex; }

  .caja { grid-template-columns: 1fr; min-height: 0; }
  .caja-izq { height: auto; padding: 16px; }
  .caja-der { height: auto; position: static; border-left: 0; border-top: 1px solid var(--linea); padding: 18px 16px; }
  .carrito { min-height: 180px; max-height: 46vh; }
  .item { grid-template-columns: minmax(0, 1fr) auto 84px 28px; gap: 8px; padding: 11px 12px; }
  .scan-hint, .atajos, kbd { display: none; }
  .tag-grande { font-size: 60px; }

  .pagina { padding: 18px 16px 32px; }
  .encabezado h1 { font-size: 32px; }
  .tabla .ocultar-movil { display: none; }
  .tabla th, .tabla td { padding: 12px; }

  .chat-body { height: 100dvh; }
  .mensajes { padding: 18px 14px; }
  .msg { max-width: 94%; }
  .msg.ia { padding-left: 34px; }
  .msg.ia::before { width: 24px; height: 24px; }
  .banner { margin: 12px 12px 0; flex-wrap: wrap; }
  .banner .btn { margin-left: 0; width: 100%; }
}

/* ---------- Ajustes después de revisar ---------- */
/* Logo sobre el panel verde del ingreso: etiqueta blanca, V verde */
.auth-lado .marca-svg path:first-of-type { fill: #fff; }
.auth-lado .marca-svg circle { fill: var(--verde); }
.auth-lado .marca-svg path:last-of-type { stroke: var(--verde); }

#banner-avisos { flex-shrink: 0; }
.banner > span { flex: 1; min-width: 0; }

@media (max-width: 820px) {
  /* Renglón de la venta en dos líneas: nombre arriba, cantidad y subtotal abajo */
  .item {
    grid-template-columns: auto minmax(0, 1fr) 28px;
    grid-template-areas: "info info quitar" "qty sub sub";
    row-gap: 6px; column-gap: 10px;
  }
  .item > div:first-child { grid-area: info; }
  .item .qty { grid-area: qty; }
  .item .sub { grid-area: sub; align-self: center; }
  .item .quitar { grid-area: quitar; align-self: start; }
  .carrito { max-height: 38vh; min-height: 140px; }
  .caja-der { gap: 10px; }
  .total-box .monto { min-height: 0; }
  .tag-grande { font-size: 54px; }
  .pagos .btn { padding: 12px 6px; font-size: 14.5px; }
  .pagos .btn.efectivo { padding: 15px 8px; }
  .banner { flex-wrap: nowrap; align-items: flex-start; }
  .banner:has(.btn) { flex-wrap: wrap; }
  .banner .btn { width: 100%; }
}

/* ---------- Elegir producto (código nuevo) ---------- */
.lista-elegir { display: grid; gap: 6px; margin-top: 10px; max-height: 300px; overflow: auto; }
.elegir {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  padding: 11px 14px; border-radius: var(--r-control); border: 1.5px solid var(--linea); background: var(--blanco); font-weight: 560;
}
.elegir:hover { border-color: var(--verde); background: var(--verde-claro); }
.rc-sugerido { margin-top: 12px; font-size: 14.5px; }
.vacio-chico { color: var(--gris); font-size: 14.5px; padding: 8px 2px; }

/* ---------- Menú "Más" (solo celular) ---------- */
.tab.mas { display: none; }

/* ---------- Inicio ---------- */
.hoy {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0;
  background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-panel); margin-bottom: 18px; overflow: hidden;
}
.hoy-principal { padding: 24px 26px; }
.hoy .lbl { display: block; color: var(--gris); font-size: 14.5px; font-weight: 560; margin-bottom: 10px; }
.hoy-detalle { color: var(--gris); margin-top: 14px; max-width: 42ch; }
.sube { color: var(--verde); }
.baja { color: var(--rojo); }
.hoy-datos { display: grid; border-left: 1px solid var(--linea-suave); }
.hoy-datos > div { padding: 16px 22px; border-bottom: 1px solid var(--linea-suave); display: flex; flex-direction: column; justify-content: center; }
.hoy-datos > div:last-child { border-bottom: 0; }
.hoy-datos .lbl { margin-bottom: 2px; font-size: 13.5px; }
.hoy-datos b { font-size: 26px; font-stretch: 75%; font-weight: 800; line-height: 1.15; }
.hoy-datos small { color: var(--gris); font-size: 13.5px; }
.inicio-grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.barras { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 170px; align-items: end; margin-top: 14px; }
.barra-dia { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.barra-dia .barra { width: 100%; max-width: 44px; background: var(--verde); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.barra-dia.hoy .barra { background: var(--etiqueta); }
.barra-monto { font-size: 12px; color: var(--gris); font-weight: 600; }
.barra-lbl { font-size: 12.5px; color: var(--gris); text-transform: capitalize; }
.barra-dia.hoy .barra-lbl { color: var(--tinta); font-weight: 700; text-transform: none; }
.nota { color: var(--gris); font-size: 14px; margin-top: 12px; }
.fila-link, .fila-dato {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--linea-suave); color: var(--tinta); text-decoration: none;
}
.fila-link:last-child, .fila-dato:last-of-type { border-bottom: 0; }
.fila-link .ico { width: 18px; height: 18px; color: var(--verde); }
.fila-link:hover span { color: var(--verde); }
.fila-dato span:last-child { color: var(--gris); white-space: nowrap; }
.fila-dato b { color: var(--tinta); }
.fila-dato .baja b, .fila-dato .baja { color: var(--rojo); }
@media (max-width: 820px) {
  .hoy { grid-template-columns: 1fr; }
  .hoy-datos { border-left: 0; border-top: 1px solid var(--linea-suave); grid-template-columns: repeat(3, 1fr); }
  .hoy-datos > div { border-bottom: 0; border-right: 1px solid var(--linea-suave); padding: 14px 12px; }
  .hoy-datos > div:last-child { border-right: 0; }
  .hoy-datos b { font-size: 20px; }
  .hoy-datos small { display: none; }
  .inicio-grilla { grid-template-columns: 1fr; }
  .barras { height: 140px; gap: 5px; }
  .barra-monto { font-size: 10.5px; }
}

/* ---------- Ventas ---------- */
.selector-dia { display: flex; gap: 6px; align-items: center; }
.selector-dia .input { width: 170px; }
.selector-dia .btn { padding: 11px; }
.pestanas { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--linea); }
.pestana {
  background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--gris);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.pestana.activa { color: var(--verde); border-bottom-color: var(--verde); }
.totales-dia {
  display: flex; flex-wrap: wrap; gap: 0; background: var(--blanco); border: 1px solid var(--linea);
  border-radius: var(--r-panel); margin-bottom: 14px; overflow: hidden;
}
.totales-dia > div { padding: 14px 20px; border-right: 1px solid var(--linea-suave); display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.totales-dia > div:last-child { border-right: 0; }
.totales-dia .lbl { color: var(--gris); font-size: 13.5px; font-weight: 560; }
.totales-dia b { font-size: 20px; font-stretch: 78%; font-weight: 800; }
.lista-ventas { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-panel); overflow: hidden; }
.venta { border-bottom: 1px solid var(--linea-suave); }
.venta:last-child { border-bottom: 0; }
.venta-cab {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto 96px; gap: 14px; align-items: center;
  width: 100%; padding: 13px 18px; background: none; border: 0; text-align: left;
}
.venta-cab:hover { background: #F6F8F7; }
.venta-hora { color: var(--gris); font-weight: 600; }
.venta-items { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.venta-medio { font-size: 13.5px; color: var(--gris); }
.venta-total { text-align: right; font-weight: 750; }
.venta.anulada .venta-items, .venta.anulada .venta-total { text-decoration: line-through; color: var(--gris); }
.venta.anulada .venta-medio { color: var(--rojo); font-weight: 650; }
.venta-detalle { display: none; padding: 4px 18px 16px 86px; }
.venta.abierta .venta-detalle { display: block; }
.venta.abierta .venta-cab { background: #F6F8F7; }
.acciones-venta { display: flex; justify-content: flex-end; margin-top: 10px; }
.vacio-grande { text-align: center; color: var(--gris); padding: 40px 20px; }
.nota-celda { display: block; color: var(--gris); font-size: 13px; }
@media (max-width: 820px) {
  .selector-dia { width: 100%; }
  .selector-dia .input { flex: 1; width: auto; }
  .venta-cab { grid-template-columns: 44px minmax(0, 1fr) 80px; gap: 10px; padding: 12px 14px; }
  .venta-medio { display: none; }
  .venta-detalle { padding: 4px 14px 14px; }
  .totales-dia > div { padding: 12px 14px; }
}

/* ---------- Pedidos ---------- */
.barra-cobertura { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.barra-cobertura label { margin: 0; }
.barra-cobertura .input { width: auto; }
.barra-cobertura .nota { margin: 0; }
.prov-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.prov-cab h2 { margin: 0; }
.pedido { border-top: 1.5px dashed var(--linea); margin-top: 8px; }
.pedido-fila { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--linea-suave); }
.pedido-fila small { display: block; color: var(--gris); font-size: 13.5px; font-weight: 430; }
.cant-pedido { width: 88px; text-align: center; font-weight: 700; font-size: 17px; padding: 9px; flex-shrink: 0; }
.prov-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.prov-pie .nota { margin: 0; }
.prov-pie .btn.whatsapp { margin-top: 0; }
@media (max-width: 820px) {
  .prov-pie .btn { width: 100%; }
}

.msg.ia .burbuja a { color: var(--verde); font-weight: 600; text-underline-offset: 3px; }

/* ---------- Cámara ---------- */
.btn-camara {
  position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border-radius: 11px; z-index: 2;
  border: 0; background: var(--verde-claro); color: var(--verde); display: grid; place-items: center;
}
.btn-camara:hover { background: var(--verde); color: #fff; }
.scan-box .input { padding-right: 64px; }
.camara-bg { position: fixed; inset: 0; z-index: 80; background: #0B1411; display: grid; place-items: center; }
.camara { width: 100%; max-width: 560px; height: 100%; max-height: 100dvh; display: flex; flex-direction: column; color: #fff; }
.camara-cab { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; font-size: 17px; }
.camara-cerrar { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.camara-vista { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
.camara-vista video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camara-marco {
  position: absolute; left: 10%; right: 10%; top: 50%; height: 34%; transform: translateY(-50%);
  border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); border: 3px solid rgba(255,255,255,.9);
}
.camara-marco span { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: var(--etiqueta); box-shadow: 0 0 12px var(--etiqueta); }
.camara-marco.ok { border-color: var(--etiqueta); animation: leido .5s ease-out; }
@keyframes leido { from { background: rgba(255, 212, 59, .35); } to { background: transparent; } }
.camara-ultimo {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: 90%;
  background: var(--etiqueta); color: var(--tinta); font-weight: 750; padding: 10px 16px; border-radius: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.camara-estado { text-align: center; padding: 14px 18px 4px; color: rgba(255,255,255,.8); font-size: 15px; }
.camara-estado.error { color: #FFB4AA; }
.camara-pie { display: grid; gap: 8px; padding: 12px 18px calc(18px + env(safe-area-inset-bottom)); }
.camara-pie .btn { width: 100%; }
.camara-pie .btn:not(.primario) { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.foto-reconocer { width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; background: var(--papel); margin: 10px 0; }
@media (max-width: 820px) { .solo-pc { display: none; } }

/* ---------- Facturación electrónica ---------- */
.toast-accion { color: var(--etiqueta); font-weight: 700; margin-left: 6px; text-underline-offset: 3px; text-decoration: underline; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.estado-fiscal { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin: 6px 0 14px; line-height: 1.45; }
.estado-fiscal .ico { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.estado-fiscal b { display: block; }
.estado-fiscal span { color: inherit; opacity: .85; font-size: 14.5px; }
.estado-fiscal small.ambiente { display: block; margin-top: 6px; font-size: 13.5px; color: var(--gris); }
.estado-fiscal.ok { background: var(--verde-claro); color: var(--verde-osc); }
.estado-fiscal.mal { background: var(--rojo-claro); color: var(--rojo); }
.estado-fiscal.pendiente { background: var(--papel); color: var(--tinta); }
.pasos-arca { border: 1px solid var(--linea); border-radius: 12px; padding: 0 16px; margin-bottom: 4px; }
.pasos-arca summary { cursor: pointer; font-weight: 640; padding: 14px 0; color: var(--verde); }
.pasos-arca ol { margin: 0 0 16px 20px; display: grid; gap: 12px; line-height: 1.5; font-size: 15px; max-width: 68ch; }
.pasos-arca li::marker { font-weight: 800; color: var(--verde); }
.cuit-vadmin { background: var(--etiqueta); padding: 1px 6px; border-radius: 4px; white-space: nowrap; letter-spacing: .02em; }
.prueba-arca { list-style: none; margin: 16px 0 0; display: grid; gap: 8px; }
.prueba-arca li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.prueba-arca .ico { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.prueba-arca .ok .ico { color: var(--verde); }
.prueba-arca .mal { color: var(--rojo); font-weight: 560; }
.factura-cliente {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 11px 12px; margin: 4px 0 10px; border-radius: var(--r-control);
  border: 1.5px dashed var(--linea); background: var(--blanco); color: var(--tinta); font-size: 14.5px; line-height: 1.3;
}
.factura-cliente:hover { border-color: var(--verde); }
.factura-cliente .ico { width: 20px; height: 20px; color: var(--verde); flex: none; }
.factura-cliente .cambiar { margin-left: auto; color: var(--verde); font-weight: 640; white-space: nowrap; font-size: 13.5px; }
.factura-cliente.apagada { color: var(--gris); }
.factura-cliente.apagada .ico { color: var(--gris); }
.comps { display: grid; gap: 6px; margin: 10px 0 2px; }
.comp { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--gris); }
.comp .ico { width: 18px; height: 18px; flex: none; }
.comp.ok { color: var(--verde-osc); font-weight: 580; }
.comp.mal { color: var(--rojo); }
.comp .btn-link, .comp a { margin-left: auto; color: var(--verde); font-weight: 640; cursor: pointer; padding: 2px 0; font-size: 14.5px; }
.comp small { font-weight: 450; color: var(--gris); }
.acciones-venta { gap: 8px; }
.impresora-estado {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; margin-bottom: 10px;
  padding: 8px 2px; border: 0; background: none; color: var(--gris); font-size: 13.5px; line-height: 1.3;
}
.impresora-estado .ico { width: 18px; height: 18px; flex: none; }
.impresora-estado .cambiar { margin-left: auto; color: var(--verde); font-weight: 640; }
.opciones { display: flex; gap: 8px; flex-wrap: wrap; }
.opciones.apiladas { flex-direction: column; }
.opcion { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 11px 14px; border: 1.5px solid var(--linea);
  border-radius: var(--r-control); font-weight: 600; cursor: pointer; flex: 1; min-width: 110px; }
.opcion:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); }
.opcion input { accent-color: var(--verde); margin-top: 3px; }
.opcion small { display: block; color: var(--gris); font-weight: 430; font-size: 13.5px; margin-top: 2px; }
.opcion.deshabilitada { opacity: .6; cursor: default; }
.aviso-etiquetas { display: flex; gap: 12px; align-items: center; padding: 14px 16px; margin-bottom: 14px; border-radius: 12px;
  background: #FFF6D1; color: var(--tinta); text-decoration: none; line-height: 1.4; font-size: 14.5px; border: 1px solid #F1DB7A; }
.aviso-etiquetas .ico { width: 22px; height: 22px; flex: none; color: #8A6A00; }
.aviso-etiquetas .ir { margin-left: auto; font-weight: 700; color: var(--verde); white-space: nowrap; }
@media (max-width: 820px) { .aviso-etiquetas { flex-wrap: wrap; } .aviso-etiquetas .ir { margin-left: 34px; } }
.modal .fila:has(> :nth-child(3)) { grid-template-columns: 1fr 1fr 1fr; }
.aviso-pedidos { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px;
  background: var(--rojo); color: #fff; text-decoration: none; font-weight: 650; animation: latido 1.6s ease-in-out infinite; }
.aviso-pedidos .ico { width: 22px; height: 22px; flex: none; }
.aviso-pedidos b { margin-left: auto; text-decoration: underline; }
@keyframes latido { 50% { box-shadow: 0 0 0 6px rgba(200, 55, 42, .25); } }
@media (prefers-reduced-motion: reduce) { .aviso-pedidos { animation: none; } }
.error-chico { color: var(--rojo); font-size: 14px; margin: 8px 0 0; }
.switch .btn { flex: none; }
/* QR de Mercado Pago en la caja */
.cobro-qr { text-align: center; }
.cobro-qr .monto-qr { font-size: 40px; font-weight: 850; letter-spacing: -.02em; margin: 2px 0 10px; }
.cobro-qr .qr-caja { display: inline-block; background: #fff; padding: 14px; border-radius: 16px; border: 1px solid var(--linea); }
.cobro-qr .qr-caja canvas, .cobro-qr .qr-caja img, .cobro-qr .qr-caja svg { display: block; width: 260px; height: 260px; image-rendering: pixelated; }
.cobro-qr .esperando { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 14px 0 4px; font-weight: 600; }
.cobro-qr .esperando::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--verde); border-right-color: transparent; animation: girar .9s linear infinite; }
.cobro-qr.pagado .qr-caja { opacity: .25; }
.cobro-qr .listo { color: var(--verde-osc); font-size: 22px; font-weight: 800; margin-top: 12px; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cobro-qr .esperando::before { animation: none; } }


/* =====================================================================
   ENCARGADO: la pantalla principal es la charla con la IA
   ===================================================================== */
.chat-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; max-width: 780px; margin: 0 auto; }
.mensajes { flex: 1; overflow-y: auto; padding: 28px 20px 12px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }

/* Conversación vacía: saludo grande y el cuadro de texto en el medio */
.saludo { display: none; padding: 0 20px; }
body.vacio .mensajes { flex: 0 0 auto; padding: 0; }
body.vacio .chat { justify-content: center; padding-bottom: 8vh; }
body.vacio .saludo { display: block; margin-bottom: 26px; }
.saludo h1 {
  font-size: clamp(38px, 6vw, 60px); font-weight: 850; font-stretch: 72%; letter-spacing: -.025em; line-height: 1;
  margin: 0 0 12px;
}
.saludo p { color: var(--gris); font-size: 17px; margin: 0; }
.saludo p b { color: var(--tinta); font-weight: 720; }
.saludo p a { color: var(--verde); font-weight: 650; text-underline-offset: 3px; }
.ver-anteriores { margin-top: 14px; border: 0; background: none; padding: 0; color: var(--gris); font: inherit; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.chips { display: none; flex-wrap: wrap; gap: 8px; padding: 14px 20px 0; }
body.vacio .chips { display: flex; }
.chip {
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--linea); background: transparent;
  font-size: 14.5px; font-weight: 540; color: var(--tinta); display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.chip .ico { width: 17px; height: 17px; color: var(--verde); }
.chip:hover { border-color: var(--verde); background: var(--blanco); }

/* Cuadro para escribir */
.compositor { padding: 10px 20px calc(16px + env(safe-area-inset-bottom)); }
body.vacio .compositor { padding-bottom: 0; }
.comp-fila, .adjuntos { background: var(--blanco); }
.compositor > .comp-fila {
  display: flex; align-items: flex-end; gap: 4px; padding: 7px; border: 1px solid var(--linea); border-radius: 28px;
  box-shadow: 0 8px 28px rgba(19, 34, 30, .07);
}
.compositor:has(.adjuntos:not([hidden])) > .comp-fila { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
.compositor:focus-within > .comp-fila, .compositor:focus-within > .adjuntos { border-color: var(--verde); }
.compositor textarea {
  flex: 1; resize: none; padding: 11px 6px; border: 0; outline: none; background: none; max-height: 160px;
  line-height: 1.4; font-size: 16.5px; font-family: inherit; color: var(--tinta); min-width: 0;
}
.comp-btn, .comp-enviar, .comp-voz {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: none; color: var(--gris);
}
.comp-btn:hover { background: var(--papel); color: var(--tinta); }
.comp-btn .ico { width: 23px; height: 23px; }
.comp-enviar, .comp-voz { background: var(--tinta); color: #fff; }
.comp-voz { background: var(--verde); }
.comp-enviar:hover { background: #000; } .comp-voz:hover { background: var(--verde-osc); }
.comp-enviar .ico, .comp-voz .ico { width: 21px; height: 21px; stroke-width: 2.3; }
.compositor.dictando #dictar { background: var(--rojo); color: #fff; }

.adjuntos {
  display: flex; gap: 8px; padding: 12px 12px 4px; border: 1px solid var(--linea); border-bottom: 0; border-radius: 22px 22px 0 0;
}
.adjunto { position: relative; }
.adjunto img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; display: block; border: 1px solid var(--linea); }
.adjunto button {
  position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--blanco);
  background: var(--tinta); color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer;
}
.adjunto button .ico { width: 13px; height: 13px; }

.grabando { flex: 1; display: flex; align-items: center; gap: 12px; padding: 0 10px; height: 44px; font-variant-numeric: tabular-nums; color: var(--gris); }
.punto-rojo { width: 10px; height: 10px; border-radius: 50%; background: var(--rojo); animation: late 1.2s infinite; flex: none; }
.barra-nivel { flex: 1; height: 4px; border-radius: 4px; background: var(--linea-suave); overflow: hidden; }
.barra-nivel i { display: block; height: 100%; background: var(--verde); transform-origin: left; transform: scaleX(0); transition: transform .08s; }

/* Mensajes */
.msg-fotos { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.msg-fotos .msg-foto { max-width: 160px; max-height: 200px; }
.msg.yo .burbuja { background: var(--blanco); color: var(--tinta); border: 1px solid var(--linea); border-radius: 20px 20px 6px 20px; }
.msg.ia .burbuja { font-size: 16.5px; line-height: 1.55; }

/* ---------- Modo conversación por voz ---------- */
.modo-voz {
  position: fixed; inset: 0; z-index: 60; background: var(--papel);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
}
.modo-voz[hidden] { display: none; }
body.con-voz .menu-flotante { display: none; }
.voz-centro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; width: 100%; max-width: 560px; text-align: center; }
.voz-orbe {
  --nivel: 0; position: relative; width: 220px; height: 220px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--blanco); display: grid; place-items: center;
  box-shadow: 0 20px 60px rgba(14, 107, 78, .16);
  transform: scale(calc(1 + var(--nivel) * .12)); transition: transform .09s linear;
}
.orbe-halo { position: absolute; inset: -14px; border-radius: 50%; border: 2px solid var(--verde); opacity: calc(.12 + var(--nivel) * .6); transition: opacity .09s; }
.orbe-marca { display: grid; place-items: center; transform-origin: 50% 30%; }
/* La etiqueta cuelga: cuando habla, se hamaca como una etiqueta de precio */
.modo-voz[data-estado="hablando"] .orbe-marca { animation: hamaca 1.6s ease-in-out infinite; }
.modo-voz[data-estado="pensando"] .voz-orbe { animation: respira 1.4s ease-in-out infinite; }
.modo-voz[data-estado="pausa"] .voz-orbe { opacity: .55; box-shadow: none; }
@keyframes hamaca { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes respira { 0%, 100% { transform: scale(.96); } 50% { transform: scale(1.03); } }
.voz-estado { font-size: 22px; font-weight: 760; font-stretch: 80%; margin: 0; }
.voz-texto { color: var(--gris); font-size: 16.5px; line-height: 1.5; margin: 0; max-height: 30vh; overflow-y: auto; }
.voz-pie .btn { min-width: 180px; border-radius: 999px; }

@media (max-width: 820px) {
  /* En la charla el botón del menú va arriba: abajo está el cuadro para escribir */
  .chat-body .menu-flotante { top: calc(12px + env(safe-area-inset-top)); left: 12px; right: auto; bottom: auto; }
  .chat-body .menu-panel { top: 62px; bottom: auto; left: 0; right: auto; transform-origin: 26px -20px; }
  .chat-body { padding-bottom: 0 !important; }
  .chat-body .fab { width: 46px; height: 46px; border-radius: 16px; }
  .mensajes { padding: 72px 14px 10px; }
  .saludo, .chips { padding-left: 16px; padding-right: 16px; }
  .compositor { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  body.vacio .chat { justify-content: flex-end; padding-bottom: 0; }
  body.vacio .saludo { margin-bottom: 18px; }
  body.vacio .chips { padding-bottom: calc(10px + env(safe-area-inset-bottom)); order: 3; }
  body.vacio .compositor { padding-bottom: 6px; }
  .voz-orbe { width: 180px; height: 180px; }
}
/* ajustes después de revisar las capturas */
.compositor textarea { height: 44px; padding: 11px 6px; }
body.vacio #banner-avisos .banner { margin: 0 20px 28px; }
@media (max-width: 820px) {
  body.vacio .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0; padding-top: 10px; }
  body.vacio .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  body.vacio #banner-avisos .banner { margin: 0 12px 20px; }
}
.banner-cerrar { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; color: var(--gris); display: grid; place-items: center; padding: 0; cursor: pointer; margin-left: auto; }
.banner-cerrar:hover { background: var(--papel); color: var(--tinta); }
.banner-cerrar .ico { width: 18px; height: 18px; }
.modo-voz[data-estado="vivo"] .voz-orbe { box-shadow: 0 20px 60px rgba(14, 107, 78, .22); }
.modo-voz[data-estado="revisando"] .voz-orbe, .modo-voz[data-estado="conectando"] .voz-orbe { animation: respira 1.4s ease-in-out infinite; }
@media (max-width: 820px) {
  /* en la charla, el aviso no queda debajo del botón del menú */
  body.chat-body:not(.vacio) #banner-avisos .banner { margin: 70px 12px 0; }
  .banner:has(.banner-cerrar) { flex-wrap: nowrap; align-items: flex-start; }
  .banner:has(.btn):has(.banner-cerrar) { flex-wrap: wrap; }
}

/* =====================================================================
   CATÁLOGO del comercio adherido (solo delivery)
   ===================================================================== */
.cat-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-acciones label.btn { cursor: pointer; }
.banner.ok > .ico { color: var(--verde); }
.banner a.btn { margin-left: auto; flex: none; }
#aviso-tienda .banner { margin: 0 0 16px; }
.cat-filtros { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.cat-filtros .input { flex: 1; min-width: 220px; }
.segmento { display: inline-flex; background: var(--blanco); border: 1px solid var(--linea); border-radius: 999px; padding: 3px; }
.segmento button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--gris); cursor: pointer; }
.segmento button.activo { background: var(--tinta); color: #fff; }
.cat-lista { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-panel); overflow: hidden; }
.cat-fila { display: grid; grid-template-columns: 52px minmax(0, 1fr) 132px 112px; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--linea-suave); }
.cat-fila:last-child { border-bottom: 0; }
.cat-fila.agotado .cat-foto, .cat-fila.agotado .cat-info b { opacity: .45; }
.cat-foto { width: 52px; height: 52px; border-radius: 12px; background: var(--papel); display: grid; place-items: center; overflow: hidden; color: var(--gris); }
.cat-foto img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cat-info { min-width: 0; }
.cat-info b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-info small { color: var(--gris); font-size: 13.5px; }
.cat-precio { display: flex; align-items: center; gap: 4px; margin: 0; border: 1.5px solid var(--linea); border-radius: 10px; padding: 0 10px; background: var(--blanco); }
.cat-precio:focus-within { border-color: var(--verde); }
.cat-precio span { color: var(--gris); font-weight: 600; }
.cat-precio input { border: 0; outline: none; width: 100%; padding: 9px 0; font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; background: none; }
.switch-mini { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; cursor: pointer; justify-self: end; }
.switch-mini input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--linea); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch-mini input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch-mini input:checked { background: var(--verde); }
.switch-mini input:checked::after { transform: translateX(16px); }
.switch-mini span { min-width: 58px; color: var(--gris); }
.switch-mini input:checked + span { color: var(--verde); }
.cat-vacio { padding: 48px 24px; text-align: center; max-width: 520px; margin: 0 auto; }
.cat-vacio > .ico { width: 44px; height: 44px; color: var(--verde); margin-bottom: 10px; }
.cat-vacio h2 { font-size: 28px; margin-bottom: 8px; }
.cat-vacio p { color: var(--gris); margin-bottom: 20px; }
@media (max-width: 820px) {
  .cat-fila { grid-template-columns: 46px minmax(0, 1fr) 96px; grid-template-areas: "foto info info" "foto precio hay"; row-gap: 8px; }
  .cat-foto { grid-area: foto; width: 46px; height: 46px; align-self: start; }
  .cat-info { grid-area: info; } .cat-precio { grid-area: precio; } .switch-mini { grid-area: hay; }
  .cat-acciones { width: 100%; } .cat-acciones .btn { flex: 1; }
}
/* Registro: elegir cómo usar Vala */
.modos { border: 0; padding: 0; margin: 4px 0 6px; display: grid; gap: 8px; }
.modos legend { font-size: 14px; font-weight: 560; margin-bottom: 6px; }
.modo { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--linea); border-radius: 12px; margin: 0; cursor: pointer; font-weight: 400; }
.modo:has(input:checked) { border-color: var(--verde); background: var(--verde-claro); }
.modo input { width: 18px; height: 18px; accent-color: var(--verde); margin-top: 3px; flex: none; }
.modo b { display: block; font-weight: 700; }
.modo small { color: var(--gris); font-size: 13.5px; line-height: 1.4; display: block; }
.cat-acciones label.btn { margin: 0; }
.cat-foto { position: relative; }
.cat-foto img { position: absolute; inset: 0; }
button.cat-foto { border: 1px solid var(--linea-suave); padding: 0; cursor: pointer; }
.cat-cam { position: absolute; right: 2px; bottom: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--blanco); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.cat-cam .ico { width: 12px; height: 12px; color: var(--verde); }
.cat-foto.procesando::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.7) ; }
.cat-foto.procesando::before { content: ''; position: absolute; z-index: 1; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--verde); border-right-color: transparent; animation: girar .9s linear infinite; }
.accion.corta .acc-items > *:nth-child(n+5) { display: none; }
.acc-ver-mas { display: block; width: 100%; border: 0; border-top: 1px solid var(--linea-suave); background: none; padding: 10px 16px; text-align: left; font: inherit; font-weight: 600; color: var(--verde); cursor: pointer; }

/* =====================================================================
   Movimiento y terminaciones (botones vivos, entrada de página)
   ===================================================================== */
.btn { transition: transform .16s ease, box-shadow .16s ease, background .16s, border-color .16s, color .16s; position: relative; overflow: hidden; }
@media (hover: hover) {
  .btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(19, 34, 30, .10); }
  .btn.primario:not(:disabled):hover { box-shadow: 0 8px 20px color-mix(in srgb, var(--verde) 35%, transparent); }
}
.btn:not(:disabled):active { transform: scale(.97); box-shadow: none; }
.btn.primario { background: linear-gradient(180deg, color-mix(in srgb, var(--verde) 88%, #fff), var(--verde)); }
.btn.primario::after { /* brillo que cruza al pasar el mouse */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-110%); transition: transform .55s ease;
}
.btn.primario:hover::after { transform: translateX(110%); }
.btn .ico { transition: transform .2s ease; }
.btn:hover .ico { transform: scale(1.1); }

/* Tablas como tarjetas elevadas */
table.tabla { border-color: var(--linea-suave); box-shadow: 0 1px 2px rgba(19, 34, 30, .04), 0 8px 24px rgba(19, 34, 30, .05); border-radius: 18px; }
.tabla td { transition: background .15s; }
.tabla tr.click:active td { background: var(--verde-claro); }

/* Menú: íconos en mosaicos de color, movimiento al pasar */
.menu-items a .ico { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--verde-claro); transition: transform .2s ease, background .2s, color .2s; }
.menu-items a { transition: background .15s, transform .15s; }
.menu-items a:hover { transform: translateX(3px); }
.menu-items a:hover .ico { transform: rotate(-6deg) scale(1.06); }
.menu-items a.activo .ico { background: var(--verde); color: #fff; }
.fab:active { transform: scale(.94); }

/* Campos */
.input { transition: border-color .15s, box-shadow .2s; }

/* Entrada de cada página: una sola cascada corta */
.pagina > * { animation: pagina-entra .42s cubic-bezier(.2, .8, .2, 1) both; }
.pagina > :nth-child(2) { animation-delay: .05s; }
.pagina > :nth-child(3) { animation-delay: .1s; }
.pagina > :nth-child(4) { animation-delay: .15s; }
.pagina > :nth-child(n+5) { animation-delay: .2s; }
@keyframes pagina-entra { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  .pagina > *, .menu-items a { animation: none !important; }
  .btn, .btn .ico, .menu-items a, .menu-items a .ico, .btn.primario::after { transition: none !important; }
}

/* ---------- Catálogo: ofertas y promociones ---------- */
.btn.chico { padding: 6px 12px; font-size: 14px; min-height: 0; }
.chip-oferta {
  margin-top: 4px; border: 1px dashed var(--linea); background: none; border-radius: 999px; padding: 2px 10px;
  font: inherit; font-size: 12.5px; font-weight: 650; color: var(--gris); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.chip-oferta:hover { border-color: var(--verde); color: var(--verde); }
.chip-oferta.activa { border: 0; background: #FFE8D6; color: #A3440B; }
.o-rapidos { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.promos-dueno { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-panel); padding: 16px 18px; margin-bottom: 16px; }
.promos-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.promos-cab h2 { font-size: 22px; }
.promos-cab p { color: var(--gris); font-size: 14px; margin-top: 2px; }
.promos-lista { display: flex; gap: 10px; overflow-x: auto; margin-top: 12px; padding-bottom: 2px; }
.promos-lista .nota { margin: 0; }
.promo-dueno {
  flex: none; min-width: 240px; max-width: 320px; display: flex; gap: 12px; justify-content: space-between; align-items: flex-start;
  padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, #FFF3E6, #FFE3CF); border: 1px solid #F6D2B5;
}
.promo-dueno b { display: block; font-weight: 760; }
.promo-dueno small { display: block; font-size: 13px; color: #6B4A33; }
.promo-dueno small.gris { color: var(--gris); margin-top: 4px; }

/* =====================================================================
   Portada: Vala IA te recibe
   ===================================================================== */
body:has(#bienvenida) { background: #F7F9F8; overflow-x: hidden; }
.aura { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aura i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(70px); opacity: .32; animation: aura 18s ease-in-out infinite alternate; }
.aura i:nth-child(1) { background: #1747C9; left: -22vmax; top: -24vmax; }
.aura i:nth-child(2) { background: #1F8A5B; right: -24vmax; bottom: -26vmax; animation-delay: -6s; }
.aura i:nth-child(3) { background: #7FB6FF; left: 30%; top: 40%; width: 34vmax; height: 34vmax; opacity: .18; animation-delay: -12s; }
@keyframes aura { to { transform: translate(6vmax, 4vmax) scale(1.12); } }
body.con-auth .aura { opacity: .55; }

.bv { position: relative; z-index: 1; min-height: 100dvh; width: min(100%, 600px); margin: 0 auto; padding: 56px 20px 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center; }
.bv-orbe {
  width: 92px; height: 92px; border-radius: 30px; display: grid; place-items: center; margin-bottom: 26px;
  background: linear-gradient(140deg, #1747C9, #1F8A5B); box-shadow: 0 18px 40px rgba(23, 71, 201, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
  animation: respira 3.6s ease-in-out infinite;
}
.bv-orbe .marca-svg path:first-of-type { fill: #fff; }
.bv-orbe .marca-svg circle { fill: #1747C9; }
.bv-orbe .marca-svg path:last-of-type { stroke: #1747C9; }
@keyframes respira { 50% { transform: scale(1.05) rotate(-3deg); box-shadow: 0 26px 56px rgba(31, 138, 91, .32), inset 0 1px 0 rgba(255, 255, 255, .35); } }
.bv-titulo { font-size: clamp(42px, 9vw, 68px); font-stretch: 68%; font-weight: 880; line-height: .98; letter-spacing: -.01em; color: var(--tinta); }
.bv-sub { font-size: clamp(19px, 4.4vw, 23px); color: #3F5149; margin-top: 12px; font-weight: 520; }

.bv-chat { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.bv-chat:empty { display: none; }
.bv-msg { max-width: 86%; padding: 12px 16px; border-radius: 20px; font-size: 16.5px; line-height: 1.4; text-align: left; animation: msg .3s cubic-bezier(.2, .9, .3, 1.2); }
.bv-msg.yo { align-self: flex-end; background: var(--tinta); color: #fff; border-bottom-right-radius: 6px; }
.bv-msg.vala { align-self: flex-start; background: #fff; color: var(--tinta); border-bottom-left-radius: 6px; box-shadow: 0 4px 16px rgba(16, 34, 27, .08); }
@keyframes msg { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.bv-puntos { display: inline-flex; gap: 5px; padding: 4px 0; }
.bv-puntos i { width: 7px; height: 7px; border-radius: 50%; background: #9AA8A2; animation: punto 1s infinite; }
.bv-puntos i:nth-child(2) { animation-delay: .15s; } .bv-puntos i:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 50% { transform: translateY(-4px); background: var(--tinta); } }

.bv-compositor {
  width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 26px; padding: 7px 7px 7px 20px; border-radius: 999px;
  background: #fff; box-shadow: 0 10px 34px rgba(16, 34, 27, .12), 0 0 0 1px rgba(16, 34, 27, .06); transition: box-shadow .2s;
}
.bv-compositor:focus-within { box-shadow: 0 12px 40px rgba(23, 71, 201, .18), 0 0 0 2px #1747C9; }
.bv-compositor input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 17px; padding: 10px 0; color: var(--tinta); }
.bv-enviar { width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--tinta); color: #fff; transition: transform .15s, background .2s; }
.bv-enviar .ico { width: 22px; height: 22px; stroke-width: 2.4; }
.bv-enviar:hover { background: #1747C9; } .bv-enviar:active { transform: scale(.9); }

.bv-tarjetas { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.bv-tarjeta {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 6px;
  min-height: 196px; padding: 20px 18px; border: 0; border-radius: 26px; color: #fff; text-decoration: none; font: inherit; cursor: pointer;
  transition: transform .2s cubic-bezier(.2, .9, .3, 1.2), box-shadow .2s;
  animation: tarjeta-entra .6s cubic-bezier(.2, .8, .2, 1) both;
}
.bv-delivery { background: linear-gradient(150deg, #2F63F0, #1236A8); box-shadow: 0 14px 30px rgba(23, 71, 201, .3); }
.bv-sistema { background: linear-gradient(150deg, #27A06C, #12603F); box-shadow: 0 14px 30px rgba(31, 138, 91, .3); animation-delay: .08s; }
@keyframes tarjeta-entra { from { opacity: 0; transform: translateY(18px); } }
.bv-tarjeta::after { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -60px; bottom: -70px; background: rgba(255, 255, 255, .1); transition: transform .4s; }
.bv-ico { width: 54px; height: 54px; border-radius: 18px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; margin-bottom: auto; }
.bv-ico .ico { width: 30px; height: 30px; color: #fff; }
.bv-tarjeta b { font-size: 27px; font-stretch: 72%; font-weight: 860; line-height: 1; margin-top: 18px; }
.bv-tarjeta small { font-size: 14.5px; line-height: 1.35; opacity: .88; }
@media (hover: hover) { .bv-tarjeta:hover { transform: translateY(-4px); } .bv-tarjeta:hover::after { transform: scale(1.25); } }
.bv-tarjeta:active { transform: scale(.97); }
body.charlando .bv-tarjetas { opacity: .5; pointer-events: none; transition: opacity .3s; }

.bv-auth { position: relative; z-index: 1; min-height: 100dvh; display: grid; place-items: center; padding: 70px 20px 40px; }
.bv-card { background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); border-radius: 26px; padding: 30px 26px; box-shadow: 0 20px 50px rgba(16, 34, 27, .12); animation: msg .35s ease-out; }
.bv-card .logo { display: inline-flex !important; }
.bv-volver { position: fixed; top: 18px; left: 18px; z-index: 2; display: flex; align-items: center; gap: 6px; border: 0; background: #fff; border-radius: 999px;
  padding: 10px 16px 10px 12px; font: inherit; font-weight: 650; cursor: pointer; box-shadow: 0 6px 18px rgba(16, 34, 27, .1); }
.bv-volver .ico { width: 18px; height: 18px; }
@media (max-width: 380px) { .bv-tarjeta { min-height: 178px; padding: 16px 14px; } .bv-tarjeta b { font-size: 23px; } }
@media (prefers-reduced-motion: reduce) { .aura i, .bv-orbe, .bv-tarjeta, .bv-msg, .bv-puntos i { animation: none !important; } }

/* Logo del local (Delivery) */
.logo-local { display: flex; gap: 16px; align-items: center; padding: 6px 0 14px; border-bottom: 1px solid var(--linea-suave); margin-bottom: 6px; flex-wrap: wrap; }
.logo-local b { display: block; font-weight: 700; }
.logo-local small { display: block; color: var(--gris); font-size: 14px; max-width: 46ch; }
.logo-local label.btn { margin: 0; cursor: pointer; }
.logo-prev { position: relative; width: 150px; height: 84px; border-radius: 16px; overflow: hidden; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #1747C9, #0F2E86); color: #fff; font-size: 44px; font-weight: 900; font-stretch: 65%; }
.logo-prev img { width: 100%; height: 100%; object-fit: cover; }
.logo-prev.procesando::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.65); }
.logo-prev.procesando::before { content: ''; position: absolute; z-index: 1; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--verde); border-right-color: transparent; animation: girar .9s linear infinite; }
.bv[hidden], .bv-auth[hidden] { display: none; }
.bv .ico, .bv-volver .ico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bv-enviar .ico { stroke-width: 2.5; }

/* Limpiar el chat del Encargado */
.chat-limpiar { position: fixed; z-index: 40; top: 18px; right: 18px; display: flex; align-items: center; gap: 7px; height: 52px; padding: 0 18px 0 15px;
  border: 1px solid var(--linea); border-radius: 18px; background: var(--blanco); color: var(--tinta); font: inherit; font-weight: 650; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(19, 34, 30, .10); transition: transform .18s ease, box-shadow .18s, color .15s; }
.chat-limpiar .ico { width: 20px; height: 20px; }
.chat-limpiar:hover { color: var(--rojo); transform: translateY(-1px); box-shadow: 0 10px 26px rgba(19, 34, 30, .16); }
.chat-limpiar:active { transform: scale(.94); }
body.vacio .chat-limpiar { display: none; }
@media (max-width: 600px) { .chat-limpiar { width: 52px; padding: 0; justify-content: center; } .chat-limpiar span { display: none; } }
.bv-limpiar { align-self: flex-end; display: flex; align-items: center; gap: 6px; margin-top: 16px; border: 0; background: #fff; border-radius: 999px; padding: 7px 13px;
  font: inherit; font-size: 14px; font-weight: 650; color: var(--tinta); cursor: pointer; box-shadow: 0 2px 10px rgba(16, 34, 27, .08); }
.bv-limpiar:hover { color: var(--rojo); }
.bv-limpiar[hidden] { display: none; }
.bv-limpiar .ico { width: 17px; height: 17px; }

/* =====================================================================
   Legales: términos, privacidad, arrepentimiento y baja
   ===================================================================== */
body.legal-body { background: #F7F9F8; min-height: 100dvh; }
.legal-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px; background: rgba(247, 249, 248, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linea-suave); }
.legal-marca { font-size: 28px; font-weight: 900; font-stretch: 70%; font-style: italic; color: var(--verde); text-decoration: none; }
.legal-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.legal-nav a { padding: 7px 12px; border-radius: 999px; background: var(--blanco); border: 1px solid var(--linea); color: var(--tinta); text-decoration: none; font-weight: 600; font-size: 14px; }
.legal { max-width: 760px; margin: 0 auto; padding: 22px 20px 60px; }
.legal article { background: var(--blanco); border: 1px solid var(--linea); border-radius: 22px; padding: 26px 24px; margin-top: 18px; scroll-margin-top: 80px; }
.legal h1 { font-size: clamp(26px, 5vw, 34px); font-stretch: 75%; line-height: 1.05; margin-bottom: 14px; }
.legal h2 { font-size: 18px; margin: 22px 0 6px; }
.legal p, .legal li { font-size: 16px; line-height: 1.62; color: #2B3A34; max-width: 68ch; }
.legal ul { padding-left: 20px; display: grid; gap: 6px; }
.legal a { color: var(--verde); font-weight: 600; text-underline-offset: 3px; }
.legal-resumen { background: var(--verde-claro); border-radius: 14px; padding: 14px 16px; }
.legal-aaip { font-size: 14px !important; color: var(--gris) !important; border-left: 3px solid var(--linea); padding-left: 12px; }
.legal-quien { margin-top: 18px; font-size: 15px; line-height: 1.55; color: #2B3A34; }
.legal-fecha { color: var(--gris); font-size: 14px; margin-top: 6px; }
.legal-botones, .bv-legal, .pie-legal, .seg-legal { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.legal-boton, .bv-boton-legal, .boton-legal {
  display: inline-flex; align-items: center; padding: 10px 16px; border-radius: 999px; font-weight: 750; font-size: 14.5px; text-decoration: none;
  background: var(--tinta); color: #fff !important; transition: transform .15s; }
.legal-boton.suave { background: var(--blanco); color: var(--tinta) !important; border: 1px solid var(--linea); }
.legal-boton:active, .bv-boton-legal:active, .boton-legal:active { transform: scale(.97); }
.legal-pie { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 20px; font-size: 14px; }
.legal-pie a { color: var(--gris); font-weight: 600; }

.bv-legal { position: relative; z-index: 1; justify-content: center; margin-top: 26px; }
.bv-legal span, .pie-legal span, .seg-legal span { flex-basis: 100%; text-align: center; font-size: 13.5px; color: var(--gris); margin-top: 2px; }
.bv-legal span a, .pie-legal span a, .seg-legal span a { color: var(--gris); font-weight: 600; }
.seg-legal { justify-content: center; margin: 4px 0 8px; }
.seg-legal .boton-legal { background: var(--blanco); color: var(--tinta) !important; border: 1px solid var(--linea); }

.arrep-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.arrep-tabs button { flex: none; border: 1px solid var(--linea); background: var(--blanco); border-radius: 999px; padding: 9px 14px; font: inherit; font-weight: 650; font-size: 14.5px; cursor: pointer; color: var(--tinta); }
.arrep-tabs button.activo { background: var(--tinta); color: #fff; border-color: var(--tinta); }
#formulario { background: var(--blanco); border: 1px solid var(--linea); border-radius: 22px; padding: 26px 22px; margin-top: 14px; }
.arrep-intro { color: #3F5149; margin-bottom: 16px; }
.arrep-form { display: grid; gap: 12px; }
.arrep-form label { display: grid; gap: 6px; font-weight: 650; font-size: 15px; }
.arrep-ok { text-align: center; display: grid; justify-items: center; gap: 8px; }
.arrep-ok-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--verde-claro); color: var(--verde); }
.arrep-ok-ico .ico { width: 34px; height: 34px; }
.arrep-codigo { font-size: 34px; font-weight: 900; letter-spacing: .06em; padding: 10px 22px; border-radius: 16px; background: var(--verde-claro); color: var(--verde); font-variant-numeric: tabular-nums; }

/* Aceptar términos al registrarse */
.acepto { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: #3F5149; margin: 4px 0 12px; font-weight: 500; }
.acepto input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--verde); flex: none; }
.acepto a { color: var(--verde); font-weight: 650; }

/* Avisos de pedido (página de seguimiento) */
.avisos-cli { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.avisos-cli > div { flex: 1; min-width: 180px; }
.avisos-cli b { display: block; font-size: 16px; }
.avisos-cli small { color: var(--gris); font-size: 14px; line-height: 1.4; display: block; margin-top: 2px; }
.avisos-ico { width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--verde-claro); color: var(--verde); display: grid; place-items: center; }
.avisos-ico .ico { width: 24px; height: 24px; }
.avisos-on { display: flex; gap: 8px; align-items: center; }
.avisos-on .ico { width: 18px; height: 18px; flex: none; }

/* Aviso por WhatsApp en cada pedido (Delivery) */
.ped-avisar { width: 100%; justify-content: center; margin-top: 8px; }
.ped-papeles { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ped-papeles .btn { flex: 1; justify-content: center; }

/* =====================================================================
   Avisos del Encargado (stock, caja, reclamos) en la pantalla principal
   ===================================================================== */
.avisos-enc { display: grid; gap: 10px; padding: 4px 20px 10px; max-height: 38vh; overflow-y: auto; }
.avisos-enc[hidden] { display: none; }
body.vacio .avisos-enc { margin-bottom: 18px; max-height: none; }
.aviso-enc { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 40px 14px 14px; border-radius: 18px;
  background: var(--blanco); border: 1px solid var(--linea); box-shadow: 0 6px 18px rgba(19, 34, 30, .07);
  transition: opacity .25s, transform .25s; }
.aviso-enc.nuevo { animation: aviso-entra .45s cubic-bezier(.2, .9, .3, 1.2); }
.aviso-enc.saliendo { opacity: 0; transform: translateX(16px); }
@keyframes aviso-entra { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.aviso-ico { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--verde-claro); color: var(--verde); }
.aviso-ico .ico { width: 22px; height: 22px; }
.aviso-enc.stock .aviso-ico { background: #FFF1D6; color: #9A5B00; }
.aviso-enc.caja .aviso-ico, .aviso-enc.reclamo .aviso-ico { background: #FDE7E4; color: var(--rojo); }
.aviso-cuerpo { flex: 1; min-width: 0; }
.aviso-cuerpo b { display: block; font-weight: 720; line-height: 1.3; }
.aviso-cuerpo small { display: block; color: var(--gris); font-size: 14px; margin-top: 3px; line-height: 1.4; }
.aviso-botones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.aviso-x { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--gris);
  display: grid; place-items: center; cursor: pointer; }
.aviso-x:hover { background: var(--papel); color: var(--tinta); }
.aviso-x .ico { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { .aviso-enc.nuevo { animation: none; } }
.foto-billetes { width: 100%; justify-content: center; margin: 10px 0 4px; cursor: pointer; }
.detalle-billetes:empty { display: none; }
.detalle-billetes { margin: 6px 0; }

/* ---------- Tu plan ---------- */
.plan-tarjeta { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r-panel); padding: 24px; margin-bottom: 18px; }
.plan-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.plan-cab small { display: block; color: var(--gris); font-size: 14px; }
.plan-cab b { font-size: 28px; line-height: 1.1; }
.plan-precio { text-align: right; }
.plan-precio b { font-size: 34px; font-variant-numeric: tabular-nums; }
.plan-estado { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 4px; padding: 12px 14px; border-radius: var(--r-control); background: var(--papel); font-weight: 600; }
.plan-estado .ico { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.plan-estado.ok { background: var(--verde-claro); color: var(--verde-osc); }
.plan-estado.mal { background: var(--rojo-claro); color: var(--rojo); }
.plan-incluye { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.plan-incluye li { display: flex; gap: 10px; align-items: center; }
.plan-incluye .ico { width: 18px; height: 18px; color: var(--verde); flex: none; }
.plan-activar { display: grid; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--linea-suave); }
.plan-activar label { font-weight: 600; font-size: 14px; }
.plan-activar .btn.grande { justify-content: center; padding: 14px; font-size: 17px; }
.plan-activar small { color: var(--gris); font-size: 13.5px; }
.plan-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--linea-suave); color: var(--gris); font-size: 14px; }
.plan-pago { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linea-suave); }
.plan-pago small { display: block; color: var(--gris); font-size: 13px; }
.plan-pago .nota { margin: 0; }
.banner-plan { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border-radius: var(--r-control); background: var(--etiqueta); color: var(--tinta); font-weight: 600; text-decoration: none; }
.banner-plan.mal { background: var(--rojo-claro); color: var(--rojo); }
.banner-plan .ico { width: 18px; height: 18px; flex: none; }
.banner-plan span { flex: 1; }
.banner-plan u { white-space: nowrap; }
/* Factura C de Vala */
.factura-vala { border: 1px solid var(--linea); border-radius: 12px; padding: 18px; font-size: 14px; background: #fff; }
.fv-cab { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--linea); }
.fv-cab small, .fv-rec small { display: block; color: var(--gris); font-size: 12.5px; line-height: 1.4; }
.fv-letra { width: 52px; height: 52px; border: 2px solid var(--tinta); border-radius: 8px; display: grid; place-items: center; font-size: 28px; font-weight: 800; line-height: 1; padding-top: 4px; }
.fv-letra small { font-size: 9px; font-weight: 600; }
.fv-num { text-align: right; }
.fv-rec { padding: 12px 0; border-bottom: 1px solid var(--linea); }
.fv-linea, .fv-total { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; }
.fv-total { border-top: 1px solid var(--linea); font-size: 17px; }
.fv-pie { display: flex; gap: 14px; align-items: center; padding-top: 12px; border-top: 1px solid var(--linea); }
.fv-pie svg { width: 92px; height: 92px; flex: none; }
@media print {
  body.imprimiendo-factura > *:not(.modal-bg) { display: none !important; }
  body.imprimiendo-factura .modal-bg { position: static; background: none; }
  body.imprimiendo-factura .modal .botones { display: none; }
  body.imprimiendo-factura .modal { box-shadow: none; max-width: none; }
}
@media (max-width: 520px) {
  .plan-precio { text-align: left; display: flex; align-items: baseline; gap: 6px; }
  .fv-cab { grid-template-columns: 1fr auto; }
  .fv-num { grid-column: 1 / -1; text-align: left; }
}
.com-deuda { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; margin: 6px 0 12px; border-radius: var(--r-control); background: var(--etiqueta); }
.com-deuda.mal { background: var(--rojo-claro); }
.com-deuda small { display: block; color: var(--gris); font-size: 13px; }
.com-semana { padding: 14px; border-radius: var(--r-control); background: var(--papel); }
.com-semana > small { color: var(--gris); font-size: 13px; }
.com-cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.com-cifras b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.com-cifras small { color: var(--gris); font-size: 12.5px; }
.com-tit { font-size: 16px; margin: 18px 0 2px; }
@media (max-width: 520px) { .com-cifras { grid-template-columns: repeat(2, 1fr); } }
.ped-vala { color: var(--gris); } .ped-vala small { font-size: 12px; }
