/* بيجر تِك — theme «قُرص (Puck)» — staff screen (/staff). Load after /themes/common.css and base.css.
   public/staff.html is one markup for the three themes; this file decides what shows and how.
   Puck: discs and pills, a ring of LED dots, tactile buttons, a soft spring. */

/* =====================================================================
   SHARED BITS
   ===================================================================== */
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: default; transform: none; }
.btn.is-busy { opacity: .7; }
.btn .wait { display: none; }
.btn.is-wait .idle, .btn.is-wait .sent { display: none; }
.btn.is-wait .wait { display: inline; }
.form-error {
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: rgba(138, 44, 58, .1); color: var(--danger);
  font-size: 14px; font-weight: var(--fw-medium); line-height: 1.5;
}
.field[aria-invalid="true"] { box-shadow: inset 0 0 0 2.5px var(--danger); }
#board:focus { outline: none; }
.tear, .lightline, .print-brand { display: none; }

/* ---------------- boot ---------------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: 15px; }
.boot-mark { width: 46px; height: 46px; border-radius: 50%; border: 5px dotted var(--ready); animation: boot-spin 2.4s steps(12) infinite; }
@keyframes boot-spin { to { transform: rotate(360deg); } }

/* =====================================================================
   LOGIN — a disc whose LED ring chases while you sign in
   ===================================================================== */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px 16px;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 30px 24px 22px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-2);
  text-align: center;
}
.login-mark.disc { --d: 112px; --ring: 8px; align-self: center; margin-bottom: 6px; color: var(--ready); }
.login-mark .ico { width: 40px; height: 40px; }
.login-brand { align-self: center; }
.login-title { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.3; }
.login-sub { margin-top: -8px; font-size: 14px; color: var(--muted); }
.login-field { display: flex; flex-direction: column; gap: 6px; text-align: start; }
.login-label { padding-inline-start: 18px; font-size: 14px; font-weight: var(--fw-medium); }
.login .field { min-height: 58px; text-align: center; }
.field-pin { font-size: 24px; letter-spacing: .3em; }
.field-pin::placeholder { letter-spacing: .2em; }
.login-help { font-size: 13px; color: var(--muted); }
.login-help a { display: inline-block; padding: 12px 4px; color: var(--text); font-weight: var(--fw-bold); }
.login-back { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; color: var(--muted); font-size: 13px; }

/* =====================================================================
   DASHBOARD — header
   ===================================================================== */
.s-page { min-height: 100vh; padding: 14px 16px 120px; }
.s-top {
  position: relative; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 68px; padding-inline: 20px 10px;
  background: var(--surface); border-radius: var(--radius-pill); box-shadow: var(--shadow-1);
}
.s-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.s-titles { min-width: 0; }
.s-vsep { width: 1.5px; height: 30px; background: var(--line); flex: none; }
.s-shop { font-size: 18px; font-weight: var(--fw-bold); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-conn { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3C8A55; display: inline-block; flex: none; }
.s-conn.is-connecting .dot { background: var(--muted); animation: dot-blink 1.2s steps(2, jump-none) infinite; }
.s-conn.is-down { color: var(--alert); }
.s-conn.is-down .dot { background: var(--alert); animation: dot-blink .8s steps(2, jump-none) infinite; }
@keyframes dot-blink { to { opacity: .25; } }
.s-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.s-actions .btn { min-height: 48px; font-size: 14px; padding: 0 14px; }
.s-actions .btn-icon { padding: 0; }
.anchor { position: relative; }
.pop {
  position: absolute; top: calc(100% + 12px); inset-inline-start: 0; z-index: 50;
  min-width: 280px; padding: 10px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-2), inset 0 0 0 1.5px var(--line);
  transform-origin: top; animation: pop-in .22s var(--spring) both;
}
.pop-end { inset-inline-start: auto; inset-inline-end: 0; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 12px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text);
  font: inherit; font-size: 15px; font-weight: var(--fw-medium); line-height: 1.3; text-decoration: none; cursor: pointer; text-align: start;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--bg); outline: none; }
