/* Kiểu dáng các trang nghiệp vụ (bản 0.3.2): công trình (đầu trang, bước, thẻ), hồ sơ, hợp đồng, báo giá, khách hàng, bảo hành, vật tư, khoán,
   nhân viên (danh sách kiểu HRM + sơ đồ tổ chức), cài đặt (thẻ mục), tài khoản. Dùng biến màu, .card, .kpi, .badge, .tag… của style.css.
   Tệp này chỉ thêm lớp riêng của các trang trên (và vài lớp phụ có tiền tố riêng); không đổi kiểu dáng chung của khung. */

/* ---------- dùng chung ---------- */
.mode .ic { width: 13px; height: 13px; }
.mode.xem { background: var(--grey-soft); color: #475467; border: 1px solid #e4e7ec; }
.mode.duyet { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.icon-btn .ic { width: 16px; height: 16px; vertical-align: middle; }
.icon-btn.do:hover { background: var(--bad-soft); color: var(--bad); }
label.co-ic { flex-direction: row-reverse; } /* nút tải lên: chữ đứng trước trong mã (bindTaiLen đổi chữ đó), biểu tượng hiện bên trái */
.page-head .sub .ic { width: 15px; height: 15px; }
.page-head + .kpis { margin-top: -2px; }
.mot-dong { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hai-dong { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.phu { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.phu .ic { width: 13px; height: 13px; vertical-align: -2px; }
.so-tien { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chu-nho { font-size: 12px; color: var(--muted); }
.thanh-pt { display: flex; align-items: center; gap: 8px; }
.thanh-pt .bar { flex: 1; margin: 0; min-width: 56px; }
.thanh-pt span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.o-tron { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: var(--main-soft); color: var(--main); flex: none; }
.o-tron .ic { width: 16px; height: 16px; }
/* tệp đính kèm: tên dài không đẩy trang rộng ra (điện thoại) */
.files > * { min-width: 0; }
.file { min-width: 0; }
.tep-o { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tep-o > .file { flex: 1 1 auto; min-width: 0; }
/* ô lọc: trên điện thoại ô tìm kiếm cả hàng */
.filters .dem-kq { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
/* thẻ có tiêu đề + mô tả ngắn */
.card .mo-ta { margin: -6px 0 12px; color: var(--muted); font-size: 13px; }

/* ---------- bảng danh sách gọn (cột tối thiểu, tên 1 dòng, tiền canh phải, cuộn ngang trong khung) ---------- */
table.list.gon { min-width: 880px; }
table.list.gon th, table.list.gon td { white-space: nowrap; }
table.list.gon td { padding-top: 10px; padding-bottom: 10px; }
table.list.gon td.chu { white-space: normal; }
table.list.gon td.c-ten .mot-dong { max-width: 280px; }
table.list.gon td.c-ten.rong .mot-dong { max-width: 340px; }
table.list.gon td.c-ct .mot-dong { max-width: 230px; }
table.list.gon td.c-hep .mot-dong { max-width: 190px; }
table.list.gon td.c-nd .hai-dong { min-width: 180px; max-width: 250px; }
table.list.gon td.num, table.list.gon th.num { font-variant-numeric: tabular-nums; }
table.list.gon td.num .phu { text-align: right; }
table.list.gon td.c-tien { min-width: 118px; }
table.list.gon td .nguoi .n { max-width: 150px; }
table.list.gon td.c-nut { width: 1%; text-align: right; }
table.list.gon td.c-nut .btn + .btn { margin-left: 4px; }
table.list.gon .badge { white-space: nowrap; }
table.list.gon tfoot td { background: #f6f8fc; font-weight: 600; border-top: 1px solid var(--line); }
.table-wrap.trong-card { box-shadow: none; }
.card > .table-wrap { box-shadow: none; }
.card > .table-wrap:first-child { margin-top: 0; }

/* ---------- đầu trang công trình ---------- */
.ct-hero { padding: 0; overflow: hidden; }
.ct-hero::before { content: ""; display: block; height: 4px; background: var(--grad); }
.ct-hero-top { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-start; padding: 18px 22px 14px; }
.ct-hero-t { flex: 1 1 420px; min-width: 0; }
.ct-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.ct-hero h1 { margin: 0 0 8px; font-size: 23px; line-height: 1.3; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.ct-hero-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 13px; }
.ct-hero-meta > span, .ct-hero-meta > a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.ct-hero-meta a { color: var(--muted); text-decoration: none; }
.ct-hero-meta a:hover { color: var(--main); text-decoration: underline; }
.ct-hero-meta .ic { width: 15px; height: 15px; flex: none; }
.ct-hero-meta .mot-dong { max-width: 420px; }
.ct-hero-nut { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ct-hero-so { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line-soft); border-top: 1px solid var(--line-soft); }
.ct-hero-so > div { background: #fff; padding: 12px 18px 13px; min-width: 0; }
.ct-hero-so > div:first-child { padding-left: 22px; }
.ct-hero-so .k { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ct-hero-so .k .ic { width: 14px; height: 14px; }
.ct-hero-so .v { display: block; margin-top: 4px; font-size: 15.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.ct-hero-so .v .badge { font-size: 12px; vertical-align: 1px; }
.ct-hero-so small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ct-hero-so .bar { margin-top: 7px; }
.ct-hero-so .avs { margin-top: 3px; }
.ct-hero-so .tre { color: var(--bad); font-weight: 600; }
.ct-hero .stepper { margin: 0; padding: 12px 22px 14px; border-top: 1px solid var(--line-soft); background: #f8fbfe; scroll-behavior: smooth; scrollbar-width: none; }
.ct-hero .stepper::-webkit-scrollbar { display: none; }
.ct-hero .stepper button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ct-hero .stepper button .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.ct-hero .stepper .st-so { font-variant-numeric: tabular-nums; }
.tabs.ct-tabs { margin-top: 2px; }
@media (max-width: 760px) {
  .tabs.ct-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .tabs.ct-tabs::-webkit-scrollbar { display: none; }
  .tabs.ct-tabs a { flex: none; padding: 10px 12px; }
  .ct-hero-top { padding: 16px 15px 12px; }
  .ct-hero h1 { font-size: 19px; }
  .ct-hero-meta .mot-dong { max-width: 78vw; }
  .ct-hero-nut { width: 100%; }
  .ct-hero-nut .btn { flex: 1 1 auto; }
  .ct-hero-so > div, .ct-hero-so > div:first-child { padding: 10px 14px 11px; }
  .ct-hero .stepper { padding: 10px 12px 12px; }
}
/* tổng quan công trình: nhật ký có ảnh đại diện */
.nk-dong { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.nk-dong:last-child { border-bottom: 0; }
.nk-dong .av { margin-top: 1px; }
.nk-dong time { display: block; color: var(--muted); font-size: 11.5px; }
.nk-ghi { display: flex; gap: 8px; margin-top: 10px; }
.nk-ghi .inp { flex: 1; min-width: 0; }
.ban-ve-dong { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; min-width: 0; }
.ban-ve-dong:last-child { border-bottom: 0; }
.ban-ve-dong .mot-dong { flex: 1; min-width: 0; }
.td-dong { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 4px 16px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.td-dong:last-child { border-bottom: 0; }
.td-dong .t { font-weight: 600; color: var(--ink); line-height: 1.35; }
.td-dong .bar { margin-top: 4px; }
@media (max-width: 560px) { .td-dong { grid-template-columns: minmax(0, 1fr) 96px; } }

/* ---------- thanh nút cuối trang gọn (báo giá, hồ sơ) ---------- */
.thanh-luu { gap: 8px; }
.thanh-luu .spacer { flex: 1; }
.menu-them { position: relative; display: inline-flex; }
.menu-them > .dd-menu { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 30; min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; animation: moVao .14s ease; }
.menu-them > .dd-menu button, .menu-them > .dd-menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 10px; background: none; color: var(--text); font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap; }
.menu-them > .dd-menu button:hover, .menu-them > .dd-menu a:hover { background: #eef2f8; }
.menu-them > .dd-menu .do { color: var(--bad); }
.menu-them > .dd-menu .do:hover { background: var(--bad-soft); }
.menu-them > .dd-menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 6px; }
.chi-dt { display: none !important; }
@media (max-width: 560px) {
  .an-dt { display: none !important; }
  .chi-dt { display: flex !important; }
  body.in-app .actions.sticky.thanh-luu { flex-wrap: nowrap; }
  body.in-app .actions.sticky.thanh-luu .btn { flex: 0 0 auto; }
  body.in-app .actions.sticky.thanh-luu .btn.primary { flex: 1 1 auto; }
  body.in-app .actions.sticky.thanh-luu .spacer { display: none; }
  .thanh-luu .menu-them > .dd-menu { right: 0; }
}
.btn.vuong { padding: 0; width: 40px; }
.btn.small.vuong { width: 32px; }

/* ---------- hồ sơ ---------- */
.hs-chon { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.hs-chon a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fff; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s, transform .12s; min-width: 0; }
.hs-chon a:hover { border-color: var(--main-line); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hs-chon a > span:last-child { min-width: 0; flex: 1; }
.hs-chon b { display: block; color: var(--ink); line-height: 1.35; }
.hs-tom { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.hs-tom .card { margin: 0; }
.hs-viec { display: grid; gap: 2px; }
.hs-viec a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; color: inherit; min-width: 0; }
.hs-viec a:hover { background: var(--hover); }
.hs-viec a > span:nth-child(2) { min-width: 0; flex: 1; }
.hs-viec b { display: block; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-group > .hs-head h3 .ic { width: 16px; height: 16px; color: var(--main); }
.hs-group > .hs-head h3.co-ic::before { display: none; }
.hai-cot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .hai-cot { grid-template-columns: minmax(0, 1fr); gap: 0; } }
button.kpi { width: 100%; text-align: left; cursor: pointer; font: inherit; }
button.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hs-row .tools .chu-nho { display: inline-flex; align-items: center; gap: 4px; }
.hs-row .tools .chu-nho .ic { width: 13px; height: 13px; }
@media (max-width: 1180px) { .hs-tom { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .hs-tom { grid-template-columns: minmax(0, 1fr); gap: 0; } .hs-tom .card { margin-bottom: 12px; } }

/* ---------- hợp đồng: các đợt thanh toán dạng thanh ---------- */
.dot-thanh { display: flex; gap: 4px; margin: 2px 0 14px; }
.dot-thanh > div { flex: var(--p, 1) 1 0; min-width: 0; }
.dot-thanh i { display: block; height: 8px; border-radius: 5px; background: #e4e9f1; position: relative; overflow: hidden; }
.dot-thanh i > b { position: absolute; inset: 0 auto 0 0; width: var(--d, 0%); background: linear-gradient(90deg, #3f75dd, #003399); border-radius: 5px; }
.dot-thanh .xong i > b { background: linear-gradient(90deg, #4ade80, #16a34a); }
.dot-thanh .tre i { box-shadow: inset 0 0 0 1.5px var(--bad); }
.dot-thanh span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-tom { margin-bottom: 16px; }

/* ---------- bảo hành: các bước của phiếu ---------- */
.bh-buoc { display: flex; align-items: center; gap: 0; margin: 2px 0 14px; }
.bh-buoc > div { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-weight: 600; font-size: 13px; }
.bh-buoc > div::after { content: ""; flex: 1; height: 2px; background: var(--line); margin: 0 10px; min-width: 12px; }
.bh-buoc > div:last-child { flex: none; }
.bh-buoc > div:last-child::after { display: none; }
.bh-buoc .so { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e7ebf2; color: var(--muted); flex: none; font-size: 12px; }
.bh-buoc .so .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.bh-buoc .xong { color: var(--ok); } .bh-buoc .xong .so { background: var(--ok); color: #fff; } .bh-buoc .xong::after { background: var(--ok-line); }
.bh-buoc .dang { color: var(--main); } .bh-buoc .dang .so { background: var(--grad-cam); color: #fff; }
.han-o { display: grid; gap: 2px; font-size: 12.5px; line-height: 1.35; }
.han-o .ic { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 560px) { .bh-buoc > div { font-size: 12px; gap: 6px; } .bh-buoc > div::after { margin: 0 6px; } }

/* ---------- khách hàng ---------- */
.kh-dau { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.kh-dau .av { box-shadow: none; }
.kh-dau h1 { margin: 0; font-size: 22px; line-height: 1.3; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.kh-dau .kh-t { flex: 1 1 300px; min-width: 0; }
.kh-dau .kh-t .row { margin-top: 4px; }
.lien-quan { display: grid; gap: 2px; }
.lien-quan a { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; text-decoration: none; color: inherit; min-width: 0; }
.lien-quan a:hover { background: var(--hover); }
.lien-quan a > span:nth-child(2) { flex: 1; min-width: 0; }
.lien-quan b { display: block; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lien-quan .so-tien { font-weight: 600; color: var(--ink); font-size: 13px; }
.lh-dong { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) auto; gap: 6px; margin: 4px 0; align-items: center; }
@media (max-width: 560px) { .lh-dong { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .lh-dong > :first-child { grid-column: 1 / -1; } }

/* ---------- nhân viên (kiểu HRM) ---------- */
.nv-bang .nguoi .n { max-width: 180px; }
.nv-bang td .phu.lui { padding-left: 46px; }
.nv-bang .may-o2 .tag { padding: 1px 6px; }
.nv-bang td.c-nut .icon-btn { border: 1px solid var(--line); background: #fff; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.nv-bang td.c-nut .icon-btn + .icon-btn { margin-left: 4px; }
.nv-bang tr.khoa td { background: #fbfaf9; }
.nv-bang tr.khoa .nguoi .n { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.nv-bang tr[data-sua-dong] { cursor: pointer; }
.quyen-chip { display: flex; flex-wrap: wrap; gap: 4px; max-width: 200px; }
.nv-bang th, .nv-bang td { padding-left: 10px; padding-right: 10px; }
.quyen-chip .tag { font-weight: 600; }
.quyen-chip .tag.them { background: #fff; border: 1px dashed #c4cddb; color: var(--muted); cursor: help; }
.tt-nv { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.tt-nv i { width: 8px; height: 8px; border-radius: 50%; background: #1baf7a; box-shadow: 0 0 0 3px rgba(27, 175, 122, .16); }
.tt-nv.khoa { color: var(--muted); } .tt-nv.khoa i { background: #98a2b3; box-shadow: 0 0 0 3px rgba(152, 162, 179, .2); }
.may-o2 { display: flex; gap: 4px; flex-wrap: nowrap; }
.nv-loc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.nv-loc input[type=search] { max-width: 300px; }
.nv-loc .seg { margin-left: auto; }
/* sơ đồ tổ chức (thuần HTML / CSS) */
.sd-dau { display: flex; flex-direction: column; align-items: center; gap: 0; margin: 4px 0 6px; }
.sd-hang { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; position: relative; }
.sd-noi { width: 2px; height: 18px; background: var(--line); }
.sd-o { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; box-shadow: var(--shadow); min-width: 220px; max-width: 300px; text-decoration: none; color: inherit; cursor: pointer; }
.sd-o:hover { border-color: var(--main-line); box-shadow: var(--shadow-md); }
.sd-o.lon { border-top: 3px solid var(--brand); }
.sd-o > span { min-width: 0; line-height: 1.3; }
.sd-o b { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-o small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-o .sd-dem { margin-left: auto; flex: none; font-size: 11.5px; font-weight: 600; color: var(--muted); background: #ecf0f5; border-radius: 999px; padding: 0 8px; line-height: 20px; }
.sd-luoi-dau { height: 18px; border-top: 2px solid var(--line); border-left: 2px solid var(--line); border-right: 2px solid var(--line); border-radius: 12px 12px 0 0; margin: 0 8% 0; }
.sd-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; align-items: start; }
.sd-pb { border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.sd-pb-dau { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #f6f9fd; border-bottom: 1px solid var(--line-soft); }
.sd-pb-dau h3 { margin: 0; font-size: 14px; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-pb-dau .o-tron { width: 28px; height: 28px; }
.sd-pb-dau .sd-dem { font-size: 11.5px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line-soft); border-radius: 999px; padding: 0 8px; line-height: 20px; }
.sd-cay { padding: 8px 14px 12px; }
.sd-cay ul { list-style: none; margin: 0; padding: 0; }
.sd-cay ul ul { padding-left: 15px; }
.sd-cay li { position: relative; }
.sd-cay ul ul > li { padding-left: 16px; }
.sd-cay ul ul > li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--line); }
.sd-cay ul ul > li:last-child::before { bottom: auto; height: 25px; }
.sd-cay ul ul > li::after { content: ""; position: absolute; left: 0; top: 25px; width: 12px; border-top: 2px solid var(--line); }
.sd-nut { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 10px; cursor: pointer; min-width: 0; }
.sd-nut:hover { background: var(--hover); }
.sd-nut > span { min-width: 0; line-height: 1.3; flex: 1; }
.sd-nut b { display: block; color: var(--ink); font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-nut small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-nut .tag { flex: none; }
.sd-bc { font-size: 11.5px; color: var(--faint); margin: -2px 0 2px 45px; }
@media (max-width: 560px) {
  .sd-o { min-width: 0; width: 100%; max-width: none; }
  .sd-luoi-dau { display: none; }
  .nv-loc .seg { margin-left: 0; width: 100%; } .nv-loc .seg button { flex: 1; justify-content: center; }
  .nv-loc input[type=search] { max-width: none; flex: 1 1 100%; }
  .nv-loc select { flex: 1 1 40%; max-width: none !important; }
}

/* ---------- cài đặt: thẻ mục (dính trên cùng, bấm là cuộn tới mục; mọi ô vẫn ở trên trang để 1 nút Lưu lưu hết) ---------- */
.cd-khung { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 22px; align-items: start; }
.cd-nav { position: sticky; top: calc(var(--tbh) + 16px); display: grid; gap: 2px; padding: 8px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.cd-nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 10px; background: none; color: var(--text); cursor: pointer; text-align: left; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .12s, color .12s; }
.cd-nav button .ic { color: var(--muted); }
.cd-nav button:hover { background: #eef2f8; }
.cd-nav button.on { background: var(--main-soft); color: var(--main-dark); }
.cd-nav button.on .ic { color: var(--main); }
.cd-nav .cd-nav-ghi { font-size: 11.5px; color: var(--faint); padding: 8px 11px 4px; line-height: 1.4; white-space: normal; }
.cd-phan { scroll-margin-top: calc(var(--tbh) + 16px); margin-bottom: 26px; }
.cd-phan-dau { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.cd-phan-dau .o-tron { width: 38px; height: 38px; border-radius: 12px; }
.cd-phan-dau .o-tron .ic { width: 19px; height: 19px; }
.cd-phan-dau h2 { margin: 0; font-size: 18px; color: var(--ink); line-height: 1.3; }
.cd-phan-dau p { margin: 1px 0 0; color: var(--muted); font-size: 13px; }
.cd-nh { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.cd-nh:last-of-type { border-bottom: 0; }
.cd-luu-ghi { color: var(--muted); font-size: 12.5px; }
@media (max-width: 1100px) {
  .cd-khung { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cd-nav { position: sticky; top: var(--tbh); z-index: 20; display: flex; gap: 4px; overflow-x: auto; padding: 6px; margin: 0 0 14px; border-radius: 13px; scrollbar-width: none; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); }
  .cd-nav::-webkit-scrollbar { display: none; }
  .cd-nav button { flex: none; width: auto; padding: 7px 11px; font-size: 13px; }
  .cd-nav .cd-nav-ghi { display: none; }
  .cd-phan { scroll-margin-top: calc(var(--tbh) + 70px); }
  .cd-nh { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cd-nh > :last-child { justify-self: end; grid-column: 1 / -1; }
}
@media (max-width: 560px) { .cd-nh { grid-template-columns: minmax(0, 1fr); } .cd-phan-dau h2 { font-size: 16.5px; } }

/* ---------- tài khoản ---------- */
.tk-dau { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; }
.tk-dau .av { box-shadow: none; }
.tk-dau h1 { margin: 0; font-size: 21px; color: var(--ink); }
.tk-dau .tk-t { flex: 1 1 260px; min-width: 0; }
.tk-dau .kv { margin-top: 10px; font-size: 13.5px; }

/* ---------- khoán: thẻ tổ đội ---------- */
.doi-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 16px; }
.doi-the { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.doi-the .nguoi { width: 100%; }
.doi-the .v { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 10px; line-height: 1.2; }
.doi-the .bar { margin-top: 8px; }
.doi-the .s { font-size: 12px; color: var(--muted); margin-top: 6px; }
/* chấm công thợ: cột tên dính bên trái khi cuộn ngang */
table.cc-tho td.ten, table.cc-tho th.ten { position: sticky; left: 0; background: #fff; z-index: 1; }
table.cc-tho thead th.ten { background: #f6f8fc; z-index: 2; }

/* ---------- điện thoại: bảng gọn thành thẻ ---------- */
@media (max-width: 560px) {
  table.list.cards.gon { min-width: 0; }
  table.list.cards.gon td { white-space: normal; padding: 3px 10px; }
  table.list.cards.gon td.o-rong { display: none; }
  table.list.cards.gon td .mot-dong { white-space: normal; max-width: none !important; overflow-wrap: anywhere; }
  table.list.cards.gon td .hai-dong { max-width: none !important; min-width: 0; }
  table.list.cards.gon tr { padding: 11px 6px; }
  table.list.cards.gon td:first-child { font-size: 15px; padding-bottom: 5px; }
  table.list.cards.gon td.num { text-align: left; }
  table.list.cards.gon td.num .phu { text-align: left; }
  table.list.cards.gon td.c-nut { width: auto; text-align: left; padding-top: 8px; }
  table.list.cards.gon .quyen-chip { max-width: none; }
  table.list.cards.gon .thanh-pt { max-width: 260px; }
  table.list.cards.gon td .nguoi .n { max-width: none; }
  .filters input[type=search] { max-width: none; flex: 1 1 100%; }
  .filters select { flex: 1 1 40%; max-width: none; }
}

/* ---------- bảng chào giá (BOQ): cột số đủ rộng, bảng cuộn ngang trong khung thay vì bóp cột ---------- */
table.boq td input.n { min-width: 92px; }
table.boq td input.n[data-k="vt"], table.boq td input.n[data-k="nc"], table.boq td input.n[data-k="dg"] { min-width: 112px; }
table.boq td input.n[data-k="kl1"] { min-width: 84px; }
table.boq td input[data-k="unit"] { min-width: 58px; }
table.boq td input[data-k="ref"] { min-width: 80px; }
table.boq td input[data-k="note"] { min-width: 130px; }
table.boq td.stt input { min-width: 48px; }
table.boq td.calc { min-width: 104px; }
table.boq td.tools .icon-btn { padding: 4px 5px; }
.goi-y-tag .ic { width: 12px; height: 12px; vertical-align: -1px; }
