:root {
  /* Sidapur Coffee: terracotta elephant, charcoal wordmark, dark brown bar */
  --bg: #faf7f3; --card: #fff; --ink: #2f2b28; --muted: #7a6f66; --line: #ebe3da;
  --brand: #a04828; --brand-ink: #fff; --accent: #f6e9e1; --bar: #503e30; --ok: #1d7a3a; --warn: #b25b00; --bad: #b3261e;
  --serif: 'Lora', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
body { max-width: 560px; margin: 0 auto; padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
header { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: #fff; color: var(--ink); border-top: 4px solid var(--bar); border-bottom: 1px solid var(--line); }
.brand { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.brand img { height: 40px; width: auto; }
.brand span { font-size: 12px; letter-spacing: .2em; color: var(--brand); font-weight: 600; }
header select { max-width: 42%; padding: 6px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; margin: 0; width: auto; }
.sync { font-size: 12px; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.sync.on { background: #d9f2df; color: var(--ok); } .sync.off { background: #ffe2c4; color: var(--warn); }
main { padding: 12px; }
h2 { margin: 0 0 10px; font: 600 21px/1.25 var(--serif); } h3 { margin: 0 0 8px; font: 600 17px/1.25 var(--serif); }
.card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.narrow { max-width: 420px; margin: 24px auto; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .right { text-align: right; }
.ok { color: var(--ok); } .warn { color: var(--warn); }
label { display: block; margin: 10px 0; font-size: 14px; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
input, select, textarea { width: 100%; font: inherit; padding: 11px 12px; margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
label.check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; }
button { font: inherit; border: 0; border-radius: 10px; padding: 10px 14px; cursor: pointer; }
button.primary { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
button.ghost { background: var(--accent); color: var(--brand); margin: 4px 4px 4px 0; }
button.big { width: 100%; padding: 15px; font-size: 18px; margin-top: 8px; }
button.tiny { padding: 4px 10px; font-size: 13px; background: var(--accent); color: var(--brand); margin-top: 4px; }
button:disabled { opacity: .5; }
.links { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 14px; }
.links a { color: var(--brand); cursor: pointer; text-decoration: underline; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row input[type=date] { width: auto; margin: 0; }
.inline { display: flex; gap: 8px; align-items: center; margin: 8px 0; } .inline input { margin: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.chips button { background: var(--card); color: var(--ink); white-space: nowrap; border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.chips button.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { position: relative; min-height: 92px; background: var(--card); text-align: left; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 1px 2px rgba(0,0,0,.08); border: 2px solid transparent; }
.tile.in { border-color: var(--brand); }
.tile .name { font-weight: 600; } .tile .price { color: var(--muted); }
.tile .qty { position: absolute; top: 6px; right: 6px; background: var(--brand); color: #fff; border-radius: 99px; min-width: 26px; height: 26px; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
#cartbar .bar { position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; padding: 8px 12px; display: flex; gap: 8px; background: var(--bg); }
#cartbar .bar .primary { flex: 1; padding: 14px; font-size: 16px; }
nav { position: fixed; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav button { flex: 1; background: none; padding: 16px 2px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-radius: 0; }
nav button.active { color: var(--brand); font-weight: 700; box-shadow: inset 0 3px 0 var(--brand); }
.line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line .ln { flex: 1; } .line .amt { min-width: 80px; text-align: right; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 36px; height: 36px; padding: 0; font-size: 20px; background: var(--accent); color: var(--brand); }
.tl { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.tl.grand { font-size: 22px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.pay { display: flex; gap: 10px; }
.pay button { flex: 1; padding: 18px; font-size: 18px; font-weight: 600; background: var(--accent); color: var(--brand); border: 2px solid transparent; }
.pay button.sel { background: var(--brand); color: #fff; }
.big-num { font: 600 38px/1.2 var(--serif); margin: 4px 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--accent); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; min-width: 0; }
.stats b { font-size: 15px; overflow-wrap: anywhere; } .stats small { color: var(--muted); font-size: 11px; }
.sale { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: default; }
.sale:last-child { border-bottom: 0; }
.sale.void { opacity: .5; text-decoration: line-through; }
[data-edititem], [data-editstaff] { cursor: pointer; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
code { background: var(--accent); padding: 1px 4px; border-radius: 4px; }
#toast { position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90%; z-index: 10; text-align: center; }
#toast.show { opacity: 1; }
.search { margin: 0 0 10px; }
