/* =========================================================
   Pháo Hoa – giao diện sáng. Màu chủ đạo (--blue-*) & màu nhấn (--accent-*)
   được ghi đè theo Cài đặt giao diện (App\Services\Theme). Mặc định "Tết rực rỡ":
   xanh chàm #1D24A6 + đỏ son #D7000F + vàng pháo hoa #F5A524.
   Ưu tiên máy tính; trên điện thoại hoạt động như ứng dụng
   ========================================================= */
:root {
  --blue-950: #0a0c38;
  --blue-900: #0f1253;
  --blue-800: #141871;
  --blue-700: #181e8b;
  --blue-600: #1d24a6;
  --blue-500: #464bb6;
  --blue-300: #999cd7;
  --blue-100: #dddef2;
  --blue-50: #eff0f9;
  --blue-rgb: 29, 36, 166;
  --accent-950: #490005;
  --accent-900: #6c0008;
  --accent-800: #92000a;
  --accent-700: #b5000d;
  --accent-600: #d7000f;
  --accent-500: #de2e3a;
  --accent-300: #ed8c93;
  --accent-100: #f9d9db;
  --accent-50: #fcedee;
  --accent-rgb: 215, 0, 15;
  --gold: #f5a524;
  --footer-bg: #080a2e;
  --hero-image: none;
  --bg: #f3f7fc;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --line: #e2eaf4;
  --line-2: #edf2f9;
  --ink: #0f2440;
  --ink-2: #44597a;
  --muted: #7a8ca5;
  --green: #0f9d58;
  --green-bg: #e3f6ec;
  --amber: #e8960c;
  --amber-bg: #fff3dc;
  --red: #e5484d;
  --red-bg: #fde8e8;
  --violet: #6e56cf;
  --violet-bg: #efeafe;
  --teal: #0b8f8a;
  --teal-bg: #dff5f3;
  --gray: #64748b;
  --gray-bg: #eef1f5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 36, 64, .06);
  --shadow: 0 1px 2px rgba(15, 36, 64, .05), 0 6px 20px rgba(15, 36, 64, .06);
  --shadow-lg: 0 18px 50px rgba(10, 42, 79, .18);
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --tabbar-h: 64px;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15.5px; font-weight: 650; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--blue-50); padding: 2px 6px; border-radius: 6px; color: var(--blue-800); }
.ic { width: 20px; height: 20px; flex: none; }
.ic-sm { width: 16px; height: 16px; flex: none; }
.ic-lg { width: 26px; height: 26px; flex: none; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.strong { font-weight: 650; }
.mono { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.text-green { color: var(--green); } .text-red { color: var(--red); } .text-amber { color: var(--amber); }

/* ---------- Thanh tiến trình chuyển trang ---------- */
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999; background: linear-gradient(90deg, var(--accent-600), var(--gold)); box-shadow: 0 0 10px var(--blue-300); transition: width .3s var(--ease), opacity .3s; opacity: 0; }
#progress.on { opacity: 1; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
  text-decoration: none; user-select: none;
}
.btn:hover { border-color: #c9d7ea; background: var(--surface-2); color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible { outline: 3px solid var(--blue-100); outline-offset: 1px; }
.btn-primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; box-shadow: 0 6px 14px -6px rgba(var(--blue-rgb), .6); }
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.btn-outline { border-color: var(--blue-700); color: var(--blue-700); }
.btn-outline:hover { background: var(--blue-50); border-color: var(--blue-700); color: var(--blue-800); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--blue-50); border-color: transparent; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #cc3238; border-color: #cc3238; color: #fff; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #0b8048; border-color: #0b8048; color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 12px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }

