:root {
  color-scheme: light;
  --bg: #f4efe8;
  --paper: #fffaf4;
  --card: #ffffff;
  --ink: #2c2825;
  --muted: #80766e;
  --orange: #ff8061;
  --orange-deep: #ef6f50;
  --orange-soft: #ffe8de;
  --olive: #7d873b;
  --olive-deep: #626b2e;
  --olive-soft: #edf0d8;
  --red: #a91f2c;
  --red-soft: #f6e1e2;
  --line: #e5ddd5;
  --black: #191817;
  --success: #58743e;
  --danger: #a91f2c;
  --shadow: 0 14px 36px rgba(79, 56, 36, .08);
  --shadow-soft: 0 8px 24px rgba(79, 56, 36, .06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 11% 4%, rgba(255,128,97,.11) 0 2px, transparent 2.5px),
    radial-gradient(circle at 74% 2%, rgba(125,135,59,.12) 0 1.5px, transparent 2px),
    radial-gradient(circle at 93% 18%, rgba(169,31,44,.08) 0 2px, transparent 2.5px),
    var(--bg);
  background-size: 84px 84px, 118px 118px, 146px 146px, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select {
  font: inherit;
}

button { -webkit-tap-highlight-color: transparent; }

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(30px + env(safe-area-inset-bottom));
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.orange { color: var(--orange-deep) !important; }
.olive { color: var(--olive-deep) !important; }
.red { color: var(--red) !important; }
.olive-text { color: var(--olive-deep) !important; }

.loading-screen {
  min-height: 70vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  text-align: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--orange-soft);
  border: 1px solid rgba(255,128,97,.22);
}

.brand-mark img {
  width: 34px;
  height: 38px;
  object-fit: contain;
  display: block;
}

.brand-mark-lg {
  width: 78px;
  height: 78px;
  border-radius: 25px;
  box-shadow: var(--shadow-soft);
}
.brand-mark-lg img { width: 50px; height: 56px; }

.loading-copy {
  display: grid;
  gap: 5px;
}
.loading-copy strong { font-size: 20px; letter-spacing: -.02em; }
.loading-copy span { color: var(--muted); font-size: 14px; }

.loader-dots { display: flex; gap: 6px; }
.loader-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  animation: dot 1.1s infinite ease-in-out;
}
.loader-dots i:nth-child(2) { animation-delay: .14s; }
.loader-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes dot {
  0%, 70%, 100% { transform: translateY(0); opacity: .35; }
  35% { transform: translateY(-5px); opacity: 1; }
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-name {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .065em;
}
.brand-subtitle {
  margin-top: 2px;
  font-size: 10px;
  color: var(--orange-deep);
  font-weight: 800;
  letter-spacing: .16em;
}

.member-chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.55);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.welcome-block { margin: 4px 2px 17px; }

.eyebrow,
.loyalty-label,
.micro-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  color: var(--muted);
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin: 5px 0 7px;
  font-size: clamp(30px, 8vw, 42px);
  line-height: .98;
  letter-spacing: -.045em;
}

h2 {
  margin: 4px 0 0;
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: -.025em;
}

h3 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.15;
}

.welcome-copy,
.page-intro p,
.action-card p,
.admin-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.loyalty-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 22px;
  border-radius: 30px;
  color: #fff8f1;
  background:
    radial-gradient(circle at 86% 13%, rgba(255,255,255,.18) 0 58px, transparent 59px),
    linear-gradient(135deg, var(--orange) 0%, #f27b5d 55%, #e96c4d 100%);
  box-shadow: 0 18px 34px rgba(222, 103, 73, .24);
}

.loyalty-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -45px auto;
  width: 145px;
  height: 145px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 45% 55% 52% 48%;
  transform: rotate(-18deg);
}

.loyalty-card-top,
.loyalty-card-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.loyalty-card-bottom {
  align-items: flex-end;
  margin-top: 30px;
}
.loyalty-label,
.loyalty-card .micro-label { color: rgba(255,255,255,.75); }

.points-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 4px;
}
.points {
  font-size: clamp(46px, 13vw, 64px);
  font-weight: 900;
  letter-spacing: -.055em;
  line-height: .95;
}
.points-unit {
  font-size: 14px;
  font-weight: 700;
  opacity: .86;
}

