/* «منيو الطاولة» + «نداء شلة» (pager + cashier console). Theme tokens come from styles.css. */
[hidden] { display: none !important; }
:root {
  --ring-a: #F59E0B; --ring-b: #E11D48; --ring-c: #9333EA;
  --scene-a: #3B2A1E; --scene-b: #1E140D;
  --warm: 255, 196, 120;
  --danger-soft: #FDECE4;
  --sheet-h: 300px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --danger-soft: #3A1D12; } }
:root[data-theme="dark"] { --danger-soft: #3A1D12; }

.btn-sm { min-height: 38px; padding: 0 12px; border-radius: 12px; font-size: 13px; }
.btn-danger { color: var(--danger); }
.stepper { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.stepper .icon-btn { width: 36px; min-height: 36px; }

/* ---------------- table menu ---------------- */
body.body-table { overflow: hidden; overscroll-behavior: none; }
.tb-host { height: calc(100dvh - 60px); }
.tb { position: relative; height: 100%; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; }

.tb-stories { display: flex; gap: 14px; overflow-x: auto; padding: 6px 16px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.tb-stories::-webkit-scrollbar { display: none; }
.tb-story { flex: none; display: grid; justify-items: center; gap: 4px; width: 74px; background: none; border: 0; padding: 0; scroll-snap-align: start; }
.tb-ring { width: 70px; height: 70px; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, var(--ring-a), var(--ring-b), var(--ring-c), var(--ring-a)); transition: transform .2s; }
.tb-seen .tb-ring { background: var(--line); }
.tb-on .tb-ring { background: conic-gradient(from 210deg, var(--ring-a), var(--ring-b), var(--ring-c), var(--ring-a)); transform: scale(1.06); }
.tb-story-img { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; border: 3px solid var(--bg); background: var(--surface-2); color: var(--ink-3); }
.tb-story-img img { width: 100%; height: 100%; object-fit: cover; }
.tb-story-name { font-size: 12px; font-weight: 700; max-width: 74px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tb-scene { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--scene-a), var(--scene-b)); isolation: isolate; }
.tb-ambient { position: absolute; inset: -24px; background-size: cover; background-position: center; filter: blur(14px) brightness(.5) saturate(1.25); transform: scale(1.06); z-index: -2; }
.tb-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120px 120px at 14% 18%, rgba(var(--warm), .35), transparent 70%),
    radial-gradient(90px 90px at 82% 12%, rgba(var(--warm), .3), transparent 70%),
    radial-gradient(70px 70px at 60% 26%, rgba(var(--warm), .22), transparent 70%),
    radial-gradient(60% 40% at 50% 100%, rgba(var(--warm), .25), transparent 70%); }
.tb-sign { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; z-index: 0; pointer-events: none;
  color: rgba(255, 236, 205, .92); font-size: 22px; font-weight: 800; letter-spacing: .5px; text-align: center; max-width: 80%;
  text-shadow: 0 0 18px rgba(var(--warm), .55), 0 2px 6px rgba(0, 0, 0, .45); }
