/* Giao diện phần mềm H2 VIỆT NAM (đổi nhận diện 25/11/2026, bản 0.4.2; bố cục từ bản 2.0) – kiểu phần mềm quản trị (menu dọc trái, thanh trên có tìm kiếm, chuông, ảnh đại diện),
   màu theo logo duyệt H2 VIỆT NAM: xanh logo #003399 cho nút chính, liên kết, ô đang chọn (chữ trắng trên nền xanh 10,9:1); nền trang và chữ phụ xám xanh;
   menu trái xanh đậm cùng sắc logo, logo trắng. Màu mang nghĩa giữ nguyên: vàng = chờ / cảnh báo, đỏ = lỗi / quá hạn, cam = đang làm / thi công / giờ ra,
   màu 8 bước công trình và các dãy số liệu (đã kiểm mù màu). Chữ Be Vietnam Pro (OFL, có sẵn trong public/fonts), biểu tượng Lucide (ISC, public/icons.svg).
   0.3.2: mọi màu CHỮ đạt ≥ 4,5:1 trên nền trắng và nền trang #f0f2f6 (--muted 5,8:1, --faint 5,2:1, --main 5,3:1 / 4,7:1, nút chính ≥ 4,5:1);
   --deco chỉ cho nét trang trí (viền, chấm), không dùng cho chữ. */

