:root {
  /* Bộ nhận diện TruePack: Navy (tin cậy) · Cam (năng động) · Vàng (tích cực) · Xám nhạt (hiện đại) */
  --navy: #0B3D91;
  --orange: #FF8A00;
  --yellow: #FFC107;
  --brand: #0B3D91;
  --brand-2: #2F6BD8;
  --brand-ink: #ffffff;
  --accent: #FF8A00;
  --accent-ink: #ffffff;
  --accent-text: #C25E00;
  --bg: #F4F6FA;
  --surface: #ffffff;
  --surface-2: #EBEFF6;
  --ink: #0A1B3D;
  --ink-2: #4B5875;
  --line: #DCE2ED;
  --danger: #dc2626;
  --ok: #16a34a;
  --cam-bg: #0A1A3A;
  --logo-light: inline-block;
  --logo-dark: none;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 61, 145, .06), 0 8px 24px rgba(11, 61, 145, .08);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #6E9BF0; --brand-2: #4F84E8; --brand-ink: #071430; --accent-text: #FFA640;
    --bg: #071125; --surface: #0D1A35; --surface-2: #142446; --ink: #E8EEFA; --ink-2: #9DAAC6; --line: #22355E;
    --cam-bg: #040B1A; --logo-light: none; --logo-dark: inline-block;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #6E9BF0; --brand-2: #4F84E8; --brand-ink: #071430; --accent-text: #FFA640;
  --bg: #071125; --surface: #0D1A35; --surface-2: #142446; --ink: #E8EEFA; --ink-2: #9DAAC6; --line: #22355E;
  --cam-bg: #040B1A; --logo-light: none; --logo-dark: inline-block;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video, canvas { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.container { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 15px; transition: transform .12s, background .12s, border-color .12s; white-space: nowrap; }
.btn:hover { border-color: var(--brand-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.06); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Landing */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .container { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo-mark { width: 36px; height: 36px; flex: none; }
.logo-mark.light { display: var(--logo-light); } .logo-mark.dark { display: var(--logo-dark); }
.logo-word b { color: var(--brand); font-weight: 800; } .logo-word i { color: var(--orange); font-style: normal; font-weight: 800; }
.logo-tag { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-2); letter-spacing: .01em; margin-top: -2px; }
.nav-links { display: flex; gap: 22px; margin-left: 16px; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { margin-left: auto; display: flex; gap: 10px; }
.menu-btn { display: none; margin-left: auto; }

.hero { padding: 72px 0 48px; text-align: center; }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--accent-text); font-weight: 600; font-size: 13px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.08; letter-spacing: -.03em; margin: 20px auto 16px; max-width: 900px; }
.hero h1 em { font-style: normal; color: var(--orange); }
.hero p.lead { font-size: 18px; color: var(--ink-2); max-width: 640px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 56px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat b { display: block; font-size: 30px; letter-spacing: -.02em; color: var(--brand); }
.stat span { color: var(--ink-2); font-size: 14px; }

.mock { margin: 56px auto 0; max-width: 980px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; text-align: left; }
.mock-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; }
.mock-cam { position: relative; background: var(--cam-bg); aspect-ratio: 16/10; display: grid; place-items: center; }
.mock-cam .rec { position: absolute; top: 12px; left: 12px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.mock-cam .ts { position: absolute; bottom: 12px; left: 12px; color: #fff; font: 600 13px ui-monospace, monospace; background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 6px; }
.mock-cam .qrbox { width: 120px; height: 120px; border: 3px solid var(--orange); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); }
.mock-list { padding: 16px; display: grid; gap: 10px; align-content: start; }
.mock-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.mock-row small { color: var(--ink-2); }

section.block { padding: 80px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.02em; margin: 0 0 12px; line-height: 1.15; }
.section-head p { color: var(--ink-2); margin: 0; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin: 14px 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-2) 15%, transparent); color: var(--brand); }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }

.billing-toggle { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin: 0 auto 32px; }
.billing-toggle button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.billing-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.billing-toggle .save { color: var(--ok); font-size: 12px; margin-left: 4px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan { position: relative; display: flex; flex-direction: column; }
.plan.popular { border: 2px solid var(--brand); }
.plan .badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.plan .price { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 0; }
.plan .price small { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.plan ul { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); flex: 1; }
.plan li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 8px; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; }
.contact-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-item:last-child { border: 0; }
.contact-item small { display: block; color: var(--ink-2); }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 25%, transparent); }

