*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f4f2ee;
  --card: #ffffff;
  --ink: #23201c;
  --muted: #7c756b;
  --line: #e2ddd4;
  --accent: #8a3b1e;
  --accent-ink: #fff;
  --prep: #b5761b;
  --ready: #2f7d32;
  --picked: #5a5148;
  --danger: #b23b2e;
}

body {
  margin: 0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--accent); }

.wrap { max-width: 760px; margin: 0 auto; padding: 18px 16px 60px; }

.topbar {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}
.topbar .brand { color: #fff; font-weight: 700; text-decoration: none; margin-right: auto; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.topbar nav a { color: #fdece3; text-decoration: none; }
.topbar nav a:hover { color: #fff; text-decoration: underline; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}
.card.narrow { max-width: 360px; margin: 40px auto; }

h1 { font-size: 1.5rem; margin: .2em 0 .6em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; margin: 1em 0 .4em; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }

.rowbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

label { display: block; margin: 10px 0; font-weight: 600; }
label input, label textarea, label select { font-weight: 400; }

input, select, textarea, button {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  max-width: 100%;
}
input[type=text], input[type=password], input[type=date], input[type=time],
input[type=number], textarea, select { width: 100%; }
.wide { width: 100%; }
.two { display: flex; gap: 12px; }
.two > label { flex: 1; }

button {
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}
button:hover { filter: brightness(1.06); }
button.btn, a.btn {
  display: inline-block;
  background: #efe9df;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 600;
}
button.link { background: none; border: none; color: #fdece3; padding: 0; font-weight: 600; }
button.danger { background: var(--danger); border-color: var(--danger); }
button.done { background: var(--ready); border-color: var(--ready); }

.inline { display: inline; }
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.formactions { margin-top: 14px; }

.flash { background: #fff6e5; border: 1px solid #f0dca8; border-radius: 8px; padding: 6px 12px; margin: 10px 0; }
.flash p { margin: 4px 0; }

.tabs a {
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
}
.tabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.order-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.order-head .pickup { color: var(--muted); white-space: nowrap; }
.order .items { margin: 8px 0; padding-left: 20px; }
.order .notes { background: #f7f3ea; border-radius: 6px; padding: 6px 10px; margin: 6px 0 0; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.pill {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  margin-right: 6px;
}
.pill.prep { background: var(--prep); }
.pill.ready { background: var(--ready); }
.pill.picked_up { background: var(--picked); }

.itemrow { display: flex; gap: 8px; margin: 6px 0; }
.itemrow select { flex: 1; }
.itemrow input[type=number] { width: 90px; }
.itemrow .rm { background: #efe9df; color: var(--ink); border-color: var(--line); }

.totals { width: 100%; border-collapse: collapse; }
.totals th, .totals td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.totals .num { text-align: right; font-variant-numeric: tabular-nums; }

.daylist { list-style: none; padding: 0; }
.daylist li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }

.menurow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menurow input[name=name] { flex: 1; min-width: 160px; }
.menurow input[name=unit] { width: 120px; }
.menurow.inactive { opacity: .55; }

.fbtext { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* customer page */
.customer { max-width: 460px; margin: 30px auto; text-align: center; }
.customer .big { font-size: 1.4rem; font-weight: 700; margin: 2px 0 14px; }
.customer .items { display: inline-block; text-align: left; }
.statusbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px;
  border-radius: 10px;
  margin: 16px 0;
}
.statusbox .dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.statusbox.prep { background: #fbefdb; color: var(--prep); }
.statusbox.ready { background: #e3f2e3; color: var(--ready); }
.statusbox.picked_up { background: #ece9e5; color: var(--picked); }
.statusbox.pending { background: #eef1f6; color: #4a5568; }
.statusbox.declined { background: #f6e6e4; color: var(--danger); }

/* ---- phase 2: requests, offer, public ordering ---- */
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
}
.pill.pending { background: #4a5568; }
.pill.declined { background: var(--danger); }

label.check { font-weight: 600; }
label.check input { width: auto; margin-right: 8px; }
.confirmbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.w-price { width: 90px; }
.w-unit { width: 110px; }

.offertbl { width: 100%; border-collapse: collapse; }
.offertbl th, .offertbl td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.offertbl .num { text-align: center; }
.offertbl input[type=number] { width: 90px; }

.orderform .hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.pickrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.pickrow input[type=number] { width: 72px; }
.pickname { flex: 1; }
.price { color: var(--muted); margin-left: 6px; }
.customer .orderform label { display: block; text-align: left; margin: 12px 0; }

.menupic {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 16px;
}
.menupic-thumb {
  max-width: 280px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.stafflink {
  margin-top: 22px;
  font-size: 0.85rem;
}
.stafflink a { color: var(--muted); text-decoration: none; }
.stafflink a:hover { text-decoration: underline; }