.tb-sign img { width: 72px; height: 72px; border-radius: 20px; object-fit: cover; box-shadow: 0 0 0 3px rgba(255, 236, 205, .35), 0 0 30px rgba(var(--warm), .45); }
.tb-sheet-open .tb-sign { opacity: 0; transition: opacity .3s; }
.tb-offers { position: absolute; top: 10px; inset-inline: 12px 60px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 3; }
.tb-offer { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(20, 12, 6, .45); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tb-sound { position: absolute; top: 10px; inset-inline-end: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: rgba(20, 12, 6, .45); border: 1px solid rgba(255, 255, 255, .18); }

.tb-table { position: absolute; left: -10%; width: 120%; bottom: 4%; aspect-ratio: 1.6 / 1; transition: transform .45s cubic-bezier(.2, .8, .2, 1); transform-origin: 50% 100%; }
.tb-sheet-open .tb-table { transform: translateY(calc(-1 * var(--sheet-h) + 40px)) scale(.86); }
.tb-marble { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); }
.tb-items { position: absolute; inset: 0 7%; }
.tb-steam { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
.tb-hint { position: absolute; inset-inline: 18%; top: 38%; text-align: center; font-size: 13px; font-weight: 700; color: #6B5B4D; display: flex; gap: 6px; justify-content: center; align-items: center; }
.tb-more { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(20, 12, 6, .55); color: #fff; }

.tb-plate { position: absolute; left: var(--x); top: var(--y); width: calc(31% * var(--s)); aspect-ratio: 1; padding: 0; border: 0; background: none;
  transform: translate(-50%, -62%); transform-origin: 50% 85%; -webkit-tap-highlight-color: transparent; }
.tb-hidden { visibility: hidden; }
.tb-shadow { position: absolute; left: 6%; right: 6%; bottom: -8%; height: 26%; border-radius: 50%; background: radial-gradient(closest-side, rgba(45, 28, 12, .45), transparent); filter: blur(3px); }
.tb-obj { position: absolute; inset: 0; display: block; }
.tb-dish { border-radius: 50%; padding: 7%; background: radial-gradient(circle at 35% 30%, #fff, #F3EEE8 70%, #E2D9CF); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .12), 0 2px 0 #DDD3C8; overflow: hidden; }
.tb-dish img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tb-cut img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(40, 24, 10, .35)); }
.tb-qty { position: absolute; top: 2%; inset-inline-end: 6%; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.tb-land { animation: tb-land .62s cubic-bezier(.3, 1.4, .5, 1); }
.tb-land-ice { animation: tb-land .62s cubic-bezier(.3, 1.4, .5, 1), tb-ice .5s .5s 2; }
.tb-bump { animation: tb-bump .4s ease; }
@keyframes tb-land {
  0% { transform: translate(-50%, -62%) scale(1.1, .86); }
  45% { transform: translate(-50%, -66%) scale(.95, 1.06); }
  75% { transform: translate(-50%, -61%) scale(1.02, .98); }
  100% { transform: translate(-50%, -62%) scale(1); }
}
@keyframes tb-ice { 25% { rotate: -3deg; } 75% { rotate: 3deg; } }
@keyframes tb-bump { 50% { transform: translate(-50%, -62%) scale(1.12); } }

/* cold: condensation drops + glint */
.drop { position: absolute; width: 5px; height: 7px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .35) 45%, rgba(200, 225, 255, .15));
  box-shadow: 0 1px 1px rgba(0, 0, 0, .15); animation: drop 5s linear infinite; }
.drop:nth-of-type(1) { left: 30%; top: 22%; animation-delay: .2s; }
.drop:nth-of-type(2) { left: 58%; top: 18%; animation-delay: 1.6s; animation-duration: 6s; }
.drop:nth-of-type(3) { left: 44%; top: 30%; animation-delay: 3.1s; }
.drop:nth-of-type(4) { left: 68%; top: 34%; animation-delay: 2.3s; animation-duration: 7s; }
.drop:nth-of-type(5) { left: 22%; top: 40%; animation-delay: 4s; }
@keyframes drop { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: .95; transform: translateY(0) scale(1); } 85% { opacity: .8; } 100% { opacity: 0; transform: translateY(34px) scale(.9); } }
.glint { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%);
  background-size: 250% 100%; animation: glint 4.5s ease-in-out infinite; mix-blend-mode: soft-light; }
.tb-cut .glint { -webkit-mask: var(--mask) center / contain no-repeat; mask: var(--mask) center / contain no-repeat; }
@keyframes glint { 0%, 55% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* hot: heat shimmer above heavy dishes (level 3) */
.shimmer { position: absolute; left: 18%; right: 18%; top: -34%; height: 40%; pointer-events: none; border-radius: 50%;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0) 0 5px, rgba(255, 255, 255, .07) 5px 7px); filter: blur(1.5px); animation: shimmer 1.6s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { transform: skewX(-4deg) translateY(0); opacity: .5; } 50% { transform: skewX(5deg) translateY(-6px); opacity: .9; } }

