/* Quản trị Phương Võ Center (bản nháp) — cùng bộ màu, cỡ chữ, bo góc với CRM crm.phuongvocenter.com
   (menu trái #182C4F, mục chọn #1A9AFF, nút chính #0C66FF, nền #F1F2F4, bo góc 4px, chữ hệ thống 14px).
   Tên class tránh các chữ hay bị bộ chặn quảng cáo giấu. */
:root {
  color-scheme: light;
  --nen: #f1f2f4;
  --mat: #ffffff;
  --mat-2: #fafafa;
  --vien: #e8e8e8;
  --vien-dam: #d9d9d9;
  --chu: #1f2a3d;
  --chu-2: #364866;
  --chu-mo: #6b7686;
  --chinh: #0c66ff;
  --chinh-sang: #3686ff;
  --chinh-dam: #0048d9;
  --chinh-nhat: #ebf5ff;
  --menu: #182c4f;
  --menu-chon: #1a9aff;
  --tot: #0a8f63; --tot-nen: #e3f7ef;
  --xau: #e02424; --xau-nen: #fdecec;
  --vang: #b45d00; --vang-nen: #fff3e0;
  --xanh-nen: #eef4ff;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --bong: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --bo: 4px;
  --ray: #eef0f3; --anh-nen: #dfe7f5; --hover: #f8fafd; --chan-bang: #fafbfc; --nen-dn: linear-gradient(160deg, #eef3fb, #f6f7f9); --vien-nhap: #cfe0ff; --chu-ngan: #4b5563; --chu-duoi: #5f6b7a;
  --menu-w: 236px;
  --tren-h: 56px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --nen: #12161d; --mat: #1a2029; --mat-2: #202733; --vien: #2c3442; --vien-dam: #3a4352;
    --chu: #e9edf3; --chu-2: #c3ccd9; --chu-mo: #8d97a6;
    --chinh: #3d86ff; --chinh-sang: #5c9aff; --chinh-dam: #7fb0ff; --chinh-nhat: #1a2a45;
    --menu: #121f37;
    --tot: #3fc48f; --tot-nen: #13302a; --xau: #f26b6b; --xau-nen: #3a1d1f; --vang: #f0a94a; --vang-nen: #36290f; --xanh-nen: #1a2a45;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --bong: 0 1px 2px rgba(0, 0, 0, .4);
    --ray: #263042; --anh-nen: #1a2a45; --hover: #202733; --chan-bang: #202733; --nen-dn: #12161d; --vien-nhap: #2c3442; --chu-ngan: #c3ccd9; --chu-duoi: #8d97a6;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --nen: #12161d; --mat: #1a2029; --mat-2: #202733; --vien: #2c3442; --vien-dam: #3a4352;
  --chu: #e9edf3; --chu-2: #c3ccd9; --chu-mo: #8d97a6;
  --chinh: #3d86ff; --chinh-sang: #5c9aff; --chinh-dam: #7fb0ff; --chinh-nhat: #1a2a45;
  --menu: #121f37;
  --tot: #3fc48f; --tot-nen: #13302a; --xau: #f26b6b; --xau-nen: #3a1d1f; --vang: #f0a94a; --vang-nen: #36290f; --xanh-nen: #1a2a45;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --bong: 0 1px 2px rgba(0, 0, 0, .4);
  --ray: #263042; --anh-nen: #1a2a45; --hover: #202733; --chan-bang: #202733; --nen-dn: #12161d; --vien-nhap: #2c3442; --chu-ngan: #c3ccd9; --chu-duoi: #8d97a6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--nen); color: var(--chu); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
a { color: var(--chinh); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
h1, h2 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; line-height: 1.3; }
h2 { font-size: 16px; }
svg.ic { width: 18px; height: 18px; flex: none; }
.mo { color: var(--chu-mo); }
.nho { font-size: 12.5px; }
.loi { color: var(--xau); min-height: 1.2em; margin: 4px 0; font-size: 13px; }
.so { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Nút, ô nhập ---------- */
.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 15px; min-height: 36px;
  border: 1px solid var(--vien-dam); background: var(--mat); border-radius: var(--bo); cursor: pointer;
  white-space: nowrap; font-weight: 500; color: var(--chu); text-decoration: none !important;
}
.nut:hover { border-color: var(--chinh-sang); color: var(--chinh-sang); }
.nut.chinh { background: var(--chinh); border-color: var(--chinh); color: #fff; }
.nut.chinh:hover { background: var(--chinh-sang); border-color: var(--chinh-sang); color: #fff; }
.nut-icon {
  display: inline-grid; place-items: center; border: 0; background: transparent; cursor: pointer;
  width: 36px; height: 36px; border-radius: var(--bo); color: var(--chu-mo); flex: none;
}
.nut-icon:hover { background: var(--mat-2); color: var(--chinh); }
.o-nhap, .chon-co-so, .bang-cong-cu input {
  border: 1px solid var(--vien-dam); border-radius: var(--bo); padding: 6px 11px; min-height: 36px; background: var(--mat);
}
.o-nhap:focus, .chon-co-so:focus, .bang-cong-cu input:focus, .the-dang-nhap input:focus, #o-nhap-tim:focus {
  outline: 0; border-color: var(--chinh-sang); box-shadow: 0 0 0 2px rgba(12, 102, 255, .2);
}

/* ---------- Đăng nhập ---------- */
.dang-nhap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--nen-dn); }
.the-dang-nhap {
  width: 100%; max-width: 420px; background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo);
  padding: 28px; box-shadow: var(--bong); display: grid; gap: 12px;
}
.the-dang-nhap .dau { text-align: center; margin-bottom: 6px; }
.the-dang-nhap h1 { font-size: 20px; }
.the-dang-nhap p { margin: 2px 0 0; }
.the-dang-nhap label { display: grid; gap: 4px; font-size: 12.5px; color: var(--chu-2); font-weight: 500; }
.the-dang-nhap input { border: 1px solid var(--vien-dam); border-radius: var(--bo); padding: 6px 11px; min-height: 36px; background: var(--mat); font-size: 14px; }
.the-dang-nhap .nut { min-height: 46px; font-size: 15px; }
.logo-lon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--chinh); color: #fff; margin: 0 auto 10px;
  display: grid; place-items: center; font-weight: 800; font-size: 22px;
}
.nhan-nhap { display: inline-block; background: var(--vang-nen); color: var(--vang); border-radius: 10px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }

