/* El mundo del restaurante: claro, denso, se opera de un vistazo.
   Lo contrario del feed del comensal, a propósito. */

.marca { font-family: var(--font-display); font-size: 21px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.tenue { color: var(--ink-muted); }

.btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 600;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primario { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primario:hover { filter: brightness(1.08); background: var(--accent); }
.btn-chico { padding: 5px 10px; font-size: 12.5px; }
.btn.peligro { color: var(--st-alert); border-color: color-mix(in srgb, var(--st-alert) 40%, transparent); }
.ancho { width: 100%; }

.campo { display: block; margin-bottom: 12px; }
.campo span { display: block; font-size: 12px; color: var(--ink-muted); margin-bottom: 5px; letter-spacing: .04em; }
.campo input, .campo select {
  width: 100%; padding: 10px 12px; border-radius: 8px; font: inherit;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
}

/* ---------- entrada ---------- */
.entrada { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.tarjeta-entrada {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 28px; width: 100%; max-width: 360px; box-shadow: var(--shadow);
}
.tarjeta-entrada .tenue { margin: 2px 0 22px; font-size: 13.5px; }
.error {
  color: var(--st-alert); background: var(--st-alert-bg); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; margin: 0 0 12px;
}

/* ---------- barra ---------- */
.barra {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px clamp(16px, 3vw, 28px);
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.restaurante { font-size: 13.5px; color: var(--ink-muted); }
.quien { margin-left: auto; font-size: 13px; color: var(--ink-muted); }
.latido {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  animation: latir 2.4s ease-in-out infinite;
}
.latido.frio { background: var(--st-alert); animation: none; }
@keyframes latir { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .latido { animation: none; } }

.lienzo {
  max-width: 1400px; margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 28px) 60px;
  display: flex; flex-direction: column; gap: 18px;
}

/* ---------- alerta ---------- */
.alerta {
  display: flex; align-items: center; gap: 14px;
  background: var(--st-alert-bg);
  border: 1px solid color-mix(in srgb, var(--st-alert) 40%, transparent);
  border-radius: 12px; padding: 14px 16px; flex-wrap: wrap;
}
.alerta .campana { font-size: 20px; animation: sacudir 1.6s ease-in-out infinite; }
@keyframes sacudir {
  0%,88%,100% { transform: rotate(0); } 92% { transform: rotate(11deg); } 96% { transform: rotate(-11deg); }
}
@media (prefers-reduced-motion: reduce) { .alerta .campana { animation: none; } }
.alerta strong { display: block; font-size: 15px; }
.alerta small { font-size: 13px; color: var(--ink-muted); }

/* ---------- kpis ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 13px 15px; box-shadow: var(--shadow);
}
.kpi p { margin: 0; }
.kpi .k { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; margin-bottom: 5px; }
.kpi .v { font-size: 25px; font-weight: 700; line-height: 1.1; }
.kpi .d { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.kpi.urgente .v { color: var(--st-alert); }

/* ---------- tarjetas ---------- */
.columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.tarjeta {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.tarjeta > header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.tarjeta > header h2 { font-size: 14px; margin: 0; font-weight: 700; }
.tarjeta .pista { margin-left: auto; font-size: 12px; color: var(--ink-muted); }
.tarjeta .cuerpo { padding: 14px 16px; }

/* ---------- mesas ---------- */
.mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.mesa-tile {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 9px;
  text-align: center; background: var(--surface); position: relative;
  overflow: hidden; cursor: pointer; font: inherit; color: inherit;
}
.mesa-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.mesa-tile .n { font-size: 12px; color: var(--ink-muted); font-weight: 600; }
.mesa-tile .t { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700; margin-top: 2px; }
.mesa-tile .s { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; margin-top: 5px; color: var(--ink-muted); }
.mesa-tile .p { font-size: 10.5px; color: var(--ink-muted); margin-top: 2px; }
.mesa-tile.abierta::before { background: var(--st-kitchen); }
.mesa-tile.abierta .s { color: var(--st-kitchen); }
/* Escanearon y están viendo el menú: no es mesa ocupada, es mesa que atender. */
.mesa-tile.mirando::before { background: var(--st-served); }
.mesa-tile.mirando .s { color: var(--st-served); }
/* Ya pagó y sigue sentada. No debe nada, pero la mesa no está libre. */
.mesa-tile.sobremesa::before { background: var(--accent); }
.mesa-tile.sobremesa .s { color: var(--accent); }
.mesa-tile.sobrecupo { box-shadow: inset 0 0 0 1px var(--st-new); }
.mesa-tile.sobrecupo .p { color: var(--st-new); font-weight: 600; }
.mesa-tile.cuenta_pedida::before { background: var(--st-alert); }
.mesa-tile.cuenta_pedida { background: var(--st-alert-bg); border-color: color-mix(in srgb, var(--st-alert) 35%, transparent); }
.mesa-tile.cuenta_pedida .s { color: var(--st-alert); }
.mesa-tile.libre { cursor: default; }
.mesa-tile.libre:hover { background: var(--surface); }
.mesa-tile:hover { background: var(--surface-2); }
.mesa-qr {
  display: block; margin-top: 6px; font-size: 10.5px; color: var(--accent);
  text-decoration: none; font-weight: 600;
}
.mesa-qr:hover { text-decoration: underline; }

/* ---------- pedidos ---------- */
.pedido {
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 11px 12px;
  margin-bottom: 9px; display: flex; gap: 11px; align-items: flex-start;
}
.pedido:last-child { margin-bottom: 0; }
.pedido.nuevo { border-color: color-mix(in srgb, var(--st-new) 45%, transparent); background: var(--st-new-bg); }
.pedido .info { flex: 1; min-width: 0; }
.pedido .de { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; }
.pedido .que { font-size: 14px; font-weight: 600; margin-top: 1px; }
.pedido .cuando { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

/* ---------- inventario ---------- */
/* En qué local está trabajando. Solo sale con más de uno que atender. */
.sucursal {
  font: inherit; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; cursor: pointer;
}
.sucursal:hover { border-color: var(--accent); }

/* ---------- foto de cada artículo de bodega ----------
   Grande y con borde punteado cuando está vacía: tiene que verse como un
   hueco que pide que lo llenen, no como un adorno apagado. */
.foto-insumo {
  position: relative; flex: 0 0 auto; width: 46px; height: 46px;
  border-radius: 10px; border: 1.5px dashed var(--line);
  background: var(--surface-2); padding: 0; overflow: hidden;
  display: grid; place-items: center; cursor: pointer;
  transition: border-color .15s ease, transform .1s ease;
}
.foto-insumo:hover { border-color: var(--accent); }
.foto-insumo:active { transform: scale(.95); }
.foto-insumo.con-foto { border-style: solid; border-color: var(--line-soft); }
.foto-insumo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-insumo .sin-foto { font-size: 17px; opacity: .55; }
.foto-insumo .quitar {
  position: absolute; top: 0; right: 0; width: 17px; height: 17px;
  display: grid; place-items: center; font-size: 9px; line-height: 1;
  background: rgba(10,14,12,.72); color: #fff; border-bottom-left-radius: 7px;
  opacity: 0; transition: opacity .15s ease;
}
.foto-insumo:hover .quitar, .foto-insumo .quitar:focus-visible { opacity: 1; }
/* En pantalla táctil no hay hover: la × se ve siempre. */
@media (hover: none) { .foto-insumo .quitar { opacity: 1; } }
.foto-insumo.subiendo { opacity: .45; pointer-events: none; }
.foto-insumo.subiendo::after {
  content: ""; position: absolute; inset: 0; border-radius: 9px;
  border: 2px solid var(--accent); border-top-color: transparent;
  animation: girando .7s linear infinite;
}
@keyframes girando { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .foto-insumo.subiendo::after { animation: none; } }

.insumo.recibiendo { background: var(--accent-soft); border-radius: 8px; }
/* En cero o en negativo: el plato que dependa de esto ya se apagó solo. */
.insumo.agotado .nom b { color: var(--st-alert); }
.insumo [data-mover] { flex: 0 0 auto; }

/* Qué pasó en la bodega. Tres opciones, no un desplegable: se toca una vez y
   con el dedo, no se busca en una lista. */
.b-modos { display: flex; gap: 6px; margin: 4px 0 16px; }
.b-modos button {
  flex: 1; padding: 10px 8px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink);
}
.b-modos button:hover { background: var(--surface-2); }
.b-modos button[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}

.insumo { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.insumo:last-child { border-bottom: 0; }
.insumo .nom { flex: 1; min-width: 0; }
.insumo .nom b { display: block; font-size: 13.5px; font-weight: 600; }
.insumo .nom span { font-size: 11.5px; color: var(--ink-muted); }
.barra-stock { width: 70px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; flex: 0 0 auto; }
.barra-stock i { display: block; height: 100%; background: var(--accent); transition: width .4s ease; }
.barra-stock.bajo i { background: var(--st-new); }
.barra-stock.cero i { background: var(--st-alert); }
.insumo .cant { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; width: 78px; text-align: right; flex: 0 0 auto; }

.vacio { color: var(--ink-muted); font-size: 13.5px; padding: 18px 0; text-align: center; }

/* ---------- modales ---------- */
.fondo-modal {
  position: fixed; inset: 0; z-index: 200; background: rgba(10,14,12,.6);
  display: grid; place-items: center; padding: 24px; backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 420px;
  padding: 22px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
  max-height: 88dvh; overflow-y: auto;
}
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.c-lineas { font-size: 13px; margin-bottom: 12px; }
.c-lineas div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.c-totales { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 16px; }
.c-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; font-size: 14px; }
.c-fila.c-grande { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.c-propina input { width: 100px; text-align: right; padding: 6px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
/* "Siguen en la mesa": cambia lo que pasa al cobrar, así que se ve, no se
   esconde en un menú. */
.c-seguir {
  display: flex; gap: 11px; align-items: flex-start; margin: 4px 0 14px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); cursor: pointer;
}
.c-seguir:hover { border-color: var(--accent); }
.c-seguir input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }
.c-seguir b { display: block; font-size: 13.5px; }
.c-seguir small { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 2px; line-height: 1.45; }

.c-botones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.c-botones .btn-primario { margin-left: auto; }

.factura { max-width: 400px; padding: 0; overflow: hidden; }
.sello {
  background: var(--st-alert-bg); color: var(--st-alert); margin: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--st-alert) 35%, transparent);
  padding: 10px 18px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-align: center;
}
.f-cuerpo { padding: 20px 24px; font-family: var(--font-mono); font-size: 12.5px; }
.f-cuerpo h3 { font-family: var(--font-ui); font-size: 16px; margin: 0 0 2px; }
.f-cuerpo .org { color: var(--ink-muted); font-size: 11.5px; margin: 0 0 14px; line-height: 1.5; }
.f-cuerpo .fila { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.f-cuerpo .regla { border-top: 1px dashed var(--line); margin: 11px 0; }
.f-cuerpo .grande { font-size: 14.5px; font-weight: 700; }
.factura .c-botones { padding: 0 24px 20px; }

/* ---------- pestañas ---------- */
.pestanas { display: flex; gap: 3px; background: var(--surface-2); padding: 3px; border-radius: 9px; }
.pestanas button {
  border: 0; background: transparent; padding: 7px 15px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-muted);
}
.pestanas button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- avisos que necesitan ojo humano ---------- */
.aviso-fila {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-left: 4px solid var(--st-new);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
}
.aviso-fila.urgente { border-left-color: var(--st-alert); background: var(--st-alert-bg); }
.aviso-fila .ico { font-size: 17px; }
.aviso-fila strong { display: block; font-size: 14px; }
.aviso-fila small { font-size: 12.5px; color: var(--ink-muted); }

/* ---------- gestión del menú ---------- */
.grupo-menu { margin-bottom: 22px; }
.grupo-menu:last-child { margin-bottom: 0; }
.grupo-menu h3 {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-muted); margin: 0 0 8px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.grupo-menu h3 .tenue { color: var(--line); }
/* Qué es esta categoría para el sugerido del comensal. Va al margen y calladito:
   se toca una vez en la vida del restaurante. */
.tipo-cat {
  margin-left: auto; font: inherit; font-size: 10.5px; letter-spacing: .06em;
  color: var(--ink-muted); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; cursor: pointer;
}
.tipo-cat:hover { border-color: var(--accent); color: var(--ink); }
.tipo-cat:disabled { opacity: .5; cursor: wait; }

/* ---------- material de cada plato ----------
   Tres huecos siempre visibles: vacíos con borde punteado, para que se vea de
   un vistazo qué falta grabar. Un plato sin video se ve decente pero no vende;
   el hueco es el recordatorio. */
.fp-medios { display: flex; gap: 5px; flex: 0 0 auto; }
.hueco-medio {
  position: relative; width: 34px; height: 34px; padding: 0;
  border: 1.5px dashed var(--line); border-radius: 8px;
  background: var(--surface-2); cursor: pointer;
  display: grid; place-items: center; line-height: 1;
  transition: border-color .15s ease, transform .1s ease;
}
.hueco-medio span { font-size: 14px; opacity: .5; }
.hueco-medio:hover { border-color: var(--accent); }
.hueco-medio:active { transform: scale(.94); }
.hueco-medio.lleno { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.hueco-medio.lleno span { opacity: 1; }
.hueco-medio em {
  position: absolute; bottom: -1px; right: -1px;
  font-size: 7.5px; font-style: normal; font-family: var(--font-mono);
  background: var(--accent); color: var(--accent-ink);
  padding: 0 2px; border-radius: 3px 0 6px 0;
}
/* Sobre 3 MB ya se nota la espera en el WiFi de un restaurante. */
.hueco-medio.pesado { border-color: var(--st-new); background: var(--st-new-bg); }
.hueco-medio.pesado em { background: var(--st-new); color: #241703; }
.hueco-medio.subiendo { opacity: .45; pointer-events: none; }
.hueco-medio.subiendo::after {
  content: ""; position: absolute; inset: -1px; border-radius: 8px;
  border: 2px solid var(--accent); border-top-color: transparent;
  animation: girando .7s linear infinite;
}

.fila-plato {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto auto auto;
  gap: 14px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft);
}
.fila-plato:last-child { border-bottom: 0; }
.fila-plato.apagada { opacity: .55; }
.fp-info { min-width: 0; }
.fp-info b { display: block; font-size: 14px; font-weight: 600; }
.fp-info span {
  display: block; font-size: 12.5px; color: var(--ink-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-precio { font-size: 14px; font-weight: 700; white-space: nowrap; }
.fp-precio s { color: var(--ink-muted); font-weight: 400; font-size: 12.5px; }
.fp-stock { font-size: 12.5px; color: var(--ink-muted); white-space: nowrap; }
.fp-acciones { display: flex; gap: 6px; flex-wrap: wrap; }

.etiqueta {
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
}
.etiqueta.especial { color: var(--accent); background: var(--accent-soft); }
.etiqueta.oferta { color: var(--st-new); background: var(--st-new-bg); }
.etiqueta.fuera { color: var(--st-alert); background: var(--st-alert-bg); }

.dos-columnas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.campo textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; font: inherit; resize: vertical;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
}
.ayuda, .ayuda-nit { font-size: 12.5px; color: var(--ink-muted); margin: -4px 0 14px; line-height: 1.5; }
.marca-check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; font-size: 13.5px; }
.marca-check input { accent-color: var(--accent); width: 17px; height: 17px; margin-top: 2px; }
.marca-check em { display: block; font-style: normal; font-size: 12px; color: var(--ink-muted); }

/* ---------- mesas y códigos ---------- */
.rejilla-mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 14px; }
.tarjeta-mesa {
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px;
  text-align: center; background: var(--surface);
}
.tarjeta-mesa.inactiva { opacity: .5; }
.qr-caja { background: #fff; border-radius: 8px; padding: 8px; display: inline-block; line-height: 0; }
.qr-caja svg { width: 108px; height: 108px; }
.tarjeta-mesa b { display: block; font-size: 15px; margin-top: 9px; }
.estado-mesa { font-size: 11.5px; color: var(--ink-muted); }
.capacidad {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 7px 0 4px; font-size: 12px; color: var(--ink-muted);
}
.capacidad input {
  width: 52px; padding: 4px 7px; border-radius: 6px; text-align: center;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; font-family: var(--font-mono);
}
.token {
  display: block; font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-muted); margin: 6px 0 9px; word-break: break-all;
}
.acciones-mesa { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.nota-qr {
  margin: 18px 0 0; font-size: 13px; color: var(--ink-muted);
  border-top: 1px solid var(--line-soft); padding-top: 14px;
}

.sello.bueno {
  background: var(--accent-soft); color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.nota-propina {
  font-family: var(--font-ui); font-size: 11.5px; color: var(--ink-muted);
  margin: 14px 0 0; border-top: 1px solid var(--line-soft); padding-top: 10px;
}

.aviso {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 300;
  background: var(--ink); color: var(--bg);
  padding: 11px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: calc(100vw - 40px);
}
