@import url('fonts/faces.css');

/* ============================================================================
   BEEF FRY — STAFF SYSTEM
   Same clothes as the website: #0D0D0D ground, square corners, Archivo Black
   over Inter, red as the accent.

   One rule that outranks the brand, everywhere in here:
   FILLED RED IS RESERVED FOR "THIS ORDER IS LATE".
   Buttons use red, active tabs use red, but nothing else fills a whole panel
   with it and pulses. A cook glancing up from the grill has to be able to tell
   an urgent ticket from an ordinary one in less than a second, and that only
   works if the loudest thing on the screen is never used for decoration.
   Green means ready or paid; amber means money still owed. Both are separate
   from the accent and mean exactly one thing each.
   ========================================================================= */

:root {
  --dark: #0D0D0D;
  --card: #121212;
  --surface: #1A1A1A;
  --surface-2: #1F1F1F;
  --border: #262626;
  --border-lit: #3A3A3A;

  --red: #C91835;
  --red-bright: #D90429;
  --red-deep: #8E0B20;

  --text: #ECF0F3;
  --muted: #8E9AAF;
  --dim: #6B7280;

  --green: #16A34A;
  --green-lit: #4ADE80;
  --amber: #D97706;
  --amber-lit: #F59E0B;
  --blue: #3B82F6;

  --radius: 0px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Archivo Black', 'Archivo', Impact, sans-serif;
  --heading: 'Archivo', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--dark); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  overscroll-behavior: none; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400;
             text-transform: uppercase; letter-spacing: 0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--red-bright); }
::selection { background: var(--red); color: #fff; }

/* ---------------------------------------------------------------- shell */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; background: var(--card);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: baseline; gap: 8px; font-family: var(--display);
         font-size: 1.05rem; letter-spacing: 0.02em; }
.brand b { color: var(--red-bright); font-weight: 400; }
.brand span.role {
  font-family: var(--heading); font-size: 10px; letter-spacing: 0.22em; color: var(--dim);
  font-weight: 700; text-transform: uppercase;
  border-left: 1px solid var(--border); padding-left: 10px;
}
.topbar .spacer { flex: 1; }
.who { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.25; }
.who b { display: block; color: var(--text); font-size: 13px; font-weight: 600;
         text-transform: capitalize; }
.clock { font-family: var(--heading); font-weight: 700;
         font-variant-numeric: tabular-nums; color: var(--text); }

.dot { width: 8px; height: 8px; background: var(--green-lit); display: inline-block; }
.dot.off { background: var(--red-bright); }
.link-btn { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 6px;
            font-family: var(--heading); font-size: 11px; font-weight: 700;
            letter-spacing: 0.14em; text-transform: uppercase; }
.link-btn:hover { color: var(--text); }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-family: var(--heading); font-weight: 700; font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; transition: all 0.2s var(--ease); min-height: 46px; user-select: none;
}
.btn:hover:not(:disabled) { border-color: var(--border-lit); background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* The brand button. Red, but flat and small -- never a whole panel. */
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.red:hover:not(:disabled) {
  background: var(--red-bright); border-color: var(--red-bright); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.blue { background: var(--surface-2); border-color: var(--border-lit); color: var(--text); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; min-height: 34px; font-size: 10.5px; }
.btn.block { width: 100%; }
.btn.xl { font-size: 14px; padding: 16px; min-height: 58px; letter-spacing: 0.16em; }

/* --------------------------------------------------------------- inputs */
label.field { display: block; margin-bottom: 10px; }
label.field > span {
  display: block; font-family: var(--heading); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 5px; font-weight: 700;
}
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); }
textarea { resize: vertical; min-height: 60px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.card h2 {
  font-family: var(--heading); font-size: 11px; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
.empty { color: var(--dim); text-align: center; padding: 40px 20px; font-size: 14px; }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: var(--radius);
  font-family: var(--heading); font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.badge.queued     { color: var(--muted); border-color: var(--border-lit); }
.badge.in_process { color: var(--text); border-color: var(--text); }
.badge.ready      { color: var(--green-lit); border-color: var(--green); background: rgba(22,163,74,.12); }
.badge.served, .badge.collected, .badge.dispatched, .badge.delivered,
.badge.on_the_way { color: var(--dim); border-color: var(--border); }
.badge.void { color: var(--red-bright); border-color: var(--red-deep); }
.badge.dining   { color: var(--text);  border-color: var(--border-lit); }
.badge.takeaway { color: var(--muted); border-color: var(--border-lit); }
.badge.delivery { color: var(--green-lit); border-color: var(--green); }

/* ---------------------------------------------------------- order tiles */
.order-card {
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--border-lit);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.order-card.ready { border-left-color: var(--green); }
.order-card.in_process { border-left-color: var(--text); }

/* ---- the one filled-red thing in the whole system ---------------------- */
.order-card.late {
  border-color: var(--red-bright);
  border-left-color: var(--red-bright);
  background: linear-gradient(180deg, rgba(217, 4, 41, 0.20), rgba(217, 4, 41, 0.06));
  animation: pulse-late 1.5s ease-in-out infinite;
}
@keyframes pulse-late {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 4, 41, 0); }
  50%      { box-shadow: 0 0 0 5px rgba(217, 4, 41, 0.22); }
}
@media (prefers-reduced-motion: reduce) {
  .order-card.late { animation: none; border-left-width: 8px; }
}

.order-head { display: flex; align-items: flex-start; gap: 12px; }
.order-no { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--text); }
.order-card.late .order-no { color: var(--red-bright); }
.order-where { font-family: var(--heading); font-size: 15px; font-weight: 700;
               text-transform: uppercase; letter-spacing: 0.02em; }
.order-meta { font-size: 12px; color: var(--muted); }
.timer {
  margin-left: auto; text-align: right; font-family: var(--heading); font-weight: 700;
  font-variant-numeric: tabular-nums; font-size: 22px; color: var(--muted);
}
.order-card.late .timer { color: var(--red-bright); }

.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--surface); }
.items li:last-child { border-bottom: 0; }
.items .q { font-family: var(--heading); font-weight: 800; color: var(--text); min-width: 30px; }
.items .n { flex: 1; }
.items .note { display: block; font-size: 12px; color: var(--amber-lit); font-style: italic; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1; }

/* --------------------------------------------------------------- layout */
.pad { padding: 16px; }
.grid { display: grid; gap: 14px; }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--border);
        border-radius: var(--radius); padding: 14px; }
.stat .k { font-family: var(--heading); font-size: 10px; letter-spacing: 0.16em;
           text-transform: uppercase; color: var(--dim); font-weight: 700; }
.stat .v { font-family: var(--display); font-size: 26px; margin-top: 4px;
           font-variant-numeric: tabular-nums; }
.stat .v.red { color: var(--red-bright); }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; font-family: var(--heading); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--dim); font-weight: 700;
  padding: 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 10px; border-bottom: 1px solid var(--surface); vertical-align: middle;
                font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: var(--surface); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- toast */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-lit);
  border-left: 3px solid var(--red); border-radius: var(--radius);
  padding: 12px 16px; max-width: 340px; box-shadow: 0 16px 40px rgba(0,0,0,.6);
  animation: slide-in .2s ease;
}
.toast.error { border-left-color: var(--red-bright); }
.toast.ok { border-left-color: var(--green); }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.84); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; width: min(560px, 100%); max-height: 88vh; overflow: auto;
}
.modal h2 { font-size: 18px; margin-bottom: 14px; }

/* ----------------------------------------------------------- focus ring */
:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 2px; }
