/* Pingora Queue — shared styles. Logical properties keep RTL (Arabic) and LTR in one sheet. */
:root {
  --ink: #0f2a30; --muted: #5b6f73; --line: #dbe5e3; --bg: #f4f7f6; --card: #fff;
  --brand: #123F46; --brand-2: #2E7457; --mint: #C5E8D5; --warn: #b4532a; --warn-bg: #fbeee6;
  --ok-bg: #e5f4ec; --err-bg: #fde8e8; --err: #a62626; --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.5 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; }
a { color: var(--brand-2); }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; } h2 { font-size: 1.15rem; margin: 1.2rem 0 .5rem; } h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--card); border-block-end: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; font-weight: 600; }
.brand b { color: var(--brand-2); }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.page-owner main, .page-admin main { max-width: 980px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-block-end: 16px; }
.narrow { max-width: 420px; margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); } .small, small { font-size: .875rem; } .fine { font-size: .8rem; color: var(--muted); }
.block { display: block; } .grow { flex: 1; min-width: 0; } .break { word-break: break-all; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label { display: flex; flex-direction: column; gap: 4px; margin-block: 10px; font-weight: 500; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; margin-block: 6px; }
input, select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px; }
input.short { max-width: 9rem; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--mint); outline-offset: 1px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; }
select.lang { min-height: 36px; padding: 4px 8px; }