.mini-b {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: rgba(255,250,244,.96);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.mini-b img { width: 40px; height: 46px; object-fit: contain; }

.card-number,
.earn-rate { font-size: 14px; font-weight: 800; margin-top: 3px; }
.earn-rate { text-align: right; }

.tabs {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px;
  margin: 0 -2px 22px;
  border: 1px solid rgba(229,221,213,.86);
  border-radius: 22px;
  background: rgba(255,250,244,.88);
  box-shadow: 0 8px 24px rgba(79,56,36,.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.tabs::-webkit-scrollbar { display: none; }

.tabs button {
  min-width: 78px;
  flex: 1 0 auto;
  display: grid;
  justify-items: center;
  gap: 3px;
  border: 0;
  border-radius: 15px;
  padding: 9px 10px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: .18s ease;
}
.tabs button.active {
  background: var(--orange-soft);
  color: var(--orange-deep);
}
.tab-icon { font-size: 17px; line-height: 1; }

.tab-panel { animation: reveal .18s ease-out; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 2px 12px;
}
.compact-title { margin-top: 22px; }

.text-button {
  border: 0;
  background: transparent;
  color: var(--orange-deep);
  padding: 8px 0;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-soft);
}

.qr-card {
  display: grid;
  grid-template-columns: minmax(158px, 202px) 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.qr-shell,
.reward-qr-shell {
  position: relative;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #eee7df;
}
.qr-shell::before,
.qr-shell::after,
.reward-qr-shell::before,
.reward-qr-shell::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--orange);
  border-style: solid;
}
.qr-shell::before,
.reward-qr-shell::before {
  top: 7px; left: 7px;
  border-width: 2px 0 0 2px;
  border-radius: 7px 0 0 0;
}
.qr-shell::after,
.reward-qr-shell::after {
  right: 7px; bottom: 7px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 7px 0;
}
.qr-card canvas,
dialog canvas {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  background: white;
}

.qr-copy {
  display: grid;
  gap: 7px;
  align-content: center;
}
.qr-copy strong { font-size: 16px; line-height: 1.2; }

.pass-home-card { padding: 18px; }
.empty-state {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
}
.empty-state .button { grid-column: 1 / -1; }
.empty-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: var(--olive-soft);
  color: var(--olive-deep);
  font-size: 20px;
}
.empty-state p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.active-pass-card {
  display: grid;
  gap: 14px;
}
.active-pass-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.active-pass-title { font-weight: 900; font-size: 19px; }
.active-pass-count { color: var(--olive-deep); font-weight: 900; font-size: 14px; }
.progress-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe8d9;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--olive), #a8b45a);
  transition: width .3s ease;
}
.active-pass-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.promo-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0;
  padding: 19px;
  border-radius: 24px;
  color: #fff8f4;
  background:
    radial-gradient(circle at 80% 10%, rgba(255,255,255,.09) 0 44px, transparent 45px),
    var(--red);
  box-shadow: 0 12px 26px rgba(129, 20, 34, .16);
}
.promo-copy { display: grid; gap: 4px; }
.promo-copy strong { font-size: 17px; line-height: 1.15; }
.promo-copy small { opacity: .76; line-height: 1.35; }
.promo-kicker { font-size: 10px; font-weight: 900; letter-spacing: .13em; opacity: .72; }
.round-arrow {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff8f4;
  color: var(--red);
  font-size: 22px;
  cursor: pointer;
}

.profile-card { overflow: hidden; margin-top: 18px; }
.profile-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px;
  cursor: pointer;
}
.profile-card summary::-webkit-details-marker { display: none; }
.profile-card summary > span:first-child { display: grid; gap: 5px; }
.summary-arrow { font-size: 20px; color: var(--muted); transition: transform .18s ease; }
.profile-card[open] .summary-arrow { transform: rotate(180deg); }
.profile-fields { padding: 0 18px 18px; }

label {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fbf8f4;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(255,128,97,.75);
  box-shadow: 0 0 0 3px rgba(255,128,97,.12);
}
.date-input-wrap {
  display: flex;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 13px;
  background: #fbf8f4;
}
.date-input-wrap input {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--orange);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(239,111,80,.18);
  transition: transform .12s ease, opacity .12s ease, background .12s ease;
}
.button:active { transform: scale(.985); }
.button:disabled { opacity: .42; cursor: default; box-shadow: none; }
.button-olive { background: var(--olive); box-shadow: 0 8px 18px rgba(98,107,46,.16); }
.button-red { background: var(--red); box-shadow: 0 8px 18px rgba(169,31,44,.16); }
.button-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.form-result { min-height: 16px; margin-top: 8px; }