.menu-item:focus-visible { box-shadow: inset 0 0 0 2px var(--text); }
.menu-item .ico { color: var(--muted); }
.menu-item small { display: block; font-size: 12px; color: var(--muted); font-weight: var(--fw-regular); }
.menu-danger, .menu-danger .ico { color: var(--danger); }
.menu-sep { height: 1.5px; background: var(--line); margin: 6px 0; }

/* =====================================================================
   ORDER ENTRY — one-tap «طلب جديد» or the cashier's number
   ===================================================================== */
.s-main { container: main / inline-size; transition: margin .3s var(--ease); }
.s-entry { display: grid; grid-template-columns: auto auto minmax(110px, 170px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 14px 0 6px; }
.s-entry .btn { min-height: 62px; }
.s-entry label { min-width: 0; }
.btn-new { padding: 0 10px 0 22px; font-size: 18px; gap: 12px; }
.btn-new > .ico-plus { display: none; }
.new-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.new-txt small { margin-top: 3px; font-size: 11.5px; font-weight: var(--fw-medium); opacity: .72; }
.btn-new .next { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--ready); color: var(--on-ready); outline: 2px dotted var(--ready-led); outline-offset: -6px; }
.btn-new .next .ico { width: 18px; height: 18px; }
.btn-new:active .next { animation: next-spin .5s var(--spring); }
@keyframes next-spin { 50% { transform: rotate(90deg) scale(.9); } }
.entry-or { font-size: 13px; color: var(--muted); }
.entry-error { margin: 6px 0 0; padding: 8px 16px; border-radius: var(--radius-pill); background: rgba(138, 44, 58, .1); color: var(--danger); font-size: 14px; font-weight: var(--fw-medium); }

/* =====================================================================
   BOARD — two columns, pill cards with a mini puck
   ===================================================================== */
.s-board { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; padding-top: 12px; }
.col { container: col / inline-size; min-width: 0; background: var(--surface-2); border-radius: var(--radius-lg); padding: 8px 10px 12px; }
.col-ready { background: var(--ready-soft); }
.col-head { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px 4px; }
.col-head h2 { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: var(--fw-bold); white-space: nowrap; }
.col-head h2::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 3px dotted var(--prep); flex: none; }
.col-ready .col-head h2 { color: var(--ready); }
.col-ready .col-head h2::before { border: 0; background: var(--ready); box-shadow: 0 0 0 3px var(--ready-soft), 0 0 0 5px var(--ready-led); }
.col-note { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.col-count { margin-inline-start: auto; min-width: 36px; height: 32px; padding: 0 10px; display: grid; place-items: center; border-radius: var(--radius-pill); background: var(--surface); font-weight: var(--fw-bold); flex: none; }
.col-ready .col-count { background: var(--ready); color: var(--on-ready); }
.col-list { display: flex; flex-direction: column; gap: 8px; }
.col-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 14px; }

