/* Tabliqo design system: tokens, base elements and shared components. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("../fonts/figtree-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); }

/* Hide scrollbars platform-wide; content still scrolls via wheel, touch and keyboard. */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

:root {
  /* Tabliqo "Service" palette */
  --awning: #0f3b30;      /* deep bottle green: navigation, guest header, kiosk */
  --awning-2: #17493c;
  --awning-3: #23584a;
  --awning-text: #c9ddd5;
  --ink: #18211d;
  --graphite: #2c3732;
  --slate: #5a6660;
  --line: #d5dcd8;
  --fog: #f2f4f3;         /* porcelain: app background */
  --chalk: #ffffff;
  --surface-2: #f8faf9;     /* table headers, panel strips */
  --palm-ink: #0a5b3e;
  --chili-ink: #8f241b;
  --sky-ink: #173f85;
  --paper: #fffdf7;       /* order tickets and receipts only */
  --mango: #f5a524;       /* saffron accent */
  --mango-ink: #7a4b00;
  --mango-soft: #fff1d2;
  --palm: #0f8a5f;
  --palm-soft: #dff3ea;
  --chili: #d63b2f;
  --chili-soft: #fde5e2;
  --sky: #2563c9;
  --sky-soft: #e0ebfb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 59, 48, .06), 0 8px 24px rgba(15, 59, 48, .08);
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fog); color: var(--ink); font: 400 16px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; line-height: 1.12; letter-spacing: -.015em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.muted { color: var(--slate); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--btn-bg, var(--awning)); border-radius: var(--radius-sm); background: var(--btn-bg, var(--awning)); color: var(--btn-fg, var(--on-awning, #fff)); font-weight: 650; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--btn-hover, var(--awning-2)); border-color: var(--btn-hover, var(--awning-2)); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.accent { background: var(--mango); border-color: var(--mango); color: var(--on-mango, var(--ink)); }
.btn.accent:hover { background: #ffb73d; border-color: #ffb73d; }
.btn.green { background: var(--btn-bg, var(--awning)); border-color: var(--btn-bg, var(--awning)); color: var(--btn-fg, var(--on-awning, #fff)); }
.btn.green:hover { background: var(--awning-2); }
.btn.ok { background: var(--palm); border-color: var(--palm); }
.btn.ok:hover { background: #0c7551; }
.btn.danger { background: var(--chili); border-color: var(--chili); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--fog); border-color: #c4c9d0; }
.btn.ghost.danger-text { color: var(--chili); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; }
.btn.sm.icon { width: 36px; }
.link { background: none; border: 0; padding: 0; color: var(--sky); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 650; font-size: 14px; }
.field .hint { color: var(--slate); font-size: 13px; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 9px 12px; background: var(--chalk); color: var(--ink); border: 1.5px solid var(--line); border-radius: var(--radius-sm); }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(245, 165, 36, .45); }
.input[aria-invalid="true"] { border-color: var(--chili); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--awning); flex: none; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* Surfaces */
.card { background: var(--chalk); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.banner { padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 550; border: 1px solid transparent; }
.banner.warn { background: var(--mango-soft); border-color: #f0d28a; color: #5d3a00; }
.banner.ok { background: var(--palm-soft); border-color: #9fd6bf; color: var(--palm-ink); }
.banner.err { background: var(--chili-soft); border-color: #f0aaa3; color: var(--chili-ink); }
.banner.info { background: var(--sky-soft); border-color: #aac6f0; color: var(--sky-ink); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--fog); color: var(--graphite); white-space: nowrap; }
.pill.pending { background: var(--mango-soft); color: var(--mango-ink); }
.pill.accepted, .pill.preparing { background: var(--sky-soft); color: var(--sky-ink); }
.pill.ready { background: var(--palm-soft); color: var(--palm-ink); }
.pill.served { background: #e6e3f7; color: #3b2f8a; }
.pill.completed { background: var(--fog); color: var(--slate); }
.pill.rejected, .pill.cancelled { background: var(--chili-soft); color: var(--chili-ink); }
.pill.paid { background: var(--palm-soft); color: var(--palm-ink); }
.pill.open { background: var(--palm-soft); color: var(--palm-ink); }

/* Signal arcs: the logo's motif, used as a live indicator */
.signal { width: 18px; height: 14px; flex: none; color: var(--slate); }
.signal path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.signal.live { color: var(--palm); }
.signal.off { color: var(--chili); }
@media (prefers-reduced-motion: no-preference) {
  .signal.live path:nth-child(1) { animation: arc 2.4s infinite .4s; }
  .signal.live path:nth-child(2) { animation: arc 2.4s infinite .2s; }
  .signal.live path:nth-child(3) { animation: arc 2.4s infinite; }
  @keyframes arc { 0%, 55%, 100% { opacity: 1; } 25% { opacity: .25; } }
}

/* Dialogs: native <dialog>, centred on desktop and a bottom sheet on phones */
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--chalk); color: var(--ink); box-shadow: 0 24px 80px rgba(0, 0, 0, .35); overflow: hidden; }
dialog.modal::backdrop { background: rgba(9, 32, 26, .62); }
dialog.modal[open] { display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.modal-head h2 { font-size: 22px; flex: 1; }
.modal-body { padding: 4px 18px 18px; overflow-y: auto; flex: 1 1 auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--fog); }
@media (max-width: 640px) {
  dialog.modal.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .modal-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.modal[open] { animation: pop .16s ease-out; }
  @keyframes pop { from { opacity: 0; transform: translateY(10px); } }
}

/* Toasts */
.toasts { position: fixed; z-index: 100; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 480px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--awning); color: #fff; font-weight: 550; box-shadow: var(--shadow); }
.toast.err { background: var(--chili); }
.toast.ok { background: var(--palm); }
.toasts { z-index: 120; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--awning); display: inline-block; }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } }
.empty { padding: 40px 16px; text-align: center; color: var(--slate); }
.empty h3 { color: var(--ink); font-size: 20px; margin-bottom: 6px; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--fog); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 650; color: var(--slate); }
.seg button[aria-pressed="true"] { background: var(--chalk); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 59, 48, .12); }

/* Ticket: the paper slip that orders are printed on. Perforated top edge. */
.ticket { position: relative; background: var(--paper); border: 1px solid #e6e1d3; border-top: 0; border-radius: 0 0 10px 10px; padding: 16px 14px 14px; }
.ticket::before { content: ""; position: absolute; left: -1px; right: -1px; top: -7px; height: 8px;
  background: radial-gradient(circle at 6px 0, transparent 5px, var(--paper) 5.5px) -1px 0 / 12px 8px repeat-x; }
.ticket .rule { border: 0; border-top: 1.5px dashed #d8d1bf; margin: 10px 0; }

/* Print: thermal receipt (80 mm) */
#print-area { display: none; }
.receipt { font: 12.5px/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: #000; width: 72mm; margin: 0 auto; }
.receipt h1 { font: 800 17px/1.2 var(--display); text-align: center; letter-spacing: 0; }
.receipt .c { text-align: center; }
.receipt .meta { margin: 6px 0; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { vertical-align: top; padding: 1px 0; }
.receipt td.q { width: 2.6em; }
.receipt td.r { text-align: right; white-space: nowrap; padding-left: 6px; }
.receipt .sub { padding-left: 2.6em; font-size: 11.5px; }
.receipt .tot td { font-weight: 800; font-size: 14px; padding-top: 4px; }
.receipt .stamp { text-align: center; font-weight: 800; letter-spacing: .2em; border: 1.5px solid #000; padding: 3px; margin: 8px 0 4px; }
@media print {
  @page { margin: 4mm; }
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing { background: var(--chalk); }
  body.printing #print-area { display: block; }
  body.printing.print-receipt #print-area { display: block; }
}
.receipt tr.sub td { font-size: 11.5px; padding-top: 0; }
