/* 404 VJ — giao diện. Nền đen sân khấu, chữ LED, đỏ đèn tally cho hành động chính. */
:root {
  color-scheme: dark;
  --stage: #000000;
  --rig: #111217;
  --rig-2: #181920;
  --truss: #272934;
  --truss-2: #343744;
  --haze: #9da0ad;
  --spot: #f2f3f7;
  --tally: #ff2e4d;
  --tally-hover: #ff4a66;
  --ok: #2bd67b;
  --warn: #ffb020;
  --pc: var(--tally);
  --font: "Inter", "Inter Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Inter Display", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --r-sm: 6px;
  --r: 10px;
  --wrap: 1200px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--stage); color: var(--spot);
  font: 400 16px/1.55 var(--font); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.022em; font-weight: 750; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -0.032em; }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.012em; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: #cfd1da; max-width: 62ch; }
.muted { color: var(--haze); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .01em; }
.mt { margin-top: 1.6em; }
:focus-visible { outline: 2px solid var(--spot); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--spot); color: #000; padding: 8px 12px; border-radius: var(--r-sm); z-index: 99; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 640px; }
.narrow-left { max-width: 820px; margin-left: max(0px, calc((100% - var(--wrap)) / 2)); }

/* ---------- Nút ---------- */
.btn {
  --b: var(--truss-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 42px; padding: 0 18px; border-radius: var(--r-sm); border: 1px solid var(--b);
  background: transparent; color: var(--spot); font: 600 .95rem/1 var(--font); text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--haze); }
.btn-primary { background: var(--tally); border-color: var(--tally); color: #fff; }
.btn-primary:hover { background: var(--tally-hover); border-color: var(--tally-hover); }
.btn-ghost { background: transparent; }
.btn-text { border-color: transparent; padding: 0 6px; min-height: 30px; color: var(--haze); text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: var(--spot); border-color: transparent; }
.btn-text.danger { color: #ff8a9b; }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: .875rem; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #fff; font-weight: 600; }
.btn-google:hover { background: #eef0f4; border-color: #eef0f4; }
.tally { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 1px rgba(255,255,255,.75); flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.actions.center { justify-content: center; }
.link { color: var(--spot); text-decoration: underline; text-decoration-color: var(--truss-2); text-underline-offset: 4px; }
.link:hover { text-decoration-color: var(--spot); }

/* ---------- Thanh trên ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(0,0,0,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--truss); }
.topbar-in { display: flex; align-items: center; gap: 36px; height: 64px; }
.brand { display: flex; align-items: center; }
.brand .logo { display: block; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--haze); font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--spot); }
.nav a[aria-current="page"] { color: var(--spot); background: var(--rig-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.nav-admin { color: var(--haze); text-decoration: none; font-size: .9rem; font-weight: 500; }
.nav-admin:hover { color: var(--spot); }
.nav-user { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: .9rem; font-weight: 500; max-width: 220px; }
.nav-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--rig-2); }
.avatar-letter { display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--truss-2); }
.nav-mobile { display: none; margin-left: auto; position: relative; }
.nav-mobile summary { list-style: none; cursor: pointer; width: 40px; height: 40px; display: grid; place-content: center; gap: 5px; border: 1px solid var(--truss-2); border-radius: var(--r-sm); }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile summary span { display: block; width: 18px; height: 2px; background: var(--spot); border-radius: 2px; }
.nav-mobile-panel { position: absolute; right: 0; top: 48px; background: var(--rig); border: 1px solid var(--truss); border-radius: var(--r); padding: 8px; min-width: 210px; display: grid; }
.nav-mobile-panel a { padding: 11px 12px; text-decoration: none; border-radius: var(--r-sm); }
.nav-mobile-panel a:hover, .nav-mobile-panel a[aria-current="page"] { background: var(--rig-2); }

.flash { border-bottom: 1px solid var(--truss); padding: 12px 0; font-size: .95rem; background: var(--rig); }
.flash-ok { box-shadow: inset 3px 0 0 var(--ok); }
.flash-error { box-shadow: inset 3px 0 0 var(--tally); }
.flash-info { box-shadow: inset 3px 0 0 var(--haze); }

/* ---------- Màn LED ---------- */
.led-wall { display: block; width: 100%; height: auto; }
.led-off circle { fill: #15161c; }
.led-glow { opacity: .6; }
@media (prefers-reduced-motion: no-preference) {
  .led-animate .led-on circle, .led-animate .led-glow circle { animation: led-on .42s cubic-bezier(.2,.7,.3,1) both; }
}
@keyframes led-on { from { opacity: 0; } 40% { opacity: 1; filter: brightness(1.8); } to { opacity: 1; } }

/* ---------- Trang chủ ---------- */
.hero { border-bottom: 1px solid var(--truss); }
.hero-wall { padding: 40px var(--gutter) 24px; max-width: 1320px; margin: 0 auto; }
.hero-copy { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 56px; align-items: end; padding-top: 16px; padding-bottom: 64px; }
.hero-text h1 { max-width: 16ch; }
.hero-meta { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--truss); }
.hero-meta div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0 14px 16px; border-bottom: 1px solid var(--truss); position: relative; }
.hero-meta div::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 10px var(--pc); }
.hero-meta dt { font-weight: 650; }
.hero-meta dd { margin: 0; color: var(--haze); font-size: .9rem; text-align: right; }

.section { padding: 72px 0; }
.section-tight { padding: 32px 0 56px; }
.section + .section { border-top: 1px solid var(--truss); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }

.product-rows { border-top: 1px solid var(--truss); }
.product-row { display: grid; grid-template-columns: 280px minmax(0, 1fr) 250px; gap: 36px; padding: 32px 0; border-bottom: 1px solid var(--truss); align-items: start; }
.product-thumb { display: block; background: #000; border: 1px solid var(--truss); border-radius: var(--r); padding: 10px; position: relative; overflow: hidden; }
.product-thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--pc); }
.product-img { display: block; width: 100%; height: auto; border-radius: var(--r-sm); aspect-ratio: 16 / 9; object-fit: cover; }
.product-info h3 { font-size: 1.5rem; margin-bottom: .2em; }
.product-info h3 a { text-decoration: none; }
.product-info h3 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--pc); }
.tagline { color: var(--haze); margin-bottom: 14px; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ticks li { position: relative; padding-left: 20px; color: #d6d8e0; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--pc); }
.product-buy { display: grid; gap: 4px; justify-items: start; }
.product-buy p { margin: 0; }
.product-buy .actions { margin-top: 14px; justify-self: stretch; }
.price { font: 750 1.6rem/1.2 var(--display); letter-spacing: -0.02em; }
.price-lg { font-size: 2.1rem; margin: 18px 0 4px; }

.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; padding: 0; margin: 0; }
.steps li { counter-increment: s; border-top: 1px solid var(--truss-2); padding-top: 20px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--truss-2); font-weight: 700; margin-bottom: 16px; color: var(--spot); }
.steps p { color: var(--haze); margin: 0; }

