/* Dawri — shared design system.
   Idea: the order ticket. Big numerals, perforations that mean "tear here", status colors that carry meaning. */
:root {
  --ink: #16201B;
  --ink-2: #38423B;
  --electric: #16201B;
  --electric-d: #2B3A31;
  --lime: #C9EE58;
  --lime-d: #8DB51F;
  --paper: #F3F2ED;
  --paper-2: #E8E6DD;
  --card: #FFFFFF;
  --line: #DEDCD1;
  --muted: #646B61;
  --amber: #FFB020;
  --amber-d: #8A5A00;
  --amber-bg: #FFF3D6;
  --green: #0FA968;
  --green-d: #07744A;
  --green-bg: #DDF6EA;
  --coral: #FF5A4E;
  --coral-d: #B6291F;
  --coral-bg: #FFE4E1;
  --font-display: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --r: 14px;
  --maxw: 1120px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; margin: 0; letter-spacing: 0; }
p { margin: 0; }
a { color: var(--green-d); }
img, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--lime-d); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.muted { color: var(--muted); }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 22px; border-radius: 999px; border: 2px solid transparent;
  background: var(--electric); color: #fff; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--electric-d); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ink { background: var(--ink); } .btn.ink:hover { background: var(--ink-2); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); } .btn.ghost:hover { background: #fff; border-color: var(--ink); }
.btn.green { background: var(--green); } .btn.green:hover { background: var(--green-d); }
.btn.danger { background: transparent; color: var(--coral-d); border-color: var(--coral); } .btn.danger:hover { background: var(--coral-bg); }
.btn.sm { min-height: 36px; padding: 4px 14px; font-size: 14px; }
.btn.lg { min-height: 54px; padding: 10px 30px; font-size: 18px; }
.btn.block { width: 100%; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 14px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=tel], textarea, select {
  width: 100%; min-height: 48px; padding: 9px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--electric); box-shadow: 0 0 0 3px rgba(141,181,31,.30); }
input[dir=ltr], .ltr { direction: ltr; text-align: left; unicode-bidi: plaintext; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 4px; accent-color: var(--green-d); flex: none; }
.form-error { color: var(--coral-d); background: var(--coral-bg); border-radius: 10px; padding: 10px 14px; font-size: 15px; margin-bottom: 14px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(243,242,237,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 900; font-size: 24px; color: var(--ink); text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.nav .links { display: flex; gap: 22px; margin-inline-start: 12px; }
.nav .links a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 16px; }
.nav .links a:hover { color: var(--green-d); }
.nav .grow { flex: 1; }
.lang-btn { background: none; border: 2px solid var(--line); border-radius: 999px; min-height: 38px; padding: 2px 14px; cursor: pointer; font-weight: 600; font-size: 14px; }
.lang-btn:hover { border-color: var(--ink); }

/* ---------- ticket (the signature shape) ---------- */
.ticket { position: relative; background: var(--card); border-radius: 20px; border: 1px solid var(--line); }
.perf { position: relative; border-top: 2px dashed var(--line); margin: 0 18px; }
.perf::before, .perf::after { content: ''; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); }
.perf::before { inset-inline-start: -31px; } .perf::after { inset-inline-end: -31px; }
.ticket .perf::before, .ticket .perf::after { clip-path: none; }
.on-ink .perf::before, .on-ink .perf::after { background: var(--ink); border-color: transparent; }

/* ---------- status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--paper-2); color: var(--ink-2); }
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.prep { background: var(--amber-bg); color: var(--amber-d); }
.chip.ready { background: var(--green-bg); color: var(--green-d); }
.chip.off { background: var(--coral-bg); color: var(--coral-d); }
.chip.plain::before { display: none; }

/* ---------- misc ---------- */
.toast-host { position: fixed; inset-inline: 0; bottom: 18px; display: grid; justify-items: center; gap: 8px; z-index: 100; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 18px; font-size: 15px; max-width: 460px; animation: toast-in .2s ease-out; }
.toast.bad { background: var(--coral-d); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--lime-d); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (max-width: 720px) { body { font-size: 16px; } .nav .links { display: none; } }
@media print { .no-print { display: none !important; } }

/* Saudi riyal sign (official symbol, drawn as a mask so it takes the text colour) */
.sar { display: inline-block; width: .82em; height: .91em; background: currentColor; vertical-align: -.08em; -webkit-mask: url(/static/riyal.png) center / contain no-repeat; mask: url(/static/riyal.png) center / contain no-repeat; }