/* category sheet */
.tb-sheet { position: absolute; left: 0; right: 0; bottom: 72px; height: var(--sheet-h); z-index: 10; display: grid; grid-template-rows: auto 1fr;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 22px 22px 0 0; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(0, 0, 0, .25);
  transform: translateY(calc(100% + 80px)); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.tb-sheet[aria-hidden="false"] { transform: translateY(0); }
.tb-instant { transition: none; }
.tb-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px 6px; font-size: 16px; }
.tb-cards { display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 14px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.tb-cards::-webkit-scrollbar { display: none; }
.tb-card { flex: none; width: 176px; display: grid; grid-template-rows: 100px 1fr; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); scroll-snap-align: start; }
.tb-card-img { position: relative; background: var(--surface-2); overflow: hidden; }
.tb-card-img img { width: 100%; height: 100%; object-fit: cover; }
.tb-card-body { display: grid; gap: 5px; padding: 8px 10px 10px; align-content: start; }
.tb-card-body .price { margin: 0; }
.tb-card-body .price strong { font-size: 15px; }
.tb-card-name { font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.tb-card-tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 18px; }
.tag-hot { background: var(--danger-soft); color: var(--danger); }
.tag-cold { background: color-mix(in srgb, #3B82F6 14%, var(--surface)); color: color-mix(in srgb, #2563EB 80%, var(--ink)); }
.tb-card-img .wisp { position: absolute; bottom: 30%; width: 16px; height: 46px; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .85), transparent); filter: blur(5px); animation: wisp 3s ease-out infinite; }
.tb-card-img .wisp:nth-of-type(1) { left: 34%; }
.tb-card-img .wisp:nth-of-type(2) { left: 50%; animation-delay: 1s; }
.tb-card-img .wisp:nth-of-type(3) { left: 62%; animation-delay: 2s; }
@keyframes wisp { 0% { opacity: 0; transform: translateY(10px) scaleX(.7); } 30% { opacity: .75; } 100% { opacity: 0; transform: translateY(-44px) translateX(8px) scaleX(1.5) skewX(12deg); } }

/* bar, popover, modal, flying ghost */
.tb-bar { position: relative; z-index: 12; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 16px env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tb-bar-info { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--brand-strong); }
.tb-bar-text { color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-bar .btn { min-height: 46px; }
.tb-pop { position: fixed; z-index: 60; display: grid; gap: 10px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tb-pop-head, .tb-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tb-pop .price { margin: 0; }
.tb-note { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 42px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); }
.tb-note input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); }
.tb-modal { position: fixed; inset: 0; z-index: 70; display: grid; align-items: end; justify-items: center; background: rgba(0, 0, 0, .5); }
.tb-modal-card { width: min(640px, 100%); max-height: 88dvh; overflow: auto; display: grid; gap: 12px; padding: 6px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: 22px 22px 0 0; animation: up .3s cubic-bezier(.2, .8, .2, 1); }
.tb-modal-card .tb-sheet-head { padding: 10px 0 0; }
.tb-modal-card .pick-list { margin: 0; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.tb-summary { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tb-summary li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.tb-summary small { display: block; color: var(--ink-3); font-size: 12px; }
.tb-sum-total { padding-top: 8px; border-top: 1px dashed var(--line); font-weight: 800; }
.tb-ghost { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; will-change: transform; }
.tb-ghost img { width: 100%; height: 100%; object-fit: cover; }
.tb-ghost.tb-dish { border-radius: 50%; }
.tb-ghost.tb-dish img { border-radius: 50%; }
.tb-ghost.tb-cut img { object-fit: contain; filter: drop-shadow(0 18px 14px rgba(0, 0, 0, .35)); }
.choice-ico-table { background: linear-gradient(135deg, var(--ring-a), var(--ring-b)); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .tb-table, .tb-sheet { transition: none; }
  .tb-land, .tb-land-ice, .tb-bump, .drop, .glint, .shimmer, .wisp { animation: none !important; }
  .drop { opacity: .7; }
}

/* ---------------- pager (customer) ---------------- */
.pg { display: grid; gap: 14px; padding-top: 8px; }
.pg-store { display: flex; align-items: center; gap: 12px; }
.pg-store div { display: grid; }
.pg-logo { width: 48px; height: 48px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); }
.pg-logo img { width: 100%; height: 100%; object-fit: cover; }
.pg-ticket { position: relative; display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border-radius: 28px; text-align: center;
  background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); }
