:root {
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg: #F7F4EC;
  --surface: #ffffff;
  --surface-muted: #faf9f6;
  --border: #e7e2da;
  --border-strong: #d9d2c6;

  --text: #1c1815;
  --text-muted: #7a7168;
  --text-faint: #a49b90;

  --primary: #B3123C;
  --primary-hover: #8C0E2F;
  --primary-soft: #F7E0E5;
  --primary-soft-text: #7A0E2A;

  --success: #1e8a5f;
  --success-soft: #e3f3eb;
  --success-soft-text: #145f41;

  --danger: #c23a2c;
  --danger-soft: #fbe9e6;
  --danger-soft-text: #8f2a1f;

  --focus: #B3123C;

  --gold: #D4A017;

  --shadow-xs: 0 1px 2px rgba(28, 24, 21, 0.05);
  --shadow-sm: 0 2px 6px rgba(28, 24, 21, 0.06), 0 1px 2px rgba(28, 24, 21, 0.05);
  --shadow-md: 0 8px 20px rgba(28, 24, 21, 0.08), 0 2px 6px rgba(28, 24, 21, 0.05);
  --shadow-lg: 0 20px 48px rgba(28, 24, 21, 0.14), 0 4px 12px rgba(28, 24, 21, 0.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--primary-soft);
  color: var(--primary-soft-text);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 { font-weight: 650; letter-spacing: -0.015em; margin: 0; }

/* ---------- Shell / topbar ---------- */

.app-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 0.98rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

a.brand { text-decoration: none; }
button.brand { background: none; border: none; padding: 0; font: inherit; cursor: pointer; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.brand-mark svg { width: 16px; height: 16px; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.main.align-top {
  align-items: flex-start;
  padding-top: 56px;
}

/* ---------- Card ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.card.wide { max-width: 620px; }

#phone-section { flex-direction: column; align-items: center; gap: 0; }

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.login-welcome {
  font-weight: 650;
  font-size: 1rem;
  color: var(--text);
  margin: 0;
}

.eyebrow-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.eyebrow-icon svg { width: 22px; height: 22px; }

h1.title { font-size: 1.35rem; margin-bottom: 6px; }

p.subtitle {
  color: var(--text-muted);
  margin: 0 0 26px;
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap svg {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}

input[type="text"],
input[type="tel"],
input[type="password"],
select {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

input::placeholder { color: var(--text-faint); }

/* Country code + phone number sharing one row (customer login). */
.phone-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.phone-country-select {
  flex: 0 0 15%;
  min-width: 68px;
  padding-left: 10px;
  padding-right: 6px;
  text-align: center;
}

.phone-input-wrap {
  flex: 1 1 85%;
  min-width: 0;
}

.field-subinput { margin-top: 8px; padding-left: 14px; }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  position: relative;
}

.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }

.dropzone svg { width: 22px; height: 22px; color: var(--text-faint); margin-bottom: 8px; }

.dropzone .dz-label { font-size: 0.88rem; color: var(--text-muted); }
.dropzone .dz-filename { font-size: 0.85rem; color: var(--primary); font-weight: 600; margin-top: 4px; }

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------- Buttons ---------- */

button {
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
}

button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-secondary {
  width: 100%;
  padding: 13px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-muted); border-color: var(--text-faint); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--surface-muted); }

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid #ecc9c2;
  padding: 7px 12px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }

.btn-small { width: auto; padding: 9px 16px; font-size: 0.85rem; }

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.spinner.dark {
  border-color: var(--border-strong);
  border-top-color: var(--primary);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Alerts / toasts ---------- */

.alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.87rem;
  margin-top: 14px;
  border: 1px solid transparent;
}

.alert.show { display: flex; }
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }

.alert-error {
  background: var(--danger-soft);
  color: var(--danger-soft-text);
  border-color: #f2c9c1;
}

.alert-success {
  background: var(--success-soft);
  color: var(--success-soft-text);
  border-color: #bfe3cf;
}

.hidden { display: none !important; }

/* ---------- Wheel ---------- */

.wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.prize-frame {
  width: 100%;
  border: 3px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  margin: 6px 0 0;
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.prize-tile {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  padding: 6px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.prize-tile .tile-emoji { font-size: 1.4rem; line-height: 1; }
.prize-tile .tile-label { font-size: 0.72rem; font-weight: 700; line-height: 1.2; color: var(--text); }

.prize-tile.chase-active {
  box-shadow: 0 0 0 3px var(--gold), 0 0 16px 4px rgba(212, 160, 23, 0.6);
  transform: scale(1.05);
  border-color: var(--gold);
}

.prize-tile.chase-winner {
  box-shadow: 0 0 0 3px var(--gold), 0 0 20px 6px rgba(212, 160, 23, 0.7);
  border-color: var(--gold);
  animation: tile-pulse 0.6s ease-in-out infinite;
}

@keyframes tile-pulse {
  0%, 100% { transform: scale(1.05); }
  50% { transform: scale(1.12); }
}

.spins-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 16px;
}

.spins-pill svg { width: 14px; height: 14px; }
.spins-pill.empty { color: var(--danger-soft-text); background: var(--danger-soft); border-color: #f2c9c1; }

.result-banner {
  display: none;
  align-items: center;
  gap: 12px;
  background: var(--success-soft);
  border: 1px solid #bfe3cf;
  color: var(--success-soft-text);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 18px;
  width: 100%;
}

.result-banner.show { display: flex; }

.result-banner .icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.result-banner .icon svg { width: 17px; height: 17px; }
.result-banner strong { display: block; font-size: 0.95rem; }
.result-banner span { font-size: 0.82rem; opacity: 0.85; }

.bonus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 20px;
  width: 100%;
}

.bonus-row-text { font-size: 0.83rem; color: var(--text-muted); line-height: 1.4; }
.bonus-row-text strong { color: var(--text); display: block; font-size: 0.87rem; margin-bottom: 2px; }

/* ---------- Disclaimer / prizes & terms ---------- */

.disclaimer {
  font-size: 0.78rem;
  color: var(--text-faint);
  line-height: 1.5;
  margin: 0 0 20px;
}

.terms-block {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.terms-block summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
  font-size: 0.85rem;
}

.terms-prizes { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; }
.terms-prizes .terms-prize-row { display: flex; justify-content: space-between; gap: 10px; }
.terms-prizes .terms-prize-row span:last-child { color: var(--text-faint); white-space: nowrap; }

.terms-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

.grand-prize-card { text-align: center; }
.grand-prize-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.grand-prize-list li {
  font-size: 0.88rem;
  color: var(--text);
  padding-left: 20px;
  position: relative;
}
.grand-prize-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.grand-prize-date {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--primary-soft-text);
  background: var(--primary-soft);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  margin: 4px auto 0;
  display: table;
}

.grand-prize-cta {
  text-align: center;
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--text);
  margin: 12px 0 0;
}

/* ---------- Quarterly gift ---------- */

.gift-card { text-align: center; }

#gift-box {
  display: block;
  margin: 8px auto 4px;
  width: 120px;
  height: 120px;
  font-size: 64px;
  line-height: 120px;
  background: var(--primary-soft);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.08s ease;
}

#gift-box:hover:not(:disabled) { transform: translateY(-2px); }

#gift-box.shake { animation: gift-shake 0.35s ease; }

@keyframes gift-shake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-8deg) scale(1.03); }
  50% { transform: rotate(0deg) scale(1.06); }
  75% { transform: rotate(8deg) scale(1.03); }
}

#gift-box:disabled { cursor: default; }

/* ---------- Staff: lookup / table ---------- */

.staff-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.search-row .field { flex: 1; margin-bottom: 0; }
.search-row button { width: auto; padding: 12px 20px; white-space: nowrap; }

.result-panel {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.customer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.customer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 650;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.customer-info { display: flex; align-items: center; gap: 12px; }
.customer-name { font-size: 1.02rem; font-weight: 650; }
.customer-phone { font-size: 0.83rem; color: var(--text-muted); }

.section-label {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin: 24px 0 10px;
}

.reward-list { display: flex; flex-direction: column; gap: 8px; }

.reward-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.reward-item-label { font-size: 0.9rem; font-weight: 600; }

.tag-chip {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-soft-text);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 650;
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.empty-state {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.spins-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.spins-meter .track {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
}

.spins-meter .fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .card { padding: 26px 20px; border-radius: var(--radius-md); }
  .topbar { padding: 14px 18px; }
  .search-row { flex-direction: column; align-items: stretch; }
  .search-row button { width: 100%; }
}

/* ---------- Loyalty punch card ---------- */
.punch-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 8px 0 12px; }
.punch {
  aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--text-faint); font-size: 0.8rem; font-weight: 700;
  background: var(--surface-muted); line-height: 1.1; padding: 2px;
}
.punch.filled { background: var(--primary-soft); border: 2px solid var(--primary); color: var(--primary-soft-text); }
.punch.milestone { border-radius: 14px; overflow: hidden; }
.punch-gift { font-size: 0.95rem; }
.punch-label { font-size: 0.5rem; font-weight: 600; margin-top: 2px; }
.cards-completed { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 4px; }
.profile-box { background: var(--surface-muted); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-top: 16px; }
.profile-box p { font-size: 0.85rem; color: var(--text-faint); margin: 4px 0 12px; }
.profile-box input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.expiry-chip { display: inline-block; margin-left: 6px; font-size: 0.72rem; font-weight: 600; color: #9a3412; background: #ffedd5; padding: 2px 9px; border-radius: 999px; }
.minspend-chip { display: inline-block; margin-left: 6px; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); padding: 2px 9px; border-radius: 999px; }
.checkin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; flex-wrap: wrap; }

.main.stack { flex-direction: column; gap: 20px; }