/* ---------- Đầu trang con ---------- */
.page-head { padding: 56px 0 8px; }
.page-head h1 { margin-bottom: .3em; }
.crumb { margin: 0 0 12px; font-size: .9rem; }
.crumb a { color: var(--haze); text-decoration: none; }
.crumb a:hover { color: var(--spot); }
.crumb a::after { content: " /"; }

/* ---------- Trang sản phẩm ---------- */
.product-hero { border-bottom: 1px solid var(--truss); background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 9%, #000) 0%, #000 70%); }
.product-hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; padding-top: 56px; padding-bottom: 64px; align-items: center; }
.product-visual { background: #000; border: 1px solid var(--truss); border-radius: 14px; padding: 16px; box-shadow: 0 0 0 1px #000, 0 30px 80px -40px var(--pc); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; }

/* ---------- Tải về ---------- */
.gate { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px; border: 1px solid var(--truss-2); border-radius: var(--r); background: var(--rig); margin: 24px 0 8px; }
.gate h2 { margin-bottom: .2em; font-size: 1.3rem; }
.gate p { margin: 0; color: var(--haze); }
.g-icon { flex: none; }
.dl-product { padding: 40px 0; border-bottom: 1px solid var(--truss); scroll-margin-top: 80px; }
.dl-head { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 24px; align-items: center; margin-bottom: 24px; }
.dl-head h2 { margin-bottom: .15em; }
.dl-head p { margin: 0; }
.dl-thumb { background: #000; border: 1px solid var(--truss); border-radius: var(--r-sm); padding: 6px; }
.files { display: grid; gap: 10px; }
.file { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 8px 24px; align-items: center; padding: 16px 18px; background: var(--rig); border: 1px solid var(--truss); border-radius: var(--r); }
.file-os { display: flex; align-items: center; gap: 12px; }
.file-os div { display: grid; }
.file-meta { display: grid; gap: 2px; min-width: 0; }
.file-meta .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-hash { grid-column: 1 / -1; }
.file-hash summary { cursor: pointer; width: fit-content; }
.file-hash code { display: block; word-break: break-all; margin-top: 6px; color: var(--haze); }
.notes { margin-top: 20px; }
.notes h3 { font-size: 1rem; }
.older { margin-top: 18px; }
.older summary { cursor: pointer; color: var(--haze); margin-bottom: 12px; }
.empty { color: var(--haze); padding: 18px; border: 1px dashed var(--truss-2); border-radius: var(--r); }

/* ---------- Cửa hàng ---------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.plan { border: 1px solid var(--truss); border-radius: 14px; padding: 20px; background: var(--rig); border-top: 3px solid var(--pc); }
.plan-visual { background: #000; border-radius: var(--r); padding: 8px; margin-bottom: 20px; border: 1px solid var(--truss); }
.plan h2 { margin-bottom: .15em; font-size: 1.5rem; }
.plan .btn-block { margin: 18px 0 22px; }
.pay-note { margin-top: 48px; max-width: 70ch; border-top: 1px solid var(--truss); padding-top: 28px; }
.pay-note h2 { font-size: 1.2rem; }
.pay-note p { color: var(--haze); }

/* ---------- Thanh toán ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.checkout-main { display: grid; gap: 22px; }
.checkout-main h1 { margin-bottom: 0; }
fieldset.field { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
legend { font-weight: 650; margin-bottom: 10px; padding: 0; }
.account-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--rig); border: 1px solid var(--truss); border-radius: var(--r); }
.account-chip div { display: grid; }
.account-chip .avatar { width: 32px; height: 32px; }
.account-chip.big { background: none; border: 0; padding: 0; gap: 16px; }
.account-chip.big .avatar { width: 56px; height: 56px; font-size: 1.2rem; }
.account-chip.big h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.method { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--truss); border-radius: var(--r); background: var(--rig); cursor: pointer; }
.method:has(input:checked) { border-color: var(--spot); background: var(--rig-2); }
.method span { display: grid; gap: 2px; }
.method input, .check input { accent-color: var(--tally); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check a { color: var(--spot); }
.secure-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.secure-note svg { flex: none; margin-top: 3px; }
.summary { position: sticky; top: 88px; border: 1px solid var(--truss); border-radius: 14px; padding: 22px; background: var(--rig); }
.summary-visual { background: #000; border: 1px solid var(--truss); border-radius: var(--r); padding: 8px; margin-bottom: 18px; }
.summary h2 { margin-bottom: .1em; }
.summary-lines { margin: 18px 0 0; display: grid; }
.summary-lines div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--truss); }
.summary-lines dt { color: var(--haze); }
.summary-lines dd { margin: 0; font-weight: 600; }
.summary-lines .total dt { color: var(--spot); font-weight: 650; }
.summary-lines .total dd { font: 750 1.4rem/1.2 var(--display); }

/* ---------- Kết quả ---------- */
.result { text-align: center; padding-top: 24px; }
.result .lead { margin-left: auto; margin-right: auto; }
.result-icon { width: 64px; height: 64px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; }
.result-icon.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); box-shadow: 0 0 40px -6px var(--ok); }
.result-icon.fail { background: color-mix(in srgb, var(--tally) 16%, transparent); color: var(--tally); }
.keybox { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; background: #000; border: 1px solid var(--truss-2); border-radius: var(--r); margin: 16px 0; }
.keybox code { font-size: 1.05rem; letter-spacing: .04em; overflow-wrap: anywhere; text-align: left; }
.result .keybox { box-shadow: 0 0 0 1px #000, 0 0 50px -20px var(--pc); }
.result .keybox code { font-size: clamp(.95rem, 2.6vw, 1.3rem); }
.howto { text-align: left; max-width: 46ch; margin: 24px auto; padding-left: 1.3em; color: #d6d8e0; display: grid; gap: 6px; }
.result .actions { margin: 28px 0 18px; }
.result > .alert { margin-bottom: 28px; }

/* ---------- Thông báo ---------- */
.alert { padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--truss-2); background: var(--rig); margin: 0; }
.alert-error { border-color: color-mix(in srgb, var(--tally) 60%, transparent); }
.alert-warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); color: #ffd98a; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--rig-2); border: 1px solid var(--truss-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--haze); }
.badge-active::before, .badge-paid::before { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.badge-pending::before { background: var(--warn); }
.badge-failed::before, .badge-revoked::before { background: var(--tally); }
.badge-admin::before { background: #7b5cff; }

/* ---------- Đăng nhập ---------- */
.page-login main { min-height: calc(100vh - 64px); }
.login { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); min-height: calc(100vh - 64px); }
.login-wall { display: grid; place-items: center; padding: 48px; border-right: 1px solid var(--truss); }
.login-card { align-self: center; padding: 48px; max-width: 460px; display: grid; gap: 4px; }
.login-card h1 { font-size: 2.2rem; }
.login-card .btn-google { margin: 14px 0 8px; }
.login-card .alert { margin: 8px 0; }
.dev-login { margin: 14px 0; padding: 14px; border: 1px dashed var(--truss-2); border-radius: var(--r); display: grid; gap: 8px; }
.row { display: flex; gap: 8px; }

/* ---------- Tài khoản ---------- */
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.licenses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.license { border: 1px solid var(--truss); border-left: 3px solid var(--pc); border-radius: var(--r); padding: 20px; background: var(--rig); }
.license-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.license-top h3 { margin-bottom: 2px; }
.machines ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.machines li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--truss); }
.machines p { margin: 0; }
.empty-box { padding: 28px; border: 1px dashed var(--truss-2); border-radius: var(--r); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.empty-box p { margin: 0; color: var(--haze); }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--truss); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); margin-right: 10px; box-shadow: 0 0 8px var(--pc); }

