
/* Two themes from one brand.
   Customer (default): La Terraza's printed menu — warm black, cream type, solid brand orange.
   Office (.office): see office.css (minimal neutral dashboard for reception + owner). */
:root {
  --bg: #110e0b; --surface: #1b1713; --surface-2: #231e19; --line: #33291f; --line-strong: #4a3d30;
  --text: #f4ecdf; --muted: #b3a593; --gold: #e2c08d;
  --brand: #f08a24; --brand-ink: #1a1006; --accent: #f08a24; --accent-soft: #2e1f12; --accent-ink: #f6c08a;
  --danger: #fca5a5; --danger-soft: #3b1514; --ok: #86efac; --ok-soft: #12301d;
  --serif: 'Playfair Display', Georgia, serif; --sans: Karla, system-ui, sans-serif;
  --r-card: 20px; --r-input: 14px; --r-img: 14px;
  --map-bg: #15110d; --tbl: #241e19; --tbl-line: #4a3d30; --tbl-text: #d8ccbb;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 .4em; line-height: 1.15; letter-spacing: -0.01em; }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.hidden { display: none !important; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::placeholder { color: var(--muted); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; }

/* Buttons: flat pills, no gradients, no glow. */
button, .btn { font: 500 15px/1 var(--sans); cursor: pointer; border: 1px solid transparent; border-radius: 999px; min-height: 44px; padding: 0 20px;
  background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: background-color .15s, border-color .15s, opacity .15s; }
button:hover, .btn:hover { border-color: var(--line-strong); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--brand); color: var(--brand-ink); }
.primary:hover { border-color: transparent; opacity: .9; }
.ghost { background: transparent; border-color: var(--line-strong); }
.danger { background: var(--danger-soft); color: var(--danger); }
.ok { background: var(--ok-soft); color: var(--ok); }
.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; padding: 0; flex: none; }

input, select, textarea { font: 16px/1.4 var(--sans); color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-input); padding: 12px 14px; width: 100%; }
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
label.check { display: inline-flex; gap: 8px; align-items: center; color: var(--text); margin: 4px 14px 4px 0; font-size: 15px; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.field-error { color: var(--danger); font-size: 14px; font-weight: 500; min-height: 1.5em; margin: 10px 0 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; min-height: 40px; border-radius: 999px; background: transparent; border: 1px solid var(--line-strong);
  font: 500 14px/1 var(--sans); white-space: nowrap; cursor: pointer; color: var(--text); text-decoration: none; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--brand-ink); font: 700 12px/1 var(--sans); }