.page-intro {
  margin: 4px 2px 18px;
  max-width: 540px;
}
.page-intro h2 {
  margin: 5px 0 8px;
  font-size: 28px;
}
.pass-intro {
  padding: 20px;
  border-radius: 24px;
  background: var(--olive-soft);
}
.staff-intro {
  padding: 20px;
  border-radius: 24px;
  background: var(--orange-soft);
}
.admin-intro {
  padding: 20px;
  border-radius: 24px;
  background: var(--red-soft);
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reward-item {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow: hidden;
  position: relative;
}
.reward-item::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -22px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--orange-soft);
  z-index: 0;
}
.reward-item > * { position: relative; z-index: 1; }
.reward-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--orange-soft);
  font-size: 23px;
}
.reward-item h3 { margin: 2px 0 0; }
.reward-description {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.reward-cost {
  font-size: 17px;
  font-weight: 900;
  color: var(--orange-deep);
}
.reward-stock { font-size: 11px; color: var(--muted); }
.reward-item .button { width: 100%; }

.plans-stack { display: grid; gap: 12px; }

.plan-card {
  padding: 19px;
  display: grid;
  gap: 16px;
}
.plan-card.featured {
  border-color: rgba(125,135,59,.36);
  background:
    radial-gradient(circle at 90% 8%, rgba(125,135,59,.13) 0 55px, transparent 56px),
    #fff;
}
.plan-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.plan-title { font-size: 21px; font-weight: 900; letter-spacing: -.025em; }
.plan-price { text-align: right; font-weight: 900; white-space: nowrap; }
.plan-price small { display: block; font-weight: 700; color: var(--muted); font-size: 10px; }
.plan-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.plan-fact {
  padding: 11px;
  border-radius: 14px;
  background: #f8f5ef;
}
.plan-fact span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; margin-bottom: 3px; }
.plan-fact strong { font-size: 13px; }
.plan-description { color: var(--muted); font-size: 13px; line-height: 1.45; }
.plan-card .button { width: 100%; }

.history-list { display: grid; gap: 9px; }

.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
}
.history-dot {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-size: 17px;
}
.history-dot.minus { background: var(--red-soft); color: var(--red); }
.history-title { font-weight: 800; font-size: 14px; }
.history-date { margin-top: 3px; color: var(--muted); font-size: 11px; }
.history-value { font-size: 15px; font-weight: 900; }
.positive { color: var(--success); }
.negative { color: var(--danger); }

.staff-grid, .admin-grid { display: grid; gap: 12px; }

.action-card, .admin-card { padding: 18px; }
.action-card {
  position: relative;
  overflow: hidden;
}
.action-number {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 34px;
  font-weight: 900;
  color: rgba(255,128,97,.14);
}
.action-card-olive .action-number { color: rgba(125,135,59,.18); }
.action-card-red .action-number { color: rgba(169,31,44,.14); }
.action-card > .button { width: 100%; margin-top: 11px; }

.customer-result {
  margin-top: 12px;
  padding: 13px;
  border-radius: 14px;
  background: #f8f5ef;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.45;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.metric {
  min-height: 105px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.metric span { color: var(--muted); font-size: 11px; font-weight: 800; }
.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
  letter-spacing: -.035em;
}

.admin-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}
.admin-icon {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--orange-soft);
  color: var(--orange-deep);
  font-size: 18px;
}
.admin-card-olive .admin-icon { background: var(--olive-soft); color: var(--olive-deep); }
.admin-card .button { width: 100%; margin-top: 4px; }

.admin-list {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}
.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px dashed var(--line);
}
.admin-list-item:first-child { border-top: 0; }
.admin-list-main { min-width: 0; }
.admin-list-main strong { font-size: 13px; }
.admin-list-meta { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.small-action {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.fatal-card {
  margin-top: 18vh;
  border: 1px solid rgba(169,31,44,.22);
  border-radius: 22px;
  padding: 18px;
  color: var(--danger);
  background: var(--red-soft);
  font-weight: 800;
  line-height: 1.45;
}

dialog {
  width: min(92vw, 390px);
  border: 0;
  padding: 0;
  border-radius: 28px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(44,40,37,.24);
}
dialog::backdrop {
  background: rgba(44,40,37,.48);
  backdrop-filter: blur(3px);
}
.dialog-content {
  position: relative;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 24px 22px 22px;
  text-align: center;
}
.dialog-content h2 { font-size: 25px; }
.dialog-content p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.dialog-close {
  position: absolute;
  top: 11px;
  right: 11px;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eee7df;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
}
.reward-dialog-badge {
  margin-top: 5px;
  color: var(--orange-deep);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}
.reward-qr-shell { width: 224px; max-width: 100%; }

.qr-fallback {
  width: 100%;
  font-size: 10px;
  word-break: break-all;
}

@media (min-width: 640px) {
  .shell { padding-left: 22px; padding-right: 22px; }
  .staff-grid, .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .reward-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .shell { padding-left: 13px; padding-right: 13px; }
  .qr-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .qr-shell { width: min(100%, 210px); margin: 0 auto; }
  .qr-copy { justify-items: center; }
  .reward-item { min-height: 220px; }
  .plan-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-fact { padding: 9px 7px; }
}

@media (max-width: 360px) {
  .reward-grid { grid-template-columns: 1fr; }
  .reward-item { min-height: 0; }
  .loyalty-card { padding: 19px; }
  .mini-b { width: 56px; height: 56px; }
}