/* ---------- Bảng ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--haze); font-size: .82rem; padding: 10px 12px; border-bottom: 1px solid var(--truss-2); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--truss); vertical-align: middle; white-space: nowrap; }
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.row-actions { text-align: right; }
.row-actions form { display: inline-block; margin-left: 2px; }
.user-cell { display: flex; gap: 10px; align-items: center; }

/* ---------- Hỗ trợ ---------- */
.faq details { border-bottom: 1px solid var(--truss); padding: 4px 0; scroll-margin-top: 80px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--haze); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: #d0d2da; max-width: 68ch; }
.contact { margin-top: 48px; }

/* ---------- Trang văn bản (chính sách bảo mật) ---------- */
.prose { color: #d0d2da; }
.prose h2 { color: var(--spot); font-size: 1.15rem; margin: 36px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { max-width: 72ch; line-height: 1.65; }
.prose ul { padding-left: 1.2em; display: grid; gap: 8px; margin: 0 0 12px; }
.prose strong { color: var(--spot); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- Lỗi ---------- */
.error-page { padding: 48px 0 80px; }
.error-wall { max-width: 640px; margin: 0 auto 32px; padding: 0 var(--gutter); }

/* ---------- Form ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
label.field { display: grid; gap: 6px; }
label.field > span:first-child { font-weight: 600; font-size: .9rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; background: #000; color: var(--spot);
  border: 1px solid var(--truss-2); border-radius: var(--r-sm); font: inherit; font-size: .95rem;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--spot); }
input[type="color"] { width: 100%; height: 42px; padding: 3px; background: #000; border: 1px solid var(--truss-2); border-radius: var(--r-sm); }
input[type="file"] { font: inherit; font-size: .9rem; color: var(--haze); }
input[type="file"]::file-selector-button { font: 600 .85rem var(--font); background: var(--rig-2); color: var(--spot); border: 1px solid var(--truss-2); border-radius: var(--r-sm); padding: 8px 12px; margin-right: 12px; cursor: pointer; }
progress { width: 160px; height: 6px; accent-color: var(--tally); }
.upload { display: grid; gap: 10px; }
.upload-msg { margin: 0; }

/* ---------- Quản trị ---------- */
.is-admin .footer { display: none; }
.admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.admin-side { border-right: 1px solid var(--truss); padding: 28px 16px; background: var(--rig); }
.admin-side-title { color: var(--haze); font-size: .82rem; font-weight: 600; margin: 0 12px 10px; }
.admin-side nav { display: grid; gap: 2px; position: sticky; top: 88px; }
.admin-side a { padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--haze); font-weight: 500; }
.admin-side a:hover { color: var(--spot); background: var(--rig-2); }
.admin-side a[aria-current="page"] { color: var(--spot); background: var(--rig-2); box-shadow: inset 2px 0 0 var(--tally); }
.admin-main { padding: 32px 40px 64px; display: grid; gap: 20px; align-content: start; min-width: 0; }
.admin-title { font-size: 1.9rem; margin: 0 0 4px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: grid; gap: 4px; padding: 18px; border: 1px solid var(--truss); border-radius: var(--r); background: var(--rig); }
.kpi strong { font: 750 1.75rem/1.15 var(--display); letter-spacing: -0.02em; }
.panel { border: 1px solid var(--truss); border-radius: var(--r); background: var(--rig); padding: 20px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.panel-head h2, .panel > h2 { font-size: 1.1rem; margin: 0; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--tally); }
.chart .bar:hover { fill: var(--tally-hover); }
.chart .axis { fill: var(--haze); font: 500 11px var(--font); }
.chart .baseline { stroke: var(--truss-2); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--haze); border: 1px solid var(--truss); font-size: .9rem; }
.tabs a[aria-current="page"] { color: var(--spot); border-color: var(--spot); }
.toolbar { display: flex; gap: 10px; align-items: center; }
.toolbar input { max-width: 340px; }
.admin-products { display: grid; gap: 12px; }
.admin-product { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 14px; border: 1px solid var(--truss); border-left: 3px solid var(--pc); border-radius: var(--r); background: var(--rig); }
.admin-product h2 { font-size: 1.15rem; margin-bottom: 2px; }
.admin-product p { margin: 0; }
.admin-product-visual { background: #000; border-radius: var(--r-sm); padding: 6px; border: 1px solid var(--truss); }
.admin-product-visual.big { margin: 12px 0; padding: 10px; }
.edit-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* ---------- Chân trang ---------- */
.footer { border-top: 1px solid var(--truss); margin-top: 24px; padding-top: 48px; }
.footer-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; }
.footer-brand p { color: var(--haze); margin-top: 14px; max-width: 32ch; }
.footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer-links h2 { font: 600 .9rem/1.4 var(--font); color: var(--spot); margin-bottom: 10px; letter-spacing: 0; }
.footer-links a { display: block; color: var(--haze); text-decoration: none; padding: 4px 0; font-size: .92rem; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--spot); }
.footer-base { display: flex; justify-content: space-between; gap: 16px; padding-top: 32px; padding-bottom: 32px; color: var(--haze); font-size: .85rem; }
.footer-base a { color: var(--haze); }

