/* Antoji Mesas — piel compartida de las pantallas de restaurante
   (centro de pedidos, cocina, simulador). Oscuro cálido + naranja Antoji. */
@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #0e0c0b; --panel: #171413; --panel-2: #1f1b19; --line: #2b2623; --line-2: #3a332f;
  --ink: #f6efe9; --muted: #a89f98; --faint: #6f6660;
  --accent: #ff6a3d; --accent-2: #ff8a5c; --accent-ink: #1c0a03; --accent-soft: rgba(255,106,61,.14);
  /* canales */
  --wa: #25d366; --wa-soft: rgba(37,211,102,.14);
  --dom: #f5a524; --dom-soft: rgba(245,165,36,.15);
  --rec: #38bdf8; --rec-soft: rgba(56,189,248,.15);
  --sal: #c084fc; --sal-soft: rgba(192,132,252,.15);
  --mes: #94a3b8; --mes-soft: rgba(148,163,184,.14);
  /* etapas */
  --st-nuevo: #ff6a3d; --st-cocina: #facc15; --st-listo: #2dd4bf; --st-entregado: #94a3b8;
  --danger: #f43f5e;
  --radius: 16px; --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: "Inter", system-ui, sans-serif; --display: "Fredoka", "Inter", sans-serif;
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--font); min-height: 100vh; }
body { -webkit-font-smoothing: antialiased; }
button { font-family: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- barra superior ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  background: rgba(23,20,19,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; }
.marca { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 1.15rem; white-space: nowrap; }
.marca .logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff9f45); color: var(--accent-ink); font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(255,106,61,.35); }
.marca small { display: block; font-family: var(--font); font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.marca b { color: var(--accent); font-weight: 600; }
.topbar .espacio { flex: 1; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .86rem; font-weight: 600; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.nav-links a:hover { background: var(--panel-2); color: var(--ink); }
.nav-links a.activo { background: var(--accent-soft); color: var(--accent); }
.vivo { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; color: var(--muted);
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; white-space: nowrap; }
.vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.vivo.on i { background: var(--wa); box-shadow: 0 0 0 0 rgba(37,211,102,.6); animation: latido 2s infinite; }
.vivo.on { color: var(--ink); }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.55); } 70% { box-shadow: 0 0 0 8px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }
.reloj { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: .95rem; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; display: grid; place-items: center; font-size: 1.05rem; transition: .15s; }
.icon-btn:hover { border-color: var(--line-2); background: var(--panel-2); }
.icon-btn .contador { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.icon-btn.sonando { animation: campana 1s ease 2; }
@keyframes campana { 0%,100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }

/* ---------- etiquetas de canal ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 4px 10px;
  border-radius: 99px; white-space: nowrap; line-height: 1.2; }
.tag svg { width: 13px; height: 13px; flex: none; }
.tag.wa  { background: var(--wa-soft);  color: var(--wa); }
.tag.dom { background: var(--dom-soft); color: var(--dom); }
.tag.rec { background: var(--rec-soft); color: var(--rec); }
.tag.sal { background: var(--sal-soft); color: var(--sal); }
.tag.mes { background: var(--mes-soft); color: var(--mes); }
.tag.cli { background: var(--panel-2); color: var(--ink); font-weight: 600; }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: 76px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 16px; border-radius: 14px;
  background: rgba(31,27,25,.96); border: 1px solid var(--line-2); box-shadow: var(--shadow); position: relative; overflow: hidden;
  animation: entra .45s cubic-bezier(.2,1.3,.4,1); border-left: 4px solid var(--t-color, var(--accent)); }
.toast.sale { animation: sale .3s ease forwards; }
.toast .t-ico { font-size: 1.5rem; line-height: 1; }
.toast .t-tit { font-weight: 800; font-size: .95rem; }
.toast .t-cue { color: var(--muted); font-size: .84rem; margin-top: 3px; }
.toast .t-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.toast .t-barra { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--t-color, var(--accent)); animation: barra linear forwards; }
@keyframes entra { from { opacity: 0; transform: translateX(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes sale { to { opacity: 0; transform: translateX(40px); } }
@keyframes barra { from { width: 100%; } to { width: 0; } }

/* ---------- pastilla de sonido ---------- */
.activar-sonido { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; padding: 12px 20px; border-radius: 99px;
  border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: .9rem; cursor: pointer; box-shadow: 0 8px 26px rgba(255,106,61,.45); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(900px 500px at 20% 0%, rgba(255,106,61,.16), transparent 60%), var(--bg); }
.card-login { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: var(--shadow); }
.card-login .marca { margin-bottom: 18px; }
.card-login h2 { font-family: var(--display); font-weight: 600; font-size: 1.4rem; margin-bottom: 4px; }
.card-login p { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.card-login label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
.card-login input { width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font-size: 1rem; }
.card-login input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--ink); font-weight: 700; font-size: .88rem; cursor: pointer; text-decoration: none; transition: .15s; }
.btn:hover { border-color: var(--faint); }
.btn.primario { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primario:hover { background: var(--accent-2); }
.btn.ancho { width: 100%; padding: 13px; font-size: 1rem; }
.error { color: var(--danger); font-size: .85rem; margin-top: 10px; }

/* ---------- animaciones comunes ---------- */
.aparece { animation: aparece .6s cubic-bezier(.2,1.2,.4,1); }
@keyframes aparece { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
.destello { animation: destello 1.2s ease 3; }
@keyframes destello { 0%,100% { box-shadow: 0 0 0 0 rgba(255,106,61,0); } 50% { box-shadow: 0 0 0 4px rgba(255,106,61,.55), 0 0 30px rgba(255,106,61,.35); } }

/* embebido en /demo: el menú lo pone la página de afuera */
.embebido .nav-links, .embebido #btn-salir, .embebido #btn-sonido { display: none !important; }
.embebido .topbar { display: none !important; }

@media (max-width: 720px) {
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .nav-links { order: 5; width: 100%; overflow-x: auto; }
  .marca small { display: none; }
}

/* ======================================================================
   Componentes de las secciones de negocio (Reportes, Corte, Personal,
   Ajustes…): mismas piezas en todas para que se sientan una sola app.
   ====================================================================== */
.pagina { max-width: 1320px; margin: 0 auto; padding: 22px 22px 60px; }
.pag-cab { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pag-cab h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; line-height: 1.1; }
.pag-cab p { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.pag-cab .espacio { flex: 1; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: .84rem; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .k-lbl { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi .k-val { font-family: var(--display); font-size: 1.9rem; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: .78rem; color: var(--faint); margin-top: 2px; }
.kpi.acc .k-val { color: var(--accent); } .kpi.wa .k-val { color: var(--wa); } .kpi.ok .k-val { color: var(--st-listo); }
.kpi.acc::after, .kpi.wa::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; filter: blur(30px); opacity: .45; }
.kpi.acc::after { background: var(--accent); } .kpi.wa::after { background: var(--wa); }
.rejilla { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-top: 14px; }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c7 { grid-column: span 7; } .c6 { grid-column: span 6; } .c5 { grid-column: span 5; } .c4 { grid-column: span 4; }
@media (max-width: 1000px) { .c8, .c7, .c6, .c5, .c4 { grid-column: span 12; } }
.caja-a { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.caja-a h3 { font-size: .8rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.caja-a h3 .espacio { flex: 1; }
.fila-dato { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.fila-dato:first-of-type { border-top: 0; }
.fila-dato .v { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.fila-dato.total { font-size: 1.1rem; } .fila-dato.total .v { color: var(--accent); font-family: var(--display); font-weight: 600; font-size: 1.4rem; }
.barras { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.barras .b { flex: 1; min-width: 4px; background: linear-gradient(180deg, var(--accent), rgba(255,106,61,.35)); border-radius: 6px 6px 2px 2px; position: relative; transition: height .6s cubic-bezier(.2,1,.3,1); cursor: default; }
.barras .b:hover { filter: brightness(1.25); }
.barras .b[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: .72rem; font-weight: 700; padding: 5px 8px; border-radius: 7px; white-space: nowrap; z-index: 5; }
.ejes { display: flex; gap: 4px; margin-top: 6px; } .ejes span { flex: 1; text-align: center; font-size: .66rem; color: var(--faint); min-width: 4px; overflow: hidden; }
.lista-top { display: flex; flex-direction: column; gap: 8px; }
.lista-top .it { display: flex; align-items: center; gap: 12px; }
.lista-top img, .lista-top .sinfoto { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: none; background: var(--panel-2); display: grid; place-items: center; }
.lista-top .nm { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; }
.lista-top .nm small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; }
.lista-top .barrita { height: 5px; border-radius: 99px; background: var(--panel-2); margin-top: 5px; overflow: hidden; }
.lista-top .barrita i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.lista-top .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th { text-align: left; font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tabla td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.tabla tr:hover td { background: var(--panel-2); }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.campo-a { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.campo-a input, .campo-a select, .campo-a textarea { padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font: inherit; font-size: .95rem; font-weight: 500; }
.campo-a input:focus, .campo-a select:focus, .campo-a textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form-fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.vacio-a { text-align: center; color: var(--faint); padding: 34px 10px; font-size: .9rem; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--panel-2); color: var(--muted); }
.pill.ok { background: rgba(45,212,191,.15); color: var(--st-listo); } .pill.acc { background: var(--accent-soft); color: var(--accent); }
.pill.off { background: rgba(244,63,94,.12); color: var(--danger); }
.interruptor { position: relative; width: 50px; height: 28px; flex: none; }
.interruptor input { opacity: 0; width: 0; height: 0; }
.interruptor span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); cursor: pointer; transition: .2s; }
.interruptor span::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .2s; }
.interruptor input:checked + span { background: var(--accent); }
.interruptor input:checked + span::before { transform: translateX(22px); }
.modal-a { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 80; padding: 16px; }
.modal-a > div { width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); animation: aparece .35s cubic-bezier(.2,1.2,.4,1); }
.modal-a h3 { font-family: var(--display); font-weight: 600; font-size: 1.3rem; margin-bottom: 14px; }
.modal-a .acciones { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.btn.peligro { color: var(--danger); border-color: rgba(244,63,94,.35); }