.tag { font-size: 13px; color: var(--muted); font-weight: 500; }
.tag.hot { color: var(--accent-ink); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; }
.notice { background: var(--accent-soft); color: var(--accent-ink); border-radius: var(--r-input); padding: 12px 16px; font-weight: 500; }
.alert { background: var(--danger-soft); color: var(--danger); border-radius: var(--r-input); padding: 12px 16px; font-weight: 600; }
.algs { display: flex; flex-wrap: wrap; gap: 4px; }
.alg { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--line-strong); color: var(--gold); font: 700 11px/1 var(--sans); }
.alg .ico { width: 17px; height: 17px; }
.alg.bad { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.price { font-weight: 700; white-space: nowrap; }
.old { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: .85em; margin-inline-end: 6px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

/* Sheets */
.overlay { position: fixed; inset: 0; background: rgba(10, 8, 6, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease-out; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: -8px auto 14px; }
@media (min-width: 720px) { .overlay { align-items: center; } .sheet { border-radius: 24px; } .sheet::before { display: none; } .sheet.wide { max-width: 860px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet-head h2, .sheet-head h3 { margin: 0; }
@keyframes up { from { transform: translateY(32px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
#toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px;
  font-weight: 500; z-index: 99; max-width: 92vw; text-align: center; font-size: 15px; }

/* 2D floor map */
.map { position: relative; width: 100%; aspect-ratio: 1000 / 620; background: var(--map-bg); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; user-select: none; touch-action: none; }
.area { position: absolute; border: 1px dashed var(--line-strong); border-radius: 16px; color: var(--muted); font-size: 12px; font-weight: 500; padding: 6px 10px; letter-spacing: .04em; text-transform: uppercase; }
.area.kids { border-style: dotted; } .area.bar { background: var(--surface); }
.tbl { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--tbl); border: 1.5px solid var(--tbl-line);
  color: var(--tbl-text); font: 600 clamp(11px, 1.5vw, 18px)/1 var(--sans); cursor: pointer; padding: 0; min-height: 0; transition: transform .12s; }
.tbl.round { border-radius: 50%; } .tbl.square { border-radius: 12px; }
.tbl:hover { transform: scale(1.04); border-color: var(--tbl-line); }
.tbl .sub { display: inline-flex; align-items: center; gap: 2px; font-size: clamp(8px, .85vw, 11px); font-weight: 500; opacity: .9; }
.tbl .sub .ico { width: 1.1em; height: 1.1em; }
.tbl .warn { position: absolute; top: -7px; inset-inline-end: -7px; background: #b42318; color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--map-bg); }
.tbl.sel { outline: 2px solid var(--text); outline-offset: 3px; }
.tbl.free { color: var(--muted); }
.tbl.reserved { background: #efeafd; border-color: #6d4fd1; color: #3b2a7a; }
.tbl.occupied { background: #e9f0fd; border-color: #2f5fc4; color: #1d3a78; }
.tbl.waiting { background: #fdf5df; border-color: #a16207; color: #5c3a05; }
.tbl.new { background: #fde8d7; border-color: #c2410c; color: #6b2306; animation: ring 1.4s infinite; }
.tbl.call { background: #fdecea; border-color: #b42318; color: #6e1610; animation: ring 1.4s infinite; }
.tbl.bill { background: #e4f4ea; border-color: #15803d; color: #0f4a26; }
.tbl.taken { opacity: .35; cursor: not-allowed; }
.tbl.pick { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(194, 65, 12, .35); } 70%, 100% { box-shadow: 0 0 0 8px rgba(194, 65, 12, 0); } }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -1px; border: 1.5px solid; }
.map.edit .tbl, .map.edit .area { cursor: grab; }
.map.edit .area { z-index: 0; } .map.edit .tbl { z-index: 1; }
.map.edit .area.sel { outline: 2px solid var(--text); }

/* Office shells (reception + owner) */
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brandmark { font-family: var(--serif); font-size: 20px; }
.logo { width: 36px; height: 36px; border-radius: 50%; }
.pinpad { max-width: 340px; margin: 10vh auto; text-align: center; padding: 28px; }
.pinpad .dots { font-size: 30px; letter-spacing: 12px; height: 44px; }
.pinpad .keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.pinpad .keys button { font-size: 22px; min-height: 60px; background: var(--bg); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi .v { font: 500 26px/1.2 var(--sans); margin-top: 6px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.bars div { flex: 1; background: var(--accent-ink); opacity: .85; border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars div:hover { opacity: 1; }
.bars div:hover::after { content: attr(data-t); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 11px; padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list th { color: var(--muted); font-weight: 500; font-size: 13px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 26px; cursor: pointer; transition: .15s; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb { width: 52px; height: 52px; border-radius: var(--r-img); object-fit: cover; background: var(--surface-2); flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .tbl.new, .tbl.call { box-shadow: 0 0 0 4px rgba(194, 65, 12, .3); }
}

/* Keep controls reachable on narrow screens and in Arabic. */
body:not(.office) :where(button,.btn,select){min-height:44px}
body:not(.office) .icon-btn{min-width:44px}
.card2 .n,.line .grow,.note{overflow-wrap:anywhere}
[dir="rtl"] .sheet,[dir="rtl"] input,[dir="rtl"] textarea{text-align:start}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
/* Extras and variants of a dish (dish-options.js): one row per choice, tall enough to tap */
.opts{border:0;padding:0;margin:18px 0 0;min-width:0}
.opts legend{font-weight:600;padding:0;margin-bottom:4px;color:var(--text)}
.opts .opts-hint{font-weight:400;font-size:13px;color:var(--muted);margin-inline-start:6px}
.opts .opt{display:flex;align-items:center;gap:12px;min-height:48px;margin:0;font-size:15px;color:var(--text);border-bottom:1px solid var(--line);cursor:pointer}
.opts .opt input{width:20px;height:20px;padding:0;margin:0;flex:none;accent-color:var(--accent)}
.opts .opt-price{color:var(--muted);font-variant-numeric:tabular-nums}

/* Self-service: the order number, big */
.self-number{text-align:center}.self-number .big-number{font-size:64px;font-weight:700;line-height:1;margin:6px 0 10px}

/* Stamp cards */
.stamp-dots{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.stamp-dots span{width:18px;height:18px;border-radius:50%;border:2px solid currentColor;opacity:.45}.stamp-dots span.on{background:currentColor;opacity:1}