/* ---------- Biểu mẫu ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13.5px; font-weight: 550; color: var(--ink); }
.req::after { content: ' *'; color: var(--red); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid #d4dfec; border-radius: 10px; background: #fff; color: var(--ink);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 92px; padding: 10px 14px; resize: vertical; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2344597a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:hover, .select:hover, .textarea:hover { border-color: #b9cbe2; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-100); }
.input::placeholder, .textarea::placeholder { color: #9aabc0; }
.input-sm, .select-sm { height: 36px; border-radius: 8px; font-size: 13.5px; }
.input[readonly] { background: var(--surface-2); }
.help { font-size: 12.5px; color: var(--muted); }
.error-text { font-size: 12.5px; color: var(--red); }
.input-group { position: relative; display: flex; }
.input-group .input { padding-right: 46px; }
.input-group .btn { position: absolute; right: 4px; top: 4px; height: 36px; width: 38px; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; background: transparent; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 450; }
.check input { width: 18px; height: 18px; accent-color: var(--blue-600); margin: 0; }
.radios { display: flex; gap: 22px; flex-wrap: wrap; min-height: 44px; align-items: center; }
.segmented { display: inline-flex; background: var(--blue-50); border-radius: 12px; padding: 4px; gap: 4px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 8px 16px; border-radius: 9px; cursor: pointer; font-weight: 550; color: var(--ink-2); transition: all .15s; }
.segmented input:checked + span { background: #fff; color: var(--blue-700); box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 40px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.form-section { font-size: 16px; font-weight: 700; margin: 26px 0 14px; display: flex; align-items: center; gap: 10px; }
.form-section::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--line); }

/* ---------- Thẻ, khung ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13.5px; }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Huy hiệu trạng thái ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: #b26d00; }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-blue { background: var(--blue-50); color: var(--blue-700); }
.badge-teal { background: var(--teal-bg); color: var(--teal); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--blue-50); color: var(--blue-700); font-size: 12.5px; font-weight: 600; }
.chip-gold { background: linear-gradient(135deg, #fff1cc, #ffe08a); color: #8a5a00; }

/* ---------- Thông báo nhanh ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; border: 1px solid; font-size: 14px; margin-bottom: 16px; }
.alert .ic { margin-top: 1px; }
.alert-success { background: var(--green-bg); border-color: #b6e6cd; color: #0b6b3d; }
.alert-error { background: var(--red-bg); border-color: #f6c3c4; color: #a3262b; }
.alert-info { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-800); }
.alert-warning { background: var(--amber-bg); border-color: #f7dca6; color: #8a5800; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { min-width: 280px; max-width: 380px; background: var(--blue-950); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: toast-in .3s var(--ease); font-size: 14px; }
.toast a { color: var(--blue-300); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- Bảng ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0 0 var(--radius) var(--radius); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { position: sticky; top: 0; z-index: 1; background: #f6f9fd; color: var(--ink); text-align: left; font-weight: 650; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13.5px; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f7fbff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; text-align: right; }
.table .clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.table tfoot td { font-weight: 700; background: #f6f9fd; border-top: 1px solid var(--line); }
.row-link { cursor: pointer; }
.prod-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--blue-50); border: 1px solid var(--line-2); flex: none; }
.thumb-sm { width: 40px; height: 40px; border-radius: 8px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .ic-lg { margin: 0 auto 10px; color: var(--blue-300); width: 44px; height: 44px; }

/* ---------- Thẻ tổng hợp (như màn Đơn đặt hàng) ---------- */
.status-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.status-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .15s; display: block; color: inherit; }
.status-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.status-card .sc-head { padding: 14px 20px; color: #fff; font-size: 18px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.status-card .sc-row { display: flex; align-items: baseline; gap: 6px; padding: 10px 20px; border-bottom: 1px dotted var(--line); }
.status-card .sc-row:last-child { border-bottom: 0; padding-bottom: 14px; }
.status-card .sc-row b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.status-card .sc-row span { color: var(--ink-2); }
.sc-green .sc-head { background: linear-gradient(135deg, #0f9d58, #12b56a); }
.sc-amber .sc-head { background: linear-gradient(135deg, #f2a21b, #f7b733); }
.sc-gray .sc-head { background: linear-gradient(135deg, #5d6d85, #74839a); }
.sc-blue .sc-head { background: linear-gradient(135deg, var(--blue-700), var(--blue-500)); }
.status-card.is-active { outline: 3px solid var(--blue-100); border-color: var(--blue-500); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue-600); }
.kpi .kpi-top { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 13.5px; }
.kpi .kpi-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.kpi .kpi-val { font-size: 24px; font-weight: 700; margin-top: 10px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.k-green::before { background: var(--green); } .kpi.k-green .kpi-ic { background: var(--green-bg); color: var(--green); }
.kpi.k-amber::before { background: var(--amber); } .kpi.k-amber .kpi-ic { background: var(--amber-bg); color: var(--amber); }
.kpi.k-violet::before { background: var(--violet); } .kpi.k-violet .kpi-ic { background: var(--violet-bg); color: var(--violet); }
.kpi.k-red::before { background: var(--red); } .kpi.k-red .kpi-ic { background: var(--red-bg); color: var(--red); }

/* ---------- Thanh lọc ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .input, .toolbar .select { height: 42px; }
.toolbar .search { flex: 1; min-width: 220px; max-width: 420px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--ink-2); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.tabs a.active { color: var(--blue-700); border-bottom-color: var(--blue-600); }
.tabs .count { background: var(--blue-50); color: var(--blue-700); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.tabs a.active .count { background: var(--blue-600); color: #fff; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 6px; }
.pager .pages a, .pager .pages span { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 550; padding: 0 8px; }
.pager .pages .on { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* ---------- Khung ứng dụng (quản trị & cổng đối tác) ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 50; }
.brand { display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 20px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 30% 30%, var(--accent-500), var(--accent-700) 45%, var(--blue-700)); box-shadow: 0 6px 14px -6px rgba(var(--accent-rgb), .7); flex: none; }
.brand-mark .ic { width: 22px; height: 22px; }
.brand b { font-size: 16px; display: block; line-height: 1.2; }
.brand small { color: var(--muted); font-size: 12px; }
.nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; scrollbar-width: thin; }
.nav-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 550; margin: 2px 0; transition: background .12s, color .12s; }
.nav a:hover { background: var(--blue-50); color: var(--blue-700); }
.nav a.active { background: var(--blue-600); color: #fff; box-shadow: 0 6px 16px -8px rgba(var(--blue-rgb), .8); }
.nav a .badge-count { margin-left: auto; background: var(--amber); color: #fff; font-size: 11.5px; border-radius: 999px; padding: 0 7px; font-weight: 700; line-height: 20px; }
.nav a.active .badge-count { background: #fff; color: var(--blue-700); }
.side-user { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-500), var(--blue-800)); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { color: var(--muted); font-size: 12px; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(243, 247, 252, .85); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .top-title { display: none; font-weight: 700; font-size: 17px; }
.topbar .top-search { flex: 1; max-width: 440px; }
.topbar .top-search .input { height: 40px; background: #fff; }
.topbar .top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: #fff; color: var(--blue-700); box-shadow: var(--shadow-sm); }
.dot-count { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.page { padding: 8px 28px 40px; flex: 1; animation: page-in .28s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13.5px; margin: 6px 0 10px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--blue-700); }
.crumbs .ic { width: 14px; height: 14px; color: var(--muted); }
.crumbs b { color: var(--ink); font-weight: 650; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Menu thả xuống */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 90; opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: all .16s var(--ease); }
.dropdown.open .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 9px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--blue-50); color: var(--blue-700); }
.dropdown-menu .dm-head { padding: 10px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.notif-menu { width: 360px; max-height: 460px; overflow-y: auto; }
.notif-item { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.notif-item:hover { background: var(--blue-50); color: var(--ink); }
.notif-item.unread { background: #f4f9ff; }
.notif-item.unread b::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-600); margin-right: 6px; vertical-align: middle; }
.notif-item small { color: var(--muted); display: block; }

/* Thanh tab dưới (điện thoại) */
.tabbar { display: none; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(6, 26, 51, .38); z-index: 150; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 160; background: #fff; border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .28s var(--ease); max-height: 82vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.sheet::before { content: ''; display: block; width: 42px; height: 5px; border-radius: 3px; background: #d5dfeb; margin: 2px auto 12px; }
body.sheet-open .sheet { transform: none; }
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; border-radius: 14px; color: var(--ink-2); font-size: 12.5px; text-align: center; font-weight: 550; }
.sheet-grid a .ic { width: 24px; height: 24px; color: var(--blue-600); }
.sheet-grid a.active { background: var(--blue-50); color: var(--blue-700); }
.sheet h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 4px 6px; }

/* ---------- Hộp thoại ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 18px; box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); color: var(--ink); }
dialog.modal::backdrop { background: rgba(6, 26, 51, .45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modal-in .22s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: var(--surface-2); }

/* ---------- Biểu đồ ---------- */
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--line-2); }
.chart .base { stroke: #c7d5e6; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .b1 { fill: var(--blue-600); }
.chart .b2 { fill: #34c3a0; }
.chart rect:hover { opacity: .8; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 110px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.bar-track { height: 10px; background: var(--blue-50); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--blue-700)); border-radius: 6px; }

/* ---------- Dòng hàng động (đơn, báo giá, phiếu nhập, VIP) ---------- */
.lines .line { display: grid; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 10px; background: var(--surface-2); }
.lines-order .line { grid-template-columns: minmax(200px, 2.4fr) minmax(120px, 1.2fr) 100px 130px 130px 40px; }
.lines-receipt .line { grid-template-columns: minmax(200px, 2.4fr) minmax(120px, 1.2fr) 100px 140px 130px 40px; }
.lines-vip .line { grid-template-columns: minmax(200px, 3fr) 120px 130px 40px; }
.line .line-total { font-weight: 700; text-align: right; padding-bottom: 10px; font-variant-numeric: tabular-nums; }
.line .line-sub { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.summary { display: flex; flex-direction: column; gap: 8px; }
.summary .srow { display: flex; justify-content: space-between; gap: 10px; }
.summary .srow.total { font-size: 18px; font-weight: 700; padding-top: 10px; border-top: 1px dashed var(--line); }
.sticky-side { position: sticky; top: calc(var(--topbar-h) + 12px); }

/* ---------- Đăng nhập / đăng ký ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(110deg, rgba(var(--accent-rgb), .55), rgba(var(--blue-rgb), .35) 60%, rgba(0, 0, 0, .25)), var(--hero-image) center / cover no-repeat, linear-gradient(120deg, var(--accent-700), var(--accent-900) 35%, var(--blue-800) 70%, var(--blue-950)); }
.auth-art .brand { border: 0; padding: 0; color: #fff; }
.auth-art .brand small { color: rgba(255, 255, 255, .78); }
.auth-art h2 { font-size: 34px; line-height: 1.2; max-width: 460px; font-weight: 700; }
.auth-art p { color: rgba(255, 255, 255, .86); max-width: 420px; font-size: 15.5px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 760px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .card { padding: 28px; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 22px; font-weight: 700; height: 56px; }
.totp-setup { display: flex; gap: 20px; align-items: center; }
.totp-qr { flex: none; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; line-height: 0; }
.totp-qr svg { width: 180px; height: 180px; }
@media (max-width: 560px) { .totp-setup { flex-direction: column; align-items: flex-start; } .totp-qr svg { width: 220px; height: 220px; } }
.secret-box { font-family: ui-monospace, monospace; font-size: 17px; letter-spacing: .12em; background: var(--blue-50); border: 1px dashed var(--blue-300); border-radius: 12px; padding: 14px; text-align: center; word-break: break-all; color: var(--blue-900); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, monospace; }
.codes span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }

/* Pháo hoa trang trí bằng CSS (không dùng ảnh) */
.sparks { position: absolute; inset: 0; pointer-events: none; }
.sparks i { position: absolute; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, transparent 30%, rgba(255, 255, 255, .0) 31%), repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .85) 0deg 2deg, transparent 2deg 15deg); -webkit-mask: radial-gradient(circle, transparent 18%, #000 20%, #000 55%, transparent 70%); mask: radial-gradient(circle, transparent 18%, #000 20%, #000 55%, transparent 70%); opacity: .5; animation: burst 4.5s ease-out infinite; }
.sparks i:nth-child(1) { top: 8%; right: 10%; }
.sparks i:nth-child(2) { top: 40%; right: 38%; width: 120px; height: 120px; animation-delay: 1.4s; filter: hue-rotate(-30deg); }
.sparks i:nth-child(3) { bottom: 12%; right: 6%; width: 220px; height: 220px; animation-delay: 2.6s; }
.sparks i:nth-child(4) { top: 14%; left: 42%; width: 90px; height: 90px; animation-delay: .7s; }
@keyframes burst { 0% { transform: scale(.2); opacity: 0; } 20% { opacity: .8; } 70% { opacity: .35; } 100% { transform: scale(1.15); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sparks i, .page, .toast { animation: none !important; } }

/* =========================================================
   TRANG TRƯNG BÀY CÔNG KHAI
   ========================================================= */
.site { background: #fff; }
.site-header { position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid var(--line-2); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }
.site-header .brand { border: 0; padding: 0; height: auto; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { padding: 8px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 550; }
.site-nav a:hover { background: var(--blue-50); color: var(--blue-700); }
.site-nav a.active { color: var(--blue-700); background: var(--blue-50); }
.site-header .hd-search { flex: 1; max-width: 360px; margin-left: auto; }
.site-header .hd-actions { display: flex; gap: 8px; align-items: center; }
.wrap { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.ref-bar { background: linear-gradient(90deg, #fff7e0, #fff1c7); color: #7a5200; font-size: 13.5px; }
.ref-bar .wrap { display: flex; gap: 12px; align-items: center; height: 40px; }

.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(90deg, rgba(var(--accent-rgb), .78) 0%, rgba(var(--accent-rgb), .35) 38%, rgba(var(--blue-rgb), .25) 70%, rgba(var(--blue-rgb), .55) 100%), linear-gradient(180deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .35)), var(--hero-image) center / cover no-repeat, linear-gradient(120deg, var(--accent-700), var(--accent-900) 35%, var(--blue-800) 70%, var(--blue-950)); }
.hero h1, .hero p { text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; padding: 72px 0 84px; }
.hero h1 { font-size: 46px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.hero p { color: rgba(255, 255, 255, .9); font-size: 17px; max-width: 520px; margin: 18px 0 28px; }
.hero .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-light { background: #fff; color: var(--blue-800); border-color: #fff; }
.hero .btn-light:hover { background: var(--blue-50); color: var(--blue-900); }
.hero .btn-glass { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero .btn-glass:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.hero-stats { display: flex; gap: 28px; margin-top: 36px; }
.hero-stats b { font-size: 26px; display: block; color: var(--gold); }
.hero-stats span { color: rgba(255, 255, 255, .8); font-size: 13.5px; }
.hero-visual { position: relative; height: 380px; }
.hero-card { position: absolute; background: rgba(255, 255, 255, .96); color: var(--ink); border-radius: 18px; padding: 14px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); width: 230px; animation: float 6s ease-in-out infinite; }
.hero-card:nth-child(1) { top: 0; left: 0; }
.hero-card:nth-child(2) { top: 40px; right: 0; animation-delay: -2s; }
.hero-card:nth-child(3) { bottom: -10px; left: 18%; animation-delay: -4s; z-index: 2; }
.products-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.p-card form { flex-wrap: wrap; }
.hero-card img { width: 100%; height: 110px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.hero-card b { display: block; font-size: 14px; }
.hero-card .price { color: var(--accent-600); font-weight: 700; }
@keyframes float { 50% { transform: translateY(-10px); } }

.section { padding: 56px 0; }
.section-alt { background: var(--bg); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { font-size: 28px; font-weight: 750; }
.section-head p { color: var(--muted); margin: 6px 0 0; }
.cat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.cat-tile { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line); color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.cat-tile .ci { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.cat-tile b { font-size: 15.5px; }
.cat-tile small { color: var(--muted); }

.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.p-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; color: var(--ink); }
.p-card:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -22px rgba(10, 42, 79, .35); border-color: #cfdcee; color: var(--ink); }
.p-card .p-img { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--blue-50), #fff); position: relative; overflow: hidden; }
.p-card .p-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.p-card:hover .p-img img { transform: scale(1.04); }
.p-card .p-tags { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.p-card .p-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.p-card .p-name { font-weight: 650; font-size: 15px; line-height: 1.35; }
.p-card .p-meta { color: var(--muted); font-size: 12.5px; }
.p-card .p-foot { margin-top: auto; display: flex; align-items: end; justify-content: space-between; gap: 8px; padding-top: 8px; }
.price-tag b { font-size: 18px; color: var(--accent-600); font-weight: 750; font-variant-numeric: tabular-nums; }
.price-tag small { display: block; color: var(--muted); font-size: 11.5px; }
.price-tag .contact { font-weight: 700; color: var(--amber); }

.shop-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.filters { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 18px; }
.filters h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.filters .f-link { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.filters .f-link:hover { background: var(--blue-50); }
.filters .f-link.on { background: var(--blue-600); color: #fff; }

.pd { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; padding: 32px 0 56px; }
.pd-gallery { border-radius: 22px; overflow: hidden; background: linear-gradient(135deg, var(--blue-50), #fff); border: 1px solid var(--line); aspect-ratio: 1 / 1; }
.pd-gallery img { width: 100%; height: 100%; object-fit: cover; }
.pd h1 { font-size: 32px; font-weight: 750; margin: 10px 0 8px; }
.pd .pd-price { display: flex; align-items: baseline; gap: 12px; margin: 18px 0; padding: 18px 20px; background: var(--blue-50); border-radius: 16px; }
.pd .pd-price b { font-size: 32px; color: var(--blue-700); font-weight: 800; }
.spec-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 18px 0; }
.spec-list div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; }
.spec-list small { color: var(--muted); display: block; font-size: 12px; }
.spec-list b { font-size: 15px; }
.safety { border-left: 4px solid var(--amber); background: var(--amber-bg); border-radius: 0 12px 12px 0; padding: 12px 16px; color: #7a5200; font-size: 14px; }

.store-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.store-card { padding: 22px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.store-card h3 { margin-bottom: 10px; }
.store-card p { display: flex; gap: 8px; color: var(--ink-2); margin: 6px 0; }

.cta-band { border-radius: 24px; padding: 36px 40px; color: #fff; display: flex; gap: 24px; align-items: center; justify-content: space-between; background: linear-gradient(110deg, var(--accent-700), var(--accent-900) 30%, var(--blue-800) 65%, var(--blue-600)); position: relative; overflow: hidden; }
.cta-band h2 { font-size: 26px; }
.cta-band p { color: rgba(255, 255, 255, .85); margin: 6px 0 0; }

.site-footer { background: var(--footer-bg); border-top: 3px solid var(--accent-600); color: rgba(255, 255, 255, .72); padding: 48px 0 28px; margin-top: 0; }
.site-footer .brand { color: #fff; border: 0; padding: 0; height: auto; }
.site-footer .brand small { color: rgba(255, 255, 255, .6); }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer .cols-4 { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.site-footer .cols-5 { grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr; }
.site-footer .cols-6 { grid-template-columns: 1.2fr repeat(5, 1fr); }
.site-footer h4::after { content: ''; display: block; width: 28px; height: 2px; margin-top: 8px; background: var(--gold); border-radius: 2px; }
.site-footer h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.site-footer a { color: rgba(255, 255, 255, .72); display: block; padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.site-footer .copy { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 32px; padding-top: 18px; font-size: 13px; }

.maint { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; color: #fff; background: linear-gradient(110deg, rgba(var(--accent-rgb), .6), rgba(var(--blue-rgb), .45)), var(--hero-image) center / cover no-repeat, linear-gradient(160deg, var(--accent-800), var(--blue-800)); position: relative; overflow: hidden; }
.maint h1 { font-size: 34px; margin: 18px 0 10px; }
.maint p { color: rgba(255, 255, 255, .88); max-width: 520px; margin: 0 auto 22px; }

/* Bản in (phiếu xuất, báo giá) */
.print-page { max-width: 900px; margin: 24px auto; background: #fff; padding: 40px 44px; border-radius: 12px; box-shadow: var(--shadow); }
.print-page h1 { text-align: center; font-size: 22px; text-transform: uppercase; margin: 10px 0 4px; }
.print-page .table th { position: static; }
.print-page .sign { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 36px; gap: 10px; }
.print-page .sign small { display: block; color: var(--muted); margin-bottom: 70px; }
.print-bar { max-width: 900px; margin: 16px auto 0; display: flex; gap: 10px; justify-content: flex-end; }
@media print {
  body { background: #fff; }
  .print-bar, .no-print { display: none !important; }
  .print-page { box-shadow: none; margin: 0; padding: 0; max-width: none; }
}

/* =========================================================
   ĐÁP ỨNG: máy tính bảng & điện thoại (giao diện kiểu ứng dụng)
   ========================================================= */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 960px) {
  body { font-size: 15px; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); background: rgba(255, 255, 255, .9); border-bottom-color: var(--line-2); }
  .topbar .top-title { display: block; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .top-search, .topbar .hide-m { display: none; }
  .page { padding: 12px 14px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .crumbs { display: none; }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 21px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; background: none; border: 0; font-family: inherit; position: relative; cursor: pointer; }
  .tabbar .ic { width: 23px; height: 23px; transition: transform .2s var(--ease); }
  .tabbar a.active, .tabbar button.active { color: var(--blue-600); }
  .tabbar a.active .ic { transform: translateY(-1px) scale(1.08); }
  .tabbar .tb-badge { position: absolute; top: 6px; left: 54%; min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px; background: var(--red); color: #fff; font-size: 10.5px; display: grid; place-items: center; }
  .grid-2, .grid-3, .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-cards { grid-template-columns: repeat(3, minmax(220px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -14px 16px; padding: 2px 14px 6px; scrollbar-width: none; }
  .status-cards > * { scroll-snap-align: start; }
  .status-card .sc-head { font-size: 16px; padding: 10px 16px; }
  .status-card .sc-row { padding: 8px 16px; }
  .status-card .sc-row b { font-size: 19px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .kpi-val { font-size: 19px; }
  .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .form-grid .span-2 { grid-column: auto; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar > * { flex: 1 1 auto; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .dl { grid-template-columns: 120px 1fr; }
  .sticky-side { position: static; }
  /* Bảng → danh sách thẻ */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .table-cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-cards td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  .table-cards td[data-label=""]::before, .table-cards td:not([data-label])::before { display: none; }
  .table-cards td.cell-title { display: block; text-align: left; font-weight: 650; font-size: 15px; padding-bottom: 6px; }
  .table-cards td.actions { justify-content: flex-end; padding-top: 8px; }
  .table-cards .prod-cell { min-width: 0; }
  .table-cards .clip { max-width: 60%; }
  .lines .line { grid-template-columns: 1fr 1fr !important; }
  .lines .line > :first-child { grid-column: 1 / -1; }
  .line .line-total { text-align: left; padding-bottom: 0; }
  .dropdown-menu.notif-menu { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; }
  #toasts { left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .bar-row { grid-template-columns: 110px 1fr 90px; }
  /* Công khai */
  .site-nav, .site-header .hd-search { display: none; }
  .site-header .wrap { height: 60px; }
  .wrap { width: calc(100% - 28px); }
  .hero .wrap { grid-template-columns: 1fr; padding: 40px 0 48px; }
  .hero h1 { font-size: 32px; }
  .hero-visual { display: none; }
  .products, .products-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .p-card form .select { flex: 1 1 100% !important; }
  .p-card { border-radius: 14px; }
  .p-card .p-body { padding: 10px 12px 12px; }
  .p-card .p-name { font-size: 14px; }
  .price-tag b { font-size: 16px; }
  .cat-row { grid-template-columns: repeat(5, 150px); overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 4px; }
  .shop-layout { grid-template-columns: 1fr; }
  .filters { position: static; flex-direction: row; overflow-x: auto; }
  .filters .card { min-width: 100%; }
  .pd { grid-template-columns: 1fr; gap: 20px; padding-top: 12px; }
  .pd h1 { font-size: 24px; }
  .store-grid { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
  .section-head h2 { font-size: 22px; }
  .section-head { flex-direction: column; align-items: stretch; }
  .ref-bar .hide-m, .site-header .hide-m { display: none; }
  .section-head form .input { width: 100% !important; }
  .site-header .brand small { display: none; }
  .site-header .brand b { font-size: 15px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cta-band { flex-direction: column; align-items: flex-start; padding: 26px; }
  .site-body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form { padding: 24px 14px; align-items: flex-start; }
  .auth-card .card { padding: 20px; }
  .print-page { padding: 20px; margin: 0; border-radius: 0; }
}
@media (max-width: 420px) {
  .grid-4, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats { gap: 18px; }
}

/* ===================== SEO, tin tức, thống kê (v1.5) ===================== */
.input-group .addon { display: flex; align-items: center; padding: 0 10px; background: var(--surface-2); border: 1px solid var(--line); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); white-space: nowrap; }
.input-group .addon + .input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.select.sm { height: 34px; padding: 0 28px 0 10px; font-size: 13px; width: auto; }
.segmented.sm span { padding: 4px 10px; font-size: 12px; }
.tabs.tabs-sm { margin: 4px 0 0; }
.tabs.tabs-sm a { font-size: 13px; padding: 6px 10px; }
.muted-l { color: rgba(255, 255, 255, .55); }
.h-page { font-size: 28px; font-weight: 750; letter-spacing: -.01em; }

.seo-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #c6d1df; flex: none; vertical-align: middle; }
.seo-dot.good { background: var(--green); } .seo-dot.ok { background: var(--amber); } .seo-dot.bad { background: var(--red); }
.seo-box .card-head .flex { gap: 6px; align-items: center; }
.seo-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seo-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.seo-checks li .seo-dot { margin-top: 4px; }
.seo-checks li b { color: var(--ink); font-weight: 600; }
.meter { height: 4px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; width: 0; background: #c6d1df; transition: width .2s, background .2s; }
.meter i.good { background: var(--green); } .meter i.ok { background: var(--amber); } .meter i.bad { background: var(--red); }
.serp-wrap { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.serp { margin-top: 10px; background: #fff; border-radius: 10px; padding: 12px 14px; max-width: 420px; font-family: Arial, sans-serif; box-shadow: var(--shadow-sm); }
.serp.desktop { max-width: 600px; }
.serp-site { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.serp-fav { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--accent-500), var(--blue-600)); flex: none; }
.serp-name { font-size: 14px; color: #202124; line-height: 1.2; }
.serp-url { font-size: 12px; color: #4d5156; line-height: 1.3; word-break: break-all; }
.serp-title { color: #1a0dab; font-size: 18px; line-height: 1.3; margin-bottom: 4px; }
.serp.desktop .serp-title { font-size: 20px; }
.serp-desc { color: #4d5156; font-size: 14px; line-height: 1.55; }
.serp-desc b { color: #202124; }

.title-input { font-size: 22px; font-weight: 700; height: 54px; }
.editor { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: var(--topbar-h); z-index: 3; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.editor-bar button { min-width: 34px; height: 34px; padding: 0 8px; border: 0; background: transparent; border-radius: 8px; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 14px; }
.editor-bar button:hover { background: var(--blue-50); }
.editor-bar button.on { background: var(--blue-100); color: var(--blue-700); }
.editor-bar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.editor-area { min-height: 360px; padding: 18px 20px; outline: none; }
.editor-area:focus { box-shadow: inset 0 0 0 2px var(--blue-100); }
.editor-src { border: 0; border-radius: 0; min-height: 360px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.editor-foot { padding: 8px 12px; border-top: 1px solid var(--line-2); }

.prose { font-size: 16.5px; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 24px; line-height: 1.3; margin-top: 1.6em; font-weight: 750; }
.prose h3 { font-size: 20px; line-height: 1.35; margin-top: 1.4em; font-weight: 700; }
.prose h4 { font-size: 17px; margin-top: 1.2em; font-weight: 700; }
.prose p { margin: 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--blue-600); text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--blue-500); background: var(--blue-50); border-radius: 0 10px 10px 0; color: var(--ink-2); }
.prose img { max-width: 100%; height: auto; border-radius: 12px; display: block; }
.prose figure { margin: 1.4em 0; }
.prose figcaption { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 6px; }
.prose pre { background: #0f2440; color: #e6eefb; padding: 14px; border-radius: 10px; overflow: auto; font-size: 14px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--ink-2); }
.breadcrumbs a:hover { color: var(--blue-600); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip { text-decoration: none; }
.chips .chip.on { background: var(--blue-600); color: #fff; }
.chips .chip.on .muted { color: var(--blue-100); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s var(--ease), box-shadow .2s; }
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.post-thumb { display: block; aspect-ratio: 1200/630; background: var(--blue-50); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.post-body h3 { font-size: 17px; line-height: 1.4; margin: 0; }
.post-body h3 a { color: var(--ink); }
.post-body h3 a:hover { color: var(--blue-600); }
.post-body p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.post-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.wrap.narrow { max-width: 780px; }
.article-head h1 { font-size: 34px; line-height: 1.25; letter-spacing: -.01em; margin: 12px 0 10px; }
.article-cover { margin: 22px 0; }
.article-cover img { width: 100%; height: auto; border-radius: var(--radius); display: block; }
.toc { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 24px; }
.toc ol { margin: 8px 0 0; padding-left: 20px; }
.toc li { margin: 4px 0; } .toc li.lv3 { margin-left: 16px; list-style: circle; }
.toc a { color: var(--ink-2); }
.share { display: flex; gap: 8px; align-items: center; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.stat-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; font-size: 14px; }
.stat-row .hbar { grid-column: 1 / -1; }
.hbar { height: 6px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--blue-600)); border-radius: 6px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; height: 140px; align-items: end; }
.hours div { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.hours i { width: 100%; background: var(--blue-500); border-radius: 4px 4px 0 0; min-height: 2px; }
.hours span { font-size: 11px; color: var(--muted); height: 14px; }
.contact-row { display: grid; grid-template-columns: 150px 1fr 1.6fr 36px; gap: 8px; align-items: center; }

@media (max-width: 960px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .article-head h1 { font-size: 26px; }
  .contact-row { grid-template-columns: 1fr 36px; }
  .contact-row .select { grid-column: 1 / -1; }
  .contact-row input[name$="[label]"] { grid-column: 1 / -1; }
  .editor-area { min-height: 260px; padding: 14px; }
  .h-page { font-size: 24px; }
}
.input-group .addon ~ .input { padding-right: 12px; }
@media (max-width: 1440px) {
  .site-header .wrap { gap: 16px; }
  .site-nav a { padding: 8px 10px; }
  .site-header .hd-search { min-width: 150px; }
  .hd-actions .btn-ghost.hide-m[href^="tel:"] { display: none; }
}
.link-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 8px 8px 12px; }
.link-box code { flex: 1; word-break: break-all; background: none; padding: 0; }
.check-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; display: flex; flex-direction: column; gap: 4px; }
tr.muted td { opacity: .6; }
.bill-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 8px; }
.switch-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch-row input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 24px; background: #c6d1df; position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 2px 0 0; }
.switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch-row input:checked { background: var(--blue-600); }
.switch-row input:checked::after { transform: translateX(18px); }
.switch-row span { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: 12.5px; }

/* ---------- Logo ảnh & nút liên hệ nổi (bong bóng) ---------- */
.brand-img { object-fit: cover; padding: 0; background: #fff; }
.fab-contact { position: fixed; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 14px; pointer-events: none; }
.fab-contact.fab-left { left: 18px; }
.fab-contact.fab-right { right: 18px; }
.fab-contact:empty { display: none; }
.fab { pointer-events: auto; position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 22px -6px rgba(0, 0, 0, .45); transition: transform .2s var(--ease); }
.fab:hover { transform: scale(1.08); color: #fff; }
.fab .ic { width: 26px; height: 26px; }
.fab::before, .fab::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: inherit; z-index: -1; animation: fab-ring 2s ease-out infinite; }
.fab::after { animation-delay: 1s; }
.fab-zalo { background: #0068ff; }
.fab-zalo .fab-txt { font-weight: 800; font-size: 14.5px; letter-spacing: -.02em; }
.fab-phone { background: #12b347; }
.fab-phone .ic { animation: fab-shake 1.6s ease-in-out infinite; }
.fab-messenger { background: linear-gradient(135deg, #00b2ff, #a033ff 60%, #ff5c87); }
@keyframes fab-ring { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes fab-shake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .fab::before, .fab::after, .fab-phone .ic { animation: none; } }
@media (max-width: 960px) {
  .fab-contact { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); gap: 12px; }
  .fab-contact.fab-left { left: 12px; }
  .fab-contact.fab-right { right: 12px; }
  .fab { width: 50px; height: 50px; }
  .site-footer .cols-4, .site-footer .cols-5, .site-footer .cols-6 { grid-template-columns: 1fr 1fr; }
  .site-footer .cols > div:first-child { grid-column: 1 / -1; }
}

/* ---------- Trang cài đặt giao diện ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.swatch { position: relative; display: block; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch .sw-bar { display: flex; height: 46px; }
.swatch .sw-bar i { flex: 1; }
.swatch .sw-bar i:first-child { flex: 2; }
.swatch .sw-name { display: block; padding: 8px 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.swatch:has(input:checked) { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.swatch:has(input:checked) .sw-name::before { content: '✓ '; color: var(--blue-600); }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 48px; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; flex: none; }
.hero-thumb { width: 100%; max-width: 420px; aspect-ratio: 16 / 6; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; }

/* ---------- Phân loại kho ---------- */
.type-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.type-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 28%, #fff); white-space: nowrap; }
.type-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-pick label { cursor: pointer; }
.color-pick input { position: absolute; opacity: 0; pointer-events: none; }
.color-pick i { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.color-pick input:checked + i { box-shadow: 0 0 0 2px var(--ink); }
.store-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- Thanh toán & công nợ ---------- */
a.kpi { display: block; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.kpi:hover { color: inherit; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.pay-bar { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.pay-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #34c37a); border-radius: 8px; }
.pay-list { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 12px; }
.pay-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; }
.pay-item + .pay-item { border-top: 1px solid var(--line-2); }
.pay-form > summary { list-style: none; cursor: pointer; }
.pay-form > summary::-webkit-details-marker { display: none; }
.pay-form[open] > summary { display: none; }
.pos-deposit { display: flex; flex-direction: column; gap: 6px; }
.pos-deposit .flex { gap: 8px; }
.segmented.seg-block { display: flex; } .seg-block label { flex: 1; } .seg-block span { display: block; text-align: center; white-space: nowrap; padding: 8px 6px; font-size: 13.5px; }

/* ---------- Hạng thành viên ---------- */
.tier-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 22px; white-space: nowrap; border: 1px solid transparent; vertical-align: middle; letter-spacing: .01em; }
.tier-badge .ic { width: 14px; height: 14px; }
.tier-badge.tier-lg { font-size: 14px; padding: 4px 14px 4px 10px; line-height: 24px; }
.tier-badge.tier-lg .ic { width: 18px; height: 18px; }
.tier-thanh_vien { background: #eef1f5; color: #475569; border-color: #dbe2ea; }
.tier-bac { background: linear-gradient(135deg, #fbfcfd, #d5dbe3 55%, #aeb8c5); color: #334155; border-color: #b8c1cd; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.tier-vang { background: linear-gradient(135deg, #fff6d1, #f7cd4d 55%, #d9a210); color: #5c3d00; border-color: #e0ad22; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.tier-kim_cuong { background: linear-gradient(135deg, #67e8f9, #60a5fa 45%, #8b5cf6 80%, #6d28d9); color: #fff; border-color: #7c6cf0; text-shadow: 0 1px 2px rgba(46,16,101,.45); box-shadow: 0 0 0 1px rgba(255,255,255,.25) inset, 0 4px 14px -6px rgba(109,40,217,.7); }
.tier-card { position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px; color: #fff; display: flex; gap: 22px; align-items: center; }
.tier-card .tc-ic { flex: none; width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.tier-card .tc-ic .ic { width: 46px; height: 46px; }
.tier-card h2 { font-size: 28px; margin: 2px 0 4px; letter-spacing: -.01em; }
.tier-card .tc-sub { opacity: .88; font-size: 14px; }
.tier-card .tc-pts { margin-left: auto; text-align: right; }
.tier-card .tc-pts b { display: block; font-size: 34px; line-height: 1; }
.tier-card::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%); }
.tier-card.tier-thanh_vien { background: linear-gradient(120deg, #475569, #64748b 60%, #94a3b8); border: 0; }
.tier-card.tier-bac { background: linear-gradient(120deg, #6b7686, #9aa6b6 50%, #cfd6df); color: #fff; border: 0; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tier-card.tier-vang { background: linear-gradient(120deg, #a86e00, #e0a50f 50%, #f7d35c); color: #fff; border: 0; text-shadow: 0 1px 2px rgba(80,50,0,.35); }
.tier-card.tier-kim_cuong { background: linear-gradient(120deg, #4c1d95, #7c3aed 40%, #3b82f6 75%, #22d3ee); border: 0; }
.tier-progress { height: 10px; border-radius: 10px; background: rgba(255,255,255,.3); overflow: hidden; margin-top: 12px; }
.tier-progress i { display: block; height: 100%; background: #fff; border-radius: 10px; }
.tier-ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tier-step { position: relative; border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.tier-step.on { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.tier-step.off { opacity: .65; }
.tier-step .ts-head { display: flex; align-items: center; gap: 10px; }
.tier-step .ts-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.tier-step .ts-ic .ic { width: 24px; height: 24px; }
.tier-step ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.tier-step .ts-now { position: absolute; top: -10px; right: 14px; background: var(--blue-600); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 1px 9px; }
.tier-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tier-pick label { cursor: pointer; }
.tier-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tier-pick input:checked + .tier-badge { outline: 2px solid var(--ink); outline-offset: 2px; }
.tier-cfg td { vertical-align: top; }
.tier-cfg .input, .tier-cfg .textarea { min-width: 0; }
@media (max-width: 960px) {
  .tier-ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tier-card { flex-wrap: wrap; padding: 20px; gap: 14px; }
  .tier-card .tc-ic { width: 64px; height: 64px; border-radius: 18px; }
  .tier-card .tc-ic .ic { width: 34px; height: 34px; }
  .tier-card .tc-pts { margin-left: 0; text-align: left; width: 100%; }
}

/* ---------- Hợp đồng điện tử (khổ A4) ---------- */
.hd-paper { background: #fff; max-width: 820px; margin: 0 auto; padding: 56px 64px 64px 80px; box-shadow: var(--shadow); border-radius: 6px; color: #111; }
.hd-doc { font-family: "Times New Roman", Tinos, "Liberation Serif", serif; font-size: 16.5px; line-height: 1.5; }
.hd-doc p { margin: 0 0 7px; text-align: justify; }
.hd-doc .hd-center { text-align: center; }
.hd-doc .hd-right { text-align: right; }
.hd-doc .hd-title { text-align: center; font-size: 20px; margin: 22px 0 16px; }
.hd-doc .hd-indent { text-indent: 2em; }
.hd-doc table { width: 100%; border-collapse: collapse; margin: 0 0 10px; }
.hd-doc table td, .hd-doc table th { vertical-align: top; padding: 2px 6px; border: 0; width: 50%; }
.hd-doc table.hd-border td, .hd-doc table.hd-border th { border: 1px solid #333; width: auto; }
.hd-doc .hd-sign { margin-top: 26px; }
.hd-doc .hd-sign-space { display: block; height: 70px; }
.hd-doc .hd-unsigned { color: #b0b7c3; font-style: italic; height: auto; padding: 24px 0; }
.hd-doc .hd-blank { color: #c2410c; background: #fff3e0; border-bottom: 1px dashed #f59e0b; padding: 0 2px; }
.hd-doc .hd-signed { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; margin: 8px 0; border: 2px solid #0f9d58; border-radius: 10px; color: #0b6b3d; transform: rotate(-2deg); }
.hd-doc .hd-signed-name { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 24px; line-height: 1.1; }
.hd-doc .hd-signed-note { font-size: 13px; font-style: italic; }
.hd-doc .hd-signed-time { font-size: 12px; }
.hd-status { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hd-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-vars button { border: 1px dashed var(--blue-300); background: var(--blue-50); color: var(--blue-800); border-radius: 8px; padding: 3px 8px; font: inherit; font-size: 12.5px; cursor: pointer; }
.editor-area.hd-doc { min-height: 480px; padding: 24px 32px; }
.print-page .hd-paper, .hd-print .hd-paper { box-shadow: none; }
@media (max-width: 760px) { .hd-paper { padding: 22px 16px; } .hd-doc { font-size: 15px; } .hd-doc table td { display: block; width: 100%; } }
@media print {
  .hd-print { background: #fff !important; }
  .hd-print .hd-paper { max-width: none; padding: 0; margin: 0; border-radius: 0; }
  .hd-doc .hd-blank { background: none; color: #000; }
  .hd-doc table td { display: table-cell !important; width: 50% !important; }
  @page { size: A4; margin: 2cm 2cm 2cm 3cm; }
}
.hd-doc .hd-head { font-size: 15px; }
.hd-doc .hd-sign-a { display: block; min-height: 70px; }
.hd-doc .hd-sign-img, .hd-sign-box .hd-sign-img { display: inline-block; max-width: 100%; height: auto; }
.hd-sign-box { border: 1px dashed var(--line); border-radius: 12px; padding: 14px; background: repeating-conic-gradient(#f3f5f8 0% 25%, #fff 0% 50%) 50% / 16px 16px; text-align: center; }

/* Trình soạn báo giá */
.qb-bar-in { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.qb-bar-in .field { min-width: 220px; flex: 1; max-width: 340px; margin: 0; }
.qb-main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.qb-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; }
.qb-search input { flex: 1; border: 0; outline: 0; height: 44px; font: inherit; background: none; }
.qb-kinds { display: flex; gap: 6px; margin: 10px 0 12px; }
.qb-kinds button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 14px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink-2); }
.qb-kinds button.on { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.qb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 70vh; overflow-y: auto; padding: 2px; }
.qb-card { position: relative; display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; overflow: hidden; cursor: pointer; font: inherit; padding: 0; transition: border-color .15s, box-shadow .15s; }
.qb-card:hover, .qb-card:focus-visible { border-color: var(--blue-500, var(--blue-600)); box-shadow: 0 6px 18px -8px rgba(var(--blue-rgb), .5); outline: 0; }
.qb-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: linear-gradient(135deg, var(--blue-50), #fff); display: block; }
.qb-card .qb-info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.qb-card b { font-size: 13.5px; line-height: 1.3; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.qb-card small { color: var(--muted); font-size: 12px; }
.qb-card .qb-price { font-size: 15px; font-weight: 800; color: var(--accent-700, #c4161c); }
.qb-card .qb-in { position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--blue-600); color: #fff; font-size: 12.5px; font-weight: 700; display: none; place-items: center; }
.qb-card.has .qb-in { display: grid; }
.qb-card.has { border-color: var(--blue-600); }
.qb-none, .qb-empty { color: var(--muted); text-align: center; padding: 18px 8px; font-size: 14px; }
.qb-lines:not(:empty) + .qb-empty { display: none; }
.qb-lines-head { display: flex; align-items: center; justify-content: space-between; }
.qb-line { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.qb-line img { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; background: var(--blue-50); }
.qb-line .qn { font-weight: 650; font-size: 14px; line-height: 1.3; }
.qb-line .qn small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.qb-line .qx { border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.qb-line .qx:hover { color: var(--red); }
.qb-line .qrow { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qb-line .qrow .select { width: auto; min-width: 100px; flex: 1; height: 38px; padding-top: 0; padding-bottom: 0; }
.qb-line .qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qb-line .qty button { width: 32px; height: 38px; border: 0; background: var(--blue-50); color: var(--blue-700); font-size: 18px; cursor: pointer; }
.qb-line .qty input { width: 48px; height: 38px; border: 0; text-align: center; font: inherit; font-weight: 700; }
.qb-line .qprice { width: 120px; height: 38px; text-align: right; font-weight: 700; }
.qb-line .qprice.edited { border-color: var(--gold, #d9a400); background: #fffbea; }
.qb-line .qtot { font-weight: 800; margin-left: auto; font-variant-numeric: tabular-nums; }
.qb-line .qinfo { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.qb-line .qinfo.warn { color: var(--red); }
.qb-actions { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 899px) {
  .qb-main { grid-template-columns: minmax(0, 1fr); }
  .qb-grid { max-height: 52vh; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .qb-bar-in .field { max-width: none; }
}

/* Chữ ký bằng tên CTV */
.sigpad canvas { width: 100%; max-width: 380px; height: auto; display: block; border: 1px dashed var(--blue-300); border-radius: 12px; background: #fff; margin: 6px 0; }
.sigpad-styles { display: flex; gap: 6px; flex-wrap: wrap; }
.sigpad-styles button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 4px 12px; cursor: pointer; font-size: 20px; line-height: 1.3; }
.sigpad-styles button.on { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 2px var(--blue-100); }
.hd-doc .hd-sign-ctv { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.hd-file { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.hd-file form { margin-top: 2px; }

/* ===== Đầu trang & chân trang kiểu nhập nhoáng: xanh đậm → đỏ ===== */
.site-header { background: linear-gradient(100deg, var(--blue-950, #08183a) 0%, var(--blue-900) 38%, var(--accent-900, #5b0f1c) 72%, var(--accent-700, #b5121b) 100%); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 6px 24px -12px rgba(0, 0, 0, .55); }
.site-header .wrap { height: 76px; gap: 20px; }
.site-header .brand, .site-header .brand b { color: #fff; }
.site-header .brand small { color: rgba(255, 255, 255, .72); }
.site-nav { gap: 2px; margin-left: 8px; }
.site-nav a { position: relative; color: rgba(255, 255, 255, .88); background: none; border-radius: 0; padding: 10px 14px; font-weight: 600; }
.site-nav a:hover { color: #fff; background: none; }
.site-nav a.active { color: var(--gold, #f5c542); background: none; }
.site-nav a.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--gold, #f5c542); }
.site-header .hd-search { max-width: 260px; }
.site-header .hd-search .input { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22); color: #fff; }
.site-header .hd-search .input::placeholder { color: rgba(255, 255, 255, .6); }
.site-header .hd-search .input:focus { background: rgba(255, 255, 255, .2); border-color: var(--gold, #f5c542); box-shadow: none; }
.site-header .hd-search .btn { color: #fff; }
.site-header .icon-btn { color: #fff; }
.site-header .btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .55); background: transparent; border-radius: 10px; }
.site-header .btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.site-header .btn-primary { background: var(--accent-600, #e11d2e); border-color: transparent; color: #fff; border-radius: 10px; box-shadow: 0 6px 16px -6px rgba(225, 29, 46, .8); }

.site-footer { position: relative; overflow: hidden; background: linear-gradient(100deg, var(--blue-950, #08183a) 0%, var(--blue-900) 40%, var(--accent-900, #5b0f1c) 78%, var(--accent-700, #b5121b) 100%); border-top: 0; color: rgba(255, 255, 255, .86); padding: 52px 0 24px; }
.site-footer::before { content: ''; position: absolute; right: -80px; top: -90px; width: 420px; height: 420px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .18) 0deg 1.2deg, transparent 1.2deg 10deg); -webkit-mask: radial-gradient(circle, transparent 14%, #000 16%, #000 50%, transparent 70%); mask: radial-gradient(circle, transparent 14%, #000 16%, #000 50%, transparent 70%); pointer-events: none; opacity: .7; }
.site-footer .wrap { position: relative; }
.site-footer .cols > div + div { padding-left: 24px; border-left: 1px solid rgba(255, 255, 255, .12); }
.site-footer .cols > div:last-child { border-left: 1px solid rgba(255, 255, 255, .12); }
.site-footer h4 { font-size: 19px; font-weight: 700; margin-bottom: 18px; }
.site-footer h4::after { width: 38px; height: 3px; margin-top: 10px; }
.site-footer .cols a { color: rgba(255, 255, 255, .88); padding: 5px 0; }
.site-footer .cols > div:not(:first-child):not(:last-child) a::before { content: '›'; margin-right: 8px; color: var(--gold, #f5c542); font-weight: 700; }
.site-footer .cols a:hover { color: var(--gold, #f5c542); }
.site-footer .muted-l { color: rgba(255, 255, 255, .6); }
.site-footer .copy { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .35); margin-top: 36px; padding-top: 20px; font-size: 14px; color: rgba(255, 255, 255, .9); }
.foot-badge { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--gold, #f5c542); color: var(--gold, #f5c542); border-radius: 999px; padding: 9px 20px; font-weight: 600; background: rgba(0, 0, 0, .18); }
@media (max-width: 960px) { .site-footer .cols > div + div { padding-left: 0; border-left: 0; } .site-header .wrap { height: 64px; } }

/* ===== Thanh trượt sản phẩm ===== */
.slider { position: relative; }
.slider-track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 6px 2px 18px; scrollbar-width: none; outline: 0; -webkit-overflow-scrolling: touch; }
.slider-track::-webkit-scrollbar { display: none; }
.slider-item { flex: 0 0 calc((100% - 60px) / 4); scroll-snap-align: start; min-width: 0; display: flex; }
.slider-item > * { flex: 1; }
.slider-btn { position: absolute; top: 42%; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(10, 42, 79, .5); transition: opacity .2s, transform .15s; }
.slider-btn:hover:not(:disabled) { background: var(--accent-600, #d7000f); border-color: transparent; color: #fff; transform: scale(1.06); }
.slider-btn:disabled { opacity: 0; pointer-events: none; }
.slider-btn.prev { left: -16px; } .slider-btn.prev svg { transform: rotate(180deg); }
.slider-btn.next { right: -16px; }
.slider.no-scroll .slider-btn { display: none; }
@media (max-width: 1100px) { .slider-item { flex-basis: calc((100% - 40px) / 3); } }
@media (max-width: 760px) { .slider-item { flex-basis: calc((100% - 16px) / 1.6); } .slider-track { gap: 16px; } .slider-btn { width: 38px; height: 38px; } .slider-btn.prev { left: -6px; } .slider-btn.next { right: -6px; } }
@media (prefers-reduced-motion: reduce) { .slider-track { scroll-behavior: auto; } }
