/* SmartSale — kiểu dáng. Mọi lớp nằm dưới .qlbh để không ảnh hưởng wp-admin. */
.qlbh {
	--bg: #f4f5f7; --pn: #fff; --ln: #e3e6eb; --ln2: #eef0f3; --tx: #111827; --mu: #667085; --mu2: #98a2b3;
	--ac: #1f5eff; --ac-d: #1749cc; --ac2: #eef3ff; --ok: #087443; --ok2: #e8f6ee; --bad: #d1242f; --bad2: #fdecec; --warn: #b54708; --warn2: #fff4e5;
	--side: #0e1726; --side2: #16223a; --side-tx: #a8b3c7; --r: 10px; --sh: 0 1px 2px rgba(16, 24, 40, .05);
	--top: 32px; --hh: 58px;
	font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--tx); margin: 0 0 0 -20px; min-height: calc(100vh - var(--top)); background: var(--bg);
	display: grid; grid-template-columns: 236px minmax(0, 1fr); -webkit-font-smoothing: antialiased;
}
.qlbh * { box-sizing: border-box; }
.qlbh input, .qlbh select, .qlbh textarea { font: inherit; border: 1px solid var(--ln); border-radius: 8px; padding: 7px 10px; min-height: 36px; background: #fff; color: var(--tx); max-width: 100%; box-shadow: var(--sh); }
.qlbh input:focus, .qlbh select:focus, .qlbh textarea:focus { outline: 0; border-color: var(--ac); box-shadow: 0 0 0 3px rgba(31, 94, 255, .15); }
.qlbh input:disabled { background: #f2f4f7; color: var(--mu); }
.qlbh input.err { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(209, 36, 47, .12); }
.qlbh input[type=checkbox] { min-height: 0; box-shadow: none; accent-color: var(--ac); width: 16px; height: 16px; }
.qlbh small { color: var(--mu); }
.qlbh .r { text-align: right; }
.qlbh .b { font-weight: 600; }
.qlbh .ok { color: var(--ok); }
.qlbh .bad { color: var(--bad); }
.qlbh .muted, .qlbh tr.muted td { color: var(--mu); }
.qlbh h3 { font-size: 15px; font-weight: 650; margin: 22px 0 10px; }
.qlbh .tag { background: var(--ln2); color: var(--mu); border-radius: 99px; padding: 1px 8px; font-size: 11px; font-weight: 500; }
.qlbh code { background: var(--ln2); border-radius: 4px; padding: 0 4px; }
.qb-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* nút */
.qb-btn { font: inherit; font-weight: 500; border: 1px solid var(--ln); background: #fff; color: var(--tx); border-radius: 8px; padding: 7px 14px; min-height: 36px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; box-shadow: var(--sh); transition: background .12s, border-color .12s; }
.qb-btn:hover { background: #f9fafb; border-color: #cfd4dc; }
.qb-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(31, 94, 255, .25); }
.qb-btn:disabled { opacity: .5; cursor: default; }
.qb-btn.primary { background: var(--ac); border-color: var(--ac); color: #fff; font-weight: 600; }
.qb-btn.primary:hover { background: var(--ac-d); border-color: var(--ac-d); }
.qb-btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.qb-btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.qb-btn.ghost:hover { background: var(--ln2); }
.qb-btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.qb-btn.on { background: var(--ac2); border-color: var(--ac); color: var(--ac); font-weight: 600; }
.qb-btn.huge { width: 100%; justify-content: center; min-height: 54px; font-size: 18px; margin-top: 12px; letter-spacing: .02em; border-radius: 10px; }
.qb-btn.huge small { color: rgba(255,255,255,.75); font-size: 12px; }
.qb-chip { font: inherit; font-size: 13px; border: 1px solid var(--ln); background: #fff; border-radius: 99px; padding: 4px 12px; cursor: pointer; }
.qb-chip:hover { border-color: var(--ac); color: var(--ac); }
.qb-chip.on { background: var(--ac2); border-color: var(--ac); color: var(--ac); }
.qb-x { border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--mu); padding: 2px 6px; border-radius: 6px; }
.qb-x:hover { color: var(--bad); background: var(--bad2); }
.qb-chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.qb-badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 2px 10px; background: var(--ln2); color: var(--mu); }
.qb-badge.ok { background: var(--ok2); color: var(--ok); }
.qb-badge.bad { background: var(--bad2); color: var(--bad); }
.qb-badge.r-manager { background: #efe9ff; color: #5b34c9; }
.qb-badge.r-accountant { background: #e6f4ff; color: #0b5cad; }
.qb-badge.r-warehouse { background: var(--warn2); color: var(--warn); }
.qb-badge.r-cashier { background: var(--ok2); color: var(--ok); }

/* khung: thanh bên + nội dung */
.qb-side { background: var(--side); color: var(--side-tx); position: sticky; top: var(--top); height: calc(100vh - var(--top)); display: flex; flex-direction: column; overflow: hidden; z-index: 60; }
.qb-side-h { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.qb-logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #3b7bff, #1f5eff); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.qb-brand { color: #fff; font-weight: 650; font-size: 15px; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-brand select.qb-store { width: 100%; background: var(--side2); color: #fff; border-color: rgba(255,255,255,.12); font-weight: 600; box-shadow: none; }
.qb-nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; scrollbar-width: thin; scrollbar-color: #2a3650 transparent; }
.qb-ng { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #67748c; padding: 14px 10px 6px; }
.qb-nav a { display: flex; align-items: center; gap: 11px; color: var(--side-tx); text-decoration: none; padding: 8px 10px; border-radius: 8px; margin: 1px 0; font-weight: 500; position: relative; }
.qb-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.qb-nav a.on { background: rgba(59,123,255,.16); color: #fff; }
.qb-nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #3b7bff; }
.qb-nav a.on .qb-ic { color: #7aa5ff; }
.qb-nav a:focus { box-shadow: none; outline: 0; }
.qb-nav a:focus-visible { outline: 2px solid #3b7bff; outline-offset: -2px; }
.qb-side-f { font-size: 11px; color: #8b97ad; padding: 10px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.qb-scrim { display: none; }
.qb-body { min-width: 0; display: flex; flex-direction: column; }
.qb-top { display: flex; align-items: center; gap: 8px; height: var(--hh); padding: 0 20px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--ln); position: sticky; top: var(--top); z-index: 50; }
.qb-top .sp { flex: 1; }
.qb-title { font-size: 18px; font-weight: 650; margin: 0; padding: 0; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-menu { display: none; }
.qb-full { color: var(--mu); }
.qb-bell { color: var(--mu); position: relative; }
.qb-lic { display: flex; align-items: center; gap: 8px; padding: 9px 20px; background: var(--warn2); color: var(--warn); border-bottom: 1px solid var(--ln); font-weight: 600; }
.qb-lic[hidden] { display: none; }
.qb-lic.bad { background: var(--bad2); color: var(--bad); }
.qb-scard .lic.bad { color: var(--bad); }
.qb-scard .lic.warn { color: var(--warn); }
.qb-spi { flex-wrap: wrap; gap: 14px; }
.qb-bell .cnt { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.qb-bell .cnt[hidden] { display: none; }
.qb-notices { list-style: none; margin: 0 0 12px; padding: 0; max-height: 60vh; overflow: auto; }
.qb-notices li { padding: 9px 10px; border-bottom: 1px solid var(--ln2); }
.qb-notices li.new { background: var(--ac2); }
.qb-notices .muted { font-size: 12px; margin-top: 2px; }
.qb-main { padding: 20px; flex: 1; min-width: 0; }
.qb-loading, .qb-err { padding: 30px; grid-column: 1 / -1; }

.qb-user { position: relative; flex-shrink: 0; }
.qb-ub { padding: 4px 10px 4px 4px; gap: 9px; max-width: 260px; }
.qb-ub .av { width: 32px; height: 32px; border-radius: 50%; background: var(--ac2); color: var(--ac); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.qb-ub .nm { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; }
.qb-ub .nm b { font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.qb-ub .nm small { font-size: 12px; }
.qb-um { display: none; position: absolute; right: 0; top: 100%; margin-top: 6px; background: #fff; border: 1px solid var(--ln); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,24,40,.14); min-width: 230px; z-index: 70; padding: 6px; }
.qb-um.on { display: block; }
.qb-um a, .qb-um button { display: block; width: 100%; text-align: left; padding: 9px 12px; color: var(--tx); text-decoration: none; background: none; border: 0; border-radius: 7px; font: inherit; cursor: pointer; }
.qb-um a:hover, .qb-um button:hover { background: var(--ac2); color: var(--ac); }

/* wp-admin */
body.toplevel_page_qlbh #wpbody-content { padding-bottom: 0; }
body.toplevel_page_qlbh #wpfooter { display: none; }
body.toplevel_page_qlbh .notice, body.toplevel_page_qlbh .update-nag { display: none; }
body.qlbh-full #adminmenumain, body.qlbh-full #wpadminbar, body.qlbh-full #wpfooter { display: none; }
body.qlbh-full #wpcontent, body.qlbh-full #wpfooter { margin-left: 0; padding-left: 0; }
body.qlbh-full.wp-admin { padding-top: 0; }
html.wp-toolbar:has(body.qlbh-full) { padding-top: 0; }
body.qlbh-full .qlbh { margin-left: 0; --top: 0px; min-height: 100vh; }

/* thanh công cụ, lọc */
.qb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.qb-bar .sp { flex: 1; }
.qb-bar input[type=search] { min-width: 260px; }
.qb-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qb-totals { display: flex; flex-wrap: wrap; gap: 20px; margin: 4px 0 10px; color: var(--mu); }
.qb-totals b { color: var(--tx); }
.qb-note { display: flex; gap: 10px; align-items: flex-start; background: var(--warn2); color: #7a3306; border: 1px solid #fedf89; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.qb-note .qb-ic { color: var(--warn); margin-top: 1px; }
.qb-note:empty { display: none; }

/* bảng */
.qb-tbl-wrap { background: var(--pn); border: 1px solid var(--ln); border-radius: var(--r); overflow: auto; box-shadow: var(--sh); }
.qb-tbl { width: 100%; border-collapse: collapse; background: var(--pn); }
.qb-tbl th { text-align: left; font-weight: 600; color: var(--mu); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--ln); background: #f9fafb; position: sticky; top: 0; z-index: 1; }
.qb-tbl th.r { text-align: right; }
.qb-tbl td { padding: 10px 14px; border-bottom: 1px solid var(--ln2); vertical-align: middle; }
.qb-tbl tbody tr:last-child td { border-bottom: 0; }
.qb-tbl tbody tr:hover td { background: #fafbfc; }
.qb-tbl tr.click { cursor: pointer; }
.qb-tbl tr.click:hover td { background: #f3f6ff; }
.qb-tbl td.r, .qb-tbl th.r { font-variant-numeric: tabular-nums; }
.qb-empty1 { text-align: center; color: var(--mu); padding: 28px !important; }
.qb-panel > .qb-tbl, .qb-2col .qb-tbl { border: 1px solid var(--ln); border-radius: var(--r); overflow: hidden; border-collapse: separate; border-spacing: 0; }

/* bán hàng */
.qb-pos { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 16px; align-items: start; }
.qb-pos-l { min-width: 0; }
.qb-pos-r { background: var(--pn); border: 1px solid var(--ln); border-radius: 12px; padding: 16px; position: sticky; top: calc(var(--top) + var(--hh) + 16px); box-shadow: 0 4px 16px rgba(16,24,40,.06); }
.qb-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.qb-tab { font: inherit; font-weight: 500; border: 1px solid var(--ln); background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.qb-tab.on { background: var(--tx); color: #fff; border-color: var(--tx); }
.qb-tab.on small { color: #cbd5e1; }
.qb-tab .x { margin-left: 2px; opacity: .6; }
.qb-tab .x:hover { opacity: 1; }
.qb-tab.add { font-weight: 700; }
.qb-search { position: relative; display: block; }
.qb-search input { width: 100%; }
.qb-search.big input { min-height: 48px; font-size: 16px; padding-left: 14px; border-radius: 10px; }
.qb-bar .qb-search { min-width: 280px; }
.qb-dd { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: #fff; border: 1px solid var(--ln); border-radius: 10px; box-shadow: 0 16px 40px rgba(16,24,40,.16); max-height: 400px; overflow: auto; padding: 4px; }
.qb-ddi { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "t n r" "t m r"; gap: 0 12px; padding: 8px 10px; cursor: pointer; border-radius: 7px; }
.qb-ddi .qb-th { grid-area: t; align-self: center; }
.qb-ddi .n { grid-area: n; font-weight: 600; }
.qb-ddi .m { grid-area: m; color: var(--mu); font-size: 12px; }
.qb-ddi .r { grid-area: r; text-align: right; align-self: center; font-weight: 600; }
.qb-ddi .r small { display: block; font-weight: 400; }
.qb-ddi.hi, .qb-ddi:hover { background: var(--ac2); }
.qb-ddi.add { color: var(--ac); font-weight: 600; display: block; }
.qb-cart-wrap { background: var(--pn); border: 1px solid var(--ln); border-radius: 12px; margin-top: 10px; overflow: auto; box-shadow: var(--sh); }
.qb-cart td { padding: 8px 10px; }
.qb-cart .nm { font-weight: 600; }
.qb-cart input { width: 108px; text-align: right; }
.qb-cart input.q { width: 64px; text-align: center; }
.qb-cart tr.over td { background: #fff5f5; }
.qb-cart tr.over input.q { border-color: var(--bad); }
.qb-qty { display: inline-flex; align-items: center; }
.qb-qty button { border: 1px solid var(--ln); background: #f9fafb; width: 30px; height: 36px; cursor: pointer; font-size: 16px; color: var(--mu); }
.qb-qty button:hover { color: var(--tx); background: #f2f4f7; }
.qb-qty button:first-child { border-radius: 8px 0 0 8px; border-right: 0; }
.qb-qty button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.qb-qty input.q { border-radius: 0; box-shadow: none; }
.qb-empty { color: var(--mu); text-align: center; padding: 56px 10px; }
.qb-pp { margin-bottom: 12px; }
.qb-pp-sel { display: flex; justify-content: space-between; align-items: center; background: var(--ac2); border: 1px solid #d5e1ff; border-radius: 8px; padding: 8px 12px; }
.qb-pp-sel b { display: block; }
.qb-sum .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; }
.qb-sum .row input { width: 150px; text-align: right; }
.qb-sum .row.big { font-size: 17px; font-weight: 600; border-top: 1px dashed var(--ln); margin-top: 6px; padding-top: 12px; }
.qb-sum .row.big b { color: var(--ac); font-size: 26px; font-variant-numeric: tabular-nums; }
.qb-sum .row.sub { padding-top: 0; color: var(--mu); }
.qb-sum textarea { width: 100%; margin: 8px 0; }
.qb-inl { display: inline-flex; gap: 4px; align-items: center; }
.qb-inl input { width: 110px !important; }
.qb-meth { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.qb-meth .qb-btn { justify-content: center; }
.qb-quick { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; margin-bottom: 4px; }

/* hộp thoại */
.qb-modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100000; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; overflow: auto; animation: qbfade .12s; }
.qb-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 540px; box-shadow: 0 24px 64px rgba(15,23,42,.3); display: flex; flex-direction: column; max-height: 88vh; }
.qb-modal.wide { max-width: 940px; }
.qb-mh { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--ln2); font-size: 16px; }
.qb-mh b { font-weight: 650; }
.qb-mb { padding: 16px 20px; overflow: auto; }
.qb-mf { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--ln2); background: #fafbfc; border-radius: 0 0 14px 14px; }
@keyframes qbfade { from { opacity: 0; } to { opacity: 1; } }
.qb-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 10px; }
.qb-form > label:not(.qb-chk) { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: #344054; }
.qb-form > label > input, .qb-form > label > select { color: var(--tx); width: 100%; font-weight: 400; }
.qb-form .full { grid-column: 1 / -1; }
.qb-form > .lbl { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: #344054; }
.qb-form p.full { margin: -4px 0 0; font-size: 13px; }
.qb-form .qb-inl select { flex: 1; }
.qb-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; margin-bottom: 14px; }
.qb-kv div { display: flex; flex-direction: column; }
.qb-kv span { color: var(--mu); font-size: 12px; }
.qb-kv .full { grid-column: 1 / -1; }
.qb-sumr { margin: 12px 0 0 auto; max-width: 340px; }
.qb-sumr div { display: flex; justify-content: space-between; padding: 3px 0; }
.qb-sumr .big { font-size: 16px; border-top: 1px solid var(--ln); padding-top: 6px; margin-top: 3px; }

.qb-toast { position: fixed; right: 20px; bottom: 20px; z-index: 100001; background: #111827; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 440px; transition: opacity .5s; }
.qlbh .qb-toast.bad, .qb-toast.bad { background: var(--bad); color: #fff; } /* .qlbh .bad đặt chữ đỏ: phải ghi đè, không thì chữ đỏ trên nền đỏ */
.qb-toast.out { opacity: 0; }

/* thẻ số liệu, báo cáo, tổng quan */
.qb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 4px; }
.qb-card { background: var(--pn); border: 1px solid var(--ln); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--sh); position: relative; }
.qb-card > i { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 9px; background: var(--ac2); color: var(--ac); display: grid; place-items: center; }
.qb-card span { color: var(--mu); font-size: 13px; font-weight: 500; }
.qb-card > b { font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.qb-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.qb-panel { background: var(--pn); border: 1px solid var(--ln); border-radius: 12px; padding: 16px 18px; box-shadow: var(--sh); min-width: 0; }
.qb-panel h2 { font-size: 15px; font-weight: 650; margin: 0 0 12px; }
.qb-panel h2:not(:first-child) { margin-top: 20px; }
.qb-panel .qb-chart { border: 0; max-width: none; }
.qb-alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--warn2); color: #7a3306; text-decoration: none; margin-bottom: 6px; }
.qb-alert:hover { filter: brightness(.98); }
.qb-alert .qb-ic { color: var(--warn); }
.qb-chart { width: 100%; max-width: 920px; background: var(--pn); border: 1px solid var(--ln); border-radius: 12px; }
.qb-chart text { font-size: 11px; fill: var(--mu); }
.qb-chart .g { stroke: var(--ln2); }
.qb-chart .rv { fill: #a9c2ff; }
.qb-chart .pf { fill: #087443; }
.qb-legend { display: flex; gap: 6px; align-items: center; color: var(--mu); font-size: 13px; margin-top: 6px; }
.qb-legend span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 10px; }
.qb-legend .rv { background: #a9c2ff; }
.qb-legend .pf { background: #087443; }
.qb-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.qb-catrow { display: flex; gap: 6px; margin-bottom: 6px; }
.qb-catrow input { flex: 1; }
.v-settings .qb-form { background: var(--pn); border: 1px solid var(--ln); border-radius: 12px; padding: 16px; box-shadow: var(--sh); }

/* mẫu phiếu thanh toán */
.qb-print { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 16px; align-items: start; }
.qb-print .qb-panel h2:not(:first-child) { margin-top: 18px; }
.qb-print textarea { width: 100%; resize: vertical; }
.qb-print .pv { position: sticky; top: calc(var(--top) + var(--hh) + 16px); }
.qb-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.qb-logo-in { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qb-logo-in .lgp { width: 120px; height: 56px; border: 1px dashed var(--ln); border-radius: 8px; display: grid; place-items: center; background: #fafbfc; overflow: hidden; }
.qb-logo-in .lgp img { max-width: 100%; max-height: 100%; }
.qb-logo-in input[type=file] { box-shadow: none; border: 0; padding: 0; min-height: 0; font-size: 13px; max-width: 220px; }
.qb-pv { background: #e9ecf1; border-radius: 10px; padding: 18px; display: flex; justify-content: center; overflow: auto; max-height: calc(100vh - 200px); }
.qb-pv iframe { background: #fff; border: 0; box-shadow: 0 6px 24px rgba(16,24,40,.18); min-height: 300px; flex-shrink: 0; }
.qb-pv.a4 iframe { zoom: .62; }

/* vai trò, cửa hàng */
.qb-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.qb-role { background: var(--pn); border: 1px solid var(--ln); border-radius: 12px; padding: 12px 14px; box-shadow: var(--sh); }
.qb-role .lv { float: right; font-size: 11px; color: var(--mu); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.qb-role p { margin: 6px 0 0; color: var(--mu); font-size: 13px; }
.qb-acts { display: flex; flex-wrap: wrap; gap: 4px; }
.qb-stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 12px; }
.qb-scard .h { font-size: 17px; margin-bottom: 2px; }
.qb-scard .h b { font-weight: 650; }
.qb-scard > div:nth-child(3) b { font-size: 20px; }
.qb-scard.off { opacity: .7; }
.qb-scard .qb-acts { margin-top: 8px; }
.qb-scard .ret b { color: var(--tx); }

/* trang riêng /ban-hang */
body.qlbh-standalone { margin: 0; background: #f4f5f7; }
.qlbh.standalone { margin: 0; --top: 0px; min-height: 100vh; }
.qb-login { display: flex !important; align-items: center; justify-content: center; min-height: 100vh; margin: 0 !important; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, #dfe8ff 0, transparent 60%), #f4f5f7 !important; }
.qb-login-box { background: #fff; border: 1px solid var(--ln); border-radius: 16px; padding: 28px; width: 100%; max-width: 400px; box-shadow: 0 24px 60px rgba(16,24,40,.10); }
.qb-login-box h1 { font-size: 22px; margin: 0 0 18px; }
.qb-login-box .qb-logo { width: 42px; height: 42px; margin-bottom: 14px; }
.qb-login-box .qb-logo .qb-ic { width: 22px; height: 22px; }
.qb-login-box p { margin: 0 0 12px; }
.qb-login-box label { display: block; font-size: 13px; font-weight: 500; color: #344054; margin-bottom: 5px; }
.qb-login-box input[type=text], .qb-login-box input[type=password] { width: 100%; min-height: 42px; }
.qb-login-box .login-remember label { display: inline-flex; gap: 8px; align-items: center; color: var(--tx); font-weight: 400; }
.qb-login-box input[type=submit] { width: 100%; min-height: 46px; background: var(--ac); color: #fff; border: 0; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.qb-login-box input[type=submit]:hover { background: var(--ac-d); }

/* thanh bên thu vào: màn nhỏ và chế độ toàn màn hình */
@media (max-width: 1100px) {
	.qb-pos { grid-template-columns: 1fr; }
	.qb-pos-r { position: static; }
	.qb-2col, .qb-grid, .qb-print { grid-template-columns: 1fr; }
	.qb-print .pv { position: static; }
}
@media (max-width: 960px) {
	.qlbh { grid-template-columns: minmax(0, 1fr); }
	.qb-side { position: fixed; left: 0; top: var(--top); bottom: 0; height: auto; width: 264px; transform: translateX(-100%); transition: transform .2s; z-index: 100; }
	.qlbh.nav-open .qb-side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
	.qlbh.nav-open .qb-scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 90; }
	.qb-menu { display: inline-flex; }
}
body.qlbh-full .qlbh { grid-template-columns: minmax(0, 1fr); }
body.qlbh-full .qb-side { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: 264px; transform: translateX(-100%); transition: transform .2s; z-index: 100; }
body.qlbh-full .qlbh.nav-open .qb-side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
body.qlbh-full .qlbh.nav-open .qb-scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 90; }
body.qlbh-full .qb-menu { display: inline-flex; }
body.qlbh-full .qb-full { color: var(--ac); background: var(--ac2); }
@media (max-width: 782px) {
	.qlbh { margin-left: -10px; --top: 46px; --hh: 54px; }
	.qlbh.standalone { margin: 0; --top: 0px; }
	.qb-top { padding: 0 10px; gap: 4px; }
	.qb-title { font-size: 16px; }
	.qb-ub .nm { display: none; }
	.qb-ub { padding: 4px; }
	.qb-main { padding: 12px; }
	.qb-form, .qb-kv, .qb-checks { grid-template-columns: 1fr; }
	.qb-bar input[type=search], .qb-bar .qb-search { min-width: 0; width: 100%; }
	.qb-card > b { font-size: 20px; }
	.qb-rep .qb-tbl, .qb-home .qb-tbl { display: block; overflow-x: auto; }
	/* giỏ hàng xếp thành thẻ: tên + nút xóa; SL, đơn giá, thành tiền */
	.qb-cart thead, .qb-cart td:nth-child(1), .qb-cart td:nth-child(5) { display: none; }
	.qb-cart tr { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px 8px; padding: 10px 12px; border-bottom: 1px solid var(--ln2); align-items: center; }
	.qb-cart td { border: 0; padding: 0 !important; }
	.qb-cart td:nth-child(2) { grid-column: 1 / 4; grid-row: 1; }
	.qb-cart td:nth-child(7) { grid-column: 4; grid-row: 1; justify-self: end; }
	.qb-cart td:nth-child(3) { grid-column: 1; grid-row: 2; }
	.qb-cart td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: left; }
	.qb-cart td:nth-child(6) { grid-column: 3 / 5; grid-row: 2; }
	.qb-cart input { width: 96px; }
}
@media print { .qlbh { display: none; } }

/* Đợt 3: ảnh hàng hóa, lô, combo, biến thể */
.qb-th { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--ln2); display: inline-block; flex: none; vertical-align: middle; }
.qb-th.none { background: var(--ln2) linear-gradient(135deg, transparent 46%, var(--ln) 46%, var(--ln) 54%, transparent 54%); }
.qb-thl { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: var(--ln2); display: block; }
.qb-pnm { display: inline-flex; align-items: center; gap: 10px; }
.qb-img { display: flex; gap: 14px; align-items: center; }
.qb-img p { margin: 6px 0 0; }
.qb-lotin { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.qb-lotin input, .qb-lotin select { font-size: 12px; padding: 4px 6px; min-width: 0; }
.qb-lotin input.lt { width: 130px; }
.qb-alloc { font-size: 12px; color: var(--mu); margin-top: 2px; }
.qb-vgen { border: 1px dashed var(--ln); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.qb-vgen .qb-form { margin: 8px 0; }
.qb-lots .qb-tbl tr.bad td { color: var(--bad, #c0262d); }
.qb-combo .qb-search { margin-top: 8px; position: relative; }
@media (max-width: 720px) { .qb-img { flex-direction: column; align-items: flex-start; } }
.qb-modal .vt input { min-width: 0; width: 100%; }
.qb-modal .vt .va { width: 150px; } .qb-modal .vt .vs { width: 110px; } .qb-modal .vt .vb { width: 130px; } .qb-modal .vt .vp { width: 105px; }
/* Đợt 4: ca, chuyển hàng */
.qb-shift { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--ln2); color: var(--mu); font-size: 13px; margin-bottom: 8px; flex-wrap: wrap; text-decoration: none; }
.qb-shift svg { width: 16px; height: 16px; }
.qb-shift.on { background: var(--ok2); color: var(--ok); font-weight: 600; }
.qb-shift.need { background: var(--warn2); color: var(--warn); font-weight: 600; }
.qb-shift input.oc { width: 130px; padding: 4px 8px; }
.qb-cur .qb-grid { align-items: start; }
.qb-cur .qb-sum textarea { width: 100%; }
.qb-rcv .qb-panel { margin-bottom: 14px; }
/* Đợt 5: bảo mật, duyệt, camera, màn hình khách */
.has-cam { position: relative; }
.qb-cam { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--mu); cursor: pointer; padding: 4px; border-radius: 6px; line-height: 0; }
.qb-cam:hover { background: var(--ac2); color: var(--ac); }
.qb-cam svg { width: 20px; height: 20px; }
.has-cam > input { padding-right: 36px; }
.qb-scan { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; }
.qb-scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qb-scan .ln { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; background: #ff3b30; box-shadow: 0 0 8px #ff3b30; }
.qb-tfaqr svg { width: 200px; height: 200px; display: block; margin: 8px auto; }
.qb-codes { background: var(--ln2); padding: 10px 14px; border-radius: 8px; font-size: 15px; letter-spacing: 1px; }
.qb-dispbtn { margin: 0 0 8px; }
.qb-dispbtn svg { width: 16px; height: 16px; }
.qb-display { position: fixed; inset: 0; z-index: 300; background: #0f172a; color: #fff; display: grid; grid-template-columns: 1fr 380px; grid-template-rows: auto 1fr; gap: 0 24px; padding: 24px; font-size: 20px; }
.qb-display .dh { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; border-bottom: 1px solid #334155; margin-bottom: 14px; }
.qb-display .shop { font-size: 28px; }
.qb-display .dl { overflow: auto; }
.qb-display table { width: 100%; border-collapse: collapse; }
.qb-display td { padding: 10px 0; border-bottom: 1px solid #1e293b; vertical-align: top; }
.qb-display td small { color: #94a3b8; font-size: 15px; }
.qb-display .r { text-align: right; white-space: nowrap; }
.qb-display .wel { font-size: 34px; color: #94a3b8; margin-top: 20vh; text-align: center; }
.qb-display .row { display: flex; justify-content: space-between; padding: 6px 0; color: #cbd5e1; }
.qb-display .big { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding: 16px; background: #1d4ed8; border-radius: 14px; }
.qb-display .big b { font-size: 46px; }
.qb-display .qr { margin-top: 18px; background: #fff; color: #111; border-radius: 14px; padding: 12px; text-align: center; font-size: 15px; }
.qb-display .qr:empty { display: none; }
.qb-display .qr svg { width: 230px; height: 230px; }
.qb-display .thx { display: none; }
.qb-display.done .thx { display: flex; position: absolute; inset: 0; background: #0f172a; align-items: center; justify-content: center; text-align: center; font-size: 28px; }
.qb-display.done .thx b { font-size: 48px; }
@media (max-width: 800px) { .qb-display { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; font-size: 17px; padding: 14px; } .qb-display .big b { font-size: 36px; } }
.qb-tbl th.ck, .qb-tbl td.ck { width: 34px; text-align: center; cursor: default; }
.qb-tbl td.ck input, .qb-tbl th.ck input { width: 16px; height: 16px; cursor: pointer; }
.qlbh [hidden], .qb-modal [hidden] { display: none !important; } /* thuộc tính hidden thắng display của .qb-btn */
/* Hàng bán chạy: chọn khoảng thời gian, tiêu chí xếp (0.9.5) */
.qb-toph { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qlbh select.qb-topsel { min-height: 30px; padding: 3px 8px; font-size: 13px; font-weight: 500; box-shadow: none; }
.qb-dim { opacity: .5; transition: opacity .15s; }

/* Chuyển khoản trong ca (0.9.5) */
.qb-trfbox { margin-top: 16px; }
.qb-trfbox h3 { font-size: 15px; margin: 0 0 8px; }
.qb-trf { max-width: 420px; }
/* Báo cáo › Các món tiền (0.9.6) */
.qb-mnylist { max-height: 460px; overflow: auto; border-radius: 10px; }
.qb-mnylist thead th { position: sticky; top: 0; z-index: 1; }
.qb-money tr.click { cursor: pointer; }
