Sample app, fictional data. Everything on this page is the current first version: the brief, four screenshot sheets and the full code (4 parts). Plain text, nothing needs a login.




You are the master UI designer for RestaurantOS, a restaurant app used in Oman. A potential client will use two new full-screen pages on shared tablets and phones:
1) WAITER PAGE. A waiter types a 4-digit PIN, sees the menu as photo tiles, taps a photo, sets the quantity and kitchen notes, sends the order to the kitchen, is alerted when it is ready, taps "Picked up", and can take payment (cash with change, card, other). Orders made with no connection are saved on the device and sent later.
2) KITCHEN PAGE. Big order cards in three columns (New, Preparing, Ready for pickup): start cooking, mark ready, handed over. Cards turn amber after 8 minutes and red after 15.
Both must look excellent and be fast to use with one hand and wet or gloved fingers on PHONE (390px), TABLET (820px and 1180px) and DESKTOP (1440px). Attached: screenshots of the current version (sheet-phone / sheet-tablet / sheet-desktop / sheet-pay) and the code in numbered batches (02 to 05). Please redesign the visuals and layout only.
HARD RULES (do not break these):
- Keep ALL behaviour, props, state, API calls, hooks and text keys exactly as they are. Only change JSX structure, class names and CSS. If you add a new visible text, wrap it in t("...") with plain English.
- Keep every existing t("...") string unchanged unless you must fix it; list any string you change or add at the end.
- Same dependencies only (React, lucide-react). No new libraries, fonts or images. No inline styles except where the code already uses them.
- All sizes in rem, minimum text size 0.75rem (12px). Touch targets at least 2.75rem (44px). Colour contrast WCAG AA in all three themes (Light, Dim, Dark): use the existing CSS variables (--bg, --card, --ink, --mut, --line, --line-strong, --brand, --brand-strong, --brand-soft, --lime, --good, --goodbg, --bad, --badbg, --warn, --warnbg, --info, --infobg). For fixed dark overlays use rgb() not hex.
- Right-to-left must work (Arabic, Persian, Urdu): use logical properties (inline-start/end, margin-inline, inset-inline) and keep icons mirrored only where they point.
- Respect prefers-reduced-motion. Keep print rule that hides these pages.
- Honest wording: do not promise anything the app does not do (no "real-time guaranteed", no marketing claims). The ready alert is a banner, sound and vibration.
- The CSS must stay inside one block that I place ABOVE the generated THEMES block. Do not output the THEMES block.
- Keep the two layouts: phone = one pane at a time with bottom tabs (Menu, Order, My orders); from 900px = menu left, order panel right. Kitchen: phone/tablet portrait = one column at a time with tabs; from 900px = three columns.
DESIGN GOALS: a calm, premium, café-quality look that matches the existing dark-green brand; big readable photo tiles with name and price; an obvious selected state; a very clear "Ready for pickup" moment; kitchen cards readable from two metres away (large quantities, bold notes in a distinct colour, a visible age/timer); a PIN pad that feels like a payment keypad; sheets that feel native on phones and centred on desktop. Empty states, loading and error states should look designed, not plain.
OUTPUT FORMAT: reply in numbered batches, each under 20,000 characters, one batch per message, each complete and copyable on its own. Order: (1) Waiter.tsx part 1, (2) Waiter.tsx part 2, (3) Kitchen.tsx, (4) the CSS block, (5) the list of any text changes. Plain code blocks. No explanations between batches. Start with batch 1 only when I paste "go".
I will paste the code batches (02 to 05) now, one per message. Do not answer until I say "go".
// FILE: apps/web/src/Waiter.tsx (part 1 of 2: imports, PinPad, Photo, PaySheet, ItemSheet)
import { useEffect, useMemo, useRef, useState } from "react";
import { Banknote, Bell, CheckCircle2, ChefHat, CloudOff, CreditCard, Delete, ImageIcon, Lock, Minus, Plus, ReceiptText, Send, Trash2, UtensilsCrossed, X } from "lucide-react";
import { api, ago, money, minorDigits, ApiError, type Me } from "./api";
import { computeChange, parseMinor } from "./change";
import { discard, enqueue, flushQueue, readQueue, type Queued } from "./waiterQueue";
import { useData, useLive } from "./live";
import { t } from "./i18n";
import { enableSound, playFor } from "./sounds";
import { groupsByProduct, needsChoice, optionsValid, unitPrice, type TillGroup } from "./till";
import { Alert } from "./ui";
/** Waiter page: a 4-digit PIN says who is taking orders; tap a photo, set quantity and notes, send to the kitchen, get told when it is ready. */
interface Session { token: string; user: { id: string; name: string; role: string } }
const KEY = "ros.waiter";
const loadSession = (): Session | null => { try { const s = JSON.parse(sessionStorage.getItem(KEY) ?? "null"); return s?.token ? s : null; } catch { return null; } };
const newKey = () => (globalThis.crypto?.randomUUID?.() ?? `k-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`);
const isManager = (r: string) => ["manager", "admin", "owner"].includes(r);
export function PinPad({ title, hint, locationId, onDone, onCancel }: { title: string; hint?: string; locationId: string; onDone: (s: Session) => void; onCancel?: () => void }) {
const [pin, setPin] = useState(""); const [err, setErr] = useState(""); const [busy, setBusy] = useState(false);
const press = (d: string) => { enableSound(); if (busy) return; setErr(""); setPin(p => (p + d).slice(0, 4)); };
useEffect(() => {
if (pin.length !== 4) return;
setBusy(true);
api<Session>("POST", "/v1/pin/verify", { pin, locationId }).then(onDone, (e: Error) => { setErr(e.message); setPin(""); }).finally(() => setBusy(false));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pin]);
useEffect(() => {
const k = (e: KeyboardEvent) => { if (/^\d$/.test(e.key)) press(e.key); else if (e.key === "Backspace") setPin(p => p.slice(0, -1)); else if (e.key === "Escape" && onCancel) onCancel(); };
window.addEventListener("keydown", k); return () => window.removeEventListener("keydown", k);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [busy]);
return <div className="wt-pin">
<div className="wt-pin-card">
<span className="wt-mark" aria-hidden="true"><UtensilsCrossed size={26} /></span>
<h1>{title}</h1>{hint && <p>{hint}</p>}
<div className="wt-dots" role="status" aria-label={t("PIN: {n} of 4 digits", { n: pin.length })}>{[0, 1, 2, 3].map(i => <i key={i} className={i < pin.length ? "on" : ""} />)}</div>
<p className="wt-pin-err" role="alert">{err}</p>
<div className="wt-keys">
{["1", "2", "3", "4", "5", "6", "7", "8", "9"].map(d => <button key={d} type="button" onClick={() => press(d)}>{d}</button>)}
<button type="button" className="ghost" onClick={onCancel} disabled={!onCancel} aria-label={t("Cancel")}>{onCancel ? <X size={22} /> : null}</button>
<button type="button" onClick={() => press("0")}>0</button>
<button type="button" className="ghost" onClick={() => setPin(p => p.slice(0, -1))} aria-label={t("Delete")}><Delete size={22} /></button>
</div>
</div>
</div>;
}
function Photo({ id, version }: { id: string; version?: string | null }) {
const [bad, setBad] = useState(false);
return <span className="wt-photo">{version && !bad ? <img src={`/api/v1/products/${id}/image?size=thumb&v=${version}`} alt="" loading="lazy" onError={() => setBad(true)} /> : <ImageIcon size={30} aria-hidden="true" />}</span>;
}
/** Taking payment for one order: cash (with the change worked out), card, or other. The server checks the cash and works out the change again. */
function PaySheet({ order, currency, hdr, onClose, onPaid }: { order: any; currency: string; hdr: Record<string, string> | undefined; onClose: () => void; onPaid: () => void }) {
const digits = minorDigits(currency); const total = order.total_minor as number;
const [method, setMethod] = useState<"cash" | "card" | "other">("cash"); const [got, setGot] = useState(""); const [busy, setBusy] = useState(false); const [err, setErr] = useState("");
const rec = parseMinor(got, digits); const res = rec !== null ? computeChange(total, rec) : null;
const step = 10 ** digits; const quick = [...new Set([1, 5, 10, 20, 50].map(m => Math.ceil(total / (m * step)) * m * step))].filter(v => v >= total).slice(0, 4);
const fmt = (m: number) => (m / step).toFixed(digits);
const ok = method !== "cash" || got === "" || (res !== null && res.kind === "change");
const pay = async () => { setBusy(true); setErr(""); try { const r = await api<any>("POST", `/v1/orders/waiter/${order.id}/pay`, method === "cash" && rec !== null ? { method, cashReceivedMinor: rec } : { method }, hdr); setDone(r.changeMinor); } catch (e) { setErr((e as Error).message); } finally { setBusy(false); } };
const [done, setDone] = useState<number | null | undefined>(undefined);
if (done !== undefined) return <div className="wt-scrim"><div className="wt-sheet" role="dialog" aria-modal="true"><div className="wt-sheet-body wt-paid"><CheckCircle2 size={48} aria-hidden="true" /><h2>{t("Payment recorded")}</h2>{done !== null && done > 0 && <p className="wt-change"><small>{t("Change to give back")}</small><b>{money(done, currency)}</b></p>}</div><footer><button type="button" className="wt-primary" onClick={onPaid}>{t("Done")}</button></footer></div></div>;
return <div className="wt-scrim" onMouseDown={e => { if (e.target === e.currentTarget) onClose(); }}>
<div className="wt-sheet" role="dialog" aria-modal="true" aria-label={t("Take payment")}>
<header><div><h2>#{order.short_code} · {t("Take payment")}</h2><b>{money(total, currency)}</b></div><button type="button" className="wt-x" onClick={onClose} aria-label={t("Close")}><X size={20} /></button></header>
<div className="wt-sheet-body">
<div className="wt-method" role="radiogroup" aria-label={t("Payment method")}>
{([["cash", t("Cash"), Banknote], ["card", t("Card"), CreditCard], ["other", t("Other"), ReceiptText]] as const).map(([m, label, Icon]) => <button key={m} type="button" role="radio" aria-checked={method === m} className={method === m ? "on" : ""} onClick={() => setMethod(m)}><Icon size={22} />{label}</button>)}
</div>
{method === "cash" && <>
<label className="wt-note">{t("Cash received ({currency})", { currency })}<input inputMode="decimal" className="wt-input" value={got} onChange={e => setGot(e.target.value)} placeholder={fmt(total)} autoFocus /></label>
<div className="wt-quick"><button type="button" onClick={() => setGot(fmt(total))}>{t("Exact")}</button>{quick.filter(v => v !== total).map(v => <button key={v} type="button" onClick={() => setGot(fmt(v))}>{money(v, currency)}</button>)}</div>
{res && <p className={`wt-change ${res.kind}`}>{res.kind === "change" ? <><small>{t("Change to give back")}</small><b>{money(res.amount, currency)}</b></> : <><small>{t("Customer still owes")}</small><b>{money(res.amount, currency)}</b></>}</p>}
</>}
{err && <Alert>{err}</Alert>}
</div>
<footer><button type="button" className="wt-primary" disabled={busy || !ok} onClick={() => void pay()}>{busy ? t("Recording…") : t("Record payment")} · {money(total, currency)}</button></footer>
</div>
</div>;
}
interface Line { key: string; productId: string; qty: number; modifierIds: string[]; note: string }
function ItemSheet({ product, groups, currency, initial, onSave, onClose }: { product: any; groups: TillGroup[]; currency: string; initial?: Line; onSave: (l: { qty: number; modifierIds: string[]; note: string }) => void; onClose: () => void }) {
const [qty, setQty] = useState(initial?.qty ?? 1); const [chosen, setChosen] = useState<string[]>(initial?.modifierIds ?? []); const [note, setNote] = useState(initial?.note ?? "");
const pick = (g: TillGroup, id: string) => setChosen(c => {
const inGroup = g.options.filter(o => c.includes(o.id)).map(o => o.id);
if (c.includes(id)) return c.filter(x => x !== id);
if (g.max === 1) return [...c.filter(x => !inGroup.includes(x)), id];
return inGroup.length >= g.max ? c : [...c, id];
});
const unit = unitPrice(product.price_minor, { key: "", productId: product.id, qty: 1, modifierIds: chosen, note: "" }, groups);
const ok = optionsValid(groups, chosen);
return <div className="wt-scrim" onMouseDown={e => { if (e.target === e.currentTarget) onClose(); }}>
<div className="wt-sheet" role="dialog" aria-modal="true" aria-label={product.name}>
<header><Photo id={product.id} version={product.image_version} /><div><h2>{product.name}</h2><b>{money(unit, currency)}</b></div><button type="button" className="wt-x" onClick={onClose} aria-label={t("Close")}><X size={20} /></button></header>
<div className="wt-sheet-body">
<div className="wt-qty" role="group" aria-label={t("Quantity")}>
<button type="button" onClick={() => setQty(q => Math.max(1, q - 1))} aria-label={t("Remove one")}><Minus size={24} /></button>
<output aria-live="polite">{qty}</output>
<button type="button" onClick={() => setQty(q => Math.min(99, q + 1))} aria-label={t("Add one")}><Plus size={24} /></button>
</div>
{groups.map(g => <section key={g.id} className="tl-group">
<div className="tl-group-head"><b>{g.name}</b><span>{g.min > 0 ? t("Required") : t("Optional")}{g.max > 1 ? ` · ${t("up to {n}", { n: g.max })}` : ""}</span></div>
<div className="tl-chips" role={g.max === 1 ? "radiogroup" : "group"} aria-label={g.name}>
{g.options.map(o => <button type="button" key={o.id} role={g.max === 1 ? "radio" : "checkbox"} aria-checked={chosen.includes(o.id)} disabled={!o.available} className={chosen.includes(o.id) ? "is-on" : ""} onClick={() => pick(g, o.id)}>
<span>{o.name}</span><small>{o.available ? (o.priceMinor ? `+${money(o.priceMinor, currency)}` : t("Free")) : t("Sold out")}</small></button>)}
</div>
</section>)}
<label className="wt-note">{t("Note for the kitchen (optional)")}<textarea rows={2} value={note} onChange={e => setNote(e.target.value)} maxLength={200} placeholder={t("e.g. extra hot, no ice")} /></label>
</div>
<footer><button type="button" className="wt-primary" disabled={!ok} onClick={() => onSave({ qty, modifierIds: chosen, note: note.trim() })}>{initial ? t("Save") : t("Add to order")} · {money(unit * qty, currency)}</button></footer>
</div>
</div>;
}
// FILE: apps/web/src/Waiter.tsx (part 2 of 2: the main Waiter component; part 1 comes first in the same file)
export default function Waiter({ me, locationId, onExit }: { me: Me; locationId: string; onExit: () => void }) {
const currency = me.organization.default_currency;
const [session, setSessionState] = useState<Session | null>(loadSession);
const setSession = (s: Session | null) => { setSessionState(s); try { s ? sessionStorage.setItem(KEY, JSON.stringify(s)) : sessionStorage.removeItem(KEY); } catch { /* private mode */ } };
const [leaving, setLeaving] = useState(false);
const { connected, soundOn, setSoundOn } = useLive();
// A waiter tablet must not ring for other people's orders: mute the new-order chime while this page is open (the "ready" alert still plays), then put the setting back.
useEffect(() => { const was = soundOn; setSoundOn(false); return () => setSoundOn(was); /* eslint-disable-next-line react-hooks/exhaustive-deps */ }, []);
const menuRes = useData(() => api<any>("GET", `/v1/menu?locationId=${locationId}`), [locationId]);
const groupsRes = useData(() => api<any[]>("GET", `/v1/modifier-groups?locationId=${locationId}`), [locationId]);
const hdr = session ? { "x-waiter-token": session.token } : undefined;
const mineRes = useData(async () => session ? api<any[]>("GET", `/v1/orders/waiter/mine?locationId=${locationId}`, undefined, hdr) : [], [session?.token, locationId]);
const [pane, setPane] = useState<"menu" | "order" | "mine">("menu");
const [side, setSide] = useState<"order" | "mine">("order");
const [cat, setCat] = useState("all"); const [lines, setLines] = useState<Line[]>([]); const [orderNote, setOrderNote] = useState("");
const [sheet, setSheet] = useState<{ product: any; line?: Line } | null>(null);
const [paying, setPaying] = useState<any>(null);
const [busy, setBusy] = useState(false); const [msg, setMsg] = useState<{ kind: "ok" | "error"; text: string } | null>(null);
const keyRef = useRef(newKey());
const [queue, setQueue] = useState<Queued[]>(readQueue);
useEffect(() => { const h = () => setQueue(readQueue()); window.addEventListener("ros:waiter-queue", h); return () => window.removeEventListener("ros:waiter-queue", h); }, []);
// The menu is kept on this device, so a dropped connection doesn't stop the waiter from taking orders.
const cacheKey = `ros.waiter.menu.${locationId}`;
const cached = useMemo(() => { try { return JSON.parse(localStorage.getItem(cacheKey) ?? "null"); } catch { return null; } }, [cacheKey]);
useEffect(() => { if (menuRes.data && groupsRes.data) { try { localStorage.setItem(cacheKey, JSON.stringify({ menu: menuRes.data, groups: groupsRes.data })); } catch { /* storage full */ } } }, [menuRes.data, groupsRes.data, cacheKey]);
const menu = menuRes.data ?? (menuRes.error ? cached?.menu : null);
const rawGroups = groupsRes.data ?? (groupsRes.error ? cached?.groups : null) ?? [];
const flush = async () => { const r = await flushQueue(session ? { userId: session.user.id, token: session.token } : null); if (r.sent) await mineRes.reload(); };
useEffect(() => { if (!queue.length) return; void flush(); const i = setInterval(() => void flush(), 15000); window.addEventListener("online", flush); return () => { clearInterval(i); window.removeEventListener("online", flush); }; /* eslint-disable-next-line react-hooks/exhaustive-deps */ }, [queue.length, session?.token]);
const products: any[] = (menu?.products ?? []).filter((p: any) => p.available !== false && p.active !== false);
const cats: any[] = menu?.categories ?? [];
const byId = useMemo(() => new Map(products.map(p => [p.id, p])), [products]);
const groups = useMemo(() => groupsByProduct(rawGroups), [rawGroups]);
const shown = products.filter(p => cat === "all" || (cat === "none" ? !p.category_id : p.category_id === cat));
const mine: any[] = mineRes.data ?? []; const readyOrders = mine.filter(o => o.status === "ready");
const count = lines.reduce((a, l) => a + l.qty, 0);
const total = lines.reduce((a, l) => { const p = byId.get(l.productId); return p ? a + l.qty * unitPrice(p.price_minor, { ...l }, groups.get(l.productId) ?? []) : a; }, 0);
// Tell the waiter the moment one of their orders turns ready.
const seenReady = useRef<Set<string> | null>(null);
useEffect(() => {
if (!session || mineRes.data === null) return;
const now = new Set(readyOrders.map(o => o.id));
if (seenReady.current) { const fresh = [...now].filter(id => !seenReady.current!.has(id)); if (fresh.length) { playFor(undefined, "order"); navigator.vibrate?.([200, 100, 200]); } }
seenReady.current = now;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [mineRes.data]);
useEffect(() => { if (mineRes.error?.toLowerCase().includes("pin again")) setSession(null); }, [mineRes.error]);
useEffect(() => { if (!session) { seenReady.current = null; } }, [session]);
if (!session) return <PinPad title={t("Enter your PIN")} hint={t("Your 4-digit PIN shows which waiter is taking the order.")} locationId={locationId} onDone={s => { setSession(s); setPane("menu"); }} />;
if (leaving) return <PinPad title={t("Manager PIN")} hint={t("A manager or owner PIN is needed to leave waiter mode.")} locationId={locationId} onCancel={() => setLeaving(false)}
onDone={s => { if (isManager(s.user.role)) onExit(); else setLeaving(false); }} />;
const addLine = (p: any, v: { qty: number; modifierIds: string[]; note: string }, existing?: Line) => {
setLines(ls => existing ? ls.map(l => l.key === existing.key ? { ...l, ...v } : l) : [...ls, { key: newKey(), productId: p.id, ...v }]);
setSheet(null); setMsg(null);
};
const send = async () => {
if (!lines.length || busy) return; setBusy(true); setMsg(null);
const body = { locationId, clientKey: keyRef.current, lines: lines.map(l => ({ productId: l.productId, quantity: l.qty, note: l.note || undefined, modifierIds: l.modifierIds.length ? l.modifierIds : undefined })), note: orderNote.trim() || undefined };
const done = (text: string) => { setLines([]); setOrderNote(""); keyRef.current = newKey(); setMsg({ kind: "ok", text }); setPane("menu"); setSide("mine"); };
try {
const r = await api<any>("POST", "/v1/orders/waiter", body, hdr);
done(t("Sent to the kitchen · order {code}", { code: r.shortCode })); await mineRes.reload();
} catch (e) {
if (e instanceof ApiError && e.status === 0) {
// No connection: keep the order on this device; it is sent by itself when the connection is back.
enqueue({ key: body.clientKey, userId: session!.user.id, token: session!.token, locationId, body, at: Date.now(), summary: lines.map(l => `${l.qty}× ${byId.get(l.productId)?.name ?? ""}`).join(" · ") });
done(t("No connection. The order is saved on this device and will be sent automatically."));
} else { const m = (e as Error).message; if (m.toLowerCase().includes("pin again")) setSession(null); else setMsg({ kind: "error", text: m }); }
} finally { setBusy(false); }
};
const pickedUp = async (id: string) => { try { await api("POST", `/v1/orders/waiter/${id}/picked-up`, {}, hdr); await mineRes.reload(); } catch (e) { setMsg({ kind: "error", text: (e as Error).message }); } };
const orderPanel = <div className="wt-panel">
{!lines.length ? <p className="wt-empty">{t("Nothing added yet. Tap a photo to add it.")}</p> : <ul className="wt-lines">{lines.map(l => { const p = byId.get(l.productId); if (!p) return null; const g = groups.get(l.productId) ?? [];
const opts = g.flatMap(x => x.options).filter(o => l.modifierIds.includes(o.id)).map(o => o.name).join(", ");
return <li key={l.key}><button type="button" className="wt-line" onClick={() => setSheet({ product: p, line: l })}><b>{l.qty}×</b><span><strong>{p.name}</strong>{opts && <small>{opts}</small>}{l.note && <em>{l.note}</em>}</span><i>{money(l.qty * unitPrice(p.price_minor, l, g), currency)}</i></button>
<button type="button" className="wt-del" onClick={() => setLines(ls => ls.filter(x => x.key !== l.key))} aria-label={t("Remove {name}?", { name: p.name })}><Trash2 size={18} /></button></li>; })}</ul>}
<label className="wt-note">{t("Note for the whole order (optional)")}<textarea rows={2} value={orderNote} onChange={e => setOrderNote(e.target.value)} maxLength={300} placeholder={t("e.g. table by the window")} /></label>
<div className="wt-total"><span>{t("Total")}</span><b>{money(total, currency)}</b></div>
<button type="button" className="wt-primary" disabled={!lines.length || busy} onClick={() => void send()}><Send size={20} />{busy ? t("Sending…") : t("Send to kitchen")}</button>
</div>;
const minePanel = <div className="wt-panel">
{queue.length > 0 && <ul className="wt-orders">{queue.map(q => <li key={q.key} className="wt-order st-waiting">
<div className="wt-order-top"><CloudOff size={18} aria-hidden="true" /><span className="wt-chip">{q.error ? t("Not sent") : t("Waiting to send…")}</span><small>{ago(new Date(q.at).toISOString())}</small></div>
<p>{q.summary}</p>{q.error && <p className="wt-err">{q.error}</p>}
<div className="wt-actions"><button type="button" className="wt-ghost dark" onClick={() => { if (q.error === "Enter your PIN again.") { /* shows the PIN pad via lock */ setSession(null); } else void flush(); }}>{q.error === "Enter your PIN again." ? t("Enter PIN to send") : t("Send now")}</button>
{q.error && q.error !== "Enter your PIN again." && <button type="button" className="wt-ghost dark" onClick={() => { if (window.confirm(t("Discard this order?"))) discard(q.key); }}>{t("Discard")}</button>}</div>
</li>)}</ul>}
{!mine.length && !queue.length ? <p className="wt-empty">{t("No open orders. Orders you send appear here.")}</p> : <ul className="wt-orders">{mine.map(o => <li key={o.id} className={`wt-order st-${o.status}`}>
<div className="wt-order-top"><b>#{o.short_code}</b><span className="wt-chip">{o.status === "completed" ? t("Handed over") : o.status === "ready" ? t("Ready for pickup") : o.status === "preparing" ? t("Preparing") : t("In the kitchen")}</span><small>{ago(o.received_at)}</small></div>
<p>{(o.items as any[]).map(i => `${i.quantity}× ${i.name}`).join(" · ")}</p>
<div className="wt-pay-row"><b>{money(o.total_minor, currency)}</b>{o.payment_method ? <span className="wt-chip paid">{t("Paid")}</span> : <button type="button" className="wt-ghost dark" onClick={() => setPaying(o)}><Banknote size={18} />{t("Take payment")}</button>}</div>
{o.status === "ready" && <button type="button" className="wt-primary" onClick={() => void pickedUp(o.id)}><CheckCircle2 size={20} />{t("Picked up")}</button>}
</li>)}</ul>}
</div>;
return <div className="wt">
<header className="wt-top">
<span className="wt-brand"><UtensilsCrossed size={20} aria-hidden="true" /> {session.user.name}</span>
{!connected && <span className="wt-offline" role="status">{t("Reconnecting")}</span>}
{queue.length > 0 && <span className="wt-offline" role="status"><CloudOff size={14} aria-hidden="true" /> {t("{n} saved on this device", { n: queue.length })}</span>}
<button type="button" className="wt-ghost" onClick={() => setSession(null)} aria-label={t("Lock")} title={t("Lock")}><Lock size={18} /><span>{t("Lock")}</span></button>
{isManager(me.user.role) && <button type="button" className="wt-ghost" onClick={() => setLeaving(true)} aria-label={t("Manager view")} title={t("Manager view")}><ChefHat size={18} /><span>{t("Manager view")}</span></button>}
</header>
{readyOrders.length > 0 && <button type="button" className="wt-ready-banner" onClick={() => { setPane("mine"); setSide("mine"); }}><Bell size={20} aria-hidden="true" />{t("{n} order(s) ready for pickup", { n: readyOrders.length })}</button>}
{msg && <div className="wt-msg"><Alert kind={msg.kind} onClose={() => setMsg(null)}>{msg.text}</Alert></div>}
<div className={`wt-body pane-${pane}`}>
<section className="wt-menu" aria-label={t("Menu")}>
<div className="wt-cats" role="tablist">{[{ id: "all", name: t("All") }, ...cats.map(c => ({ id: c.id, name: c.name }))].map(c => <button key={c.id} type="button" role="tab" aria-selected={cat === c.id} className={cat === c.id ? "on" : ""} onClick={() => setCat(c.id)}>{c.name}</button>)}</div>
{menuRes.error && !menu ? <Alert>{menuRes.error}</Alert> : !menu ? <p className="wt-empty">{t("Loading menu…")}</p> :
<div className="wt-grid">{shown.map(p => { const n = lines.filter(l => l.productId === p.id).reduce((s, l) => s + l.qty, 0); return <button key={p.id} type="button" className={`wt-item ${n ? "picked" : ""}`} onClick={() => setSheet({ product: p })} aria-label={p.name}>
<Photo id={p.id} version={p.image_version} /><span className="wt-item-name">{p.name}</span><span className="wt-item-price">{money(p.price_minor, currency)}{needsChoice(groups.get(p.id) ?? []) ? " ·" : ""}</span>{n > 0 && <span className="wt-badge">{n}</span>}</button>; })}</div>}
</section>
<aside className="wt-side">
<div className="wt-tabs" role="tablist"><button type="button" role="tab" aria-selected={side === "order"} className={side === "order" ? "on" : ""} onClick={() => setSide("order")}>{t("Order")}{count > 0 && <em>{count}</em>}</button>
<button type="button" role="tab" aria-selected={side === "mine"} className={side === "mine" ? "on" : ""} onClick={() => setSide("mine")}>{t("My orders")}{readyOrders.length > 0 && <em className="hot">{readyOrders.length}</em>}</button></div>
<div className="wt-side-body wide-only">{side === "order" ? orderPanel : minePanel}</div>
<div className="wt-side-body narrow-only">{pane === "mine" ? minePanel : orderPanel}</div>
</aside>
</div>
<nav className="wt-nav" aria-label={t("Waiter navigation")}>
<button type="button" className={pane === "menu" ? "on" : ""} onClick={() => setPane("menu")}><UtensilsCrossed size={22} />{t("Menu")}</button>
<button type="button" className={pane === "order" ? "on" : ""} onClick={() => setPane("order")}><ReceiptText size={22} />{t("Order")}{count > 0 && <em>{count}</em>}</button>
<button type="button" className={pane === "mine" ? "on" : ""} onClick={() => setPane("mine")}><Bell size={22} />{t("My orders")}{readyOrders.length > 0 && <em className="hot">{readyOrders.length}</em>}</button>
</nav>
{paying && <PaySheet order={paying} currency={currency} hdr={hdr} onClose={() => setPaying(null)} onPaid={() => { setPaying(null); void mineRes.reload(); }} />}
{sheet && <ItemSheet product={sheet.product} groups={groups.get(sheet.product.id) ?? []} currency={currency} initial={sheet.line} onClose={() => setSheet(null)} onSave={v => addLine(sheet.product, v, sheet.line)} />}
</div>;
}
// FILE: apps/web/src/Kitchen.tsx
import { useEffect, useState } from "react";
import { Bell, BellOff, CheckCircle2, ChefHat, Flame, ImageIcon, Play, Truck } from "lucide-react";
import { api, type Me } from "./api";
import { useData, useLive } from "./live";
import { t } from "./i18n";
import { enableSound } from "./sounds";
import { Alert } from "./ui";
/** Kitchen page: big cards, oldest first. Start cooking, mark ready (the waiter is told), then it leaves the board once handed over. */
const mins = (iso: string, now: number) => Math.max(0, Math.floor((now - new Date(iso).getTime()) / 60000));
function Thumb({ id, version }: { id: string; version?: string | null }) {
const [bad, setBad] = useState(false);
return <span className="kt-thumb">{version && !bad ? <img src={`/api/v1/products/${id}/image?size=thumb&v=${version}`} alt="" loading="lazy" onError={() => setBad(true)} /> : <ImageIcon size={18} aria-hidden="true" />}</span>;
}
export default function Kitchen({ me, locationId, onExit }: { me: Me; locationId: string; onExit: () => void }) {
const { connected, soundOn, setSoundOn } = useLive();
const board = useData(() => api<any[]>("GET", `/v1/kitchen?locationId=${locationId}`), [locationId]);
const [now, setNow] = useState(Date.now()); const [busy, setBusy] = useState<string | null>(null); const [err, setErr] = useState(""); const [col, setCol] = useState<"accepted" | "preparing" | "ready">("accepted");
useEffect(() => { const i = setInterval(() => setNow(Date.now()), 20000); return () => clearInterval(i); }, []);
useEffect(() => { try { void (navigator as any).wakeLock?.request?.("screen"); } catch { /* not supported */ } }, []);
const orders = board.data ?? [];
const cols = [{ id: "accepted" as const, title: t("New"), to: "preparing", label: t("Start cooking"), Icon: Play }, { id: "preparing" as const, title: t("Preparing"), to: "ready", label: t("Ready"), Icon: CheckCircle2 }, { id: "ready" as const, title: t("Ready for pickup"), to: "completed", label: t("Handed over"), Icon: Truck }];
const move = async (o: any, to: string) => {
setBusy(o.id); setErr("");
try { await api("POST", `/v1/orders/${o.id}/transition`, { to, expectedVersion: o.version }); await board.reload(); }
catch (e) { setErr((e as Error).message); await board.reload(); }
finally { setBusy(null); }
};
return <div className="kt" onPointerDown={() => enableSound()}>
<header className="kt-top">
<span className="kt-brand"><ChefHat size={22} aria-hidden="true" /> {t("Kitchen")}</span>
<span className={`kt-conn ${connected ? "ok" : ""}`} role="status">{connected ? t("Live") : t("Reconnecting")}</span>
<button type="button" className="wt-ghost" onClick={() => { setSoundOn(!soundOn); enableSound(); }} aria-pressed={soundOn} aria-label={soundOn ? t("Sound on") : t("Sound off")}>{soundOn ? <Bell size={18} /> : <BellOff size={18} />}<span>{soundOn ? t("Sound on") : t("Sound off")}</span></button>
<button type="button" className="wt-ghost" onClick={onExit} aria-label={t("Manager view")} title={t("Manager view")}><ChefHat size={18} /><span>{t("Manager view")}</span></button>
</header>
{(err || board.error) && <div className="wt-msg"><Alert onClose={() => setErr("")}>{err || board.error}</Alert></div>}
<nav className="kt-tabs" aria-label={t("Kitchen columns")}>{cols.map(c => { const n = orders.filter(o => (c.id === "accepted" ? o.status === "new" || o.status === "accepted" : o.status === c.id)).length;
return <button key={c.id} type="button" className={col === c.id ? "on" : ""} onClick={() => setCol(c.id)}>{c.title}<em>{n}</em></button>; })}</nav>
<div className={`kt-board col-${col}`}>
{cols.map(c => { const list = orders.filter(o => c.id === "accepted" ? o.status === "new" || o.status === "accepted" : o.status === c.id);
return <section key={c.id} className={`kt-col col-${c.id}`} aria-label={c.title}>
<h2>{c.title}<em>{list.length}</em></h2>
{!list.length && <p className="wt-empty">{c.id === "accepted" ? t("No new orders") : t("Nothing here")}</p>}
{list.map(o => { const m = mins(o.received_at, now); const late = c.id !== "ready" && m >= 15; const warn = c.id !== "ready" && m >= 8;
return <article key={o.id} className={`kt-card ${late ? "late" : warn ? "warn" : ""}`}>
<div className="kt-card-top"><b>#{o.short_code}</b>{o.taken_by && <span>{o.taken_by}</span>}<span className="kt-age">{late && <Flame size={14} aria-hidden="true" />}{m} {t("min")}</span></div>
{o.notes && <p className="kt-order-note">{o.notes}</p>}
<ul>{(o.items as any[]).map((i, k) => <li key={k}><Thumb id={i.product_id} version={i.image_version} /><div><span><b>{i.quantity}×</b> {i.name}</span>{(i.options as string[]).length > 0 && <small>{(i.options as string[]).join(", ")}</small>}{i.notes && <em>{i.notes}</em>}</div></li>)}</ul>
<button type="button" className="kt-act" disabled={busy === o.id} onClick={() => void move(o, o.status === "new" ? "accepted" : c.to)}><c.Icon size={22} />{c.label}</button>
</article>; })}
</section>; })}
</div>
</div>;
}
/* FILE: apps/web/src/style.css (the 'Waiter and kitchen pages' block; it sits ABOVE the generated THEMES block) */
/* The language button stays reachable over full-screen tools (calculator, scanner): lifted clear of their bottom bars. */
body:has(.chg-screen,.scn-screen,.tl-scrim) .trn-fab{inset-block-end:calc(6rem + env(safe-area-inset-bottom))}
/* ===== Waiter and kitchen pages. One layout for phone, tablet and desktop: panes on phones, two or three columns from 900px. ===== */
.wt,.kt{position:fixed;inset:0;z-index:40;display:flex;flex-direction:column;background:var(--bg);color:var(--ink);font-size:1rem}
.wt-top,.kt-top{display:flex;align-items:center;gap:.5rem;padding:.6rem max(.9rem,env(safe-area-inset-left)) .6rem;background:var(--brand);color:#fff}
.wt-brand,.kt-brand{display:flex;align-items:center;gap:.5rem;margin-inline-end:auto;font-weight:800;font-size:1.05rem;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wt-ghost{display:inline-flex;align-items:center;gap:.4rem;min-height:2.75rem;padding:0 .8rem;border:1px solid rgb(255 255 255/.35);border-radius:.75rem;background:transparent;color:inherit;font:inherit;font-weight:700;cursor:pointer}
.wt-offline,.kt-conn{font-size:.8125rem;font-weight:700;padding:.2rem .6rem;border-radius:999px;background:rgb(255 255 255/.18)}
.kt-conn.ok{background:rgb(217 237 154/.25)}
.wt-msg{padding:.5rem .9rem 0}
.wt-ready-banner{display:flex;align-items:center;justify-content:center;gap:.6rem;min-height:3rem;margin:0;border:0;background:var(--lime);color:var(--brand);font:inherit;font-weight:800;font-size:1.05rem;cursor:pointer;animation:wtpulse 1.6s ease-in-out infinite}
@keyframes wtpulse{50%{filter:brightness(.93)}}
@media (prefers-reduced-motion:reduce){.wt-ready-banner{animation:none}}
.wt-body{flex:1;min-height:0;display:grid;grid-template-columns:1fr;position:relative}
.wt-menu{min-height:0;overflow:auto;padding:.75rem .9rem 5.5rem}
.wt-cats{display:flex;gap:.5rem;overflow-x:auto;padding-bottom:.6rem;margin-bottom:.4rem;scrollbar-width:thin}
.wt-cats button{flex:none;min-height:2.75rem;padding:0 1rem;border:1px solid var(--line-strong,var(--line));border-radius:999px;background:var(--card);color:inherit;font:inherit;font-weight:700;cursor:pointer}
.wt-cats button.on{background:var(--brand);border-color:var(--brand);color:#fff}
.wt-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}
@media (min-width:600px){.wt-grid{grid-template-columns:repeat(auto-fill,minmax(10rem,1fr))}}
@media (max-width:520px){.wt-ghost span{display:none}.wt-ghost{padding:0 .85rem}}
.wt-item{position:relative;display:flex;flex-direction:column;gap:.35rem;padding:.5rem;border:2px solid transparent;border-radius:1rem;background:var(--card);box-shadow:0 1px 3px rgb(23 43 53/.08);color:inherit;text-align:start;font:inherit;cursor:pointer}
.wt-item:active{transform:scale(.985)}
.wt-item.picked{border-color:var(--brand-strong)}
.wt-photo{display:grid;place-items:center;aspect-ratio:4/3;width:100%;overflow:hidden;border-radius:.75rem;background:var(--brand-soft);color:var(--mut)}
.wt-photo img{width:100%;height:100%;object-fit:cover}
.wt-item-name{font-weight:800;line-height:1.2;overflow-wrap:anywhere}
.wt-item-price{color:var(--mut);font-weight:700;font-size:.9375rem}
.wt-badge{position:absolute;inset-block-start:.35rem;inset-inline-end:.35rem;min-width:1.9rem;height:1.9rem;padding:0 .4rem;display:grid;place-items:center;border-radius:999px;background:var(--brand);color:#fff;font-weight:800}
.wt-side{display:none;min-height:0;flex-direction:column;background:var(--card);border-inline-start:1px solid var(--line)}
.wt-side-body{flex:1;min-height:0;overflow:auto}
.wt-tabs{display:none}
.wt-panel{display:flex;flex-direction:column;gap:.8rem;padding:.9rem .9rem 5.5rem}
.wt-empty{margin:1.5rem .5rem;color:var(--mut);text-align:center}
.wt-lines,.wt-orders{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.wt-lines li{display:flex;gap:.4rem;align-items:stretch}
.wt-line{flex:1;display:flex;gap:.7rem;align-items:flex-start;min-height:3.25rem;padding:.6rem .75rem;border:1px solid var(--line);border-radius:.85rem;background:var(--bg);color:inherit;text-align:start;font:inherit;cursor:pointer}
.wt-line b{font-size:1.15rem}.wt-line span{flex:1;display:grid;gap:.1rem;min-width:0}.wt-line small{color:var(--mut)}.wt-line em{color:var(--warn);font-style:normal;font-weight:700}.wt-line i{font-style:normal;font-weight:800;white-space:nowrap}
.wt-del{flex:none;width:3rem;border:1px solid var(--line);border-radius:.85rem;background:var(--card);color:var(--bad);cursor:pointer;display:grid;place-items:center}
.wt-note{display:grid;gap:.35rem;font-weight:700}
.wt-note textarea{width:100%;padding:.7rem .8rem;border:1px solid var(--line-strong,var(--line));border-radius:.75rem;background:var(--card);color:inherit;font:inherit;resize:vertical}
.wt-total{display:flex;justify-content:space-between;align-items:center;font-size:1.25rem}
.wt-primary{display:flex;align-items:center;justify-content:center;gap:.6rem;width:100%;min-height:3.5rem;padding:0 1.2rem;border:0;border-radius:1rem;background:var(--brand-strong);color:#fff;font:inherit;font-size:1.1rem;font-weight:800;cursor:pointer}
.wt-primary:disabled{opacity:.5;cursor:not-allowed}
.wt-order{display:grid;gap:.5rem;padding:.8rem;border:1px solid var(--line);border-radius:1rem;background:var(--bg)}
.wt-order.st-ready{border:2px solid var(--brand-strong);background:var(--goodbg)}
.wt-order p{margin:0;color:var(--mut)}
.wt-order-top{display:flex;align-items:center;gap:.6rem}.wt-order-top small{margin-inline-start:auto;color:var(--mut)}
.wt-chip{padding:.15rem .6rem;border-radius:999px;background:var(--infobg);color:var(--info);font-weight:800;font-size:.875rem}
.st-ready .wt-chip{background:var(--brand-strong);color:#fff}
.wt-nav{position:absolute;inset-inline:0;bottom:0;z-index:2;display:grid;grid-template-columns:repeat(3,1fr);gap:.4rem;padding:.45rem .6rem max(.45rem,env(safe-area-inset-bottom));background:var(--card);border-top:1px solid var(--line);box-shadow:0 -4px 16px rgb(23 43 53/.08)}
.wt-nav button{position:relative;display:grid;justify-items:center;gap:.15rem;min-height:3.4rem;border:0;border-radius:.9rem;background:transparent;color:var(--mut);font:inherit;font-size:.8125rem;font-weight:800;cursor:pointer}
.wt-nav button.on{background:var(--brand-soft);color:var(--brand)}
.wt-nav em,.wt-tabs em{position:absolute;inset-block-start:.15rem;inset-inline-end:28%;min-width:1.25rem;padding:0 .3rem;border-radius:999px;background:var(--brand);color:#fff;font-style:normal;font-size:.75rem;line-height:1.25rem}
.wt-nav em.hot,.wt-tabs em.hot{background:var(--bad)}
.wt-body.pane-menu .wt-side,.wt-body:not(.pane-menu) .wt-menu{display:none}
.wt-body:not(.pane-menu) .wt-side{display:flex;border:0}
.wt-body .wide-only{display:none}
.wt-scrim{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center;background:rgb(16 32 28/.55)}
.wt-sheet{display:flex;flex-direction:column;width:100%;max-height:92dvh;border-radius:1.4rem 1.4rem 0 0;background:var(--card);overflow:hidden}
.wt-sheet header{display:flex;align-items:center;gap:.9rem;padding:.9rem 1rem;border-bottom:1px solid var(--line)}
.wt-sheet header .wt-photo{width:4.5rem;flex:none}.wt-sheet header div{flex:1;display:grid;gap:.1rem;min-width:0}.wt-sheet h2{margin:0;font-size:1.2rem}
.wt-x{width:2.75rem;height:2.75rem;border:0;border-radius:50%;background:var(--bg);color:inherit;cursor:pointer;display:grid;place-items:center}
.wt-sheet-body{overflow:auto;display:grid;gap:1rem;padding:1rem}
.wt-sheet footer{padding:.8rem 1rem max(.8rem,env(safe-area-inset-bottom));border-top:1px solid var(--line)}
.wt-qty{display:flex;align-items:center;justify-content:center;gap:1.4rem}
.wt-qty button{width:4rem;height:4rem;border:2px solid var(--brand-strong);border-radius:50%;background:var(--card);color:var(--brand-strong);cursor:pointer;display:grid;place-items:center}
.wt-qty output{min-width:3.5rem;text-align:center;font-size:2.4rem;font-weight:800}
.wt-pin{position:fixed;inset:0;z-index:70;display:grid;place-items:center;padding:1rem;background:var(--bg)}
.wt-pin-card{display:grid;justify-items:center;gap:.7rem;width:min(22rem,100%);text-align:center}
.wt-pin-card h1{margin:0;font-size:1.5rem}.wt-pin-card p{margin:0;color:var(--mut)}
.wt-mark{display:grid;place-items:center;width:3.4rem;height:3.4rem;border-radius:1rem;background:var(--brand);color:#fff}
.wt-dots{display:flex;gap:.9rem;margin:.4rem 0}.wt-dots i{width:1.1rem;height:1.1rem;border:2px solid var(--brand-strong);border-radius:50%}.wt-dots i.on{background:var(--brand-strong)}
.wt-pin-err{min-height:1.5rem;color:var(--bad)!important;font-weight:700}
.wt-keys{display:grid;grid-template-columns:repeat(3,1fr);gap:.7rem;width:100%}
.wt-keys button{min-height:4.1rem;border:1px solid var(--line-strong,var(--line));border-radius:1.1rem;background:var(--card);color:inherit;font:inherit;font-size:1.6rem;font-weight:800;cursor:pointer;display:grid;place-items:center}
.wt-keys button.ghost{border-color:transparent;background:transparent;color:var(--mut)}
.wt-keys button:active{background:var(--brand-soft)}
@media (min-width:900px){
.wt-body{grid-template-columns:minmax(0,1fr) 26rem}
.wt-menu{padding-bottom:1.5rem}
.wt-grid{grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));gap:.9rem}
.wt-body.pane-menu .wt-side,.wt-body:not(.pane-menu) .wt-side{display:flex;border-inline-start:1px solid var(--line)}
.wt-body:not(.pane-menu) .wt-menu{display:block}
.wt-nav,.wt-body .narrow-only{display:none}
.wt-body .wide-only{display:block}
.wt-tabs{display:grid;grid-template-columns:1fr 1fr;gap:.4rem;padding:.6rem}
.wt-tabs button{position:relative;min-height:3rem;border:0;border-radius:.8rem;background:var(--bg);color:var(--mut);font:inherit;font-weight:800;cursor:pointer}
.wt-tabs button.on{background:var(--brand-soft);color:var(--brand)}
.wt-tabs em{inset-inline-end:.8rem}
.wt-panel{padding-bottom:1rem}
.wt-scrim{align-items:center}.wt-sheet{width:min(34rem,94vw);max-height:90dvh;border-radius:1.4rem}
}
@media (min-width:1400px){.wt-body{grid-template-columns:minmax(0,1fr) 30rem}.wt-grid{grid-template-columns:repeat(auto-fill,minmax(11rem,1fr))}}
.kt-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:.4rem;padding:.5rem .7rem}
.kt-tabs button{position:relative;min-height:3rem;border:0;border-radius:.8rem;background:var(--card);color:var(--mut);font:inherit;font-weight:800;cursor:pointer}
.kt-tabs button.on{background:var(--brand);color:#fff}
.kt-tabs em,.kt-col h2 em{margin-inline-start:.45rem;padding:0 .5rem;border-radius:999px;background:rgb(23 43 53/.12);font-style:normal;font-size:.85rem}
.kt-board{flex:1;min-height:0;overflow:auto;padding:.4rem .7rem 1.2rem}
.kt-col{display:none;gap:.8rem;align-content:start}
.kt-board.col-accepted .col-accepted,.kt-board.col-preparing .col-preparing,.kt-board.col-ready .col-ready{display:grid}
.kt-col h2{display:none;margin:0 0 .2rem;font-size:1.1rem}
.kt-card{display:grid;gap:.6rem;padding:.9rem;border:2px solid var(--line);border-radius:1.1rem;background:var(--card);box-shadow:0 1px 3px rgb(23 43 53/.08)}
.kt-card.warn{border-color:var(--warn)}.kt-card.late{border-color:var(--bad);background:var(--badbg)}
.kt-card-top{display:flex;align-items:center;gap:.6rem}.kt-card-top b{font-size:1.5rem}.kt-card-top span{color:var(--mut);font-weight:700}
.kt-age{margin-inline-start:auto;display:inline-flex;align-items:center;gap:.25rem;font-weight:800!important}
.kt-order-note{margin:0;padding:.5rem .7rem;border-radius:.7rem;background:var(--warnbg);color:var(--warn);font-weight:700}
.kt-card ul{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.kt-card li{display:flex;gap:.6rem;align-items:flex-start;font-size:1.2rem}
.kt-card li div{display:grid;gap:.1rem;min-width:0}.kt-card li small{color:var(--mut);font-size:.95rem}.kt-card li em{color:var(--bad);font-style:normal;font-weight:800;font-size:1.05rem}
.kt-thumb{flex:none;display:grid;place-items:center;width:2.6rem;height:2.6rem;overflow:hidden;border-radius:.6rem;background:var(--brand-soft);color:var(--mut)}.kt-thumb img{width:100%;height:100%;object-fit:cover}
.kt-act{display:flex;align-items:center;justify-content:center;gap:.6rem;min-height:3.6rem;border:0;border-radius:1rem;background:var(--brand-strong);color:#fff;font:inherit;font-size:1.15rem;font-weight:800;cursor:pointer}
.kt-act:disabled{opacity:.55}
.kt-col.col-ready .kt-act{background:var(--card);color:var(--brand);border:2px solid var(--brand-strong)}
@media (min-width:900px){
.kt-tabs{display:none}
.kt-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;align-items:start;padding:.9rem 1rem 1.5rem}
.kt-board .kt-col{display:grid}
.kt-col h2{display:flex;align-items:center;position:sticky;top:0;z-index:1;padding:.2rem 0 .4rem;background:var(--bg)}
}
@media print{.wt,.kt,.wt-pin{display:none!important}}
.wt-order.st-waiting{border:2px dashed var(--warn);background:var(--warnbg)}.wt-order.st-waiting .wt-chip{background:var(--warn);color:#fff}
.wt-err{color:var(--bad)!important;font-weight:700}.wt-actions{display:flex;gap:.5rem;flex-wrap:wrap}
.wt-ghost.dark{border-color:var(--line-strong,var(--line));color:var(--ink);background:var(--card)}
.wt-offline{display:inline-flex;align-items:center;gap:.3rem}
.wt-pay-row{display:flex;align-items:center;justify-content:space-between;gap:.6rem}.wt-chip.paid{background:var(--brand-strong);color:#fff}
.wt-method{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem}
.wt-method button{display:grid;justify-items:center;gap:.25rem;min-height:4rem;border:2px solid var(--line);border-radius:1rem;background:var(--card);color:inherit;font:inherit;font-weight:800;cursor:pointer}
.wt-method button.on{border-color:var(--brand-strong);background:var(--brand-soft);color:var(--brand)}
.wt-input{width:100%;min-height:3.5rem;padding:0 1rem;border:1px solid var(--line-strong,var(--line));border-radius:.85rem;background:var(--card);color:inherit;font:inherit;font-size:1.5rem;font-weight:800}
.wt-quick{display:flex;flex-wrap:wrap;gap:.5rem}.wt-quick button{min-height:3rem;padding:0 1rem;border:1px solid var(--line-strong,var(--line));border-radius:.8rem;background:var(--card);color:inherit;font:inherit;font-weight:800;cursor:pointer}
.wt-change{display:grid;gap:.1rem;margin:0;padding:.9rem 1rem;border-radius:1rem;background:var(--goodbg);color:var(--good);text-align:center}.wt-change small{font-weight:700}.wt-change b{font-size:2.2rem}
.wt-change.short{background:var(--badbg);color:var(--bad)}
.wt-paid{justify-items:center;text-align:center;color:var(--good)}.wt-paid h2{margin:0;color:var(--ink)}