.card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "num info actions"; align-items: center; column-gap: 10px;
  padding: 8px;
  background: var(--surface); border-radius: var(--radius-pill); box-shadow: var(--shadow-1);
  transition: box-shadow .25s, transform .2s, opacity .2s;
}
@media (hover: hover) { .card:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 14px 26px -14px rgba(43, 27, 18, .5); } }
.card.is-busy { opacity: .7; }
.card.is-busy .btn { pointer-events: none; }
.card > .card-num { grid-area: num; }
.card-num.len-3 { font-size: 21px; }
.card-num.len-4 { font-size: 15px; }
.card-num.len-6 { width: auto; min-width: 64px; padding: 0 14px; border-radius: var(--radius-pill); font-size: 13px; }
.card-info { grid-area: info; min-width: 0; display: flex; flex-direction: column; }
.card-label { font-size: 15px; font-weight: var(--fw-bold); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-time { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.card-time b { font-size: 17px; font-weight: var(--fw-bold); color: var(--text); transition: color .3s; }
.card-actions { grid-area: actions; display: flex; align-items: center; gap: 2px; }
.card-actions .btn-main { min-height: 56px; min-width: 104px; font-size: 17px; padding: 0 16px; }
.btn-qr { font-size: 13px; }
.card-actions .btn-qr { width: var(--tap); padding: 0; }
.card-tools { grid-area: tools; }
.card-more { grid-area: extra; display: flex; gap: 6px; padding: 0 4px 4px; animation: state-in .25s var(--ease) both; }
.card-more .btn { flex: 1; min-width: 0; padding: 0 10px; }
.btn-more[aria-expanded="true"] { background: var(--bg); }

/* ready card: rounded rectangle, two rows */
.card.is-ready { border-radius: var(--radius); grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "num info tools" "actions actions actions" "extra extra extra"; row-gap: 8px; padding: 10px 10px 12px; }
.card.is-ready .card-actions { gap: 6px; }
.card.is-ready .card-actions .btn { flex: 1; min-width: 0; min-height: 52px; font-size: 15px; }
.nudge-count { min-width: 26px; height: 24px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--radius-pill); background: var(--ready); color: var(--on-ready); font-size: 12px; line-height: 1; }
.btn-realert.is-sent { background: var(--ready); color: var(--on-ready); box-shadow: none; }
.btn-realert.is-sent .nudge-count { background: var(--on-ready); color: var(--ready); }
.btn-realert.is-wait { color: var(--muted); }
.card-clear { display: none; position: absolute; bottom: 0; inset-inline: 18px; height: 3px; border-radius: 3px; background: var(--ready); opacity: .45; transform: scaleX(var(--clear, 1)); transform-origin: right center; transition: transform 1s linear; }
.card.has-clear .card-clear { display: block; }

/* late colours */
.card.is-late { box-shadow: 0 0 0 2px var(--warn), var(--shadow-1); }
.card.is-late .mini { background: var(--warn-soft); color: var(--warn); outline-color: var(--warn); }
.card.is-late .card-time b { color: var(--warn); }
.card.is-overdue { box-shadow: 0 0 0 2px var(--alert), var(--shadow-1); }
.card.is-overdue .mini { outline-color: #fff; animation: mini-blink 1s steps(2, jump-none) infinite; }
.card.is-overdue .card-time b { color: var(--alert); }
.card.is-overdue .btn-realert:not(.is-sent) { background: var(--alert-soft); color: var(--alert); box-shadow: inset 0 0 0 1.5px var(--alert); }
.card.is-overdue .card-clear { background: var(--alert); }
@keyframes mini-blink { 0% { outline-color: #fff; } 100% { outline-color: var(--ready-led); } }

/* motion */
.card.is-arrived { animation: card-arrive .7s var(--spring) both; }
.card.is-ready.is-arrived .mini { animation: mini-ping .5s var(--spring) .15s 2; }
.card.is-leaving { animation: card-leave .3s ease-in forwards; pointer-events: none; }
.card.is-pinged .mini { animation: mini-ping .5s var(--spring) 3; }
@keyframes card-arrive { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: none; } }
@keyframes card-leave { to { opacity: 0; transform: scale(.9) translateX(-20px); } }
@keyframes mini-ping { 50% { transform: scale(1.18); } }

/* narrow columns (QR panel open, tablet portrait, phone): preparing actions drop under the info */
@container col (max-width: 450px) {
  .card:not(.is-ready) { border-radius: var(--radius); grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "num info" "actions actions"; row-gap: 8px; padding: 10px; }
  .card:not(.is-ready) .card-actions .btn-main { flex: 1; }
}
@container col (max-width: 300px) { .col-note { display: none; } }

/* =====================================================================
   ORDER QR — side panel, non-blocking, closes itself
   ===================================================================== */
.qr-panel {
  position: fixed; z-index: 30; top: 96px; inset-inline-end: 16px; width: 300px;
  max-height: calc(100vh - 112px); overflow: auto;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 14px 18px 18px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-2), inset 0 0 0 1.5px var(--line);
  transform: translateX(-340px) scale(.96); opacity: 0;
  transition: transform .4s var(--spring), opacity .2s;
}
.qr-open .qr-panel { transform: none; opacity: 1; }
.qr-head { align-self: stretch; display: flex; align-items: center; justify-content: space-between; }
.qr-kicker { font-size: 14px; color: var(--muted); font-weight: var(--fw-medium); }
.qr-number { min-width: 96px; height: 96px; padding: 0 12px; display: grid; place-items: center; border-radius: var(--radius-pill); background: var(--bg); outline: 3px dotted var(--line); outline-offset: -10px; font-size: 40px; font-weight: var(--fw-bold); line-height: 1; }
.qr-number.len-3 { font-size: 34px; }
.qr-number.len-4 { font-size: 26px; padding: 0 20px; }
.qr-number.len-6 { font-size: 20px; padding: 0 22px; }
.qr-label { font-size: 15px; font-weight: var(--fw-bold); }
.qr-frame { padding: 12px; border-radius: var(--radius); background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.qr-frame img { display: block; width: 176px; height: 176px; }
.qr-hint { font-size: 13px; color: var(--muted); line-height: 1.6; }
.qr-timer { align-self: stretch; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.qr-timer i { display: block; height: 100%; border-radius: 6px; background: var(--prep); transform: scaleX(var(--p, 1)); transform-origin: right center; transition: transform 1s linear; }
.qr-auto { font-size: 12.5px; color: var(--muted); }
@media (min-width: 980px) { .qr-open .s-main { margin-inline-end: 316px; } }

/* =====================================================================
   TOASTS
   ===================================================================== */
.toasts {
  position: fixed; z-index: 60; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100% - 24px); pointer-events: none;
}
.toast {
  pointer-events: auto; max-width: 100%;
  display: flex; align-items: center; gap: 16px;
  min-height: 56px; padding: 8px 22px;
  background: var(--text); color: var(--surface);
  border-radius: var(--radius-pill); box-shadow: var(--shadow-2);
  font-size: 15px; line-height: 1.4;
  animation: toast-in .4s var(--spring) both;
}
.toast.has-action { padding-inline-end: 8px; }
.toast.is-error { background: var(--danger); color: var(--on-danger); }
.toast.is-leaving { animation: toast-out .25s ease-in forwards; }
.toast .btn { min-height: 48px; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.96); } }

/* =====================================================================
   DIALOGS — report, settings, cashier QR, confirm
   ===================================================================== */
.sheet {
  width: min(580px, calc(100% - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-2);
  overflow: auto; overscroll-behavior: contain;
}
.sheet[open] { animation: sheet-in .4s var(--spring) both; }
.sheet::backdrop { background: rgba(43, 27, 18, .45); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.sheet-wide { width: min(780px, calc(100% - 24px)); }
.sheet-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 22px 22px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head .btn-icon { margin: -6px -8px 0 0; }
.sheet-title { font-size: var(--fs-xl); font-weight: var(--fw-bold); line-height: 1.3; }
.sheet-sub { font-size: 14px; color: var(--muted); line-height: 1.6; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet-actions .btn { flex: 1 1 160px; }
.sheet-confirm { width: min(440px, calc(100% - 24px)); text-align: center; }
.sheet-confirm .sheet-body { align-items: center; padding-top: 26px; }
.confirm-ico { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: rgba(138, 44, 58, .1); color: var(--danger); outline: 3px dotted rgba(138, 44, 58, .35); outline-offset: -8px; }
.confirm-ico .ico { width: 28px; height: 28px; }
.sheet-confirm .sheet-actions { align-self: stretch; }

/* segmented choice (radio inputs) */
.seg { display: inline-flex; flex-wrap: wrap; align-self: flex-start; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: var(--radius-pill); font-size: 15px; font-weight: var(--fw-medium); color: var(--muted); white-space: nowrap; transition: background-color .2s, color .2s, transform .2s var(--spring); }
.seg input:checked + span { background: var(--brand); color: var(--on-brand); font-weight: var(--fw-bold); box-shadow: var(--shadow-press); }
.seg input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 2px; }
.seg input:active + span { transform: scale(.96); }
.seg-sm span { min-height: 48px; padding: 0 14px; font-size: 14px; }
.seg-wrap { border-radius: var(--radius); }
.seg-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); align-self: stretch; }
.seg-wrap span { width: 100%; padding: 0 8px; }

/* ---------------- report ---------------- */
.report { display: flex; flex-direction: column; gap: 16px; transition: opacity .2s; }
.report.is-loading { opacity: .55; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 16px 14px; border-radius: var(--radius); background: var(--bg); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: var(--fw-medium); }
.stat-val { font-size: 26px; font-weight: var(--fw-bold); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12px; color: var(--muted); min-height: 1.4em; }
.stat-hero { background: var(--brand); color: var(--on-brand); }
.stat-hero .stat-label, .stat-hero .stat-sub { color: inherit; opacity: .78; }
.stat-hero .stat-val { font-size: 34px; line-height: 1.15; }
.chart-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.chart-title { font-size: 16px; font-weight: var(--fw-bold); }
.chart { list-style: none; margin: 0; padding: 22px 6px 0; height: 210px; display: flex; align-items: stretch; gap: 4px; border-radius: var(--radius); background: var(--bg); }
.bar { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.bar-val { font-size: 11px; font-weight: var(--fw-bold); line-height: 1.4; min-height: 15px; }
.bar-fill { width: 100%; max-width: 40px; height: calc(var(--h, 0) * 140px); min-height: 4px; border-radius: 10px 10px 4px 4px; background: var(--prep); opacity: .55; transform-origin: bottom; animation: bar-grow .6s var(--spring) both; }
.bar.is-peak .bar-fill { background: var(--brand); opacity: 1; }
.bar-lbl { align-self: stretch; height: 30px; padding-top: 6px; border-top: 1.5px solid var(--line); font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; }
.chart.is-dense .bar-val { visibility: hidden; }
.chart.is-dense .bar.is-peak .bar-val { visibility: visible; }
.chart.is-dense .bar:not(.show-lbl) .bar-lbl { color: transparent; }
.bar.is-today .bar-lbl { color: var(--text); font-weight: var(--fw-bold); }
@keyframes bar-grow { from { transform: scaleY(0); } to { transform: none; } }
.chart-empty { padding: 34px 16px; border-radius: var(--radius); background: var(--bg); text-align: center; color: var(--muted); font-size: 14px; }
.report-note { font-size: 12px; color: var(--muted); }

/* ---------------- settings ---------------- */
.set { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1.5px solid var(--line); }
.sheet-head + .form-error + .set, .sheet-head + .set { border-top: 0; padding-top: 0; }
.set-title { font-size: 16px; font-weight: var(--fw-bold); }
.set-desc { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.set-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.set-inline { display: flex; gap: 8px; }
.set-inline .field { flex: 1; min-width: 0; min-height: 52px; font-size: 15px; text-align: left; }
.set-inline .btn { min-height: 52px; flex: none; }
.set-status { font-size: 13px; font-weight: var(--fw-medium); color: #3C8A55; }
.set-status:empty { display: none; }
.set-status.is-error { color: var(--danger); }
.set-switch { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.set-switch-text { display: flex; flex-direction: column; gap: 6px; }
.switch { position: relative; flex: none; display: inline-grid; place-items: center; min-width: 64px; min-height: 48px; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch-track { width: 58px; height: 34px; padding: 4px; border-radius: var(--radius-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); transition: background-color .2s; }
.switch-track i { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 4px rgba(43, 27, 18, .3); outline: 2px dotted var(--line); outline-offset: -6px; transition: transform .3s var(--spring); }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track i { transform: translateX(-24px); outline-color: var(--ready-led); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--text); outline-offset: 3px; }

/* theme picker (cards) */
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-opt { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 12px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: box-shadow .2s, transform .2s var(--spring); }
.theme-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-opt.is-checked { box-shadow: inset 0 0 0 3px var(--text); }
.theme-opt:has(input:focus-visible) { outline: 3px solid var(--text); outline-offset: 3px; }
.theme-opt:active { transform: scale(.98); }
.theme-name { display: flex; align-items: center; gap: 8px; padding: 4px 6px 0; font-size: 16px; font-weight: var(--fw-bold); }
.theme-desc { padding: 0 6px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.theme-current { display: none; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--bg); font-size: 11px; font-style: normal; font-weight: var(--fw-medium); color: var(--muted); }
.theme-opt.is-current .theme-current { display: inline-block; }

/* ----- theme previews: keep this block identical in the three staff.css files ----- */
.pv { display: flex; align-items: center; justify-content: center; gap: 12px; height: 84px; border-radius: 10px; overflow: hidden; font-family: "Alexandria", "Segoe UI", Tahoma, sans-serif; direction: ltr; }
.pv i { font-style: normal; line-height: 1; font-variant-numeric: tabular-nums; }
.pv-puck { background: #F1E6D6; }
.pv-puck .pv-a, .pv-puck .pv-b { display: grid; place-items: center; border-radius: 50%; font-weight: 800; }
.pv-puck .pv-a { width: 42px; height: 42px; background: #FFF8EE; color: #2B1B12; font-size: 16px; outline: 2px dotted #DDCBB3; outline-offset: -6px; }
.pv-puck .pv-b { width: 54px; height: 54px; background: #B9441E; color: #FFF4E8; font-size: 20px; outline: 3px dotted #FF9466; outline-offset: -7px; box-shadow: 0 6px 12px -6px rgba(43, 27, 18, .6); }
.pv-receipt { background: #F2EEE5; gap: 0; }
.pv-receipt .pv-a, .pv-receipt .pv-b { display: grid; place-items: center; height: 50px; padding: 0 12px; border: 2px solid #1A1916; background: #FFFDF8; color: #1A1916; font-size: 24px; font-weight: 700; }
.pv-receipt .pv-a { border-inline-end-style: dashed; }
.pv-receipt .pv-b { background: #FFD60A; }
.pv-neon { background: radial-gradient(80% 70% at 50% 0, rgba(217, 192, 160, .16), transparent 70%), #15110E; }
.pv-neon .pv-a, .pv-neon .pv-b { font-size: 34px; font-weight: 700; }
.pv-neon .pv-a { color: #1E1814; -webkit-text-stroke: 2px #D9C0A0; paint-order: stroke fill; }
.pv-neon .pv-b { color: #3BE0C8; text-shadow: 0 0 .3em rgba(59, 224, 200, .7), 0 0 .08em rgba(59, 224, 200, .9); }
/* ----- end of theme previews ----- */

/* ---------------- cashier QR (printable) ---------------- */
.print-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 26px 22px 22px; border-radius: var(--radius-lg); background: var(--bg);
}
.print-shop { font-size: 24px; font-weight: var(--fw-bold); }
.print-qr { padding: 16px; border-radius: 34px; background: #fff; box-shadow: 0 0 0 6px var(--surface), 0 0 0 9px var(--ready); outline: 3px dotted var(--ready-led); outline-offset: 2px; }
.print-qr img { display: block; width: 260px; height: 260px; max-width: 100%; }
.print-instr { margin-top: 10px; font-size: 22px; font-weight: var(--fw-bold); }
.print-sub { font-size: 15px; color: var(--muted); }
.print-url { font-size: 12px; color: var(--muted); word-break: break-all; }
.print-brand { display: inline-flex; margin-top: 4px; font-size: 14px; }

@media (max-height: 820px) {
  .print-qr img { width: 190px; height: 190px; }
  .print-card { gap: 6px; padding-top: 20px; padding-bottom: 20px; }
}

/* =====================================================================
   SMALLER SCREENS — tablet portrait (768) and phone (390)
   ===================================================================== */
@media (max-width: 979px) {
  /* QR panel becomes a compact bar at the bottom; the page gets room to scroll past it */
  .qr-panel {
    top: auto; inset-inline: 16px; bottom: 16px; width: auto; max-height: calc(100vh - 32px);
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 14px;
    grid-template-areas: "frame head" "frame num" "frame label" "frame hint" "frame auto" "timer timer" "done done";
    padding: 12px; text-align: start;
    transform: translateY(110%);
  }
  .qr-head { grid-area: head; }
  .qr-number { grid-area: num; justify-self: start; min-width: 72px; height: 72px; font-size: 30px; }
  .qr-label { grid-area: label; }
  .qr-frame { grid-area: frame; padding: 8px; }
  .qr-frame img { width: 150px; height: 150px; }
  .qr-hint { grid-area: hint; }
  .qr-timer { grid-area: timer; }
  .qr-auto { grid-area: auto; }
  .qr-done { grid-area: done; }
  .qr-number.len-3 { font-size: 26px; }
  .qr-number.len-4 { font-size: 20px; }
  .qr-number.len-6 { font-size: 15px; }
  .qr-open .s-page { padding-bottom: 300px; }
}
/* the entry row follows its own width (QR panel open, tablet portrait, phone) */
@container main (max-width: 760px) {
  .s-entry { grid-template-columns: auto minmax(96px, 130px) minmax(0, 1fr) auto; }
  .s-entry .field { padding: 0 12px; }
  .entry-or { display: none; }
}
@container main (max-width: 560px) {
  .s-entry { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-top: 10px; }
  .btn-new { grid-column: 1 / -1; justify-content: center; }
  .entry-label { grid-column: 1 / -1; order: 1; }
  .s-entry .field { min-height: 56px; }
  .s-entry .btn { min-height: 58px; }
}
@media (max-width: 900px) {
  .s-actions .btn:not(.btn-icon) { width: var(--tap); padding: 0; }
  .s-actions .btn-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 640px) {
  .s-page { padding: 8px 8px 120px; }
  .s-top { padding-inline: 16px 4px; min-height: 60px; }
  .s-top .wordmark, .s-vsep { display: none; }
  .s-actions { gap: 0; }
  .s-board { grid-template-columns: 1fr; gap: 10px; }
  .card.is-ready .card-actions .btn { font-size: 14px; padding: 0 10px; }

  .qr-panel { inset-inline: 8px; bottom: 8px; }
  .qr-frame img { width: 132px; height: 132px; }
  .qr-hint { display: none; }
  .qr-open .s-page { padding-bottom: 250px; }

  .sheet, .sheet-wide, .sheet-confirm { width: 100%; max-width: 100%; max-height: calc(100dvh - 12px); margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .sheet[open] { animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(40%); opacity: 0; } to { transform: none; opacity: 1; } }
  .sheet-body { padding: 16px 16px 22px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-hero { grid-column: 1 / -1; }
  .stat-val { font-size: 22px; }
  .seg { align-self: stretch; }
  .seg label { flex: 1 1 auto; }
  .seg span { width: 100%; padding: 0 12px; }
  .themes { grid-template-columns: 1fr; }
  .theme-opt { display: grid; grid-template-columns: 112px minmax(0, 1fr); grid-template-areas: "pv name" "pv desc"; align-items: center; column-gap: 12px; }
  .theme-opt .pv { grid-area: pv; height: 72px; }
  .theme-name { grid-area: name; align-self: end; }
  .theme-desc { grid-area: desc; align-self: start; }
  .chart { height: 190px; }
  .bar-fill { height: calc(var(--h, 0) * 120px); }
  .print-qr img { width: 220px; height: 220px; }
}

/* =====================================================================
   PRINT — only the cashier card
   ===================================================================== */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; }
  body > *:not(#cashier-dlg) { display: none !important; }
  #cashier-dlg { position: static; display: block; width: auto; max-width: none; max-height: none; margin: 0; overflow: visible; box-shadow: none; background: #fff; animation: none; }
  #cashier-dlg::backdrop { display: none; }
  .no-print { display: none !important; }
  .sheet-body { padding: 0; }
  .print-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; padding-top: 10mm; }
  .print-qr img { width: 9cm; height: 9cm; }
  .print-instr { font-size: 26pt; }
}

/* =====================================================================
   TABLE TIMER «مؤقت الطاولات» — «محلي» on ready cards, the «على الطاولات»
   column (a third column on wide boards, a full-width row below otherwise)
   ===================================================================== */
.btn-table { background: var(--prep-soft); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow-press); }
.btn-table .ico { color: var(--prep); }
.tbl-min { font-size: 12px; font-weight: var(--fw-medium); color: var(--muted); }
@media (hover: hover) { .btn-table:hover { background: var(--surface-2); } }
/* with «محلي» the reminder shrinks to its bell (its aria-label keeps the full name) */
.card.is-ready.has-table .card-actions .btn-realert { flex: 0 0 auto; min-width: 58px; padding: 0 14px; }
.card.is-ready.has-table .btn-realert .idle { display: none; }

.s-board.has-tables .col-tables { grid-column: 1 / -1; }
.s-board.has-tables .col-tables .col-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; }
@container main (min-width: 1100px) {
  .s-board.has-tables { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-board.has-tables .col-tables { grid-column: auto; }
  .s-board.has-tables .col-tables .col-list { display: flex; }
}
.col-tables { background: var(--surface-2); }
.col-tables .col-head h2::before { border: 3px solid var(--prep); border-top-color: transparent; transform: rotate(45deg); }
.col-over { flex: none; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--alert); color: #fff; font-size: 12px; font-weight: var(--fw-bold); white-space: nowrap; }

.card.is-table {
  border-radius: var(--radius);
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "num info clock" "actions actions actions" "edit edit edit";
  row-gap: 8px; padding: 10px 10px 14px;
}
.card.is-table .t-num { background: var(--surface-2); }
.t-info { grid-area: info; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.t-where { font-size: 15px; font-weight: var(--fw-bold); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-where.is-empty { color: var(--muted); font-weight: var(--fw-medium); }
.t-who { margin-inline-start: 8px; color: var(--muted); font-weight: var(--fw-medium); }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); }
.t-ext, .t-warned { padding: 1px 9px; border-radius: var(--radius-pill); background: var(--bg); font-size: 11.5px; font-weight: var(--fw-medium); white-space: nowrap; }
.t-clock { grid-area: clock; display: flex; flex-direction: column; align-items: flex-end; padding-inline-end: 4px; line-height: 1.15; }
.t-clock b { font-size: 27px; font-weight: var(--fw-bold); letter-spacing: -.01em; transition: color .3s; }
.t-state { font-size: 11.5px; color: var(--muted); white-space: nowrap; transition: color .3s; }
.t-actions { grid-area: actions; display: flex; gap: 6px; }
.t-actions .btn { min-height: 52px; font-size: 15px; }
.t-actions .btn-extend { flex: 1; min-width: 0; }
.t-actions .btn-leave { flex: 1.4; min-width: 0; }
.t-edit { grid-area: edit; display: flex; gap: 6px; animation: state-in .25s var(--ease) both; }
.t-edit .field { flex: 1; min-width: 0; min-height: 52px; font-size: 17px; font-weight: var(--fw-bold); text-align: center; }
.t-edit .btn { min-height: 52px; flex: none; }
.card.is-editing .t-actions { display: none; }
.t-bar { position: absolute; bottom: 0; inset-inline: 18px; height: 4px; border-radius: 4px; background: var(--prep); opacity: .45; transform: scaleX(var(--left, 1)); transform-origin: right center; transition: transform 1s linear, background-color .3s; }

/* last 5 minutes: saffron; time up: crimson, the disc blinks */
.card.is-table.is-warn { box-shadow: 0 0 0 2px var(--warn), var(--shadow-1); }
.card.is-table.is-warn .t-clock b, .card.is-table.is-warn .t-state { color: var(--warn); }
.card.is-table.is-warn .t-bar { background: var(--warn); opacity: .9; }
.card.is-table.is-over { box-shadow: 0 0 0 2.5px var(--alert), var(--shadow-1); background: linear-gradient(90deg, var(--alert-soft), var(--surface) 70%); }
.card.is-table.is-over .t-clock b, .card.is-table.is-over .t-state { color: var(--alert); }
.card.is-table.is-over .t-num { background: var(--alert); color: #fff; outline-color: #fff; animation: tbl-blink 1s steps(2, jump-none) infinite; }
.card.is-table.is-over .btn-leave { background: var(--alert); color: #fff; }
@keyframes tbl-blink { 0% { outline-color: #fff; } 100% { outline-color: var(--alert-soft); } }

@container col (max-width: 360px) {
  .t-clock b { font-size: 23px; }
  .t-actions .btn { font-size: 14px; padding: 0 10px; }
}

/* toasts: time up, and «كان محلياً؟» next to the collect-undo */
.toast.is-alert { background: var(--alert); color: #fff; font-weight: var(--fw-bold); }
.toast:has(.btn-toast-table) { flex-wrap: wrap; justify-content: center; gap: 8px 12px; padding-block: 10px; border-radius: var(--radius-lg); }
.btn-toast-table { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }

/* settings: session length */
.set-child { padding-top: 14px; border-top-style: dashed; }
.minutes-field { position: relative; flex: 1; min-width: 0; display: flex; }
.minutes-field .field { padding: 0 76px; text-align: center; font-size: 22px; font-weight: var(--fw-bold); }
.minutes-unit { position: absolute; inset-inline-end: 22px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--muted); pointer-events: none; }
.minutes-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.minutes-quick .btn { min-width: 64px; font-size: 15px; }
.minutes-quick .btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-press); }

/* report */
.stats-tables .stat { background: var(--prep-soft); }
