:root {
  --nen: #f4f6f9;
  --the: #ffffff;
  --chu: #1d2633;
  --chu-phu: #637083;
  --vien: #e2e7ee;
  --chinh: #1463d8;
  --chinh-nhat: #e8f0fd;
  --xanh: #138a52;
  --xanh-nhat: #e3f5ec;
  --vang: #a86400;
  --vang-nhat: #fff3dc;
  --do: #c62f2f;
  --do-nhat: #fdeaea;
  --xam-nhat: #eef1f5;
  --bo-goc: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 15px;
  color: var(--chu);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--nen); }
a { color: var(--chinh); }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.phu { color: var(--chu-phu); font-size: 13px; }
.an { display: none !important; }

/* thanh trên cùng */
.thanh-tren {
  background: var(--the); border-bottom: 1px solid var(--vien);
  display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 56px;
  position: sticky; top: 0; z-index: 5;
}
.logo { font-weight: 700; font-size: 16px; white-space: nowrap; }
.logo span { color: var(--chinh); }
.tab-bar { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-bar button {
  background: none; border: 0; padding: 18px 12px 15px; font: inherit; color: var(--chu-phu);
  border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
}
.tab-bar button.chon { color: var(--chinh); border-bottom-color: var(--chinh); font-weight: 600; }
.nguoi-dung { white-space: nowrap; font-size: 13px; color: var(--chu-phu); }

main { max-width: 1280px; margin: 0 auto; padding: 20px; }
.the { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo-goc); padding: 18px; margin-bottom: 16px; }
.hang { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hang.giua { justify-content: space-between; }
.luoi { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.chi-so { background: var(--the); border: 1px solid var(--vien); border-radius: var(--bo-goc); padding: 14px 16px; }
.chi-so b { display: block; font-size: 26px; margin-top: 4px; }

/* nút & ô nhập */
button, .nut {
  font: inherit; border: 1px solid var(--vien); background: var(--the); color: var(--chu);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .nut:hover { border-color: #b9c3d0; }
button.chinh, .nut.chinh { background: var(--chinh); border-color: var(--chinh); color: #fff; }
button.chinh:hover { background: #0f53b8; }
button.nguy { color: var(--do); }
button.nho { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: .55; cursor: default; }
input, select, textarea {
  font: inherit; border: 1px solid var(--vien); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--chu);
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--chinh-nhat); border-color: var(--chinh); }
label { display: block; font-size: 13px; color: var(--chu-phu); margin-bottom: 12px; }
label input, label select, label textarea { display: block; width: 100%; margin-top: 4px; color: var(--chu); }
.o-ngay { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.o-ngay label { display: flex; align-items: center; gap: 4px; margin: 0; color: var(--chu); }
.o-ngay input { width: auto; display: inline; margin: 0; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* bảng */
.cuon { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--the); }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--vien); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--chu-phu); text-transform: uppercase; letter-spacing: .02em; background: #fafbfc; white-space: nowrap; }
td.so, th.so { text-align: right; font-variant-numeric: tabular-nums; }
tr.bam { cursor: pointer; }
tr.bam:hover td { background: #f7f9fc; }
code, .mac { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }

/* nhãn trạng thái */
.nhan { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.nhan.xanh { background: var(--xanh-nhat); color: var(--xanh); }
.nhan.vang { background: var(--vang-nhat); color: var(--vang); }
.nhan.do { background: var(--do-nhat); color: var(--do); }
.nhan.xam { background: var(--xam-nhat); color: var(--chu-phu); }
.nhan.lam { background: var(--chinh-nhat); color: var(--chinh); }
.cham { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c3cad4; margin-right: 6px; }
.cham.on { background: #1fb36b; box-shadow: 0 0 0 3px #d4f3e3; }

/* lưới bảng công */
.luoi-cong td, .luoi-cong th { padding: 6px 4px; text-align: center; font-size: 13px; border: 1px solid var(--vien); }
.luoi-cong td:nth-child(-n+2), .luoi-cong th:nth-child(-n+2) { text-align: left; padding-left: 8px; white-space: nowrap; }
.luoi-cong th.cn { background: #f1f3f6; }
.luoi-cong td.o { cursor: pointer; min-width: 34px; }
.luoi-cong td.o:hover { outline: 2px solid var(--chinh); outline-offset: -2px; }
.o.du { background: var(--xanh-nhat); }
.o.thieu { background: var(--vang-nhat); }
.o.vang-mat { background: var(--do-nhat); color: var(--do); font-weight: 600; }
.o.phep { background: var(--chinh-nhat); color: var(--chinh); }
.o.nghi { background: #f6f7f9; }
.o.dc { box-shadow: inset 0 -3px 0 #8f5bd6; }
.o.kt { box-shadow: inset 0 -3px 0 var(--vang); }

/* hộp thoại */
.phu-mo { position: fixed; inset: 0; background: rgba(20, 28, 40, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 20; overflow-y: auto; }
.hop { background: var(--the); border-radius: 12px; padding: 22px; width: 100%; max-width: 560px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.hop .hang.cuoi { justify-content: flex-end; margin-top: 8px; }
.thong-bao { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2633; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 30; font-size: 14px; max-width: 90vw; }
.thong-bao.loi { background: var(--do); }
.canh-bao { background: var(--vang-nhat); border: 1px solid #f1d39a; color: #6b4300; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }
.goi-y { background: var(--chinh-nhat); border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }

/* trang đăng nhập */
.trung-tam { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.trung-tam .the { width: 100%; max-width: 380px; }

/* trang nhân viên trên điện thoại */
.dt { max-width: 520px; margin: 0 auto; padding: 16px; }
.dt .lon { font-size: 34px; font-weight: 700; margin: 4px 0; }
.dt .trang-thai-to { text-align: center; padding: 26px 18px; }
.dt .bieu-tuong { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.dt .bieu-tuong.xanh { background: var(--xanh-nhat); color: var(--xanh); }
.dt .bieu-tuong.xam { background: var(--xam-nhat); color: var(--chu-phu); }

@media (max-width: 720px) {
  main { padding: 12px; }
  .thanh-tren { padding: 0 12px; gap: 8px; }
  .nguoi-dung span { display: none; }
  .form-2 { grid-template-columns: 1fr; }
}
