/* ============================================================
   DUO food — Tema oscuro oliva-dorado
   Diseño táctil para iPad y celular + escritorio
   ============================================================ */

:root {
  --bg: #0B0F0B;
  --panel: #111711;
  --panel-2: #151C15;
  --card: #141A14;
  --card-hi: #1A231B;
  --borde: #233026;
  --borde-hi: #324434;

  --texto: #F1F4EF;
  --texto-2: #A9B2A9;
  --texto-3: #6E7A70;

  --oro: #78C858;
  --oro-suave: #5FAE4C;
  --oro-oscuro: #486838;
  --oro-trans: rgba(120, 200, 88, 0.13);

  --verde: #8FD97C;
  --rojo: #E5735C;
  --rojo-suave: rgba(229, 115, 92, 0.15);
  --verde-suave: rgba(143, 217, 124, 0.15);

  --radio: 18px;
  --radio-ch: 12px;
  --sombra: 0 10px 30px rgba(0, 0, 0, 0.45);
  --lateral: 236px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--texto);
  min-height: 100vh;
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(120, 200, 88, 0.06), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(72, 104, 56, 0.10), transparent 60%);
}

button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, textarea, select {
  background: var(--panel-2);
  border: 1.5px solid var(--borde);
  border-radius: var(--radio-ch);
  color: var(--texto);
  padding: 13px 14px;
  font-size: 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--oro-suave); }
input::placeholder, textarea::placeholder { color: var(--texto-3); }

::selection { background: var(--oro-trans); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--borde); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ ESTRUCTURA ============ */

.layout { display: flex; min-height: 100vh; }

