:root {
  /* Trufflehunters-style: warm brown / copper / cream. Per-org override via JS. */
  --bg:     #2a1d11;   /* deep coffee bean */
  --bg-2:   #3c2b1a;   /* warm chestnut */
  --bg-3:   #5c4429;   /* tan accent */
  --fg:     #f7ecd9;   /* warm cream */
  --muted:  #c2a888;   /* faded parchment */
  --accent: #c05621;   /* copper / paprika */
  --green:  #5b8c3e;   /* sage */
  --red:    #c53030;   /* mulled red */
  --amber:  #d69e2e;   /* honey */
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
button { cursor: pointer; font: inherit; }

/* ---- Login ---- */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--bg); }
.login-card { background: var(--bg-2); padding: 32px; border-radius: var(--radius); width: min(380px, 95vw); display: grid; gap: 12px; }
.login-card h1 { margin: 0 0 8px; text-align: center; letter-spacing: 4px; }
.login-card label { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.login-card input, .login-card select { padding: 12px; border-radius: 6px; border: 1px solid var(--bg-3); background: var(--bg); color: var(--fg); font-size: 18px; }
.login-card button { padding: 14px; border: 0; border-radius: 6px; background: var(--accent); color: white; font-size: 16px; font-weight: 600; }
.err { color: var(--red); font-size: 14px; }

/* ---- Login: org tiles, role choice, user grid, PIN pad ---- */
.login-card { width: min(520px, 96vw); max-height: 95vh; overflow-y: auto; }
.login-card h2 { margin: 12px 0 8px; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }
.login-org-bar { display: flex; justify-content: space-between; padding: 8px 10px; background: var(--bg); border-radius: 6px; font-size: 13px; align-items: center; }
.login-org-bar a { color: var(--muted); font-size: 12px; }
.org-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.org-tile { background: var(--bg-3); padding: 24px 12px; border-radius: 10px; text-align: center; color: var(--fg); text-decoration: none; font-weight: 700; }
.org-tile:hover { background: #5a6677; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-tile { background: var(--bg-3); border-radius: 10px; padding: 24px 12px; text-align: center; color: var(--fg); text-decoration: none; display: grid; gap: 4px; }
.role-tile:hover { background: #5a6677; }
.role-tile span { font-size: 40px; }
.role-tile strong { font-size: 18px; }
.role-tile small { color: var(--muted); }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.user-tile { background: var(--bg-3); color: var(--fg); border: 0; padding: 18px 8px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.user-tile:hover { background: #5a6677; }
.register-link { display: block; text-align: center; margin-top: 14px; color: var(--muted); text-decoration: none; font-size: 14px; }
.register-link:hover { color: var(--fg); }
.pin-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: grid; place-items: center; padding: 16px; z-index: 60; }
.pin-modal.hidden { display: none; }
.pin-modal h2 { color: var(--fg); margin: 0; font-size: 18px; text-transform: none; letter-spacing: 0; }
.pin-modal { display: flex; flex-direction: column; gap: 12px; }
.pin-modal > * { width: min(320px, 90vw); }
.pin-modal input[type=password] { font-size: 36px; padding: 14px; text-align: center; letter-spacing: 10px; background: var(--bg-2); color: var(--fg); border: 1px solid var(--bg-3); border-radius: 8px; }
.pad { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pad-key { background: var(--bg-3); color: var(--fg); border: 0; padding: 18px; border-radius: 8px; font-size: 22px; font-weight: 700; cursor: pointer; }
.pad-key:hover { background: #5a6677; }
.pad-clear { background: var(--red); }
.pad-enter { background: var(--green); }
.pin-actions { display: flex; justify-content: flex-end; gap: 8px; }
.pin-actions .ghost { background: transparent; border: 1px solid var(--bg-3); color: var(--muted); padding: 8px 16px; border-radius: 6px; }

/* ---- Till ---- */
.till-body { display: grid; grid-template-rows: auto 1fr; height: 100vh; overflow: hidden; }
.till-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--bg-2); border-bottom: 1px solid var(--bg-3); }
.brand { font-weight: 700; letter-spacing: 1px; }
.till-header .status { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.till-header .user { display: flex; gap: 16px; align-items: center; font-size: 13px; }
.till-header .user a { color: var(--muted); text-decoration: none; }
.till-header .user a:hover { color: var(--fg); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.online  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.offline { background: var(--red); }

.till-main { display: grid; grid-template-columns: 1fr 360px; gap: 0; min-height: 0; }

.catalog { display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; padding: 8px; background: var(--bg-2); border-bottom: 1px solid var(--bg-3); }
.cat { padding: 10px 8px; border: 0; border-radius: 6px; background: var(--bg-3); color: var(--fg); font-weight: 600; font-size: 13px; line-height: 1.1; min-height: 44px; text-align: center; word-break: break-word; }
.cat.active { outline: 2px solid var(--accent); }
.cat.all { background: var(--bg-2); border: 1px solid var(--bg-3); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 10px; overflow-y: auto; align-content: start; }
.prod { padding: 14px 10px; border: 0; border-radius: var(--radius); background: var(--bg-3); color: var(--fg); display: grid; gap: 8px; min-height: 84px; text-align: left; }
.prod-name { font-weight: 600; line-height: 1.2; }
.prod-price { color: var(--muted); font-size: 14px; }
.prod:hover { background: #5a6677; }

.cart { background: var(--bg-2); border-left: 1px solid var(--bg-3); display: grid; grid-template-rows: auto 1fr auto auto auto; min-height: 0; }
.cart-header { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--bg-3); font-weight: 600; }
.cart-lines { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.cart-line { padding: 10px 14px; border-bottom: 1px solid var(--bg); }
.cart-line-main { display: flex; justify-content: space-between; gap: 8px; }
.line-name { flex: 1; }
.cart-line-ctrl { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cart-line-ctrl button { padding: 2px 10px; border: 0; border-radius: 4px; background: var(--bg-3); color: var(--fg); }
.qty { min-width: 22px; text-align: center; }
.line-note { font-size: 12px; color: var(--muted); }
.totals { padding: 12px 14px; border-top: 1px solid var(--bg-3); display: grid; gap: 4px; font-size: 14px; }
.totals > div { display: flex; justify-content: space-between; }
.totals .total { font-size: 22px; font-weight: 700; margin-top: 4px; }
.cart-actions { padding: 10px 12px; display: grid; gap: 8px; }
.cart-actions.row { grid-template-columns: 1fr 1fr 1fr; }
.cart-actions button { padding: 14px; border: 0; border-radius: 6px; background: var(--bg-3); color: var(--fg); font-weight: 600; }
.cart-actions .big { padding: 18px; font-size: 16px; }
.cart-actions .primary { background: var(--green); }
.cart-actions .ghost { background: transparent; border: 1px solid var(--bg-3); color: var(--muted); }
.cart-actions button:disabled { opacity: 0.4; }

/* ---- Modals ---- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-card { background: var(--bg-2); padding: 24px; border-radius: var(--radius); width: min(420px, 95vw); max-height: 90vh; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.modal-card .mod-list { flex: 1 1 auto; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.modal-card h2 { margin: 0 0 6px; }
.modal-card input, .modal-card select, .modal-card textarea { padding: 10px; border-radius: 6px; border: 1px solid var(--bg-3); background: var(--bg); color: var(--fg); }
.big-total { font-size: 22px; color: var(--muted); }
.big-total strong { color: var(--fg); }
#tender-amount { font-size: 32px; padding: 14px; text-align: right; }
.quick-cash { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.quick-cash button { padding: 12px; border: 0; border-radius: 6px; background: var(--bg-3); color: var(--fg); }
.change { font-size: 18px; }
.change strong { color: var(--green); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.modal-actions .primary { background: var(--green); color: white; padding: 12px 20px; border: 0; border-radius: 6px; }
.modal-actions .ghost { background: transparent; border: 1px solid var(--bg-3); color: var(--muted); padding: 12px 20px; border-radius: 6px; }
.mod-list { display: grid; gap: 8px; }
.mod-opt { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg); border-radius: 6px; }
.mod-opt input { width: auto; }
.mod-delta { margin-left: auto; color: var(--muted); }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--green); color: white; padding: 14px 24px; border-radius: 8px; opacity: 0; transition: opacity 0.2s; z-index: 60; }
#toast.show { opacity: 1; }

/* ---- Admin / Reports ---- */
.admin-body, .report-body { background: var(--bg); color: var(--fg); margin: 0; min-height: 100vh; }
.admin-body header, .report-body header { display: flex; gap: 18px; align-items: center; padding: 12px 18px; background: var(--bg-2); border-bottom: 1px solid var(--bg-3); }
.admin-body header a, .report-body header a { color: var(--muted); text-decoration: none; }
.admin-body header a:hover, .report-body header a:hover { color: var(--fg); }
.admin-nav { display: flex; gap: 6px; padding: 12px 18px; background: var(--bg-2); border-bottom: 1px solid var(--bg-3); flex-wrap: wrap; }
.admin-nav button { padding: 8px 14px; border: 0; border-radius: 4px; background: var(--bg-3); color: var(--muted); }
.admin-nav button.active { background: var(--accent); color: white; }
.admin-body main, .report-main { padding: 20px; }
table.grid { width: 100%; border-collapse: collapse; background: var(--bg-2); }
table.grid th, table.grid td { padding: 8px; border-bottom: 1px solid var(--bg-3); text-align: left; }
table.grid input, table.grid select { width: 100%; padding: 6px; background: var(--bg); color: var(--fg); border: 1px solid var(--bg-3); border-radius: 4px; }
table.grid tr.low { background: rgba(229, 62, 62, 0.1); }
table.grid button { padding: 6px 10px; border: 0; border-radius: 4px; background: var(--bg-3); color: var(--fg); }
.primary { background: var(--accent) !important; color: white; }
.form { display: grid; gap: 12px; max-width: 480px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form input, .form textarea { padding: 8px; background: var(--bg-2); color: var(--fg); border: 1px solid var(--bg-3); border-radius: 4px; }
.form textarea { min-height: 80px; }

.filters { display: flex; gap: 10px; align-items: end; margin-bottom: 16px; flex-wrap: wrap; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.filters input { padding: 6px; background: var(--bg-2); border: 1px solid var(--bg-3); color: var(--fg); border-radius: 4px; }
.filters button, .filters .btn { padding: 8px 14px; background: var(--accent); color: white; border: 0; border-radius: 4px; text-decoration: none; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--bg-2); padding: 12px; border-radius: 8px; display: grid; gap: 4px; }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.stat strong { font-size: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.grid-2 table { width: 100%; background: var(--bg-2); }
.grid-2 td { padding: 6px 10px; border-bottom: 1px solid var(--bg-3); }
.bar { height: 8px; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 4px; }
tr.empty-slot td { color: var(--muted); opacity: 0.5; }

/* Half-hourly toggle pill */
.hh-toggle { display: inline-flex; background: var(--bg-2); border-radius: 6px; padding: 2px; }
.hh-toggle button { background: transparent; color: var(--muted); border: 0; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.hh-toggle button.active { background: var(--accent); color: white; }

/* Z report on-screen card */
.z-card { margin: 16px 0; }
.z-card.hidden { display: none; }
.z-paper { background: white; color: #1a202c; max-width: 480px; margin: 0 auto; padding: 28px; border-radius: 8px; font-family: ui-monospace, "SF Mono", Consolas, monospace; box-shadow: 0 8px 24px rgba(0,0,0,0.4); position: relative; }
.z-paper h2 { margin: 0 0 4px; text-align: center; letter-spacing: 4px; }
.z-paper h3 { margin: 18px 0 6px; border-top: 1px dashed #999; padding-top: 12px; font-size: 14px; letter-spacing: 2px; }
.z-range { text-align: center; font-size: 12px; color: #666; margin-bottom: 12px; }
.z-paper table { width: 100%; border-collapse: collapse; }
.z-paper td, .z-paper th { padding: 3px 0; font-size: 14px; }
.z-totals tr.z-net td { font-weight: 800; border-top: 1px solid #333; border-bottom: 3px double #333; padding: 6px 0; }
.z-close { position: absolute; top: 10px; right: 14px; background: transparent; border: 0; font-size: 28px; cursor: pointer; color: #999; }
.z-close:hover { color: #333; }
.z-print-hint { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #999; font-size: 11px; color: #666; text-align: center; }
@media print {
  .filters, .report-summary, .grid-2, #halfhourly, .hh-toggle, header { display: none !important; }
  .z-card { margin: 0; }
  .z-paper { box-shadow: none; max-width: 100%; }
  .z-close { display: none; }
  body { background: white; }
}

/* Commission form */
.commission-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.commission-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.commission-form input { padding: 6px 8px; background: var(--bg-2); border: 1px solid var(--bg-3); color: var(--fg); border-radius: 4px; }
.commission-form button { padding: 8px 14px; background: var(--accent); color: white; border: 0; border-radius: 4px; cursor: pointer; }

/* Pickup pill — turns green when there's something ready */
#pickup-pill.has { background: var(--green); color: #fff; animation: pickup-glow 1.4s ease-in-out infinite; }
@keyframes pickup-glow { 0%, 100% { box-shadow: 0 0 0 rgba(91,140,62,0.4); } 50% { box-shadow: 0 0 14px rgba(91,140,62,0.95); } }

.pickup-banner {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-150%);
  background: var(--green); color: #fff;
  padding: 24px 40px 18px; border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7); z-index: 80;
  opacity: 0; transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  text-align: center; min-width: min(420px, 92vw); max-width: 92vw;
  pointer-events: none;
}
.pickup-banner.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.pickup-banner-x {
  position: absolute; top: 4px; right: 10px;
  background: transparent; border: 0; color: rgba(255,255,255,0.75);
  font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.pickup-banner-x:hover { color: #fff; }
.pickup-banner-label {
  font-size: 13px; font-weight: 700; letter-spacing: 3px; opacity: 0.9;
  text-transform: uppercase; margin-bottom: 4px;
}
.pickup-banner-num {
  font-size: 88px; font-weight: 900; line-height: 1;
  letter-spacing: 2px; margin: 6px 0; font-variant-numeric: tabular-nums;
}
.pickup-banner-sub { font-size: 17px; opacity: 0.95; margin-bottom: 14px; }
.pickup-banner-actions { display: flex; gap: 10px; justify-content: center; }
.pickup-banner-btn {
  flex: 1; max-width: 180px; padding: 14px 18px;
  border: 0; border-radius: 8px; font-size: 16px; font-weight: 800; cursor: pointer;
}
.pickup-banner-btn.ghost { background: rgba(255,255,255,0.15); color: #fff; }
.pickup-banner-btn.ghost:hover { background: rgba(255,255,255,0.25); }
.pickup-banner-btn.primary { background: #fff; color: var(--green); }
.pickup-banner-btn.primary:hover { background: #e6f7e9; }

.pickup-drawer {
  position: fixed; top: 0; right: -380px; width: min(380px, 95vw); height: 100vh;
  background: var(--bg-2); border-left: 1px solid var(--bg-3);
  transition: right 0.3s; z-index: 70; overflow-y: auto;
  box-shadow: -8px 0 24px rgba(0,0,0,0.4);
}
.pickup-drawer.show { right: 0; }
.pickup-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--bg); font-weight: 700; }
#pickup-close { background: transparent; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; }
#pickup-list { list-style: none; margin: 0; padding: 0; }
#pickup-list li { padding: 14px 18px; border-bottom: 1px solid var(--bg-3); }
.pickup-where { font-size: 16px; }
.pickup-where strong { font-size: 24px; color: var(--green); margin-left: 6px; }
.pickup-meta { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.pickup-collect { width: 100%; padding: 12px; background: var(--green); color: #fff; border: 0; border-radius: 6px; font-weight: 700; font-size: 15px; cursor: pointer; }
.pickup-collect:hover { background: #4a7331; }
.pickup-empty { padding: 30px; text-align: center; color: var(--muted); }

#pickup-alerts-pill.alerts-off { opacity: 0.6; background: var(--bg-2); }

/* --- Pickup terminal full-screen view (/kds/pickup-view) --- */
#pickup-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 16px; align-content: start; overflow-y: auto; }
.pickup-card {
  background: var(--bg-2); border-radius: 12px; padding: 22px 18px;
  border-top: 8px solid var(--green); text-align: center;
  display: grid; gap: 12px; align-content: start;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.pickup-card.fresh { border-top-color: var(--green); }
.pickup-card.amber { border-top-color: var(--amber); }
.pickup-card.late  { border-top-color: var(--red); animation: pulse-late 1.5s ease-in-out infinite; }
.pickup-card-label { font-size: 13px; letter-spacing: 3px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.pickup-card-num {
  font-size: 72px; font-weight: 900; line-height: 1; color: #fff;
  font-variant-numeric: tabular-nums; letter-spacing: 2px;
  word-break: break-all;
}
.pickup-card-lines {
  list-style: none; margin: 0; padding: 8px 0 0; text-align: left;
  display: grid; gap: 6px; border-top: 1px solid rgba(255,255,255,0.08);
  max-height: 260px; overflow-y: auto;
}
.pickup-line { display: flex; gap: 8px; font-size: 16px; color: #e8e8e8; line-height: 1.25; }
.pickup-line-qty { font-weight: 800; color: #fff; min-width: 28px; }
.pickup-line-name { flex: 1; }
.pickup-line-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.pickup-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.pickup-card-server { font-weight: 600; }
.pickup-card-elapsed { font-family: ui-monospace, "SF Mono", monospace; }
.pickup-card.late  .pickup-card-elapsed { color: #fc8181; }
.pickup-card.amber .pickup-card-elapsed { color: var(--amber); }
.pickup-card-btn {
  background: var(--green); color: #fff; border: 0; padding: 18px;
  border-radius: 10px; font-size: 18px; font-weight: 800; letter-spacing: 2px;
  cursor: pointer;
}
.pickup-card-btn:hover { background: #4a7331; }

@media (min-width: 1600px) {
  #pickup-board { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
  .pickup-card-num { font-size: 96px; }
  .pickup-line { font-size: 18px; }
}
@media (min-width: 2400px) {
  #pickup-board { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 20px; padding: 24px; }
  .pickup-card-num { font-size: 128px; }
  .pickup-line { font-size: 22px; }
  .pickup-card-lines { max-height: 360px; }
}

/* Table / pager numeric keypad — replaces system keyboard on tablets */
.table-display {
  background: var(--bg); color: var(--fg);
  font-size: 48px; font-weight: 800; text-align: center;
  padding: 16px; border-radius: 8px; min-height: 70px;
  letter-spacing: 4px; font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.table-pad, .table-letters {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px;
}
.table-letters { grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; }
.table-letters.hidden { display: none; }
.tk {
  background: var(--bg-3); color: var(--fg); border: 0;
  padding: 22px 12px; border-radius: 10px;
  font-size: 28px; font-weight: 800; cursor: pointer;
  min-height: 64px;
}
.tk:hover, .tk:active { background: #6f5436; }
.tk-clear { background: var(--red); }
.tk-letters { background: var(--bg-2); color: var(--muted); font-size: 16px; }

/* Till mode pill + picker */
.pill { background: var(--bg-3); color: var(--fg); border: 0; padding: 8px 16px; border-radius: 999px; font-size: 15px; font-weight: 700; cursor: pointer; min-height: 36px; }
.pill.training-on { background: var(--amber); color: #1a202c; }
.training-banner { background: var(--amber); color: #1a202c; padding: 8px 16px; text-align: center; font-weight: 800; letter-spacing: 2px; }
.training-banner.hidden { display: none; }
.pill:hover { background: #5a6677; }
.mode-choices { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 8px; }
.mode-choice { background: var(--bg-3); color: var(--fg); border: 0; border-radius: 10px; padding: 18px 10px; display: grid; gap: 4px; cursor: pointer; }
.mode-choice:hover { background: #5a6677; }
.mode-choice span { font-size: 32px; }
.mode-choice strong { font-size: 18px; }
.mode-choice small { color: var(--muted); }

/* ---- Kitchen Display Screen ---- */
.kds-body { background: #111; color: #f0f0f0; margin: 0; min-height: 100vh; display: grid; grid-template-rows: auto 1fr; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.kds-header { display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: #1a202c; border-bottom: 1px solid #2d3748; }
.kds-brand { font-size: 24px; font-weight: 800; letter-spacing: 3px; }
.kds-header select { background: #2d3748; color: #f0f0f0; border: 1px solid #4a5568; padding: 8px 12px; border-radius: 6px; font-size: 16px; }
.kds-clock { font-family: ui-monospace, "SF Mono", monospace; font-size: 22px; color: #cbd5e0; margin-left: auto; }
.kds-actions { display: flex; gap: 8px; }
.kds-actions a, .kds-actions button { background: transparent; color: #a0aec0; border: 1px solid #4a5568; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 13px; cursor: pointer; }
.kds-actions a:hover, .kds-actions button:hover { color: #f0f0f0; border-color: #a0aec0; }
.kds-board { padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-content: start; overflow-y: auto; }
.kds-empty { grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: #4a5568; font-size: 28px; }

/* Kitchen banter banner — pops in from the top when a new ticket lands. */
.kds-banter {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-120%);
  background: linear-gradient(135deg, #c05621, #d69e2e);
  color: #1a202c; font-weight: 900; font-size: 32px; letter-spacing: 1px;
  padding: 18px 40px; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 -3px 0 rgba(0,0,0,0.15);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  opacity: 0; pointer-events: none; z-index: 80; white-space: nowrap;
}
.kds-banter.show { transform: translateX(-50%) translateY(0); opacity: 1; }
@media (min-width: 1600px) { .kds-banter { font-size: 44px; padding: 24px 56px; } }
@media (min-width: 2400px) { .kds-banter { font-size: 60px; padding: 32px 72px; } }

.kds-tile { background: #2d3748; border-radius: 10px; padding: 14px; display: grid; grid-template-rows: auto 1fr auto auto; gap: 10px; border-top: 6px solid #38a169; min-height: 220px; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.kds-tile.fresh { border-top-color: #38a169; }
.kds-tile.amber { border-top-color: #d69e2e; }
.kds-tile.late  { border-top-color: #e53e3e; animation: pulse-late 1.5s ease-in-out infinite; }
@keyframes pulse-late { 0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.4); } 50% { box-shadow: 0 0 24px rgba(229,62,62,0.7); } }
.kds-tile-head { display: flex; align-items: center; gap: 10px; }
.kds-num { background: #4a5568; color: #fff; font-weight: 800; font-size: 22px; min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; }
.kds-ref { flex: 1; font-size: 15px; color: #cbd5e0; }
.kds-ref strong { color: #fff; font-size: 18px; }
.kds-elapsed { font-family: ui-monospace, "SF Mono", monospace; font-size: 22px; font-weight: 700; }
.kds-tile.fresh .kds-elapsed { color: #68d391; }
.kds-tile.amber .kds-elapsed { color: #f6ad55; }
.kds-tile.late  .kds-elapsed { color: #fc8181; }
.kds-table { background: #2c5282; color: #fff; padding: 8px 12px; border-radius: 6px; text-align: center; font-size: 16px; letter-spacing: 1px; }
.kds-table strong { font-size: 28px; margin-left: 8px; }
.kds-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.kds-lines li { font-size: 18px; line-height: 1.3; }
.kds-qty { font-weight: 800; color: #fff; margin-right: 6px; }
.kds-name { font-weight: 600; }
.kds-mods { color: #a0aec0; font-size: 14px; margin: 4px 0 0 28px; line-height: 1.3; }
.kds-note { color: #f6ad55; font-size: 14px; margin: 4px 0 0 28px; font-weight: 600; }
.kds-order-note { background: #d69e2e; color: #1a202c; padding: 8px 10px; border-radius: 6px; font-weight: 700; }
.kds-done, .kds-ready, .kds-collect { color: #fff; border: 0; padding: 16px; border-radius: 8px; font-size: 18px; font-weight: 800; letter-spacing: 1px; cursor: pointer; }
.kds-ready   { background: #d69e2e; }                /* amber/honey — "make me ready" */
.kds-ready:hover  { background: #b7791f; }
.kds-collect { background: #3182ce; }                /* blue — "FOH come collect" */
.kds-collect:hover { background: #2c5282; }
.kds-done    { background: #38a169; }                /* fallback for legacy */
.kds-done:hover  { background: #2f855a; }

/* Ready-for-pickup tile state */
.kds-tile.ready { border-top-color: #3182ce; animation: pulse-ready 1.5s ease-in-out infinite; }
@keyframes pulse-ready { 0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.4); } 50% { box-shadow: 0 0 24px rgba(49,130,206,0.85); } }
.kds-tile.ready .kds-elapsed { color: #63b3ed; }
.kds-ready-flag { background: #3182ce; color: #fff; padding: 8px 12px; border-radius: 6px; text-align: center; font-size: 17px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }

@media (min-width: 1600px) {
  .kds-board { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
  .kds-lines li { font-size: 22px; }
  .kds-elapsed, .kds-num { font-size: 26px; }
}
@media (min-width: 2400px) {
  .kds-board { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 20px; padding: 24px; }
  .kds-lines li { font-size: 28px; }
  .kds-name { font-size: 28px; }
}
