:root {
  --chu-dao: #009a9e; --chu-dao-dam: #007a7e; --chu-dao-nhat: #e6f6f6; --nhan: #ff8a3d;
  --chu: #1c2b2d; --chu-phu: #5b6b6d; --nen: #f5f9f9; --the: #fff; --vien: #dde8e8;
  --do: #c0392b; --do-nhat: #fdecea; --xanh: #1e8e5a; --xanh-nhat: #e6f5ee; --vang-nhat: #fff5e0; --vang: #9a6500;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--chu); background: var(--nen); font-size: 15px; line-height: 1.5; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--chu-dao-dam); }
.cho { padding: 40px; text-align: center; color: var(--chu-phu); }
.an { display: none !important; }

/* Nút + ô nhập */
button, input, select, textarea { font: inherit; color: inherit; }
.nut { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--chu-dao); color: #fff; font-weight: 700; border: 1px solid var(--chu-dao); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.nut:hover { background: var(--chu-dao-dam); border-color: var(--chu-dao-dam); }
.nut:disabled { opacity: .55; cursor: default; }
.nut-phu { background: #fff; color: var(--chu-dao-dam); border-color: var(--vien); }
.nut-phu:hover { background: var(--chu-dao-nhat); border-color: var(--chu-dao); }
.nut-do { background: #fff; color: var(--do); border-color: #f0c6c1; }
.nut-do:hover { background: var(--do-nhat); border-color: var(--do); }
.nut-nho { padding: 4px 10px; font-size: .86rem; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=search], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--vien); border-radius: 8px; padding: 8px 10px; background: #fff; min-height: 38px; }
input:focus, select:focus, textarea:focus, .soan:focus { outline: 2px solid var(--chu-dao); outline-offset: 1px; border-color: var(--chu-dao); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--nhan); outline-offset: 2px; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
label small, .goi-y { font-weight: 400; color: var(--chu-phu); font-size: .82rem; }
.o { margin-bottom: 14px; }
.hai-cot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ba-cot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .hai-cot, .ba-cot { grid-template-columns: 1fr; } }

/* Đăng nhập */
.dang-nhap { max-width: 380px; margin: 9vh auto; background: var(--the); border: 1px solid var(--vien); border-radius: 14px; padding: 28px; }
.dang-nhap h1 { color: var(--chu-dao-dam); }
.dang-nhap .nut { width: 100%; margin-top: 6px; padding: 10px; }
.loi { color: var(--do); background: var(--do-nhat); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-size: .9rem; }

/* Khung */
.dau { background: #fff; border-bottom: 1px solid var(--vien); position: sticky; top: 0; z-index: 20; }
.dau-trong { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.thuong-hieu { font-weight: 800; color: var(--chu-dao-dam); padding: 14px 0; }
.thuong-hieu span { color: var(--chu-phu); font-weight: 600; }
.the-tab { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.the-tab button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 15px 12px 12px; font-weight: 600; color: var(--chu-phu); cursor: pointer; white-space: nowrap; }
.the-tab button:hover { color: var(--chu-dao-dam); }
.the-tab button[aria-selected=true] { color: var(--chu-dao-dam); border-bottom-color: var(--chu-dao); }
.the-tab .dem { background: var(--nhan); color: #fff; border-radius: 99px; font-size: .72rem; padding: 1px 7px; margin-left: 4px; }
.nguoi { font-size: .86rem; color: var(--chu-phu); display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.than { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.dau-muc { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dau-muc p { margin: 0; color: var(--chu-phu); font-size: .9rem; }
.nhom-nut { display: flex; gap: 8px; flex-wrap: wrap; }

/* Bộ lọc */
.loc { background: var(--the); border: 1px solid var(--vien); border-radius: 12px; padding: 14px; display: grid; grid-template-columns: 1.8fr 1.5fr 1fr 1fr 1.1fr 1.1fr auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.loc.gon { grid-template-columns: 1fr 1fr 1.4fr auto; max-width: 820px; }
.loc .o { margin: 0; }
@media (max-width: 980px) { .loc, .loc.gon { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .loc, .loc.gon { grid-template-columns: 1fr; } }

/* Số tổng */
.so-tong { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.so-tong div { background: var(--the); border: 1px solid var(--vien); border-radius: 12px; padding: 10px 16px; min-width: 150px; }
.so-tong b { display: block; font-size: 1.45rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.so-tong span { color: var(--chu-phu); font-size: .82rem; }

/* Bảng */
.bang-khung { background: var(--the); border: 1px solid var(--vien); border-radius: 12px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--vien); vertical-align: top; }
th { background: #fafcfc; font-size: .8rem; color: var(--chu-phu); white-space: nowrap; position: sticky; top: 0; }
th button { background: none; border: 0; padding: 0; font-weight: 700; color: inherit; cursor: pointer; }
th button:hover { color: var(--chu-dao-dam); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfc; }
td.so, th.so { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.hep { white-space: nowrap; }
.trong { padding: 36px 16px; text-align: center; color: var(--chu-phu); }
.ma { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; background: var(--nen); border-radius: 5px; padding: 1px 6px; }
.nhan { display: inline-block; border-radius: 99px; padding: 1px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.nhan.dang_chay, .nhan.da_hop_tac { background: var(--xanh-nhat); color: var(--xanh); }
.nhan.tam_dung, .nhan.sap_dien_ra, .nhan.chua_co_ma, .nhan.da_lien_he, .nhan.dang_trao_doi { background: var(--vang-nhat); color: var(--vang); }
.nhan.ket_thuc, .nhan.het_ma, .nhan.khong_phu_hop, .nhan.an-web { background: #eceff0; color: var(--chu-phu); }
.nhan.moi { background: var(--do-nhat); color: var(--do); }
.anh-nho { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; background: var(--nen); display: block; }
.ten-cd { font-weight: 700; }
.phu { color: var(--chu-phu); font-size: .82rem; }
.thanh { height: 6px; background: var(--nen); border-radius: 99px; overflow: hidden; min-width: 70px; margin-top: 4px; }
.thanh i { display: block; height: 100%; background: var(--chu-dao); border-radius: 99px; }
.phan-trang { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px; color: var(--chu-phu); font-size: .88rem; }

/* Hộp thoại */
.phu-nen { position: fixed; inset: 0; background: rgba(15, 35, 37, .5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; }
.hop { background: #fff; border-radius: 14px; width: 100%; max-width: 780px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.hop.hep { max-width: 460px; }
.hop-dau { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--vien); }
.hop-dau h2 { margin: 0; }
.hop-dau button { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--chu-phu); padding: 4px 8px; }
.hop-than { padding: 18px 20px 4px; }
.hop-chan { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--vien); position: sticky; bottom: 0; background: #fff; border-radius: 0 0 14px 14px; }
fieldset { border: 1px solid var(--vien); border-radius: 10px; padding: 14px 14px 2px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; color: var(--chu-dao-dam); }
.chon-ngang { display: flex; gap: 16px; flex-wrap: wrap; }
.chon-ngang label { font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 0; font-size: .92rem; }
.chon-ngang input { width: auto; min-height: 0; }

/* Ô soạn thảo */
.thanh-soan { display: flex; gap: 4px; flex-wrap: wrap; border: 1px solid var(--vien); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 5px; background: #fafcfc; }
.thanh-soan button { background: #fff; border: 1px solid var(--vien); border-radius: 6px; padding: 3px 9px; cursor: pointer; font-size: .85rem; min-width: 32px; }
.thanh-soan button:hover { background: var(--chu-dao-nhat); }
.soan { border: 1px solid var(--vien); border-radius: 0 0 8px 8px; padding: 10px 12px; min-height: 110px; max-height: 280px; overflow-y: auto; background: #fff; }
.soan p { margin: 0 0 .5em; } .soan ul, .soan ol { margin: 0 0 .5em; padding-left: 22px; }
.xem-anh { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.xem-anh img { width: 128px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--vien); background: var(--nen); }

#thong-bao { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#thong-bao div { background: var(--chu); color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); max-width: 92vw; }
#thong-bao div.xau { background: var(--do); }

.canh-bao { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--vang-nhat); color: var(--vang); border: 1px solid #f0d9a8; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; }
