/* Fries Vietnam — App thành viên · v2
   Bố cục: một cột kiểu app điện thoại (tối đa 480px), dải vàng thương hiệu ở đầu trang chủ,
   thẻ thành viên đen nổi lên trên, thanh điều hướng dưới có nút QR nổi ở giữa. */
:root {
  --yellow: #F2C14E;
  --yellow-2: #FFD565;
  --yellow-soft: #FFF3D1;
  --red: #D63B2F;
  --red-2: #B52D22;
  --red-soft: #FDE8E5;
  --ink: #1A1A1A;
  --ink-2: #5C554C;
  --ink-3: #958C80;
  --bg: #F6F3EE;
  --surface: #FFFFFF;
  --line: #ECE5D9;
  --line-2: #F3EEE6;
  --green: #1F8A55;
  --green-soft: #E2F4EA;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(26,26,26,.05), 0 2px 8px rgba(26,26,26,.04);
  --shadow-2: 0 10px 30px rgba(26,26,26,.16);
  --font: "Be Vietnam Pro", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Baloo 2", "Be Vietnam Pro", -apple-system, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: #E9E3D8; color: var(--ink); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--red); }
:focus-visible { outline: 3px solid rgba(214,59,47,.45); outline-offset: 2px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); position: relative; overflow-x: hidden; }
@media (min-width: 520px) { #app { box-shadow: 0 0 60px rgba(0,0,0,.10); } }

/* ---------- Thanh trên ---------- */
.demo-bar { background: var(--ink); color: var(--yellow); text-align: center; font-size: 12px; font-weight: 600; padding: 6px 12px; padding-top: calc(var(--safe-top) + 6px); }
.demo-bar button { background: none; border: 0; color: #fff; text-decoration: underline; font-weight: 700; padding: 0 0 0 6px; }
.appbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  padding: calc(var(--safe-top) + 10px) 16px 10px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line);
}
.has-demo .appbar { padding-top: 10px; }
.appbar .logo { height: 30px; width: auto; display: block; }
.appbar h1 { font-size: 17px; font-weight: 800; margin: 0; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.appbar .side { min-width: 64px; flex: 0 0 auto; display: flex; }
.appbar .side.r { justify-content: flex-end; }
.chip-pts { display: inline-flex; align-items: center; gap: 4px; background: var(--yellow-soft); color: var(--ink); border-radius: 99px; padding: 5px 10px; font-weight: 800; font-size: 13px; white-space: nowrap; }
.chip-role { white-space: nowrap; background: var(--ink); color: var(--yellow); border-radius: 99px; padding: 5px 10px; font-weight: 700; font-size: 12px; }

main.page { padding: 16px 16px calc(110px + var(--safe-bottom)); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.section-h h2 { font-size: 17px; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.section-h a, .section-h button { font-size: 13px; font-weight: 700; color: var(--red); background: none; border: 0; padding: 0; text-decoration: none; }
.lead { color: var(--ink-2); font-size: 14px; margin: 0 2px 14px; }

/* ---------- Trang chủ: dải vàng ---------- */
.hero { background: var(--yellow); margin: -16px -16px 0; padding: calc(var(--safe-top) + 12px) 16px 86px; position: relative; overflow: hidden; }
.has-demo .hero { padding-top: 12px; }
.hero::after { content: ""; position: absolute; right: -70px; top: -90px; width: 230px; height: 230px; border-radius: 50%; background: var(--yellow-2); }
.hero > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-top .logo { height: 40px; width: auto; display: block; }
.hero .hello { margin-top: 14px; font-size: 14px; color: #5A4310; font-weight: 600; }
.hero .name { font-family: var(--display); font-size: 28px; line-height: 1.1; font-weight: 800; color: var(--ink); margin-top: 2px; text-wrap: balance; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.55); display: grid; place-items: center; color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

.mcard {
  margin-top: -70px; position: relative; z-index: 2; background: var(--ink); color: #fff; border-radius: 22px; padding: 18px 18px 16px;
  box-shadow: var(--shadow-2); overflow: hidden;
}
.mcard::before { content: ""; position: absolute; inset: auto -40px -70px auto; width: 190px; height: 190px; border-radius: 50%; background: rgba(242,193,78,.13); }
.mcard > * { position: relative; }
.mcard-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tier { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 11px 4px 6px; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.1); color: #fff; }
.tier i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.mcard .code { font-size: 12px; letter-spacing: 1.6px; color: #A9A196; font-weight: 700; }
.pts-row { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 14px; gap: 12px; }
.pts b { font-family: var(--display); font-size: 48px; line-height: .9; font-weight: 800; color: var(--yellow); letter-spacing: -1px; display: block; }
.pts span { font-size: 13px; color: #CFC6B8; font-weight: 600; }
.qr-mini { border: 0; background: #fff; color: var(--ink); border-radius: 14px; padding: 8px 12px 8px 8px; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; }
.qr-mini svg { width: 30px; height: 30px; }
.bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; margin-top: 16px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), #FFE08A); border-radius: 99px; }
.bar-lbl { font-size: 12px; color: #CFC6B8; margin-top: 7px; }
.bar-lbl b { color: #fff; }

/* ---------- Ô chức năng ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; }
.tile { background: var(--surface); border: 0; border-radius: 16px; padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; box-shadow: var(--shadow-1); position: relative; min-height: 86px; }
.tile .ti { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--yellow-soft); color: var(--red); }
.tile .ti svg { width: 22px; height: 22px; }
.tile .ti.red { background: var(--red-soft); color: var(--red); }
.tile .ti.dark { background: var(--ink); color: var(--yellow); }
.tile .badge { position: absolute; top: 6px; right: 8px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 99px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; }
.tile .dot { position: absolute; top: 9px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; }

/* ---------- Thẻ chung ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-1); }
.card + .card { margin-top: 12px; }
.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.card .sub { color: var(--ink-2); font-size: 13px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mt-s { margin-top: 8px; }

/* ---------- Check-in: dải tem ---------- */
.ck-card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-1); border: 0; width: 100%; text-align: left; display: block; }
.ck-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ck-head .t { font-weight: 800; font-size: 16px; }
.ck-head .s { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.ck-count { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; color: var(--red); white-space: nowrap; }
.ck-count small { font-size: 14px; color: var(--ink-3); }
.stamps { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 6px; margin-top: 14px; }
.stamp { aspect-ratio: 1; max-width: 100%; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; border: 2px dashed #DCD2C1; color: var(--ink-3); background: var(--bg); }
.stamp.done { border: 0; background: var(--yellow); color: var(--ink); }
.stamp.done svg { width: 55%; height: 55%; }
.stamp.next { border: 2px solid var(--red); color: var(--red); background: var(--red-soft); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(214,59,47,.35); } 50% { box-shadow: 0 0 0 6px rgba(214,59,47,0); } }
.ck-next { margin-top: 12px; display: flex; gap: 10px; align-items: center; background: var(--yellow-soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.ck-next b { font-weight: 800; }
.ck-next svg { width: 20px; height: 20px; color: var(--red); flex: 0 0 20px; }

.timeline { position: relative; margin-top: 6px; }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 14px; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 21px; top: 46px; bottom: 2px; width: 2px; background: var(--line); }
.tl-item.done:not(:last-child)::before { background: var(--yellow); }
.tl-dot { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 44px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 18px; background: var(--surface); border: 2px dashed #DCD2C1; color: var(--ink-3); z-index: 1; }
.tl-item.done .tl-dot { background: var(--yellow); border: 0; color: var(--ink); }
.tl-item.done .tl-dot svg { width: 22px; height: 22px; }
.tl-item.next .tl-dot { border: 2px solid var(--red); background: var(--red-soft); color: var(--red); animation: pulse 1.8s ease-in-out infinite; }
.tl-body { flex: 1; min-width: 0; background: var(--surface); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-1); border: 0; text-align: left; width: 100%; }
.tl-item.locked .tl-body { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); }
.tl-body .k { font-size: 11.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); }
.tl-item.next .tl-body .k { color: var(--red); }
.tl-body .t { font-weight: 800; font-size: 15px; margin-top: 1px; }
.tl-body .d { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.tl-body .f { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px;
  padding: 13px 18px; font-weight: 800; font-size: 15px; background: var(--red); color: #fff; min-height: 52px;
  text-decoration: none; transition: transform .08s ease, background .15s; letter-spacing: -.1px;
}
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--red-2); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.block { width: 100%; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.yellow:hover { background: var(--yellow-2); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--line-2); }
.btn.small { min-height: 38px; padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.btn svg { width: 20px; height: 20px; flex: 0 0 20px; }
.linklike { background: none; border: 0; color: var(--red); font-weight: 700; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Tag ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--yellow-soft); color: #7A5600; white-space: nowrap; }
.tag.red { background: var(--red-soft); color: var(--red-2); }
.tag.green { background: var(--green-soft); color: #176B41; }
.tag.grey { background: #EFEAE2; color: var(--ink-2); }
.tag.dark { background: var(--ink); color: var(--yellow); }

/* ---------- Khuyến mãi ---------- */
.promos { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
.promos::-webkit-scrollbar { display: none; }
.promo { flex: 0 0 84%; scroll-snap-align: start; border-radius: var(--radius); overflow: hidden; background: var(--ink); color: #fff; text-decoration: none; display: flex; flex-direction: column; min-height: 132px; position: relative; }
.promo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.promo .pb { padding: 16px; position: relative; flex: 1; }
.promo .pk { font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--yellow); }
.promo h4 { margin: 4px 0 4px; font-size: 17px; font-weight: 800; line-height: 1.25; }
.promo p { margin: 0; font-size: 13px; color: #D8D0C3; }
.promo:nth-child(3n+2) { background: var(--red); }
.promo:nth-child(3n+2) .pk { color: #FFE3A3; }
.promo:nth-child(3n+2) p { color: #FFE1DD; }
.promo:nth-child(3n+3) { background: var(--yellow); color: var(--ink); }
.promo:nth-child(3n+3) .pk { color: var(--red); }
.promo:nth-child(3n+3) p { color: #5A4310; }

/* ---------- Danh sách ---------- */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--line-2); background: none; width: 100%; text-align: left; text-decoration: none; color: inherit; min-height: 60px; }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 700; }
.item .s { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.item .r { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .ico { width: 38px; height: 38px; border-radius: 12px; background: var(--yellow-soft); display: grid; place-items: center; flex: 0 0 38px; color: var(--red); font-weight: 800; }
.item .ico svg { width: 20px; height: 20px; }
.item .ico.dark { background: var(--ink); color: var(--yellow); }
.item .ico.green { background: var(--green-soft); color: var(--green); }
.item .chev { color: #C9BEA9; display: flex; }
.item .chev svg { width: 18px; height: 18px; }
.plus { color: var(--green); }
.minus { color: var(--red); }

/* ---------- Quà ---------- */
.reward { display: flex; gap: 14px; align-items: center; }
.reward .thumb { width: 68px; height: 68px; border-radius: 16px; background: var(--yellow-soft); flex: 0 0 68px; display: grid; place-items: center; overflow: hidden; }
.reward .thumb img { width: 100%; height: 100%; object-fit: cover; }
.reward .thumb svg { width: 32px; height: 32px; color: var(--red); }
.reward .info { flex: 1; min-width: 0; }
.reward h4 { margin: 0; font-size: 15px; font-weight: 800; }
.reward p { margin: 2px 0 6px; font-size: 12.5px; color: var(--ink-2); }
.cost { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--red); font-size: 14px; }
.cost svg { width: 15px; height: 15px; }
.need { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.need .mini { height: 5px; background: #F1E8D6; border-radius: 9px; overflow: hidden; margin-top: 4px; }
.need .mini i { display: block; height: 100%; background: var(--yellow); }
.balance { display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.balance b { font-family: var(--display); color: var(--yellow); font-size: 28px; line-height: 1; font-weight: 800; }

.seg { display: flex; background: #EAE3D6; border-radius: 13px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); min-height: 40px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.voucher { display: flex; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; margin-bottom: 12px; width: 100%; border: 0; padding: 0; text-align: left; }
.voucher .vl { background: var(--red); color: #fff; width: 84px; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; position: relative; flex: 0 0 84px; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.voucher .vl svg { width: 30px; height: 30px; }
.voucher.ck .vl { background: var(--ink); color: var(--yellow); }
.voucher.sp .vl { background: var(--yellow); color: var(--ink); }
.voucher .vl::after { content: ""; position: absolute; right: -7px; top: 0; bottom: 0; width: 14px; background: radial-gradient(circle at 7px 7px, var(--surface) 5px, transparent 5.5px) 0 0 / 14px 14px repeat-y; }
.voucher .vr { padding: 13px 16px; flex: 1; min-width: 0; }
.voucher h4 { margin: 0 0 3px; font-size: 15px; font-weight: 800; }
.voucher .s { font-size: 12px; color: var(--ink-2); }
.voucher.off { opacity: .55; }
.voucher.off .vl { background: #9A8F7A; color: #fff; }

/* ---------- Biểu mẫu ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 13px; padding: 13px 14px;
  font-size: 16px; outline: none; min-height: 52px; -webkit-appearance: none; appearance: none;
}
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23958C80' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px; }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(242,193,78,.28); }
.input[disabled] { background: var(--line-2); color: var(--ink-2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; margin: 10px 0; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--red); flex: 0 0 22px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.switch:last-child { border-bottom: 0; }
.switch .t { font-weight: 700; }
.switch .s { font-size: 12.5px; color: var(--ink-2); }
.switch input { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 99px; background: #DCD3C4; position: relative; flex: 0 0 50px; transition: background .15s; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(20px); }
.err { background: var(--red-soft); color: var(--red-2); padding: 11px 13px; border-radius: 12px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px; }
.ok-box { background: var(--green-soft); color: #176B41; padding: 11px 13px; border-radius: 12px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px; }
.pin-input { letter-spacing: 12px; font-weight: 800; text-align: center; font-size: 22px; }
.money-input { font-size: 24px; font-weight: 800; }

/* ---------- Đăng nhập ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.auth-hero { background: var(--yellow); padding: calc(var(--safe-top) + 26px) 24px 54px; text-align: center; position: relative; overflow: hidden; }
.has-demo .auth-hero { padding-top: 22px; }
.auth-hero::before { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: var(--yellow-2); left: -120px; bottom: -170px; }
.auth-hero::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: var(--yellow-2); right: -60px; top: -50px; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .logo-full { width: min(230px, 60vw); height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 6px 14px rgba(90,60,0,.18)); }
.auth-hero p { margin: 14px auto 0; color: #4E3A0E; font-size: 14.5px; font-weight: 600; max-width: 300px; text-wrap: balance; }
.auth-body { background: var(--bg); border-radius: 26px 26px 0 0; margin-top: -28px; padding: 22px 20px calc(30px + var(--safe-bottom)); flex: 1; position: relative; z-index: 2; }
.perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; }
.perks div { background: var(--surface); border-radius: 14px; padding: 11px 6px; text-align: center; font-size: 11.5px; font-weight: 700; box-shadow: var(--shadow-1); color: var(--ink-2); }
.perks b { display: block; font-family: var(--display); font-size: 22px; line-height: 1.05; color: var(--red); font-weight: 800; }
.demo-quick { margin-top: 18px; background: var(--surface); border: 1.5px dashed var(--yellow); border-radius: 16px; padding: 14px; }
.demo-quick .t { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); margin-bottom: 8px; }

/* ---------- Thanh dưới ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 30;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); display: flex; align-items: flex-end;
  padding: 6px 6px calc(6px + var(--safe-bottom)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tabbar button { flex: 1; background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 5px 0 3px; min-height: 52px; position: relative; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button.on { color: var(--ink); }
.tabbar button.on::before { content: ""; position: absolute; top: -7px; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--red); }
.tabbar .qr-fab { flex: 0 0 78px; color: var(--ink); }
.tabbar .qr-fab .fab { width: 60px; height: 60px; border-radius: 20px; background: var(--red); color: #fff; display: grid; place-items: center; margin-top: -30px; box-shadow: 0 8px 20px rgba(214,59,47,.4); border: 4px solid var(--surface); }
.tabbar .qr-fab .fab svg { width: 28px; height: 28px; }
.tabbar .qr-fab.on::before { display: none; }
.tabbar .nb { position: absolute; top: 2px; left: 50%; margin-left: 6px; background: var(--red); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; min-width: 16px; line-height: 16px; font-weight: 800; }

/* ---------- Sheet ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20,16,10,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet { background: var(--bg); width: 100%; max-width: 480px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 10px 18px calc(24px + var(--safe-bottom)); animation: up .24s cubic-bezier(.2,.8,.2,1); -webkit-overflow-scrolling: touch; }
.sheet .grab { width: 40px; height: 5px; background: #D9CDB6; border-radius: 9px; margin: 2px auto 14px; }
.sheet h3 { margin: 0 0 12px; font-size: 20px; font-weight: 800; letter-spacing: -.2px; padding-right: 40px; }
.sheet h3.center { padding: 0 40px; }
.sheet .close { position: sticky; top: 0; float: right; background: #EAE3D6; border: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; z-index: 3; color: var(--ink); }
.sheet .close svg { width: 18px; height: 18px; }
.sheet.full { max-height: 100vh; max-height: 100dvh; height: 100dvh; border-radius: 0; padding-top: calc(var(--safe-top) + 10px); }
.sheet.full .grab { display: none; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.qr-box { background: var(--surface); border-radius: 22px; padding: 22px 22px 18px; text-align: center; box-shadow: var(--shadow-1); position: relative; }
.qr-box .qr-logo { height: 30px; width: auto; display: block; margin: 0 auto 12px; }
.qr-box .qr { width: min(68vw, 270px); margin: 0 auto; }
.qr-box .qr svg { width: 100%; height: auto; display: block; }
.qr-box .code { font-size: 20px; font-weight: 900; letter-spacing: 3px; margin-top: 12px; }
.qr-box .sub { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.qr-steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.qr-steps div { background: var(--surface); border-radius: 14px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); display: flex; gap: 8px; align-items: flex-start; }
.qr-steps svg { width: 20px; height: 20px; color: var(--red); flex: 0 0 20px; }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-bottom)); transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: calc(100% - 32px); text-align: center; animation: up .2s ease; }
.toast.err-t { background: var(--red); }

.success { text-align: center; padding: 4px 0 8px; }
.success .seal { width: 76px; height: 76px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: grid; place-items: center; margin: 0 auto 10px; box-shadow: 0 0 0 8px var(--yellow-soft); }
.success .seal svg { width: 38px; height: 38px; }
.success .big { font-family: var(--display); font-size: 56px; font-weight: 800; color: var(--red); line-height: 1; }
.success h3 { padding: 0; }
.success p { color: var(--ink-2); margin: 6px 0 0; }

/* ---------- Máy quét ---------- */
.scanner { position: relative; background: #000; border-radius: 20px; overflow: hidden; aspect-ratio: 1 / 1; max-width: 100%; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 14%; border: 3px solid var(--yellow); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scanner .msg { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: #fff; font-size: 13px; font-weight: 600; padding: 0 16px; }

/* ---------- Quầy ---------- */
.branch-pick { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow-1); margin-bottom: 12px; }
.branch-pick svg { width: 20px; height: 20px; color: var(--red); flex: 0 0 20px; }
.branch-pick select { flex: 1; border: 0; background: transparent; min-height: 44px; font-weight: 700; font-size: 15px; -webkit-appearance: none; appearance: none; }
.scan-hero { width: 100%; border: 0; border-radius: 22px; background: var(--ink); color: #fff; padding: 22px 18px; display: flex; align-items: center; gap: 16px; text-align: left; box-shadow: var(--shadow-2); }
.scan-hero .si { width: 64px; height: 64px; border-radius: 18px; background: var(--yellow); color: var(--ink); display: grid; place-items: center; flex: 0 0 64px; }
.scan-hero .si svg { width: 34px; height: 34px; }
.scan-hero .t { font-size: 18px; font-weight: 800; }
.scan-hero .s { font-size: 13px; color: #CFC6B8; margin-top: 2px; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats3 div { background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-1); }
.stats3 b { display: block; font-family: var(--display); font-size: 26px; line-height: 1; font-weight: 800; }
.stats3 span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.who { display: flex; gap: 12px; align-items: center; background: var(--ink); color: #fff; border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; }
.who .av { width: 46px; height: 46px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: grid; place-items: center; font-weight: 900; font-size: 18px; flex: 0 0 46px; }
.who .grow { flex: 1; min-width: 0; }
.who .s { color: #CFC6B8; font-size: 12.5px; }
.who b.p { font-family: var(--display); color: var(--yellow); font-size: 26px; line-height: 1; }
.act { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-1); margin-bottom: 12px; }
.act-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.act-h .n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--yellow-soft); color: var(--red); flex: 0 0 30px; }
.act-h .n svg { width: 18px; height: 18px; }
.act-h b { font-size: 15px; }
.act-h .tag { margin-left: auto; }
.preview-pts { background: var(--yellow-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 700; margin-bottom: 12px; }

/* ---------- Giải trí ---------- */
.game-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-1); border: 0; width: 100%; text-align: left; }
.game-card + .game-card { margin-top: 12px; }
.game-card .art { width: 76px; height: 76px; border-radius: 18px; flex: 0 0 76px; display: grid; place-items: center; overflow: hidden; }
.game-card .art.spin { background: conic-gradient(var(--yellow) 0 60deg, var(--red) 0 120deg, #fff 0 180deg, var(--ink) 0 240deg, var(--yellow) 0 300deg, var(--red) 0); position: relative; }
.game-card .art.spin::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--ink); }
.game-card .art.catch { background: var(--ink); color: var(--yellow); }
.game-card .art.catch svg { width: 40px; height: 40px; }
.game-card .grow { flex: 1; min-width: 0; }
.game-card .t { font-weight: 800; font-size: 16px; }
.game-card .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.game-card .tag { margin-top: 6px; }

.wheel-wrap { position: relative; width: min(84vw, 340px); aspect-ratio: 1; margin: 6px auto 0; max-width: 100%; }
.wheel-wrap canvas { width: 100%; height: 100%; display: block; transition: transform 4.6s cubic-bezier(.12,.75,.12,1); border-radius: 50%; box-shadow: 0 12px 30px rgba(26,26,26,.22); }
.wheel-wrap .pin { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 30px solid var(--ink); filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); z-index: 2; }
.wheel-wrap .hub { position: absolute; inset: 50% auto auto 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px var(--ink); display: grid; place-items: center; z-index: 2; }
.wheel-wrap .hub img { width: 50px; height: auto; }

.game-stage { position: relative; background: #FFF7E3; border-radius: 20px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: inset 0 0 0 2px var(--line); }
.game-stage canvas { display: block; width: 100%; height: auto; }
.game-hud { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.game-hud div { background: var(--surface); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow-1); font-size: 12px; color: var(--ink-2); font-weight: 600; flex: 1; text-align: center; }
.game-hud b { display: block; font-family: var(--display); font-size: 22px; line-height: 1; color: var(--ink); }
.game-over { position: absolute; inset: 0; background: rgba(26,26,26,.72); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; gap: 8px; }
.game-over .big { font-family: var(--display); font-size: 60px; font-weight: 800; line-height: 1; color: var(--yellow); }
.legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Hướng dẫn nhanh ---------- */
.howto { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-1); margin-top: 16px; }
.howto-h { display: flex; justify-content: space-between; align-items: center; }
.howto-h b { font-size: 15px; }
.howto ol { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.howto li { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); counter-increment: s; }
.howto li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 800; display: grid; place-items: center; flex: 0 0 26px; font-size: 13px; }
.howto li b { color: var(--ink); }

/* ---------- Quản trị ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-1); min-width: 0; }
.kpi .v { font-family: var(--display); font-size: 26px; line-height: 1.05; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.kpi .l { font-size: 12px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }
.kpi.hl { background: var(--ink); }
.kpi.hl .v { color: var(--yellow); }
.kpi.hl .l { color: #CFC6B8; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b i { width: 100%; background: var(--yellow); border-radius: 5px 5px 2px 2px; min-height: 2px; }
.bars .b.today i { background: var(--red); }
.bars .b span { font-size: 9.5px; color: var(--ink-3); }
.bars .b em { font-size: 10px; font-style: normal; font-weight: 700; color: var(--ink); }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 13px; }
.hbar .tr { grid-column: 1 / -1; height: 8px; background: var(--line-2); border-radius: 9px; overflow: hidden; margin-bottom: 8px; }
.hbar .tr i { display: block; height: 100%; background: var(--yellow); border-radius: 9px; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line-2); }
table.tbl td.n, table.tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.subnav { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav button { flex: 0 0 auto; border: 0; background: var(--surface); border-radius: 99px; padding: 9px 15px; font-weight: 700; font-size: 13px; color: var(--ink-2); box-shadow: var(--shadow-1); }
.subnav button.on { background: var(--ink); color: var(--yellow); }
.editor-row { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow-1); margin-bottom: 10px; }
.editor-row .er-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.editor-row .er-h b { flex: 1; font-size: 14px; }
.editor-row .er-h button { border: 0; background: var(--line-2); color: var(--ink-2); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.editor-row .er-h button svg { width: 16px; height: 16px; }
.editor-row .er-h button.del { background: var(--red-soft); color: var(--red); }
.editor-row .input { min-height: 44px; padding: 9px 12px; font-size: 15px; }
.editor-row .field { margin-bottom: 8px; }
.editor-row .field label { font-size: 12px; margin-bottom: 4px; color: var(--ink-2); }
.color-dot { width: 44px; min-width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); padding: 0; background: none; }
.empty { text-align: center; color: var(--ink-3); padding: 30px 16px; font-size: 14px; }
.empty svg { width: 46px; height: 46px; color: #D9CDB6; display: block; margin: 0 auto 8px; }
.prose { font-size: 14px; white-space: pre-line; }
.prose h4 { margin: 16px 0 6px; }
.spinner { width: 30px; height: 30px; border: 3px solid var(--yellow-soft); border-top-color: var(--red); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.splash { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; background: var(--yellow); }
.splash img { width: 180px; height: auto; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- v3: Khách tự quét hoá đơn ---------- */
.vh { position: absolute !important; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
label.btn { display: inline-flex; }
.rc-cta { width: 100%; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); padding: 14px 14px 14px 16px; display: flex; align-items: center; gap: 14px; text-align: left; }
.rc-cta .ri { width: 48px; height: 48px; border-radius: 14px; background: var(--red); color: #fff; display: grid; place-items: center; flex: 0 0 48px; }
.rc-cta .ri svg { width: 26px; height: 26px; }
.rc-cta .t { font-weight: 800; font-size: 15.5px; }
.rc-cta .s { font-size: 12.5px; color: var(--ink-2); }
.rc-tips { display: grid; gap: 10px; margin: 6px 0 16px; }
.rc-tips > div { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.rc-tips i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--yellow); font-weight: 800; display: grid; place-items: center; flex: 0 0 26px; font-size: 13px; }
.rc-prev { position: relative; border-radius: 16px; overflow: hidden; background: #2A2620; max-height: 46vh; display: grid; place-items: center; }
.rc-prev img { display: block; max-height: 46vh; width: auto; max-width: 100%; opacity: .9; }
.rc-scan { position: absolute; left: 0; right: 0; height: 3px; background: var(--yellow); box-shadow: 0 0 16px 4px rgba(242,193,78,.7); animation: rcscan 1.8s ease-in-out infinite alternate; }
@keyframes rcscan { from { top: 4%; } to { top: 94%; } }
@media (prefers-reduced-motion: reduce) { .rc-scan { animation: none; top: 50%; } }
.rc-prog { margin: 14px 0 6px; }
.rc-prog .bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rc-prog .bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; transition: width .3s; }
.rc-prog .sub { margin-top: 8px; font-size: 13px; color: var(--ink-2); text-align: center; font-weight: 600; }
.rc-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 6px 16px; }
.rc-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.rc-row:last-child { border-bottom: 0; }
.rc-row span { color: var(--ink-2); white-space: nowrap; }
.rc-row b { text-align: right; font-variant-numeric: tabular-nums; }
.rc-row b.miss { color: var(--red); }
.rc-pts { display: flex; align-items: center; justify-content: space-between; background: var(--yellow-soft); border-radius: 14px; padding: 12px 16px; margin-top: 12px; }
.rc-pts b { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--red); }
.rc-thumb { width: 100%; max-height: 36vh; object-fit: contain; border-radius: 14px; display: block; margin-bottom: 12px; background: #2A2620; }
.rc-issues { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.rc-issues li { background: var(--red-soft); color: var(--red-2); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; font-weight: 600; }
.rc-sum { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.rc-sum div { background: var(--line-2); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); }
.rc-sum b { display: block; font-family: var(--display); font-size: 24px; line-height: 1.1; color: var(--ink); }
.rc-sum .bad b { color: var(--red); }
.rc-sum .good b { color: var(--green); }
.rc-map { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rc-map label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.rc-map select { width: 100%; min-height: 40px; margin-top: 2px; }
.rc-ocr { white-space: pre-wrap; font-size: 11.5px; font-family: ui-monospace, Menlo, monospace; color: var(--ink-2); max-height: 220px; overflow: auto; background: var(--line-2); border-radius: 10px; padding: 10px; }