.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 10px 16px; border-radius: 10px; cursor: pointer; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-light { background: #fff; color: var(--brand); border-color: #fff; }
.btn-warn { background: var(--warn-bg); color: var(--warn); border-color: #f1c9b5; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-block { width: 100%; margin-block-start: 8px; } .btn-xl { font-size: 1.15rem; padding: 14px 22px; min-height: 56px; }
.btn.small { min-height: 36px; padding: 6px 10px; font-size: .9rem; }

.notice { padding: 10px 14px; border-radius: 10px; background: #eef3f2; margin: 10px 0; }
.notice.ok { background: var(--ok-bg); color: #1e5a40; } .notice.error { background: var(--err-bg); color: var(--err); }
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eef3f2; color: var(--muted); margin-inline-start: 6px; vertical-align: middle; }
.pill-online { background: var(--ok-bg); color: #1e5a40; } .pill-serving { background: var(--mint); color: var(--brand); }
.pill-break { background: #fff4d6; color: #7a5a00; } .pill-wrapping { background: var(--warn-bg); color: var(--warn); }

/* guest */
.venue-head { text-align: center; margin-block-end: 12px; } .svc-name { font-weight: 600; margin: 0; }
.service-list { display: grid; gap: 12px; }
.service-btn { display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; font: inherit; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; color: var(--ink); min-height: 76px; }
.service-btn:hover:not(:disabled) { border-color: var(--brand-2); }
.service-btn:disabled { opacity: .55; cursor: not-allowed; }
.service-btn .prefix, .list-row .prefix { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--mint); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.list-row .prefix { width: 36px; height: 36px; font-size: 1rem; }
.svc-text { display: flex; flex-direction: column; } .svc-text strong { font-size: 1.1rem; } .svc-text small { color: var(--muted); }
.big-number { font-size: clamp(3.5rem, 18vw, 6rem); font-weight: 800; letter-spacing: .02em; text-align: center; color: var(--brand); line-height: 1.1; margin: 8px 0; direction: ltr; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.stats > div, .today > div { background: var(--bg); border-radius: 12px; padding: 12px; text-align: center; display: flex; flex-direction: column; }
.stat-n { font-size: 1.8rem; font-weight: 800; color: var(--brand); } .stat-n.small { font-size: 1.3rem; padding-block: .25rem; } .stat-n.text { font-size: 1rem; font-weight: 600; padding-block: .6rem; } .stat-l { font-size: .85rem; color: var(--muted); }
.alerts { border: 1px dashed var(--brand-2); border-radius: 12px; padding: 12px; margin: 12px 0; text-align: center; }
.alerts.compact { border: 0; margin-block-start: 20px; }
.called-screen { position: fixed; inset: 0; background: var(--brand-2); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; z-index: 10; animation: pulse 1.2s ease-in-out 3; }
.called-screen .big-number { color: #fff; font-size: clamp(4rem, 24vw, 8rem); }
.called-title { font-size: 1.6rem; font-weight: 700; margin: 0; } .called-counter { font-size: 1.5rem; margin: 0 0 24px; } .called-counter strong { font-size: 2rem; display: block; }
.called-screen .muted, .called-screen .fine { color: #e5f4ec; }
@keyframes pulse { 50% { background: #3d9470; } }
@media (prefers-reduced-motion: reduce) { .called-screen { animation: none; } }

/* staff */
.console-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-block-end: 16px; }
.serving { text-align: center; } .timer { font-size: 1.3rem; font-variant-numeric: tabular-nums; color: var(--muted); margin: 0; direction: ltr; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-block-start: 16px; }
.actions .btn-xl { min-width: 12rem; }
.idle { padding-block: 40px; }
.undo-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--brand); color: #fff; border-radius: var(--radius); padding: 10px 16px; margin-block-end: 16px; }
.queue-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-block-end: 12px; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: .9rem; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { flex-direction: row; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; cursor: pointer; font-weight: 600; }
.choice:has(input:checked) { border-color: var(--brand-2); background: var(--ok-bg); }
.choice.taken { opacity: .5; cursor: not-allowed; } .choice small { display: block; font-weight: 400; color: var(--muted); }
.choice input { min-height: auto; }
.reason { margin-block-start: 16px; }

/* owner */
.portal-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin-block-end: 12px; }
.today { display: grid; grid-template-columns: repeat(4, minmax(70px, 1fr)); gap: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-block-end: 1px solid var(--line); margin-block-end: 16px; }
.tabs button { font: inherit; background: none; border: 0; border-block-end: 3px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--muted); white-space: nowrap; min-height: 44px; }
.tabs button.active { color: var(--brand); border-color: var(--brand-2); font-weight: 700; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .section-head h2 { margin-block-start: 0; }
.list { display: grid; gap: 8px; margin-block: 12px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.list-row.inactive { opacity: .6; }
.edit-form { border: 2px solid var(--mint); border-radius: 12px; padding: 12px 16px; background: #fbfdfc; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.qr-wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.qr { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
@media print {
  .topbar, .tabs, .portal-head, .btn, .notice { display: none !important; }
  .card { border: 0; } .qr { width: 70vw; height: auto; border: 0; }
}
@media (max-width: 520px) {
  .today { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .actions .btn-xl { width: 100%; }
}

/* ---------- M2: pickup stage, transfer, feedback, supervisor board ---------- */
.btn-ready { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.panel-box { border: 2px solid var(--mint); border-radius: 12px; padding: 12px 16px; margin-top: 16px; text-align: start; background: #fbfdfc; }
.pickup-list { display: grid; gap: 8px; }
.pickup-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pickup-row.ready { border-color: #b9dcc8; background: #f6fbf8; box-shadow: inset 4px 0 0 var(--brand-2); }
[dir=rtl] .pickup-row.ready { box-shadow: inset -4px 0 0 var(--brand-2); }
.pk-num { font-size: 1.5rem; font-weight: 800; color: var(--brand); direction: ltr; min-width: 4.5rem; }
.center-row { justify-content: center; margin-top: 12px; }
.feedback { margin-top: 16px; }
.stars { display: flex; justify-content: center; gap: 6px; direction: ltr; }
.star { font-size: 2rem; line-height: 1; background: none; border: 0; color: #d7c27a; cursor: pointer; min-width: 44px; min-height: 44px; border-radius: 10px; }
.star:hover, .star:focus-visible { color: #c79a1c; background: var(--bg); }
.pickup-fields { margin-top: 12px; }
.alert-card { border-color: #f1c9b5; background: var(--warn-bg); }
.board-queues { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.bq { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.bq-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bq-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.bq-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; direction: ltr; }
.bq-list .btn.small { min-height: 36px; min-width: 36px; padding: 4px 8px; }
.page-staff .tabs { margin-bottom: 12px; }

/* ---------- platform admin ---------- */
.admin-toolbar { margin-bottom: 12px; flex-wrap: nowrap; }
.admin-toolbar input { flex: 1; min-width: 0; }
.venue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.venue-grid .card { margin: 0; }
.venue-card.inactive { opacity: .65; }
.venue-head { display: flex; gap: 12px; align-items: center; }
.venue-head h2 { margin: 0 0 4px; font-size: 1.1rem; }
.venue-head .prefix { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--mint); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; }
.venue-head .pill { margin-inline-start: 0; }
.venue-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; color: var(--muted); margin: 8px 0; }
.venue-stats strong { color: var(--brand); }
.venue-card .btn.small, .subs .btn.small { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
.sub-stats { grid-template-columns: repeat(6, minmax(70px, 1fr)); margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table.subs { width: 100%; border-collapse: collapse; font-size: .92rem; }
.subs th, .subs td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.subs th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.subs select { min-height: 36px; padding: 4px 8px; }
@media (max-width: 760px) { .sub-stats { grid-template-columns: repeat(3, 1fr); } .venue-grid { grid-template-columns: 1fr; } }
.venue-grid { align-items: start; }
.venue-head h2, .venue-card h2 { text-align: start; }
.venue-card .row:has(> label.grow) { align-items: end; }