/* panels (cashier, owner dashboard, platform admin): green = go / confirm / save, red = stop / cancel / delete, outline = neutral */
body.fn-colors { --fn-green: #0B8A57; --fn-green-d: #076B43; --fn-red: #D92D20; --fn-red-d: #B42318; }
body.fn-colors .btn:not(.ghost):not(.danger) { background: var(--fn-green); color: #fff; border-color: transparent; }
body.fn-colors .btn:not(.ghost):not(.danger):hover { background: var(--fn-green-d); }
body.fn-colors .btn.danger { background: var(--fn-red); color: #fff; border-color: transparent; }
body.fn-colors .btn.danger:hover { background: var(--fn-red-d); }

/* lighter raised buttons: flat colour, a thin 2px lip, soft shadow. Small red = outline (cancel), big red = solid (destructive). */
body.fn-colors .btn { --lip: 2px; transition: transform .1s ease, box-shadow .1s ease, background .15s; }
body.fn-colors .btn:not(.ghost):not(.danger) { background: var(--fn-green); border-color: transparent; box-shadow: 0 var(--lip) 0 #065a38, 0 4px 8px rgba(5,86,52,.14); }
body.fn-colors .btn.danger { background: var(--fn-red); color: #fff; border-color: transparent; box-shadow: 0 var(--lip) 0 #8E1A12, 0 4px 8px rgba(142,26,18,.14); }
body.fn-colors .btn.danger.sm { background: #fff; color: var(--fn-red); border: 1.5px solid #F0A39C; box-shadow: 0 1px 0 #F0A39C; }
body.fn-colors .btn.danger.sm:hover { background: #FEF3F2; border-color: var(--fn-red); }
body.fn-colors .btn.ghost { background: #fff; color: var(--ink); border-color: #D3D1C5; box-shadow: 0 1px 0 #D3D1C5; }
body.fn-colors .btn.ghost:hover { background: #FAFAF6; border-color: var(--ink); }
body.fn-colors .btn:active { transform: translateY(1px); box-shadow: none; }
body.fn-colors .btn[disabled] { box-shadow: none; transform: none; opacity: .55; }
body.fn-colors .btn.block, body.fn-colors .btnrow .btn { margin-bottom: var(--lip); }
@media (prefers-reduced-motion: reduce) { body.fn-colors .btn { transition: none; } }
body.fn-colors .code .btn { --lip: 2px; margin: 0; }

/* ---- the bell (notices) ---- */
.bell { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; padding: 0; }
.bell:hover { border-color: var(--ink); }
.bell svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell[hidden] { display: none; }
.bell-dot { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #D92D20; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; box-sizing: content-box; }
.bell-dot[hidden] { display: none; }
.k-head .bell { width: 34px; height: 34px; background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.k-head .bell-dot { border-color: var(--ink); }
.nt-pop { position: fixed; z-index: 80; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 44px rgba(22,32,27,.22); display: flex; flex-direction: column; overflow: hidden; }
.nt-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.nt-head b { font-size: 16px; }
.nt-link { background: none; border: 0; color: var(--green-d); font-weight: 700; font-size: 13px; cursor: pointer; padding: 2px 0; }
.nt-list { overflow-y: auto; flex: 1; min-height: 80px; }
.nt-item { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; justify-items: start; }
.nt-item.new { background: #F6FBE6; box-shadow: inset 3px 0 0 var(--lime-d); }
[dir="rtl"] .nt-item.new { box-shadow: inset -3px 0 0 var(--lime-d); }
.nt-meta { display: flex; gap: 10px; align-items: center; width: 100%; }
.nt-tag { font-size: 12px; font-weight: 800; background: var(--paper-2); border-radius: 999px; padding: 2px 10px; }
.nt-item.own .nt-tag { background: var(--ink); color: var(--lime); }
.nt-time { font-size: 12px; color: var(--muted); margin-inline-start: auto; }
.nt-title { font-size: 15px; }
.nt-body { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.nt-quote { font-size: 12.5px; color: var(--muted); border-inline-start: 3px solid var(--line); padding-inline-start: 8px; }
.nt-empty { text-align: center; color: var(--muted); padding: 28px 16px; margin: 0; }
.nt-bottom { padding: 12px 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.nt-compose { display: grid; gap: 8px; }
.nt-compose textarea { width: 100%; resize: vertical; }
.nt-foot { display: flex; align-items: center; gap: 10px; }

.meters{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:12px 0}