/* ---------- Menu trái ---------- */
.menu {
  position: fixed; inset: 0 auto 0 0; width: var(--menu-w); background: var(--menu); color: #fff;
  display: flex; flex-direction: column; z-index: 30;
}
.menu-dau { height: var(--tren-h); display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); flex: none; }
.logo {
  width: 32px; height: 32px; border-radius: 4px; background: var(--menu-chon); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: none;
}
.ten-tiem { flex: 1; min-width: 0; line-height: 1.2; }
.ten-tiem b { display: block; font-weight: 600; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ten-tiem small { font-size: 11px; color: rgba(255, 255, 255, .55); letter-spacing: .04em; }
.menu .nut-icon { color: rgba(255, 255, 255, .6); width: 30px; height: 30px; }
.menu .nut-icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.cay-menu { flex: 1; overflow-y: auto; padding: 6px 0; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.nhom-menu > button {
  display: flex; align-items: center; width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255, 255, 255, .55); padding: 12px 20px 8px;
}
.nhom-menu > button:hover { color: #fff; }
.nhom-menu > button .chu { flex: 1; }
.nhom-menu > button .mui { width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform .15s; }
.nhom-menu.mo-ra > button .mui { transform: rotate(45deg); }
.nhom-menu .muc { display: none; }
.nhom-menu.mo-ra .muc, .nhom-menu.don .muc { display: block; }
.muc a {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: rgba(255, 255, 255, .85); text-decoration: none !important;
}
.muc a svg { width: 18px; height: 18px; flex: none; color: rgba(255, 255, 255, .75); }
.muc a .chu { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muc a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.muc a.dang-xem { background: var(--menu-chon); color: #fff; }
.muc a.dang-xem svg { color: #fff; }
.muc a.sap { color: rgba(255, 255, 255, .5); }
.muc a.sap svg { color: rgba(255, 255, 255, .4); }
.nhan-sap { font-size: 10.5px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 10px; padding: 0 6px; white-space: nowrap; }
.chan-menu { border-top: 1px solid rgba(255, 255, 255, .08); padding: 12px 20px; font-size: 12.5px; color: rgba(255, 255, 255, .7); flex: none; }
.chan-menu a { color: #fff; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.chan-menu a svg { width: 15px; height: 15px; }

body.thu-gon { --menu-w: 64px; }
body.thu-gon .ten-tiem, body.thu-gon .nhom-menu > button, body.thu-gon .muc a .chu, body.thu-gon .nhan-sap, body.thu-gon .chan-menu { display: none; }
body.thu-gon .menu-dau { padding: 0; justify-content: center; flex-direction: column; gap: 2px; height: auto; padding: 10px 0; }
body.thu-gon .nhom-menu .muc { display: block; }
body.thu-gon .muc a { justify-content: center; padding: 11px 0; }
body.thu-gon #nut-thu-gon svg { transform: rotate(180deg); }

/* ---------- Thanh trên ---------- */
.than { margin-left: var(--menu-w); min-height: 100vh; }
.thanh-tren {
  position: fixed; left: var(--menu-w); right: 0; top: 0; height: var(--tren-h); background: var(--mat); border-bottom: 1px solid var(--vien);
  display: flex; align-items: center; gap: 12px; padding: 0 20px; z-index: 20;
}
.ten-m { display: none; }
.o-tim-nhanh {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px;
  border: 1px solid var(--vien-dam); border-radius: var(--bo); background: var(--mat); color: var(--chu-mo); cursor: pointer; text-align: left;
}
.o-tim-nhanh:hover { border-color: var(--chinh-sang); }
.o-tim-nhanh svg { width: 16px; height: 16px; }
.o-tim-nhanh .chu-tim { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: 11px/1 ui-monospace, monospace; border: 1px solid var(--vien); border-radius: 4px; padding: 3px 5px; background: var(--mat-2); color: var(--chu-mo); }
.phai-tren { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chon-co-so { min-width: 180px; }
.nguoi { display: flex; align-items: center; gap: 8px; }
.anh-nho { width: 32px; height: 32px; border-radius: 50%; background: var(--anh-nen); color: var(--chinh-dam); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.ten-nguoi { font-size: 13px; color: var(--chu); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

.noi-dung { padding: calc(var(--tren-h) + 20px) 24px 40px; max-width: 1480px; outline: none; }
.dai-nhap {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--xanh-nen); border: 1px solid var(--vien-nhap); color: var(--chu-2);
  border-radius: var(--bo); padding: 8px 12px; margin-bottom: 14px; font-size: 13px;
}
.dai-nhap a { font-weight: 600; }

/* ---------- Đầu trang + chọn kỳ ---------- */
.tieu-de-trang { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.tieu-de-trang > div:first-child { flex: 1 1 280px; min-width: 0; }
.tieu-de-trang p { margin: 2px 0 0; font-size: 13px; }
.duong-dan { font-size: 12.5px; color: var(--chu-mo); margin-bottom: 2px; }
.hang-ky { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.chip {
  display: inline-flex; align-items: center; padding: 4px 10px; min-height: 32px; border-radius: var(--bo); border: 1px solid var(--vien-dam);
  background: var(--mat); cursor: pointer; white-space: nowrap; font-size: 13px; font-weight: 500;
}
.chip:hover { border-color: var(--chinh-sang); color: var(--chinh-sang); }
.chip.chon { background: var(--chinh); border-color: var(--chinh); color: #fff; }
.chon-ngay { display: flex; gap: 6px; align-items: center; }
.chon-ngay input { border: 1px solid var(--vien-dam); border-radius: var(--bo); padding: 3px 6px; min-height: 32px; background: var(--mat); }
.cap-nhat { font-size: 12.5px; color: var(--chu-mo); white-space: nowrap; }

/* ---------- Ô số (giống ô số CRM) ---------- */
.dai-so { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.o-so { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo); box-shadow: var(--bong); padding: 14px 16px; min-width: 0; }
.o-so .nhan { color: var(--chu-mo); font-size: 12.5px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.o-so .gia-tri { font-size: 22px; font-weight: 700; margin-top: 2px; }
.o-so .so-sanh { font-size: 12px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 0 5px; align-items: baseline; color: var(--chu-mo); }
.o-so .giai-thich { font-size: 12px; color: var(--chu-mo); margin-top: 4px; }
.o-so .cach-tinh { display: none; font-size: 12.5px; color: var(--chu-2); background: var(--mat-2); border: 1px solid var(--vien); border-radius: var(--bo); padding: 8px 10px; margin-top: 8px; }
.o-so.mo-i .cach-tinh { display: block; }
.nut-i {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--vien-dam); background: var(--mat); padding: 0;
  font: italic 700 10.5px/1 Georgia, serif; color: var(--chu-mo); cursor: pointer; flex: none;
}
.nut-i:hover { border-color: var(--chinh); color: var(--chinh); }
.tang { color: var(--tot); }
.giam { color: var(--xau); }
.bang-nhau { color: var(--chu-mo); }

/* Ô việc cần làm (giống hàng ô viền đỏ trên Tổng quan CRM) */
.hang-viec { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.o-viec {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--mat); border: 1px solid var(--vien);
  border-radius: var(--bo); box-shadow: var(--bong); color: var(--chu); text-decoration: none !important; min-width: 0;
}
.o-viec.gap { border-left: 3px solid var(--xau); }
.o-viec .bt { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.o-viec .bt svg { width: 20px; height: 20px; }
.o-viec .so-lon { font-size: 20px; font-weight: 700; line-height: 1.2; }
.o-viec .chu-nho { font-size: 13px; color: var(--chu-mo); }
a.o-viec:hover { border-color: var(--chinh-sang); }

/* ---------- Khối (thẻ) ---------- */
.luoi-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.khoi { background: var(--mat); border: 1px solid var(--vien); border-radius: var(--bo); box-shadow: var(--bong); padding: 16px; margin-bottom: 12px; min-width: 0; }
.khoi-dau { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: -16px -16px 14px; padding: 12px 16px; border-bottom: 1px solid var(--vien); }
.khoi-dau h2 { font-size: 15px; }
.khoi > h2 { font-size: 15px; margin: -16px -16px 14px; padding: 12px 16px; border-bottom: 1px solid var(--vien); }
.ngan { display: flex; gap: 2px; border-bottom: 1px solid var(--vien); overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; background: var(--mat); border-radius: var(--bo) var(--bo) 0 0; }
.ngan::-webkit-scrollbar { display: none; }
.ngan button {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--chu-ngan); font-weight: 500;
  border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px;
}
.ngan button.chon { color: var(--chinh-dam); border-bottom-color: var(--chinh); }
.khoi > .ngan { margin: -16px -16px 14px; padding: 0 4px; }
.ngan-rieng { border: 1px solid var(--vien); box-shadow: var(--bong); padding: 0 4px; }
.dem { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--ray); font-size: 12px; text-align: center; margin-left: 4px; color: var(--chu-2); }
.ngan button.chon .dem { background: var(--chinh); color: #fff; }

/* ---------- Danh sách việc ---------- */
.ds-viec { list-style: none; margin: 0; padding: 0; }
.ds-viec li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--vien); align-items: flex-start; }
.ds-viec li:first-child { border-top: 0; padding-top: 0; }
.ds-viec .dau-viec { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ds-viec .dau-viec svg { width: 18px; height: 18px; }
.ds-viec .noi { flex: 1; min-width: 0; }
.ds-viec .noi b { display: block; font-weight: 600; }
.ds-viec .phu { color: var(--chu-mo); font-size: 12.5px; }
.muc-xau { background: var(--xau-nen); color: var(--xau); }
.muc-vang { background: var(--vang-nen); color: var(--vang); }
.muc-tot { background: var(--tot-nen); color: var(--tot); }
.muc-xanh { background: var(--xanh-nen); color: var(--chinh-dam); }
.trong { color: var(--chu-mo); padding: 24px 0; text-align: center; }
.danh-sach-nho { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; }
.danh-sach-nho li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border: 0; }
.danh-sach-nho li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Bảng (giống bảng CRM) ---------- */
.bang-cong-cu { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.bang-cong-cu input { flex: 1 1 220px; max-width: 420px; }
.bang-boc { overflow-x: auto; border: 1px solid var(--vien); border-radius: var(--bo); }
table.bang { width: 100%; border-collapse: collapse; }
.bang th, .bang td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--vien); white-space: nowrap; }
.bang th { padding: 9px 12px; font-weight: 500; font-size: 13px; color: var(--chu-2); background: var(--mat-2); cursor: pointer; user-select: none; }
.bang th:hover { color: var(--chinh); }
.bang th.phai, .bang td.phai { text-align: right; }
.bang th .mui-sx { font-size: 10px; margin-left: 3px; color: var(--chinh); }
.bang tbody tr:last-child td { border-bottom: 0; }
.bang tbody tr:hover { background: var(--hover); }
.bang tfoot td { font-weight: 600; background: var(--chan-bang); border-top: 1px solid var(--vien); border-bottom: 0; }
.bang td.dai { white-space: normal; min-width: 180px; }
.bang-them { text-align: center; padding: 10px 0 0; }
.nhan-tt { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- Biểu đồ ---------- */
.chu-giai { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--chu-2); margin-bottom: 8px; }
.chu-giai span { display: inline-flex; align-items: center; gap: 6px; }
.chu-giai i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.bieu-do { position: relative; width: 100%; }
.bieu-do svg { display: block; width: 100%; height: auto; overflow: visible; }
.bieu-do .luoi { stroke: var(--vien); stroke-width: 1; }
.bieu-do .truc { fill: var(--chu-mo); font-size: 11px; }
.bieu-do .cot-cham.dang-chi { fill: var(--chinh); opacity: .06; }
.goi-y {
  position: fixed; z-index: 60; pointer-events: none; background: var(--mat); color: var(--chu);
  border: 1px solid var(--vien); border-radius: 8px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  font-size: 12.5px; min-width: 180px;
}
.goi-y .dong { display: flex; justify-content: space-between; gap: 14px; }
.goi-y i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.thanh-ngang { display: grid; gap: 12px; }
.thanh-ngang .hang { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.thanh-ngang .ray { height: 8px; background: var(--ray); border-radius: 4px; overflow: hidden; }
.thanh-ngang .lap { height: 100%; border-radius: 4px; }

/* ---------- Hồ sơ khách, hệ thống ---------- */
.ho-so-dau { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.anh-chu { width: 48px; height: 48px; border-radius: 50%; background: var(--anh-nen); color: var(--chinh-dam); display: grid; place-items: center; font-size: 18px; font-weight: 700; flex: none; }
.cap-tt { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; margin: 0; }
.cap-tt dt { color: var(--chu-mo); font-size: 12.5px; }
.cap-tt dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.do-thanh { height: 8px; background: var(--ray); border-radius: 4px; overflow: hidden; margin: 6px 0 2px; }
.do-thanh > div { height: 100%; background: var(--chinh); border-radius: 4px; }
.do-thanh.vang > div { background: var(--vang); }
.do-thanh.do > div { background: var(--xau); }

/* ---------- Tìm nhanh ---------- */
.hop-tim { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 70; display: grid; justify-items: center; align-items: start; padding: 10vh 16px 16px; }
.hop-tim-trong { width: 100%; max-width: 560px; background: var(--mat); border-radius: 8px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); padding: 10px; }
.hop-tim-trong p { margin: 6px 4px 0; }
#o-nhap-tim { width: 100%; border: 1px solid var(--vien-dam); border-radius: var(--bo); padding: 8px 12px; font-size: 15px; background: var(--mat); min-height: 40px; }
.ket-qua-tim { max-height: 55vh; overflow-y: auto; margin-top: 6px; }
.ket-qua-tim .nhom-kq { font-size: 11px; color: var(--chu-mo); padding: 8px 8px 2px; text-transform: uppercase; letter-spacing: .06em; }
.ket-qua-tim a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--bo); color: var(--chu); }
.ket-qua-tim a span:last-child { color: var(--chu-mo); font-size: 12.5px; white-space: nowrap; }
.ket-qua-tim a.chon, .ket-qua-tim a:hover { background: var(--chinh-nhat); text-decoration: none; }

/* ---------- Điện thoại: thanh dưới trắng + bảng «Thêm» (giống CRM) ---------- */
.thanh-duoi, .tam-them { display: none; }
@media (max-width: 1200px) {
  .luoi-2 { grid-template-columns: minmax(0, 1fr); }
  .hang-viec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --tren-h: 52px; --menu-w: 0px; }
  body.thu-gon { --menu-w: 0px; }
  .menu { display: none; }
  .thanh-tren { left: 0; padding: 0 8px 0 12px; gap: 6px; }
  .ten-m { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; }
  .ten-m .logo { width: 28px; height: 28px; font-size: 13px; }
  .ten-m span { overflow: hidden; text-overflow: ellipsis; }
  .ten-m .nhan-nhap { flex: none; overflow: visible; }
  #nut-sang-toi { display: none; } /* trên điện thoại nằm trong bảng «Thêm» */
  .o-tim-nhanh { flex: none; width: 36px; padding: 0; justify-content: center; border: 0; }
  .o-tim-nhanh .chu-tim, .o-tim-nhanh kbd { display: none; }
  .phai-tren { margin-left: 0; gap: 2px; }
  .chon-co-so { min-width: 0; max-width: 112px; padding: 4px 6px; font-size: 13px; }
  .ten-nguoi, .nguoi .anh-nho { display: none; }
  .noi-dung { padding: calc(var(--tren-h) + 12px) 12px calc(76px + env(safe-area-inset-bottom)); }
  h1 { font-size: 18px; }
  .hang-ky { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: calc(100% + 24px); margin: 0 -12px; padding: 0 12px 2px; }
  .hang-ky::-webkit-scrollbar { display: none; }
  .dai-so, .hang-viec { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
  .o-so { padding: 12px; }
  .o-so .giai-thich { display: none; }
  .o-so.mo-i .giai-thich { display: block; }
  .o-viec { padding: 12px; gap: 10px; }
  .o-viec .bt { width: 34px; height: 34px; }
  .khoi { padding: 12px; }
  .khoi-dau, .khoi > h2, .khoi > .ngan { margin: -12px -12px 12px; }
  .thanh-ngang .hang { grid-template-columns: 84px 1fr auto; }
  .thanh-duoi {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--mat); border-top: 1px solid var(--vien); padding-bottom: env(safe-area-inset-bottom);
  }
  .thanh-duoi a, .thanh-duoi button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 11px; color: var(--chu-duoi);
    background: none; border: 0; text-decoration: none !important; cursor: pointer;
  }
  .thanh-duoi svg { width: 22px; height: 22px; }
  .thanh-duoi .dang-xem { color: var(--chinh); }
  .tam-them.mo { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .4); }
  .tam-them .tam {
    position: absolute; left: 0; right: 0; bottom: 0; background: var(--mat); border-radius: 14px 14px 0 0;
    padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); max-height: 80vh; overflow-y: auto;
  }
  .tam-them .nhom-kq { font-size: 11px; color: var(--chu-mo); padding: 10px 12px 4px; text-transform: uppercase; letter-spacing: .06em; }
  .tam-them a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; color: var(--chu); text-decoration: none !important; }
  .tam-them a svg { width: 20px; height: 20px; color: var(--chu-duoi); }
  .tam-them a.dang-xem { background: var(--chinh-nhat); color: var(--chinh-dam); }
  .tam-them a.sap { color: var(--chu-mo); }
  .tam-them a .nhan-sap { margin-left: auto; border-color: var(--vien-dam); color: var(--chu-mo); }
}
@media (max-width: 520px) {
  .o-so .gia-tri { font-size: 18px; }
  .o-viec .so-lon { font-size: 18px; }
}
@media print {
  .menu, .thanh-tren, .thanh-duoi, .hang-ky, .dai-nhap { display: none !important; }
  .than { margin: 0 !important; }
  .noi-dung { padding-top: 0; }
}