.cta-band { background: linear-gradient(135deg, var(--navy), #072A66); color: #fff; border-radius: 22px; padding: 56px 32px; text-align: center; }
.cta-band h2 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 12px; letter-spacing: -.02em; }
.cta-band p { opacity: .85; margin: 0 0 24px; }

footer.site { border-top: 1px solid var(--line); padding: 40px 0; color: var(--ink-2); font-size: 14px; }
footer.site .container { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; }
footer.site nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 15, 14, .55); display: none; place-items: center; z-index: 100; padding: 16px; }
.modal-backdrop.open { display: grid; }
.modal { background: var(--surface); border-radius: 18px; width: min(440px, 100%); padding: 28px; box-shadow: var(--shadow); max-height: 92vh; overflow: auto; }
.modal.wide { width: min(760px, 100%); }
.modal h3 { margin: 0 0 4px; font-size: 22px; }
.modal .sub { color: var(--ink-2); margin: 0 0 20px; font-size: 14px; }
.modal-close { float: right; border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* App shell */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { padding: 4px 8px 18px; }
.store-switch { margin: 0 4px 12px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%; font-size: 15px; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.active { background: color-mix(in srgb, var(--brand-2) 15%, transparent); color: var(--brand); font-weight: 700; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.storage-meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 8px 0 4px; }
.storage-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), var(--orange)); }
.main { padding: 28px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.topbar h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; }
.topbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.mobile-nav-btn { display: none; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.kpi small { color: var(--ink-2); font-weight: 500; }
.kpi b { display: block; font-size: 28px; letter-spacing: -.02em; margin-top: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { font-size: 17px; margin: 0 0 14px; }
.row-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar i { width: 100%; max-width: 44px; background: var(--brand-2); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bars .bar small { color: var(--ink-2); font-size: 12px; }
.bars .bar span { font-size: 12px; font-weight: 700; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar .input { width: auto; min-width: 160px; }
.toolbar .grow { flex: 1; min-width: 220px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); background: var(--surface-2); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
.thumb { width: 72px; aspect-ratio: 16/10; border-radius: 8px; background: var(--cam-bg); object-fit: cover; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.tag.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.tag.warn { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
.tag.brand { background: color-mix(in srgb, var(--brand-2) 15%, transparent); color: var(--brand); }
.actions { display: flex; gap: 6px; }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* Recorder */
.rec-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.cam-wrap { position: relative; background: var(--cam-bg); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; display: grid; place-items: center; color: #9fb2af; }
.cam-wrap canvas, .cam-wrap video { width: 100%; height: 100%; object-fit: contain; }
.cam-status { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; }
.cam-status .tag { background: rgba(0,0,0,.6); color: #fff; }
.cam-status .tag.rec { background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.scan-hint { position: absolute; inset: auto 0 12px; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 3px #000; }
.order-current { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.log { display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.log div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; display: flex; justify-content: space-between; gap: 8px; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row small { display: block; color: var(--ink-2); }
.toggle { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle:checked { background: var(--brand); }
.toggle:checked::after { transform: translateX(18px); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 200; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 980px) {
  .grid-4, .stats, .kpis { grid-template-columns: repeat(2, 1fr); }
  .plans, .grid-3 { grid-template-columns: 1fr 1fr; }
  .about, .contact-grid, .row-2, .rec-layout, .settings-grid, .mock-body { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .mobile-nav-btn { display: inline-flex; }
  .main { padding: 18px 16px; }
}
@media (max-width: 720px) {
  .nav-links, .nav-cta { display: none; }
  .menu-btn { display: inline-flex; }
  .nav.open .nav-links { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); padding: 16px; margin: 0; border-bottom: 1px solid var(--line); }
  .nav.open .nav-cta { display: flex; position: absolute; top: calc(64px + 190px); left: 16px; right: 16px; }
  .grid-4, .plans, .grid-3, .stats, .kpis { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  section.block { padding: 56px 0; }
  .hero { padding-top: 44px; }
  .topbar h1 { font-size: 20px; }
}

/* ---- v2: dashboard parity ---- */
.side-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); padding: 12px 12px 4px; font-weight: 700; }
.sidebar { overflow-y: auto; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.range { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.range select, .range input { width: auto; padding: 7px 10px; font-size: 13px; }
.range small { color: var(--ink-2); font-size: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.panel-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.stack { display: grid; gap: 16px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mini-kpis div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.mini-kpis small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
.mini-kpis b { display: block; font-size: 22px; }
.c-new { color: var(--brand-2); } .c-ret { color: var(--accent); }
.sbars { display: flex; align-items: flex-end; gap: 3px; height: 180px; border-bottom: 1px solid var(--line); }
.sbars .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.sbars .col i { display: block; width: 100%; }
.sbars .col i.n { background: var(--brand-2); border-radius: 3px 3px 0 0; }
.sbars .col i.r { background: var(--accent); }
.sbars .col i.s { background: linear-gradient(var(--brand-2), var(--brand)); border-radius: 3px 3px 0 0; }
.sbars .col:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 11px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.xlabels { display: flex; gap: 3px; margin-top: 4px; }
.xlabels span { flex: 1; font-size: 10px; color: var(--ink-2); text-align: center; overflow: hidden; white-space: nowrap; min-width: 0; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.heat { display: grid; grid-template-columns: 32px repeat(24, 1fr); gap: 2px; font-size: 10px; color: var(--ink-2); }
.heat span { height: 20px; border-radius: 3px; background: var(--surface-2); }
.heat b { font-weight: 600; display: flex; align-items: center; }
.meter { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.meter.warn i { background: linear-gradient(90deg, var(--yellow), var(--danger)); }
.notice { background: color-mix(in srgb, var(--brand-2) 12%, transparent); color: var(--brand); padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.vcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--surface); }
.vcard img, .vcard .ph { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--cam-bg); }
.vcard div { padding: 8px 10px; font-size: 12px; }
.store-card .mini-kpis { grid-template-columns: 1fr 1fr; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--brand); border-color: var(--brand); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 13px; cursor: pointer; }
.checks input:checked + span { color: var(--brand); font-weight: 700; }
.opt-cards { display: grid; gap: 8px; }
.opt-cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.opt-cards label { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: block; font-size: 13px; }
.opt-cards label small { display: block; color: var(--ink-2); font-size: 12px; }
.opt-cards input { position: absolute; opacity: 0; pointer-events: none; }
.opt-cards label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand-2) 10%, transparent); }
.settings-sec { padding: 14px 0; border-bottom: 1px solid var(--line); }
.settings-sec:last-child { border-bottom: 0; }
.settings-sec > b { display: block; margin-bottom: 8px; }
.hint { color: var(--ink-2); font-size: 12px; margin: 6px 0 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { background: var(--surface-2); border-radius: 99px; padding: 3px 10px; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--ink-2); padding: 0; }
.plan-hero { background: linear-gradient(135deg, #072A66, var(--navy)); color: #fff; border-radius: var(--radius); padding: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.plan-hero small { opacity: .75; font-weight: 700; letter-spacing: .06em; font-size: 11px; }
.plan-hero h2 { font-size: 34px; margin: 2px 0 10px; }
.plan-hero .chip { background: rgba(255,255,255,.15); color: #fff; }
.voucher { display: flex; border: 1px dashed var(--brand-2); border-radius: 14px; overflow: hidden; background: var(--surface); }
.voucher .l { background: color-mix(in srgb, var(--brand-2) 14%, transparent); color: var(--brand); padding: 18px; min-width: 130px; display: grid; place-content: center; text-align: center; }
.voucher .l b { font-size: 22px; }
.voucher .r { padding: 14px 18px; flex: 1; }
.ref-code { font: 800 32px ui-monospace, monospace; letter-spacing: .12em; color: var(--brand); }
.qr-box { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; }
.rec-side .seg { width: 100%; } .rec-side .seg button { flex: 1; }
.dup { background: var(--yellow) !important; color: #2A1E00 !important; }
.wrap-cell { white-space: nowrap; }
@media (max-width: 980px) {
  .opt-cards.cols-3 { grid-template-columns: 1fr; }
  .mini-kpis { grid-template-columns: 1fr 1fr 1fr; }
  .heat { font-size: 8px; grid-template-columns: 22px repeat(24, 1fr); gap: 1px; }
}
@media (max-width: 720px) { .topbar .who, #planTag { display: none; } }
.logo { line-height: 1.15; }
.sidebar .logo-tag { font-size: 9.5px; white-space: nowrap; }
.nav .logo-tag { white-space: nowrap; }
.count-badge { margin-left: auto; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; }
.side-link.admin-link { margin-top: 6px; border: 1px dashed var(--accent); color: var(--accent-text); font-weight: 700; }
button.panel { font: inherit; color: inherit; width: 100%; }
/* Hiện/ẩn mật khẩu */
.pw-wrap { position: relative; display: block; }
.pw-wrap > .input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-2); border-radius: 8px; cursor: pointer; }
.pw-eye:hover { color: var(--brand); background: var(--surface-2); }
.pw-eye:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.pw-eye[aria-pressed="true"] { color: var(--brand); }

/* ===== Giao diện điện thoại (app) ===== */
.m-top { display: none; }
@media (max-width: 720px) {
  body.m-shell { background: var(--bg); }
  body.m-shell .sidebar, body.m-shell .topbar { display: none !important; }
  body.m-shell .app { display: block; }
  body.m-shell .main { padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  body.m-shell .m-top { display: flex; align-items: center; gap: 8px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; margin: 0 -16px 14px; padding: 10px 12px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  body.m-shell .m-top h1 { font-size: 18px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
  body.m-home .m-top { display: none; }
  body.m-shell .panel-head > p, body.m-shell .main > #view > p.muted:first-child { margin-top: 0 !important; }
}
.m-icon-btn { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; flex: none; }
.m-icon-btn svg { width: 22px; height: 22px; }

.m-head { display: flex; align-items: center; gap: 14px; padding: calc(18px + env(safe-area-inset-top, 0px)) 0 22px; }
.m-appicon { width: 60px; height: 60px; border-radius: 16px; box-shadow: 0 6px 16px rgba(11, 61, 145, .25); flex: none; }
.m-brand { font-size: 27px; font-weight: 800; letter-spacing: -.03em; flex: 1; }
.m-brand b { color: var(--brand); } .m-brand i { color: var(--orange); font-style: normal; }
.m-round { position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink-2); display: grid; place-items: center; box-shadow: var(--shadow); cursor: pointer; flex: none; }
.m-round svg { width: 26px; height: 26px; }
.m-dot { position: absolute; top: 11px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); border: 2px solid var(--surface); }

.m-sec { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.m-sec h2 { font-size: 20px; margin: 0; letter-spacing: -.02em; }
.m-link-ic { border: 0; background: none; color: var(--orange); width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.m-link-ic svg { width: 26px; height: 26px; }

.m-stores { display: grid; gap: 16px; }
.m-store { display: block; width: 100%; text-align: left; border: 0; background: var(--surface); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); cursor: pointer; color: inherit; font: inherit; }
.m-store-art { display: grid; place-items: center; aspect-ratio: 2 / 1.1; border-radius: 18px; background: color-mix(in srgb, var(--brand-2) 10%, var(--surface)); color: color-mix(in srgb, var(--brand-2) 45%, var(--surface)); overflow: hidden; }
.m-store-art svg { width: 92px; height: 92px; }
.m-store-art img { width: 100%; height: 100%; object-fit: cover; }
.m-store-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.m-store-row > span:first-child { flex: 1; min-width: 0; }
.m-store-row b { display: block; font-size: 20px; letter-spacing: -.01em; }
.m-store-row small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.m-chev { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); flex: none; }
.m-chev svg { width: 22px; height: 22px; }

.m-fab { position: fixed; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: inline-flex; align-items: center; gap: 12px; padding: 18px 28px 18px 24px; border: 0; border-radius: 999px; background: var(--orange); color: #fff; font: 700 17px var(--font); box-shadow: 0 10px 26px rgba(255, 138, 0, .45); cursor: pointer; }
.m-fab svg { width: 30px; height: 30px; color: #fff; }
.m-fab svg circle { fill: #fff; } .m-fab svg path[stroke="#fff"] { stroke: var(--orange); }
@media (min-width: 721px) { .m-fab { display: none; } }

.m-store-hero { background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.m-store-hero .mini-kpis div { text-align: center; }
.m-cta { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; border: 0; border-radius: 18px; padding: 18px; background: linear-gradient(135deg, var(--orange), #FF6B00); color: #fff; font: inherit; box-shadow: 0 10px 24px rgba(255, 138, 0, .35); cursor: pointer; margin-bottom: 14px; }
.m-cta svg { width: 34px; height: 34px; flex: none; }
.m-cta b { display: block; font-size: 18px; } .m-cta small { opacity: .9; }
.m-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.m-tile { border: 0; background: var(--surface); border-radius: 16px; padding: 14px 6px; display: grid; gap: 6px; justify-items: center; font: 600 12px var(--font); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; }
.m-tile span { font-size: 24px; }

.m-profile { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.m-profile b { display: block; font-size: 17px; } .m-profile small { color: var(--ink-2); }
.m-wallet { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; border: 0; border-radius: 18px; padding: 16px; background: linear-gradient(135deg, #072A66, var(--navy)); color: #fff; font: inherit; cursor: pointer; margin-bottom: 16px; }
.m-wallet small { display: block; opacity: .75; font-size: 12px; } .m-wallet b { font-size: 17px; font-variant-numeric: tabular-nums; }
.m-group { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.m-group > small { display: block; padding: 12px 16px 4px; color: var(--ink-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.m-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: none; font: 500 15px var(--font); color: var(--ink); text-align: left; cursor: pointer; }
.m-group > small + .m-item { border-top: 0; }
.m-item > span:nth-child(2) { flex: 1; }
.m-item-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 17px; }
.m-item .m-chev { width: 28px; height: 28px; background: none; color: var(--ink-2); }
.m-item .m-chev svg { width: 18px; height: 18px; }

.m-notes { display: grid; gap: 8px; }
.m-note { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.m-note > span:nth-child(2) { flex: 1; min-width: 0; }
.m-note b { display: block; font-size: 14px; } .m-note small { color: var(--ink-2); font-size: 12px; }
.m-note-ic { font-size: 22px; }
.m-note svg { width: 18px; height: 18px; color: var(--ink-2); flex: none; }

@media (max-width: 720px) {
  /* Modal kiểu bottom-sheet trên điện thoại */
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 90vh; border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px)); }
}
.m-store-hero .mini-kpis { gap: 6px; }
.m-store-hero .mini-kpis div { padding: 10px 4px; }
.m-store-hero .mini-kpis small { font-size: 10px; letter-spacing: 0; white-space: nowrap; }
@media (max-width: 720px) {
  body.m-shell .rec-layout { gap: 12px; }
  body.m-shell .cam-wrap { border-radius: 18px; }
}

/* Màn Danh sách cửa hàng (điện thoại) */
@media (max-width: 720px) { body.m-center .m-top h1 { text-align: center; margin-right: 40px; } }
.m-addbtn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; padding: 18px; background: var(--orange); color: #fff; font: 700 17px var(--font); box-shadow: 0 8px 20px rgba(255, 138, 0, .35); cursor: pointer; margin: 4px 0 18px; }
.m-addbtn svg { width: 24px; height: 24px; color: #fff; }
.m-slist { display: grid; gap: 14px; }
.m-srow { display: flex; align-items: center; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 4px 8px 4px 4px; transition: box-shadow .15s; position: relative; }
.m-srow.dragging { z-index: 5; box-shadow: 0 14px 34px rgba(11, 61, 145, .22); transition: none; }
.m-srow-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; padding: 14px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.m-srow-art { width: 76px; height: 76px; border-radius: 18px; flex: none; display: grid; place-items: center; overflow: hidden; background: color-mix(in srgb, var(--brand-2) 10%, var(--surface)); color: color-mix(in srgb, var(--brand-2) 45%, var(--surface)); }
.m-srow-art svg { width: 42px; height: 42px; }
.m-srow-art img { width: 100%; height: 100%; object-fit: cover; }
.m-srow-info { min-width: 0; display: grid; gap: 6px; }
.m-srow-info b { font-size: 18px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; font-variant-numeric: tabular-nums; }
.m-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.m-stats svg { width: 18px; height: 18px; color: var(--orange); flex: none; }
.m-handle { width: 44px; height: 56px; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; cursor: grab; touch-action: none; border-radius: 12px; flex: none; }
.m-handle:active { cursor: grabbing; background: var(--surface-2); }
.m-handle svg { width: 26px; height: 26px; }

/* Form Thêm/Sửa cửa hàng */
.sf-head { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; margin: -6px 0 16px; }
.sf-head h3 { text-align: center; margin: 0; font-size: 19px; }
.sf-x { width: 48px; height: 48px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.sf-x svg { width: 28px; height: 28px; }
.sf-sheet .modal-close { display: none; }
.sf { display: grid; gap: 16px; }
.sf-logo { display: grid; place-items: center; aspect-ratio: 2 / 1.1; max-height: 260px; width: 100%; border-radius: 22px; background: var(--surface-2); cursor: pointer; overflow: hidden; border: 2px dashed transparent; transition: border-color .15s; }
.sf-logo:hover { border-color: var(--orange); }
.sf-logo.has { background: var(--surface); border: 1px solid var(--line); }
.sf-logo img { width: 100%; height: 100%; object-fit: contain; }
.sf-logo-ic { width: 64px; height: 64px; color: color-mix(in srgb, var(--orange) 55%, var(--surface)); }
.sf-logo-ic svg { width: 100%; height: 100%; }
.sf-logo-txt { text-align: center; display: grid; gap: 2px; justify-items: center; margin-top: -4px; }
.sf-logo-txt b { font-size: 17px; } .sf-logo-txt small { color: var(--ink-2); font-size: 12.5px; }
.sf-logo-txt .btn { margin-top: 6px; }
.sf .field > label { font-size: 15px; font-weight: 700; color: var(--ink); }
.sf-pill { border-radius: 999px; padding: 15px 22px; font-size: 16px; }
.sf-staff { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.sf-staff > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sf-staff b { font-size: 15.5px; } .sf-staff small { color: var(--ink); font-size: 13px; } .sf-staff em { color: var(--danger); font-size: 12px; font-style: normal; }
.sf-staff-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); flex: none; }
.sf-staff-ic svg { width: 26px; height: 26px; }
.sf-chev { color: var(--orange); width: 26px; flex: none; } .sf-chev svg { width: 24px; height: 24px; }
.sf-submit { width: 100%; border: 0; border-radius: 999px; padding: 17px; background: var(--orange); color: #fff; font: 700 17px var(--font); box-shadow: 0 8px 20px rgba(255, 138, 0, .3); cursor: pointer; margin-top: 4px; }
.sf-pick { display: grid; gap: 8px; margin-bottom: 16px; }
.sf-prow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; }
.sf-prow > span:nth-child(2) { flex: 1; min-width: 0; } .sf-prow b { display: block; } .sf-prow small { color: var(--ink-2); font-size: 12px; }
.sf-quick { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface-2); margin-bottom: 14px; }
.m-store-art.logo, .m-srow-art.logo { background: var(--surface); border: 1px solid var(--line); }
.m-store-art.logo img, .m-srow-art.logo img { object-fit: contain; padding: 10%; }
@media (max-width: 720px) { .modal.sf-sheet { min-height: 94vh; border-radius: 26px 26px 0 0; } }
.sf-trash { width: 48px; height: 48px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); display: grid; place-items: center; cursor: pointer; justify-self: end; }
.sf-trash svg { width: 24px; height: 24px; }
.tag.handover { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }

/* ===== App điện thoại v2 ===== */
.o { color: var(--orange) !important; }
.m-icon-btn.hi { color: var(--orange); }
.m-chev-s { color: var(--ink-2); width: 22px; flex: none; } .m-chev-s svg { width: 20px; height: 20px; }
.m-empty { min-height: 46vh; display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center; color: var(--ink-2); padding: 24px 12px; }
.m-empty > svg { width: 96px; height: 96px; color: color-mix(in srgb, var(--ink-2) 75%, var(--surface)); margin-bottom: 6px; }
.m-empty b { color: var(--ink); font-size: 16px; } .m-empty small { font-size: 13px; max-width: 280px; }
.m-reload { margin-top: 8px; border: 0; border-radius: 999px; padding: 8px 18px; background: color-mix(in srgb, var(--orange) 12%, transparent); color: var(--orange); font: 600 13px var(--font); cursor: pointer; }
.m-scard { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px; border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.m-scard .m-srow-art { width: 64px; height: 64px; font-size: 28px; }
.m-scard-info { flex: 1; min-width: 0; display: grid; gap: 3px; } .m-scard-info b { font-size: 18px; } .m-scard-info small { font-size: 12px; }
.m-banner { display: flex; align-items: center; gap: 12px; margin-top: -8px; padding: 22px 14px 12px; border-radius: 0 0 20px 20px; background: var(--surface); box-shadow: var(--shadow); }
.m-banner span { flex: 1; min-width: 0; display: grid; gap: 2px; } .m-banner small { color: var(--ink-2); font-size: 11.5px; } .m-banner b { color: var(--orange); font-size: 12.5px; font-weight: 600; }
.m-srch-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.m-cart { width: 44px; height: 44px; border: 0; border-radius: 14px; background: none; color: var(--orange); display: grid; place-items: center; cursor: pointer; flex: none; }
.m-cart svg { width: 30px; height: 30px; } .m-cart.plain { color: var(--ink-2); } .m-cart.plain svg { width: 26px; }
.m-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 999px; padding: 4px 6px 4px 4px; box-shadow: var(--shadow); }
.m-search .input { border: 0; background: transparent; box-shadow: none; padding: 10px 14px; min-width: 0; }
.m-sbtn { width: 38px; height: 38px; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; border-radius: 10px; cursor: pointer; flex: none; }
.m-sbtn svg { width: 22px; height: 22px; } .m-sbtn.hi { color: var(--orange); }
.m-sec h2 small { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.m-vlist { display: grid; gap: 10px; }
.m-vrow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.m-vrow img, .m-vrow-ph { width: 64px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--cam-bg); flex: none; }
.m-vrow > span:nth-child(2) { flex: 1; min-width: 0; display: grid; } .m-vrow b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .m-vrow small { color: var(--ink-2); font-size: 12px; }
.m-fab-c { right: 50%; transform: translateX(50%); }
.m-dial { position: fixed; inset: 0; z-index: 60; background: rgba(5, 15, 30, .45); opacity: 0; transition: opacity .15s; }
.m-dial.open { opacity: 1; }
.m-dial-b, .m-dial-x { position: fixed; border: 0; cursor: pointer; font: 700 15px var(--font); }
.m-dial-b { display: inline-flex; align-items: center; gap: 8px; padding: 16px 22px; border-radius: 999px; background: var(--orange); color: #fff; box-shadow: 0 10px 24px rgba(255, 138, 0, .45); transform: scale(.6); transition: transform .18s; }
.m-dial.open .m-dial-b { transform: scale(1); }
.m-dial-b svg { width: 26px; height: 26px; }
.m-dial-b.top { left: 50%; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; }
.m-dial-b.left { left: 16px; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }
.m-dial-b.right { right: 16px; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }
.m-dial-x { left: 50%; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; width: 52px; height: 52px; border-radius: 50%; background: var(--surface); color: var(--orange); display: grid; place-items: center; box-shadow: var(--shadow); }
.m-dial-x svg { width: 22px; height: 22px; }
.m-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-two .btn { border-radius: 999px; color: var(--orange); font-weight: 700; }
.m-label { display: block; margin: 16px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--ink-2); }
.m-people { display: grid; gap: 10px; margin-bottom: 16px; }
.m-person { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.m-person > span:nth-child(2) { flex: 1; min-width: 0; display: grid; } .m-person b { font-size: 15px; } .m-person small { color: var(--ink-2); font-size: 12px; }
.m-rm { border: 0; background: var(--surface-2); color: var(--danger); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }
.m-info { border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 14px; padding: 0 4px; }
.sf-submit[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.ms-grip { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: -8px auto 14px; }
.ms-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ms-head b { font-size: 17px; }
.ms-sec { display: grid; gap: 10px; margin-bottom: 18px; } .ms-sec > b { font-size: 14px; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-chips button { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 9px 16px; font: 500 13px var(--font); cursor: pointer; }
.ms-chips button.on { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, var(--surface)); color: var(--orange); font-weight: 700; }
.m-link-danger { border: 0; background: none; color: var(--danger); font: 600 13px var(--font); cursor: pointer; }
.m-opts { display: grid; gap: 4px; }
.m-opts button { display: flex; align-items: center; gap: 12px; padding: 14px 10px; border: 0; border-radius: 12px; background: none; font: 500 15px var(--font); color: var(--ink); text-align: left; cursor: pointer; }
.m-opts button:hover { background: var(--surface-2); } .m-opts i, .m-langs i { margin-left: auto; color: var(--orange); font-style: normal; font-weight: 800; }
.m-fbar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; margin-bottom: 10px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font: 600 14px var(--font); color: var(--orange); cursor: pointer; }
.m-fbar svg { width: 20px; height: 20px; }
.m-kpi3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 12px; }
.m-kpi3.two { grid-template-columns: 1fr 1fr; }
.m-kpi3 > div { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); } .m-kpi3 small { color: var(--ink-2); font-size: 11.5px; } .m-kpi3 b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.m-card { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.m-card h3 { margin: 0 0 8px; font-size: 16px; }
.m-ratio { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; }
.m-acc { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px; border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.m-acc > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 1px; } .m-acc b { font-size: 16px; } .m-acc small { color: var(--ink-2); font-size: 12px; }
.m-set { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.m-group > .m-set:first-child { border-top: 0; }
.m-set-ic { width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 15px; font-weight: 800; color: var(--ink-2); flex: none; }
.m-set-t { flex: 1; min-width: 0; display: grid; } .m-set-t b { font-size: 14.5px; font-weight: 600; } .m-set-t small { color: var(--ink-2); font-size: 11.5px; }
.m-set-v { color: var(--ink-2); font-size: 13px; white-space: nowrap; flex: none; }
.m-about { padding: 24px 6px 8px; display: grid; gap: 6px; }
.m-about-logo { display: flex; align-items: center; gap: 14px; } .m-about-logo img { border-radius: 16px; } .m-about-logo small { display: block; color: var(--ink-2); font-size: 12px; }
.m-about h3 { margin: 16px 0 0; font-size: 16px; } .m-about p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.m-rate { text-align: center; margin: 16px 0 4px; display: grid; gap: 6px; }
.m-rate button { border: 0; background: none; font-size: 34px; color: var(--line); cursor: pointer; padding: 0 3px; } .m-rate button.on { color: #FFB800; }
.m-contact { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; } .m-contact b { color: var(--orange); text-align: right; font-weight: 600; }
.m-doc p { color: var(--ink-2); line-height: 1.6; margin: 0 0 10px; }
.m-total { margin: 14px 4px; font-size: 14px; }
.m-langs { display: grid; gap: 12px; }
.m-langs button { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid transparent; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); font: 600 15px var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.m-langs button.on { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 6%, var(--surface)); }
.m-flag { font-size: 30px; line-height: 1; }
/* vuốt để xoá cửa hàng */
.m-srow { overflow: hidden; --sw: 0px; }
.m-srow-del { position: absolute; left: 0; top: 0; bottom: 0; width: 90px; border: 0; background: var(--danger); color: #fff; display: grid; place-content: center; justify-items: center; gap: 2px; font: 700 12px var(--font); cursor: pointer; border-radius: 22px 0 0 22px; }
.m-srow-del svg { width: 24px; height: 24px; }
.m-srow-main, .m-srow .m-handle { transform: translateX(var(--sw)); transition: transform .18s; position: relative; z-index: 1; background: var(--surface); }
/* menu bật lên */
.m-pop-wrap { position: fixed; inset: 0; z-index: 300; }
.m-pop { position: fixed; background: var(--surface); border-radius: 16px; box-shadow: 0 12px 40px rgba(5, 15, 40, .25); overflow: hidden; border: 1px solid var(--line); }
.m-pop button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 0; border-top: 1px solid var(--line); background: none; font: 500 14.5px var(--font); color: var(--ink); text-align: center; justify-content: center; cursor: pointer; }
.m-pop button:first-child { border-top: 0; } .m-pop button.on { color: var(--orange); font-weight: 700; } .m-pop button.danger { color: var(--danger); } .m-pop i { font-style: normal; }
/* hướng dẫn */
.m-coach { position: fixed; inset: 0; z-index: 400; cursor: pointer; }
.m-coach-hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(5, 12, 28, .62); transition: all .2s; }
.m-coach-tip { position: fixed; left: 16px; right: 16px; max-width: 360px; margin: 0 auto; background: #fff; color: #0A1B3D; border-radius: 18px; padding: 14px 16px; display: grid; gap: 3px; box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.m-coach-tip::before { content: ""; position: absolute; top: -8px; left: var(--ax); width: 16px; height: 16px; background: #fff; transform: rotate(45deg); }
.m-coach-tip.up::before { top: auto; bottom: -8px; }
.m-coach-tip b { color: var(--orange); font-size: 16px; } .m-coach-tip span { font-size: 14px; } .m-coach-tip small { color: #8a94a8; font-size: 11px; }
/* hộp nhập mã */
.m-dialog { position: fixed; inset: 0; z-index: 350; background: rgba(5, 12, 28, .55); display: grid; place-items: center; padding: 16px; }
.m-dialog-box { width: min(360px, 100%); background: var(--surface); border-radius: 22px; padding: 22px 18px 18px; display: grid; gap: 10px; text-align: center; }
.m-dialog-box > b { font-size: 18px; } .m-dialog-box > small { color: var(--ink-2); }
.m-dialog-box .m-search { box-shadow: none; background: var(--surface-2); margin: 6px 0; }
.m-dialog-act { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .m-dialog-act .btn { border-radius: 999px; }
/* máy quét */
.m-scan { position: fixed; inset: 0; z-index: 320; background: #000; }
.m-scan video { width: 100%; height: 100%; object-fit: cover; }
.m-scan-frame { position: absolute; left: 50%; top: 42%; width: min(72vw, 320px); aspect-ratio: 1; translate: -50% -50%; }
.m-scan-frame i, .mc-frame i { position: absolute; width: 40px; height: 40px; border: 4px solid var(--orange); }
.m-scan-frame i:nth-child(1), .mc-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.m-scan-frame i:nth-child(2), .mc-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.m-scan-frame i:nth-child(3), .mc-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.m-scan-frame i:nth-child(4), .mc-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.m-scan-back, .mc-back { position: absolute; left: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); }
.m-scan-back { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; }
.m-scan-back svg { width: 22px; height: 22px; }
.m-scan-hint { position: absolute; left: 0; right: 0; top: calc(42% + min(36vw, 160px) + 20px); text-align: center; color: #fff; margin: 0; font-size: 14px; }
.m-scan-bar { position: absolute; left: 0; right: 0; bottom: calc(36px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 40px; align-items: center; }
.m-scan-btn { width: 50px; height: 50px; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; display: grid; place-items: center; cursor: pointer; }
.m-scan-btn svg { width: 24px; height: 24px; } .m-scan-btn.big { width: 64px; height: 64px; } .m-scan-btn.on { background: #fff; color: #000; }

/* Màn quay & chụp toàn màn hình trên điện thoại */
@media (max-width: 720px) {
  body.m-full { background: #121212; }
  body.m-full .m-top { display: none !important; }
  body.m-full .main { padding: 0 0 env(safe-area-inset-bottom, 0px); }
}
.mr { color: #fff; background: #121212; min-height: 100vh; padding: calc(8px + env(safe-area-inset-top, 0px)) 0 16px; display: grid; gap: 10px; align-content: start; }
.mr-top { display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.mr-ic { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.mr-ic svg { width: 20px; height: 20px; } .mr-ic.sm { width: 32px; height: 32px; background: none; color: var(--orange); } .mr-ic.sm.off { color: #777; }
.mr-info { flex: 1; text-align: center; font-weight: 700; font-size: 13px; letter-spacing: .02em; white-space: nowrap; }
.mr-type { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--orange); color: #fff; font: 700 12px var(--font); cursor: pointer; white-space: nowrap; }
.mr-cam { position: relative; margin: 0 8px; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 62vh; }
.mr-cam canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.mr-frame { position: absolute; left: 50%; top: 45%; width: 62%; aspect-ratio: 1; translate: -50% -50%; border: 3px solid var(--orange); border-radius: 22px; display: grid; place-items: center; transition: width .2s, aspect-ratio .2s; pointer-events: none; }
.mr-frame.wide { width: 86%; aspect-ratio: 1.6; }
.mr-cross { color: rgba(255,255,255,.75); font-size: 28px; }
.mr-frame-btn { pointer-events: auto; position: absolute; right: -14px; bottom: -14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mr-frame-btn svg { width: 16px; height: 16px; }
.mr-chip { position: absolute; bottom: 12px; border: 0; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font: 700 12px var(--font); padding: 6px 10px; cursor: pointer; }
#mrZoom { left: 12px; } .mr-chip.kb { right: 12px; padding: 4px 8px; } .mr-chip.kb svg { width: 26px; height: 22px; }
.mr-timer { position: absolute; left: 50%; bottom: 12px; translate: -50% 0; background: rgba(0,0,0,.55); border-radius: 999px; padding: 6px 14px; font: 700 14px ui-monospace, monospace; letter-spacing: .06em; }
.mr-timer.on { background: var(--danger); }
.mr-off { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: #000; } .mr-off p { margin: 0 0 12px; color: #bbb; }
.mr-brand { text-align: center; color: var(--orange); font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.mr-pill { justify-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 13px; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-pill i { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex: none; }
.mr-pill.idle i { background: #888; } .mr-pill.rec { background: rgba(220, 38, 38, .25); } .mr-pill.rec i { background: var(--danger); animation: blink 1s infinite; }
.mr-bottom { display: flex; justify-content: center; align-items: center; gap: 44px; margin-top: 6px; }
.mr-side { width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mr-side svg { width: 24px; height: 24px; } .mr-side.on { background: #fff; color: #111; }
.mr-rec { position: relative; width: 84px; height: 84px; border-radius: 50%; border: 5px solid rgba(255,255,255,.25); background: var(--orange); padding: 0; cursor: pointer; display: grid; place-items: center; }
.mr-rec img { width: 54px; height: 54px; border-radius: 14px; }
.mr-rec.rec { border-color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, .25); } }
.mr-lock { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: #333; color: #aaa; display: grid; place-items: center; }
.mr-lock svg { width: 12px; height: 12px; }
.mr-session { margin: 6px 12px 0; } .mr-session .log div { background: rgba(255,255,255,.08); color: #fff; }
.mc { position: fixed; inset: 0; background: #000; color: #fff; z-index: 45; }
.mc video { width: 100%; height: 100%; object-fit: cover; }
.mc-back { z-index: 2; }
.mc-top { position: absolute; left: 0; right: 0; top: calc(18px + env(safe-area-inset-top, 0px)); display: grid; justify-items: center; gap: 10px; z-index: 1; }
.mc-store { background: rgba(0,0,0,.55); padding: 6px 16px; border-radius: 999px; font-weight: 700; color: var(--orange); }
.mc-seg { display: flex; gap: 4px; background: rgba(0,0,0,.55); padding: 4px; border-radius: 999px; }
.mc-seg button { border: 0; border-radius: 999px; padding: 8px 14px; background: none; color: #ddd; font: 600 13px var(--font); cursor: pointer; } .mc-seg button.on { background: var(--orange); color: #fff; }
.mc-hint { display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,.55); border-radius: 12px; padding: 6px 12px; font-size: 13px; } .mc-hint svg { width: 16px; height: 16px; } .mc-hint.ok { background: var(--ok); }
.mc-frame { position: absolute; left: 50%; top: 50%; width: min(78vw, 340px); aspect-ratio: 1.15; translate: -50% -50%; }
.mc-bottom { position: absolute; left: 0; right: 0; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; align-items: center; gap: 44px; }
.mc-shot { width: 84px; height: 84px; border-radius: 50%; border: 5px solid rgba(255,255,255,.3); background: var(--orange); display: grid; place-items: center; cursor: pointer; }
.mc-shot svg { width: 46px; height: 46px; }
.mc-flashfx { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; } .mc-flashfx.go { animation: fx .35s; }
@keyframes fx { 0% { opacity: .8; } 100% { opacity: 0; } }
.m-fab span { white-space: nowrap; }

/* Khung quét chỉnh được (kéo để di chuyển / kéo góc để đổi cỡ) */
.mr-cam { height: min(64vh, calc((100vw - 16px) * var(--ar, 1.3333))); width: auto; max-width: calc(100% - 16px); margin: 0 auto; max-height: none; }
.mr-cam canvas { object-fit: contain; }
.mr-frame { translate: none; aspect-ratio: auto; pointer-events: auto; touch-action: none; cursor: move; transition: none; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .18); }
.mr-frame.adjusting, .mc-frame.adjusting { border-color: #fff; }
.mr-frame-btn { touch-action: none; cursor: nwse-resize; width: 36px; height: 36px; right: -16px; bottom: -16px; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.mr-frame-btn svg { width: 18px; height: 18px; }
.mc-frame { translate: none; aspect-ratio: auto; touch-action: none; cursor: move; z-index: 1; }
.mc-frame .mr-frame-btn { position: absolute; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: #fff; }
.mc-frame.adjusting i { border-color: #fff; }
.mr-frame { z-index: 3; } .mr-chip, .mr-timer { z-index: 2; }
/* Nút Xoá ẩn hẳn ngoài mép trái, chỉ trượt vào theo ngón tay khi vuốt (không lộ vệt đỏ) */
.m-srow-del { transform: translateX(calc(var(--sw) - 100%)); transition: transform .18s; border-radius: 22px 0 0 22px; }