.pg-label { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.pg-number { font-size: 104px; line-height: 1; font-weight: 800; letter-spacing: -2px; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.pg-status { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; }
.pg-ahead { color: var(--ink-2); font-weight: 600; }
.pg-waiting .pg-ticket::after { content: ""; position: absolute; inset: -2px; border-radius: 28px; border: 2px solid var(--brand); opacity: .5; animation: pg-breathe 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes pg-breathe { 50% { opacity: .1; transform: scale(1.02); } }
.pg-called .pg-ticket { background: var(--brand); border-color: var(--brand); color: #fff; animation: pg-pulse 1s ease-in-out infinite; }
.pg-called .pg-number, .pg-called .pg-label, .pg-called .pg-ahead { color: #fff; }
.pg-called::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--brand); animation: pg-flash 1s steps(1) infinite; pointer-events: none; }
@keyframes pg-pulse { 50% { transform: scale(1.03); } }
@keyframes pg-flash { 0% { opacity: .28; } 50% { opacity: 0; } }
.pg-big { min-height: 60px; font-size: 18px; }
.pg-armed, .pg-tip { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--brand-strong); margin: 0; }
.pg-tip { color: var(--ink-2); font-weight: 500; font-size: 13px; }
.pg-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.pg-completed .pg-number, .pg-cancelled .pg-number, .pg-expired .pg-number { color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) {
  .pg-called .pg-ticket, .pg-waiting .pg-ticket::after { animation: none; }
  .pg-called::before { animation: none; opacity: .15; }
}

/* ---------------- cashier console ---------------- */
.app:has(.ct) { max-width: 1100px; }
.ct { display: grid; gap: 14px; padding-top: 4px; }
.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ct-head h1 { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.ct-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ct-stats div { display: grid; gap: 2px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.ct-stats strong { font-size: 18px; }
.ct-stats small { font-size: 11px; color: var(--ink-2); }
@media (max-width: 560px) { .ct-stats { grid-template-columns: repeat(3, 1fr); } }
.ct-new { display: grid; gap: 10px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border-radius: 10px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); }
.ct-table, .field input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.ct-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ct-tk { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.ct-tk-num { grid-row: span 2; display: grid; place-items: center; min-width: 74px; padding: 0 8px; border-radius: 14px; background: var(--surface-2); font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ct-called { border-color: var(--warn); }
.ct-called .ct-tk-num { background: var(--warn-soft); color: var(--warn); }
.ct-arrived .ct-tk-num { background: var(--brand-soft); color: var(--brand-strong); }
.ct-late { background: var(--danger-soft); border-color: var(--danger); }
.ct-tk-body { display: grid; gap: 4px; min-width: 0; }
.ct-tk-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; }
.ct-tk-line > span { display: inline-flex; align-items: center; gap: 4px; }
.ct-tk-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct-tk-actions .btn { min-height: 42px; font-size: 14px; padding: 0 12px; }
.ct-qr-num { text-align: center; font-size: 56px; font-weight: 800; line-height: 1; color: var(--brand-strong); }
.ct-qr { width: min(72vw, 340px); margin: 0 auto; padding: 10px; border-radius: 18px; background: #fff; }
.ct-qr svg { display: block; width: 100%; height: auto; }
.ct-login { max-width: 460px; margin: 0 auto; }
.ct-login .page-title { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ct-form { display: grid; gap: 14px; margin-top: 16px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field-row { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.field-row input { border: 0; border-radius: 0; }
.field-prefix { padding: 0 12px; color: var(--ink-2); font-weight: 700; border-inline-end: 1px solid var(--line); align-self: stretch; display: grid; place-items: center; }
