:root {
  --bg: #eceff1;
  --surface: #ffffff;
  --surface-2: #f5f7f8;
  --ink: #12181c;
  --muted: #55626b;
  --line: #cfd6db;
  --new: #d93a1d;
  --new-bg: #fde9e4;
  --prep: #a65f00;
  --prep-bg: #fff0d1;
  --out: #1458c4;
  --out-bg: #e1ecfd;
  --done: #5b6770;
  --ok: #17803d;
  --ok-bg: #dff3e5;
  --danger: #b3261e;
  --focus: #1458c4;
  --font: "Segoe UI", system-ui, -apple-system, Tahoma, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1215;
    --surface: #182026;
    --surface-2: #1f2a31;
    --ink: #f1f5f7;
    --muted: #9db0bb;
    --line: #33424b;
    --new: #ff6a4d;
    --new-bg: #3a1c16;
    --prep: #ffb43d;
    --prep-bg: #38290e;
    --out: #6aa5ff;
    --out-bg: #14253f;
    --done: #8ea0aa;
    --ok: #4cd37d;
    --ok-bg: #123322;
    --danger: #ff8a80;
    --focus: #6aa5ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 var(--font);
}
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  padding: 10px 16px; background: var(--surface); border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1 1 240px; min-width: 0; }
.brand h1 { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--done); }
.pill.on::before { background: var(--ok); }
.pill.warn::before { background: var(--prep); }
.tabs { display: flex; gap: 6px; }
.tabs button {
  font: inherit; font-weight: 700; font-size: 1.05rem; min-height: 48px; padding: 0 20px;
  border-radius: 10px; border: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.count {
  display: inline-block; min-width: 24px; padding: 0 7px; margin-inline-start: 6px; border-radius: 99px;
  background: var(--new); color: #fff; font-size: .9rem; text-align: center;
}
.tools { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn {
  font: inherit; font-weight: 700; min-height: 48px; padding: 0 18px; border-radius: 10px;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.ghost { border-color: var(--line); color: var(--muted); font-weight: 600; }
.btn.primary { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sound.off { background: var(--prep-bg); border-color: var(--prep); color: var(--prep); }
.btn.sound.on { border-color: var(--ok); color: var(--ok); }
@media (prefers-color-scheme: dark) {
  .btn.primary, .btn.danger { color: #0b0f12; }
}

.banner {
  display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 10px 16px; background: var(--prep-bg); color: var(--prep); font-weight: 700;
  border-bottom: 2px solid var(--prep);
}

/* Board */
main { padding: 12px; }
.board {
  display: grid; gap: 12px; align-items: start;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
}
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .board { grid-template-columns: 1fr; } }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-width: 0; }
.col > h2 {
  margin: 2px 4px 10px; font-size: 1.1rem; font-weight: 800;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-bottom: 4px solid var(--col, var(--line)); padding-bottom: 6px;
}
.col h2 .n { font-variant-numeric: tabular-nums; color: var(--col, var(--muted)); }
.col.new { --col: var(--new); }
.col.accepted { --col: var(--prep); }
.col.out_for_delivery { --col: var(--out); }
.col.ready { --col: var(--ok); }
.board.has-ready { grid-template-columns: repeat(5, minmax(230px, 1fr)); }
@media (max-width: 1500px) { .board.has-ready { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .board.has-ready { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .board.has-ready { grid-template-columns: 1fr; } }
.pickup-strip { font-weight: 900; letter-spacing: .04em; background: var(--ok-bg); color: var(--ok); border: 2px solid var(--ok); border-radius: 8px; padding: 4px 10px; width: fit-content; margin: 4px 0; }
.fil-chips { display: inline-flex; gap: 4px; }
.fil-chips button { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.fil-chips button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.col.done { --col: var(--done); }
.empty { color: var(--muted); text-align: center; padding: 18px 6px; }

.card {
  background: var(--surface); border: 2px solid var(--line); border-inline-start: 8px solid var(--col);
  border-radius: 12px; padding: 12px; margin-bottom: 10px; min-width: 0;
}
.card.alert { animation: flash 0.9s steps(2, jump-none) infinite; }
@keyframes flash {
  0% { background: var(--surface); border-color: var(--line); }
  100% { background: var(--new-bg); border-color: var(--new); }
}
@media (prefers-reduced-motion: reduce) {
  .card.alert { animation: none; background: var(--new-bg); border-color: var(--new); }
}
.card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.num { font-size: 2.1rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.age { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.age.late { color: var(--new); }
.who { margin: 8px 0 2px; font-weight: 700; }
.who .phone { color: var(--muted); font-weight: 500; unicode-bidi: plaintext; }
.addr { color: var(--ink); margin-bottom: 8px; overflow-wrap: anywhere; }
.addr a { font-weight: 700; color: var(--out); }
.lines { list-style: none; margin: 8px 0; padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.lines li { padding: 5px 0; display: grid; grid-template-columns: auto 1fr; gap: 0 10px; }
.lines .q { font-weight: 900; font-size: 1.15rem; }
.lines .nm { font-weight: 700; font-size: 1.05rem; }
.lines .ar { color: var(--muted); font-weight: 500; font-size: .95rem; }
.lines .mods { grid-column: 2; font-size: .92rem; color: var(--muted); }
.lines .mods .no { background: var(--new-bg); color: var(--new); border: 1px solid var(--new); font-weight: 800; padding: 1px 8px; border-radius: 6px; text-transform: uppercase; }
.lines .note { grid-column: 2; font-weight: 700; background: var(--prep-bg); color: var(--prep); padding: 2px 8px; border-radius: 6px; width: fit-content; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.total { font-size: 1.25rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.badge { font-size: .85rem; font-weight: 800; padding: 3px 10px; border-radius: 6px; background: var(--ok-bg); color: var(--ok); }
.badge.branch { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.branch-filter { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; }
.branch-filter select, .driver-pick { min-height: 40px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 8px; font: inherit; max-width: 100%; }
.driver-row { display: flex; align-items: center; gap: 8px; }
.driver-row .driver-pick { flex: 1; min-height: 48px; }
.col.scheduled { grid-column: 1 / -1; --col: var(--prep); }
.sched-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; align-items: start; }
.driver-line { color: var(--out); }
.badge.foodics { background: var(--out-bg); color: var(--out); }
.badge.foodics.sending { background: var(--prep-bg); color: var(--prep); }
.badge.foodics.bad { background: var(--new-bg); color: var(--new); border: 0; cursor: pointer; font-family: inherit; }
.badge.card-pay { background: var(--out-bg); color: var(--out); }
.badge.rejected, .badge.cancelled { background: var(--new-bg); color: var(--new); }
.prep { font-weight: 700; color: var(--prep); margin-top: 6px; }
.actions { display: grid; gap: 8px; margin-top: 10px; }
.actions .label { font-weight: 700; color: var(--muted); font-size: .9rem; }
.preps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preps .btn { font-size: 1.1rem; min-height: 56px; padding: 0 6px; background: var(--ok); border-color: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { .preps .btn { color: #0b0f12; } }
.actions .big { min-height: 60px; font-size: 1.15rem; }
details.card > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card .body { margin-top: 8px; }

/* Menu */
.menu { max-width: 760px; margin: 0 auto; }
.menu h2 { font-size: 1.15rem; margin: 18px 4px 8px; text-transform: capitalize; }
.item {
  display: flex; align-items: center; gap: 12px; background: var(--surface); border: 2px solid var(--line);
  border-radius: 12px; padding: 8px 14px; margin-bottom: 8px; min-height: 64px;
}
.item.off { background: var(--surface-2); }
.item.off .info { opacity: .6; }
.item .info { flex: 1; min-width: 0; }
.item .nm { font-weight: 700; }
.item .sub { color: var(--muted); font-size: .92rem; }
.switch { position: relative; flex: none; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 48px; font-weight: 700; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { width: 60px; height: 34px; border-radius: 99px; background: var(--done); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 4px; inset-inline-start: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(26px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch .txt { min-width: 72px; }

/* Dialog */
dialog { border: 2px solid var(--ink); border-radius: 14px; background: var(--surface); color: var(--ink); max-width: min(480px, 92vw); width: 100%; padding: 18px; }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h2 { margin: 0 0 4px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.quick .btn { min-height: 44px; font-weight: 600; }
dialog input { width: 100%; font: inherit; font-size: 1.05rem; min-height: 48px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* Header: pause switch + page links */
.tools { flex-wrap: wrap; }
.btn.pause { min-width: 150px; }
.btn.pause.on { border-color: var(--ok); color: var(--ok); }
.btn.pause.paused { background: var(--danger); border-color: var(--danger); color: #fff; font-size: 1.05rem; }
@media (prefers-color-scheme: dark) { .btn.pause.paused { color: #0b0f12; } }
.links { display: flex; gap: 4px; flex-wrap: wrap; }
.links a { color: var(--muted); font-weight: 700; text-decoration: none; padding: 10px 10px; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
.links a:hover { color: var(--ink); background: var(--surface-2); }
.links a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); border-radius: 0; }

/* Order cards: delivery fee flag */
.badges { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.badge.check { background: var(--prep-bg); color: var(--prep); border: 1px solid var(--prep); }
.feeline { font-size: .9rem; margin-top: 4px; }

/* Chats */
.chats { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 12px; align-items: stretch; height: calc(100vh - 110px); min-height: 420px; }
.chat-list { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.chat-row { font: inherit; color: inherit; text-align: start; display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; min-height: 64px; }
.chat-row.sel { border-color: var(--ink); }
.chat-row .dot { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; background: transparent; }
.chat-row.unread .dot { background: var(--new); }
.chat-row .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-row .top { display: flex; justify-content: space-between; gap: 8px; }
.chat-row .nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.unread .nm { color: var(--new); }
.chat-row .when { color: var(--muted); font-size: .85rem; flex: none; font-variant-numeric: tabular-nums; }
.chat-row .pv { color: var(--muted); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge.paused-badge { width: fit-content; background: var(--prep-bg); color: var(--prep); margin-top: 2px; }
.chat-thread { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.chat-thread > .empty { margin: auto; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border-bottom: 2px solid var(--line); }
.thread-head .who { flex: 1; min-width: 0; }
.thread-head .nm { font-weight: 800; font-size: 1.1rem; }
.thread-head .phone { color: var(--muted); font-size: .9rem; unicode-bidi: plaintext; }
.thread-head .back { display: none; }
.handoff-note { padding: 8px 12px; background: var(--prep-bg); color: var(--prep); font-weight: 700; font-size: .92rem; }
.chat-thread .log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: min(80%, 520px); padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.bubble.in { align-self: flex-start; }
.bubble.out { align-self: flex-end; background: var(--out-bg); border-color: var(--out); }
.bubble.out.staff { background: var(--ok-bg); border-color: var(--ok); }
.bubble .by { font-size: .75rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bubble .txt { white-space: pre-wrap; }
.bubble .btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bubble .chip { font-size: .85rem; font-weight: 700; padding: 2px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); }
.bubble .ts { font-size: .75rem; color: var(--muted); text-align: end; margin-top: 2px; }
.composer { display: flex; gap: 8px; padding: 10px; background: var(--surface); border-top: 2px solid var(--line); align-items: stretch; }
.composer textarea { flex: 1; font: inherit; font-size: 1.05rem; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); resize: none; min-height: 56px; }
@media (max-width: 760px) {
  .chats { grid-template-columns: 1fr; height: 72vh; }
  .chats.has-sel .chat-list { display: none; }
  .chats:not(.has-sel) .chat-thread { display: none; }
  .thread-head .back { display: inline-flex; min-height: 44px; }
}

/* Settings page */
.settings-page { max-width: 860px; margin: 0 auto; padding-bottom: 90px; }
.settings-page section.card-box { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.settings-page h2 { margin: 0 0 4px; font-size: 1.2rem; }
.settings-page .hint { color: var(--muted); margin: 0 0 12px; font-size: .95rem; }
.settings-page label.field { display: grid; gap: 4px; font-weight: 700; font-size: .92rem; }
.settings-page input[type="text"], .settings-page input[type="number"], .settings-page input[type="time"] {
  font: inherit; font-size: 1.05rem; min-height: 48px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
.settings-page input:disabled { opacity: .5; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 8px; }
.row > * { flex: 1 1 140px; min-width: 0; }
.row > .btn { flex: 0 0 auto; }
.big-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.big-toggle .state { font-size: 1.3rem; font-weight: 900; }
.big-toggle .state.off { color: var(--danger); }
.day { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: start; padding: 10px 0; border-top: 1px dashed var(--line); }
.day:first-of-type { border-top: 0; }
.day .dn { font-weight: 800; padding-top: 12px; }
.day .win { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.day .win input[type="time"] { width: 130px; }
.day .win .sep { color: var(--muted); }
.day .win .note { color: var(--muted); font-size: .85rem; }
.day .closed { color: var(--muted); font-weight: 700; padding: 12px 0; }
.day .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: .92rem; }
@media (max-width: 560px) { .day { grid-template-columns: 1fr; } .day .dn { padding-top: 0; } }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-top: 2px solid var(--line); }
.savebar .msg { font-weight: 700; }
.savebar .msg.ok { color: var(--ok); }
.savebar .msg.err { color: var(--danger); }
.errors { background: var(--new-bg); color: var(--new); border: 2px solid var(--new); border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-weight: 700; }
.errors ul { margin: 4px 0 0; padding-inline-start: 20px; }

/* Voice-call orders */
.badge.call { background: var(--out-bg); color: var(--out); }

/* Reservations */
.resv { max-width: 860px; margin: 0 auto; }
.resv-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.resv-nav { display: flex; gap: 8px; align-items: center; }
.resv-nav input[type="date"], .resv-form input, .resv-form select {
  font: inherit; font-size: 1.05rem; min-height: 48px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
.resv-nav input[type="date"] { width: auto; }
.resv-head { flex: 1 1 200px; min-width: 0; }
.resv-head h2 { margin: 0; font-size: 1.25rem; }
.resv-list { display: grid; gap: 10px; }
.resv-card { border-inline-start-color: var(--out); }
.resv-card.status-seated { border-inline-start-color: var(--ok); }
.resv-card.status-completed, .resv-card.status-cancelled, .resv-card.status-no_show { border-inline-start-color: var(--done); opacity: .75; }
.resv-card .head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.resv-card .rtime { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.resv-card .rparty { font-size: 1.2rem; font-weight: 800; }
.resv-card .rstatus { margin-inline-start: auto; background: var(--out-bg); color: var(--out); }
.badge.rstatus.seated { background: var(--ok-bg); color: var(--ok); }
.badge.rstatus.completed { background: var(--surface-2); color: var(--done); }
.badge.rstatus.cancelled, .badge.rstatus.no_show { background: var(--new-bg); color: var(--new); }
.resv-card .phone { color: var(--out); font-weight: 600; unicode-bidi: plaintext; }
.resv-card .note-box { margin-top: 6px; font-weight: 700; background: var(--prep-bg); color: var(--prep); padding: 4px 10px; border-radius: 6px; width: fit-content; }
.resv-actions { grid-auto-flow: column; grid-auto-columns: 1fr; }
.resv-actions .btn { min-height: 52px; }
.resv-form { display: grid; gap: 10px; }
.resv-form .field { display: grid; gap: 4px; font-weight: 700; font-size: .92rem; }
.resv-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-msg { margin: 0; min-height: 1.2em; color: var(--danger); font-weight: 700; }

/* Login, business switcher, team, platform admin */
.session-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.session-bar .who { color: var(--muted); font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.session-bar select, .form-grid input, .form-grid select, .form-grid textarea, .login-card input {
  font: inherit; font-size: 1.05rem; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
.session-bar select { width: auto; max-width: 220px; min-height: 40px; }
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 22px 18px; display: grid; gap: 12px; }
.login-card h1 { margin: 0; font-size: 1.4rem; }
.login-card label, .form-grid label { display: grid; gap: 4px; font-weight: 700; font-size: .92rem; }
.login-card .btn { width: 100%; }
.admin-page { max-width: 980px; margin: 0 auto; padding: 0 0 40px; display: grid; gap: 14px; }
.box { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.box h2 { margin: 0 0 8px; font-size: 1.2rem; }
.biz-list { display: grid; gap: 10px; }
.biz { display: grid; gap: 8px; border-inline-start: 6px solid var(--ok); }
.biz.off { border-inline-start-color: var(--done); opacity: .8; }
.biz .head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.biz .head h3 { margin: 0; font-size: 1.1rem; }
.biz .nums { display: flex; gap: 16px; flex-wrap: wrap; font-size: .92rem; color: var(--muted); }
.biz .nums b { color: var(--ink); }
.biz .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.biz .acts .btn { min-height: 44px; }
.check-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.check-list li::before { content: "\25CB  "; color: var(--prep); }
.check-list li.done::before { content: "\2713  "; color: var(--ok); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.steps span { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; font-weight: 700; color: var(--muted); }
.steps span.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.form-grid { display: grid; gap: 10px; }
.form-grid .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .form-grid .two { grid-template-columns: 1fr; } }
.team-list { display: grid; gap: 8px; margin: 8px 0 12px; }
.team-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 8px 0; border-top: 1px dashed var(--line); }
.team-row:first-child { border-top: 0; }
.ok-text { color: var(--ok); font-weight: 700; }
.err-text { color: var(--danger); font-weight: 700; min-height: 1.2em; }

/* Phase 4: upsell tag, appointment staff filter */
.badge.upsell { background: var(--out-bg); color: var(--out); }
.resv-staff { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.resv-staff select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line, #8884); background: inherit; color: inherit; font: inherit; }

/* Phone: header rows wrap instead of pushing the page sideways */
@media (max-width: 640px) {
  .tabs { width: 100%; gap: 4px; }
  .tabs button { flex: 1 1 auto; min-width: 0; padding: 0 8px; font-size: .88rem; line-height: 1.1; }
  .tabs .count { margin-inline-start: 3px; min-width: 20px; padding: 0 5px; }
  .tools { flex-wrap: wrap; width: 100%; }
  .tools .links { flex-wrap: wrap; }
}

/* Settings: phone fields and dropdowns look like the other fields */
.settings-page input[type="tel"], .settings-page input[type="url"], .settings-page select {
  font: inherit; font-size: 1.05rem; min-height: 48px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; max-width: 100%;
}
.settings-page select { padding: 0 8px; }

/* Chat list rows: the row's ".top" line must not pick up the page header's ".top" look */
.chat-row .top { position: static; padding: 0; border: 0; background: none; flex-wrap: nowrap; align-items: baseline; }

/* Arabic / right-to-left */
html[lang="ar"] body { font-family: 'Alexandria', 'Segoe UI', Tahoma, 'Noto Sans Arabic', sans-serif; }
html[lang="ar"] body, html[lang="ar"] body * { letter-spacing: 0 !important; }
html[lang="ar"] .bubble .by { text-transform: none; }
html[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-26px); }
html[dir="rtl"] .resv-nav .arrow { display: inline-block; transform: scaleX(-1); }
.lang-toggle { min-height: 44px; }
.login-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.login-top .lang-toggle { flex: none; min-width: 84px; }
.chat-row .when, .rtime, .num, .phone, .total { unicode-bidi: isolate; }

/* Date navigation wraps on narrow phones instead of pushing the page sideways */
.resv-nav { flex-wrap: wrap; max-width: 100%; }
.resv-nav input[type="date"] { min-width: 0; flex: 1 1 140px; }
.login-card .login-top .btn { width: auto; }
.login-card { min-width: 0; }
.login-card label > span { min-width: 0; }
