:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1c1c;
  --muted: #6b6b6b;
  --accent: #b3541e;
  --accent-dark: #8f4116;
  --border: #e5e2df;
  --success: #2f7a4f;
  --warning: #b3831e;
  --danger: #b33a1e;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

a { color: var(--accent); text-decoration: none; }

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

.wide { max-width: 960px; }

header.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

header.topbar h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.pending { background: #f5e6d3; color: var(--warning); }
.badge.preparing { background: #dbe8f5; color: #2b5f8f; }
.badge.ready { background: #e2f0e6; color: var(--success); }
.badge.served { background: #ece9e6; color: var(--muted); }
.badge.cancelled { background: #f5dbd3; color: var(--danger); }
.badge.completed { background: #e2f0e6; color: var(--success); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.category-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 22px 0 8px;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.item-row:last-child { border-bottom: none; }

.item-photo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}
.item-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid var(--border);
}
.item-info { flex: 1; min-width: 0; }

.item-name { font-weight: 600; font-size: 15px; }
.item-desc { font-size: 13px; color: var(--muted); }
.item-price { font-size: 14px; color: var(--muted); margin-top: 2px; }

.item-row.out-of-stock { opacity: .5; }
.item-row .badge { margin-top: 6px; display: inline-block; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-control button {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 16px;
  cursor: pointer;
}
.qty-control span { min-width: 18px; text-align: center; font-weight: 600; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.block { display: block; width: 100%; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.cart-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0,0,0,.05);
}

input[type=text], input[type=tel], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
  background: #fff;
  color: var(--text);
}

label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
}
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.muted { color: var(--muted); font-size: 13px; }
.total-line { display: flex; justify-content: space-between; font-weight: 600; padding-top: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; width: 100%; max-width: 480px;
  border-radius: 16px 16px 0 0; padding: 20px;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal { border-radius: var(--radius); }
}

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text); background: #fff;
}
.tabs a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.alert.error { background: #f5dbd3; color: var(--danger); }
.alert.success { background: #e2f0e6; color: var(--success); }

footer.note { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 0 90px; }
