/* Commendix — clarity design (v5).
   The Terminal layout (header / KPI strip / three-region board) dressed in the
   soft palette: porcelain ground, white rounded cards, emerald + mandarine,
   Sora for numbers and headings, Manrope for text. One light look; the KDS
   screens are the dark twin. */
:root {
  --brand: #15a679;
  --brand-ink: #0c7a57;
  --brand-soft: #ddf2e8;
  --accent: #f57715;
  --forest: #0c1f1a;
  --forest-2: #14302a;
  --mint: #9fd6bd;

  --bg: #f1f0ea;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --surface-3: #eeede6;
  --border: #e2e1d8;
  --border-strong: #cbcabf;
  --hairline: rgba(20,30,25,.12);
  --text: #16201b;
  --text-2: #4c554f;
  --text-3: #878f88;
  --good: #0a8f66;
  --warn: #e19b00;
  --bad: #dd4a42;

  /* dataviz categorical */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --chart-surface: #fcfcfb; --grid: #ececea;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(18,26,21,.05), 0 6px 20px rgba(18,26,21,.06);
  --shadow-lg: 0 12px 44px rgba(18,26,21,.16);
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Sora', 'Manrope', -apple-system, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }

.hidden { display: none !important; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  transition: .12s ease; white-space: nowrap; }
.btn:hover { border-color: var(--text-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--bad); border-color: transparent; background: transparent; }
.btn.danger:hover { background: rgba(227,73,72,.1); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- forms ---------------- */
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none; transition: .12s; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

/* ---------------- auth screen ---------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), transparent); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 30px; }

/* two-column branded auth */
.auth-split { width: 100%; max-width: 900px; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); }
.auth-hero { background: linear-gradient(150deg, var(--brand), var(--brand-ink)); color: #fff; padding: 44px 38px;
  display: flex; flex-direction: column; }
.auth-hero .logo-svg, .auth-hero .logo-img { width: 56px; height: 56px; box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.auth-hero h2 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 26px 0 10px; line-height: 1.15; }
.auth-hero p.lead { font-size: 15px; opacity: .92; line-height: 1.55; }
.auth-features { margin-top: auto; padding-top: 30px; display: flex; flex-direction: column; gap: 15px; }
.auth-feature { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.auth-feature .fi { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.auth-feature b { display: block; font-weight: 700; }
.auth-feature span { opacity: .85; }
.auth-form-pane { padding: 40px 38px; display: flex; flex-direction: column; justify-content: center; }
.auth-form-pane .brand-mark { display: none; }
@media (max-width: 760px) {
  .auth-split { grid-template-columns: 1fr; max-width: 440px; }
  .auth-hero { padding: 30px 28px; }
  .auth-hero .auth-features { display: none; }
  .auth-hero h2 { font-size: 22px; }
}
.brand-mark { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.brand-logo { width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0; }
.logo-svg, .logo-img { width: 100%; height: 100%; border-radius: 24%; display: block; object-fit: contain;
  box-shadow: 0 4px 12px rgba(11,107,94,.28); }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.tabs { display: flex; gap: 4px; background: var(--surface-3); padding: 4px; border-radius: 11px; margin: 22px 0; }
.tabs button { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 8px; font-weight: 600; color: var(--text-2); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.form-error { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------------- app shell ---------------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand-mark { padding: 0 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 600; font-size: 14px; position: relative; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav a .ico { width: 20px; text-align: center; font-size: 16px; }
.nav a .badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; }
.side-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; font-size: 13px; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px); z-index: 5; }
.topbar h1 { font-size: 20px; }
.content { padding: 24px 28px 60px; max-width: 1120px; }
.page { display: none; }
.page.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- cards / grids ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; }
.card h3 { font-size: 15px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.stat-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .label { font-size: 13px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.stat .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------------- tables / menu ---------------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.cat-head td { background: var(--surface-3); font-weight: 700; font-size: 13px; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.on { background: rgba(18,140,126,.14); color: var(--good); }
.pill.off { background: var(--surface-3); color: var(--text-3); }
.pill.new { background: rgba(42,120,214,.14); color: var(--s1); }
.pill.preparing { background: rgba(237,161,0,.16); color: #a06c00; }
.pill.ready { background: rgba(18,140,126,.14); color: var(--good); }
.pill.done { background: var(--surface-3); color: var(--text-3); }


/* ---------------- orders board ---------------- */
.ord-groups { display: flex; flex-direction: column; gap: 26px; }
.ord-group { animation: fade .2s ease; }
.ord-group-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.ord-group-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.ord-group-count { min-width: 22px; padding: 1px 8px; border-radius: 999px; text-align: center;
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--surface-3); color: var(--text-2); }
.ord-group-count--received { background: rgba(42,120,214,.14); color: var(--s1); }
.ord-group-count--preparing { background: rgba(237,161,0,.18); color: #a06c00; }
.ord-group-count--ready { background: rgba(18,140,126,.16); color: var(--good); }

.ord-group-hint { font-size: 12.5px; color: var(--text-3); }
.ord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.ord-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 15px 16px 14px 20px; overflow: hidden; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  animation: fade .2s ease; }
/* status is the loudest signal on a busy board: a colored spine down the card */
.ord-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ord-accent, var(--border-strong)); }
.ord-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.ord-card.st-received { --ord-accent: var(--s1); }
.ord-card.st-preparing { --ord-accent: var(--warn); }
.ord-card.st-ready { --ord-accent: var(--good); }
.ord-card.st-done { --ord-accent: var(--border-strong); opacity: .6; }
.ord-card.st-done:hover { opacity: 1; }

.ord-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ord-code { font-size: 17px; font-weight: 800; letter-spacing: .07em; font-variant-numeric: tabular-nums; }
.ord-pos-badge { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 8px;
  background: var(--brand); color: #fff; letter-spacing: .02em; }
.ord-time { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.ord-cust { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-size: 14px; font-weight: 600; }
.ord-av, .conv-av { width: 28px; height: 28px; border-radius: 9px; background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; letter-spacing: .02em; }
.ord-items { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 8px; }
.ord-item { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.ord-qty { flex-shrink: 0; min-width: 28px; padding: 2px 6px; border-radius: 7px; background: var(--brand-soft);
  color: var(--brand-ink); font-weight: 800; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }

.ord-item-name { flex: 1; min-width: 0; }
.ord-note { display: block; font-size: 12px; color: var(--text-3); font-style: italic; margin-top: 1px; }
.ord-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
/* the price must never wrap to two lines — it's the first thing she reads */
.ord-total { font-size: 19px; font-weight: 800; letter-spacing: -.02em; margin-right: auto; white-space: nowrap; }
.ord-conv { padding: 6px 9px; }

/* the one action: mark ready + link the POS ticket number */
.ord-pos { margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border); animation: fade .18s ease; }
.ord-pos label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.ord-pos-row { display: flex; gap: 8px; }
.ord-pos-row input { flex: 1; min-width: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.ord-empty { text-align: center; padding: 52px 20px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius); color: var(--text-2); background: var(--surface-2); }
.ord-empty-ico { font-size: 38px; opacity: .5; margin-bottom: 6px; }
.ord-empty p { margin: 6px 0 0; }

/* ---------------- ticket board (TV / kitchen / dashboard tab) ----------------
   Read from across a room, so everything is sized in vw and the tiles shrink as
   the board fills. Ported from the Mixte Dinde shop board. */
.tk-body { margin: 0; background: var(--bg); }
.tk-screen { min-height: 100vh; display: flex; flex-direction: column; }
.tk-top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 26px; border-bottom: 1px solid var(--border); background: var(--surface); }
.tk-brand { display: flex; align-items: center; gap: 12px; font-size: clamp(16px, 1.8vw, 24px); font-weight: 800; letter-spacing: -.01em; }
.tk-logo { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; }
.tk-clock { font-size: clamp(16px, 1.8vw, 24px); font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tk-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 26px; border-top: 1px solid var(--border); background: var(--surface);
  font-size: clamp(11px, 1.1vw, 15px); color: var(--text-3); }
.tk-live { color: var(--good); font-weight: 700; white-space: nowrap; }

.tk-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px 26px; min-height: 0; }
.tk-grid--panel { min-height: 62vh; padding: 0; }
.tk-col { display: flex; flex-direction: column; min-height: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tk-col-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.tk-col-label { font-size: clamp(15px, 1.7vw, 26px); font-weight: 800; letter-spacing: -.01em; }
.tk-count { min-width: 34px; padding: 2px 10px; border-radius: 999px; text-align: center;
  font-size: clamp(13px, 1.3vw, 19px); font-weight: 800; font-variant-numeric: tabular-nums; }
.tk-count--preparing { background: rgba(237,161,0,.18); color: #a06c00; }
.tk-count--ready { background: rgba(18,140,126,.16); color: var(--good); }
.tk-count--pressing { background: rgba(237,161,0,.28); color: #7a5410; }

/* Two kitchen stations: the board grows a third column. The screen is in the
   corner of an L-shaped kitchen — one station garnishes, the other presses. */
.tk-grid--deux { grid-template-columns: 1fr 1fr 1fr; }
.tk-postes {
  font: inherit; font-weight: 800; font-size: .78rem; letter-spacing: .04em;
  text-transform: uppercase; color: inherit;
  background: rgba(255,255,255,.14); border: 1.5px solid rgba(255,255,255,.45);
  border-radius: 99px; padding: 6px 16px; margin-left: auto; margin-right: 14px; cursor: pointer;
}
.tk-postes:hover { background: rgba(255,255,255,.26); }

/* Changing station count mid-service moves someone's work: confirm first. */
.confirme {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center;
  justify-content: center; padding: 20px; background: rgba(16,18,24,.62);
}
.confirme__boite {
  width: 520px; max-width: 100%; background: #fff; border-radius: 10px;
  padding: 22px 24px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.38); color: #14263f;
}
.confirme__titre { margin: 0 0 10px; font-size: 1.25rem; }
.confirme__texte { margin: 0 0 12px; font-size: .98rem; line-height: 1.5; color: #40506a; }
.confirme__chiffre {
  margin: 0 0 14px; font-size: .95rem; font-weight: 700; color: #7a5410;
  background: #fdf3dc; border-radius: 7px; padding: 10px 12px;
}
.confirme__actions { display: flex; justify-content: flex-end; gap: 10px; }
.confirme__non, .confirme__oui {
  font: inherit; font-weight: 700; font-size: 1rem; padding: 11px 20px;
  border-radius: 7px; cursor: pointer;
}
.confirme__non { border: 1.5px solid #dbe3ef; background: #fff; color: #14263f; }
.confirme__oui { border: 0; background: #14263f; color: #fff; }

.tk-empty { color: var(--text-3); font-size: clamp(12px, 1.2vw, 16px); text-align: center; margin: auto 0; }
.tk-list { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.tk-list--split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tk-sub { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.tk-tile { display: flex; align-items: baseline; gap: 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-left: 5px solid var(--warn); border-radius: var(--radius-sm);
  padding: 9px 14px; animation: fade .2s ease; }
.tk-tile--lg { padding: 12px 18px; }
.tk-tile--md { padding: 7px 14px; }
.tk-tile--sm { padding: 4px 11px; }
.tk-tile--ready { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 9%, var(--surface-2)); }
.tk-num { font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.tk-tile--lg .tk-num { font-size: clamp(30px, 3.6vw, 58px); }
.tk-tile--md .tk-num { font-size: clamp(22px, 2.5vw, 40px); }
.tk-tile--sm .tk-num { font-size: clamp(16px, 1.8vw, 28px); }
.tk-tile--ready .tk-num { color: var(--good); }
.tk-when { margin-left: auto; color: var(--text-3); font-size: clamp(10px, 1vw, 14px); white-space: nowrap; }
.tk-tile--tap { cursor: pointer; transition: transform .1s ease, border-color .12s ease; }
.tk-tile--tap:hover { border-color: var(--brand); }
.tk-tile--tap:active { transform: scale(.985); }
.tk-action { color: var(--good); font-weight: 800; font-size: clamp(11px, 1.1vw, 15px); white-space: nowrap; }

.tk-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.tk-links { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-addnum { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 16px; max-width: 460px; animation: fade .18s ease; }
.tk-addnum label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.tk-addnum input { font-weight: 700; font-variant-numeric: tabular-nums; }
/* delivery marker — the quartier is the payload the cashier reads to the driver */
.tk-zone { font-size: clamp(11px, 1.1vw, 16px); font-weight: 700; color: var(--text-2);
  background: var(--surface-3); border-radius: 8px; padding: 2px 9px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.ord-deliv { margin-left: auto; font-size: 12.5px; font-weight: 800; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; padding: 3px 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }

/* the ready column is a "done" affordance, not a warning — keep the hover calm */
.tk-tile--ready.tk-tile--tap:hover { border-color: var(--good); }
.tk-tile--ready .tk-action { color: var(--text-3); }
@media (max-width: 720px) { .tk-grid { grid-template-columns: 1fr; } .tk-list--split { grid-template-columns: 1fr; } }

/* ---------------- conversations ---------------- */
.conv-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: calc(100vh - 150px); }
.conv-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-y: auto;
  scroll-behavior: smooth; }
.conv-item { display: flex; gap: 11px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; position: relative; transition: background .16s ease, padding-left .16s ease; }
.conv-item::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand); opacity: 0; transition: opacity .16s ease; }
.conv-item:hover { background: var(--surface-3); }
.conv-item.active { background: var(--brand-soft); padding-left: 18px; }
.conv-item.active::before { opacity: 1; }
.conv-item.active .conv-av { background: var(--brand); color: #fff; }
.conv-main { min-width: 0; flex: 1; }
.conv-item .top { display: flex; align-items: center; gap: 8px; }
.conv-item .name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-when { margin-left: auto; font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.conv-item .prev { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.flag { font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); padding: 2px 7px; border-radius: 8px; }
.flag.human { background: var(--bad); }

.thread { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.thread-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.thread-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.thread-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; padding: 18px; background:
  linear-gradient(var(--surface-2), var(--surface-2)); display: flex; flex-direction: column; gap: 8px; }
.thread-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.thread-compose input { flex: 1; }
.bubble { max-width: 76%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow);
  animation: bubbleIn .22s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none; }
  .conv-list, .thread-body { scroll-behavior: auto; }
  .ord-card, .ord-card:hover { transition: none; transform: none; }
}
.bubble .meta { font-size: 10px; opacity: .6; margin-top: 4px; text-align: right; }
.bubble.in { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 4px; }
.bubble.bot { align-self: flex-end; background: #d9fdd3; color: #0a0a0a; border-bottom-right-radius: 4px; }
.bubble.agent { align-self: flex-end; background: var(--s1); color: #fff; border-bottom-right-radius: 4px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(0,0,0,.06); border: 1px solid rgba(0,0,0,.08); color: inherit; }


/* ---------------- back-office ---------------- */
.adm-shell { min-height: 100vh; background: var(--bg); }
.adm-top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border); }
.adm-top .brand-mark { margin: 0; }
.adm-top-right { display: flex; align-items: center; gap: 12px; }
.adm-main { max-width: 1100px; margin: 0 auto; padding: 28px 24px 70px; }
.adm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.adm-head h1 { font-size: 24px; }

.adm-add { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 22px; animation: fade .18s ease; }
.adm-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.adm-add-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.adm-list { display: flex; flex-direction: column; gap: 14px; }
.adm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; }
.adm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.adm-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.adm-avatar { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }

.adm-name { font-weight: 800; font-size: 16px; }
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px;
  margin: 16px 0; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.adm-stats div { display: flex; flex-direction: column; gap: 1px; }
.adm-stats b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }

.adm-feats-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-3); margin-bottom: 10px; }
.adm-feats { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.adm-feats-label { width: 100%; }
.adm-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.adm-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.adm-switch-track { width: 40px; height: 23px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border-strong); position: relative; transition: background .16s ease, border-color .16s ease; flex-shrink: 0; }
.adm-switch-dot { position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .16s ease; }
.adm-switch input:checked + .adm-switch-track { background: var(--brand); border-color: var(--brand); }
.adm-switch input:checked + .adm-switch-track .adm-switch-dot { transform: translateX(17px); }
.adm-switch input:focus-visible + .adm-switch-track { box-shadow: 0 0 0 3px var(--brand-soft); }
.adm-switch input:disabled + .adm-switch-track { opacity: .55; }
.adm-switch-label { font-size: 14px; font-weight: 600; }

/* ---------------- toast ---------------- */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: slideIn .25s ease; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------------- charts ---------------- */
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.chart-legend .k { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; padding: 7px 0; font-size: 14px; }
.bar-track { background: var(--surface-3); border-radius: 5px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: var(--s1); }

/* ---------------- phone simulator ---------------- */
.sim-stage { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 600px at 20% 0%, #dff3ef, transparent), radial-gradient(1000px 600px at 100% 100%, #fde6da, transparent), var(--bg); }

.sim-cols { display: grid; grid-template-columns: auto 300px; gap: 30px; align-items: start; }
@media (max-width: 820px) { .sim-cols { grid-template-columns: 1fr; } }
.phone { width: 360px; max-width: 92vw; height: 720px; max-height: 88vh; background: #0b141a; border-radius: 40px; padding: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 2px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.phone-screen { flex: 1; border-radius: 30px; overflow: hidden; display: flex; flex-direction: column; background: #e5ddd5; }

.wa-head { background: var(--brand-ink); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.wa-head .av { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 18px; overflow: hidden; }
.wa-head .av .logo-svg, .wa-head .av .logo-img { box-shadow: none; border-radius: 0; }
.wa-head .nm { font-weight: 700; font-size: 15px; }
.wa-head .st { font-size: 12px; opacity: .85; }
.wa-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 7px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23000' stroke-opacity='0.02'/%3E%3C/svg%3E"); }
.wa-in { display: flex; gap: 8px; padding: 10px; background: var(--surface-2); border-top: 1px solid var(--border); }
.wa-in input { flex: 1; border-radius: 22px; padding: 10px 16px; }
.wa-send { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; border: none; font-size: 18px; display: grid; place-items: center; flex-shrink: 0; }
.sim-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.sim-panel h3 { font-size: 15px; margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--text-3); background: var(--surface-3); padding: 10px 12px; border-radius: 10px; margin-top: 10px; line-height: 1.5; }

/* ---------------- V2 digital menu (public catalogue) ---------------- */
.dm-body { background: var(--bg); }
.dm-app { max-width: 640px; margin: 0 auto; padding-bottom: 90px; }
.dm-hero { background: linear-gradient(135deg, var(--brand), var(--brand-ink)); color: #fff; padding: 26px 20px 22px; }
.dm-hero-inner { display: flex; align-items: center; gap: 14px; max-width: 640px; margin: 0 auto; }
.dm-logo { width: 54px; height: 54px; display: grid; place-items: center; font-size: 28px; flex-shrink: 0; }
.dm-logo .logo-svg, .dm-logo .logo-img { box-shadow: 0 6px 16px rgba(0,0,0,.22); }
.dm-hero h1 { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.dm-sub { font-size: 13px; opacity: .9; margin-top: 2px; }
.dm-cats { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); scrollbar-width: none; }
.dm-cats::-webkit-scrollbar { display: none; }
.dm-cat { flex-shrink: 0; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: .12s; }
.dm-cat.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.dm-menu { padding: 8px 16px 20px; }
.dm-cat-block { scroll-margin-top: 62px; padding-top: 14px; }
.dm-cat-title { font-size: 17px; margin: 6px 0 12px; }
.dm-items { display: flex; flex-direction: column; gap: 10px; }
.dm-item { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.dm-item-tile { width: 58px; height: 58px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; font-size: 28px; flex-shrink: 0; }
.dm-item-main { flex: 1; min-width: 0; }
.dm-item-name { font-weight: 700; font-size: 15px; }
.dm-item-desc { font-size: 13px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-item-price { font-size: 14px; font-weight: 700; color: var(--brand-ink); margin-top: 5px; }

.dm-add { width: 38px; height: 38px; border-radius: 11px; border: none; background: var(--brand); color: #fff;
  font-size: 22px; font-weight: 400; flex-shrink: 0; display: grid; place-items: center; box-shadow: 0 3px 9px rgba(18,140,126,.35); transition: transform .12s; }
.dm-add:active { transform: scale(.9); }
.dm-add.pop { animation: addpop .3s ease; }
@keyframes addpop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

.dm-cartbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 20;
  width: min(608px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px;
  background: var(--brand); color: #fff; border: none; padding: 14px 18px; border-radius: 14px;
  font-size: 15px; font-weight: 700; box-shadow: var(--shadow-lg); }
.dm-cartbar-count { background: rgba(255,255,255,.25); min-width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; }
.dm-cartbar-total { margin-left: auto; }

.dm-sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.dm-sheet { background: var(--surface); width: min(640px, 100%); max-height: 90vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: sheetUp .25s ease; }
@keyframes sheetUp { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.dm-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.dm-sheet-head h2 { font-size: 18px; }
.dm-sheet-body { overflow-y: auto; padding: 6px 20px; }
.dm-sheet-foot { padding: 14px 20px 22px; border-top: 1px solid var(--border); }
.dm-line { padding: 13px 0; border-bottom: 1px solid var(--border); }
.dm-line-top { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; }
.dm-note { width: 100%; margin: 8px 0; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); font-size: 13px; }
.dm-stepper { display: flex; align-items: center; gap: 12px; }
.dm-stepper button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 18px; }
.dm-stepper span { font-weight: 700; min-width: 18px; text-align: center; }
.dm-rm { margin-left: auto; border: none !important; background: transparent !important; }
.dm-total-row { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 12px; }
.dm-total-row b { font-size: 19px; }
.dm-checkout { width: 100%; padding: 14px; font-size: 15px; }
.dm-recap-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; margin: 4px 0 8px; }
.dm-recap { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.dm-recap div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.dm-recap span { color: var(--text-2); font-weight: 600; }
.dm-note-info { font-size: 13px; color: var(--text-3); margin-top: 10px; line-height: 1.5; }
.dm-success { text-align: center; padding: 20px 0 10px; }
.dm-success-ico { font-size: 46px; }
.dm-success p { margin: 8px 0; }
.dm-code { font-size: 34px; font-weight: 800; letter-spacing: .1em; color: var(--brand-ink); margin: 10px 0; font-variant-numeric: tabular-nums; }


/* QR / share card on the dashboard menu tab */
.qr-card { text-align: center; }
.qr-box { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); margin: 6px 0 12px; }
.qr-box svg { display: block; }
.dm-link-row { display: flex; gap: 8px; margin-top: 8px; }
.dm-link-row input { font-size: 13px; }

/* mobile shell */
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; transform: translateX(-100%); transition: .2s; width: 232px; }
  .side.open { transform: none; }
  .conv-layout { grid-template-columns: 1fr; height: auto; }
  .content { padding: 16px; }
  .menu-toggle { display: inline-grid !important; }
}
.menu-toggle { display: none; }




/* ================= clarity layer (v5): Terminal layout, soft skin ================= */
h1, h2, h3, .brand-name, .stat .value, .tb-num, .term-v, .term-clock, .tk-num, .tk-col-label, .adm-name, .dm-hero h1, .auth-hero h2, .dm-code {
  font-family: var(--display); }
.brand-x { color: var(--accent); }
@keyframes cmdx-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- header: forest bar with tenant, clock, LIVE ---- */
.shell { display: block; }
.term-head { display: flex; align-items: center; gap: 18px; padding: 10px 22px;
  background: var(--forest); box-shadow: 0 6px 24px rgba(10,20,15,.25); }
.term-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.term-brand .brand-logo { width: 34px; height: 34px; }
.term-brand .brand-name { color: #fff; font-size: 19px; }
.term-tenant { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.term-tenant-name { font: 700 15px var(--font); color: #fff; }
.term-tenant-sub { font: 600 10.5px var(--font); letter-spacing: .06em; color: var(--mint); text-transform: uppercase; }
.term-headright { display: flex; align-items: center; gap: 14px; }
.term-clockbox { display: flex; flex-direction: column; align-items: flex-end; }
.term-clock { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.term-date { font: 600 9.5px var(--font); letter-spacing: .1em; color: var(--mint); }
.term-live { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px;
  background: var(--brand); color: #fff; font: 800 11px var(--font); letter-spacing: .08em; }
.term-dot { width: 8px; height: 8px; background: #fff; border-radius: 50%; animation: cmdx-pulse 1.8s infinite; }
@media (prefers-reduced-motion: reduce) { .term-dot { animation: none; } }

/* ---- nav: light pill tabs under the header ---- */
.term-nav { display: flex; align-items: center; gap: 6px; padding: 10px 22px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; overflow-x: auto; scrollbar-width: none; }
.term-nav::-webkit-scrollbar { display: none; }
.term-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px;
  font: 700 13.5px var(--font); color: var(--text-2); white-space: nowrap; transition: .14s ease; }
.term-nav a:hover { background: var(--surface-3); color: var(--text); }
.term-nav a.active { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(10,143,102,.3); }
.term-nav .badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; }
.term-nav-spacer { flex: 1; }
.term-nav-ext { color: var(--text-3); font-size: 13px !important; }

.main { max-width: 1400px; margin: 0 auto; }
.topbar { position: static; background: transparent; border-bottom: none; backdrop-filter: none; padding: 22px 24px 0; }
.topbar h1 { font-size: 24px; letter-spacing: -.02em; }
.content { max-width: none; padding: 16px 24px 60px; }

/* ---- KPI strip: stat cards + the create button ---- */
.term-strip { display: flex; align-items: stretch; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.term-cells { display: flex; flex: 1; gap: 12px; min-width: 0; overflow-x: auto; }
.term-cell { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 4px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  position: relative; overflow: hidden; }
.term-cell::after { content: ''; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--brand), transparent 70%); opacity: .45; }
.term-k { font: 700 11px var(--font); letter-spacing: .07em; color: var(--text-3); text-transform: uppercase; }
.term-v { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; white-space: nowrap; font-variant-numeric: tabular-nums; }
.term-new { border: none; border-radius: var(--radius); background: linear-gradient(180deg, #10a877, var(--brand));
  color: #fff; padding: 0 24px; cursor: pointer; font: 800 14px var(--font); display: flex; align-items: center; gap: 9px;
  white-space: nowrap; box-shadow: 0 4px 14px rgba(10,143,102,.35); }
.term-new span { font-size: 20px; font-weight: 700; line-height: 0; }
.term-new:hover { background: linear-gradient(180deg, #0d9c6d, var(--brand-ink)); }
.term-addnum { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 14px; max-width: 480px; box-shadow: var(--shadow); }
.term-addnum label { display: block; font: 700 12px var(--font); color: var(--text-2); margin-bottom: 8px; }
.term-addnum input { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- the board: three soft panels ---- */
.term-board { display: flex; align-items: stretch; gap: 14px; min-height: 62vh; }
.tb-col { display: flex; flex-direction: column; min-width: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tb-col--prep { flex: 1.15; border-top: 3px solid var(--warn); }
.tb-col--ready { flex: .85; border-top: 3px solid var(--good); }
.tb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px;
  border-bottom: 1px solid var(--border); font: 800 15px var(--display); letter-spacing: -.01em; }
.tb-count { font: 800 13px var(--font); background: rgba(225,155,0,.16); color: #a06c00; padding: 2px 10px;
  border-radius: 999px; font-variant-numeric: tabular-nums; }
.tb-head--lime { background: transparent; }
.tb-count--onlime { background: var(--brand-soft); color: var(--brand-ink); }
.tb-head--rail { border-bottom: 1px solid rgba(255,255,255,.14); color: #fff; }
.tb-count--lime { background: var(--brand); color: #fff; }

.tb-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; align-content: start; }
.tb-card { border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.tb-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tb-num { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: .95; font-variant-numeric: tabular-nums; }
.tb-src { font: 700 10.5px var(--font); letter-spacing: .05em; color: var(--text-3); background: var(--surface-3);
  padding: 2px 8px; border-radius: 7px; flex-shrink: 0; }
.tb-items { font: 600 13.5px/1.4 var(--font); color: var(--text-2); }
.tb-note { font: 700 12px var(--font); background: rgba(225,155,0,.15); color: #8a5d00; padding: 3px 9px;
  border-radius: 8px; align-self: flex-start; }
.tb-card-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 7px; border-top: 1px dashed var(--border); }
.tb-ago { font: 600 11.5px var(--font); color: var(--text-3); }
.tb-total { font: 800 13.5px var(--font); margin-left: auto; font-variant-numeric: tabular-nums; }
.tb-act { font: 800 12px var(--font); border: none; border-radius: 9px; background: var(--brand); color: #fff;
  padding: 7px 11px; cursor: pointer; white-space: nowrap; box-shadow: 0 3px 9px rgba(10,143,102,.3); }
.tb-act:hover { background: var(--brand-ink); }

.tb-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding: 8px; gap: 8px; }
.tb-row { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border: 1px solid var(--border);
  border-left: 4px solid var(--good); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--good) 6%, var(--surface));
  cursor: pointer; transition: .12s ease; }
.tb-row:hover { border-color: var(--good); transform: translateY(-1px); }
.tb-num--ready { font-size: 30px; color: var(--brand-ink); }
.tb-row-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tb-row-items { font: 600 12.5px/1.35 var(--font); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-row-meta { font: 600 11.5px var(--font); color: var(--text-3); }
.tb-row .tb-act { background: transparent; color: var(--brand-ink); border: 1.5px solid var(--brand);
  box-shadow: none; }
.tb-row:hover .tb-act { background: var(--brand); color: #fff; }
.tb-empty { margin: auto; text-align: center; color: var(--text-3); font: 600 13px var(--font); padding: 30px; }
.tb-empty--rail { color: var(--mint); }

/* the online rail stays dark — it is the "outside world" lane */
.tb-rail { width: 300px; flex: none; background: var(--forest); color: #eef2ee; border-color: var(--forest); }
.tb-raillist { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding: 10px; gap: 10px; }
.tb-online { padding: 13px 14px; border-radius: var(--radius-sm); background: var(--forest-2);
  border: 1px solid rgba(255,255,255,.09); display: flex; flex-direction: column; gap: 6px; }
.tb-online-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tb-online-name { font: 800 14px var(--font); color: #fff; background: none; border: none; padding: 0;
  cursor: pointer; text-align: left; }
.tb-online-name:hover { color: var(--mint); text-decoration: underline; }
.tb-code { font: 700 11px var(--mono); color: var(--mint); flex-shrink: 0; }
.tb-online-items { font: 600 12.5px/1.4 var(--font); color: var(--mint); }
.tb-online .tb-note { background: rgba(245,117,14,.2); color: #ffc08a; }
.tb-online-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.tb-online-total { font: 800 13px var(--font); color: #fff; font-variant-numeric: tabular-nums; }
.tb-assign { font: 800 12px var(--font); background: var(--brand); color: #fff; border: none; border-radius: 9px;
  padding: 7px 12px; cursor: pointer; box-shadow: 0 3px 9px rgba(0,0,0,.3); }
.tb-assign:hover { background: #10a877; }
.tb-posform { display: flex; gap: 6px; }
.tb-posform input { flex: 1; min-width: 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25);
  border-radius: 9px; color: #fff; padding: 9px 11px; font: 700 14px var(--font); }
.tb-posform input::placeholder { color: rgba(255,255,255,.4); }
.tb-posform button { font: 800 12px var(--font); background: var(--brand); color: #fff; border: none;
  border-radius: 9px; padding: 0 14px; cursor: pointer; }

@media (max-width: 1080px) {
  .term-board { flex-direction: column; }
  .tb-rail { width: 100%; }
  .term-tenant-sub { display: none; }
}

/* ---- KDS screens: dark twin, amber cooking / green ready ---- */
.tk-body { background: var(--forest); }
.tk-body .tk-top, .tk-body .tk-foot { background: transparent; border-color: rgba(255,255,255,.1); }
.tk-body .tk-brand, .tk-body .tk-clock { color: #fff; }
.tk-body .tk-foot { color: var(--mint); }
.tk-body .tk-col { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.09); box-shadow: none; }
.tk-body .tk-col-head { border-bottom-color: rgba(255,255,255,.1); }
.tk-body .tk-col-label { color: #fff; }
.tk-body .tk-empty { color: var(--mint); opacity: .7; }
.tk-body .tk-tile { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); }
.tk-body .tk-num { color: #ffce67; }
.tk-body .tk-tile--ready { background: rgba(23,178,131,.14); border-left-color: #35d99f; }
.tk-body .tk-tile--ready .tk-num { color: #35d99f; }
.tk-body .tk-when { color: var(--mint); opacity: .75; }
.tk-body .tk-zone { background: rgba(255,255,255,.1); color: var(--mint); }
.tk-body .tk-count--preparing { background: rgba(255,206,103,.16); color: #ffce67; }
.tk-body .tk-count--ready { background: rgba(23,178,131,.2); color: #35d99f; }
.tk-body .tk-action { color: #35d99f; }
.tk-body .tk-tile--tap:hover { border-color: #35d99f; }

/* auth hero: forest gradient with the mandarine kicker */
.auth-hero { background:
  radial-gradient(700px 340px at 85% -10%, rgba(16,168,119,.5), transparent),
  linear-gradient(155deg, #113126, var(--forest)); }
.auth-hero h2::before { content: ''; display: block; width: 44px; height: 4px; border-radius: 2px;
  background: var(--accent); margin-bottom: 14px; }
.term-live::after { content: 'LIVE'; }
.term-live--down { background: var(--bad); }
.term-live--down::after { content: 'HORS LIGNE'; }

/* back-office: the per-client WhatsApp connection */
.adm-wa { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.adm-wa-state { font-size: 11px; font-weight: 800; letter-spacing: 0; text-transform: none; margin-left: 8px; }
.adm-wa-state.on { color: var(--good); }
.adm-wa-state.off { color: var(--text-3); }
.adm-wa-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 14px; }
.adm-wa-form .field span em { font-style: normal; font-weight: 500; color: var(--text-3); }
.adm-wa-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-wa-to { max-width: 200px; }
.adm-wa-result { grid-column: 1 / -1; font-size: 13px; margin-top: 8px; min-height: 18px; }
.adm-wa-result .good { color: var(--good); font-weight: 700; }
.adm-wa-result .bad { color: var(--bad); font-weight: 700; }


/* brand: the wordmark is Poppins 700, "ix" always orange */
.brand-name, .term-brand .brand-name { font-family: 'Poppins', var(--display); font-weight: 700; letter-spacing: -.01em; }
.brand-x { color: var(--accent); }
.logo-svg { border-radius: 22%; }

/* header alert: a customer waiting on a human, in words not a dot */
.term-alert { display: flex; align-items: center; padding: 8px 14px; border-radius: 999px;
  background: var(--accent); color: #fff; font: 800 13px var(--font); white-space: nowrap;
  cursor: pointer; animation: alertPulse 2.2s ease-in-out infinite; }
.term-alert:hover { background: #d8660b; color: #fff; }
@keyframes alertPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,119,21,.55); } 50% { box-shadow: 0 0 0 7px rgba(245,119,21,0); } }
@media (prefers-reduced-motion: reduce) { .term-alert { animation: none; } }

/* menu editor: the supplements field */
.menu-opts { font-size: 12.5px; color: var(--text-3); }

/* a message WhatsApp would not let us deliver — the cashier must see this */
.bubble-undelivered { opacity: .75; border: 1px dashed var(--accent); }
.bubble-warn { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 700; color: var(--accent); }

/* the web menu, when the customer arrived from their own WhatsApp thread */
.dm-known { display: flex; flex-direction: column; gap: 2px; background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 14px; font-size: 14px; color: var(--brand-ink); }
.dm-known span { font-size: 12.5px; opacity: .8; }

/* product photos — editor */
.item-photo-row { display: flex; gap: 12px; align-items: flex-start; }
.item-photo-preview { width: 68px; height: 68px; border-radius: var(--radius-sm); background: var(--surface-3);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0; color: var(--text-3); }
.item-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
#itemPhotoFile { font-size: 12.5px; }
.menu-thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; float: left; margin-right: 10px; }

/* product photos — the customer's menu */
.dm-item-tile--photo { padding: 0; overflow: hidden; }
.dm-item-tile--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* supplements on the customer's web menu */
.dm-item-opt { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.dm-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.dm-opt { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: .12s ease; }
.dm-opt.on { border-color: var(--brand); background: var(--brand-soft); }
.dm-opt input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.dm-opt-name { flex: 1; font-weight: 600; font-size: 14px; }
.dm-opt-price { font-size: 13px; font-weight: 700; color: var(--brand-ink); white-space: nowrap; }

/* menu editor: supplements as rows */
.opt-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.opt-row { display: flex; gap: 8px; align-items: center; }
.opt-row .opt-name { flex: 1; min-width: 0; }
.opt-price-wrap { position: relative; width: 96px; flex: none; }
.opt-price-wrap input { width: 100%; padding-right: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.opt-price-wrap span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 700; color: var(--text-3); pointer-events: none; }
.opt-del { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-3);
  border-radius: var(--radius-sm); width: 36px; height: 38px; flex: none; cursor: pointer; font-size: 13px; }
.opt-del:hover { border-color: var(--bad); color: var(--bad); }

/* settings: brand colour picker */
.brand-color-row { display: flex; align-items: center; gap: 10px; }
.brand-color-row input[type=color] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex: none; }
.brand-color-row input[type=text] { width: 110px; flex: none; font-family: var(--mono); text-transform: uppercase; }

/* the public menu hero uses the restaurant's colour */
.dm-hero { background: linear-gradient(135deg, var(--brand), var(--brand-ink)); }
.dm-logo .logo-img { border-radius: 14%; background: #fff; padding: 2px; box-shadow: 0 6px 16px rgba(0,0,0,.22); }
