/* TableOps base styles. System fonts, no framework: the guest page budget is small (05_DECISIONS B). */
:root {
  --bg: #f6f5f2; --card: #fff; --ink: #1c1b19; --muted: #6b675f; --line: #e4e1da;
  --brand: #c2410c; --brand-ink: #fff; --ok: #15803d; --warn: #b45309; --bad: #b91c1c; --info: #1d4ed8;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151412; --card: #201f1c; --ink: #f2efe9; --muted: #a8a399; --line: #34322d; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  background: var(--bg); color: var(--ink); }
[x-cloak] { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: .6rem 1rem; background: var(--line); color: var(--ink); }
button.primary { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
button.ok { background: var(--ok); color: #fff; }
button.ghost { background: transparent; border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--bad); border: 1px solid currentColor; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: .5rem; align-items: center; }
.spread { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--line); }
.pill.pending { background: #fef3c7; color: #92400e; } .pill.confirmed { background: #dbeafe; color: #1e40af; }
.pill.ready { background: #dcfce7; color: #166534; } .pill.served { background: var(--line); color: var(--muted); }
.pill.rejected, .pill.cancelled { background: #fee2e2; color: #991b1b; }
.banner { padding: .6rem 1rem; text-align: center; font-weight: 600; }
.banner.offline { background: var(--bad); color: #fff; position: sticky; top: 0; z-index: 20; }
.banner.note { background: #fef3c7; color: #92400e; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 1.1rem; margin: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: var(--card); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 1.2rem; max-height: 85vh; overflow: auto; }
@media (min-width: 700px) { .modal-back { align-items: center; } .modal { border-radius: 18px; } }

/* Guest */
.guest-head { padding: 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.guest-head h1 { margin: 0; font-size: 1.25rem; }
.cats { display: flex; gap: .5rem; overflow-x: auto; padding: .7rem 1rem; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.cats a { white-space: nowrap; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); padding: .35rem .8rem; border-radius: 999px; font-size: .9rem; }
.menu { padding: 0 1rem 7rem; max-width: 720px; margin: 0 auto; }
.menu h2 { font-size: 1.05rem; margin: 1.3rem 0 .5rem; }
.dish { display: flex; gap: .8rem; justify-content: space-between; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.dish .name { font-weight: 600; }
.dish .price { font-weight: 600; white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: .4rem; }
.stepper button { width: 2.2rem; height: 2.2rem; padding: 0; border-radius: 50%; }
.cartbar { position: fixed; inset-inline: 0; bottom: 0; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); z-index: 30; }
.cartbar button { width: 100%; max-width: 720px; display: block; margin: 0 auto; padding: .85rem; }
.orders { max-width: 720px; margin: 1rem auto 0; padding: 0 1rem; }
.order-card { margin-bottom: .7rem; }

/* Staff floor */
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.tbl { border-radius: var(--radius); padding: .9rem; background: var(--card); box-shadow: var(--shadow); border-inline-start: 6px solid var(--line); cursor: pointer; min-height: 96px; }
.tbl.free { border-color: var(--ok); } .tbl.occupied { border-color: var(--info); }
.tbl.needs_cleaning { border-color: var(--warn); } .tbl.blocked { border-color: var(--muted); opacity: .7; }
.tbl .label { font-size: 1.3rem; font-weight: 700; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.list > * + * { margin-top: .7rem; }

/* Kitchen */
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; align-items: start; }
.ticket { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ticket header { display: flex; justify-content: space-between; padding: .6rem .9rem; background: var(--ink); color: var(--bg); font-weight: 700; }
.ticket header.late { background: var(--bad); color: #fff; }
.kline { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem .9rem; border-top: 1px solid var(--line); cursor: pointer; user-select: none; }
.kline.cooking { background: rgba(29, 78, 216, .08); }
.kline.ready { background: rgba(21, 128, 61, .1); color: var(--muted); }
.kline .qty { font-weight: 800; font-size: 1.15rem; min-width: 2.2rem; }
.kline .note { color: var(--bad); font-size: .85rem; }
