:root {
  --bg: #f5f4f1;
  --card: #ffffff;
  --ink: #1f2420;
  --muted: #6b7269;
  --border: #e3e1db;
  --brand: #2f6e4e;
  --brand-dark: #24543c;
  --accent: #c96a3a;
  --danger: #b3432f;
  --radius: 12px;
  --gap: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--gap) var(--gap) 100px;
}

.wrap.narrow-admin { max-width: 780px; }

header.topbar {
  background: var(--brand);
  color: #fff;
  padding: 14px var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

header.topbar h1 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 600;
}

header.topbar a.small-link, header.topbar span.small-link {
  color: #eafff2;
  font-size: 0.85rem;
  text-decoration: none;
}

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

.card h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

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

.venue-list a.venue-tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  color: var(--ink);
}

.venue-list a.venue-tile:active { background: #eef4ee; }

.venue-tile .tag {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--brand);
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.venue-tile .tag.restaurant { background: var(--accent); }

.venue-tile .status {
  float: right;
  font-size: 0.8rem;
  color: var(--brand);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
}

form label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 10px 0 4px;
}

input[type=text], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea { resize: vertical; min-height: 90px; font-family: inherit; }

button, .btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary { background: var(--brand); color: #fff; width: 100%; }
.btn-primary:active { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

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

.menu-item:last-child { border-bottom: none; }

.menu-item .info { flex: 1; min-width: 0; }
.menu-item .info .name { font-weight: 600; }
.menu-item .info .desc { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.menu-item .info .price { color: var(--brand); font-weight: 600; margin-top: 4px; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.qty-control button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}

.qty-control button.minus { background: #dcd9d1; color: var(--ink); }
.qty-control .qty-val { min-width: 20px; text-align: center; font-weight: 600; }

.menu-item.pick-item {
  cursor: pointer;
}

.menu-item.pick-item.picked {
  background: #f2f8f3;
  margin: 0 -14px;
  padding: 12px 14px;
  border-radius: 8px;
}

.pick-indicator {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
}

.menu-item.pick-item.picked .pick-indicator {
  border-color: var(--brand);
  background: var(--brand);
}

.category-heading {
  margin: 18px 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cart-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--brand);
  color: #fff;
  padding: 14px var(--gap);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  z-index: 20;
}

.cart-bar .total { font-weight: 700; font-size: 1.05rem; }
.cart-bar button { background: #fff; color: var(--brand-dark); flex-shrink: 0; }

.seat-display {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand);
  margin: 2px 0 0;
}

.payment-info dt {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

.payment-info dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.receipt-total {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
  margin: 6px 0 2px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.locked { background: #e6e3db; color: var(--muted); }
.badge.unlocked { background: #dff2e6; color: var(--brand-dark); }
.badge.confirmed { background: #dff2e6; color: var(--brand-dark); }
.badge.fulfilled { background: #dfe8f2; color: #2b5a8c; }
.badge.paid { background: #eee6d8; color: #8c6a2b; }
.badge.cancelled { background: #f2dfe0; color: #8c2b2b; }

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.admin-table tr.row-owing { background: #f3b8ac; }
table.admin-table tr.row-credit { background: #a9dcbb; }

table.admin-table th, table.admin-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

.flex-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.flex-row.between { justify-content: space-between; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.error-box {
  background: #fbe4e0;
  color: #7a2c1d;
  border: 1px solid #f0b8ab;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: var(--gap);
  font-size: 0.9rem;
}

.notice-box {
  background: #dff2e6;
  color: var(--brand-dark);
  border: 1px solid #b7e0c6;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: var(--gap);
  font-size: 0.9rem;
}

.passenger-pick-list {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 8px;
}

.passenger-pick-list .row {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.passenger-pick-list .row:last-child { border-bottom: none; }
.passenger-pick-list .row:active { background: #eef4ee; }
.passenger-pick-list .seat { color: var(--muted); font-size: 0.85rem; }

nav.admin-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--gap);
}

nav.admin-nav a {
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88rem;
}

nav.admin-nav a.active { background: var(--brand); color: #fff; border-color: var(--brand); }

@media (min-width: 700px) {
  .wrap { padding-top: 24px; }
}
