:root {
  --den: #0f0f0f; --vang: #d9b45a; --vang-dam: #a8843a; --nga: #faf8f3; --trang: #fff;
  --chu: #1d1d1b; --nhat: #6b665c; --vien: #e7e1d3; --do: #c8102e; --xanh: #1f7a4d; --cam: #b86e00; --lam: #2457a6;
  --bo: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nga); color: var(--chu);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.dau { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--den); color: #fff; border-bottom: 2px solid var(--vang); }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo img { height: 30px; display: block; }
.logo b { color: var(--vang); font-size: 13px; letter-spacing: .12em; border: 1px solid var(--vang); border-radius: 6px; padding: 1px 6px; }
#menu { display: flex; gap: 6px; }
#menu a, #menu button { color: var(--vang); text-decoration: none; background: none; border: 1px solid #3a3426;
  padding: 5px 10px; border-radius: 999px; font-size: 13px; cursor: pointer; white-space: nowrap; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px; }
h1 { font-size: 21px; margin: 4px 0 4px; line-height: 1.3; }
h2 { font-size: 16px; margin: 20px 0 8px; }
.cho { color: var(--nhat); text-align: center; padding: 40px 0; }
.nhat { color: var(--nhat); font-size: 14px; }
.the { background: var(--trang); border: 1px solid var(--vien); border-radius: var(--bo); padding: 14px; margin-bottom: 10px; }

/* ô số liệu */
.so-lieu { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-bottom: 12px; }
.o-so { background: var(--trang); border: 1px solid var(--vien); border-radius: 12px; padding: 9px 11px; text-align: left; cursor: pointer; }
.o-so b { display: block; font-size: 22px; line-height: 1.2; }
.o-so span { font-size: 12px; color: var(--nhat); }
.o-so.dang { border-color: var(--vang); box-shadow: 0 0 0 2px var(--vang) inset; }
.o-so.do b { color: var(--do); } .o-so.cam b { color: var(--cam); } .o-so.xanh b { color: var(--xanh); }

