/* Sổ Vàng — "sổ cái giấy ngà, mực xanh rêu, chữ số đồng thau". Một bộ màu cho cả trang khách và quản trị. */
:root {
  --paper: #f4efe4;
  --surface: #fffdf8;
  --ink: #15211c;
  --muted: #66706a;
  --line: #e3dccb;
  --green: #0f3d2f;
  --green-2: #17543f;
  --brass: #a87c2c;
  --brass-soft: #f2e6c9;
  --gold-text: #f2d38a;
  --ok: #1f7a4d;
  --ok-soft: #e1f1e7;
  --warn: #8a5d00;
  --bad: #b3261e;
  --bad-soft: #fbe4e2;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(21, 33, 28, 0.06), 0 10px 28px rgba(21, 33, 28, 0.07);
  --font: 'Be Vietnam Pro', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--green); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; }
[hidden] { display: none !important; }

.demo-ribbon { position: sticky; top: 0; z-index: 20; background: var(--brass); color: #fff; text-align: center; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 6px 12px; }
.shell { max-width: 480px; margin: 0 auto; padding: 20px 16px 112px; }
.shell > * + * { margin-top: 16px; }
.page-title { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.eyebrow { margin: 0 0 4px; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); font-weight: 700; }
.muted { color: var(--muted); font-size: 0.84rem; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.row.split { padding: 10px 0; border-top: 1px solid var(--line); }

.hero { background: radial-gradient(130% 150% at 0% 0%, var(--green-2), var(--green) 60%); color: #efe6d2; border: 0; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 22px solid rgba(242, 211, 138, 0.08); }
.hero .eyebrow { color: var(--gold-text); }
.hero .muted { color: #b9c4bc; }
.hero .big { margin: 2px 0 0; font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--gold-text); font-variant-numeric: tabular-nums; }
.hero .row.split { border-top-color: rgba(255, 255, 255, 0.12); }

.actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }

.btn { appearance: none; border: 0; border-radius: 999px; padding: 13px 18px; font: inherit; font-weight: 600; cursor: pointer; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; width: 100%; transition: background-color 0.15s, transform 0.1s; }
.btn:hover { background: var(--green-2); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.btn.ghost:hover { background: var(--brass-soft); }
.btn.gold { background: var(--brass); }
.btn.gold:hover { background: #946c22; }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.btn.small { width: auto; padding: 7px 14px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .seg label:has(input:focus-visible), .tabs a:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.field { display: block; }
.field > span { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input, select { width: 100%; font: inherit; padding: 12px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
input:focus, select:focus { border-color: var(--green); outline: none; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: #ebe4d4; padding: 4px; border-radius: 999px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { text-align: center; padding: 10px; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted); transition: background-color 0.15s, color 0.15s; }
.seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; border-top: 1px dashed var(--line); }
.total .num { font-size: 1.45rem; color: var(--green); }

.notice { margin: 0; background: var(--brass-soft); border-radius: var(--r-md); padding: 12px 14px; font-size: 0.84rem; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

.pill { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--line); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--brass-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .title { font-weight: 600; }
.plus { color: var(--ok); }
.minus { color: var(--bad); }

.price-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.price-table th { text-align: right; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 0 8px; }
.price-table th:first-child, .price-table td:first-child { text-align: left; }
.price-table td { padding: 10px 0; border-top: 1px solid var(--line); text-align: right; font-weight: 600; }

.code-big { font-size: 2.2rem; font-weight: 700; letter-spacing: 0.22em; text-align: center; color: var(--green); font-variant-numeric: tabular-nums; }
.qr-mock { width: 184px; aspect-ratio: 1; margin: 4px auto; border-radius: 14px; position: relative; background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0 / 23px 23px; box-shadow: inset 0 0 0 10px #fff, 0 0 0 1px var(--line); }
.qr-mock::after { content: 'QR minh hoạ'; position: absolute; inset: 41% 14%; background: var(--brass); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.78rem; border-radius: 8px; }
.countdown { font-size: 1.6rem; font-weight: 700; color: var(--brass); font-variant-numeric: tabular-nums; }

.tabs { position: fixed; inset: auto 0 0 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center; gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.tabs a { flex: 1; max-width: 96px; text-align: center; text-decoration: none; color: var(--muted); font-size: 0.7rem; font-weight: 600; padding: 6px 4px; border-radius: 12px; display: grid; gap: 2px; justify-items: center; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current='page'] { color: var(--green); background: var(--brass-soft); }

.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 0.85rem; z-index: 30; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }

/* --------------------------------------------------------------- quản trị */
.admin .shell { max-width: 1160px; padding-bottom: 48px; }
.admin-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.vault-card .row { padding: 7px 0; }
.vault-card .row.strong { border-top: 1.5px solid var(--ink); padding-top: 10px; font-weight: 700; }
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
table.data th { text-align: left; font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data .r { text-align: right; font-variant-numeric: tabular-nums; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline input { width: 110px; padding: 7px 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
table.data input { width: 130px; padding: 7px 10px; text-align: right; }
.narrow { max-width: 420px; margin-inline: auto; }
.upper { text-transform: uppercase; }
