/* Claro y sobrio, con acento terracota y verde. */
:root {
  --fondo: #f6f4f1;
  --superficie: #ffffff;
  --superficie-2: #faf8f6;
  --borde: #e6e0d8;
  --borde-fuerte: #d6cdc2;
  --texto: #1f1a17;
  --tenue: #6d645c;
  --acento: #b5441b;          /* terracota */
  --acento-hover: #9a3814;
  --acento-suave: #f8ece6;
  --verde: #2f6b4f;
  --verde-suave: #e7f1ec;
  --ok: #2f6b4f;
  --ok-suave: #e7f1ec;
  --peligro: #b42318;
  --peligro-suave: #fdecea;
  --aviso: #8a5a00;
  --aviso-suave: #fdf3dc;
  --radio: 14px;
  --sombra: 0 1px 2px rgb(31 26 23 / .05), 0 2px 8px rgb(31 26 23 / .04);
  --sombra-alta: 0 2px 6px rgb(31 26 23 / .06), 0 12px 28px rgb(31 26 23 / .10);
  --alto-encabezado: 60px;
  --suave: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--fondo); color: var(--texto); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: .8rem; margin: 1.8rem 0 .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tenue); }
h2 small { color: var(--tenue); font-weight: 500; font-size: .85em; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  min-height: 46px; padding: 8px 12px; border: 1px solid var(--borde-fuerte); border-radius: 10px;
  background: var(--superficie); width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--acento); box-shadow: 0 0 0 3px rgb(181 68 27 / .14); outline: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--acento); flex: none; box-shadow: none; }
svg { flex: none; }
.tenue { color: var(--tenue); }
.ayuda { color: var(--tenue); font-size: .9rem; margin: .5rem 0; }

/* Encabezado */
.encabezado {
  position: sticky; top: 0; z-index: 30; height: var(--alto-encabezado);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--superficie); border-bottom: 1px solid var(--borde);
}
.marca { display: flex; align-items: center; gap: 10px; color: var(--texto); font-weight: 700; text-decoration: none; font-size: 1.05rem; min-width: 0; }
.marca img { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.marca span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 2px; margin-left: 12px; height: 100%; }
.nav a {
  display: flex; align-items: center; padding: 0 14px; color: var(--tenue); text-decoration: none; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--texto); }
