:root {
	--nen: #f3f5f9;
	--mat: #ffffff;
	--chu: #131a2e;
	--phu: #5b6478;
	--vien: #dce1ea;
	--vien2: #c9d0dc;
	--xanh: #1d4ed8;
	--xanh-nen: #e6edfd;
	--cam: #a43d0b;
	--cam-nen: #fcebdd;
	--tot: #166534;
	--tot-nen: #e3f2e8;
	--vang: #7a5300;
	--vang-nen: #fbf0cf;
	--do: #a61b1b;
	--do-nen: #fbe5e5;
	--toi: #1e293b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--nen); color: var(--chu); font: 15px/1.5 "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: var(--xanh); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--xanh); outline-offset: 2px; }

.demo-bar { background: #fbe38a; color: #3d2c00; font-size: 13px; padding: 6px max(16px, env(safe-area-inset-left)); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: space-between; }
.demo-bar b { font-weight: 700; }
.demo-bar button { border: 1px solid #b89400; background: #fff7d6; border-radius: 8px; min-height: 32px; padding: 0 10px; font-size: 13px; font-weight: 600; }

.sub { font-size: 13px; color: var(--phu); }
.nho { font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ok { background: var(--tot-nen); color: var(--tot); }
.warn { background: var(--vang-nen); color: var(--vang); }
.bad { background: var(--do-nen); color: var(--do); }
.mute { background: #eceff4; color: #4a5366; }
.remote { background: var(--xanh-nen); color: var(--xanh); }
.store { background: var(--cam-nen); color: var(--cam); }
.live { background: #efe7fd; color: #5b21b6; }
.hcns { background: #dcf2ee; color: #0f6159; }
.sao { color: #b45309; letter-spacing: 1px; white-space: nowrap; }
.tt-viec { min-width: 92px; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--vien2); background: #fff; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.tt-viec.chua { color: #4a5366; }
.tt-viec.dang { background: var(--vang-nen); border-color: #e9d28a; color: var(--vang); }
.tt-viec.xong { background: var(--tot-nen); border-color: #b7dec4; color: var(--tot); }
.tt-viec.huy { background: #eceff4; color: #6b7385; text-decoration: line-through; }
.gach { text-decoration: line-through; color: var(--phu); }
.chu-tre { color: var(--do); font-weight: 600; }
.thu { border-top: 1px solid #eef1f5; padding: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.thu:first-child { border-top: 0; }
.thu.moi { background: #f6f9ff; margin: 0 -16px; padding: 12px 16px; }
.lua-chon { display: flex; flex-wrap: wrap; gap: 6px; }
.lua-chon label { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--vien2); border-radius: 999px; font-size: 13px; background: #fff; }
.lua-chon input { width: 16px; height: 16px; }
.cau { border: 1px solid var(--vien); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cau label { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.lv { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 1px 6px; border-radius: 6px; font-size: 12px; font-weight: 700; border: 1px solid var(--vien2); color: #3b4458; background: #fff; flex: 0 0 auto; }

.card { background: var(--mat); border: 1px solid var(--vien); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-h h2 { font-size: 17px; }
.hang { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cot { display: flex; flex-direction: column; gap: 12px; }
.so { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.so > div { display: flex; flex-direction: column; }
.so b { font-size: 21px; font-variant-numeric: tabular-nums; }

.btn { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--vien2); background: #fff; font-weight: 600; }
.btn1 { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0; background: var(--xanh); color: #fff; font-weight: 600; }
.btn-to { min-height: 58px; border-radius: 14px; font-size: 18px; font-weight: 700; width: 100%; }
.btn-nho { min-height: 36px; padding: 0 10px; font-size: 13px; }
.btn-do { border-color: #e9b8b8; color: var(--do); }
.in { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--vien2); background: #fff; width: 100%; }
textarea.in { padding: 10px 12px; min-height: 72px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--vien2); border-radius: 10px; overflow: hidden; background: #fff; flex-wrap: nowrap; }
.seg button { min-height: 40px; padding: 0 12px; border: 0; background: #fff; color: #3b4458; font-weight: 600; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--vien2); }
.seg .on { background: var(--xanh-nen); color: var(--xanh); }
.seg .on-ok { background: var(--tot-nen); color: var(--tot); }
.seg .on-bad { background: var(--do-nen); color: var(--do); }
.thanh { height: 8px; border-radius: 99px; background: #e7eaf0; overflow: hidden; }
.thanh i { display: block; height: 100%; background: var(--xanh); border-radius: 99px; }

/* Sale: điện thoại */
.sale { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 16px max(16px, env(safe-area-inset-left)) 96px; display: flex; flex-direction: column; gap: 12px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--vien); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabbar > div { display: flex; width: 100%; max-width: 480px; }
.tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; border: 0; background: none; color: var(--phu); font-size: 12px; font-weight: 500; }
.tab.on { color: var(--xanh); font-weight: 700; }
.tab { position: relative; }
.tab .dem { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--do); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nhom-viec { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--phu); padding: 6px 2px 0; }
.ds-viec { display: flex; flex-direction: column; border: 1px solid var(--vien); border-radius: 12px; overflow: hidden; }
.viec { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-top: 1px solid #eef1f5; background: #fff; }
.viec:first-child { border-top: 0; }
.viec input[type=checkbox] { width: 22px; height: 22px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--xanh); }
.viec .tx { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.anh-nho { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: #e3e8f0; }
.gio-o { display: flex; gap: 6px; }
.gio-o span { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--phu); }
.gio-o i { display: block; width: 100%; height: 26px; border-radius: 6px; background: #e7eaf0; }
.gio-o i.co { background: var(--xanh); }
.gio-o i.nay { background: #fff; border: 2px solid var(--xanh); }
.ngay-dk { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid #eef1f5; }
.ngay-dk:first-child { border-top: 0; }
.ngay-dk .d { width: 62px; flex: 0 0 auto; display: flex; flex-direction: column; line-height: 1.2; }
.o-ca { flex: 1 1 0; min-height: 52px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; line-height: 1.25; border: 1px solid var(--vien2); background: #fff; padding: 4px; text-align: center; }
.o-ca small { font-size: 11px; font-weight: 600; color: var(--phu); }
.o-ca.cho { background: var(--vang-nen); border-color: #e9d28a; color: var(--vang); }
.o-ca.cho small, .o-ca.duyet small { color: inherit; }
.o-ca.duyet { background: var(--tot-nen); border-color: #b7dec4; color: var(--tot); }
.o-trong { flex: 1 1 0; }
.luoi-sz { display: grid; grid-template-columns: 84px repeat(4, minmax(0, 1fr)); gap: 5px; align-items: center; }
.luoi-sz span { text-align: center; }
.luoi-sz .h { font-size: 12px; font-weight: 600; color: var(--phu); }
.luoi-sz .r { text-align: left; font-size: 13px; color: #3b4458; }
.luoi-sz .c { min-height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--nen); font-weight: 700; font-variant-numeric: tabular-nums; }
.luoi-sz .z { background: var(--do-nen); color: var(--do); }
.luoi-sz .o { font-weight: 400; color: var(--phu); }
.luoi-sz .w { background: var(--xanh-nen); color: var(--xanh); }

/* Quản lý: máy tính, vẫn dùng được trên điện thoại */
.ql-top { background: #fff; border-bottom: 1px solid var(--vien); }
.ql-top > div { max-width: 1200px; margin: 0 auto; padding: 8px max(16px, env(safe-area-inset-left)); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo i { width: 30px; height: 30px; border-radius: 8px; background: var(--xanh); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 14px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav button { min-height: 44px; padding: 0 12px; border-radius: 8px; border: 0; background: none; color: #3b4458; font-weight: 500; }
.nav button:hover { background: #f0f3f8; }
.nav button.on { background: var(--xanh-nen); color: var(--xanh); font-weight: 600; }
.nav .dem { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--do); color: #fff; font-size: 11px; font-weight: 700; align-items: center; justify-content: center; }
@media (max-width: 700px) {
	.nav { flex-wrap: nowrap; overflow-x: auto; order: 3; flex-basis: 100%; scrollbar-width: none; }
	.nav button { white-space: nowrap; }
	.kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ql { max-width: 1200px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left)) 96px; display: flex; flex-direction: column; gap: 18px; }
.ql h1 { font-size: 24px; }
.luoi { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 460px), 100%), 1fr)); gap: 16px; align-items: start; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.kpi > div { background: #fff; border: 1px solid var(--vien); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 24px; font-variant-numeric: tabular-nums; }
.bang { overflow-x: auto; border-radius: 0 0 14px 14px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--phu); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--vien); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #e7eaf0; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.card.p0 { padding: 0; gap: 0; }
.card.p0 > .card-h { padding: 14px 16px 8px; }
.nw { white-space: nowrap; }
.chip { display: block; padding: 3px 8px; border-radius: 6px; font-size: 13px; white-space: nowrap; background: #eef1f6; }
.chip.cho { background: #fff; color: var(--vang); border: 1px dashed #b98a1e; }
.chip.thieu { background: var(--do-nen); color: var(--do); font-weight: 600; }
.ds-phieu button { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-top: 1px solid #eef1f5; background: #fff; }
.ds-phieu button.on { background: #eef3fe; }
.viec-cham { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; border-top: 1px solid #eef1f5; }
.viec-cham .tx { flex: 1 1 300px; display: flex; flex-direction: column; gap: 4px; }
.mau-dong { display: grid; grid-template-columns: 110px minmax(180px, 1fr) 76px 100px 64px 170px 44px; gap: 8px; align-items: center; padding: 8px 16px; border-top: 1px solid #eef1f5; min-width: 840px; }
.mau-dong .in { min-height: 38px; padding: 0 8px; }

/* Góp ý + hộp thoại + thông báo */
.nut-gop-y { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 6; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--toi); color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(19, 26, 46, .25); display: flex; align-items: center; gap: 8px; }
.ql-wrap .nut-gop-y { bottom: max(20px, env(safe-area-inset-bottom)); }
.man-che { position: fixed; inset: 0; background: rgba(19, 26, 46, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.hop { background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 18px max(16px, env(safe-area-inset-left)) calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow: auto; }
@media (min-width: 700px) { .man-che { align-items: center; } .hop { border-radius: 18px; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(140px + env(safe-area-inset-bottom)); z-index: 30; background: var(--toi); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: min(92vw, 520px); box-shadow: 0 6px 20px rgba(19, 26, 46, .3); }
.toast.loi { background: var(--do); }
.dang-nhap { max-width: 720px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left)) 96px; display: flex; flex-direction: column; gap: 18px; }
.tk { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.tk button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--vien); background: #fff; text-align: left; min-height: 72px; }
.tk button:hover { border-color: var(--xanh); }
