:root {
  --bg: #FBF7F1;
  --surface: #FFFFFF;
  --ink: #2E2520;
  --muted: #7B6E65;
  --line: #EAE0D4;
  --brand: #6E4A33;
  --brand-ink: #FFFFFF;
  --sky: #7FA3C4;
  --sky-soft: #E6EEF5;
  --ok: #3F7D58;
  --ok-soft: #E3F0E7;
  --warn: #B4532F;
  --warn-soft: #FBE9E1;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(46, 37, 32, .06), 0 6px 20px rgba(46, 37, 32, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .serif { font-family: "Lora", Georgia, serif; font-weight: 600; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
textarea, input { font: inherit; color: inherit; }
svg { display: block; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); font-weight: 600;
  transition: transform .12s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ok { background: var(--ok); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  border: 1.5px solid var(--line); background: var(--surface);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 46px; height: 32px; }
.brand-name { font-family: "Lora", serif; font-weight: 600; font-size: 21px; line-height: 1; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100;
  max-width: calc(100vw - 32px); display: flex; gap: 8px; align-items: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--warn); }
a.btn, a.icon-btn { color: inherit; text-decoration: none; }
a.btn:not(.ghost) { color: var(--brand-ink); }

/* Staff sign-in gate (quầy, in QR) */
.gate-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 380px; text-align: center; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 32px 24px 28px; }
.gate-card .brand { justify-content: center; margin-bottom: 22px; }
.gate-card h1 { font-size: 22px; margin: 0 0 8px; }
.gate-p { color: var(--muted); margin: 0 0 22px; }
.gate-p b { color: var(--ink); word-break: break-all; }
.gbtn { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 999px; background: #fff; border: 1.5px solid #DADCE0; color: #1F1F1F; font-weight: 600; font-size: 16px; transition: background .15s; }
.gbtn:hover { background: #F8F9FA; }
.gbtn:active { transform: scale(.98); }
.gate-wide { width: 100%; }
.gate-err { display: flex; gap: 8px; align-items: flex-start; text-align: left; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.gate-err svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.gate-badge { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; }
.who { font-size: 13px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .who { display: none; } }