.nav a.activa { color: var(--acento); border-bottom-color: var(--acento); }
.pill, .rol {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); cursor: pointer;
  white-space: nowrap; font-weight: 600; font-size: .88rem; transition: background .15s, border-color .15s;
}
.pill:hover, .rol:hover { background: var(--superficie-2); border-color: var(--borde-fuerte); }
.pill { margin-left: auto; max-width: 180px; }
.pill span { overflow: hidden; text-overflow: ellipsis; }
.pill svg, .rol svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--tenue); }
.pill::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d0a29a; flex: none; }
.pill.ok::after { background: var(--verde); }
.rol.admin { background: var(--acento); border-color: var(--acento); color: #fff; }
.rol.admin svg { color: #fff; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 8px 18px; border-radius: 10px; border: 1px solid var(--borde-fuerte);
  background: var(--superficie); cursor: pointer; font-weight: 600; text-align: center;
  transition: transform .1s var(--suave), background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: var(--superficie-2); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn.primario:hover:not(:disabled) { background: var(--acento-hover); border-color: var(--acento-hover); }
.btn.peligro { background: var(--peligro); border-color: var(--peligro); color: #fff; }
.btn.peligro-txt { color: var(--peligro); }
.btn.activo { background: var(--texto); border-color: var(--texto); color: #fff; }
.btn.chico { min-height: 38px; padding: 4px 12px; font-size: .9rem; }
.btn.grande { min-height: 56px; font-size: 1.08rem; width: 100%; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.botones { display: flex; gap: 8px; flex-wrap: wrap; }
.botones > .btn { flex: 1; }
.botones.secundarios { margin-top: 8px; }
.solo-movil { display: none !important; }

/* Páginas */
.pagina { max-width: 1120px; margin: 0 auto; padding: 20px 20px 40px; }
.barra-titulo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; flex-wrap: wrap; }
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); margin-bottom: 16px; }
.tarjeta > h2 { margin-bottom: 12px; }
.aviso { background: var(--aviso-suave); color: var(--aviso); padding: 12px 16px; border-radius: 10px; border: 1px solid #f2dfb0; }
.etiqueta { display: inline-block; font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--aviso-suave); color: var(--aviso); text-transform: uppercase; letter-spacing: .04em; }
.etiqueta.ok { background: var(--ok-suave); color: var(--ok); }

/* Resumen de Mesas */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hero-fecha { margin: 0 0 2px; color: var(--tenue); font-size: .9rem; font-weight: 500; }
.hero-fecha::first-letter { text-transform: uppercase; }
.hero-datos { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-datos > div {
  display: flex; flex-direction: column; padding: 10px 16px; min-width: 120px;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; box-shadow: var(--sombra);
}
.hero-datos strong { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-datos small { color: var(--tenue); font-weight: 500; }
.hero-datos span { font-size: .78rem; color: var(--tenue); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.hero-datos .alerta { border-color: #f2dfb0; background: var(--aviso-suave); }
.hero-datos .alerta strong { color: var(--aviso); }

/* Mesas */
.mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 8px; }
.mesa {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 118px; padding: 14px 16px;
  border-radius: var(--radio); border: 1px solid var(--borde); background: var(--superficie); cursor: pointer; text-align: left;
  box-shadow: var(--sombra); position: relative; overflow: hidden;
  transition: transform .15s var(--suave), box-shadow .15s, border-color .15s;
}
.mesa:hover { box-shadow: var(--sombra-alta); border-color: var(--borde-fuerte); }
.mesa:active { transform: scale(.98); }
.mesa-icono { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--superficie-2); color: var(--tenue); border: 1px solid var(--borde); }
.mesa-icono svg, .mesa-estado svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mesa-nombre { font-weight: 700; font-size: 1rem; }
.mesa-estado { color: var(--tenue); font-size: .82rem; font-weight: 500; display: flex; gap: 12px; flex-wrap: wrap; }
.mesa-estado span { display: inline-flex; align-items: center; gap: 4px; }
.mesa-estado svg { width: 14px; height: 14px; }
.mesa-estado .tarde { color: var(--peligro); }
.mesa.libre .mesa-estado { color: var(--verde); }
.mesa.libre .mesa-estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--verde); align-self: center; }
.mesa.ocupada { background: linear-gradient(180deg, var(--superficie), var(--acento-suave)); border-color: #ecd3c7; }
.mesa.ocupada::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--acento); }
.mesa.ocupada .mesa-icono { background: var(--acento); color: #fff; border-color: var(--acento); }
.mesa-cabeza { display: flex; align-items: center; gap: 10px; }
.mesa-total { font-size: 1.35rem; font-weight: 700; color: var(--texto); font-variant-numeric: tabular-nums; }
.mesa.por-enviar { border-color: #e9c46a; }
.mesa.por-enviar::before { background: #d99a1e; }
.mesa .etiqueta { position: absolute; top: 12px; right: 12px; }
.mesas.mini { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.mesas.mini .mesa { min-height: 70px; }
.vacio-llevar { color: var(--tenue); padding: 18px; border: 1px dashed var(--borde-fuerte); border-radius: var(--radio); text-align: center; }

/* Comanda */
.orden { display: grid; grid-template-columns: 1fr minmax(340px, 400px); height: calc(100dvh - var(--alto-encabezado)); }
.orden > * { min-width: 0; }
.menu { overflow-y: auto; padding: 16px 20px; }
.platos-barra {
  display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 10px 12px; margin-bottom: 10px;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; scrollbar-width: none;
}
.platos-barra::-webkit-scrollbar { display: none; }
.platos-titulo { flex: none; font-size: .78rem; font-weight: 700; color: var(--tenue); text-transform: uppercase; letter-spacing: .05em; margin-right: 2px; }
.plato-chip {
  flex: none; display: flex; flex-direction: column; align-items: flex-start; min-height: 46px; padding: 5px 14px;
  border-radius: 10px; border: 1px solid var(--borde-fuerte); background: var(--superficie); cursor: pointer; line-height: 1.15;
  transition: background .15s, border-color .15s;
}
.plato-chip b { font-weight: 700; font-size: .92rem; }
.plato-chip small { color: var(--tenue); font-size: .75rem; font-weight: 600; }
.plato-chip.activo { background: var(--acento); border-color: var(--acento); color: #fff; }
.plato-chip.activo small { color: rgb(255 255 255 / .85); }
.plato-chip.nuevo { justify-content: center; border-style: dashed; color: var(--acento); font-weight: 700; }
.cats {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; margin-bottom: 6px; position: sticky; top: -16px;
  background: var(--fondo); z-index: 2; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none; min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--borde-fuerte);
  background: var(--superficie); font-weight: 600; cursor: pointer; transition: background .15s, color .15s;
}
.cat.activa { background: var(--texto); color: #fff; border-color: var(--texto); }
.productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.producto {
  position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden;
  border-radius: var(--radio); border: 1px solid var(--borde); background: var(--superficie); cursor: pointer; text-align: left;
  box-shadow: var(--sombra); transition: transform .12s var(--suave), box-shadow .15s;
}
.producto:hover { box-shadow: var(--sombra-alta); }
.producto:active { transform: scale(.97); }
.producto-img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #ece6df; }
.producto-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--suave); }
.producto:hover .producto-img img { transform: scale(1.04); }
.producto-info { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 12px 12px; }
.producto-nombre { font-weight: 600; line-height: 1.25; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.precio { flex: none; color: var(--acento); font-weight: 700; font-variant-numeric: tabular-nums; }
.sello {
  position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 6px;
  background: var(--verde); color: #fff; font-weight: 700; font-size: .75rem; letter-spacing: .02em;
}
.en-cuenta {
  position: absolute; top: 8px; left: 8px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px;
  display: grid; place-items: center; background: var(--acento); color: #fff; font-weight: 700; font-size: .9rem;
  box-shadow: 0 0 0 2px #fff; animation: pop .3s var(--suave);
}

.cuenta { display: flex; flex-direction: column; background: var(--superficie); border-left: 1px solid var(--borde); padding: 14px 18px 18px; min-height: 0; }
.cuenta-encabezado { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--borde); }
.cuenta-encabezado h2 { flex: 1; text-align: center; font-size: 1.05rem; }
.nombre-llevar { margin-top: 10px; }
.lineas { list-style: none; margin: 0; padding: 6px 0; flex: 1; overflow-y: auto; }
.lineas .vacio { color: var(--tenue); text-align: center; padding: 40px 12px; }
.grupo-plato { margin-top: 10px; }
.grupo-plato:first-child { margin-top: 2px; }
.grupo-plato button {
  display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 7px 10px; cursor: pointer;
  border: 0; border-radius: 8px; background: var(--superficie-2); text-align: left;
}
.grupo-plato b { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.grupo-plato span { font-size: .8rem; color: var(--tenue); font-weight: 600; }
.grupo-plato.activo button { background: var(--acento-suave); color: var(--acento); box-shadow: inset 3px 0 0 var(--acento); }
.plato-vacio { color: var(--tenue); font-size: .85rem; padding: 8px 10px; }
.linea {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; width: 100%;
  padding: 10px 4px; border: 0; border-bottom: 1px solid var(--borde); background: none; text-align: left; cursor: pointer;
  transition: background .15s;
}
.linea:hover { background: var(--superficie-2); }
.linea.recien { animation: resaltar 1.2s ease-out; }
.linea .cant { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--superficie-2); border: 1px solid var(--borde); font-weight: 700; font-variant-numeric: tabular-nums; }
.linea .detalle { display: flex; flex-direction: column; gap: 2px; }
.linea small { color: var(--tenue); }
.linea small.nota { font-style: italic; }
.linea em { font-style: normal; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.linea em.nuevo { color: var(--aviso); }
.linea em.enviado { color: var(--ok); }
.linea .importe { font-weight: 600; font-variant-numeric: tabular-nums; }

.totales { margin: 0; padding: 10px 0; border-top: 1px solid var(--borde); }
.totales > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; }
.totales dt { color: var(--tenue); }
.totales dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.totales .descuento dd, .totales .descuento dt { color: var(--ok); }
.totales .total { font-size: 1.3rem; font-weight: 700; }
.totales .total dt { color: var(--texto); }
.totales .total.rebote dd { animation: rebote .4s var(--suave); }
.totales input { max-width: 120px; text-align: right; }

.barra-cuenta { display: none; }
.volador {
  position: fixed; z-index: 90; pointer-events: none; transform: translate(-50%, -50%);
  background: var(--acento); color: #fff; font-weight: 700; font-size: .85rem; padding: 4px 10px; border-radius: 999px;
  animation: volar .55s cubic-bezier(.5, 0, .7, .4) forwards;
}

/* Editor de producto */
.editor-cabeza { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.editor-img { width: 96px; height: 72px; flex: none; border-radius: 10px; overflow: hidden; background: #ece6df; }
.editor-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.elegir-plato { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.elegir-plato span { font-size: .8rem; font-weight: 700; color: var(--tenue); text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; }
.elegir-plato .btn { min-width: 44px; }
.elegir-plato .btn.activo { background: var(--acento); border-color: var(--acento); }
.stepper { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.stepper > .btn { width: 52px; height: 52px; font-size: 1.5rem; padding: 0; border-radius: 12px; }
.stepper output { font-size: 2rem; font-weight: 700; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.rapidas { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.mod {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 62px; padding: 10px 12px;
  border-radius: 10px; border: 1.5px solid; cursor: pointer; text-align: left; font-weight: 600; transition: transform .1s var(--suave);
}
.mod:active:not(:disabled) { transform: scale(.97); }
.mod small { font-weight: 700; text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; }
.mod.con { background: var(--verde-suave); border-color: #a9cdb9; color: #1f4d38; }
.mod.sin { background: var(--peligro-suave); border-color: #f0b4ad; color: #8a1c13; text-decoration: line-through; }
.mod.sin small { text-decoration: none; }
.mod.aparte { background: var(--aviso-suave); border-color: #ead49a; color: var(--aviso); }
.mod:disabled { opacity: .7; cursor: default; }
.editor .nota { margin-top: 12px; }

/* Cobro */
.cobro { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.lista-cuenta { list-style: none; margin: 0 0 8px; padding: 0; }
.lista-cuenta li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--borde); }
.lista-cuenta small { display: block; color: var(--tenue); }
.cliente { color: var(--tenue); margin: 8px 0 0; }
.por-cobrar { display: flex; flex-direction: column; align-items: center; padding: 18px; border-radius: 12px; margin-bottom: 16px; background: var(--acento-suave); border: 1px solid #ecd3c7; }
.por-cobrar span { color: var(--tenue); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.por-cobrar strong { font-size: 2.4rem; font-weight: 700; color: var(--acento); font-variant-numeric: tabular-nums; }
.por-cobrar.negativo { background: var(--peligro-suave); border-color: #f0b4ad; }
.por-cobrar.negativo strong { color: var(--peligro); }
.pagos { list-style: none; padding: 0; margin: 0 0 16px; }
.pagos li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--borde); animation: subir .25s var(--suave); }
.pagos li span { flex: 1; }
.pagos small { display: block; color: var(--tenue); }
.metodos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.metodo { flex-direction: column; gap: 4px; min-height: 70px; font-size: .88rem; }
.metodo svg { width: 24px; height: 24px; }
.metodo.activo { background: var(--texto); color: #fff; border-color: var(--texto); }
.billetes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cambio { font-size: 1.15rem; margin: 12px 0; }
.cambio strong { color: var(--ok); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.monto.grande { font-size: 1.5rem; font-weight: 700; min-height: 56px; }
.partes { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.partes span { color: var(--tenue); font-weight: 600; margin-right: 4px; }
.partes .btn { min-width: 44px; }
.partes .btn.activo { background: var(--texto); color: #fff; border-color: var(--texto); }
.parte-actual { margin: 4px 0 12px; font-size: 1.05rem; }
.lista-dividir { list-style: none; margin: 8px 0; padding: 0; }
.lista-dividir li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--borde); }
.lista-dividir li > span { display: flex; flex-direction: column; }
.lista-dividir small { color: var(--tenue); }
.stepper.chico { margin: 0; gap: 8px; flex-wrap: nowrap; }
.stepper.chico > .btn { width: 42px; height: 42px; font-size: 1.25rem; }
.stepper.chico output { font-size: 1.25rem; min-width: 28px; }
.resumen-dividir { font-size: 1.05rem; }
.exito { text-align: center; padding-top: 4px; }
.exito h2 { font-size: 1.5rem; animation: subir .35s .3s var(--suave) both; }
.cambio-grande { display: block; font-size: 3rem; font-weight: 700; color: var(--ok); margin: 4px 0 8px; font-variant-numeric: tabular-nums; animation: subir .4s .45s var(--suave) both; }
.palomita { width: 72px; height: 72px; margin: 0 auto 10px; display: block; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.palomita circle { stroke: var(--ok); stroke-width: 2.5; fill: var(--ok-suave); stroke-dasharray: 151; stroke-dashoffset: 151; animation: trazar .45s ease-out forwards; }
.palomita path { stroke: var(--ok); stroke-width: 3.5; stroke-dasharray: 36; stroke-dashoffset: 36; animation: trazar .3s .35s ease-out forwards; }

/* Formularios */
.campo { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.campo > span, .etiqueta-campo { font-size: .85rem; font-weight: 600; color: var(--tenue); display: block; margin-top: 10px; }
.campo > span { margin-top: 0; }
.casilla { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; cursor: pointer; }
.casilla small { display: block; color: var(--tenue); }
.rejilla-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }
.lista-edit { display: flex; flex-direction: column; gap: 8px; max-width: 520px; }
.fila-edit { display: flex; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--borde-fuerte); border-radius: 999px; cursor: pointer; background: var(--superficie); }
.chip:has(input:checked) { background: var(--acento-suave); border-color: var(--acento); }
.chip input { width: 18px; height: 18px; }

/* Ajustes */
.pestanas { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--borde); margin-bottom: 18px; scrollbar-width: none; }
.pestanas::-webkit-scrollbar { display: none; }
.pestana { flex: none; padding: 10px 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--tenue); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pestana:hover { color: var(--texto); }
.pestana.activa { color: var(--acento); border-bottom-color: var(--acento); }
.contenido-ajustes { max-width: 860px; }
.promo-cabeza { display: flex; align-items: center; gap: 12px; }
.promo-cabeza .btn { margin-left: auto; }
.celda-foto { display: flex; align-items: center; gap: 4px; }
.mini-foto { position: relative; display: block; width: 72px; height: 54px; border-radius: 8px; overflow: hidden; background: #ece6df; cursor: pointer; border: 1px solid var(--borde); }
.mini-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-foto-txt {
  position: absolute; inset: auto 0 0; padding: 2px 0; text-align: center; font-size: .65rem; font-weight: 700; color: #fff;
  background: rgb(31 26 23 / .6); text-transform: uppercase; letter-spacing: .04em;
}
.quitar-foto { min-height: 30px; padding: 0 8px; }

/* Tablas */
.tabla-scroll { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.tabla th, .tabla td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla th { font-size: .74rem; color: var(--tenue); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tabla tbody tr:hover { background: var(--superficie-2); }
.tabla tr.cancelada td { color: var(--tenue); text-decoration: line-through; }
.tabla td button { text-decoration: none; }
.productos-edit input:not([type="checkbox"]) { min-width: 140px; }
.productos-edit input.precio { min-width: 80px; max-width: 110px; }
.productos-edit select { min-width: 130px; }

/* Corte */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; padding: 14px 16px; box-shadow: var(--sombra); }
.kpi span { display: block; color: var(--tenue); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kpi strong { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi:first-child strong { color: var(--acento); }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dos-col > * { min-width: 0; }
.corte .tarjeta { overflow-x: auto; }
.diferencia { font-size: 1.1rem; }
.neg { color: var(--peligro); }
.pos { color: var(--aviso); }
.ok { color: var(--ok); }

/* Modales */
.modal-fondo {
  position: fixed; inset: 0; z-index: 50; background: rgb(31 26 23 / .45);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: aparecer-fondo .18s ease-out;
}
.modal {
  background: var(--superficie); border-radius: 16px; padding: 20px; width: 100%; max-width: 560px;
  max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: 0 24px 60px rgb(0 0 0 / .22); animation: abrir-modal .22s var(--suave);
}
.modal-fondo.saliendo { animation: desaparecer .15s ease-in forwards; }
.modal-fondo.saliendo .modal { animation: cerrar-modal .15s ease-in forwards; }
.modal.chico { max-width: 400px; }
.modal h2 { margin-bottom: 8px; }
.acciones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.error-txt { color: var(--peligro); font-weight: 600; }

/* PIN con teclado numérico */
.pin-modal { text-align: center; }
.candado { width: 52px; height: 52px; margin: 4px auto 10px; display: grid; place-items: center; border-radius: 50%; background: var(--acento-suave); color: var(--acento); }
.candado svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.puntos { display: flex; justify-content: center; gap: 12px; margin: 16px 0; min-height: 16px; }
.puntos i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--borde-fuerte); transition: all .12s var(--suave); }
.puntos i.lleno { background: var(--acento); border-color: var(--acento); }
.pin-oculto { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 0 auto 14px; }
.tecla {
  height: 58px; border-radius: 12px; border: 1px solid var(--borde); background: var(--superficie-2);
  font-size: 1.4rem; font-weight: 600; cursor: pointer; transition: transform .08s, background .1s;
}
.tecla:active { transform: scale(.94); background: var(--acento-suave); }
.tecla.suave { background: none; border-color: transparent; color: var(--tenue); font-size: 1.2rem; }
.temblar { animation: temblar .35s; }

.estado-respaldo { margin: 0 0 12px; line-height: 1.5; }
.estado-respaldo.error strong { color: var(--peligro); }
.pasos { padding-left: 1.3rem; line-height: 1.6; }
.pasos li { margin-bottom: 8px; }
.codigo { width: 100%; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; white-space: pre; }
.papel {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; line-height: 1.35;
  background: #fff; color: #000; border: 1px solid var(--borde); border-radius: 4px; box-shadow: var(--sombra);
  width: calc(var(--cols) * 1ch + 24px); max-width: 100%; margin: 12px auto; padding: 12px; overflow-x: auto; white-space: pre;
}
.papel .c { text-align: center; }
.papel .b { font-weight: 700; }
.papel .g { font-size: 1.6em; font-weight: 700; }

/* Avisos */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { background: var(--texto); color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--sombra-alta); font-weight: 600; max-width: 100%; text-align: center; animation: entrar .25s var(--suave); }
.toast.error { background: var(--peligro); }
.toast.ok { background: var(--ok); }
.toast.saliendo { animation: salir .18s ease-in forwards; }

/* Animaciones discretas al entrar a una pantalla */
.animar .hero, .animar .barra-titulo, .animar .tarjeta, .animar .kpi, .animar .platos-barra, .animar .cats, .animar .pestanas {
  animation: subir .3s var(--suave) both;
}
.animar .mesa, .animar .producto { animation: subir .32s var(--suave) both; animation-delay: min(calc(var(--i, 0) * 18ms), 300ms); }
.etiqueta.latido { animation: latido 2s ease-in-out infinite; }

@keyframes subir { from { opacity: 0; transform: translateY(8px); } }
@keyframes aparecer-fondo { from { opacity: 0; } }
@keyframes desaparecer { to { opacity: 0; } }
@keyframes abrir-modal { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes cerrar-modal { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes entrar { from { opacity: 0; transform: translateY(10px); } }
@keyframes salir { to { opacity: 0; transform: translateY(6px); } }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@keyframes rebote { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.08); } }
@keyframes resaltar { from { background: var(--acento-suave); } }
@keyframes latido { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes trazar { to { stroke-dashoffset: 0; } }
@keyframes temblar { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes volar {
  0% { transform: translate(-50%, -50%) scale(.7); opacity: 0; }
  20% { transform: translate(-50%, -80%) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -80px))) scale(.6); opacity: 0; }
}

/* Teléfono y tablet vertical */
@media (max-width: 860px) {
  .orden { grid-template-columns: 1fr; height: auto; min-height: calc(100dvh - var(--alto-encabezado)); }
  .menu { padding: 12px 14px 104px; overflow: visible; }
  .cats { top: var(--alto-encabezado); }
  .cuenta {
    position: fixed; inset: var(--alto-encabezado) 0 0 0; z-index: 25; border-left: 0;
    transform: translateY(100%); transition: transform .28s var(--suave), visibility .28s; visibility: hidden;
  }
  .panel-abierto .cuenta { transform: none; visibility: visible; }
  .solo-movil { display: inline-flex !important; }
  .barra-cuenta {
    display: flex; align-items: center; gap: 12px; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 15;
    min-height: 60px; padding: 0 18px 0 10px; border: 0; border-radius: 14px; color: #fff; cursor: pointer;
    background: var(--texto); font-weight: 600; font-size: 1rem; box-shadow: 0 8px 24px rgb(31 26 23 / .25);
  }
  .barra-cuenta strong { margin-left: auto; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
  .barra-piezas { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 8px; border-radius: 10px; background: var(--acento); font-weight: 700; }
  .barra-cuenta.rebote .barra-piezas { animation: pop .35s var(--suave); }
  .panel-abierto .barra-cuenta { display: none; }
  .cobro, .dos-col { grid-template-columns: 1fr; }
  #toasts { bottom: 84px; }
}
@media (max-width: 600px) {
  .modal-fondo { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92dvh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); animation: hoja .26s var(--suave); }
  .modal-fondo.saliendo .modal { animation: hoja-salir .16s ease-in forwards; }
  @keyframes hoja { from { transform: translateY(100%); } }
  @keyframes hoja-salir { to { transform: translateY(100%); } }
}
@media (max-width: 520px) {
  .encabezado { gap: 6px; padding: 0 10px; }
  .marca span { display: none; }
  .nav { margin-left: 4px; }
  .nav a { padding: 0 10px; font-size: .92rem; }
  .pill { padding: 6px 9px; }
  .pill span { display: none; }
  .rol { padding: 6px 10px; }
  .pagina { padding: 14px 14px 32px; }
  .hero-datos { width: 100%; }
  .hero-datos > div { min-width: 0; flex: 1; padding: 8px 12px; }
  .hero-datos strong { font-size: 1.05rem; }
  .productos { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .producto-info { flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
  .mesas { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cuenta-encabezado h2 { font-size: .98rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
