/* DV8 Rewards - mobile-first styling
   Brand: black (#000) primary, white (#FFF) secondary, gold (#ce892f) accent.
   Typeface: Poppins, self-hosted. */

@font-face {
  font-family: 'Poppins';
  src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/fonts/poppins-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #000000;
  --bg2: #141414;
  --card: #1b1b1b;
  --line: #333333;
  --text: #ffffff;
  --muted: #a8a8a8;
  --accent: #ce892f;
  --accent-dark: #a86d20;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- generic UI ---------- */
.screen { padding: 20px 18px 90px; flex: 1; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: 0.5px; }
h2 { font-size: 17px; font-weight: 600; margin: 22px 0 10px; }
.brand-logo { height: 42px; display: block; }
.sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}

label { display: block; font-size: 12.5px; color: var(--muted); margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 13px 14px; font-size: 16px; /* 16px stops iOS zoom */
  background: var(--bg2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; outline: none;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }

.btn {
  display: block; width: 100%; padding: 14px; margin-top: 16px;
  font-size: 15.5px; font-weight: 700; text-align: center;
  background: var(--accent); color: #000; border: none; border-radius: 11px;
  cursor: pointer; transition: transform 0.05s; font-family: inherit;
  letter-spacing: 0.3px;
}
.btn:active { transform: scale(0.98); }
.btn.secondary { background: var(--bg2); border: 1px solid var(--line); color: var(--text); }
.btn.outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn.small { width: auto; display: inline-block; padding: 9px 14px; font-size: 13.5px; margin: 6px 6px 0 0; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.link { color: var(--accent); text-align: center; margin-top: 16px; font-size: 14px; cursor: pointer; }
.error { color: #ff6b6b; font-size: 14px; margin-top: 10px; min-height: 18px; }

/* ---------- loyalty card ---------- */
.loyalty-card {
  background: linear-gradient(160deg, #1a1a1a 0%, #000 60%);
  border: 1.5px solid var(--accent);
  border-radius: 18px; padding: 22px; margin-top: 14px;
}
.loyalty-card .points { font-size: 42px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.loyalty-card .points small { font-size: 15px; color: var(--text); font-weight: 600; }
.qr-wrap {
  background: #fff; border-radius: 12px; padding: 14px;
  width: fit-content; margin: 18px auto 6px;
}
.qr-wrap svg { display: block; width: 180px; height: 180px; }
.qr-code { text-align: center; font-family: ui-monospace, monospace; letter-spacing: 2px;
  color: var(--muted); font-size: 14px; margin-top: 8px; }

/* review prompt banner on the card screen */
.banner {
  background: var(--accent); color: #000; border-radius: var(--radius);
  padding: 14px 16px; margin-top: 14px; font-weight: 600; font-size: 14px;
  cursor: pointer;
}

/* ---------- lists ---------- */
.row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 2px; border-bottom: 1px solid var(--line); gap: 10px;
}
.row:last-child { border-bottom: none; }
.row .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pts-pos { color: var(--accent); font-weight: 700; white-space: nowrap; }
.pts-neg { color: #ff6b6b; font-weight: 700; white-space: nowrap; }
.badge {
  font-size: 10.5px; padding: 3px 9px; border-radius: 99px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.badge.gold { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

/* ---------- star rating ---------- */
.stars { display: flex; gap: 6px; margin: 8px 0 4px; }
.stars button {
  background: none; border: none; font-size: 30px; line-height: 1;
  color: var(--line); cursor: pointer; padding: 2px;
}
.stars button.on { color: var(--accent); }
.stars-static { color: var(--accent); font-size: 15px; letter-spacing: 2px; }

/* ---------- bottom navigation ---------- */
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex; background: var(--bg2); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav button {
  flex: 1; padding: 12px 4px; background: none; border: none;
  color: var(--muted); font-size: 11.5px; cursor: pointer; font-family: inherit;
  position: relative;
}
.nav button .ico { display: block; font-size: 19px; margin-bottom: 3px; }
.nav button.active { color: var(--accent); }
.nav .dot {
  position: absolute; top: 8px; right: 22%;
  width: 9px; height: 9px; border-radius: 99px; background: var(--accent);
}

/* ---------- staff scanner ---------- */
.scanner-box {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #0a0a0a; margin-top: 14px; aspect-ratio: 1;
  border: 1px solid var(--line);
}
.scanner-box video { width: 100%; height: 100%; object-fit: cover; }
.scanner-box .frame {
  position: absolute; inset: 14%; border: 3px solid var(--accent);
  border-radius: 16px; opacity: 0.9; pointer-events: none;
}

.progress {
  height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden;
  margin-top: 12px; border: 1px solid var(--line);
}
.progress > div { height: 100%; background: var(--accent); width: 0%; transition: width 0.2s; }

/* ---------- admin tables ---------- */
.table-wrap { overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: 1px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .n { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat .l { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ---------- tab nav dropdown ---------- */
.tab-nav { position: relative; margin-top: 14px; margin-bottom: 2px; }

.tab-nav-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer; gap: 8px; transition: border-color 0.15s;
}
.tab-nav-btn:hover { border-color: var(--accent); }
.tab-nav-btn svg { flex-shrink: 0; color: var(--muted); transition: transform 0.2s; }
.tab-nav-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.tab-nav-panel {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.tab-nav-panel.open { display: block; }

.tab-nav-item {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 11px 14px; text-align: left;
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-family: inherit; cursor: pointer;
  transition: background 0.12s;
}
.tab-nav-item:last-child { border-bottom: none; }
.tab-nav-item:hover { background: var(--bg); }
.tab-nav-item.active { background: var(--accent); color: #000; font-weight: 600; }

/* ---------- filter pill bars (analytics, etc.) ---------- */
.pill-bar { display: flex; gap: 6px; overflow-x: auto; margin-top: 14px; padding-bottom: 4px; flex-wrap: nowrap; }
.pill-bar button {
  padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--muted); font-size: 13px; white-space: nowrap;
  cursor: pointer; font-family: inherit; flex-shrink: 0;
}
.pill-bar button.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #000; font-weight: 600;
  padding: 12px 22px; border-radius: 99px; font-size: 14px;
  z-index: 50; max-width: 90%; text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
}
.toast.err { background: #c0392b; color: #fff; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.logout { color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; }

/* ---------- collapsible visits (Rate tab) ---------- */
details.visit summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
details.visit summary::-webkit-details-marker { display: none; }
details.visit summary::after { content: '+'; color: var(--accent); font-size: 22px; font-weight: 700; }
details.visit[open] summary::after { content: '\2212'; }
details.visit[open] summary { padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* ---------- dish picker modal ---------- */
#dish-picker-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.dpm-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.72);
}
.dpm-sheet {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px;
  background: var(--card); border-radius: 22px 22px 0 0;
  border-top: 1px solid var(--line);
  max-height: 82vh; display: flex; flex-direction: column;
  animation: slideUp 0.22s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.dpm-header {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.dpm-back, .dpm-close {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  width: 36px; height: 36px; border-radius: 99px; font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-family: inherit;
}
.dpm-title {
  flex: 1; font-weight: 600; font-size: 15.5px; text-align: center;
}
.dpm-body {
  overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.dpm-big-btn {
  width: 100%; padding: 22px 16px; font-size: 17px; font-weight: 700;
  background: var(--bg2); border: 1.5px solid var(--line); color: var(--text);
  border-radius: 14px; cursor: pointer; font-family: inherit;
  text-align: center; transition: border-color 0.1s;
}
.dpm-big-btn:active { border-color: var(--accent); color: var(--accent); }
.dpm-cat-btn {
  width: 100%; padding: 16px 14px; font-size: 15px; font-weight: 600;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; cursor: po

