/* Brasa — restaurant ops design system (dark, back-of-house).
   Self-contained, no external fonts/assets. Ember brand accent. */

:root {
  --bg: #0c0d11;
  --panel: #15171d;
  --panel-2: #1b1e26;
  --raised: #20242e;
  --line: #2a2e3a;
  --line-soft: #21242d;
  --text: #f3f4f6;
  --muted: #9aa0ad;
  --muted-2: #6c7280;
  --ember: #ff5a1f;
  --ember-soft: rgba(255, 90, 31, 0.14);
  --ember-line: rgba(255, 90, 31, 0.45);

  --new: #4f8cff;
  --new-soft: rgba(79, 140, 255, 0.14);
  --cook: #f5a623;
  --cook-soft: rgba(245, 166, 35, 0.14);
  --ready: #2fd07a;
  --ready-soft: rgba(47, 208, 122, 0.14);
  --late: #ff4d4d;
  --late-soft: rgba(255, 77, 77, 0.14);

  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

::selection { background: var(--ember); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--raised); }

/* ---------- App shell ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px; height: 60px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #15171d, #111319);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, #ff7a3c, var(--ember));
  display: grid; place-items: center; font-size: 15px;
  box-shadow: 0 4px 14px rgba(255, 90, 31, 0.4);
}
.brand small { color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: 0.04em; }

.topbar .spacer { flex: 1; }

.loc-switch {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px 6px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text);
}
.loc-switch .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ready); }
.loc-switch .caret { color: var(--muted); font-size: 11px; }

.clock { font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }

.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ready);
}
.live .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ready);
  box-shadow: 0 0 0 0 rgba(47, 208, 122, 0.6); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 208, 122, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(47, 208, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 208, 122, 0); }
}

/* ---------- Layout content ---------- */
.content { flex: 1; padding: 20px 22px 28px; }
.bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bar .title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.bar .sub { color: var(--muted); font-size: 13px; }

/* ---------- Channel chips / filters ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--raised); }
.chip.on { color: var(--text); border-color: var(--ember-line); background: var(--ember-soft); }
.chip .swatch { width: 9px; height: 9px; border-radius: 3px; }

/* ---------- Channel badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 7px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase;
}
.badge.salon   { background: rgba(79,140,255,.16);  color: #9dbcff; }
.badge.mostrador{ background: rgba(168,130,255,.16); color: #c5acff; }
.badge.web     { background: var(--ember-soft);     color: #ffb088; }
.badge.whatsapp{ background: rgba(47,208,122,.16);   color: #79e3ad; }
.badge.rappi   { background: rgba(255,77,77,.16);    color: #ff9a9a; }
.badge.uber    { background: rgba(160,165,175,.16);  color: #cfd3da; }

/* ---------- KDS ticket board ---------- */
.board {
  display: grid; gap: 14px; margin-top: 18px;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}
.ticket {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  animation: slidein 0.4s ease both;
}
@keyframes slidein { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.ticket.late { border-color: var(--late); box-shadow: 0 0 0 1px var(--late) inset, 0 8px 22px rgba(255,77,77,.12); }
.ticket.ready { border-color: var(--ready); }
.ticket-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px; border-bottom: 1px solid var(--line-soft); gap: 8px;
}
.ticket-head .who { font-weight: 700; font-size: 13.5px; }
.ticket-head .who small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; margin-top: 1px; }
.timer {
  font-family: var(--mono); font-size: 14px; font-weight: 700;
  padding: 3px 9px; border-radius: 7px; background: var(--ready-soft); color: var(--ready);
}
.timer.warn { background: var(--cook-soft); color: var(--cook); }
.timer.late { background: var(--late-soft); color: var(--late); }
.ticket-items { padding: 10px 13px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.item { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; }
.item .qty { color: var(--ember); font-weight: 800; min-width: 18px; }
.item .name { flex: 1; line-height: 1.35; }
.item .name em { color: var(--muted); font-style: normal; font-size: 11.5px; display: block; }
.station {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: 6px; white-space: nowrap; margin-top: 1px;
}
.station.parrilla { background: var(--ember-soft); color: #ffb088; }
.station.frios { background: rgba(79,140,255,.14); color: #9dbcff; }
.station.barra { background: rgba(168,130,255,.14); color: #c5acff; }
.ticket-foot { padding: 10px 13px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.btn:hover { border-color: var(--raised); background: var(--raised); }
.btn.primary { background: var(--ember); border-color: var(--ember); color: #fff; box-shadow: 0 4px 14px rgba(255,90,31,.3); }
.btn.primary:hover { background: #ff6a33; }
.btn.ready { background: var(--ready-soft); border-color: rgba(47,208,122,.4); color: var(--ready); }
.btn.ready:hover { background: rgba(47,208,122,.22); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; justify-content: center; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat .v { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.stat .v .unit { font-size: 15px; color: var(--muted); font-weight: 600; }
.stat .delta { font-size: 12px; font-weight: 700; margin-top: 4px; }
.stat .delta.up { color: var(--ready); }
.stat .delta.down { color: var(--late); }

/* ---------- Panels / cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.panel-body { padding: 16px 18px; }
.muted { color: var(--muted); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
tr:last-child td { border-bottom: none; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--raised); border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  box-shadow: 0 12px 34px rgba(0,0,0,.5); display: flex; align-items: center; gap: 9px;
  animation: toastin 0.3s ease both;
}
.toast .ic { color: var(--ember); }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Misc ---------- */
.tag-86 {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px;
  color: var(--late); background: var(--late-soft); padding: 4px 10px; border-radius: 7px;
}
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: 0.2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: 0.2s; }
.switch input:checked + .track { background: var(--late); }
.switch input:checked + .track::after { transform: translateX(17px); }