/* ---------- Menú lateral ---------- */
.lateral {
  width: var(--lateral);
  background: linear-gradient(180deg, #111711 0%, #0C110C 100%);
  border-right: 1px solid var(--borde);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.logo-marca { position: relative; }
.logo-marca img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.logo-bloque { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.logo-marca {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(145deg, #16210F, #10150F);
  border: 2px solid var(--oro-suave);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--oro); font-size: 1.05rem; letter-spacing: 0.5px;
  flex-shrink: 0;
}
.logo-texto h1 { font-size: 1.02rem; font-weight: 800; letter-spacing: 0.3px; }
.logo-texto h1 em { color: var(--oro); font-style: normal; }
.logo-texto p { font-size: 0.72rem; color: var(--texto-3); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-etiqueta {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--texto-3); padding: 14px 12px 6px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 14px; border-radius: var(--radio-ch);
  color: var(--texto-2); font-size: 0.95rem; font-weight: 600;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-item svg { width: 21px; height: 21px; flex-shrink: 0; }
.nav-item:active { background: var(--card-hi); }
.nav-item.activo { background: var(--oro-trans); color: var(--oro); }
.nav-item.activo svg { color: var(--oro); }
.nav-item .badge {
  margin-left: auto; background: var(--oro); color: #141710;
  font-size: 0.68rem; font-weight: 800; border-radius: 99px;
  min-width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  padding: 0 7px;
}

.lateral-pie { margin-top: 12px; border-top: 1px solid var(--borde); padding-top: 14px; }
.usuario-chip {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: var(--radio-ch); background: var(--panel-2); width: 100%;
  border: 1px solid var(--borde); text-align: left;
}
.usuario-chip:active { background: var(--card-hi); }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem; color: #141710;
}
.usuario-chip .info { min-width: 0; }
.usuario-chip .info b { display: block; font-size: 0.9rem; }
.usuario-chip .info span { font-size: 0.7rem; color: var(--texto-3); }
.usuario-chip .cambiar { margin-left: auto; color: var(--texto-3); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---------- Contenido ---------- */
.contenido { flex: 1; min-width: 0; padding: 26px 28px 90px; max-width: 1280px; margin: 0 auto; width: 100%; }

.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.encabezado .saludo h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: 0.2px; }
.encabezado .saludo h2 em { font-style: normal; color: var(--oro); }
.encabezado .saludo p { color: var(--texto-3); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1.4px; margin-top: 5px; font-weight: 700; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 99px; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase;
}
.pill .punto { width: 8px; height: 8px; border-radius: 99px; }
.pill.linea { background: var(--verde-suave); color: var(--verde); border: 1px solid rgba(155,196,155,0.3); }
.pill.linea .punto { background: var(--verde); box-shadow: 0 0 8px var(--verde); animation: latido 2s infinite; }
.pill.fuera { background: var(--rojo-suave); color: var(--rojo); border: 1px solid rgba(226,149,120,0.3); }
.pill.fuera .punto { background: var(--rojo); }
@keyframes latido { 50% { opacity: 0.4; } }

/* ---------- Tarjetas ---------- */
.tarjeta {
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 20px;
}
.tarjeta h3 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--texto-3); font-weight: 800; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.tarjeta h3 .link { margin-left: auto; font-size: 0.72rem; color: var(--oro); text-decoration: none; letter-spacing: 0.5px; font-weight: 700; }
.tarjeta h3 svg { width: 15px; height: 15px; color: var(--oro-suave); }

.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { position: relative; overflow: hidden; }
.kpi .valor { font-size: 1.55rem; font-weight: 800; letter-spacing: 0.3px; line-height: 1.1; }
.kpi .detalle { font-size: 0.76rem; color: var(--texto-3); margin-top: 6px; }
.kpi .icono {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px;
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
}
.kpi .icono svg { width: 18px; height: 18px; }
.kpi.oro .valor { color: var(--oro); }
.kpi.oro .icono { background: var(--oro-trans); color: var(--oro); }
.kpi.verde .valor { color: var(--verde); }
.kpi.verde .icono { background: var(--verde-suave); color: var(--verde); }
.kpi.rojo .valor { color: var(--rojo); }
.kpi.rojo .icono { background: var(--rojo-suave); color: var(--rojo); }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; }

.cli-lista { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cli-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1.5px solid var(--borde); border-radius: var(--radio); padding: 12px 14px; }
.cli-card.fav { border-color: var(--oro-suave); background: var(--oro-trans); }
.cli-fav { background: none; border: none; font-size: 1.35rem; cursor: pointer; padding: 4px; flex-shrink: 0; color: var(--oro); line-height: 1; }
.cli-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cli-info b { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-info span { font-size: 0.78rem; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-acc { display: flex; gap: 6px; flex-shrink: 0; }
.cli-acc .btn { padding: 9px 11px; min-height: 42px; }

.cat-lista { display: flex; flex-direction: column; gap: 9px; }
.fila-cat { display: grid; grid-template-columns: 128px 1fr auto 38px; gap: 10px; align-items: center; }
.cat-nombre { font-size: 0.78rem; font-weight: 700; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-barra { height: 15px; background: var(--panel-2); border: 1px solid var(--borde); border-radius: 8px; overflow: hidden; }
.cat-barra i { display: block; height: 100%; border-radius: 7px; }
.cat-monto { font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.cat-pct { font-size: 0.75rem; color: var(--texto-3); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }

/* ---------- Gráfico ---------- */
.grafico-svg { width: 100%; height: auto; display: block; }
.grafico-leyenda { display: flex; gap: 16px; margin-top: 10px; }
.grafico-leyenda span { display: flex; align-items: center; gap: 7px; font-size: 0.74rem; color: var(--texto-2); }
.grafico-leyenda i { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Movimientos ---------- */
.mov-lista { display: flex; flex-direction: column; gap: 9px; }
.mov {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 15px; border-radius: var(--radio-ch);
  background: var(--panel-2); border: 1px solid var(--borde);
}
.mov .icono-mov {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.mov .icono-mov svg { width: 21px; height: 21px; }
.mov.ingreso .icono-mov { background: var(--verde-suave); color: var(--verde); }
.mov.egreso .icono-mov { background: var(--rojo-suave); color: var(--rojo); }
.mov .cuerpo { min-width: 0; flex: 1; }
.mov .cuerpo b { display: block; font-size: 0.93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov .cuerpo small { color: var(--texto-3); font-size: 0.74rem; display: flex; gap: 7px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.mov .monto { font-weight: 800; font-size: 0.98rem; white-space: nowrap; }
.mov.ingreso .monto { color: var(--verde); }
.mov.egreso .monto { color: var(--rojo); }
.mov .borrar { color: var(--texto-3); padding: 8px; border-radius: 9px; flex-shrink: 0; }
.mov .borrar:hover { color: var(--rojo); background: var(--rojo-suave); }
.mov .borrar svg { width: 16px; height: 16px; display: block; }

.tag {
  font-size: 0.66rem; padding: 3px 9px; border-radius: 99px;
  background: var(--card-hi); color: var(--texto-2); border: 1px solid var(--borde);
  font-weight: 700; white-space: nowrap;
}
.tag.persona { border: none; color: #141710; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 20px; border-radius: var(--radio-ch);
  font-weight: 800; font-size: 0.92rem; letter-spacing: 0.2px;
  background: var(--panel-2); color: var(--texto); border: 1.5px solid var(--borde);
  transition: transform 0.1s, background 0.15s;
  min-height: 48px; text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn.primario { background: linear-gradient(135deg, #78C858 0%, #5FAE4C 100%); color: #171A10; border: none; box-shadow: 0 6px 18px rgba(120, 200, 88, 0.28); }
.btn.peligro { background: var(--rojo-suave); color: var(--rojo); border-color: rgba(226, 149, 120, 0.3); }
.btn.fantasma { background: transparent; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.btn.bloque { width: 100%; }
.btn-fila { justify-content: flex-start; text-align: left; gap: 12px; margin-bottom: 8px; font-size: 1.05rem; }
.btn-fila:last-child { margin-bottom: 0; }
.btn-fila small { display: block; font-weight: 600; color: var(--texto-3); font-size: 0.76rem; margin-top: 2px; }

.fab {
  position: fixed; right: 22px; bottom: 92px; z-index: 60;
  width: 62px; height: 62px; border-radius: 21px;
  background: linear-gradient(135deg, #78C858, #5FAE4C);
  color: #171A10; box-shadow: 0 10px 26px rgba(120, 200, 88, 0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; font-weight: 700; line-height: 1;
  border: none;
}
.fab:active { transform: scale(0.93); }

/* ---------- Formularios ---------- */
.campo { margin-bottom: 15px; }
.campo label { display: block; font-size: 0.74rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--texto-2); margin-bottom: 7px; }

.segmentado { display: flex; background: var(--panel-2); border: 1.5px solid var(--borde); border-radius: var(--radio-ch); padding: 4px; gap: 4px; }
.segmentado button {
  flex: 1; padding: 11px 8px; border-radius: 9px; font-weight: 800; font-size: 0.88rem;
  color: var(--texto-2); transition: background 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.segmentado button svg { width: 15px; height: 15px; }
.segmentado button.activo.ing { background: var(--verde-suave); color: var(--verde); }
.segmentado button.activo.egr { background: var(--rojo-suave); color: var(--rojo); }
.segmentado button.activo.neutro { background: var(--oro-trans); color: var(--oro); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 15px; border-radius: 99px; font-size: 0.84rem; font-weight: 700;
  background: var(--panel-2); border: 1.5px solid var(--borde); color: var(--texto-2);
  min-height: 42px; display: inline-flex; align-items: center; gap: 6px;
}
.chip:active { transform: scale(0.96); }
.chip.activo { background: var(--oro-trans); border-color: var(--oro-suave); color: var(--oro); }

/* Botones dentro de un chip (◐ desactivar / 🗑️ eliminar): separados a propósito
   para que no se confundan y se toque uno por el otro en pantallas táctiles. */
.chip-tog, .chip-del {
  min-width: 30px; min-height: 30px; margin: -6px 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 0.9rem;
}
.chip-tog:active, .chip-del:active { background: rgba(255, 255, 255, 0.08); }
.chip-del { margin-left: 6px; padding-left: 10px; border-left: 1.5px solid var(--borde); transition: all 0.15s; }
/* Primer toque en 🗑️: "arma" el borrado y muestra "¿Borrar?" · segundo toque: borra al tiro */
.chip-del.confirmando, .btn.confirmando {
  width: auto; min-width: 0; border-radius: 99px;
  background: var(--rojo) !important; color: #fff !important; font-weight: 800;
  border-color: transparent !important; white-space: nowrap;
}
.chip-del.confirmando { padding: 0 10px 0 12px; font-size: 0.68rem; }
.btn.confirmando { font-size: 0.78rem; }

.input-monto { position: relative; }
.input-monto .peso {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--oro); font-weight: 800; font-size: 1.25rem;
}
.input-monto input {
  font-size: 1.5rem; font-weight: 800; text-align: center; letter-spacing: 1px;
  padding: 16px 14px 16px 44px; color: var(--oro);
}

/* ---------- Modal ---------- */
.modal-fondo {
  position: fixed; inset: 0; background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 400; display: flex; align-items: flex-end; justify-content: center;
  animation: aparecer 0.18s ease;
}
@keyframes aparecer { from { opacity: 0; } }
.modal {
  background: var(--panel); border: 1px solid var(--borde-hi);
  border-radius: 24px 24px 0 0; width: 100%; max-width: 520px;
  max-height: 92vh; overflow-y: auto; padding: 22px 22px 30px;
  animation: subir 0.22s ease;
}
@keyframes subir { from { transform: translateY(40px); opacity: 0.6; } }
.modal-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-cab h3 { font-size: 1.1rem; font-weight: 800; }
.modal-cerrar { width: 36px; height: 36px; border-radius: 11px; background: var(--panel-2); color: var(--texto-2); font-size: 1.1rem; display: flex; align-items: center; justify-content: center; border: 1px solid var(--borde); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 108px; transform: translateX(-50%) translateY(20px);
  background: #16241A; color: var(--texto); border: 1px solid rgba(143, 217, 124, 0.45);
  padding: 13px 22px; border-radius: 99px; font-weight: 700; font-size: 0.9rem;
  box-shadow: var(--sombra); z-index: 200; opacity: 0; pointer-events: none;
  transition: all 0.25s; display: flex; align-items: center; gap: 9px;
  max-width: 88vw; text-align: center;
}
#toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { border-color: rgba(226, 149, 120, 0.5); }

/* ---------- Selector de persona ---------- */
.puerta {
  position: fixed; inset: 0; z-index: 300; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px; text-align: center;
  background-image: radial-gradient(700px 500px at 50% -10%, rgba(120, 200, 88, 0.09), transparent 60%);
}
.puerta .logo-marca { width: 84px; height: 84px; border-radius: 24px; font-size: 1.7rem; margin-bottom: 18px; }
.puerta h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.puerta h1 em { color: var(--oro); font-style: normal; }
.puerta p { color: var(--texto-2); margin-bottom: 28px; font-size: 0.95rem; }
.puerta .personas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn-persona {
  display: flex; flex-direction: column; align-items: center; gap: 11px;
  background: var(--panel-2); border: 1.5px solid var(--borde);
  padding: 22px 30px; border-radius: var(--radio); min-width: 140px;
  transition: border-color 0.15s, transform 0.1s;
}
.btn-persona:active { transform: scale(0.96); }
.btn-persona .avatar { width: 54px; height: 54px; border-radius: 17px; font-size: 1.3rem; }
.btn-persona b { font-size: 1rem; }
.btn-persona span { font-size: 0.72rem; color: var(--texto-3); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }

/* ---------- Filtros ---------- */
.filtros { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filtros select { width: auto; padding: 10px 14px; font-size: 0.85rem; font-weight: 700; }
.filtros .segmentado { flex: 1; min-width: 210px; }

/* ---------- Vacío ---------- */
.vacio { text-align: center; padding: 40px 20px; color: var(--texto-3); }
.vacio .emoji { font-size: 2.6rem; margin-bottom: 12px; opacity: 0.85; }
.vacio b { display: block; color: var(--texto-2); margin-bottom: 5px; font-size: 0.95rem; }
.vacio p { font-size: 0.83rem; }

/* ---------- Pedidos ---------- */
.ped-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.ped-tab {
  padding: 10px 16px; border-radius: 99px; font-weight: 800; font-size: 0.82rem;
  background: var(--panel-2); border: 1.5px solid var(--borde); color: var(--texto-2);
  white-space: nowrap; display: flex; align-items: center; gap: 7px;
}
.ped-tab.activo { background: var(--oro-trans); border-color: var(--oro-suave); color: var(--oro); }
.ped-tab .n { background: var(--card-hi); border-radius: 99px; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; padding: 0 6px; }

.pedido { border-radius: var(--radio-ch); border: 1px solid var(--borde); background: var(--panel-2); padding: 15px; }
.pedido .cab { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pedido .num { font-weight: 800; color: var(--oro); font-size: 0.95rem; }
.pedido .items { color: var(--texto-2); font-size: 0.84rem; line-height: 1.55; margin-bottom: 12px; }
.pedido .pie { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pedido .total { font-weight: 800; font-size: 1.05rem; margin-right: auto; }
.acciones-pedido { display: flex; gap: 8px; flex-wrap: wrap; }
.acciones-pedido .btn { padding: 9px 14px; min-height: 42px; font-size: 0.8rem; }

.estado-p { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 4px 10px; border-radius: 99px; }
.estado-Pendiente { background: var(--oro-trans); color: var(--oro); }
.estado-Preparando { background: rgba(181,217,100,0.15); color: #B5D964; }
.estado-Listo { background: rgba(155,196,155,0.15); color: var(--verde); }
.estado-Entregado { background: var(--card-hi); color: var(--texto-3); }
.estado-Cancelado { background: var(--rojo-suave); color: var(--rojo); }
.estado-Confirmada { background: rgba(155,196,155,0.15); color: var(--verde); }
.estado-Rechazada, .estado-Cancelada { background: var(--rojo-suave); color: var(--rojo); }
.estado-Completada { background: var(--card-hi); color: var(--texto-3); }

.grid-pedidos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }

/* ---------- Carrito pedido nuevo ---------- */
.item-menu-fila {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  background: var(--panel-2); border: 1px solid var(--borde); border-radius: var(--radio-ch);
}
.item-menu-fila b { font-size: 0.88rem; display: block; }
.item-menu-fila small { color: var(--texto-3); font-size: 0.74rem; }
.item-menu-fila .precio { margin-left: auto; color: var(--oro); font-weight: 800; font-size: 0.85rem; white-space: nowrap; }
.cant-control { display: flex; align-items: center; gap: 2px; }
.cant-control button {
  width: 36px; height: 36px; border-radius: 10px; background: var(--card-hi);
  color: var(--oro); font-size: 1.2rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.cant-control button:disabled { opacity: 0.3; }
.cant-control span { min-width: 26px; text-align: center; font-weight: 800; }

/* ---------- Menú (admin) ---------- */
.grid-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.prod { background: var(--panel-2); border: 1px solid var(--borde); border-radius: var(--radio-ch); padding: 15px; }
.prod .fila1 { display: flex; align-items: flex-start; gap: 8px; }
.prod b { font-size: 0.93rem; line-height: 1.3; }
.desc-prod { color: var(--texto-3); font-size: 0.75rem; margin-top: 4px; line-height: 1.4; }
.prod .precio { color: var(--oro); font-weight: 800; margin: 7px 0 10px; font-size: 1rem; }

/* meta del día (Inicio) */
.meta-dia { margin-bottom: 14px; padding: 15px 18px; }
.meta-barra { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 10px; }
.meta-barra > div { height: 100%; border-radius: 99px; transition: width 0.5s; min-width: 4px; }

/* comparativa mes vs mes (Inicio) */
.comp-fila { display: grid; grid-template-columns: 62px 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 11px; }
.comp-lbl { font-size: 0.76rem; color: var(--texto-3); font-weight: 700; }
.comp-barras { display: flex; flex-direction: column; gap: 4px; }
.comp-bar { height: 6px; border-radius: 99px; min-width: 3px; }
.comp-val { font-size: 0.82rem; white-space: nowrap; }
.comp-delta { font-size: 0.74rem; font-weight: 800; white-space: nowrap; min-width: 48px; text-align: right; }
.comp-antes { font-size: 0.72rem; color: var(--texto-3); margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.06); padding-top: 9px; }

/* teclado de PIN (puerta) */
.pin-dots { text-align: center; font-size: 2rem; letter-spacing: 16px; min-height: 46px; color: var(--oro); font-weight: 800; }
.pin-dots.sacudir { animation: sacudir 0.45s; }
@keyframes sacudir { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.pin-error { text-align: center; color: var(--rojo); font-size: 0.8rem; font-weight: 700; min-height: 1.3em; margin-bottom: 10px; }
.pin-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-teclado button {
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--texto); border-radius: 14px; font-size: 1.4rem; font-weight: 800;
  padding: 15px 0; cursor: pointer; min-height: 58px; transition: background 0.15s;
}
.pin-teclado button:active { background: var(--oro); color: #0B0F0B; }
.pin-teclado .pin-fn { font-size: 1.1rem; color: var(--texto-2); }

/* chips de margen de ganancia (solo dueña) */
.chip-mg { display: inline-block; font-size: 0.66rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; margin-left: 8px; vertical-align: middle; letter-spacing: 0.2px; white-space: nowrap; }
.chip-mg.bueno { background: rgba(143, 217, 124, 0.13); color: var(--verde); border: 1px solid rgba(143, 217, 124, 0.32); }
.chip-mg.medio { background: rgba(232, 196, 104, 0.12); color: #E8C468; border: 1px solid rgba(232, 196, 104, 0.32); }
.chip-mg.bajo { background: rgba(229, 115, 92, 0.12); color: var(--rojo); border: 1px solid rgba(229, 115, 92, 0.32); }
.chip-mg.sin { background: transparent; color: var(--texto-3); border: 1px dashed var(--texto-3); opacity: 0.6; }
.mg-cat { display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600; padding: 7px 13px; border-radius: 99px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.07); white-space: nowrap; }
.mg-cat b { font-weight: 800; }
.prod .abajo { display: flex; align-items: center; gap: 8px; }
.prod .abajo .tag { margin-right: auto; }
.interruptor { position: relative; width: 46px; height: 26px; border-radius: 99px; background: var(--borde); transition: background 0.2s; flex-shrink: 0; }
.interruptor::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 99px; background: var(--texto-2); transition: all 0.2s; }
.interruptor.on { background: var(--oro-oscuro); }
.interruptor.on::after { left: 23px; background: var(--oro); }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; background: var(--card-hi); border: 1px solid var(--borde); color: var(--texto-2); display: flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.rojo:hover { color: var(--rojo); border-color: rgba(226,149,120,0.4); }

/* ---------- QR ---------- */
.qr-zona { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 8px 0 4px; }
.qr-marco {
  background: #FFFFFF; border-radius: 20px; padding: 14px; border: 5px solid var(--oro-oscuro);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); line-height: 0;
}
.qr-marco canvas { width: 180px; height: 180px; image-rendering: pixelated; border-radius: 6px; }
.qr-url { color: var(--texto-3); font-size: 0.75rem; word-break: break-all; margin-top: 8px; }

/* ---------- Caja ---------- */
.caja-monto { text-align: center; padding: 10px 0; }
.caja-monto .valor { font-size: 2.4rem; font-weight: 800; color: var(--oro); letter-spacing: 0.5px; }
.caja-monto .detalle { color: var(--texto-3); font-size: 0.8rem; margin-top: 5px; }
.fila-info { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px dashed var(--borde); font-size: 0.9rem; }
.fila-info:last-child { border-bottom: none; }
.fila-info span { color: var(--texto-2); }
.fila-info b { font-weight: 800; }
.diferencia-ok { color: var(--verde); }
.diferencia-mal { color: var(--rojo); }

/* ---------- Ajustes ---------- */
.ajuste-fila { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px dashed var(--borde); }
.ajuste-fila:last-child { border-bottom: none; }
.ajuste-fila .avatar { width: 42px; height: 42px; border-radius: 13px; font-size: 1.05rem; }
.ajuste-fila .info { flex: 1; min-width: 0; }
.ajuste-fila .info b { display: block; }
.ajuste-fila .info span { font-size: 0.75rem; color: var(--texto-3); }

/* ---------- Fotos de productos ---------- */
.foto-prod { position: relative; overflow: hidden; background: var(--card-hi); border: 1px solid var(--borde); }
.foto-prod span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.foto-prod img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-prod.xs { width: 46px; height: 46px; border-radius: 12px; }
.foto-prod.sm { width: 58px; height: 58px; border-radius: 14px; }
.foto-prod.md { width: 96px; height: 96px; border-radius: 18px; }

.prod-cab { display: flex; gap: 13px; margin-bottom: 11px; }
.prod-cab .prod-datos { flex: 1; min-width: 0; }

.foto-edit { display: flex; gap: 14px; align-items: center; }
.foto-edit .foto-prod { flex-shrink: 0; }
.foto-edit-acciones { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.foto-edit-acciones .btn { min-height: 44px; }

/* ---------- Tabla móvil: barra inferior ---------- */
.barra-tabs {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  background: rgba(11, 15, 11, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--borde);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.barra-tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--texto-3); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.3px;
  padding: 6px 12px; border-radius: 12px; text-decoration: none; position: relative;
}
.barra-tabs a svg { width: 22px; height: 22px; }
.barra-tabs a.activo { color: var(--oro); }
.barra-tabs a.activo::before {
  content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 99px; background: var(--oro);
}
.barra-tabs a .badge {
  position: absolute; top: 0; right: 4px; background: var(--oro); color: #141710;
  border-radius: 99px; min-width: 16px; height: 16px; font-size: 0.6rem;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 800;
}

.top-movil { display: none; }

/* ============ RESPONSIVE ============ */

@media (max-width: 1080px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2b { grid-template-columns: 1fr; }
}

@media (max-width: 899px) {
  .lateral { display: none; }
  .barra-tabs { display: flex; }
  .top-movil {
    display: flex; align-items: center; gap: 11px;
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 15, 11, 0.92);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--borde);
    padding: 12px 16px; margin: -26px -20px 18px;
  }
  .top-movil .logo-marca { width: 38px; height: 38px; border-radius: 12px; font-size: 0.85rem; }
  .barra-tabs { overflow-x: auto; scrollbar-width: none; }
  .barra-tabs a { padding: 6px 6px; font-size: 0.55rem; }
  .barra-tabs a svg { width: 19px; height: 19px; }
  .top-movil .icon-btn { width: 38px; height: 38px; font-size: 1.1rem; }
  .cli-card { flex-wrap: wrap; }
  .cli-acc { width: 100%; justify-content: flex-end; }
  .cli-acc .btn { flex: 1; }
  .fila-cat { grid-template-columns: 92px 1fr auto 30px; gap: 7px; }
  .cat-nombre { font-size: 0.72rem; }
  .cat-monto { font-size: 0.75rem; }
  .cat-barra { height: 13px; }
  .top-movil b { font-size: 0.95rem; }
  .top-movil b em { color: var(--oro); font-style: normal; }
  .top-movil .usuario-mini { margin-left: auto; }
  .top-movil .usuario-mini .avatar { width: 34px; height: 34px; border-radius: 11px; font-size: 0.85rem; }
  .contenido { padding: 18px 20px 110px; }
  .encabezado .saludo h2 { font-size: 1.3rem; }
  .fab { right: 16px; bottom: 84px; width: 58px; height: 58px; }
  #toast { bottom: 150px; }
}

@media (min-width: 900px) {
  .modal-fondo { align-items: center; padding: 20px; }
  .modal { border-radius: 24px; }
  .fab { bottom: 28px; right: 28px; }
  #toast { bottom: 40px; }
}

@media (max-width: 480px) {
  .grid-kpi { gap: 10px; }
  .kpi .valor { font-size: 1.3rem; }
  .contenido { padding: 14px 14px 104px; }
  .top-movil { margin: -14px -14px 14px; }
  .barra-tabs a { padding: 6px 7px; font-size: 0.58rem; }
  .barra-tabs a svg { width: 20px; height: 20px; }
}

/* ---------- Armador (elige base, proteína, ingredientes, salsas) ---------- */
.grupo { margin-top: 16px; }
.grupo h4 {
  font-size: 0.76rem; text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--texto-2); font-weight: 800; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.grupo h4 .contador { margin-left: auto; color: var(--oro); font-size: 0.72rem; }
.grupo h4 .req { color: var(--texto-3); font-size: 0.62rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.chips-sel { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-sel {
  padding: 10px 14px; border-radius: 99px; font-size: 0.84rem; font-weight: 700;
  background: var(--panel-2); border: 1.5px solid var(--borde); color: var(--texto-2);
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px;
}
.chip-sel:active { transform: scale(0.96); }
.chip-sel.activo { background: var(--oro-trans); border-color: var(--oro); color: var(--oro); }
.chip-sel .extra { font-size: 0.68rem; color: var(--oro); opacity: 0.85; }
.chip-sel:disabled { opacity: 0.35; }

/* ---------- Anular movimiento ---------- */
.borrar-mov {
  color: var(--texto-3); padding: 9px; border-radius: 10px; flex-shrink: 0;
  background: transparent; border: 1px solid transparent;
}
.borrar-mov:hover { color: var(--rojo); background: var(--rojo-suave); border-color: rgba(229,115,92,0.3); }
.borrar-mov svg { width: 16px; height: 16px; display: block; }

/* ---------- Banner sin conexión ---------- */
#bannerConexion {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  background: #4A2418; color: #FFD9CC;
  text-align: center; font-weight: 800; font-size: 0.82rem;
  padding: 10px 16px calc(10px + env(safe-area-inset-top));
  border-bottom: 2px solid var(--rojo);
}

/* ---------- Registrar venta / gasto por ítems ---------- */
.reg-op { display: flex; align-items: center; gap: 14px; }
.prod-sugerencias { display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow-y: auto; }
.sug-prod { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--borde); border-radius: 13px; padding: 10px 14px; cursor: pointer; color: var(--texto); font-size: 0.9rem; }
.sug-prod:hover { border-color: var(--oro); }
.sug-prod > span:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.linea-reg { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(143, 217, 124, 0.07); border: 1px solid rgba(143, 217, 124, 0.25); border-radius: 13px; margin-bottom: 8px; }
.linea-reg.egr { background: rgba(229, 115, 92, 0.07); border-color: rgba(229, 115, 92, 0.25); }

/* ---------- Impresión (comanda / comprobante / boleta) ----------
   No usamos window.open(): en la app instalada (PWA) en iPad/celular no abre nada
   y no avisa. En vez de eso llenamos #areaImprimir y llamamos a window.print()
   sobre la misma pantalla, escondiendo todo lo demás solo mientras se imprime. */
#areaImprimir { display: none; }
@media print {
  html, body { height: auto !important; overflow: visible !important; }
  body > *:not(#areaImprimir) { display: none !important; }
  /* position:fixed se pierde en muchos motores de impresión a PDF (queda en blanco) —
     por eso va en flujo normal, ocupando la página como cualquier documento imprimible. */
  #areaImprimir {
    display: block !important; position: static; width: 100%; background: #fff; color: #000;
    font-family: 'Courier New', monospace; font-size: 13px; padding: 10px;
  }
  #areaImprimir .centro { text-align: center; }
  #areaImprimir .logo-img { width: 60px; height: 60px; }
  #areaImprimir .marca { font-size: 17px; font-weight: bold; letter-spacing: 1px; margin-top: 4px; }
  #areaImprimir .sub { font-size: 11px; color: #333; }
  #areaImprimir .num, #areaImprimir .folio { font-size: 22px; font-weight: bold; margin: 8px 0 2px; letter-spacing: 2px; }
  #areaImprimir .linea { border-top: 1px dashed #000; margin: 8px 0; }
  #areaImprimir table { width: 100%; border-collapse: collapse; }
  #areaImprimir .total { font-size: 19px; font-weight: bold; }
  #areaImprimir .pago { font-size: 13px; }
  #areaImprimir .pie { font-size: 11px; margin-top: 8px; line-height: 1.6; }
  #areaImprimir .gracias { font-size: 13px; font-weight: bold; margin-top: 10px; }
  #areaImprimir .item { font-size: 15px; font-weight: bold; margin-top: 6px; }
  #areaImprimir .opc { font-size: 11px; margin-left: 14px; }
  #areaImprimir h2 { text-align: center; margin: 4px 0; letter-spacing: 1px; font-size: 17px; }
  #areaImprimir td { padding: 4px 0; font-size: 13px; }
  #areaImprimir .grande { font-size: 17px; }
  #areaImprimir .receta { page-break-inside: avoid; }
  #areaImprimir .titulo { font-size: 15px; font-weight: bold; text-align: center; margin-top: 6px; }
  #areaImprimir .rinde { font-size: 11px; text-align: center; margin-bottom: 4px; }
  #areaImprimir .ing { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
  #areaImprimir .ing span { overflow-wrap: anywhere; }
  #areaImprimir .ing b { white-space: nowrap; }
  #areaImprimir .paso { font-size: 12px; line-height: 1.45; }
  #areaImprimir .corte { text-align: center; font-size: 11px; color: #555; margin: 8px 0; letter-spacing: 2px; }
}

/* ---------- Editor de recetas: ingredientes y pasos ---------- */
.fila-ing-receta { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--borde); }
.fila-ing-receta:last-child { border-bottom: none; }
.fila-ing-receta input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--borde); border-radius: 10px;
  color: var(--texto); padding: 11px 12px; font-size: 0.88rem; min-height: 44px;
}
.fila-ing-receta-cant { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.fila-ing-receta-cant input:first-child { color: var(--verde); font-weight: 700; flex: 1; }
.fila-ing-receta-cant input:last-of-type { flex: 1; color: var(--texto-2); }
.fila-paso-receta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.fila-paso-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--oro-trans);
  color: var(--oro); font-weight: 800; font-size: 0.78rem; display: flex; align-items: center; justify-content: center;
}
.fila-paso-receta input {
  flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--borde); border-radius: 10px;
  color: var(--texto); padding: 11px 12px; font-size: 0.88rem; min-height: 44px;
}