/* ---------- Màn hình nhỏ ---------- */
@media (max-width: 1000px) {
  .product-row { grid-template-columns: 200px minmax(0, 1fr); }
  .product-buy { grid-column: 2; }
  .plans { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid, .edit-grid { grid-template-columns: minmax(0, 1fr); }
  .admin { grid-template-columns: minmax(0, 1fr); }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--truss); padding: 12px var(--gutter); }
  .admin-side-title { display: none; }
  .admin-side nav { display: flex; overflow-x: auto; position: static; }
  .admin-side a { white-space: nowrap; }
  .admin-main { padding: 24px var(--gutter) 48px; }
}
@media (max-width: 820px) {
  :root { --gutter: 16px; }
  .nav, .nav-right { display: none; }
  .nav-mobile { display: block; }
  .topbar-in { height: 58px; }
  .hero-wall { padding-top: 24px; padding-bottom: 12px; }
  .hero-copy, .product-hero-in, .two-col, .checkout, .login, .footer-in { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-copy { padding-bottom: 48px; }
  .product-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .product-buy { grid-column: auto; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .section { padding: 52px 0; }
  .dl-head { grid-template-columns: 96px minmax(0, 1fr); }
  .dl-buy { grid-column: 1 / -1; justify-self: start; }
  .file { grid-template-columns: minmax(0, 1fr) auto; }
  .file-meta { grid-column: 1 / -1; grid-row: 2; }
  .gate { flex-direction: column; align-items: stretch; }
  .methods, .licenses { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; order: -1; }
  .login-wall { border-right: 0; border-bottom: 1px solid var(--truss); padding: 28px var(--gutter); }
  .login-card { padding: 28px var(--gutter) 48px; max-width: none; }
  .admin-product { grid-template-columns: 100px minmax(0, 1fr); }
  .admin-product .btn { grid-column: 1 / -1; justify-self: start; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-base { flex-direction: column; }
}
@media (max-width: 560px) {
  .kpi strong { font-size: 1.2rem; }
  .keybox { flex-wrap: wrap; }
  .keybox code { flex: 1 1 100%; font-size: min(.88rem, 3.6vw); letter-spacing: .02em; }
  .keybox .btn { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