@font-face { font-family: "Be Vietnam Pro"; src: url(/fonts/bvp-Regular.woff2) format("woff2"); font-weight: 300 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Be Vietnam Pro"; src: url(/fonts/bvp-SemiBold.woff2) format("woff2"); font-weight: 600 900; font-style: normal; font-display: swap; }

:root {
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --brand: #003399; --main: #003399; --main-dark: #00287d; --main-soft: #edf4ff; --main-line: #c7dafb; --main-50: #f6f9ff;
  --sun: #f5b82e; --sun-soft: #fff8e6; --ink: #181b21; --peach: #a5c5ff; --dark: #041540;
  --grad: linear-gradient(90deg, #003399 0%, #2e69de 55%, #7ba4f0 100%);
  --grad-cam: linear-gradient(135deg, #0743b5 0%, #003399 50%, #00287d 100%);
  --bg: #f0f2f6; --card: #fff; --text: #22262c; --muted: #5f6671; --faint: #666e7a; --deco: #a3abb7; --line: #dde2ea; --line-soft: #e7ebf2; --hover: #f3f7fd;
  --do: #d63a2f; /* nền chấm số đỏ (chữ trắng 4,7:1) */
  /* màu 8 bước công trình: chấm ở menu, tổng quan, bảng (cùng sắc với nhãn .badge) */
  --gd-khach-hoi: #8693a6; --gd-bao-gia: #3b82f6; --gd-chot: #22a35a; --gd-chuan-bi: #8b5cf6; --gd-thi-cong: #f07a2a; --gd-thanh-toan: #db2777;
  --gd-ban-giao: #0d9488; --gd-bao-hanh: #65a30d;
  --ok: #15803d; --ok-soft: #ecfdf3; --ok-line: #bbf0cf; --warn: #b45309; --warn-soft: #fff8eb; --warn-line: #fcdca4; --bad: #c62828; --bad-soft: #fef2f1; --bad-line: #f9c8c4;
  --blue: #2563eb; --blue-soft: #eef4ff; --purple: #7c3aed; --purple-soft: #f4f0ff; --teal: #0f766e; --teal-soft: #ecfbf8; --grey: #667085; --grey-soft: #f2f4f7;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(21, 24, 29, .05), 0 1px 10px rgba(21, 24, 29, .035);
  --shadow-md: 0 4px 16px rgba(21, 24, 29, .08), 0 1px 3px rgba(21, 24, 29, .05);
  --shadow-lg: 0 18px 48px rgba(21, 24, 29, .18), 0 2px 8px rgba(21, 24, 29, .08);
  --sbw: 256px; --tbh: 62px;
  --sb-bg: #04226a; --sb-text: #dbe3f4; --sb-muted: #9fb0d6; --sb-line: rgba(255, 255, 255, .10);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--main); }
b, strong, h1, h2, h3, h4, th { font-weight: 600; }
h1, h2, h3 { letter-spacing: -.01em; }
[hidden] { display: none !important; }
img { max-width: 100%; }
::selection { background: #c5daff; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.ic.sm { width: 15px; height: 15px; } .ic.lg { width: 22px; height: 22px; } .ic.xl { width: 28px; height: 28px; }
* { scrollbar-width: thin; scrollbar-color: #c1c8d3 transparent; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
/* chấm màu theo bước công trình */
.gd-dot { --m: var(--deco); display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--m); flex: none; }
.gd-dot.khach-hoi { --m: var(--gd-khach-hoi); } .gd-dot.bao-gia { --m: var(--gd-bao-gia); } .gd-dot.chot { --m: var(--gd-chot); } .gd-dot.chuan-bi { --m: var(--gd-chuan-bi); }
.gd-dot.thi-cong { --m: var(--gd-thi-cong); } .gd-dot.thanh-toan { --m: var(--gd-thanh-toan); } .gd-dot.ban-giao { --m: var(--gd-ban-giao); } .gd-dot.bao-hanh { --m: var(--gd-bao-hanh); }

/* ---------- dải bản chạy thử ---------- */
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(90deg, #fff4d6, #ffe9c7); color: #6b3d00; font-weight: 600;
  padding: 6px 14px; font-size: 12.5px; border-bottom: 1px solid #f6d9a4; }
.demo-bar .ic { color: #c46a00; }

/* ---------- menu dọc bên trái ---------- */
body.in-app { padding-left: var(--sbw); }
body.in-app.sb-gon { --sbw: 76px; }
.sb { position: fixed; inset: 0 auto 0 0; width: var(--sbw); z-index: 60; display: flex; flex-direction: column; color: var(--sb-text);
  background: radial-gradient(120% 60% at 0% 0%, rgba(86, 146, 255, .26), transparent 60%), linear-gradient(180deg, #052b84 0%, #04226a 55%, #041a51 100%);
  box-shadow: 1px 0 0 rgba(0, 0, 0, .25); transition: width .18s ease, transform .22s ease; }
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: var(--tbh); padding: 0 10px 0 20px; flex: none; }
.sb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; color: #fff; }
.sb-brand .sb-mark { height: 32px; width: auto; display: block; flex: none; }
.sb-brand .sb-ten { font-size: 16.5px; font-weight: 800; letter-spacing: .05em; line-height: 1; white-space: nowrap; }
.sb-thu { width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--sb-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sb-thu:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sb-cty { margin: -4px 20px 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--sb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 12px 16px; scrollbar-color: rgba(255, 255, 255, .22) transparent; }
.sb-grp { font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--sb-muted); padding: 16px 10px 6px; font-weight: 600; white-space: nowrap; }
.sb-nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 1px 0; border-radius: 10px; color: var(--sb-text); text-decoration: none;
  font-size: 14px; position: relative; white-space: nowrap; transition: background .12s, color .12s; }
.sb-nav a .ic { width: 19px; height: 19px; color: #a9badf; transition: color .12s; }
.sb-nav a .l { overflow: hidden; text-overflow: ellipsis; }
.sb-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sb-nav a:hover .ic { color: #fff; }
.sb-nav a.on { background: linear-gradient(90deg, rgba(255, 255, 255, .19), rgba(255, 255, 255, .05)); color: #fff; font-weight: 600; }
.sb-nav a.on::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(#ffffff, #a5c5ff); }
.sb-nav a.on .ic { color: #c8dcff; }
.sb-nav a .dot { margin-left: auto; min-width: 21px; padding: 0 6px; border-radius: 11px; background: rgba(255, 255, 255, .13); color: #fff; font-size: 11.5px; line-height: 21px; text-align: center; font-weight: 600; }
.sb-nav a .dot.do { background: var(--do); }
/* công trình đang theo dõi: tối đa 5 dòng ngay dưới mục Công trình (chấm màu theo bước) */
.sb-ct { position: relative; margin: 1px 0 4px; }
.sb-ct::before { content: ""; position: absolute; left: 19px; top: 2px; bottom: 2px; width: 1px; background: rgba(255, 255, 255, .09); }
.sb-nav a.sb-sub { gap: 10px; padding: 5px 10px 5px 33px; margin: 0; font-size: 13px; color: #c3cfe9; border-radius: 9px; }
.sb-nav a.sb-sub .gd-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px rgba(0, 0, 0, .22); }
.sb-nav a.sb-sub .l { min-width: 0; }
.sb-nav a.sb-sub .l em { font-style: normal; color: #9fb0d6; }
.sb-nav a.sb-sub:hover { color: #fff; }
.sb-nav a.sb-sub.on { background: rgba(255, 255, 255, .07); color: #fff; font-weight: 600; }
.sb-nav a.sb-sub.on::before { display: none; }
.sb-foot { flex: none; border-top: 1px solid var(--sb-line); padding: 10px 12px 12px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-decoration: none; color: var(--sb-text); }
.sb-user:hover { background: rgba(255, 255, 255, .06); }
.sb-user .n { display: block; color: #fff; font-weight: 600; font-size: 13.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .r { display: block; color: var(--sb-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user > span:last-child { min-width: 0; }
.sb-ver { font-size: 11px; color: #9fb0d6; padding: 6px 8px 0; white-space: nowrap; }
/* thu gọn: chỉ còn biểu tượng */
body.sb-gon .sb-top { padding: 0 10px; justify-content: center; flex-direction: column; height: auto; padding-top: 14px; gap: 6px; }
body.sb-gon .sb-brand .sb-ten, body.sb-gon .sb-cty, body.sb-gon .sb-nav a .l, body.sb-gon .sb-user > span:last-child, body.sb-gon .sb-ver, body.sb-gon .sb-ct { display: none; }
body.sb-gon .sb-brand .sb-mark { height: 28px; }
body.sb-gon .sb-grp { font-size: 0; padding: 10px 0 4px; } body.sb-gon .sb-grp::after { content: ""; display: block; height: 1px; background: var(--sb-line); margin: 0 8px; }
body.sb-gon .sb-nav { padding: 4px 10px 16px; }
body.sb-gon .sb-nav a { justify-content: center; padding: 10px 0; }
body.sb-gon .sb-nav a .dot { position: absolute; top: 2px; right: 4px; min-width: 17px; line-height: 17px; font-size: 10px; padding: 0 4px; }
body.sb-gon .sb-user { justify-content: center; }
.sb-che { position: fixed; inset: 0; z-index: 55; background: rgba(14, 17, 21, .5); backdrop-filter: blur(2px); }

/* ---------- thanh trên ---------- */
.top { position: sticky; top: 0; z-index: 45; height: var(--tbh); display: flex; align-items: center; gap: 8px; padding: 0 28px;
  background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.spacer { flex: 1; }
.top .tb-menu, .top .tb-brand { display: none; }
.tb-brand { align-items: center; gap: 7px; text-decoration: none; color: var(--main); }
.tb-brand img { height: 27px; width: auto; display: block; flex: none; }
.tb-brand span { font-size: 14.5px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.tb-search { display: flex; align-items: center; gap: 10px; width: min(480px, 42vw); height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: 11px;
  background: #f2f4f8; color: var(--muted); cursor: pointer; text-align: left; transition: border-color .12s, background .12s; }
.tb-search:hover { border-color: #cbd1dd; background: #fff; }
.tb-search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
kbd { font: 600 11px var(--font); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: #fff; color: var(--muted); white-space: nowrap; }
.tb-btn { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: #3c434d;
  cursor: pointer; position: relative; text-decoration: none; flex: none; }
.tb-btn:hover { background: #e9edf4; color: var(--ink); }
.tb-btn .ic { width: 20px; height: 20px; }
.chuong .dot { position: absolute; top: 4px; right: 3px; min-width: 18px; padding: 0 4px; border-radius: 9px; background: var(--do); color: #fff; font-size: 10.5px;
  line-height: 15px; text-align: center; font-weight: 700; border: 2px solid #fff; }
.me { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
#me-name { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 12px; text-decoration: none; color: var(--ink); }
#me-name:hover { background: #e9edf4; }
#me-name .who { display: flex; flex-direction: column; line-height: 1.25; }
#me-name .who b { font-size: 13.5px; }
#me-name .who small { font-size: 11.5px; color: var(--muted); font-weight: 400; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.tb-tao { position: relative; }
.top-btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }

/* ---------- khung trang ---------- */
.app { max-width: 1560px; margin: 0 auto; padding: 24px 28px 120px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; line-height: 1.25; color: var(--ink); font-weight: 600; }
.page-head .sub { color: var(--muted); }
.page-head .act, .page-head > .actions { margin-left: auto; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--main); }
.mode { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-weight: 600; font-size: 12px; letter-spacing: .02em; }
.mode.new { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
.mode.edit { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 14px; font-size: 15.5px; line-height: 1.35; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 > .ic, .card h2 .h-ic { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--main-soft); color: var(--main); }
.card h2 small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.card h2 .act { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.card.flat { box-shadow: none; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.grid .w2 { grid-column: span 2; } .grid .w3 { grid-column: span 3; } .grid .w4 { grid-column: 1 / -1; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.f input, .f select, .f textarea, .inp, .filters input, .filters select {
  width: 100%; padding: 8px 12px; border: 1px solid #d1d8e2; border-radius: var(--radius-sm); background-color: #fff; min-height: 40px; transition: border-color .12s, box-shadow .12s; }
.f textarea { resize: vertical; line-height: 1.55; }
.f input:hover, .f select:hover, .f textarea:hover, .inp:hover { border-color: #bcc5d2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(0, 51, 153, .16); }
.f input[readonly], .f textarea[readonly], .f select:disabled { background: #f4f6fa; color: var(--muted); }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23786d64' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px !important; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input, input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--main); }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .b { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note { display: block; padding: 10px 14px; border-radius: 11px; background: var(--main-50); border: 1px solid var(--main-line); margin: 8px 0; color: #1a3363; }
.note.warn { background: var(--warn-soft); border-color: var(--warn-line); color: #7a3b06; }
.note.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.note.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }

/* ---------- nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; min-height: 40px; border: 1px solid #cfd6e2; border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 2px rgba(21, 24, 29, .05);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; }
.btn:hover { background: #f4f7fc; border-color: #bec7d4; }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 17px; height: 17px; }
.btn.primary { background: linear-gradient(180deg, #0743b5 0%, #003399 100%); border-color: #022775; color: #fff; box-shadow: 0 1px 2px rgba(0, 38, 115, .35), inset 0 1px 0 rgba(255, 255, 255, .16); }
.btn.primary:hover { background: linear-gradient(180deg, #003399 0%, #002472 100%); }
.btn.sun { background: linear-gradient(180deg, #fbcf4a, #f5b82e); border-color: #e8a91c; color: #3d2a00; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--main); box-shadow: none; }
.btn.ghost:hover { background: var(--main-soft); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 4px 11px; min-height: 32px; font-size: 13px; border-radius: 9px; }
.btn.big { padding: 12px 20px; min-height: 50px; font-size: 16px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions.sticky { position: sticky; bottom: 0; z-index: 15; background: rgba(240, 242, 246, .9); backdrop-filter: blur(8px); padding: 12px 0; border-top: 1px solid var(--line); }
.link { background: none; border: 0; padding: 2px 4px; color: var(--main); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; border: 0; background: transparent; cursor: pointer; padding: 4px 7px;
  border-radius: 8px; color: var(--muted); font-size: 15px; line-height: 1; vertical-align: middle; }
.icon-btn:hover { background: var(--line-soft); color: var(--ink); }

/* ---------- huy hiệu, nhãn trạng thái ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6;
  background: var(--grey-soft); color: var(--grey); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex: none; }
.badge.khach-hoi { background: #ecf0f5; color: #485261; } .badge.bao-gia { background: var(--blue-soft); color: #1d4ed8; }
.badge.chot { background: var(--ok-soft); color: var(--ok); } .badge.chuan-bi { background: var(--purple-soft); color: #6d28d9; }
.badge.thi-cong { background: #fff1e4; color: #b4480f; } .badge.thanh-toan { background: #fdf0fa; color: #a3277c; }
.badge.ban-giao { background: var(--teal-soft); color: var(--teal); } .badge.bao-hanh { background: #eef6e6; color: #3f6212; }
.badge.khao-sat { background: var(--purple-soft); color: #6d28d9; } .badge.shop { background: #fdf0fa; color: #a3277c; }
.badge.chua-co { background: var(--grey-soft); color: var(--grey); } .badge.dang-lap { background: var(--blue-soft); color: #1d4ed8; }
.badge.trinh-duyet { background: #fff4df; color: #a15c00; } .badge.da-duyet { background: var(--ok-soft); color: var(--ok); }
.badge.tra-lai { background: var(--bad-soft); color: var(--bad); }
.badge.tam-dung, .badge.truot { background: var(--grey-soft); color: var(--grey); } .badge.xong { background: var(--ok-soft); color: var(--ok); }
.badge.nhap { background: var(--grey-soft); color: #475467; } .badge.da-gui { background: var(--blue-soft); color: #1d4ed8; } .badge.moi { background: var(--bad-soft); color: var(--bad); }
.badge.dang-xu-ly { background: var(--warn-soft); color: var(--warn); } .badge.da-thu { background: var(--ok-soft); color: var(--ok); }
.badge.phat-sinh { background: var(--sun-soft); color: #7a4a00; }
.badge.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: #ecf0f5; color: #485261; white-space: nowrap; }
.tag.blue { background: var(--blue-soft); color: #1d4ed8; } .tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.purple { background: var(--purple-soft); color: #6d28d9; } .tag.cam { background: var(--main-soft); color: var(--main-dark); }

/* ---------- ảnh đại diện ---------- */
.av { --h: 24; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-style: normal;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: #fff; text-transform: uppercase; user-select: none;
  background: linear-gradient(135deg, hsl(var(--h) 72% 60%), hsl(calc(var(--h) + 18) 64% 44%)); box-shadow: 0 0 0 2px #fff; }
.av.xs { width: 20px; height: 20px; font-size: 8.5px; box-shadow: 0 0 0 1.5px #fff; } .av.sm { width: 24px; height: 24px; font-size: 9.5px; }
.av.md { width: 36px; height: 36px; font-size: 13px; } .av.lg { width: 44px; height: 44px; font-size: 15px; } .av.xl { width: 64px; height: 64px; font-size: 21px; box-shadow: 0 0 0 3px #fff; }
.av.tho, .av.to-doi { border-radius: 30%; }
.sb .av { box-shadow: 0 0 0 2px #04226a; }
.avs { display: inline-flex; align-items: center; }
.avs .av + .av { margin-left: -8px; }
.avs .av.them { background: #e2e7ef; color: var(--muted); }
.nguoi { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.nguoi > span { min-width: 0; line-height: 1.3; }
.nguoi .n { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.nguoi .r { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* ---------- bảng danh sách ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list thead th { background: #f6f8fc; color: var(--muted); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.list tbody th { text-align: left; font-weight: 600; color: var(--ink); }
table.list tr[data-href] { cursor: pointer; }
table.list tbody tr { transition: background .1s; }
table.list tbody tr:hover td { background: var(--hover); }
table.list td.num, table.list th.num { text-align: right; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type=search], .filters input.tim { max-width: 320px; padding-left: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a69d95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 11px center / 16px; }
.filters select { max-width: 220px; width: auto; }
/* ô lọc trong hàng lọc (flex): được co hẹp hơn chữ dài nhất của ô chọn – tên công trình dài không làm trang tràn ngang trên điện thoại */
.filters select, .filters input { min-width: 0; text-overflow: ellipsis; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; background: none; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; cursor: pointer; font-weight: 600; margin-bottom: -1px; border-radius: 8px 8px 0 0; transition: color .12s, background .12s; }
.tabs a:hover, .tabs button:hover { color: var(--ink); background: rgba(0, 0, 0, .025); }
.tabs a.on, .tabs button.on { color: var(--main); border-bottom-color: var(--main); }
.tabs .cnt { font-weight: 600; color: var(--muted); font-size: 11.5px; background: #e7ebf2; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.tabs .on .cnt { background: var(--main-soft); color: var(--main); }
/* điện thoại: mọi hàng thẻ (công trình 11 thẻ, việc, vật tư…) cuộn ngang 1 hàng, không xuống dòng; mép mờ báo còn thẻ (app-core.js gắn .mep-t / .mep-p) */
@media (max-width: 720px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a, .tabs button { flex: none; white-space: nowrap; scroll-snap-align: start; margin-bottom: 0; padding: 10px 12px; }
}
.mep-p { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.mep-t { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px); mask-image: linear-gradient(90deg, transparent, #000 40px); }
.mep-t.mep-p { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #e4e8ef; border-radius: 11px; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-weight: 600;
  font-size: 13px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.seg a.on, .seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(21, 24, 29, .12); }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); }
.empty::before { content: ""; display: block; width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 14px; background: #ebeff6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3a79c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") no-repeat center / 24px; }
td.empty::before, .empty.nho::before { display: none; }
td.empty { padding: 22px 12px; }
.trong { text-align: center; padding: 36px 18px; color: var(--muted); }
.trong .ic-to { width: 58px; height: 58px; border-radius: 18px; background: var(--main-soft); color: var(--main); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.trong .ic-to .ic { width: 28px; height: 28px; }
.trong > b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }

/* ---------- ô số liệu, biểu đồ ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { position: relative; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
  display: block; overflow: hidden; transition: box-shadow .15s, transform .15s; }
a.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi .k { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; padding-right: 46px; min-height: 22px; }
.kpi .v { font-size: 26px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 6px; letter-spacing: -.01em; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi .ki { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--main-soft); color: var(--main); }
.kpi .ki .ic { width: 20px; height: 20px; }
.kpi.sun .ki { background: var(--sun-soft); color: #b77900; } .kpi.blue .ki { background: var(--blue-soft); color: var(--blue); }
.kpi.warnk .ki { background: var(--bad-soft); color: var(--bad); } .kpi.okk .ki { background: var(--ok-soft); color: var(--ok); } .kpi.purple .ki { background: var(--purple-soft); color: var(--purple); }
.kpi .bar { margin-top: 10px; }
.pipe { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.pipe a { --m: var(--deco); position: relative; display: grid; grid-template-areas: "step" "n" "l"; align-content: start; padding: 12px 12px 14px; border-radius: 12px; background: #f6f8fc;
  text-decoration: none; color: var(--ink); text-align: left; border: 1px solid var(--line-soft); transition: border-color .12s, box-shadow .12s, transform .12s, background .12s; overflow: hidden; }
.pipe a:hover { border-color: var(--main-line); box-shadow: var(--shadow-md); transform: translateY(-1px); background: #fff; }
.pipe a .n { grid-area: n; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.pipe a:not(.co) .n { color: var(--faint); font-weight: 500; }
.pipe a .l { grid-area: l; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.pipe a .step { grid-area: step; display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pipe a .step .gd-dot { --m: inherit; }
.pipe a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--m); opacity: .25; }
.pipe a.co::after { opacity: 1; }
.bar { display: block; height: 7px; border-radius: 4px; background: #e4e9f1; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #3f75dd, #003399); border-radius: 4px; }
.bar.lg { height: 10px; } .bar.ok > i { background: linear-gradient(90deg, #4ade80, #16a34a); } .bar.blue > i { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.donut { position: relative; flex: none; }
.donut svg { display: block; transform: rotate(-90deg); }
.donut .giua { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15; }
.donut .giua b { font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }
.donut .giua span { font-size: 11.5px; color: var(--muted); }
.chu-giai { display: grid; gap: 6px; font-size: 13px; }
.chu-giai div { display: flex; align-items: center; gap: 8px; }
.chu-giai i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chu-giai b { margin-left: auto; font-variant-numeric: tabular-nums; }
.cot-bd { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 6px 2px 0; border-bottom: 1px solid var(--line); }
.cot-bd .c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; gap: 4px; }
.cot-bd .c i { display: block; width: min(38px, 70%); border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #3f75dd, #003399); min-height: 2px; }
.cot-bd .c i.phu { background: linear-gradient(180deg, #dae5f9, #b9cff6); }
.cot-bd .c em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cot-nhan { display: flex; gap: 10px; padding: 6px 2px 0; }
.cot-nhan span { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- công trình: bảng kanban ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #e8ecf1; border-radius: var(--radius); padding: 10px; min-height: 140px; }
.col h3 { margin: 2px 4px 10px; font-size: 13px; display: flex; align-items: center; gap: 8px; color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.col h3 > span:last-child, .col h3 .cnt { margin-left: auto; background: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.pcard { display: block; background: #fff; border-radius: 12px; padding: 11px 12px; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(21, 24, 29, .08); text-decoration: none; color: inherit;
  border: 1px solid transparent; border-left: 3px solid var(--brand); transition: box-shadow .15s, transform .15s, border-color .15s; }
.pcard:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--main-line); }
.pcard .t { font-weight: 600; line-height: 1.38; color: var(--ink); }
.pcard .m { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.pcard.tam-dung, .pcard.truot { opacity: .65; border-left-color: #98a2b3; }

/* ---------- chi tiết công trình ---------- */
.stepper { display: flex; gap: 0; margin: 4px 0 16px; overflow-x: auto; overflow-y: hidden; padding: 2px; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.stepper::-webkit-scrollbar { display: none; }
/* mỗi bước rộng theo chữ (không cắt "1. Tiếp nhậ…"), dư chỗ thì giãn đều; thiếu chỗ thì cả thanh cuộn ngang, bước hiện tại tự cuộn vào giữa (app-core.js) */
.stepper button { flex: 1 0 auto; border: 0; background: #e4e8ef; color: var(--muted); padding: 9px 14px 9px 22px; font-weight: 600; font-size: 12.5px; cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); margin-right: -6px; white-space: nowrap; scroll-snap-align: start; transition: background .12s; }
.stepper button:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; border-radius: 10px 0 0 10px; }
.stepper button:last-child { margin-right: 0; }
.stepper button:hover:not(:disabled):not(.on) { background: #d8dee7; }
.stepper button.done { background: #dae7fe; color: var(--main-dark); }
.stepper button.on { background: var(--grad-cam); color: #fff; }
.stepper button:disabled { cursor: default; }
.stepper button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand); } /* clip-path cắt mất viền ngoài: viền trong */
.tabs a:focus-visible, .tabs button:focus-visible, .dd-tabs button:focus-visible { outline-offset: -2px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 4px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px;
  cursor: pointer; user-select: none; transition: background .12s, border-color .12s; }
.chip:hover { border-color: #c4cddb; }
.chip .av { box-shadow: none; }
.chip.on { background: var(--main-soft); border-color: var(--brand); color: var(--main-dark); font-weight: 600; }
.chip.on::after { content: ""; width: 14px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c2521f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat center / contain; }
.chip.them { border-style: dashed; border-color: var(--brand); color: var(--brand); background: transparent; font-weight: 600; padding-left: 11px; }
.phase { border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #f8fbfe; }
.phase .ph-top { display: grid; grid-template-columns: 1fr 140px 140px 110px auto; gap: 8px; align-items: end; }
.log { max-height: 360px; overflow: auto; }
.log div { padding: 7px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.log time { color: var(--muted); margin-right: 6px; font-size: 12px; }

/* ---------- báo cáo (dòng thời gian kiểu bảng tin) ---------- */
.rp { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; background: #fff; box-shadow: var(--shadow); }
.rp .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rp .head .who { font-weight: 600; color: var(--ink); }
.rp .head .when { color: var(--muted); font-size: 12.5px; }
.rp .head .ct { color: var(--main); font-size: 13px; text-decoration: none; }
.rp .head .ct:hover { text-decoration: underline; }
.rp .content { margin: 8px 0; white-space: pre-line; }
.rp .warn { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 9px; padding: 6px 10px; margin: 6px 0; font-size: 13.5px; }
.rp .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--line-soft); margin-top: 8px; }
.rp .cmt { font-size: 13px; padding: 6px 10px; background: #f3f6fa; border-radius: 9px; margin-top: 6px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumbs a, .thumbs .up { position: relative; display: block; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: #e3e9f2; border: 1px solid var(--line-soft); }
.thumbs a img { transition: transform .25s; }
.thumbs a:hover img { transform: scale(1.05); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .x { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .6); color: #fff; border: 0; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; line-height: 22px; }
.thumbs .up { display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); text-align: center; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.file { display: flex; gap: 10px; align-items: center; padding: 9px; border: 1px solid var(--line-soft); border-radius: 12px; background: #fff; text-decoration: none; color: inherit; font-size: 13px;
  transition: border-color .12s, box-shadow .12s; }
.file:hover { border-color: var(--main-line); box-shadow: var(--shadow); }
.file .ext { flex: none; width: 42px; height: 42px; border-radius: 10px; background: var(--main-soft); color: var(--main-dark); font-weight: 700; font-size: 10.5px; display: flex; align-items: center;
  justify-content: center; text-transform: uppercase; overflow: hidden; }
.file .ext img { width: 100%; height: 100%; object-fit: cover; }
.file .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }

/* ---------- hộp thoại, thông báo nổi, bảng thả xuống, ô tìm kiếm nhanh ---------- */
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 120; max-width: min(460px, calc(100vw - 32px)); padding: 12px 16px 12px 14px; border-radius: 13px; display: flex; gap: 10px; align-items: flex-start;
  background: #1b1f24; color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; animation: hienLen .18s ease; }
.toast::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.toast.ok { background: #0f6b3f; } .toast.bad { background: #a5281c; } .toast.warn { background: #8a4a07; }
.toast.ok::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
@keyframes hienLen { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes moVao { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(21, 24, 29, .48); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 7vh 14px; overflow: auto; }
.modal { width: min(640px, 100%); margin: 0; border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow-lg); animation: moVao .16s ease; border: 0; }
.modal.wide { width: min(1000px, 100%); }
.modal > h2 { font-size: 18px; margin-bottom: 14px; }
.modal > h2::before { display: none; }
.modal-body { max-height: 70vh; overflow: auto; }
.modal > .actions { justify-content: flex-end; padding-top: 14px; margin-top: 14px !important; border-top: 1px solid var(--line-soft); }
.dd { position: absolute; z-index: 70; top: calc(100% + 8px); right: 0; min-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-lg); padding: 6px;
  animation: moVao .14s ease; }
.dd a, .dd button.mi { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border-radius: 10px; color: var(--text); text-decoration: none; border: 0; background: none; cursor: pointer; text-align: left; font-weight: 500; }
.dd a:hover, .dd button.mi:hover, .dd a.sel { background: #eef2f8; }
.dd .mi-ic { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--main-soft); color: var(--main); flex: none; }
.dd .mi-ic.blue { background: var(--blue-soft); color: var(--blue); } .dd .mi-ic.ok { background: var(--ok-soft); color: var(--ok); } .dd .mi-ic.purple { background: var(--purple-soft); color: var(--purple); }
.dd .mi-ic.sun { background: var(--sun-soft); color: #b77900; } .dd .mi-ic.teal { background: var(--teal-soft); color: var(--teal); } .dd .mi-ic.grey { background: var(--grey-soft); color: var(--grey); }
.dd .mi-t { display: block; font-weight: 600; color: var(--ink); line-height: 1.3; } .dd .mi-s { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }
/* bảng thông báo (chuông) kiểu "Nhắc việc" của Base: thẻ Tất cả / Chưa đọc / Việc / Đề xuất có số, chia theo ngày */
.dd-tb { width: min(420px, calc(100vw - 20px)); padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: min(640px, calc(100vh - 86px)); }
.dd-tb .dd-h { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 16px; }
.dd-tb .dd-h b { font-size: 16px; color: var(--ink); }
.dd-tb .dd-h button { margin-left: auto; }
.dd-tabs { display: flex; gap: 4px; padding: 0 12px 10px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none; flex: none; }
.dd-tabs::-webkit-scrollbar { display: none; }
.dd-tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted);
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; flex: none; transition: background .12s, border-color .12s, color .12s; }
.dd-tabs button:hover { border-color: #c4cddb; color: var(--ink); }
.dd-tabs button .n { min-width: 19px; padding: 0 5px; border-radius: 999px; background: #e7ebf2; color: var(--muted); font-size: 11px; line-height: 19px; text-align: center; font-variant-numeric: tabular-nums; }
.dd-tabs button.co-moi .n { background: var(--do); color: #fff; }
.dd-tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.dd-tabs button.on .n { background: rgba(255, 255, 255, .2); color: #fff; }
.dd-tb .dd-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 6px 6px; overscroll-behavior: contain; }
.dd-tb .dd-ngay { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 10px 10px 4px; }
.dd-tb .dd-list .trong { padding: 28px 16px; }
.dd-tb .dd-f { display: block; flex: none; text-align: center; padding: 12px; border-top: 1px solid var(--line-soft); font-weight: 600; text-decoration: none; }
.dd-tb .dd-f:hover { background: var(--main-50); }
.tbi { display: flex !important; gap: 11px; align-items: flex-start !important; padding: 10px 26px 10px 10px !important; position: relative; }
.tbi .tbi-ic { position: relative; flex: none; }
.tbi .tbi-ic .loai { position: absolute; right: -4px; bottom: -4px; width: 19px; height: 19px; border-radius: 50%; background: var(--main); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.tbi .tbi-ic .loai .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.tbi > span:last-child { min-width: 0; }
.tbi .tbi-t { font-size: 13px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tbi .tbi-w { display: block; font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.tbi.moi { background: #f5f9ff; }
.tbi.moi .tbi-t { color: var(--ink); font-weight: 500; }
.tbi.moi::after { content: ""; position: absolute; right: 10px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.cmdk-bg { position: fixed; inset: 0; z-index: 110; background: rgba(21, 24, 29, .45); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 11vh 14px 14px; }
.cmdk { width: min(640px, 100%); background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: moVao .14s ease; display: flex; flex-direction: column; max-height: 74vh; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.cmdk-in .ic { color: var(--muted); width: 20px; height: 20px; }
.cmdk-in input { flex: 1; border: 0 !important; outline: 0; font-size: 16px; padding: 4px 0; box-shadow: none !important; background: transparent; }
.cmdk-ds { overflow: auto; padding: 8px; }
.cmdk-ds .nhom { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 10px 10px 4px; }
.cmdk-ds a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.cmdk-ds a.sel, .cmdk-ds a:hover { background: #eef2f8; }
.cmdk-ds a .mi-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #ebeff6; color: #5b6470; flex: none; }
.cmdk-ds a.sel .mi-ic { background: var(--main-soft); color: var(--main); }
.cmdk-ds a .mi-t { font-weight: 600; color: var(--ink); } .cmdk-ds a .mi-s { font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.cmdk-chan { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); background: #f8fafe; }
.dang-tai { display: grid; gap: 14px; }
.dang-tai > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sk { border-radius: 12px; background: linear-gradient(90deg, #e4e8ef 0%, #f0f3f8 40%, #e4e8ef 80%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- đăng nhập ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); }
.login-hero { position: relative; overflow: hidden; color: #eef3fd; padding: 48px 56px; display: flex; flex-direction: column;
  background: radial-gradient(80% 60% at 0% 0%, rgba(92, 150, 255, .34), transparent 60%), radial-gradient(70% 50% at 100% 100%, rgba(120, 170, 255, .14), transparent 60%), linear-gradient(160deg, #033ba6, #052675 55%, #041647); }
.login-hero::after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .05); }
.login-hero .lh-logo { height: 92px; width: auto; align-self: flex-start; }
.login-hero h1 { font-size: 34px; line-height: 1.2; margin: auto 0 12px; color: #fff; max-width: 520px; letter-spacing: -.02em; }
.login-hero h1 em { font-style: normal; background: linear-gradient(90deg, #b9d2ff, #ffffff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { color: #c9d5ef; max-width: 500px; margin: 0 0 26px; font-size: 15px; }
.login-hero ul { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 12px; max-width: 520px; position: relative; z-index: 1; }
.login-hero li { display: flex; gap: 12px; align-items: center; color: #e4ebfa; }
.login-hero li .ic { width: 36px; height: 36px; padding: 8px; border-radius: 11px; background: rgba(255, 255, 255, .10); color: #b9d2ff; }
.login-hero .lh-chan { margin-top: 30px; font-size: 12.5px; color: #a9badf; position: relative; z-index: 1; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 36px 28px; background: #f8f9fc; }
.login { width: min(470px, 100%); margin: 0; padding: 0; overflow: hidden; border: 0; box-shadow: none; background: transparent; }
.login-head { padding: 0 0 18px; }
.login-head img { display: none; }
.login-head h2 { font-size: 24px; margin: 0; color: var(--ink); }
.login-head div { color: var(--muted); margin-top: 4px; }
.login-body { padding: 0; display: grid; gap: 14px; }
.login-body form { display: grid; gap: 12px; }
.login-body .btn.big { width: 100%; }
.demo-users { display: grid; gap: 8px; margin-top: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.demo-users > b { font-size: 13.5px; color: var(--ink); }
.demo-users .grp { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin-top: 6px; }
.demo-users .btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.demo-users .btns .btn { justify-content: flex-start; gap: 9px; padding: 6px 10px 6px 6px; min-height: 44px; text-align: left; font-weight: 600; border-color: var(--line-soft); box-shadow: none; }
.demo-users .btns .btn:hover { border-color: var(--main-line); background: var(--main-50); }
.demo-users .btns .btn > span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.demo-users .btns .btn small { font-weight: 400; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-users .nv-that { margin-top: 8px; border-top: 1px solid var(--line-soft); padding-top: 8px; display: grid; gap: 8px; }
.demo-users .nv-that > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--main-ink, var(--ink)); padding: 4px 0; }
.demo-users .btns .btn .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details summary { cursor: pointer; color: var(--main); font-weight: 600; }

/* ---------- trợ lý AI ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; }
.chat .msgs { flex: 1; overflow: auto; padding: 6px 2px; }
.msg { max-width: 82%; padding: 11px 15px; border-radius: 16px; margin: 8px 0; white-space: pre-wrap; line-height: 1.6; }
.msg.user { margin-left: auto; background: var(--grad-cam); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { background: #fff; border: 1px solid var(--line-soft); border-bottom-left-radius: 5px; box-shadow: var(--shadow); }
.msg.bot .used { display: block; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.msg.wait { color: var(--muted); font-style: italic; }
.chat form { display: flex; gap: 8px; padding-top: 10px; }
.chat textarea { flex: 1; min-height: 48px; max-height: 160px; padding: 12px 14px; border-radius: 14px; border: 1px solid #d1d8e2; resize: none; }
.sugg { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.sugg button { border: 1px solid var(--main-line); background: var(--main-soft); color: var(--main-dark); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 13px; font-weight: 600; }

/* ---------- thanh dưới (điện thoại) ---------- */
.bottom-nav { display: none; }
.bottom-nav a { position: relative; }

/* ---------- màn hình vừa, điện thoại ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cols3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tb-search { width: min(340px, 34vw); }
  #me-name .who { display: none; }
}
@media (max-width: 960px) {
  body.in-app, body.in-app.sb-gon { padding-left: 0; --sbw: 272px; }
  .sb { transform: translateX(-102%); box-shadow: var(--shadow-lg); }
  body.sb-mo .sb { transform: none; }
  body.sb-gon .sb-brand .sb-ten, body.sb-gon .sb-cty, body.sb-gon .sb-nav a .l, body.sb-gon .sb-user > span:last-child { display: initial; }
  body.sb-gon .sb-brand .sb-mark { height: 32px; }
  body.sb-gon .sb-ct, body.sb-gon .sb-ver { display: block; }
  body.sb-gon .sb-grp { font-size: 10.5px; padding: 16px 10px 6px; } body.sb-gon .sb-grp::after { display: none; }
  body.sb-gon .sb-nav a { justify-content: flex-start; padding: 8px 10px; } body.sb-gon .sb-nav a.sb-sub { padding: 5px 10px 5px 33px; }
  body.sb-gon .sb-nav a .dot { position: static; min-width: 21px; line-height: 21px; font-size: 11.5px; padding: 0 6px; }
  body.sb-gon .sb-top { flex-direction: row; justify-content: space-between; height: var(--tbh); padding: 0 10px 0 20px; }
  body.sb-gon .sb-user { justify-content: flex-start; }
  .sb-thu { display: none; }
  .top { padding: 0 10px 0 6px; gap: 4px; }
  .top .tb-menu, .top .tb-brand { display: inline-flex; }
  .tb-search { width: 40px; height: 40px; padding: 0; justify-content: center; border: 0; background: transparent; color: #3c434d; }
  .tb-search span, .tb-search kbd { display: none; }
  .tb-search .ic { width: 20px; height: 20px; }
  .tb-tao .btn .l { display: none; }
  .tb-tao .btn { padding: 0; width: 38px; min-height: 38px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .w3, .grid .w4 { grid-column: 1 / -1; }
  .cols2, .cols3 { grid-template-columns: minmax(0, 1fr); }
  .phase .ph-top { grid-template-columns: 1fr 1fr; }
  .phase .ph-top .w-name { grid-column: 1 / -1; }
  .app { padding: 16px 12px 120px; }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-hero { padding: 26px 22px 24px; }
  .login-hero .lh-logo { height: 64px; }
  .login-hero h1 { font-size: 23px; margin: 22px 0 8px; }
  .login-hero p, .login-hero ul, .login-hero .lh-chan { display: none; }
  .login-side { padding: 20px 14px 40px; align-items: flex-start; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; } .kpi .v { font-size: 21px; } .kpi .ki { width: 34px; height: 34px; right: 12px; top: 12px; border-radius: 10px; }
  /* 8 bước: 2 cột, mỗi bước 1 hàng gọn (số bên trái, tên bước bên phải) */
  .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .pipe a { grid-template-areas: "n step" "n l"; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 8px 10px 10px; border-radius: 11px; }
  .pipe a .n { font-size: 20px; min-width: 22px; text-align: center; margin: 0; }
  .pipe a .step { font-size: 9.5px; }
  .pipe a .l { font-size: 12px; line-height: 1.25; }
  .card h2 .act.an-dt { display: none; }
  .tq .card > h2 > .act { flex: none !important; }
  .grid { grid-template-columns: 1fr; }
  .grid .w2 { grid-column: 1 / -1; }
  .page-head h1 { font-size: 20px; }
  .card { padding: 15px 14px; border-radius: 13px; }
  .msg { max-width: 92%; }
  .toast { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: none; }
  .tb-brand img { height: 24px; }
  .demo-users .btns { grid-template-columns: minmax(0, 1fr); }
  body.in-app .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); }
  body.in-app .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 7px; font-size: 11px; color: var(--muted); text-decoration: none; border-radius: 12px; font-weight: 600; }
  body.in-app .bottom-nav a .ic { width: 22px; height: 22px; }
  body.in-app .bottom-nav a.on { color: var(--main); }
  body.in-app .bottom-nav a.on .ic { background: var(--main-soft); border-radius: 10px; padding: 2px 10px; width: 44px; box-sizing: content-box; height: 22px; margin: -2px 0; }
  .bottom-nav a .dot { position: absolute; top: 2px; left: calc(50% + 7px); min-width: 17px; padding: 0 4px; border-radius: 9px; background: var(--do); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; font-weight: 700; }
  table.list.cards thead { display: none; }
  table.list.cards tr { display: block; border-bottom: 1px solid var(--line-soft); padding: 10px 4px; }
  table.list.cards td { display: block; border: 0; padding: 2px 8px; }
  table.list.cards td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
  .actions.sticky .btn { flex: 1; }
  .me #me-name { padding: 2px; }
}
@media print { .top, .sb, .actions, .bottom-nav, .demo-bar, .sb-che { display: none !important; } body.in-app { padding-left: 0; } .app { padding: 0; } }

/* ---------- bảng chào giá ---------- */
.boq-wrap { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.boq { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1180px; font-size: 13px; }
table.boq th { position: sticky; top: 0; z-index: 2; background: #ecf3ff; color: var(--ink); font-weight: 600; padding: 6px 5px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); text-align: center; white-space: nowrap; }
table.boq td { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); padding: 2px 3px; vertical-align: top; }
table.boq input, table.boq textarea, table.boq select { width: 100%; border: 1px solid transparent; border-radius: 5px; padding: 4px 5px; background: transparent; min-height: 28px; font-size: 13px; }
table.boq textarea { resize: vertical; min-height: 28px; line-height: 1.35; overflow: hidden; }
table.boq input:hover, table.boq textarea:hover { border-color: var(--line); }
table.boq input:focus, table.boq textarea:focus, table.boq select:focus { border-color: var(--brand); background: #fff; outline: none; }
table.boq .n { text-align: right; font-variant-numeric: tabular-nums; }
table.boq td.calc { text-align: right; padding: 6px 6px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; background: #f9fbff; }
table.boq tr.muc td { background: #f4f9ff; }
table.boq tr.muc.lv0 td { background: #e2ecff; }
table.boq tr.muc input { font-weight: 600; }
table.boq tr.muc.lv0 input { text-transform: uppercase; }
table.boq td.stt { width: 56px; } table.boq td.stt input { text-align: center; }
table.boq td.tools { white-space: nowrap; width: 1%; }
table.boq tr.lech td { box-shadow: inset 3px 0 0 var(--sun); }
table.boq tr.goi-y td { background: #fffbea; }
table.boq tr.goi-y td.stt { box-shadow: inset 3px 0 0 #2fa36b; }
.goi-y-tag { display: inline-block; font-size: 11px; color: #067647; background: #e8f7ee; border-radius: 6px; padding: 0 5px; margin-top: 2px; }
.boq-tot { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 10px; }
.boq-tot div { background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; }
.boq-tot .k { font-size: 12.5px; color: var(--muted); }
.boq-tot .v { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.boq-tot .grand { background: var(--main-soft); border-color: var(--main-line); }
.words { font-style: italic; color: var(--muted); margin-top: 6px; }


/* Dòng vật tư (đề xuất của đội, phiếu nhập / xuất) trên điện thoại: mỗi dòng 1 thẻ, tên vật tư cả chiều ngang */
@media (max-width: 640px) {
  table.dong-vt, table.dong-vt tbody, table.dong-vt tfoot { display: block; }
  table.dong-vt thead { display: none; }
  table.dong-vt tbody tr { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: end; }
  table.dong-vt td { display: block; padding: 0 !important; border: 0 !important; text-align: left; white-space: normal; }
  table.dong-vt td[data-lb]::before { content: attr(data-lb); display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
  table.dong-vt td.c-so { display: none; }
  table.dong-vt td.c-ten, table.dong-vt td.empty { grid-column: 1 / -1; }
  table.dong-vt td.c-ten::before { font-weight: 600; color: var(--ink, #111826); }
  table.dong-vt td.c-dvt, table.dong-vt td.c-gia { grid-column: 1 / 2; }
  table.dong-vt td.c-sl, table.dong-vt td.c-tt { grid-column: 2 / 4; }
  table.dong-vt td.c-gc { grid-column: 1 / 3; }
  table.dong-vt td.c-x { grid-column: 3 / 4; text-align: center; }
  table.dong-vt td.c-x .icon-btn { width: 40px; height: 42px; }
  table.dong-vt tfoot tr { display: flex; justify-content: space-between; padding: 12px 4px; }
  table.dong-vt tfoot td:empty { display: none; }
}

/* ---------- hồ sơ công trình (pháp lý, vật liệu đầu vào, biện pháp, hiện trường, thanh toán, bàn giao, bảo hành) ---------- */
.hs-group { border: 1px solid var(--line-soft); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.hs-group > .hs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; background: #f6f9fd; border-bottom: 1px solid var(--line-soft); }
.hs-group > .hs-head h3 { margin: 0; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.hs-group > .hs-head h3::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(#5283e0, #003399); }
.hs-group > .hs-head .cnt { color: var(--muted); font-size: 12.5px; }
.hs-group > .hs-head .bar { flex: 0 0 140px; margin-top: 0; }
.hs-group > .hs-head .act { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.hs-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 128px minmax(0, 1.2fr) 116px; gap: 6px 12px; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.hs-row:last-child { border-bottom: 0; }
.hs-row.head { font-size: 12.5px; color: var(--muted); background: #f9fbff; padding-top: 6px; padding-bottom: 6px; }
.hs-row[data-href], .hs-row.click { cursor: pointer; }
.hs-row[data-href]:hover, .hs-row.click:hover { background: #f6faff; }
.hs-row .t { font-weight: 600; line-height: 1.35; }
.hs-row .m { font-size: 12.5px; color: var(--muted); }
.hs-row .tools { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.hs-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #b9c1cf; margin-right: 6px; vertical-align: middle; }
.hs-dot.da-duyet { background: #2fa36b; } .hs-dot.trinh-duyet { background: #e3a008; } .hs-dot.tra-lai { background: var(--bad); } .hs-dot.dang-lap { background: #3b82c4; }
.qua-han { color: var(--bad); font-weight: 600; }
.sap-han { color: var(--warn); font-weight: 600; }
.hs-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.hs-sum > div { background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; }
.hs-sum .k { font-size: 12.5px; color: var(--muted); } .hs-sum .v { font-size: 18px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.hs-check { display: grid; gap: 4px; }
.hs-check label { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 8px; background: #f9fbff; }
.hs-check .kq { display: inline-flex; gap: 4px; }
.hs-check .kq button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.hs-check .kq button.dat.on { background: var(--ok-soft); border-color: #abefc6; color: var(--ok); }
.hs-check .kq button.khong.on { background: var(--bad-soft); border-color: #f8c7c3; color: var(--bad); }
.song-ngu { font-style: italic; color: var(--muted); font-size: 12px; }

/* ---------- trang theo dõi cho chủ nhà (không cần đăng nhập, chỉ xem) ---------- */
body.portal-body { background: var(--bg); }
.portal { max-width: 900px; margin: 0 auto; padding: 0 14px 60px; }
.portal-top { background: #fff; border-top: 4px solid var(--dark); box-shadow: 0 2px 8px rgba(10, 25, 60, .07); }
.portal-top::after { content: ""; display: block; height: 3px; background: var(--grad); }
.portal-head { max-width: 900px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.portal-head img { height: 44px; width: auto; display: block; }
.portal-head .t { font-size: 13px; color: var(--ink); border-left: 1px solid var(--line); padding-left: 12px; }
.portal-head .hl { margin-left: auto; font-size: 13px; text-align: right; color: var(--muted); }
.portal-head .hl a { color: var(--main); font-weight: 600; text-decoration: none; }
.portal h1 { font-size: 22px; color: var(--ink); margin: 18px 0 2px; }
.portal .sub { color: var(--muted); margin-bottom: 12px; }
.portal .steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.portal .steps span { padding: 4px 10px; border-radius: 999px; background: #e3e9f2; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.portal .steps span.done { background: #dce9ff; color: var(--main-dark); }
.portal .steps span.on { background: var(--main); color: #fff; }
.portal .day { border-left: 3px solid var(--brand); padding: 4px 0 4px 12px; margin: 12px 0; }
.portal .day .d { font-weight: 600; color: var(--ink); }
.portal .photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.portal .photos a { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #e3e9f2; border: 1px solid var(--line-soft); }
.portal .photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .hs-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hs-row > :nth-child(n+3):not(.tools) { grid-column: 1 / -1; }
  .hs-row.head { display: none; }
  .hs-group > .hs-head .bar { flex-basis: 100px; }
  .portal-head .t { display: none; }
}
@media print { .hs-row .tools, .hs-group > .hs-head .act { display: none !important; } }


/* ---- bản 0.2: việc, đề xuất, chấm công, bảng tin, thông báo, lương (thay các phần Base.vn hay dùng) */
.hs-row.viec-row { grid-template-columns: 34px minmax(0, 1fr) 150px 100px; }
.tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: transparent; cursor: pointer; font-weight: 700; padding: 0; }
.tick:hover:not(:disabled) { border-color: var(--ok); color: var(--ok); }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick:disabled { opacity: .35; cursor: default; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.check-row input { width: 18px; height: 18px; flex: none; }
.check-row > span:first-of-type { flex: 1; }
.gach { text-decoration: line-through; color: var(--muted); }
.x-nho { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 17px; padding: 0 4px; }
.loai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.buoc-duyet { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.timeline .tl { position: relative; margin-left: 12px; padding: 6px 0 10px 22px; border-left: 2px solid var(--line); }
.timeline .tl:last-child { border-left-color: transparent; }
.timeline .tl-n { position: absolute; left: -13px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--line-soft); text-align: center; line-height: 24px; font-size: 12px; font-weight: 700; color: var(--muted); }
.timeline .tl.duyet .tl-n { background: var(--ok); color: #fff; }
.timeline .tl.tu-choi .tl-n { background: var(--bad); color: #fff; }
.timeline .tl.dang .tl-n { background: var(--sun); color: #3d2a00; }
.timeline .box { margin-top: 4px; }
.tb-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 6px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.tb-row:last-child { border-bottom: 0; }
.tb-row.moi { background: var(--sun-soft); }
.tb-row.moi .tb-t { font-weight: 600; }
.tb-t { display: block; line-height: 1.4; }
.tb-ic { font-size: 18px; line-height: 1.3; }
.card.tin.moi { border-left: 4px solid var(--brand); }
.cc-card { border: 2px solid var(--main-line); }
.cc-nut { min-width: 190px; font-size: 20px; padding: 16px 22px; margin-top: 6px; }
.ok-t { color: var(--ok); }
.ky { display: inline-block; min-width: 26px; text-align: center; border-radius: 5px; font-weight: 600; }
.k-x { background: var(--ok-soft); color: var(--ok); } .k-nua { background: #fff4df; color: #9a5b00; } .k-p { background: #e8f1fb; color: #1d5fa8; }
.k-l { background: #f1ecfd; color: #5b3cc4; } .k-ct { background: #e3f6f3; color: #0f766e; } .k-kl { background: #f2f4f7; color: #475467; } .k-v { background: var(--bad-soft); color: var(--bad); }
table.bang-cong { font-size: 12.5px; }
table.bang-cong th, table.bang-cong td.o { padding: 4px 2px; text-align: center; min-width: 26px; }
table.bang-cong th div { font-weight: 400; color: var(--muted); font-size: 11px; }
table.bang-cong td.o { cursor: pointer; font-weight: 600; }
table.bang-cong td.o:hover { outline: 2px solid var(--brand); }
table.bang-cong .cn { background: #f4f8fd; }
table.bang-cong .ten { text-align: left; position: sticky; left: 0; background: #fff; min-width: 150px; z-index: 1; }
.hs-sum > a { display: block; background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; text-decoration: none; color: inherit; }
.hs-sum > a:hover { border-color: var(--main-line); background: #f6faff; }
.phieu-luong tr.b td, .phieu-luong tr.tong td { border-top: 2px solid var(--line); }
.phieu-luong tr.tong td { font-size: 17px; }
@media (max-width: 860px) { .hs-row.viec-row { grid-template-columns: 34px minmax(0, 1fr) auto; } .hs-row.viec-row > :nth-child(3) { grid-column: 2 / 3; } }
@media (max-width: 560px) { .cc-nut { width: 100%; } .cc-ben { flex: 1 1 100%; } }
.bl { background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 11px; margin: 0 0 8px; max-width: 92%; }
.bl.toi { margin-left: auto; background: var(--main-soft); border-color: var(--main-line); }
.bl .h { font-size: 12.5px; color: var(--muted); }
.bl .t { white-space: pre-wrap; line-height: 1.5; margin-top: 2px; }
.cc-ben { text-align: center; }
.k-nn { background: #fdf0fa; color: #a3277c; }
/* điện thoại: không tràn ngang (nhãn dài, ô chọn dài), checklist nghiệm thu gõ được */
.rp .head .badge, .card .badge { white-space: normal; }
#tep-ai-xem { max-width: 100%; }
@media (max-width: 560px) {
  .hs-check label { grid-template-columns: minmax(0, 1fr); }
  .hs-check label > span { flex-wrap: wrap; }
  .hs-check label input[data-ckt] { flex: 1 1 100% !important; min-width: 0; }
  .hs-check label input[data-ckn] { flex: 1 1 100%; width: auto !important; min-width: 0; }
  .card h2 .act { flex: 1 1 100%; margin-left: 0; min-width: 0; }
  #tep-ai-xem { width: 100% !important; min-width: 0; }
  .hs-check .kq { justify-content: flex-start; flex-wrap: wrap; }
  .stepper button { font-size: 12px; padding: 8px 12px 8px 20px; }
  .stepper button:first-child { padding-left: 12px; }
}

/* ---------- trang đăng nhập tràn màn hình; dải chạy thử gọn trên điện thoại; nút lưu không bị thanh dưới che ---------- */
body:not(.in-app) .app { max-width: none; padding: 0; }
.demo-bar .dai { font-weight: 500; }
@media (max-width: 560px) {
  .demo-bar { font-size: 11.5px; padding: 5px 10px; }
  .demo-bar .dai { display: none; }
  body.in-app .actions.sticky { bottom: calc(62px + env(safe-area-inset-bottom)); border-radius: 14px; padding: 10px; border: 1px solid var(--line); box-shadow: var(--shadow-md); background: rgba(255, 255, 255, .96); }
  body.in-app .app { padding-bottom: 150px; }
}

/* ---------- tổng quan (public/app-tong-quan.js) ---------- */
/* lời chào: ngày, chào, các việc hôm nay dạng viên (không dùng dấu "·" – xuống dòng không sót dấu), nút chấm công / tạo nhanh */
.chao { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; margin: 2px 0 18px; padding: 22px 24px; border-radius: 18px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(90% 140% at 100% 0%, rgba(110, 165, 255, .30), transparent 55%), radial-gradient(70% 120% at 0% 100%, rgba(40, 95, 220, .30), transparent 60%), linear-gradient(120deg, #032e84 0%, #05184c 100%);
  box-shadow: var(--shadow-md); }
.chao::after { content: ""; position: absolute; right: -60px; top: -90px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .04); pointer-events: none; }
.chao-t { flex: 1 1 420px; min-width: 0; position: relative; z-index: 1; }
.chao-ngay { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #b9d2ff; font-weight: 600; }
.chao h1 { margin: 4px 0 0; font-size: 26px; line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.chao-hn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.chao-hn > span { color: #cbd1dc; font-size: 13.5px; margin-right: 2px; }
.chao-hn a { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 3px 12px 3px 4px; border-radius: 999px; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14); color: #ecf1f8; text-decoration: none; font-size: 13px; font-weight: 500; transition: background .12s, border-color .12s; }
.chao-hn a:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .26); }
.chao-hn a b { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .17); color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chao-hn a.cam b { background: #c4541f; } .chao-hn a.do b { background: var(--do); }
.chao-nut { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.chao-nut .btn:not(.primary) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.chao-nut .btn:not(.primary):hover { background: rgba(255, 255, 255, .16); }
/* 0.4.2: nút chính trên khung chào xanh đậm – nền trắng chữ xanh logo (nút xanh trên nền xanh không thấy khung nút) */
.chao-nut .btn.primary { background: #fff; border-color: #fff; color: var(--main); box-shadow: 0 1px 3px rgba(0, 0, 0, .22); }
.chao-nut .btn.primary:hover { background: var(--main-soft); border-color: var(--main-soft); }
.chao-nut .l-ngan { display: none; }
.chao-cc { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 13px; border-radius: 10px; background: rgba(27, 175, 122, .18);
  border: 1px solid rgba(27, 175, 122, .32); color: #b9f5d8; font-weight: 600; text-decoration: none; transition: background .12s; }
a.chao-cc:hover { background: rgba(27, 175, 122, .28); }

/* thẻ của tổng quan: tiêu đề luôn 1 dòng (chữ phụ co lại, nút bên phải); bố cục bên trong theo bề rộng thẻ (container query) */
.tq .card { container: tqthe / inline-size; }
.tq .card > h2 { flex-wrap: nowrap; min-width: 0; }
.tq .card > h2 > span:not(.act) { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq .card > h2 > small { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq .card > h2 > .act { flex: none; margin-left: auto; }
/* thẻ hẹp (cột phải, điện thoại): chữ phụ xuống dòng thứ 2 dưới tiêu đề thay vì bị cắt còn "6…" */
@container tqthe (max-width: 420px) {
  .tq .card > h2:has(> small) { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ic t act" "ic s act"; column-gap: 10px; row-gap: 0; align-items: center; }
  .tq .card > h2 > .ic { grid-area: ic; }
  .tq .card > h2 > span:not(.act) { grid-area: t; }
  .tq .card > h2 > small { grid-area: s; line-height: 1.3; }
  .tq .card > h2 > .act { grid-area: act; margin-left: 0; }
  .hd-1 { flex-wrap: wrap; row-gap: 0; }
  .hd-1 > span:first-child { flex-basis: 100%; }
  .hd-1 > .hd-w { order: 5; }
}
/* ô trống trong tổng quan: gọn 1 hàng (biểu tượng trái, chữ phải) thay vì khối to giữa thẻ */
.tq .trong { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; text-align: left; padding: 4px 2px 2px; }
.tq .trong .ic-to { grid-row: 1 / span 3; width: 40px; height: 40px; border-radius: 12px; margin: 0; }
.tq .trong .ic-to .ic { width: 20px; height: 20px; }
.tq .trong > b { grid-column: 2; font-size: 14px; margin: 0; }
.tq .trong > .small { grid-column: 2; line-height: 1.45; }
.tq .trong > div:not(.ic-to):not(.small) { grid-column: 2; justify-self: start; margin-top: 8px !important; }
.tq-chan { display: flex; justify-content: center; margin: 6px 0 -4px; }
.tq-chan a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-decoration: none; padding: 6px 12px; border-radius: 9px; }
.tq-chan a:hover { background: var(--main-soft); }
.tq-nhom { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; margin: 10px 8px 2px; }

/* dòng danh sách dùng chung: ảnh / biểu tượng | 2 dòng chữ (cắt "…") | cột phải (số tiền, thời gian – không bị cắt) */
.ds-dong { display: grid; gap: 2px; }
.dong { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 11px; text-decoration: none; color: inherit; min-width: 0; }
a.dong:hover { background: var(--hover); }
.dong-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.dong-t b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dong-t > span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dong-p { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 12px; color: var(--faint); white-space: nowrap; text-align: right; line-height: 1.35; }
.dong-p .tien { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.dong-p .qua-han { font-size: 12px; }
.dong .mi-ic { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--sun-soft); color: #b77900; flex: none; }
.dong .btn.small { flex: none; }
.dong-p.dong-viec { flex-direction: row; align-items: center; gap: 10px; }
.dong-viec .han-o { display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
@container tqthe (max-width: 430px) { .dong-viec .avs { display: none; } }
.o-tt { width: 10px; height: 10px; border-radius: 50%; background: var(--m); box-shadow: 0 0 0 3px color-mix(in srgb, var(--m) 18%, transparent); flex: none; margin: 0 4px; }

/* việc: biểu đồ vòng + chú giải, danh sách việc gần hạn – hẹp: xếp dọc; vừa: vòng trên chú giải; rộng: vòng cạnh chú giải */
.viec-tq { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 26px; align-items: start; }
.viec-bd { display: flex; align-items: center; gap: 20px; padding: 2px 0 4px; }
.viec-bd > div:last-child { flex: 1; min-width: 0; max-width: 320px; }
@container tqthe (min-width: 560px) {
  .viec-tq { grid-template-columns: 190px minmax(0, 1fr); align-items: center; }
  .viec-bd { flex-direction: column; align-items: stretch; gap: 14px; }
  .viec-bd .donut { align-self: center; }
}
@container tqthe (min-width: 860px) {
  .viec-tq { grid-template-columns: 320px minmax(0, 1fr); }
  .viec-bd { flex-direction: row; align-items: center; }
}
.cc-tq { display: flex; align-items: center; gap: 20px; }
.cc-tq .chu-giai { flex: 1; min-width: 0; }
.avs-luoi { display: flex; flex-wrap: wrap; gap: 6px; }
.avs-luoi .av { box-shadow: none; }

/* thu tiền theo hợp đồng: tổng (thanh đã thu + 3 con số) rồi từng hợp đồng – không tràn ở mọi bề rộng */
.thu-dau { display: grid; gap: 10px; margin-bottom: 10px; padding: 12px 14px; border-radius: 12px; background: #f6f8fc; border: 1px solid var(--line-soft); min-width: 0; }
.thu-pt { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.thu-pt b { font-size: 22px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.thu-pt span { font-size: 12.5px; color: var(--muted); }
.thu-dau .bar { margin: 0; }
.thu-so { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; font-size: 13px; }
.thu-so > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.thu-so .lb { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thu-so .lb i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.thu-so b { margin-left: auto; flex: none; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.thu-so b small { font-weight: 500; color: var(--muted); font-size: 11.5px; margin-left: 2px; }
.thu-so .tong { padding-top: 6px; margin-top: 1px; border-top: 1px dashed var(--line); }
@container tqthe (min-width: 470px) {
  .thu-so { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .thu-so > div { flex-direction: column; align-items: flex-start; gap: 2px; }
  .thu-so b { margin-left: 0; font-size: 15px; }
  .thu-so .tong { padding-top: 0; margin-top: 0; border-top: 0; }
}
.ds-thu { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.thu { display: block; min-width: 0; text-decoration: none; color: inherit; padding: 8px; border-radius: 10px; }
.thu:hover { background: var(--hover); }
.thu:hover .thu-t b { color: var(--main); }
.thu-t { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.thu-t b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink); }
.thu-t span { flex: none; font-weight: 700; font-size: 12.5px; color: var(--main); font-variant-numeric: tabular-nums; }
.thu .bar { margin-top: 6px; }
.thu-s { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.thu-s b { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.thu.du .thu-t span { color: var(--ok); }
.thu.du .bar > i { background: linear-gradient(90deg, #4ade80, #16a34a); }

/* hồ sơ công trình: 5 ô số (3 ô đầu là thẻ lọc danh sách bên dưới) */
.hs-tq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
@container tqthe (min-width: 400px) { .hs-tq { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hs-tq > a, .hs-tq > button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 12px 10px; border: 1px solid var(--line-soft); border-radius: 11px; background: #f6f8fc;
  text-decoration: none; color: inherit; text-align: left; cursor: pointer; font: inherit; min-width: 0; transition: border-color .12s, background .12s, box-shadow .12s; }
.hs-tq > :hover { border-color: var(--main-line); background: #fff; }
.hs-tq b { font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); }
.hs-tq span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.hs-tq .on { border-color: var(--brand); background: var(--main-50); box-shadow: inset 0 -2px 0 var(--brand); }
.hs-tq .on span { color: var(--main-dark); font-weight: 600; }
.hs-tq .do b { color: var(--bad); }
.hs-tq .rong b { color: var(--faint); font-weight: 500; }

/* hoạt động gần đây: báo cáo thi công + bảng tin, gọn 1 dòng thời gian (ảnh nhỏ, cắt 2 dòng) */
.hd-ds { display: grid; }
.hd { display: flex; gap: 12px; padding: 12px 8px; border-radius: 12px; text-decoration: none; color: inherit; position: relative; min-width: 0; }
.hd + .hd::before { content: ""; position: absolute; left: 8px; right: 8px; top: 0; height: 1px; background: var(--line-soft); }
a.hd:hover { background: var(--hover); }
a.hd:hover::before, a.hd:hover + .hd::before { opacity: 0; }
.hd-ic { position: relative; flex: none; align-self: flex-start; }
.hd-ic .loai { position: absolute; right: -4px; bottom: -4px; width: 19px; height: 19px; border-radius: 50%; background: var(--main); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.hd-ic .loai.sun { background: #b77900; }
.hd-ic .loai .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.hd-ic .mi-ic { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--sun-soft); color: #b77900; }
.hd-t { flex: 1; min-width: 0; display: grid; gap: 2px; align-content: start; }
.hd-1 { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.hd-1 > span:first-child { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-1 > span b { color: var(--ink); }
.hd-1 > .hd-w { flex: none; font-size: 12px; color: var(--faint); white-space: nowrap; }
.hd-ct { font-size: 12.5px; color: var(--main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-nd { font-size: 13px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hd-nd .vm { color: var(--warn); font-weight: 600; }
.hd-anh { display: flex; gap: 6px; margin-top: 6px; }
.hd-anh img, .hd-anh .them { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; background: #e3e9f2; border: 1px solid var(--line-soft); flex: none; }
.hd-anh .them { display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; color: var(--muted); }

.the-ai { background: linear-gradient(160deg, #fff, #f4f8ff); }
.rp > .ct { display: block; margin-top: 4px; font-size: 13px; color: var(--main); text-decoration: none; }
@media (max-width: 560px) {
  .chao { padding: 18px 16px 16px; border-radius: 16px; margin-bottom: 14px; }
  .chao h1 { font-size: 20px; }
  .chao-hn { margin-top: 10px; }
  .chao-hn > span { flex-basis: 100%; font-size: 13px; }
  .chao-hn a { font-size: 12.5px; }
  .chao-nut { width: 100%; }
  .chao-nut > * { flex: 1 1 140px; }
  .chao-nut > .cc-o { flex-basis: 100%; }
  .chao-nut .btn { padding-left: 10px; padding-right: 10px; }
  .chao-nut .l-dai { display: none; } .chao-nut .l-ngan { display: inline; }
  .viec-bd { gap: 14px; }
  .hd { padding: 11px 4px; gap: 10px; }
  .hd + .hd::before { left: 4px; right: 4px; }
  .hd-anh img, .hd-anh .them { width: 48px; height: 48px; }
  .card h2 { gap: 6px 8px; }
  .card h2 .act { flex: 0 1 auto !important; margin-left: auto !important; }
  .kpi .k { padding-right: 38px; font-size: 12.5px; }
}
@media (max-width: 400px) {
  .tq .card > h2 { font-size: 15px; gap: 8px; column-gap: 8px; }
  .tq .card > h2 .act .btn.small { padding-left: 9px; padding-right: 9px; }
  .dd-tabs [data-the="tat-ca"] .n { display: none; } /* 360 px: 4 thẻ vừa 1 hàng; số "Tất cả" ít giá trị nhất */
}
/* thẻ công trình trên bảng theo giai đoạn */
.ct-the { padding: 12px 13px; }
.ct-dau { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 6px; }
.ct-the .t { margin-bottom: 2px; }
.ct-the .m .ic { width: 13px; height: 13px; vertical-align: -2px; }
.ct-td { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.ct-td b { color: var(--ink); }
.ct-tien b { color: var(--text); font-variant-numeric: tabular-nums; }
.ct-chan { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.ct-chan .m { margin: 0; font-size: 12px; }
.filters .seg { margin-left: auto; }
/* bảng có ô nhập (hợp đồng, khoản thu, lịch thanh toán, phụ lục…): trên điện thoại bảng cuộn ngang, ô không bị bóp còn 20 px */
.table-wrap td > .inp, .table-wrap td > input, .table-wrap td > select { min-width: 92px; }
.table-wrap td > input.num, .table-wrap td > input[data-num] { min-width: 130px; }
.table-wrap td > input[type=date] { min-width: 140px; }

@media (max-width: 560px) { .cmdk-chan { display: none; } .cmdk-bg { padding-top: 70px; } }
/* ô số liệu: số dài (282.456.295) tự co theo bề rộng ô, không bị cắt dưới biểu tượng */
.kpi { container-type: inline-size; }
.kpi .v { font-size: clamp(16px, 11.5cqi, 26px); white-space: nowrap; }


/* ---------- đăng nhập bằng máy đã đăng ký (0.3.1, public/app-may.js) ---------- */
.may-the { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.may-the.dang { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.may-the.ok { border-color: var(--ok-line); background: linear-gradient(180deg, #f6fdf9 0%, #fff 60%); }
.may-the.cho { border-color: var(--main-line); background: linear-gradient(180deg, var(--main-50) 0%, #fff 60%); }
.may-the.bad { border-color: var(--bad-line); }
.may-dau { display: flex; gap: 12px; align-items: center; }
.may-dau > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.may-dau b { font-size: 16px; color: var(--ink); }
.may-dau small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.may-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--main-soft); color: var(--main); }
.may-ic .ic { width: 22px; height: 22px; }
.may-dau.ok .may-ic { background: var(--ok-soft); color: var(--ok); }
.may-dau.bad .may-ic { background: var(--bad-soft); color: var(--bad); }
.may-dau.cho .may-ic { background: var(--sun-soft); color: #b7791f; }
.may-ma { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #f1f4f9; border: 1px dashed #c9d2e1; }
.may-ma span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.may-ma b { font-size: 22px; letter-spacing: .08em; color: var(--ink); font-variant-numeric: tabular-nums; font-family: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", monospace; white-space: nowrap; }
.may-gt { margin: 0; color: var(--muted); font-size: 13px; }
.may-h { font-weight: 700; color: var(--ink); font-size: 15px; }
.may-form { display: grid; gap: 10px; }
.may-form .f > span { font-weight: 600; }
.may-imei { font-style: normal; font-size: 12px; font-weight: 600; } .may-imei.ok { color: var(--ok); } .may-imei.bad { color: var(--bad); }
.may-dk { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.may-dk summary { display: inline-flex; align-items: center; gap: 6px; }
.may-dk[open] summary { margin-bottom: 10px; }
.may-cho-dong { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--main-dark); font-weight: 600; }
.may-nut { display: flex; gap: 6px; flex-wrap: wrap; }
.xoay { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2.5px solid var(--main-line); border-top-color: var(--main); animation: may-xoay .9s linear infinite; display: inline-block; }
@keyframes may-xoay { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .xoay { animation-duration: 3s; } }
details.may-the.gon { gap: 0; }
details.may-the.gon > summary { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; list-style: none; }
details.may-the.gon > summary::-webkit-details-marker { display: none; }
details.may-the.gon > summary code { margin-left: auto; font-size: 12.5px; color: var(--muted); }
details.may-the.gon[open] > summary { margin-bottom: 12px; }
details.may-the.gon[open] { display: grid; gap: 12px; }
.mk-gd { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px 16px; }
.mk-gd > summary { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.mk-gd[open] > summary { margin-bottom: 12px; color: var(--main); }
.mk-gd-body { display: grid; gap: 12px; }
/* thẻ Máy đăng nhập (Nhân viên) */
.may-ds { display: grid; gap: 10px; }
.may-yc { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fff; }
.may-yc.nho { padding: 10px 12px; }
.may-yc .may-ic { width: 38px; height: 38px; }
.may-yc-t { flex: 1; min-width: 0; display: grid; gap: 4px; }
.may-yc-t .small { overflow-wrap: anywhere; }
.may-yc-ai { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.may-yc-nut { display: flex; gap: 6px; flex: none; align-items: center; }
.may-o { display: grid; gap: 2px; min-width: 0; }
.may-o-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.may-o small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.may-o-nut { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.may-bang td { vertical-align: top; }
.may-ls { display: grid; gap: 0; }
.may-ls > div { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; flex-wrap: wrap; }
.may-ls > div:last-child { border-bottom: 0; }
.may-ls .t { color: var(--muted); font-size: 12px; min-width: 112px; font-variant-numeric: tabular-nums; }
.may-kv { font-size: 13.5px; }
@media (max-width: 560px) {
  .may-the { padding: 15px 14px; }
  .may-ma { flex-direction: column; align-items: flex-start; gap: 2px; }
  .may-ma b { font-size: 21px; }
  .may-yc { flex-wrap: wrap; }
  .may-yc-nut { width: 100%; justify-content: flex-end; }
  .may-ls .t { min-width: 0; width: 100%; }
}
/* menu Tạo mới, bảng thông báo trên điện thoại: tấm rộng gần hết màn hình ngay dưới thanh trên, không bị cắt mép
   (thanh trên có backdrop-filter nên "fixed" tính theo thanh trên – vẫn đúng khi có dải chạy thử) */
@media (max-width: 560px) {
  .tb-tao .dd, .dd-tb { position: fixed; left: 8px; right: 8px; top: calc(var(--tbh) + 4px); width: auto; min-width: 0 !important; }
  .tb-tao .dd { max-height: calc(100vh - var(--tbh) - 96px); overflow: auto; padding: 4px; }
  .tb-tao .dd a { padding: 8px 10px; }
  .dd-tb { max-height: calc(100vh - var(--tbh) - 96px); max-height: calc(100dvh - var(--tbh) - 96px); }
  .dd-tabs { padding: 0 10px 10px; gap: 4px; }
  .dd-tabs button { padding: 3px 8px; font-size: 12px; gap: 4px; }
  .dd-tabs button .n { min-width: 17px; padding: 0 4px; }
}
.modal-loi { margin: 12px 0 0; }
@media (max-width: 560px) {
  .modal-bg { padding: 12px 10px calc(12px + env(safe-area-inset-bottom)); align-items: flex-start; }
  .modal { padding: 18px 16px; border-radius: 16px; }
  .modal-body { max-height: calc(100vh - 210px); max-height: calc(100dvh - 210px); }
  .modal > .actions .btn { flex: 1 1 auto; }
}

/* ---------- điện thoại: ô nhập chữ 16 px (iPhone Safari không tự phóng to khi bấm vào ô) ---------- */
@media (max-width: 560px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea { font-size: 16px !important; }
}

/* ---------- màn hình cảm ứng: nút biểu tượng, nút nhỏ ≥ 32 × 32 (máy tính dùng chuột giữ nguyên cỡ gọn) ---------- */
@media (pointer: coarse) {
  .icon-btn, .x-nho, .thumbs .x, .tick { min-width: 32px; min-height: 32px; }
  .x-nho { display: inline-flex; align-items: center; justify-content: center; }
  .thumbs .x { width: 32px; height: 32px; line-height: 30px; top: 2px; right: 2px; }
  .tick { width: 32px; height: 32px; }
  .btn.small { min-height: 36px; }
  .btn { min-width: 36px; }
  .link { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 8px; }
  .hs-check .kq button { min-height: 34px; padding: 5px 12px; }
  .chip { min-height: 34px; }
  .seg a, .seg button { min-height: 34px; }
  .sugg button { min-height: 36px; }
  .dd-tabs button { min-height: 34px; }
  .tabs a, .tabs button { min-height: 42px; }
  .sb-nav a.sb-sub { min-height: 34px; }
  .check input, input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
}
/* tên tệp dài không làm vỡ khung; thanh dưới 360 px có số đếm không tràn */
.files > *, .file { min-width: 0; }
@media (max-width: 400px) { body.in-app .bottom-nav a { min-width: 0; } body.in-app .bottom-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* ===== 0.4.0 QT.0.1 – quy trình phối hợp dự án ===== */
.qt-thanh { height: 8px; border-radius: 99px; background: var(--grey-soft); overflow: hidden; margin: 2px 0 14px; }
.qt-thanh span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.qt-ds { list-style: none; margin: 0; padding: 0; }
.qt-buoc { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); position: relative; }
.qt-buoc:first-child { border-top: 0; }
.qt-so { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--grey-soft); color: var(--muted); border: 2px solid transparent; }
.qt-buoc.dang .qt-so { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.qt-buoc.xong .qt-so { background: var(--ok); color: #fff; }
.qt-buoc.bo-qua { opacity: .6; }
.qt-buoc.qua-han .qt-so { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.qt-nd { flex: 1; min-width: 0; display: grid; gap: 5px; }
.qt-dau { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.qt-phu { font-size: 13px; color: var(--muted); }
.qt-phu .do, .do.small, td .do { color: var(--bad); font-weight: 600; }
.qt-gc { font-size: 13.5px; background: var(--hover); border-radius: var(--radius-sm); padding: 6px 10px; white-space: pre-wrap; }
.qt-gys { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qt-gy { font-size: 12.5px; padding: 2px 9px; border-radius: 99px; background: var(--grey-soft); color: var(--muted); text-decoration: none; }
.qt-gy.co { background: var(--ok-soft); color: var(--ok); }
a.qt-gy:hover { text-decoration: underline; }
.qt-viec summary { cursor: pointer; font-size: 13px; color: var(--main); width: max-content; max-width: 100%; }
.qt-viec dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 13px; }
.qt-viec dt { font-weight: 600; color: var(--muted); }
.qt-viec dd { margin: 0; }
.qt-ls { margin-top: 8px; font-size: 12.5px; color: var(--muted); display: grid; gap: 2px; }
.qt-nut { display: flex; flex-wrap: wrap; gap: 6px; }
.qt-os { display: inline-flex; gap: 3px; flex-wrap: nowrap; }
.qt-o { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--card); border: 1px solid var(--line); color: var(--faint); }
.qt-o.xong { background: var(--ok); border-color: var(--ok); color: #fff; }
.qt-o.dang { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.qt-o.qua-han { background: var(--bad); border-color: var(--bad); color: #fff; }
.qt-o.bo-qua { background: var(--grey-soft); border-color: var(--grey-soft); color: var(--grey); text-decoration: line-through; }
.qt-chu { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.qt-chu > span { display: inline-flex; align-items: center; gap: 6px; }
.qt-chu .qt-o { width: 14px; height: 14px; border-radius: 4px; }
.qt-bang td:first-child { min-width: 200px; }
.qt-mau td { vertical-align: top; font-size: 13px; min-width: 140px; }
.qt-mau td:first-child { min-width: 170px; }
@media (max-width: 600px) { .qt-viec dl { grid-template-columns: 1fr; } .qt-viec dt { margin-top: 4px; } .qt-o { width: 18px; height: 18px; font-size: 10px; } .qt-os { gap: 2px; }
  /* tổng hợp trên điện thoại: mỗi công trình 1 khối – tên ở trên, 12 ô + số bước xong ở dưới (không phải cuộn ngang) */
  table.list.qt-bang thead { display: none; }
  table.list.qt-bang tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 12px; border-top: 1px solid var(--line-soft); }
  table.list.qt-bang tr:first-child { border-top: 0; }
  table.list.qt-bang td { display: block; padding: 0; border: 0; min-width: 0; background: none; }
  table.list.qt-bang td:first-child, table.list.qt-bang td:last-child { grid-column: 1 / -1; }
  table.list.qt-bang td:last-child:has(> .an-dt:only-child) { display: none; } }
/* ===== HẾT QT.0.1 ===== */

/* ===== 0.4.0 A ===== */
/* danh bạ đối tác, hợp đồng khoán có BOQ, phát sinh tổ đội QT.5.4 (app-doi-tac.js, app-vat-tu.js) */
.o-tron.to { width: 46px; height: 46px; border-radius: 13px; }
.o-tron.to .ic { width: 22px; height: 22px; }
.dt-ten { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dt-ten .dt-t { min-width: 0; flex: 1; }
.dt-ten a.mot-dong { color: var(--ink); text-decoration: none; }
table.dt-bang td.c-ten.rong .mot-dong { max-width: 380px; }
table.dt-bang tr.mo { opacity: .62; }
.xem-them { text-align: center; margin-top: 12px; }
dl.dt-tt { margin: 0; display: grid; gap: 10px; }
dl.dt-tt > div { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 10px; }
dl.dt-tt dt { color: var(--muted); font-size: 12.5px; }
dl.dt-tt dd { margin: 0; overflow-wrap: anywhere; }
dl.dt-tt dd .tag { margin: 0 4px 4px 0; white-space: normal; }
/* form hợp đồng khoán */
.kf-mode { margin-bottom: 10px; }
.kf-tk { background: var(--main-50); border: 1px solid var(--main-line); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; }
.kf-tk .ic { vertical-align: -2px; }
.kf-goi-y { margin: 6px 0 0; }
.kf-muc { font-weight: 600; color: var(--ink); margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kf-tt-dong { gap: 6px; margin: 4px 0; align-items: center; flex-wrap: wrap; }
.kf-tt-dong input[type=date] { width: 150px; }
.kf-tt-dong select { width: 130px; }
.kf-tt-dong input.num { width: 150px; }
.kf-tt-dong .kf-gc { flex: 1; min-width: 120px; }
.kf-tt-dong.khoa { background: #f6f8fc; border-radius: 9px; padding: 6px 10px; }
.kh-tong { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.kh-tong > div { background: #f6f8fc; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 8px 10px; min-width: 0; }
.kh-tong span { display: block; font-size: 12px; color: var(--muted); }
.kh-tong b { display: block; font-variant-numeric: tabular-nums; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.kh-tong .chinh { background: var(--main-soft); border-color: var(--main-line); }
.kh-tong .chinh b { color: var(--main-dark); }
.kh-tong .am b { color: var(--bad); }
.ds-pl { display: grid; gap: 4px; }
.pl-dong { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; background: #f6f8fc; border-radius: 9px; min-width: 0; }
.pl-dong .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* bảng BOQ nhập liệu */
table.boq-ed { min-width: 760px; }
table.boq-ed th, table.boq-ed td { padding: 6px 6px; vertical-align: top; }
table.boq-ed .c-so { width: 36px; } table.boq-ed .c-dvt { width: 80px; } table.boq-ed .c-kl { width: 110px; }
table.boq-ed .c-gia { width: 120px; } table.boq-ed .c-tt { width: 130px; } table.boq-ed .c-gc { width: 150px; } table.boq-ed .c-x { width: 36px; }
table.boq-ed td.c-tt, table.boq-ed td.c-so { padding-top: 13px; }
table.boq-ed textarea.inp { min-height: 38px; max-height: 160px; resize: vertical; width: 100%; font-family: inherit; field-sizing: content; }
table.boq-ed .inp { width: 100%; }
table.boq-ed tfoot td { background: #f6f8fc; border-top: 1px solid var(--line); }
.boq-nut { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.boq-cdt { max-height: 52vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 4px 8px; }
.boq-cdt-nhom { padding: 8px 2px 4px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: #fff; }
.boq-cdt-dong { display: flex; gap: 8px; align-items: baseline; padding: 5px 2px 5px 18px; cursor: pointer; }
.boq-cdt-dong .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.boq-cdt-dong .s { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.nx-bang { max-height: 46vh; overflow: auto; }
/* phát sinh */
.ps-buoc { display: inline-flex; gap: 3px; vertical-align: middle; }
.ps-buoc i { width: 12px; height: 6px; border-radius: 3px; background: #e4e8ef; }
.ps-buoc i.xong { background: #a2bef2; }
.ps-buoc i.on { background: var(--brand); }
.sap-han { color: var(--warn); font-weight: 600; }
.qua-han .ic { width: 14px; height: 14px; vertical-align: -2px; }
.ps-cho.toi { border-color: var(--main-line); box-shadow: 0 0 0 3px var(--main-soft), var(--shadow); }
.ps-luot { margin: 0 0 4px; }
.ps-nut { margin-top: 10px; flex-wrap: wrap; }
.ps-tich { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-weight: 600; }
.ps-step button { cursor: default; }
ul.ps-ls { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.ps-ls li { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; min-width: 0; }
ul.ps-ls li.ps-ls-xong { border-left-color: var(--ok-line); }
ul.ps-ls li.ps-ls-tra-lai, ul.ps-ls li.ps-ls-tu-choi { border-left-color: var(--bad-line); }
.ps-ls-dau { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ps-ls-gc { font-size: 13px; background: #f6f8fc; border-radius: 8px; padding: 4px 8px; margin-top: 3px; overflow-wrap: anywhere; }
details.ps-qt { margin-top: 14px; font-size: 13px; }
details.ps-qt summary { cursor: pointer; color: var(--muted); }
details.ps-qt ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
@media (max-width: 960px) { .kh-tong { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .kh-tong { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dl.dt-tt > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kf-tt-dong input[type=date], .kf-tt-dong select, .kf-tt-dong input.num { flex: 1 1 40%; width: auto; min-width: 0; }
  .kh-dau .actions { width: 100%; }
  /* bảng BOQ: mỗi dòng thành 1 thẻ */
  table.boq-ed { min-width: 0; }
  table.boq-ed, table.boq-ed tbody, table.boq-ed tfoot { display: block; }
  table.boq-ed thead { display: none; }
  table.boq-ed tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
  table.boq-ed tbody tr.boq-trong { display: block; }
  table.boq-ed td { display: block; padding: 0 !important; border: 0 !important; width: auto !important; text-align: left; }
  table.boq-ed td[data-lb]::before { content: attr(data-lb); display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
  table.boq-ed td.c-so { display: none; }
  table.boq-ed td.c-ten, table.boq-ed td.c-gc { grid-column: 1 / -1; }
  table.boq-ed td.c-x { grid-column: 1 / -1; text-align: right; }
  table.boq-ed tfoot tr { display: flex; justify-content: space-between; padding: 8px 6px; }
  table.boq-ed tfoot td { border: 0; padding: 0; }
  table.boq-ed tfoot td:empty { display: none; }
}
/* ===== HẾT A ===== */

/* ===== 0.4.0 B ===== */
/* Thanh quyết toán tổ đội, thầu phụ (QT.4.4 – app-tqt.js): bảng biểu mẫu cuộn ngang trong khung, ô nhập gọn trong ô bảng */
.badge.tqt-qltc-xac-nhan, .badge.tqt-qltc-tien-ich { background: var(--purple-soft); color: #6d28d9; }
.badge.tqt-tqt-lap, .badge.tqt-tqt-kiem-tra { background: var(--blue-soft); color: #1d4ed8; }
.badge.tqt-tckt, .badge.tqt-tgd { background: var(--sun-soft); color: #9a6700; }
.badge.tqt-da-duyet { background: var(--warn-soft); color: var(--warn); }
.badge.tqt-da-thanh-toan, .badge.tqt-luu-tru { background: var(--ok-soft); color: var(--ok); }
.badge.tqt-huy { background: var(--grey-soft); color: var(--grey); }
.badge.tqt-toi { background: var(--main-soft); color: var(--main); } .badge.tqt-lech { background: var(--bad-soft); color: var(--bad); } .badge.tqt-pl { background: var(--teal-soft); color: var(--teal); }
table.tqt-ds tr.tqt-cho td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.tqt-tra { color: var(--warn) !important; } .tqt-tra .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.tqt-loc { flex-wrap: wrap; }
.tqt-sub { margin: -6px 0 10px; overflow-wrap: anywhere; }
.tqt-buoc button.done .ic, .tqt-buoc button.on .ic { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }
.tqt-dang { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.tqt-dang .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tqt-tom { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.tqt-tom > div { background: #f6f8fc; border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.tqt-tom > div span:first-child { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tqt-tom > div [data-o] { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tqt-tom > div.tqt-F { background: var(--main-soft); border-color: var(--main-line); } .tqt-tom > div.tqt-F [data-o] { color: var(--main); }
.tqt-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tqt-tabs button { gap: 6px; flex: none; white-space: nowrap; padding-left: 11px; padding-right: 11px; }
.tqt-tabs .tqt-tl { font-weight: 400; }
.tqt-the h2 { flex-wrap: wrap; }
.tqt-wrap { margin: 6px 0 4px; box-shadow: none; }
table.tqt-bang { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.tqt-bang th, table.tqt-bang td { border: 1px solid var(--line-soft); padding: 5px 7px; vertical-align: middle; }
table.tqt-bang th { background: #f6f8fc; color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: center; white-space: nowrap; }
table.tqt-bang td.num { text-align: right; white-space: nowrap; } table.tqt-bang td.c { text-align: center; }
table.tqt-bang tr.tqt-muc td { background: #f8fafe; font-weight: 600; }
table.tqt-bang tr.tqt-tong td, table.tqt-bang tfoot td { background: #f3f7fc; font-weight: 600; }
table.tqt-bang tr.tqt-vuot td { background: var(--bad-soft); }
table.tqt-bang td.tqt-nhap { background: #f8fbff; }
table.tqt-bang td.tqt-trong { text-align: center; color: var(--muted); padding: 14px; }
table.tqt-bang .tqt-ten { min-width: 200px; }
table.tqt-03, table.tqt-09 { min-width: 1180px; } table.tqt-05, table.tqt-08 { min-width: 1080px; } table.tqt-10 { min-width: 880px; }
table.tqt-04, table.tqt-06, table.tqt-07 { min-width: 640px; } table.tqt-02 { min-width: 520px; }
.tqt-in { width: 100%; min-width: 74px; padding: 5px 7px; border: 1px solid #cfd6e2; border-radius: 7px; font: inherit; background: #fff; color: var(--ink); }
.tqt-in.num { text-align: right; } .tqt-in.tqt-chu { min-width: 110px; } .tqt-in.tqt-ngan { min-width: 54px; }
.tqt-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--main-soft); }
select.tqt-in { min-width: 130px; }
.tqt-v { display: inline-block; min-height: 20px; overflow-wrap: anywhere; }
.f .tqt-v { padding: 8px 0 2px; }
.tqt-chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tqt-chks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.tqt-denghi { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--main-50); border: 1px solid var(--main-line); }
.tqt-denghi > span { color: var(--muted); font-size: 12.5px; } .tqt-denghi > b { font-size: 20px; color: var(--main); } .tqt-denghi > i { flex-basis: 100%; color: #1a3363; }
.tqt-h3 { font-size: 14px; margin: 14px 0 8px; }
.tqt-ro { margin: 0 0 6px; } .tqt-ro .ic { width: 13px; height: 13px; vertical-align: -2px; }
.tqt-doi { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.act-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tqt-log ul { margin: 10px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; } .tqt-log summary { cursor: pointer; }
#canh-bao ul { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 900px) { .tqt-tom { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .tqt-tabs .tqt-tl { display: none; } }
@media (max-width: 560px) {
  .tqt-tom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tqt-dang .actions, .tqt-dang .actions .btn { width: 100%; }
  .tqt-loc select, .tqt-loc input { flex: 1 1 100%; min-width: 0; }
  .tqt-the { padding: 14px 12px; }
}
/* ===== HẾT B ===== */
