/* Identidad (la de la carta impresa de Medina): bordó, blanco y grises.
   Verde = aprobado, rojo = lo que no va, naranja = pendiente. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --ink: #1e1e1e;
  --ink-2: #3f3f3f;
  --muted: #6b6b6b;
  --line: #e2e2e2;
  --accent: #86061c;          /* bordó del recuadro "MENÚ DEL DÍA" */
  --accent-hover: #6b0416;
  --accent-ink: #ffffff;      /* texto sobre bordó */
  --accent-soft: #f7e6e9;
  --accent-texto: #86061c;
  --bar: #86061c;
  --ok: #15803d;
  --ok-soft: #e3f4e8;
  --warn: #b45309;
  --warn-soft: #fdf0e1;
  --danger: #c62828;
  --danger-soft: #fdeaea;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 6px 20px rgb(0 0 0 / .05);
  /* Margen lateral: 16px, o más si el celular tiene notch en horizontal */
  --gutter-izq: max(16px, env(safe-area-inset-left, 0px));
  --gutter-der: max(16px, env(safe-area-inset-right, 0px));
  --alto-barra: 5.5rem;
  --wa-verde: #1a8d4e;
  --wa-verde-hover: #157341;
  --wa-burbuja: #dcf6c8;
  --wa-tinta: #142019;
  color-scheme: light;
}
/* Modo noche: sigue al teléfono, salvo que se elija con la lamparita (data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d;
    --surface: #171717;
    --surface-2: #232323;
    --ink: #f5f5f5;
    --ink-2: #cfcfcf;
    --muted: #9a9a9a;
    --line: #2e2e2e;
    --accent: #e0707f;
    --accent-hover: #ea8d99;
    --accent-ink: #1a0207;
    --accent-soft: #3a0f17;
    --accent-texto: #f08c9a;
    --bar: #e0707f;
    --ok: #4ade80;
    --ok-soft: #12301d;
    --warn: #f59e0b;
    --warn-soft: #33240b;
    --danger: #f87171;
    --danger-soft: #3a1515;
    --shadow: none;
    --wa-burbuja: #1f4a36;
    --wa-tinta: #e8f2ec;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0d;
  --surface: #171717;
  --surface-2: #232323;
  --ink: #f5f5f5;
  --ink-2: #cfcfcf;
  --muted: #9a9a9a;
  --line: #2e2e2e;
  --accent: #e0707f;
  --accent-hover: #ea8d99;
  --accent-ink: #1a0207;
  --accent-soft: #3a0f17;
  --accent-texto: #f08c9a;
  --bar: #e0707f;
  --ok: #4ade80;
  --ok-soft: #12301d;
  --warn: #f59e0b;
  --warn-soft: #33240b;
  --danger: #f87171;
  --danger-soft: #3a1515;
  --shadow: none;
  --wa-burbuja: #1f4a36;
  --wa-tinta: #e8f2ec;
  color-scheme: dark;
}

/* Lamparita día / noche */
.btn-tema {
  flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  display: inline-grid; place-items: center; cursor: pointer; touch-action: manipulation;
  transition: background-color .2s, border-color .2s;
}
.btn-tema svg { width: 24px; height: 24px; display: block; }
.btn-tema .foco-off { display: none; }
:root[data-theme="dark"] .btn-tema .foco-on { display: none; }
:root[data-theme="dark"] .btn-tema .foco-off { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-tema .foco-on { display: none; }
  :root:not([data-theme="light"]) .btn-tema .foco-off { display: block; }
}
@media (hover: hover) { .btn-tema:hover { border-color: var(--muted); } }
.btn-tema:active { transform: scale(.94); }
body { transition: background-color .25s, color .25s; }
@media (prefers-reduced-motion: reduce) { body, .btn-tema { transition: none; } }

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Al enfocar un campo, que no quede tapado por la barra fija de abajo */
  scroll-padding-bottom: calc(var(--alto-barra) + 1rem);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere;
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.5rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--accent-texto); }
/* 16px en los campos evita que el iPhone haga zoom al tocarlos */
button, input, select, textarea { font: inherit; font-size: max(16px, 1em); color: inherit; }
button, .btn, [role="tab"], label { touch-action: manipulation; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ── Controles ── */
.btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: .55rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  text-decoration: none;
  white-space: nowrap;
  min-height: 42px;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primario { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-peligro { color: var(--danger); }
.btn-grande { font-size: 1.15rem; padding: .95rem 1.4rem; border-radius: 14px; width: 100%; min-height: 56px; white-space: normal; }
.btn-chico { padding: .3rem .7rem; font-size: .88rem; border-radius: 8px; min-height: 34px; }
@media (hover: hover) {
  .btn:hover { background: var(--surface-2); }
  .btn-primario:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn-peligro:hover { background: var(--danger-soft); }
}
/* En pantallas táctiles, todo lo que se toca tiene al menos ~44px */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-chico { min-height: 40px; padding: .45rem .85rem; }
}

.campo { display: flex; flex-direction: column; gap: .35rem; }
.campo > span { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: .6rem .75rem;
  outline: none;
  min-height: 44px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 4.5rem; }

.tarjeta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.aviso { border-radius: 10px; padding: .75rem 1rem; font-size: .95rem; }
.aviso-error { background: var(--danger-soft); color: var(--danger); }
.aviso-ok { background: var(--ok-soft); color: var(--ok); }
.aviso-info { background: var(--surface-2); color: var(--ink-2); }
.aviso-warn { background: var(--warn-soft); color: var(--warn); }

.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .78rem; font-weight: 600;
  border-radius: 999px; padding: .15rem .6rem;
  background: var(--surface-2); color: var(--ink-2);
  white-space: nowrap;
}
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-error { background: var(--danger-soft); color: var(--danger); }
.muted { color: var(--muted); }
.fila { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.entre { justify-content: space-between; }
.pila { display: flex; flex-direction: column; gap: 1rem; }

/* ── App de empleados ── */
.app-emp { min-height: 100vh; min-height: 100dvh; }
.cont-emp {
  max-width: 560px; margin: 0 auto;
  padding: 1.25rem var(--gutter-der) calc(var(--alto-barra) + 2rem) var(--gutter-izq);
}
.marca { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 800; }
.marca svg { color: var(--accent-texto); }
.marca svg { width: 28px; height: 28px; flex: none; }
.login { min-height: 80vh; min-height: 80dvh; display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; }
.login .input { font-size: 1.6rem; text-align: center; letter-spacing: .1em; padding: .8rem; }
.cab-emp { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.cab-emp > div { min-width: 0; }

.dias {
  display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none;
  /* Los días se deslizan hasta el borde de la pantalla, sin cortar el margen */
  margin: 0 calc(-1 * var(--gutter-der)) 0 calc(-1 * var(--gutter-izq));
  padding: .1rem var(--gutter-der) .25rem var(--gutter-izq);
  scroll-padding-inline: var(--gutter-izq);
  -webkit-overflow-scrolling: touch;
}
.dias::-webkit-scrollbar { display: none; }
.dia {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: .45rem .95rem; font-weight: 600; cursor: pointer; position: relative; min-height: 42px;
}
.dia[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dia .punto { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-left: .35rem; vertical-align: middle; }

.menus { display: flex; flex-direction: column; gap: .6rem; }
.menu {
  display: flex; gap: .9rem; align-items: center; text-align: left;
  border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: .95rem 1rem; cursor: pointer; width: 100%; min-height: 64px;
}
@media (hover: hover) { .menu:hover { border-color: var(--muted); } }
.menu:active { background: var(--surface-2); }
.menu[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.menu .num {
  flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
  background: var(--surface-2); color: var(--ink-2);
}
.menu[aria-checked="true"] .num { background: var(--accent); color: var(--accent-ink); }
.menu .desc { font-size: 1.05rem; font-weight: 600; }
.menu .tag { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.opcion { display: flex; flex-direction: column; scroll-margin-top: 1rem; scroll-margin-bottom: calc(var(--alto-barra) + 1rem); }
.opcion.elegida .menu { border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
.comentario {
  display: flex; flex-direction: column; gap: .4rem;
  border: 2px solid var(--accent); border-top: 0;
  background: var(--accent-soft);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: .1rem 1rem 1rem;
}
.comentario > span { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.comentario .textarea { min-height: 3.2rem; }

.barra-listo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: .75rem var(--gutter-der) calc(.75rem + env(safe-area-inset-bottom, 0px)) var(--gutter-izq);
  background: var(--bg);
  border-top: 1px solid var(--line);
}
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
  .barra-listo {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}
.barra-listo > div { max-width: 560px; margin: 0 auto; }

.dia .punto.pendiente { background: var(--warn); }
.btn-link { border: 0; background: none; color: var(--accent-texto); padding: .4rem .25rem; font-weight: 600; min-height: 44px; }
.btn-link:disabled { color: var(--muted); opacity: 1; }

/* Confirmación por WhatsApp */
.pasos { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .45rem; color: var(--ink-2); }
.burbuja-wa {
  background: var(--wa-burbuja); color: var(--wa-tinta);
  border-radius: 4px 14px 14px 14px; padding: .75rem .9rem;
  white-space: pre-line; font-size: .95rem; line-height: 1.45;
  box-shadow: 0 1px 1px rgb(0 0 0 / .08);
}
.btn-wa { background: var(--wa-verde); border-color: var(--wa-verde); color: #fff; gap: .6rem; }
@media (hover: hover) { .btn-wa:hover { background: var(--wa-verde-hover); border-color: var(--wa-verde-hover); } }

.exito { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding-top: 2rem; }
.exito .check {
  width: 84px; height: 84px; border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  display: grid; place-items: center;
}
.exito .check svg { width: 44px; height: 44px; }
.resumen-pedido { text-align: left; width: 100%; }
.resumen-pedido dt { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.resumen-pedido dd { margin: 0 0 .75rem; font-size: 1.05rem; font-weight: 600; }

.sin-conexion {
  position: fixed; left: 0; right: 0; top: 0; z-index: 30;
  padding: calc(.5rem + env(safe-area-inset-top, 0px)) var(--gutter-der) .5rem var(--gutter-izq);
  background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: .9rem; text-align: center;
}

/* ── Carta (lo que ven los empleados al entrar al link) ── */
.carta-barra {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.carta-barra-int {
  max-width: 720px; margin: 0 auto; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: 0 var(--gutter-der) 0 var(--gutter-izq);
}
.carta-marca { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.05rem; min-width: 0; }
.carta-marca span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carta-marca svg, .carta-marca img { width: 28px; height: 28px; flex: none; color: var(--accent-texto); border-radius: 8px; object-fit: cover; }
.marca-logo { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }

.carta-hero { position: relative; max-width: 720px; margin: .75rem auto 0; padding: 0 var(--gutter-der) 0 var(--gutter-izq); }
.carta-portada { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 18px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
.carta-hero.sin-foto::before {
  content: ""; display: block; aspect-ratio: 16 / 5; border-radius: 18px;
  background:
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent) 35%, transparent) 0 22%, transparent 23%),
    radial-gradient(circle at 70% 120%, color-mix(in srgb, var(--accent) 25%, transparent) 0 30%, transparent 31%),
    var(--accent-soft);
}
.carta-logo {
  position: absolute; left: calc(var(--gutter-izq) + 14px); bottom: -34px;
  width: 76px; height: 76px; border-radius: 18px; overflow: hidden;
  background: var(--surface); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line), var(--shadow);
  display: grid; place-items: center; color: var(--accent-texto);
}
.carta-logo img { width: 100%; height: 100%; object-fit: cover; }
.carta-logo svg { width: 40px; height: 40px; }
.carta-cont { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter-der) 0 var(--gutter-izq); }
.carta-intro { padding-top: 46px; display: flex; flex-direction: column; gap: .45rem; align-items: flex-start; }
.carta-intro h1 { font-size: 1.6rem; font-weight: 800; }

.carta-tabs {
  position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 15;
  background: var(--bg); margin-top: 1rem; border-bottom: 1px solid var(--line);
}
.carta-tabs-int {
  max-width: 720px; margin: 0 auto; display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--gutter-der) 0 var(--gutter-izq); -webkit-overflow-scrolling: touch;
}
.carta-tabs-int::-webkit-scrollbar { display: none; }
.carta-tab {
  flex: none; border: 0; background: none; cursor: pointer; white-space: nowrap; min-height: 48px;
  padding: .8rem .8rem .7rem; font-weight: 800; font-size: 1.02rem; color: var(--muted);
  border-bottom: 3px solid transparent;
}
.carta-tab[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }
@media (hover: hover) { .carta-tab:hover { color: var(--ink); } }
.carta-tab .punto { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-left: .35rem; vertical-align: middle; }
.carta-tab .punto.pendiente { background: var(--warn); }

.carta-lista { padding-top: 1.1rem; padding-bottom: 4rem; display: flex; flex-direction: column; gap: 1rem; }
.carta-seccion { font-size: 1.3rem; font-weight: 800; }
.tu-pedido { border-color: var(--accent); }

.entrada-dia {
  display: flex; gap: .85rem; align-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: .7rem .85rem;
}
/* Empresa cliente (por ejemplo Loginter) */
.cliente { display: inline-flex; align-items: center; gap: .55rem; font-size: .92rem; color: var(--ink-2); flex-wrap: wrap; }
.cliente img { height: 34px; width: auto; background: #fff; border-radius: 8px; padding: 4px 8px; box-shadow: 0 0 0 1px var(--line); }
.carta-pie {
  max-width: 720px; margin: 0 auto; padding: 1.5rem var(--gutter-der) calc(2rem + env(safe-area-inset-bottom, 0px)) var(--gutter-izq);
  border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: center;
  color: var(--muted); font-size: .88rem; text-align: center;
}
.carta-pie img { height: 30px; width: auto; background: #fff; border-radius: 6px; padding: 3px 6px; }
.entrada-foto { flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--surface); display: grid; place-items: center; color: var(--accent-texto); }
.entrada-foto img { width: 100%; height: 100%; object-fit: cover; }
.entrada-foto svg { width: 30px; height: 30px; }
.entrada-nombre { font-size: 1.05rem; }
.platos { list-style: none; margin: 0; padding: 0; }
.platos li + li { border-top: 1px solid var(--line); }
.plato {
  width: 100%; display: flex; gap: 1rem; align-items: center; text-align: left;
  background: none; border: 0; padding: 1rem 0; cursor: pointer; color: inherit;
}
.plato:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
.plato-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.plato-tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.plato-tag b { color: var(--accent-texto); }
.plato-nombre { font-size: 1.12rem; font-weight: 800; line-height: 1.25; display: flex; gap: .35rem; align-items: flex-start; }
.plato-detalle { color: var(--muted); font-size: .95rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.plato-precio { font-weight: 800; font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.plato-foto {
  flex: none; width: 104px; height: 104px; border-radius: 14px; overflow: hidden;
  background: var(--surface-2); display: grid; place-items: center; color: var(--muted);
}
.plato-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plato-foto svg { width: 40px; height: 40px; opacity: .55; }
@media (min-width: 560px) { .plato-foto { width: 120px; height: 120px; } }
.plato.pedido .plato-foto { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .plato:hover .plato-nombre { color: var(--accent-texto); } }
.estrella svg { width: 18px; height: 18px; display: block; margin-top: .15rem; }

/* Detalle del plato: sube desde abajo en el celular, ventana centrada en la PC */
body.sin-scroll { overflow: hidden; }
dialog.hoja {
  padding: 0; border: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh;
  border-radius: 22px 22px 0 0; background: var(--surface); color: var(--ink); overflow-y: auto;
}
@media (min-width: 640px) { dialog.hoja { margin: auto; border-radius: 22px; } }
dialog.hoja::backdrop { background: rgb(0 0 0 / .55); }
dialog.hoja[open] { animation: hoja-subir .22s ease-out; }
@keyframes hoja-subir { from { transform: translateY(28px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { dialog.hoja[open] { animation: none; } }
.hoja-cont { position: relative; padding-bottom: env(safe-area-inset-bottom, 0px); }
.hoja-cerrar {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgb(0 0 0 / .55); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.hoja-cerrar svg { width: 22px; height: 22px; }
.hoja-foto { position: relative; }
.foto-credito {
  position: absolute; right: 8px; bottom: 8px; max-width: calc(100% - 16px);
  background: rgb(0 0 0 / .55); color: #fff; font-size: .7rem; line-height: 1.3;
  padding: .15rem .45rem; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.foto-credito a { color: #fff; text-decoration: none; }
.hoja-foto { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.hoja-foto.sin-foto { aspect-ratio: 16 / 6; }
.hoja-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hoja-foto svg { width: 64px; height: 64px; opacity: .5; }
.hoja-cuerpo { padding: 1.1rem var(--gutter-der) 1.25rem var(--gutter-izq); }
.hoja-titulo { font-size: 1.4rem; font-weight: 800; display: flex; gap: .4rem; align-items: flex-start; }

/* ── Mini presentación al abrir la app ── */
.presentacion {
  position: fixed; inset: 0; z-index: 100; background: #86061c; color: #fff;
  display: grid; place-items: center; text-align: center; cursor: pointer;
  padding: env(safe-area-inset-top, 0px) var(--gutter-der) env(safe-area-inset-bottom, 0px) var(--gutter-izq);
  transition: opacity .35s ease, transform .35s ease;
}
.presentacion.saliendo { opacity: 0; transform: scale(1.03); }
.pres-contenido { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.pres-logo { width: 132px; height: 132px; border-radius: 30px; animation: pres-entra .7s cubic-bezier(.2, .8, .2, 1) both; }
.pres-nombre { font-size: 2rem; font-weight: 800; letter-spacing: -.01em; animation: pres-sube .6s .15s ease both; }
.pres-cliente { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: center; opacity: .95; animation: pres-sube .6s .3s ease both; }
.pres-chip { background: #fff; border-radius: 10px; padding: 5px 10px; display: inline-flex; align-items: center; color: #1e1e1e; }
.pres-chip img { height: 34px; width: auto; display: block; }
.pres-saltar { position: absolute; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; font-size: .85rem; opacity: .7; }
@keyframes pres-entra { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes pres-sube { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pres-logo, .pres-nombre, .pres-cliente { animation: none; } .presentacion { transition: none; } }

/* ── Recorrido guiado ── */
body.con-tour { overflow: hidden; }
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-foco {
  position: fixed; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgb(0 0 0 / .62);
  transition: top .3s ease, left .3s ease, width .3s ease, height .3s ease;
}
.tour.centrado .tour-foco { box-shadow: 0 0 0 9999px rgb(0 0 0 / .62); }
.tour-tarjeta {
  position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  margin: 0 auto; max-width: 440px; background: var(--surface); color: var(--ink);
  border-radius: 18px; padding: 1.1rem 1.15rem .9rem; box-shadow: 0 20px 50px rgb(0 0 0 / .35);
  display: flex; flex-direction: column; gap: .55rem; outline: none;
  transition: top .3s ease;
}
.tour.centrado .tour-tarjeta { top: 50% !important; transform: translateY(-50%); }
.tour-tarjeta h2 { font-size: 1.2rem; }
.tour-tarjeta p { color: var(--ink-2); line-height: 1.5; }
.tour-pie { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .3rem; flex-wrap: wrap; }
.tour-botones { display: flex; gap: .4rem; margin-left: auto; }
.tour-puntos { display: flex; gap: 5px; }
.tour-puntos i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: block; }
.tour-puntos i.activo { background: var(--accent); width: 18px; border-radius: 4px; }
.tour-saltar { display: flex; justify-content: center; }
.tour-saltar .btn-link { color: var(--muted); font-weight: 600; min-height: 36px; }
.tour-nunca { display: flex; gap: .5rem; align-items: center; font-size: .92rem; color: var(--ink-2); }
.tour-nunca input { width: 20px; height: 20px; flex: none; }
.tour-wa { display: flex; align-items: flex-end; gap: .4rem; justify-content: center; margin-bottom: .2rem; }
.tour-burbuja {
  background: var(--wa-burbuja); color: var(--wa-tinta); border-radius: 4px 12px 12px 12px;
  padding: .5rem .7rem; font-size: .82rem; line-height: 1.4; box-shadow: 0 1px 1px rgb(0 0 0 / .08);
}
.tour-check { font-size: 1.4rem; animation: pres-entra .6s .4s both; }
@media (prefers-reduced-motion: reduce) { .tour-foco, .tour-tarjeta { transition: none; } .tour-check { animation: none; } }
.pie-recorrido { flex-basis: 100%; display: flex; justify-content: center; }

/* Panel: asistente (chat) */
.chat { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: .75rem; }
.chat-mensajes { display: flex; flex-direction: column; gap: .75rem; min-height: 40vh; }
.msg { max-width: 92%; line-height: 1.5; overflow-wrap: anywhere; }
.msg-yo { align-self: flex-end; background: var(--accent); color: var(--accent-ink); padding: .6rem .85rem; border-radius: 16px 16px 4px 16px; }
.msg-ia { align-self: flex-start; background: var(--surface-2); padding: .7rem .95rem; border-radius: 16px 16px 16px 4px; }
.msg-ia p { margin: 0 0 .55rem; } .msg-ia p:last-child { margin-bottom: 0; }
.msg-ia ul, .msg-ia ol { margin: 0 0 .55rem; padding-left: 1.3rem; }
.msg-ia li { margin: .15rem 0; }
.msg-ia a { color: var(--accent-texto); font-weight: 700; }
.msg-ia code { background: var(--surface); padding: 0 .3rem; border-radius: 4px; font-size: .9em; }
.msg-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.chat-titulo { font-weight: 800; }
.chat-tabla { overflow-x: auto; margin: 0 0 .55rem; max-width: 100%; }
.chat-tabla table { font-size: .9rem; background: var(--surface); }
.chat-pensando { display: inline-block; color: var(--muted); font-size: .9rem; animation: chat-latido 1.2s ease-in-out infinite; }
@keyframes chat-latido { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .chat-pensando { animation: none; } }
.chat-entrada {
  position: sticky; bottom: 0; display: flex; gap: .5rem; align-items: flex-end;
  background: var(--bg); padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line);
}
.chat-entrada .textarea { flex: 1; resize: none; min-height: 48px; max-height: 180px; }
.chat-entrada .btn { min-height: 48px; }
.chat-pie { font-size: .8rem; text-align: center; }
.chat-vacio { display: flex; flex-direction: column; gap: 1rem; padding-top: 1rem; }
.chat-hola { font-size: 1.05rem; }
.chat-sugerencias { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-sug {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: .55rem .9rem; font: inherit; font-size: .92rem; text-align: left; cursor: pointer; min-height: 44px;
}
@media (hover: hover) { .chip-sug:hover { border-color: var(--accent); background: var(--accent-soft); } }

/* Panel: usuarios */
.lista-usuarios { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.lista-usuarios li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* Panel: catálogo de platos */
.grilla-platos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: .9rem; }
.ficha-plato { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ficha-foto {
  position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center;
  color: var(--muted); cursor: pointer; border: 0; width: 100%; padding: 0;
}
.ficha-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ficha-foto .ficha-cambiar {
  position: absolute; left: 10px; bottom: 10px; background: rgb(0 0 0 / .6); color: #fff;
  font-weight: 700; font-size: .85rem; border-radius: 999px; padding: .35rem .75rem;
}
.ficha-cuerpo { padding: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.marca-previa { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.marca-previa .portada-previa { width: 100%; aspect-ratio: 16 / 7; border-radius: 14px; object-fit: cover; background: var(--surface-2); }
.marca-previa .logo-previo { width: 76px; height: 76px; border-radius: 18px; object-fit: cover; background: var(--surface-2); }

/* Ayuda (instructivos del panel) */
.ayuda-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1rem; align-items: start; }
.ayuda-indice { display: flex; flex-direction: column; gap: .2rem; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 120px); }
.ayuda-link {
  display: block; padding: .6rem .8rem; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600;
  border-left: 3px solid transparent; min-height: 44px;
}
@media (hover: hover) { .ayuda-link:hover { background: var(--surface-2); color: var(--ink); } }
.ayuda-link[aria-current="page"] { background: var(--accent-soft); color: var(--ink); border-left-color: var(--accent); }
.guia { display: flex; flex-direction: column; gap: .85rem; line-height: 1.55; max-width: 75ch; }
.guia h2 { font-size: 1.35rem; }
.guia h3 { margin-top: .4rem; font-size: 1.05rem; }
.guia .pasos li, .guia .lista li { margin-bottom: .35rem; }
.guia > a.btn { align-self: flex-start; }
.lista { margin: 0; padding-left: 1.2rem; color: var(--ink-2); }
.faq { border: 1px solid var(--line); border-radius: 10px; padding: .2rem .9rem; background: var(--surface); }
.faq + .faq { margin-top: .5rem; }
.faq summary { cursor: pointer; font-weight: 700; padding: .6rem 0; min-height: 44px; display: flex; align-items: center; }
.faq[open] { padding-bottom: .7rem; }
.faq p, .faq ul { color: var(--ink-2); }
.barra-progreso { flex: 1 1 140px; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; max-width: 260px; }
.barra-progreso span { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.pasos-puesta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.pasos-puesta li { display: flex; gap: .8rem; align-items: flex-start; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pasos-puesta li.hecho { background: var(--ok-soft); border-color: transparent; }
.paso-marca {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: .9rem; background: var(--surface-2); color: var(--ink-2);
}
.pasos-puesta li.hecho .paso-marca { background: var(--ok); color: #fff; }
.paso-texto { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.paso-texto > .chip { align-self: flex-start; }
@media (max-width: 760px) {
  .ayuda-grid { grid-template-columns: 1fr; }
  .ayuda-indice { position: static; flex-direction: row; overflow-x: auto; gap: .35rem; scrollbar-width: none; }
  .ayuda-indice::-webkit-scrollbar { display: none; }
  .ayuda-link { flex: none; border-left: 0; border: 1px solid var(--line); border-radius: 999px; padding: .5rem .85rem; white-space: nowrap; }
  .ayuda-link[aria-current="page"] { border-color: var(--accent); }
}

/* ── Administración ── */
.app-adm { min-height: 100vh; min-height: 100dvh; }
.cab-adm {
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
}
.app-adm::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  background: var(--surface); z-index: 6;
}
.cab-adm .interior { max-width: 1200px; margin: 0 auto; padding: .75rem var(--gutter-der) 0 var(--gutter-izq); }
.tabs {
  display: flex; gap: .25rem; overflow-x: auto; margin-top: .6rem; scrollbar-width: none;
  margin-left: calc(-1 * var(--gutter-izq)); margin-right: calc(-1 * var(--gutter-der));
  padding: 0 var(--gutter-der) 0 var(--gutter-izq);
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: none; padding: .6rem .85rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; min-height: 44px;
}
@media (hover: hover) { .tab:hover { color: var(--ink); } }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.cont-adm { max-width: 1200px; margin: 0 auto; padding: 1.25rem var(--gutter-der) 4rem var(--gutter-izq); }

.tabla-envoltura { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.cancelado td { color: var(--muted); }
tr.cancelado td.tachar { text-decoration: line-through; }
.acciones { display: flex; gap: .3rem; justify-content: flex-end; flex-wrap: nowrap; }

/* En el celular, cada fila de tabla se ve como una tarjeta */
@media (max-width: 720px) {
  .tabla-cards { border: 0; background: none; overflow: visible; }
  .tabla-cards table, .tabla-cards tbody, .tabla-cards tr, .tabla-cards td { display: block; width: 100%; }
  .tabla-cards thead { display: none; }
  .tabla-cards tr {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: .75rem .9rem; margin-bottom: .6rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .9rem;
  }
  .tabla-cards td { border: 0; padding: 0; min-width: 0; }
  .tabla-cards td[data-label]::before {
    content: attr(data-label); display: block;
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
    margin-bottom: .1rem;
  }
  .tabla-cards td.ancho, .tabla-cards td.acciones-td { grid-column: 1 / -1; }
  .tabla-cards td.num { text-align: left; }
  .tabla-cards .acciones { justify-content: flex-start; flex-wrap: wrap; }
  .tabla-cards .acciones .btn { flex: 1 1 auto; }
  .tabla-cards td.titulo { grid-column: 1 / -1; font-weight: 700; font-size: 1rem; }
  .tabla-cards td .input, .tabla-cards td .select { min-width: 0 !important; }
  .tabla-cards td:empty { display: none; }
}

.grilla-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: .75rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.tile .valor { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile .rotulo { font-size: .85rem; color: var(--muted); font-weight: 600; }

.grilla-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1rem; }
.grilla-semana { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .75rem; }
.dia-menu { min-width: 0; }
.dia-menu h3 { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.dia-menu .linea { display: flex; gap: .5rem; align-items: center; margin-bottom: .45rem; }
.dia-menu .linea b { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .8rem; color: var(--ink-2); }
.dia-menu.hoy { border-color: var(--accent); }
.linea-menu { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .55rem; }
.linea-menu > span { font-size: .78rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.linea-menu.entrada { padding-bottom: .55rem; border-bottom: 1px dashed var(--line); }
.guardar-menu { display: flex; justify-content: flex-end; }
.guardar-menu .btn { width: auto; }

/* Barras horizontales (una sola serie) */
.barras { display: flex; flex-direction: column; gap: .55rem; }
.barra { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: .6rem; align-items: center; font-size: .9rem; }
.barra .etq { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.barra .riel { height: 14px; border-radius: 0 4px 4px 0; background: transparent; position: relative; }
.barra .relleno { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.barra .val { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2ch; text-align: right; }
@media (hover: hover) { .barra:hover .relleno { filter: brightness(1.12); } }
.vacio { color: var(--muted); font-size: .9rem; padding: .5rem 0; }

.resumen-cocina { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: .6rem; }
.resumen-cocina .item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; display: flex; gap: .75rem; align-items: center; }
.resumen-cocina .cant { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2ch; }
.resumen-cocina .txt { font-size: .88rem; color: var(--ink-2); }

/* Controles de fecha: en el celular ocupan todo el ancho */
.controles { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.controles .input[type="date"] { width: auto; }
@media (max-width: 600px) {
  .controles { width: 100%; }
  .controles .input[type="date"] { flex: 1 1 8.5rem; width: auto; }
  .controles > .btn-primario, .controles > a.btn { flex: 1 1 100%; }
  .guardar-menu .btn { width: 100%; }
}

.qr-wa { background: #fff; padding: 10px; border-radius: 12px; width: 260px; max-width: 100%; }
.cartel { text-align: center; }
.cartel img { width: 260px; max-width: 100%; background: #fff; padding: 10px; border-radius: 12px; }

.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 10px; font-weight: 600;
  z-index: 50; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgb(0 0 0 / .2); text-align: center;
}
.toast.error { background: var(--danger); color: #fff; }

dialog {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  padding: 1.25rem; width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto;
}
dialog::backdrop { background: rgb(0 0 0 / .4); }

@media print {
  .no-imprimir { display: none !important; }
  body { background: #fff; color: #000; }
  .app-adm::before { display: none; }
  .imprimiendo-cartel .grilla-2 > :not(.solo-imprimir) { display: none !important; }
  .imprimiendo-cartel .cartel { border: 0; box-shadow: none; padding-top: 3rem; }
  .imprimiendo-cartel .cartel h1 { font-size: 2.6rem !important; }
  .imprimiendo-cartel .cartel img { width: 340px; }
}
