:root {
  --bg: #FFF8F0;
  --surface: #FFFFFF;
  --surface-2: #F6EADB;
  --fg: #2B2118;
  --muted: #6A5B4C;
  --line: #E4D3BE;
  --accent: #C2410C;
  --accent-fg: #FFFFFF;
  --ok: #17703F;
  --ok-bg: #E3F4EA;
  --bad: #B3261E;
  --bad-bg: #FCE8E6;
  --warn-bg: #FFF1C9;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
html.big { font-size: 137.5%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 1rem; line-height: 1.45;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 150px max(14px, env(safe-area-inset-left, 0px));
}
body.no-dock { padding-bottom: 60px; }
.app { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.app.wide { max-width: 980px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.15; text-wrap: balance; }
h3 { font-size: 1.15rem; font-weight: 800; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
[hidden] { display: none !important; }

/* ---------- cabeçalho ---------- */
.top { display: flex; align-items: center; gap: 12px; }
.logo { flex: none; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.7rem; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.top h1 { font-size: 1.45rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.top .tag { color: var(--muted); font-size: .9rem; line-height: 1.2; }
.zoom { flex: none; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 10px; font-weight: 800; font-size: .85rem; line-height: 1.1; min-height: 44px; }

/* ---------- botões ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 3.4rem; padding: 12px 18px;
  border-radius: 16px; border: 3px solid var(--accent); background: var(--accent); color: var(--accent-fg); font-weight: 800; font-size: 1.1rem;
  text-decoration: none; text-align: center; line-height: 1.2;
}
.btn.ghost { background: var(--surface); color: var(--accent); }
.btn.green { background: #1B8F4F; border-color: #1B8F4F; color: #fff; }
.btn.red { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.btn.sm { width: auto; min-height: 2.6rem; padding: 6px 14px; font-size: .95rem; border-radius: 12px; border-width: 2px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 8px 4px; color: var(--accent); font-weight: 800; text-decoration: underline; font-size: 1rem; min-height: 44px; }
.back { align-self: flex-start; }

/* ---------- avisos ---------- */
.banner { border-radius: var(--radius); padding: 14px 16px; font-weight: 700; border: 2px solid transparent; }
.banner.open { background: var(--ok-bg); border-color: #9AD4B3; color: #0F5130; }
.banner.closed { background: var(--bad-bg); border-color: #F2B3AE; color: #7E1710; }
.banner.info { background: var(--warn-bg); border-color: #EBCF7C; color: #5C4600; }
.banner .small { font-weight: 600; }
.err { background: var(--bad-bg); color: #7E1710; border-radius: 14px; padding: 12px 14px; font-weight: 700; }

/* ---------- categorias ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius); padding: 16px 10px; min-height: 8.2rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; font-weight: 800; font-size: 1.05rem; line-height: 1.2;
}
.tile .ic { font-size: 2.6rem; line-height: 1; }
.tile:active { border-color: var(--accent); }
.search { width: 100%; min-height: 3.2rem; padding: 10px 16px; border: 3px solid var(--line); border-radius: 16px; background: var(--surface); font-size: 1.05rem; }

/* ---------- produtos ---------- */
.prods { display: flex; flex-direction: column; gap: 14px; }
.prod { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; grid-template-columns: 7.4rem 1fr; gap: 12px; }
.prod .ph { width: 7.4rem; height: 7.4rem; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font-size: 3rem; overflow: hidden; }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod .nm { font-weight: 800; font-size: 1.08rem; line-height: 1.2; overflow-wrap: anywhere; }
.prod .un { color: var(--muted); font-size: .9rem; }
.prod .ds { color: var(--muted); font-size: .85rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .pr { font-size: 1.4rem; font-weight: 800; }
.prod .act { grid-column: 1 / -1; }
.prod.off { opacity: .75; }
.off-tag { display: inline-block; background: var(--surface-2); border-radius: 999px; padding: 2px 10px; font-size: .85rem; font-weight: 800; color: var(--muted); }
.step { display: grid; grid-template-columns: 3.6rem 1fr 3.6rem; gap: 8px; align-items: center; }
.step button { min-height: 3.4rem; border-radius: 14px; border: 3px solid var(--accent); background: var(--surface); color: var(--accent); font-size: 1.8rem; font-weight: 800; line-height: 1; }
.step .q { text-align: center; font-weight: 800; font-size: 1.3rem; }
.step .q small { display: block; font-size: .75rem; font-weight: 700; color: var(--muted); }

/* ---------- barra de baixo ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px max(14px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); background: linear-gradient(to top, var(--bg) 70%, rgba(255,248,240,0)); }
.dock .inner { max-width: 560px; margin: 0 auto; }

/* ---------- carrinho e resumo ---------- */
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; }
.line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.line.total { font-size: 1.3rem; font-weight: 800; border-top: 2px dashed var(--line); padding-top: 10px; margin-top: 6px; }
.citem { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-bottom: 2px solid var(--line); }
.citem:last-child { border-bottom: 0; }

/* ---------- formulário ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .legend { font-weight: 800; font-size: 1.02rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 3.2rem; padding: 10px 14px; border: 3px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 1.05rem;
}
.field textarea { min-height: 5.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field .hint { color: var(--muted); font-size: .88rem; }
.field.bad input, .field.bad select { border-color: var(--bad); }
.field .msg { color: var(--bad); font-weight: 800; font-size: .92rem; }
.pays { display: flex; flex-direction: column; gap: 10px; }
.pay { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 3px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 3.6rem; cursor: pointer; }
.pay input { width: 1.5rem; height: 1.5rem; accent-color: var(--accent); flex: none; }
.pay .t { font-weight: 800; }
.pay .d { color: var(--muted); font-size: .85rem; line-height: 1.25; }
.pay:has(input:checked) { border-color: var(--accent); background: #FFF1E6; }

/* ---------- acompanhar pedido ---------- */
.big-ok { text-align: center; padding: 8px 0; }
.big-ok .ck { width: 4.4rem; height: 4.4rem; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; font-size: 2.4rem; margin: 0 auto 8px; }
.code { font-size: 2.2rem; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.steps { display: flex; flex-direction: column; gap: 0; list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 10px 0; color: var(--muted); font-weight: 700; }
.steps li .dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 3px solid var(--line); flex: none; background: var(--surface); }
.steps li.done { color: var(--fg); }
.steps li.done .dot { background: var(--ok); border-color: var(--ok); }
.steps li.now { color: var(--fg); font-size: 1.12rem; font-weight: 800; }
.steps li.now .dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px rgba(194,65,12,.18); }

/* ---------- aviso rápido ---------- */
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 50; background: var(--fg); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 800; max-width: 90vw; text-align: center; }

/* ---------- ADMIN ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.tab { flex: none; border: 2px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 16px; font-weight: 800; min-height: 44px; position: relative; }
.tab[aria-selected="true"] { background: var(--fg); border-color: var(--fg); color: #fff; }
.tab .badge { display: inline-block; min-width: 1.5rem; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .8rem; text-align: center; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 2px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: .92rem; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.order { background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.order.novo { border-color: var(--accent); background: #FFF6EE; }
.order .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.order .cd { font-weight: 800; font-size: 1.25rem; letter-spacing: .06em; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: .85rem; background: var(--surface-2); }
.pill.novo { background: var(--accent); color: #fff; }
.pill.preparo { background: #FFE6A8; color: #5C4600; }
.pill.saiu { background: #CFE3FF; color: #123F7A; }
.pill.entregue { background: var(--ok-bg); color: var(--ok); }
.pill.cancelado { background: var(--bad-bg); color: var(--bad); }
.items { margin: 0; padding-left: 1.2rem; }
.items li { margin: 2px 0; }
.sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; font-weight: 800; }
.sw input { width: 3.2rem; height: 1.8rem; accent-color: var(--ok); flex: none; }
.sw.big { padding: 16px; font-size: 1.15rem; }
.sw.big.on { background: var(--ok-bg); border-color: #9AD4B3; }
.sw.big.off { background: var(--bad-bg); border-color: #F2B3AE; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 12px; display: flex; gap: 12px; align-items: center; }
.item .th { width: 3.8rem; height: 3.8rem; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.6rem; overflow: hidden; flex: none; }
.item .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item.dim { opacity: .6; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.imgbox { display: flex; gap: 12px; align-items: center; }
.imgbox .th { width: 5rem; height: 5rem; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font-size: 2rem; overflow: hidden; flex: none; }
.imgbox .th img { width: 100%; height: 100%; object-fit: cover; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { border: 2px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--surface); font-weight: 800; font-size: .9rem; }
.days label:has(input:checked) { background: #FCE8E6; border-color: var(--bad); color: var(--bad); }
.days input { margin-right: 4px; }
.sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.sum .box { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.sum .box b { display: block; font-size: 1.35rem; }
@media print {
  body * { visibility: hidden; }
  .printing, .printing * { visibility: visible; }
  .printing { position: absolute; left: 0; top: 0; width: 100%; border: 0 !important; }
  .noprint { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.tier { align-items: end; gap: 8px; }
.tier label { min-width: 0; font-weight: 700; font-size: .9rem; display: block; }
.tier input { width: 100%; min-height: 3rem; padding: 8px 10px; border: 3px solid var(--line); border-radius: 12px; font: inherit; background: #fff; }
