:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #2d2118;
  background: #f5efe6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #2d2118;
  --muted: #7e6e60;
  --gold: #a47a34;
  --gold-dark: #805d25;
  --cream: #fbf8f2;
  --line: #e7d9c8;
  --green: #46755a;
  --red: #9f4f4b;
  --shadow: 0 22px 60px rgba(80, 57, 30, .10);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #f5efe6; }
body { margin: 0; min-width: 320px; min-height: 100vh; background:
  radial-gradient(circle at 10% 0%, rgba(255,255,255,.98), transparent 34%),
  linear-gradient(140deg, #f8f2e9 0%, #efe6da 100%); }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.page-shell { min-height: 100vh; }
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  border-bottom: 1px solid rgba(164,122,52,.18);
  background: rgba(253,250,245,.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar nav { display: flex; gap: 24px; font-size: 14px; }
.topbar nav a:hover { color: var(--gold-dark); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-emblem {
  width: 38px; height: 38px; border: 1px solid #d7b979; border-radius: 50%;
  display: grid; place-items: center; color: var(--gold); font-size: 17px;
}
.brand-title { font-family: Georgia, "Times New Roman", serif; letter-spacing: .12em; font-size: 19px; }
.brand-sub { font-size: 8px; letter-spacing: .31em; color: #8d7c6d; margin-top: 4px; }
.brand.compact .brand-title { font-size: 17px; }
.brand.compact .brand-sub { font-size: 7px; }
.brand.compact .brand-emblem { width: 34px; height: 34px; }

.card {
  background: rgba(255,253,249,.88);
  border: 1px solid rgba(196,166,124,.34);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.eyebrow { color: var(--gold-dark); font-weight: 800; letter-spacing: .22em; font-size: 11px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; margin: 0; color: #2f231a; }
h1 { font-size: clamp(42px, 5vw, 74px); line-height: 1.03; }
h2 { font-size: 30px; }
p { line-height: 1.6; }
.muted { color: var(--muted); }

.reception-page {
  width: min(1420px, 94vw);
  margin: 28px auto 54px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .9fr);
  gap: 24px;
  align-items: start;
}
.reception-primary { padding: 54px 58px 40px; min-height: calc(100vh - 140px); text-align: center; display: flex; flex-direction: column; align-items: center; }
.reception-primary h1 { margin-top: 12px; }
.hero-copy { max-width: 760px; color: #6f5f53; font-size: 18px; margin: 22px auto 26px; }
.qr-stage {
  padding: 14px;
  background: white;
  border-radius: 24px;
  border: 1px solid #eadbc9;
  box-shadow: 0 18px 42px rgba(83,60,31,.12);
  animation: qrIn .35s ease-out;
}
@keyframes qrIn { from { transform: scale(.96); opacity: .4 } to { transform: scale(1); opacity: 1 } }
.qr-caption { display: grid; gap: 5px; margin-top: 18px; color: var(--muted); font-size: 13px; max-width: 600px; }
.qr-caption strong { color: var(--gold-dark); letter-spacing: .14em; font-size: 11px; }
.quota-row { width: min(650px, 100%); display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 30px; }
.quota-row div { background: #f7f0e6; border: 1px solid #eadcc9; padding: 13px 16px; border-radius: 16px; display: grid; gap: 3px; }
.quota-row span { color: var(--muted); font-size: 12px; }
.quota-row strong { font-family: Georgia, serif; font-size: 24px; }
.progress-track { width: min(650px,100%); height: 7px; background: #ebdfd0; border-radius: 20px; margin-top: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #c7a160, #8f692d); transition: width .35s ease; }
.network-note { margin-top: 13px; font-size: 12px; color: #8a796b; }
.sold-out-panel { width: min(520px,100%); padding: 40px 25px; background: #faf5ec; border: 1px dashed #d7bd92; border-radius: 24px; margin-top: 28px; }
.sold-icon, .status-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 24px; background: #e7f1e9; color: var(--green); }
.status-icon.bad { background: #f4dfdd; color: var(--red); }

.reception-side { display: grid; gap: 24px; }
.poster-card { padding: 14px; }
.poster-card .eyebrow { padding: 3px 2px 10px; }
.poster-card img { display: block; width: 100%; max-height: 720px; object-fit: cover; object-position: top; border-radius: 18px; }
.recent-card { padding: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-heading h2 { font-size: 26px; margin-top: 3px; }
.recent-list, .table-list, .search-results { display: grid; gap: 10px; }
.recent-item { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 15px; background: #faf6f0; border: 1px solid #ede2d4; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: #ede0cb; color: #87662e; font-weight: 800; }
.recent-copy { min-width: 0; flex: 1; display: grid; }
.recent-copy strong { font-size: 14px; }
.recent-copy span { font-size: 11px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pill { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 7px 10px; font-size: 10px; letter-spacing: .08em; font-weight: 800; background: #eee2cd; color: #805d25; white-space: nowrap; }
.pill.green { background: #e6f0e8; color: #376448; }
.pill.gray { background: #ece9e5; color: #716a62; }
.empty-state { color: var(--muted); font-size: 13px; text-align: center; padding: 22px 10px; }

.mobile-page, .voucher-page, .center-page {
  min-height: 100vh;
  padding: 28px 18px 48px;
  display: grid;
  place-items: start center;
}
.mobile-brand { width: min(680px, 100%); margin-bottom: 16px; padding: 0 4px; }
.claim-form { width: min(680px,100%); padding: 30px; }
.claim-form h1 { font-size: 43px; margin: 8px 0 8px; }
.offer-grid-mobile { display: grid; gap: 11px; margin: 24px 0 28px; }
.offer-card, .redeem-row {
  width: 100%; border: 1px solid #e6d8c6; background: #fcfaf6; border-radius: 17px; padding: 15px;
  display: flex; align-items: center; gap: 13px; text-align: left; color: var(--ink); transition: .18s ease;
}
.offer-card:hover, .redeem-row:hover { border-color: #c9a66d; transform: translateY(-1px); }
.offer-card.selected, .redeem-row.selected { background: #f3eadc; border-color: #ba8e4c; box-shadow: inset 0 0 0 1px rgba(164,122,52,.18); }
.offer-check { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; border: 1px solid #ccb997; display: grid; place-items: center; background: #fff; color: var(--gold-dark); font-weight: 900; }
.selected .offer-check { background: #a47a34; color: white; border-color: #a47a34; }
.offer-card-copy, .redeem-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
.offer-card-copy strong, .redeem-copy strong { font-size: 15px; }
.offer-card-copy span, .redeem-copy span { font-family: Georgia, serif; color: #8a652d; font-size: 18px; }
.redeem-copy small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.form-section-title { font-family: Georgia, serif; font-size: 22px; margin: 8px 0 14px; }
label { display: grid; gap: 7px; font-weight: 700; font-size: 13px; color: #514235; margin-bottom: 14px; }
.optional { font-weight: 500; color: #968678; font-size: 11px; margin-left: 4px; }
input {
  width: 100%; border: 1px solid #decfbd; background: rgba(255,255,255,.88); border-radius: 13px; padding: 14px 15px; color: #2d2118; outline: none;
}
input:focus { border-color: #b68d51; box-shadow: 0 0 0 3px rgba(164,122,52,.10); }
.primary-btn, .secondary-btn, .ghost-btn, .danger-btn {
  border: 0; border-radius: 13px; padding: 13px 18px; font-weight: 800; letter-spacing: .05em;
}
.primary-btn { color: white; background: linear-gradient(135deg, #9c742f, #b58d49); box-shadow: 0 10px 24px rgba(139,100,39,.20); }
.primary-btn:hover { filter: brightness(.97); transform: translateY(-1px); }
.primary-btn:disabled { opacity: .55; cursor: default; transform: none; }
.primary-btn.large { min-height: 52px; }
.full { width: 100%; }
.secondary-btn { color: #7d5d29; background: #f4eadb; border: 1px solid #ddc6a3; }
.ghost-btn { background: transparent; border: 1px solid #d9c8b4; color: #655444; }
.danger-btn { background: #f5e1df; border: 1px solid #e2b8b4; color: #8e4540; }
.micro-copy { color: #8b7b6e; text-align: center; font-size: 11px; margin: 12px 0 0; }
.alert { padding: 12px 14px; border-radius: 13px; font-size: 13px; margin: 12px 0; }
.error-alert { color: #8b3f3b; background: #f5e1df; border: 1px solid #ebc8c4; }
.success-alert { color: #356345; background: #e8f1e9; border: 1px solid #cce1d1; }
.neutral-alert { color: #6b5b4d; background: #f3ede5; border: 1px solid #e4d7c9; }

.center-page { place-items: center; }
.center-card, .login-card { width: min(520px,100%); padding: 34px; text-align: center; }
.center-card .brand, .login-card .brand { justify-content: center; margin-bottom: 26px; }
.center-card h1, .login-card h1 { font-size: 40px; margin: 10px 0; }
.center-card h2 { margin-top: 12px; }
.login-card { text-align: left; }
.login-card .brand { justify-content: flex-start; }
.login-card .eyebrow { margin-top: 22px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #eadbc8; border-top-color: #9d7534; animation: spin .8s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.voucher-page { background: radial-gradient(circle at 50% 0, rgba(255,255,255,.98), transparent 30%), linear-gradient(155deg,#f8f2e9,#ece0d0); }
.digital-voucher { width: min(620px,100%); padding: 28px; overflow: hidden; position: relative; }
.digital-voucher .brand { justify-content: center; }
.voucher-ribbon { margin: 24px -28px 0; text-align: center; padding: 10px; background: linear-gradient(90deg,#9a722f,#c19b5a,#96702f); color: white; font-size: 10px; font-weight: 900; letter-spacing: .2em; }
.voucher-customer { text-align: center; color: var(--muted); margin-top: 22px; }
.digital-voucher h1 { text-align: center; font-size: 38px; margin: 6px 0 14px; letter-spacing: .04em; }
.personal-qr { width: max-content; margin: 0 auto; padding: 8px; border: 1px solid #e1d1bb; background: white; border-radius: 20px; }
.scan-note { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0 22px; }
.voucher-offers { display: grid; gap: 9px; }
.voucher-offer-row { border: 1px solid #e8dccd; background: #fcf9f4; border-radius: 15px; padding: 14px; display: flex; align-items: center; gap: 12px; }
.voucher-offer-row > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
.voucher-offer-row strong { font-size: 14px; }
.voucher-offer-row span { color: #87632c; font-family: Georgia,serif; }
.voucher-offer-row.used { opacity: .68; }
.voucher-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin: 18px 0; }
.voucher-meta div { padding: 12px; background: #f5eee4; border-radius: 13px; display: grid; gap: 4px; }
.voucher-meta span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.voucher-meta strong { font-size: 12px; overflow-wrap: anywhere; }

.staff-page { width: min(1450px,94vw); margin: 28px auto 60px; }
.staff-welcome { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.staff-welcome h1 { font-size: 45px; margin-top: 6px; }
.staff-welcome p { margin: 5px 0 0; color: var(--muted); }
.staff-tabs { display: inline-flex; padding: 5px; background: rgba(255,253,249,.86); border: 1px solid #e3d4c2; border-radius: 14px; margin-bottom: 20px; gap: 4px; }
.staff-tabs button { border: 0; background: transparent; color: #706052; border-radius: 10px; padding: 10px 15px; font-weight: 700; }
.staff-tabs button.active { background: #efe3d1; color: #7c5b26; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.stat-card { padding: 22px; display: grid; gap: 4px; }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { font-family: Georgia,serif; font-size: 42px; font-weight: 500; }
.stat-card small { color: #918173; }
.staff-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.panel { padding: 24px; }
.offer-stats { display: grid; gap: 10px; }
.offer-stat-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px; border: 1px solid #e8ddd0; border-radius: 14px; background: #fcf9f4; }
.offer-stat-row > div:first-child { display: grid; gap: 3px; }
.offer-stat-row > div:first-child span { color: #8b682e; font-family: Georgia,serif; }
.offer-stat-row > div:last-child { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.table-list button, .search-results button { border: 1px solid #e8ddd0; background: #fcf9f4; border-radius: 13px; padding: 12px; color: var(--ink); display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; }
.table-list button:hover, .search-results button:hover, .search-results button.active { border-color: #c9a66d; background: #f7efe3; }
.table-list button > div, .search-results button > div { flex: 1; min-width: 0; display: grid; gap: 3px; }
.table-list button span:not(.pill), .search-results button span:not(.pill) { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voucher-workspace { display: grid; grid-template-columns: minmax(300px,.8fr) minmax(480px,1.2fr); gap: 18px; align-items: start; }
.search-panel, .detail-panel, .settings-card { padding: 24px; }
.search-panel h2, .settings-card h2 { margin: 4px 0 18px; }
.search-row { display: flex; gap: 9px; }
.search-row input { flex: 1; }
.search-results { margin-top: 14px; max-height: 620px; overflow: auto; }
.detail-panel { min-height: 510px; }
.empty-large { min-height: 440px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.voucher-detail-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.voucher-detail-head h2 { margin-top: 4px; font-size: 34px; }
.customer-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin: 20px 0 24px; }
.customer-grid div { background: #f8f2ea; border-radius: 13px; padding: 12px; display: grid; gap: 3px; }
.customer-grid span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.customer-grid strong { font-size: 13px; overflow-wrap: anywhere; }
.redeem-list { display: grid; gap: 10px; margin-bottom: 18px; }
.redeem-row.redeemed { opacity: .68; cursor: default; }
.redeem-row.redeemed .offer-check { background: #e6ece7; color: #477259; }
.settings-grid { display: grid; grid-template-columns: minmax(420px,1fr) minmax(300px,.65fr); gap: 18px; align-items: start; }
.switch-row { display: flex; align-items: center; gap: 11px; background: #f7f1e8; border: 1px solid #e3d6c5; padding: 14px; border-radius: 14px; }
.switch-row input { width: 20px; height: 20px; flex: 0 0 auto; }
.switch-row span { display: grid; gap: 2px; }
.switch-row small { color: var(--muted); font-weight: 500; }
.danger-zone p { color: var(--muted); }

@media (max-width: 1020px) {
  .reception-page { grid-template-columns: 1fr; }
  .reception-primary { min-height: auto; }
  .reception-side { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .staff-two-col, .voucher-workspace, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { height: auto; min-height: 68px; padding: 12px 16px; }
  .topbar nav { gap: 12px; font-size: 12px; }
  .brand-title { font-size: 15px; }
  .brand-sub { display: none; }
  .brand-emblem { width: 32px; height: 32px; }
  .reception-page { width: calc(100% - 20px); margin-top: 10px; }
  .reception-primary { padding: 30px 16px 24px; }
  .reception-primary h1 { font-size: 44px; }
  .hero-copy { font-size: 15px; }
  .qr-stage svg { width: 240px; height: 240px; }
  .quota-row { gap: 6px; }
  .quota-row div { padding: 10px 7px; }
  .reception-side { grid-template-columns: 1fr; }
  .poster-card { display: none; }
  .claim-form, .digital-voucher, .center-card, .login-card { padding: 22px 18px; border-radius: 20px; }
  .claim-form h1 { font-size: 38px; }
  .voucher-meta { grid-template-columns: 1fr; }
  .staff-page { width: calc(100% - 20px); margin-top: 16px; }
  .staff-welcome { align-items: center; }
  .staff-welcome h1 { font-size: 34px; }
  .staff-tabs { display: flex; width: 100%; overflow-x: auto; }
  .staff-tabs button { flex: 1 0 auto; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 16px; }
  .stat-card strong { font-size: 34px; }
  .offer-stat-row { align-items: flex-start; flex-direction: column; }
  .voucher-workspace { display: block; }
  .detail-panel { margin-top: 12px; }
  .customer-grid { grid-template-columns: 1fr; }
  .search-row { flex-direction: column; }
}

@media print {
  body { background: white; }
  .digital-voucher { box-shadow: none; border: 1px solid #d9c8b4; }
  .digital-voucher .secondary-btn, .digital-voucher .micro-copy { display: none; }
}