/* tìm + lọc */
.tim { position: sticky; top: 52px; z-index: 10; background: var(--nga); padding: 6px 0 8px; }
.tim input[type=search] { width: 100%; padding: 11px 14px; border: 1px solid var(--vien); border-radius: 12px; background: #fff; font-size: 16px; }
.loc { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.loc::-webkit-scrollbar { display: none; }
.loc button, .loc select { flex: none; border: 1px solid var(--vien); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 14px; cursor: pointer; }
.loc button.dang { background: var(--den); color: var(--vang); border-color: var(--den); }
.loc select { padding-right: 8px; max-width: 180px; }
.dem { font-size: 13px; color: var(--nhat); margin: 4px 2px 8px; }

/* thẻ người */
.ng { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; background: #fff; border: 1px solid var(--vien);
  border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; }
.ng:active { background: #f3efe4; }
.anh { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--den); color: var(--vang);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.ng .giua { flex: 1; min-width: 0; }
.ng .ten { font-weight: 650; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ng .phu { font-size: 13px; color: var(--nhat); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ng .gc { font-size: 13px; color: #8a8374; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.nhan { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: #efe9da; white-space: nowrap; }
.nhan.t-dang-hoc { background: #e2f1e8; color: var(--xanh); }
.nhan.t-quan-tam { background: #fdeed8; color: var(--cam); }
.nhan.t-da-chot { background: #e3ebf8; color: var(--lam); }
.nhan.t-hoan-thanh { background: #eee; color: #555; }
.nhan.t-ngung { background: #f7dfe2; color: var(--do); }
.nhan.canh { background: var(--do); color: #fff; }
.nhan.hen { background: var(--vang); color: var(--den); }

/* chi tiết */
.dau-ho-so { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.dau-ho-so .anh { width: 54px; height: 54px; font-size: 20px; }
.nut-lien-he { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 14px; }
.nut { display: inline-flex; justify-content: center; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--vien);
  background: #fff; text-decoration: none; cursor: pointer; font-weight: 600; font-size: 15px; }
.nut.chinh { background: var(--den); color: var(--vang); border-color: var(--den); }
.nut.vang { background: var(--vang); color: var(--den); border-color: var(--vang); }
.nut.do { color: var(--do); border-color: #f0c9cf; }
.nut[aria-disabled=true] { opacity: .4; pointer-events: none; }
.luoi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.luoi .rong { grid-column: 1 / -1; }
label.o { display: block; font-size: 13px; color: var(--nhat); }
label.o input, label.o select, label.o textarea { display: block; width: 100%; margin-top: 3px; padding: 9px 11px; border: 1px solid var(--vien);
  border-radius: 10px; background: #fff; font-size: 16px; color: var(--chu); }
label.o textarea { min-height: 90px; resize: vertical; }
label.chon { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.thanh-luu { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; margin-top: 14px; }
.thanh-luu .nut { flex: 1; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.tien { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.tien b { font-variant-numeric: tabular-nums; }
.hd { border-left: 2px solid var(--vien); padding: 0 0 12px 12px; margin-left: 6px; position: relative; }
.hd::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--vien); }
.hd.ghi_chu::before { background: var(--vang); }
.hd .ai { font-size: 12.5px; color: var(--nhat); }
.hd .nd { white-space: pre-wrap; font-size: 14.5px; }
.hd.sua .nd { font-size: 13px; color: #555; }
.o-ghi { display: flex; gap: 8px; }
.o-ghi textarea { flex: 1; min-height: 44px; padding: 9px 11px; border: 1px solid var(--vien); border-radius: 10px; font-size: 16px; resize: vertical; }

#nut-them { position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%;
  background: var(--vang); color: var(--den); font-size: 30px; display: grid; place-items: center; text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); z-index: 30; }
#thong-bao { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--den); color: #fff;
  padding: 10px 16px; border-radius: 12px; opacity: 0; transition: .2s; pointer-events: none; z-index: 50; max-width: 90vw; font-size: 14px; }
#thong-bao.hien { opacity: 1; transform: translateX(-50%); }

/* đăng nhập */
.dn { max-width: 380px; margin: 40px auto; }
.dn .nut { width: 100%; margin-top: 12px; }
.loi { color: var(--do); font-size: 14px; min-height: 20px; margin-top: 8px; }
.hop-mk { background: #fffaf0; border: 1px dashed var(--vang-dam); border-radius: 12px; padding: 12px; white-space: pre-wrap; font-size: 14.5px; }
table.tk { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tk td { padding: 8px 4px; border-bottom: 1px solid var(--vien); vertical-align: middle; }
@media (min-width: 700px) { .so-lieu { grid-template-columns: repeat(6, 1fr); } }
#nut-them[hidden] { display: none; }
.luoi > * { min-width: 0; } label.o select { max-width: 100%; }

/* ===== Bản 3: Báo cáo ===== */
body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
#tab-duoi { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--den); border-top: 2px solid var(--vang); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
#tab-duoi[hidden] { display: none; }
#tab-duoi a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; color: #a59d8b; text-decoration: none; font-size: 11.5px; border-radius: 10px; }
#tab-duoi a span { font-size: 19px; line-height: 1.1; }
#tab-duoi a.dang { color: var(--vang); background: #1e1b14; font-weight: 650; }
#nut-them { bottom: calc(80px + env(safe-area-inset-bottom)); }
#thong-bao { bottom: calc(90px + env(safe-area-inset-bottom)); }
.dau-trang { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.nut.nho { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.nut:disabled { opacity: .35; }
.chu-nho { font-size: 12.5px; margin: 6px 0 0; }
.the-link { display: block; text-decoration: none; }
.the-link:active { background: #f6f2e8; }

.luoi-to { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.o-to { display: flex; flex-direction: column; background: var(--trang); border: 1px solid var(--vien); border-radius: var(--bo); padding: 12px 13px; text-decoration: none; min-width: 0; }
.o-to .nhan-o { font-size: 13px; color: var(--nhat); }
.o-to b { font-size: 30px; line-height: 1.15; margin: 2px 0; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.o-to .mui { font-size: 13px; color: var(--nhat); font-weight: 600; }
.o-to .mui.len { color: var(--xanh); } .o-to .mui.xuong { color: var(--do); }
.o-to .thang { font-size: 12px; color: var(--nhat); margin-top: 4px; border-top: 1px dashed var(--vien); padding-top: 4px; }

.bon-so { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; font-size: 12px; color: var(--nhat); }
.bon-so.ba { grid-template-columns: repeat(3, 1fr); } .bon-so.hai { grid-template-columns: 1fr 1fr; }
.bon-so b { display: block; font-size: 22px; color: var(--chu); font-variant-numeric: tabular-nums; }
.bon-so .do b { color: var(--do); } .bon-so .cam b { color: var(--cam); } .bon-so .xanh b { color: var(--xanh); }

.dong-mt { margin: 8px 0 12px; } .dong-mt-dau { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.thanh-pt { position: relative; height: 10px; background: #efe9da; border-radius: 99px; }
.thanh-pt.to { height: 14px; margin: 8px 0; } .thanh-pt.nho { height: 6px; margin-top: 8px; }
.thanh-pt i { position: absolute; inset: 0 auto 0 0; background: var(--vang-dam); border-radius: 99px; }
.thanh-pt s { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--den); border-radius: 2px; }
.so-mt { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.so-mt b { font-size: 30px; font-variant-numeric: tabular-nums; } .so-mt span { color: var(--nhat); }
.so-mt em { margin-left: auto; font-style: normal; font-weight: 700; font-size: 20px; }
.xanh { color: var(--xanh); } .do { color: var(--do); }
.trang-thai-mt { font-size: 14px; margin: 4px 0 8px; font-weight: 600; }
.trang-thai-mt .nhat { font-weight: 400; }

.bieu-do { position: relative; margin-top: 6px; touch-action: pan-y; }
.bieu-do svg { width: 100%; height: auto; display: block; }
.bd-luoi { stroke: #eee8da; stroke-width: 1; }
.bd-chu { font-size: 10px; fill: var(--nhat); }
.bd-can { stroke: #b5ad9c; stroke-width: 2; stroke-dasharray: 5 4; }
.bd-that { fill: none; stroke: var(--vang-dam); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.bd-diem { fill: var(--vang-dam); stroke: #fff; stroke-width: 2; }
.bd-hn { stroke: var(--den); stroke-width: 1; stroke-dasharray: 2 3; }
.bd-tro { stroke: var(--chu); stroke-width: 1; opacity: .5; }
.bd-goi { position: absolute; top: 0; width: 140px; background: var(--den); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 8px; pointer-events: none; }
.bd-chu-giai { display: flex; gap: 14px; font-size: 12px; color: var(--nhat); margin-top: 4px; }
.bd-chu-giai i { display: inline-block; width: 16px; height: 0; vertical-align: middle; margin-right: 5px; border-top: 3px solid var(--vang-dam); }
.bd-chu-giai i.can { border-top: 2px dashed #b5ad9c; }

.xem-so { display: block; font-size: 12px; color: var(--nhat); min-height: 16px; margin-top: 2px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--vien); background: var(--trang); border-radius: 99px; padding: 5px 12px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.chip.dang { background: var(--den); color: var(--vang); border-color: var(--den); }
.phan-doan { display: grid; grid-template-columns: repeat(3, 1fr); background: #efe9da; border-radius: 12px; padding: 3px; margin-bottom: 10px; }
.phan-doan button { border: 0; background: none; padding: 8px 4px; border-radius: 9px; font-size: 14px; cursor: pointer; }
.phan-doan button.dang { background: var(--trang); font-weight: 650; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.viec { background: var(--trang); border: 1px solid var(--vien); border-radius: var(--bo); padding: 12px 13px; margin-bottom: 8px; }
.viec.xong .viec-ten { color: var(--nhat); }
.viec-ten { font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.viec-ten.mo { -webkit-line-clamp: unset; display: block; }
.viec-phu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12.5px; }
.nhan.nguoi { background: var(--den); color: var(--vang); }
.han { font-weight: 600; color: var(--nhat); } .han.tre { color: var(--do); } .han.gan { color: var(--cam); }
.nguon { color: #8a8374; }
.pt-chu { font-size: 12px; color: var(--nhat); }
.viec-nut { display: flex; gap: 6px; margin-top: 10px; justify-content: flex-end; }

.luoi-nv { display: grid; grid-template-columns: 1fr; gap: 10px; }
.the-nv { text-decoration: none; margin: 0; }
.nv-dau { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.nv-dau b { font-size: 17px; }
.the-nv.nho .anh { background: #efe9da; }
.nv-viec { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; color: #444; }
.nv-viec li { margin-bottom: 3px; } .nv-viec li.tre { color: var(--do); }
@media (min-width: 700px) { .luoi-to { grid-template-columns: repeat(4, 1fr); } .luoi-nv { grid-template-columns: 1fr 1fr; } }
.bd-chu-giai i.hn { width: 0; height: 12px; border-top: 0; border-left: 1px dashed var(--den); }