/* ---------- Home tiles, review flow ---------- */
.view-stack { display: flex; flex-direction: column; gap: 20px; width: 100%; align-items: center; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left;
  padding: 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface-muted);
  font: inherit; color: inherit; cursor: pointer;
}
.tile:hover { border-color: var(--primary); }
.tile.active { border-color: var(--primary); background: var(--primary-soft); }
.tile-icon { font-size: 1.4rem; }
.tile-title { font-weight: 700; font-size: 0.95rem; }
.tile-sub { font-size: 0.78rem; color: var(--text-faint); }
.faces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.face {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface-muted);
  font: inherit; font-weight: 600; font-size: 0.85rem; color: inherit; cursor: pointer;
}
.face:hover, .face:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.face-emoji { font-size: 2.2rem; line-height: 1; }
.suggested {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; font-size: 0.9rem; resize: vertical; margin-bottom: 10px;
}
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr; } }
.view-stack > div:not(.card),
.main.stack > div:not(.view-stack) { width: 100%; display: flex; justify-content: center; }

/* ---------- Review view: roomier, mobile-first ---------- */
#review-view .card { padding: 28px 22px; }
#review-view .title { margin-bottom: 8px; }
#review-view .subtitle { margin-bottom: 24px; line-height: 1.5; }
#review-view .field { margin-bottom: 20px; }
#review-view .btn-primary, #review-view .btn-secondary { min-height: 48px; }
#review-view .alert { margin-top: 16px; }
#review-view textarea.suggested {
  min-height: 140px; padding: 14px; font-size: 16px; line-height: 1.5; margin-bottom: 20px;
}
#google-section .btn-secondary,
#review-done .btn-primary { width: 100% !important; margin: 0 0 12px; padding: 13px; font-size: 0.95rem !important; }
#google-section #posted-btn { margin-top: 12px; }
#review-view .faces { grid-template-columns: 1fr; gap: 12px; }
#review-view .face {
  flex-direction: row; justify-content: flex-start; gap: 16px;
  min-height: 68px; padding: 12px 20px; font-size: 1rem;
}
#review-view .face-emoji { font-size: 2.4rem; }
@media (min-width: 520px) {
  #review-view .faces { grid-template-columns: repeat(3, 1fr); }
  #review-view .face { flex-direction: column; justify-content: center; gap: 8px; padding: 22px 8px; }
}

.punch-legend { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-muted, #6b6560); margin-bottom: 8px; }
.punch-legend b { color: var(--text); }
@media (max-width: 480px) {
  .punch-label { display: none; }
  .punch.milestone .punch-gift { font-size: 1.15rem; }
}

.link-back {
  display: block; margin: 20px auto 0; padding: 8px; background: none; border: 0;
  font: inherit; font-size: 0.9rem; color: var(--text-muted, #6b6560); text-decoration: underline; cursor: pointer;
}
.link-back:hover { color: var(--text); }
.link-back + .link-back { margin-top: 0; }

/* ---------- First-visit question ---------- */
.howfound { background: var(--surface-muted); border: 1px solid var(--border); border-radius: 14px; padding: 20px 18px 8px; margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 12px; }
.chip {
  min-height: 44px; padding: 10px 16px; border: 1.5px solid var(--border-strong, var(--border)); border-radius: 999px;
  background: var(--surface); font: inherit; font-size: 0.9rem; font-weight: 600; color: inherit; cursor: pointer;
}
.chip:hover, .chip:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.howfound-other { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 12px; }
.howfound-other input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 16px; }
.howfound .link-back { margin-top: 8px; }

/* ---------- Staff dashboard ---------- */

.dashboard-filter {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.dashboard-filter .field { max-width: 160px; margin-bottom: 0; }
.dashboard-filter input[type="date"],
.dashboard-filter select { padding: 10px 12px; }
.dashboard-filter .btn-primary { width: auto; padding: 10px 18px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.kpi-value { font-size: 1.8rem; font-weight: 800; margin: 4px 0 2px; color: var(--text); }
.kpi-sub { font-size: 0.78rem; color: var(--text-muted); }
.kpi-unavailable { color: var(--text-faint); font-style: italic; font-size: 0.9rem; }

.kpi-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-top: 6px;
}
.kpi-badge-up { background: var(--success-soft); color: var(--success-soft-text); }
.kpi-badge-down { background: var(--danger-soft); color: var(--danger-soft-text); }
.kpi-badge-flat { background: var(--surface); color: var(--text-faint); border: 1px solid var(--border); }

.dashboard-rewards-card { max-width: 640px; }

.dashboard-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.dashboard-table th, .dashboard-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.dashboard-table th {
  color: var(--text-faint);
  font-weight: 650;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pill-redeemed { background: var(--surface); color: var(--text-faint); border: 1px solid var(--border); }
.pill-active { background: var(--success-soft); color: var(--success-soft-text); }
.pill-redeemed, .pill-active {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 650;
}

.dashboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 12px;
  color: var(--text-muted);
  text-align: center;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: dashboard-spin 0.8s linear infinite;
}

@keyframes dashboard-spin {
  to { transform: rotate(360deg); }
}

.dashboard-loading .elapsed { font-size: 0.85rem; font-weight: 650; color: var(--text); }
.dashboard-loading .hint { font-size: 0.8rem; color: var(--text-faint); max-width: 320px; }
