/* =========================================================
   Pháo Hoa – giao diện sáng, xanh nước biển chủ đạo
   Ưu tiên máy tính; trên điện thoại hoạt động như ứng dụng
   ========================================================= */
:root {
  --blue-950: #061a33;
  --blue-900: #0a2a4f;
  --blue-800: #0b3f7a;
  --blue-700: #0957b3;
  --blue-600: #0b6bd8;
  --blue-500: #2b86f0;
  --blue-300: #8cc0ff;
  --blue-100: #dcebff;
  --blue-50: #eef5ff;
  --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(--blue-500), #7cc4ff); 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(11, 107, 216, .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: #9fd0ff; }
@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%, #6fb8ff, var(--blue-600) 60%, var(--blue-800)); box-shadow: 0 6px 14px -6px rgba(11, 107, 216, .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(11, 107, 216, .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: radial-gradient(1200px 600px at 10% 0%, #1a73e8 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #0b3f7a 0%, transparent 60%), linear-gradient(160deg, #0a2a4f, #0b6bd8); }
.auth-art .brand { border: 0; padding: 0; color: #fff; }
.auth-art .brand small { color: #bcd8ff; }
.auth-art h2 { font-size: 34px; line-height: 1.2; max-width: 460px; font-weight: 700; }
.auth-art p { color: #cfe3ff; 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: radial-gradient(900px 500px at 80% 10%, rgba(43, 134, 240, .9), transparent 60%), radial-gradient(700px 500px at 0% 100%, rgba(11, 63, 122, .9), transparent 60%), linear-gradient(135deg, #082447 0%, #0b4d99 55%, #0b6bd8 100%); }
.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: #cfe3ff; 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: #eaf3ff; 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; }
.hero-stats span { color: #b9d6ff; 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(--blue-700); 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(--blue-700); 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(120deg, #0a2a4f, #0b6bd8); position: relative; overflow: hidden; }
.cta-band h2 { font-size: 26px; }
.cta-band p { color: #cfe3ff; margin: 6px 0 0; }

.site-footer { background: #071f3c; color: #a9c2e2; padding: 48px 0 28px; margin-top: 0; }
.site-footer .brand { color: #fff; border: 0; padding: 0; height: auto; }
.site-footer .brand small { color: #8fb0d8; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.site-footer a { color: #a9c2e2; 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(160deg, #0a2a4f, #0b6bd8); position: relative; overflow: hidden; }
.maint h1 { font-size: 34px; margin: 18px 0 10px; }
.maint p { color: #cfe3ff; 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; }
}
