/* Hệ thống Quản lý Đấu thầu – Prototype v2 (SKG cho Lục Giác / Hùng Hậu Holdings)
   Nhận diện theo hunghau.vn (menu nền sáng, màu thương hiệu làm điểm nhấn): navy #001166, xanh dương #03549C, xanh lá #49A948, vàng #F8CD0A
   Font: font hệ thống (system-ui) như ERP SKG – Windows: Segoe UI (hinting ClearType, sắc ở cỡ nhỏ); macOS/iOS: San Francisco (giống hunghau.vn); không phụ thuộc Google Fonts */
:root {
  --navy: #001166;
  --navy-2: #0A1F7A;
  --navy-3: #13288C;
  --blue: #03549C;
  --blue-600: #024682;
  --blue-bright: #0779BF;
  --blue-50: #EAF2FA;
  --blue-100: #D3E4F4;
  --green: #49A948;
  --green-600: #3A8F39;
  --green-soft: #98CFA4;
  --green-50: #EAF6EA;
  --yellow: #F8CD0A;
  --yellow-50: #FFF8D9;
  --orange: #F47920;
  --orange-50: #FEF1E7;
  --red: #D33A2C;
  --red-50: #FCEDEB;
  --amber: #C98300;
  --amber-50: #FFF5DC;

  --bg: #F4F6FA;
  --card: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #EEF2F7;
  --text: #0F1B3D;
  --text-2: #334155;
  --muted: #5B6A80;
  --line: #E3E8EF;
  --line-2: #EEF1F5;
  --focus: rgba(3, 84, 156, .22);
  --sb-bg: #F8FAFD;
  --sb-hover: #EEF2F8;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 17, 102, .04), 0 2px 8px rgba(0, 17, 102, .05);
  --shadow-md: 0 6px 20px rgba(0, 17, 102, .08);
  --shadow-lg: 0 24px 48px rgba(0, 17, 102, .18);

  --font: system-ui, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: var(--font);
  --brand-line: linear-gradient(90deg, #03549C 0 30%, #49A948 30% 100%);
  /* Nền đặc có chữ trắng: giữ tông đậm ở cả 2 chế độ để đủ tương phản */
  --fill-blue: #03549C;
  --fill-green: #2F7D2E;
  --fill-red: #C0392B;
  --fill-amber: #9A6200;
  --fill-orange: #B5500A;
  color-scheme: light;
}

/* ---------- Dark mode ---------- */
:root[data-theme="dark"] {
  --navy: #9DB4FF;
  --blue: #5AA6E8;
  --blue-600: #7DB9EE;
  --blue-50: rgba(90, 166, 232, .14);
  --blue-100: rgba(90, 166, 232, .24);
  --green: #5CC05B;
  --green-50: rgba(92, 192, 91, .14);
  --yellow-50: rgba(248, 205, 10, .12);
  --orange-50: rgba(244, 121, 32, .15);
  --red: #F06A5C;
  --red-50: rgba(240, 106, 92, .14);
  --amber: #F0B23A;
  --amber-50: rgba(240, 178, 58, .14);
  --bg: #0A0F24;
  --card: #111934;
  --surface-2: #162042;
  --surface-3: #1C2850;
  --text: #E6EBF7;
  --text-2: #C3CCE3;
  --muted: #8E9AB8;
  --line: #243159;
  --line-2: #1D2850;
  --focus: rgba(90, 166, 232, .3);
  --sb-bg: #0D142D;
  --sb-hover: #18224A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
h1, h2, h3, h4 { margin: 0; color: var(--navy); letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
::selection { background: var(--blue-100); }
* { scrollbar-width: thin; scrollbar-color: #c3ccdb transparent; }
:root[data-theme="dark"] * { scrollbar-color: #2c3a66 transparent; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; grid-template-rows: 64px 1fr; height: 100vh; transition: grid-template-columns .2s ease; }
.app.sb-mini { grid-template-columns: 72px 1fr; }

/* Menu nền sáng: nhận diện thương hiệu chỉ ở logo, dải màu 3-7 và mục đang chọn */
.sidebar { grid-row: 1 / 3; grid-column: 1; display: flex; flex-direction: column; background: var(--sb-bg); color: var(--text-2); border-right: 1px solid var(--line); overflow: hidden; position: relative; z-index: 25; }
.sidebar::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand-line); }
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 14px; min-height: 76px; }
.sb-brand .logo { width: 40px; height: 40px; border-radius: 11px; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 1px var(--line), 0 2px 6px rgba(0, 17, 102, .06); overflow: hidden; }
.sb-brand .logo img { width: 36px; height: 36px; object-fit: contain; }
.sb-brand .t1 { font-weight: 700; color: var(--navy); font-size: 15px; line-height: 1.2; white-space: nowrap; }
.sb-brand .t2 { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 2px 12px 12px; }
.sidebar .grp { font-family: var(--font-num); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); opacity: .8; margin: 16px 10px 6px; white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin: 1px 0; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; position: relative; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { background: var(--sb-hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--blue-50); color: var(--fill-blue); font-weight: 700; }
:root[data-theme="dark"] .nav a.active { color: var(--blue); }
.app.sb-mini .nav a.active { background: var(--blue-100); }
.nav .ic { width: 20px; height: 20px; display: grid; place-items: center; flex: none; color: var(--muted); position: relative; }
.nav .ic svg { width: 20px; height: 20px; }
.nav a:hover .ic { color: var(--text-2); }
.nav a.active .ic { color: var(--fill-blue); }
.nav a.active .ic svg { stroke-width: 2; }
:root[data-theme="dark"] .nav a.active .ic { color: var(--blue); }
.nav .cnt { margin-left: auto; font-family: var(--font-num); background: var(--yellow); color: #3D2E00; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 1px 8px; min-width: 22px; text-align: center; }
.sb-foot { padding: 10px 12px; border-top: 1px solid var(--line); }
.sb-foot .hh { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.sb-foot .hh img { height: 26px; display: block; flex: none; }
:root[data-theme="dark"] .sb-foot .hh .pill { background: #fff; border-radius: 8px; padding: 3px 6px; }
.sb-foot .slogan { font-size: 14px; font-weight: 400; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }

/* Nút thu gọn: nút tròn trên mép phải của menu, không chiếm dòng nào */
.app { position: relative; }
.sb-edge { position: absolute; top: 26px; left: 240px; z-index: 40; width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 17, 102, .1); opacity: .55; transition: left .2s ease, opacity .15s, color .15s, border-color .15s, background .15s; }
.sb-edge svg { width: 14px; height: 14px; stroke-width: 2; }
.sidebar:hover + .sb-edge, .sb-edge:hover, .sb-edge:focus-visible { opacity: 1; }
.sb-edge:hover { color: #fff; background: var(--fill-blue); border-color: var(--fill-blue); }
.sb-edge:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.sb-edge::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: #0F1B3D; color: #fff; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 7px; white-space: pre; box-shadow: var(--shadow-md); pointer-events: none; opacity: 0; transition: opacity .12s; }
.sb-edge:hover::after { opacity: 1; }
.app.sb-mini .sb-edge { left: 60px; }

/* Menu thu gọn: dải icon 72px, rê chuột hiện tên */
.app.sb-mini .sb-brand { padding: 20px 0 14px; justify-content: center; }
.app.sb-mini .sb-brand > div:not(.logo),
.app.sb-mini .nav a > span:not(.ic):not(.cnt):not(.skg-tag),
.app.sb-mini .sb-foot .slogan { display: none; }
.app.sb-mini .sidebar .grp { font-size: 0; margin: 10px 14px; height: 1px; background: var(--line); opacity: 1; }
.app.sb-mini .sidebar .grp:first-child { display: none; }
.app.sb-mini .sb-scroll { padding: 2px 12px 12px; overflow: visible; }
.app.sb-mini .sidebar { overflow: visible; }
.app.sb-mini .nav a { justify-content: center; padding: 10px 0; }
.app.sb-mini .nav .cnt { position: absolute; top: 3px; right: 6px; margin: 0; padding: 0 4px; min-width: 16px; font-size: 11px; line-height: 15px; box-shadow: 0 0 0 2px var(--sb-bg); }
.app.sb-mini .nav .skg-tag { position: absolute; top: 2px; right: 2px; font-size: 0; padding: 0; width: 7px; height: 7px; border-radius: 50%; margin: 0 !important; }
.app.sb-mini .nav a:hover::after { content: attr(title); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); background: #0F1B3D; color: #fff; font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 8px; white-space: nowrap; box-shadow: var(--shadow-md); z-index: 70; pointer-events: none; }
.app.sb-mini .sb-foot .hh { justify-content: center; padding: 4px 0; }
.app.sb-mini .sb-foot .hh img { height: 22px; }

.topbar { grid-column: 2; background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 28px; z-index: 20; }
.topbar .spacer { flex: 1; }
/* QUY CHUẨN THÔNG BÁO BẢN MỚI (checkNewVer / showVerBar trong app.js): thanh cố định trên cùng giữa màn hình, còn nguyên khi chuyển màn;
   dùng chung cho phần mềm nội bộ và Cổng NCC; điện thoại: nằm ngay dưới thanh trên cùng, rộng hết màn. */
.ver-bar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; background: var(--card); color: var(--text); border: 1px solid var(--blue-100); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; white-space: nowrap; animation: pop .25s ease; }
.ver-bar .x { flex: none; }
@media (max-width: 768px) { .ver-bar { top: 70px; left: 12px; right: 12px; transform: none; white-space: normal; } .ver-bar .ver-bar-t { flex: 1; } .ver-bar .ver-bar-t .muted { display: none; } }
/* QUY CHUẨN: thanh trên cùng không lặp tên màn (đã có ở đầu trang). Máy tính: logo Hùng Hậu ở menu trái nên ẩn tên công ty;
   điện thoại (menu ẩn): hiện tên công ty, màu xanh nhận diện thương hiệu. */
.top-title { display: none; font-family: var(--font-num); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top-filter { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); padding: 5px 6px 5px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.top-filter select { padding: 5px 8px; border: 0; border-radius: 8px; background: var(--card); color: var(--text); font-weight: 600; }
.iconbtn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.iconbtn:hover { background: var(--surface-2); border-color: var(--blue-100); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn .dot { position: absolute; top: -5px; right: -5px; font-family: var(--font-num); background: var(--fill-red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 6px; border: 2px solid var(--card); }
.userchip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--card); }
.userchip:hover { border-color: var(--blue-100); }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #03549C, #0662B3); color: #fff; display: grid; place-items: center; font-family: var(--font-num); font-weight: 700; font-size: 12px; flex: none; }
.userchip .n { font-weight: 700; font-size: 14px; line-height: 1.15; }
.userchip .r { font-size: 12px; color: var(--muted); }
.hh-badge { display: none; }
.brand { display: none; }

.main { grid-column: 2; overflow-y: auto; padding: 26px 32px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 260px; }
.page-head .sub { color: var(--muted); margin-top: 6px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--blue); }

/* ---------- Cards & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 10px 20px; min-height: 48px; box-sizing: border-box; border-bottom: 1px solid var(--line-2); }
.card-h h3 { flex: 1; }
.card-b { padding: 16px 20px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mb16 { margin-bottom: 18px; }
.mt16 { margin-top: 18px; }
.mt8 { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.kpi { padding: 18px 20px 16px; cursor: pointer; transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kc, var(--blue)); }
.kpi::after { content: ""; position: absolute; right: -26px; top: -26px; width: 90px; height: 90px; border-radius: 50%; background: var(--kc, var(--blue)); opacity: .08; }
.kpi .l { font-size: 14px; color: var(--muted); font-weight: 600; line-height: 1.35; height: 2.7em; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; } /* luôn giữ 2 dòng để số lớn các thẻ thẳng hàng */
.kpi .v { font-family: var(--font-num); font-size: 34px; font-weight: 700; color: var(--navy); margin-top: 4px; line-height: 1.05; letter-spacing: -.02em; }
.kpi .s { font-size: 12px; margin-top: 4px; color: var(--muted); }
.kpi.red { --kc: var(--red); }
.kpi.amber { --kc: var(--amber); }
.kpi.blue { --kc: var(--blue); }
.kpi.green { --kc: var(--green); }
.kpi.orange { --kc: var(--orange); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.b-red { background: var(--red-50); color: var(--red); }
.b-amber { background: var(--amber-50); color: var(--amber); }
.b-green { background: var(--green-50); color: var(--green-600); }
:root[data-theme="dark"] .b-green { color: var(--green); }
:root:not([data-theme="dark"]) .b-amber, :root:not([data-theme="dark"]) .k-cho, :root:not([data-theme="dark"]) .ver.draft { color: #855700; }
:root:not([data-theme="dark"]) .b-orange { color: #A2470A; }
:root:not([data-theme="dark"]) [style*="color:var(--green)"] { color: #2B6E2A !important; }
:root:not([data-theme="dark"]) .b-red, :root:not([data-theme="dark"]) .k-kdat { color: #B42E22; }
:root:not([data-theme="dark"]) .b-green, :root:not([data-theme="dark"]) .k-dat, :root:not([data-theme="dark"]) .ver.sign { color: #2B6E2A; }
:root[data-theme="dark"] .b-red, :root[data-theme="dark"] .k-kdat { color: #FF8C80; }
:root[data-theme="dark"] .b-blue, :root[data-theme="dark"] .ver.sub { color: #86C2F2; }
.b-blue { background: var(--blue-50); color: var(--blue); }
.b-orange { background: var(--orange-50); color: #C45A0C; }
:root[data-theme="dark"] .b-orange { color: #FF9B54; }
.b-grey { background: var(--surface-3); color: var(--muted); }
.b-navy { background: rgba(0, 17, 102, .08); color: var(--navy); }
:root[data-theme="dark"] .b-navy { background: rgba(157, 180, 255, .12); }
.dotc { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
/* QUY CHUẨN ĐÁNH DẤU ĐỀ XUẤT SKG: nhãn tế nhị (viền mảnh, chữ nhạt), không nền đặc – không kéo mắt khỏi nghiệp vụ.
   Mặc định ẩn khi trình chiếu (body.hide-skg-tag – công tắc trong bảng điều khiển demo); .skg-keep luôn hiện. Menu / tab: chấm nhỏ .skg-dot. */
.skg-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 500; line-height: 16px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; vertical-align: middle; white-space: nowrap; }
.skg-tag.skg-dot { width: 6px; height: 6px; padding: 0; border: 0; margin-left: auto; font-size: 0; background: color-mix(in srgb, var(--fill-orange) 70%, transparent); flex: none; }
.tabs a .skg-tag.skg-dot { margin-left: 4px; vertical-align: 2px; display: inline-block; }
body.hide-skg-tag .skg-tag:not(.skg-keep) { display: none !important; }
body.hide-skg .skg-only { display: none !important; }

/* ---------- Buttons & forms ---------- */
/* QUY CHUẨN NÚT: 2 cỡ cố định cho cả <button> lẫn <a> – thường 36px, nhỏ (.sm) 30px. Biểu tượng theo động từ, dùng ký hiệu đơn sắc:
   ＋ thêm / tạo · ✎ sửa · ✔ xác nhận / duyệt / hoàn thành · ➤ trình / gửi · ↩ trả lại · ↶ thu hồi · ✕ từ chối · ⬆ tải lên / nhập file ·
   ⬇ tải xuống / xuất · ✍ bản đã ký · ✨ AI · "… →" chuyển sang màn / thẻ khác. Lưu, Hủy, Đóng, Tiếp tục: không biểu tượng. Không dùng emoji màu. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; box-sizing: border-box; line-height: 1; font-family: inherit; text-decoration: none; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--surface-2); border-color: var(--blue-100); }
.btn:active { transform: translateY(1px); }
/* Quy ước màu nút (giữ nhất quán khi sửa):
   - .green  = QUYẾT ĐỊNH CHẤP THUẬN của người có thẩm quyền: duyệt, ký trình, phê duyệt, phân công, phát hành.
   - .primary = HÀNH ĐỘNG CHÍNH của người thực hiện: tạo, lưu, trình, xác nhận dữ liệu của mình.
   - .danger = từ chối / đưa hồ sơ quay lại: trả lại, trả về đơn vị đề xuất.
   Cùng một quyết định thì nút mở hộp thoại và nút xác nhận trong hộp thoại cùng màu. */
.btn.primary { background: linear-gradient(180deg, #0662B3, #03549C); border-color: #03549C; color: #fff; box-shadow: 0 4px 12px rgba(3, 84, 156, .25); }
.btn.primary:hover { background: #024682; }
.btn.green { background: linear-gradient(180deg, #359A34, #2E8B2D); border-color: #2E8B2D; color: #fff; box-shadow: 0 4px 12px rgba(73, 169, 72, .25); }
.btn.green:hover { background: #277A26; }
.btn.danger { background: var(--card); border-color: color-mix(in srgb, var(--red) 35%, transparent); color: var(--red); }
.btn.danger:hover { background: var(--red-50); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-50); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
/* Thuộc tính hidden luôn thắng display của lớp (ví dụ .field trong popup có phần đổi theo lựa chọn) */
[hidden] { display: none !important; }
.field label { font-size: 14px; color: var(--text-2); font-weight: 600; }
.field label .req { color: var(--red); }
.inp, .sel, .ta { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.inp:hover, .sel:hover, .ta:hover { border-color: #C9D3E0; }
.inp:focus, .sel:focus, .ta:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--focus); }
.ta { min-height: 80px; resize: vertical; }
.inp.err { border-color: var(--red); background: var(--red-50); }
.hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.toggle input { width: 16px; height: 16px; accent-color: var(--blue); }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 14px; color: var(--muted); font-weight: 600; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--blue-50); }
.tbl .code { font-family: var(--font-num); font-weight: 700; color: var(--blue); white-space: nowrap; letter-spacing: .01em; }
.tbl .sub { font-size: 12px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
/* Độ rộng cột: tiêu đề được xuống dòng để cột số không bị kéo rộng theo tiêu đề;
   cột số / giá co vừa nội dung; cột tên, người, ngày có độ rộng tối thiểu; nút thao tác không xuống dòng */
.tbl th { white-space: normal; vertical-align: bottom; line-height: 1.35; }
/* Cột số: căn phải cả tiêu đề lẫn dữ liệu, chữ số đều độ rộng để thẳng hàng */
.tbl th.right { text-align: right; }
/* Đơn vị / chú thích của tiêu đề cột nằm dòng riêng, chữ thường, nhỏ hơn */
.tbl th .u { display: block; margin-top: 1px; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; white-space: nowrap; opacity: .85; }
.tbl th .u.up { font-size: inherit; font-weight: inherit; text-transform: uppercase; letter-spacing: inherit; opacity: 1; margin-top: 0; }
.tbl td.right { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl td.right .inp { text-align: right; }
.tbl th.c-wide { min-width: 260px; }
.tbl th.c-name { min-width: 250px; }
.tbl th.c-mid { min-width: 170px; }
.tbl th.c-person { min-width: 128px; }
.tbl th.c-date { min-width: 120px; }
.tbl td:has(> .btn), .tbl td:has(> .row > .btn) { white-space: nowrap; width: 1%; }
.tbl .sub { overflow-wrap: anywhere; }
.tbl .sub.nowrap { overflow-wrap: normal; white-space: nowrap; }
@media (min-width: 769px) and (max-width: 1440px) {
  .tbl th, .tbl td { padding-left: 10px; padding-right: 10px; }
  .tbl th.c-wide { min-width: 210px; }
  .tbl th.c-name { min-width: 200px; }
  .tbl th.c-mid { min-width: 130px; }
  .tbl th.c-person { min-width: 96px; }
  .tbl th.c-date { min-width: 100px; }
  .tbl td.nowrap:not(.right) { white-space: normal; }
}
.card > .tbl-wrap:last-child .tbl tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }

/* ---------- Filter bar ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.filters .inp, .filters .sel { width: auto; min-width: 150px; padding: 8px 11px; background: var(--surface-2); }
.filters .search { min-width: 300px; padding-left: 36px; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }

/* ---------- Progress ---------- */
.bar { height: 8px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--blue), var(--green)); }
.mini-steps { display: flex; gap: 3px; }
.mini-steps i { width: 11px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.mini-steps i.done { background: var(--green); }
.mini-steps i.cur { background: var(--blue); }
.mini-steps i.late { background: var(--red); }

/* Stepper 10 bước */
.stepper { display: flex; gap: 0; overflow-x: auto; padding: 22px 14px 10px; }
.step { flex: 1; min-width: 108px; text-align: center; position: relative; padding: 0 4px; }
.step::before { content: ""; position: absolute; top: 17px; left: -50%; width: 100%; height: 3px; background: var(--surface-3); z-index: 0; border-radius: 2px; }
.step:first-child::before { display: none; }
.step.done::before, .step.cur::before { background: var(--fill-green); }
.step .c { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 12px; margin: 0 auto 8px; display: grid; place-items: center; font-family: var(--font-num); font-weight: 700; font-size: 14px; background: var(--card); border: 2px solid var(--line); color: var(--muted); transition: transform .15s; }
.step.done .c { background: var(--fill-green); border-color: var(--fill-green); color: #fff; }
.step.cur .c { background: var(--fill-blue); border-color: var(--fill-blue); color: #fff; box-shadow: 0 0 0 6px var(--blue-100); transform: scale(1.08); }
.step.late .c { background: var(--fill-red); border-color: var(--fill-red); color: #fff; box-shadow: 0 0 0 6px var(--red-50); }
.step.skip .c { border-style: dashed; opacity: .6; }
.step .n { font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 1.3; }
.step .d { font-size: 12px; color: var(--muted); margin-top: 3px; }
.step.cur .n { color: var(--blue); font-weight: 700; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 14px; overflow-x: auto; }
.tabs a { padding: 13px 14px; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; margin-bottom: -1px; transition: color .15s; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--blue); border-color: var(--blue); }
.tabs a .badge { margin-left: 4px; }

/* Info grid */
.info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; }
.info .k { font-size: 12px; color: var(--muted); }
.info .v { font-weight: 600; margin-top: 2px; }

/* Callouts */
.callout { display: flex; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 14px; align-items: flex-start; border: 1px solid transparent; }
.callout.red { background: var(--red-50); color: var(--text); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.callout.amber { background: var(--amber-50); color: var(--text); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.callout.blue { background: var(--blue-50); color: var(--text); border-color: color-mix(in srgb, var(--blue) 22%, transparent); }
.callout.green { background: var(--green-50); color: var(--text); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.callout.orange { background: var(--orange-50); color: var(--text); border-color: color-mix(in srgb, var(--orange) 25%, transparent); }
.callout .ic { font-size: 16px; line-height: 1.2; }

/* Chart bars */
.hbar { display: grid; grid-template-columns: 170px 1fr 60px; gap: 12px; align-items: center; margin: 9px 0; font-size: 14px; }
.hbar .track { height: 14px; background: var(--surface-3); border-radius: 7px; overflow: hidden; display: flex; }
.hbar .track i { display: block; height: 100%; }
.hbar .track i:first-child { border-radius: 7px 0 0 7px; }
.hbar .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.hbar > :last-child { font-family: var(--font-num); font-weight: 700; }
/* QUY CHUẨN BIỂU ĐỒ THANH: số bên phải phải có nghĩa và đơn vị – nếu tiêu đề thẻ chưa nói rõ thì thêm dòng đầu hbarHead(nhãn, giá trị) (app.js), như đầu cột bảng */
.hbar.hbar-h { margin: 0 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 12px; }
.hbar.hbar-h > * { font-family: inherit; font-weight: 600; color: var(--muted); }
.hbar.hbar-h > .right { grid-column: 2 / 4; text-align: right; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.donut { width: 140px; height: 140px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ""; position: absolute; inset: 20px; background: var(--card); border-radius: 50%; }
.donut .lbl { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; z-index: 1; text-align: center; font-family: var(--font-num); font-weight: 700; color: var(--navy); font-size: 26px; line-height: 1.1; }
.donut .lbl small { display: block; font-family: var(--font); font-size: 12px; color: var(--muted); font-weight: 500; }
.donut.lg { width: 128px; height: 128px; margin: 0 auto 10px; }
.donut.lg::after { inset: 18px; }
.donut.lg .lbl { font-size: 36px; }
/* Thẻ Tình trạng thời hạn: xếp dọc, lấp chiều cao bằng danh sách cần xử lý */
.dl-card { display: flex; flex-direction: column; }
.dl-card .card-b { flex: 1; display: flex; flex-direction: column; }
.dl-stats { display: flex; flex-direction: column; gap: 1px; }
.dl-stat { display: grid; grid-template-columns: 9px minmax(0, 1fr) 70px 26px 34px; gap: 8px; align-items: center; font-size: 14px; padding: 3px 6px; border-radius: 8px; }
.dl-stat.click { cursor: pointer; }
.dl-stat.click:hover { background: var(--surface-2); }
.dl-stat .l { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-stat .track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.dl-stat .track i { display: block; height: 100%; border-radius: 4px; }
.dl-stat b { font-family: var(--font-num); text-align: right; }
.dl-stat .pct { font-size: 12px; color: var(--muted); text-align: right; font-family: var(--font-num); }
.dl-act { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
/* Hai cột: thẻ cao theo thẻ bên trái, danh sách lấp phần còn lại và cuộn nếu dư */
@media (min-width: 1181px) {
  .dl-card { contain: size; overflow: hidden; min-height: 545px; } /* đủ chỗ cho 3 gói khi thẻ bên trái ngắn */
  .dl-card .card-b { min-height: 0; }
  .dl-act { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .dl-act-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
}
.dl-act-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; font-size: 14px; }
.dl-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; cursor: pointer; }
.dl-item:hover { background: var(--surface-2); }
.dl-item + .dl-item { border-top: 1px dashed var(--line); }
.dl-item .t { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-item .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-item .badge { flex: none; }
.dl-note { margin-top: auto; padding-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Timeline / nhật ký */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl li { display: grid; grid-template-columns: 120px 18px 1fr; gap: 10px; padding: 8px 0; font-size: 14px; position: relative; }
.tl li:not(:last-child)::after { content: ""; position: absolute; left: 134px; top: 22px; bottom: -6px; width: 2px; background: var(--line); }
.tl .t { color: var(--muted); font-size: 12px; white-space: nowrap; font-family: var(--font-num); }
.tl .b { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); margin-top: 5px; box-shadow: 0 0 0 3px var(--blue-50); position: relative; z-index: 1; }

/* Phiên bản tài liệu */
/* Trạng thái tài liệu: cùng dáng nhãn trạng thái (.badge) – viên thuốc, chữ 12px đậm 600 */
.ver { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--card); margin: 2px 4px 2px 0; }
.ver.draft { border-color: color-mix(in srgb, var(--amber) 30%, transparent); background: var(--amber-50); color: var(--amber); }
.ver.sub { border-color: color-mix(in srgb, var(--blue) 30%, transparent); background: var(--blue-50); color: var(--blue); }
.ver.sign { border-color: color-mix(in srgb, var(--green) 30%, transparent); background: var(--green-50); color: var(--green-600); }
:root[data-theme="dark"] .ver.sign { color: var(--green); }
.lock { color: var(--muted); font-size: 14px; }

/* Modal & dropdown */
.overlay { position: fixed; inset: 0; background: rgba(0, 10, 50, .45); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 56px 16px; z-index: 50; overflow-y: auto; animation: fade .15s ease; }
.modal { background: var(--card); border-radius: 18px; width: min(720px, 100%); box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .18s ease; overflow: hidden; }
.modal.wide { width: min(980px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 24px; border-bottom: 1px solid var(--line); position: relative; }
.modal-h::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand-line); }
.modal-h h2 { flex: 1; }
.modal-b { padding: 20px 24px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.x { border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; width: 32px; height: 32px; border-radius: 8px; }
.x:hover { background: var(--surface-3); }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp .box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cmp .box .k { font-size: 12px; color: var(--muted); }
.cmp .box .v { font-family: var(--font-num); font-size: 20px; font-weight: 700; color: var(--navy); }
.cmp .box.new { border-color: var(--blue); background: var(--blue-50); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.dropdown { position: absolute; right: 0; top: 50px; width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 40; max-height: 70vh; overflow-y: auto; animation: pop .15s ease; }
.dropdown .it { padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-size: 14px; cursor: pointer; display: flex; gap: 10px; }
.dropdown .it:hover { background: var(--blue-50); }
.dropdown .dd-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.dropdown .dd-f { padding: 10px 16px 12px; font-size: 12px; color: var(--muted); background: var(--surface-2); line-height: 1.45; }
.rel { position: relative; }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #001166; color: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 80; font-size: 14px; max-width: 90vw; border-left: 4px solid var(--green); animation: pop .2s ease; }

/* Bảng điều khiển demo */
/* Nút mở bảng điều khiển demo: icon nhỏ, kín đáo – công cụ của người thuyết trình, không phải tính năng sản phẩm */
.demo-fab { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); opacity: .7; transition: opacity .15s, color .15s, border-color .15s, box-shadow .15s; }
.demo-fab svg { width: 17px; height: 17px; }
.demo-fab:hover, .demo-fab.on { opacity: 1; color: var(--fill-blue); border-color: var(--blue-100); box-shadow: var(--shadow-md); }
:root[data-theme="dark"] .demo-fab:hover, :root[data-theme="dark"] .demo-fab.on { color: var(--blue); }
.demo-fab::after { content: attr(data-tip); position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); background: #0F1B3D; color: #fff; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 7px; white-space: nowrap; box-shadow: var(--shadow-md); pointer-events: none; opacity: 0; transition: opacity .12s; }
.demo-fab:hover::after { opacity: 1; }
.demo-fab.on::after { opacity: 0; }
:root[data-theme="dark"] .toast { box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(157, 180, 255, .28); }
.demo-panel { position: fixed; right: 18px; top: 64px; width: 340px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 31; border: 1px solid var(--line); overflow: hidden; animation: pop .18s ease; }
.demo-panel .hd { background: #001166; color: #fff; padding: 13px 16px; font-weight: 700; display: flex; align-items: center; position: relative; }
.demo-panel .hd::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand-line); }
.demo-panel .hd span { flex: 1; }
.demo-panel .hd .x:hover { background: rgba(255, 255, 255, .1); }
.demo-panel .bd { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.rolelist button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; margin-bottom: 6px; cursor: pointer; font-size: 14px; transition: border-color .15s, background .15s; }
.rolelist button:hover { border-color: var(--blue-100); }
.rolelist button.on { border-color: var(--blue); background: var(--blue-50); }
.rolelist .avatar { width: 26px; height: 26px; font-size: 12px; flex: none; }

/* Đánh giá */
.ev td, .ev th { font-size: 14px; }
.ev .crit { min-width: 260px; }
.cell-k { display: inline-flex; padding: 3px 9px; border-radius: 7px; font-weight: 600; font-size: 12px; cursor: pointer; border: 1px dashed transparent; }
.cell-k:hover { border-color: var(--muted); }
.k-dat { background: var(--green-50); color: var(--green-600); }
:root[data-theme="dark"] .k-dat { color: var(--green); }
.k-kdat { background: var(--red-50); color: var(--red); }
.k-cho { background: var(--amber-50); color: var(--amber); }
.k-none { background: var(--surface-3); color: var(--muted); }

/* Văn bản dự thảo – luôn nền giấy trắng */
.paper { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md); border-radius: 6px; padding: 38px 52px; font-family: "Times New Roman", serif; font-size: 15px; line-height: 1.6; color: #111; }
.paper h4 { font-family: "Times New Roman", serif; text-align: center; color: #111; font-size: 16px; margin: 14px 0; }
.paper .af { background: #fff3c4; border-bottom: 1px dashed #d4a600; padding: 0 2px; }
.paper table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.paper td, .paper th { border: 1px solid #555; padding: 4px 6px; font-size: 14px; }

/* Điện thoại */
.phone-wrap { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.phone { width: 380px; height: 760px; border-radius: 48px; background: #05081a; padding: 14px; box-shadow: var(--shadow-lg), inset 0 0 0 2px #2a3150; flex: none; }
.phone .scr { width: 100%; height: 100%; border-radius: 36px; background: var(--bg); overflow-y: auto; position: relative; }
.phone .ph-top { background: radial-gradient(120% 90% at 100% 0%, rgba(73, 169, 72, .45), transparent 60%), linear-gradient(135deg, #001166, #03549C); color: #fff; padding: 38px 20px 20px; border-radius: 0 0 24px 24px; }
.phone .ph-card { background: var(--card); margin: 12px 14px; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid var(--line-2); }

/* Khác */
.empty { padding: 36px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; font-size: 14px; }
.kv .k { color: var(--muted); }
.sep { height: 1px; background: var(--line-2); margin: 14px 0; }
.chk { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; font-size: 14px; }
.chk .i { width: 20px; text-align: center; }
/* Popup nhắc ý kiến: mỗi người một dòng, chọn / bỏ chọn; đơn vị ngoài chỉ hiện thông tin */
.rm-row { padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.rm-row:last-child { border-bottom: 0; }
.rm-row input { margin-top: 3px; }
.rm-row.off { cursor: default; color: var(--muted); }
.projcard { padding: 18px 20px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
.projcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand-line); opacity: 0; transition: opacity .15s; }
.projcard:hover { border-color: var(--blue-100); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.projcard:hover::before { opacity: 1; }
.stars { color: var(--yellow); letter-spacing: 1px; text-shadow: 0 0 1px rgba(150, 110, 0, .5); }
.rank { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-num); font-weight: 700; color: #fff; }
.rank.A { background: var(--fill-green); }
.rank.B { background: var(--fill-blue); }
.rank.C { background: var(--fill-amber); }
.rank.D { background: var(--fill-red); }
.rank.M { background: var(--surface-3); color: var(--muted); }
.projcard.off, .tbl tr.off td { opacity: .6; }

.notif { padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-size: 14px; cursor: pointer; display: flex; gap: 10px; }
.notif:hover { background: var(--blue-50); }

/* Số liệu canh cột */
.info .v, .kv .v, .tbl td.right, .tbl td.num, .step .d { font-variant-numeric: tabular-nums; }

/* ---------- Căn cứ yêu cầu (công cụ demo): icon ⓘ cạnh tiêu đề + khung trượt bên phải ---------- */
.rq-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: 8px; padding: 0; vertical-align: 3px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.rq-btn svg { width: 16px; height: 16px; stroke-width: 2; }
.rq-btn:hover, .rq-btn.on { color: var(--fill-blue); border-color: var(--blue-100); background: var(--blue-50); }
:root[data-theme="dark"] .rq-btn:hover, :root[data-theme="dark"] .rq-btn.on { color: var(--blue); }
.rq-backdrop { display: none; }
.rq-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100vw; z-index: 45; background: var(--card); border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(0, 17, 102, .12); display: flex; flex-direction: column; animation: rq-in .2s ease; }
@keyframes rq-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes rq-up { from { transform: translateY(40px); opacity: 0; } }
.rq-top { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); position: relative; }
.rq-top::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand-line); }
.rq-top > div { flex: 1; min-width: 0; }
.rq-kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green-600); }
:root[data-theme="dark"] .rq-kicker { color: var(--green); }
.rq-top h2 { margin-top: 3px; font-size: 17px; }
.rq-src { font-size: 12px; color: var(--muted); margin-top: 3px; }
.rq-body { flex: 1; overflow-y: auto; padding: 6px 20px 28px; }
.rq-sect { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.rq-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
.rq-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rq-code { font-size: 12px; font-weight: 700; color: #fff; background: var(--fill-blue); border-radius: 6px; padding: 1px 7px; flex: none; }
.rq-code.bs { background: var(--fill-orange); }
.rq-sec { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-lbl { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 10px 0 3px; }
.rq-lbl .muted { font-weight: 500; }
.rq-q { font-size: 14px; line-height: 1.5; color: var(--text); background: var(--card); border-left: 3px solid var(--fill-blue); border-radius: 0 8px 8px 0; padding: 7px 10px; font-style: italic; }
.rq-t { font-size: 14px; line-height: 1.55; color: var(--text-2); }

/* ===== QUY CHUẨN TRỢ LÝ AI (aiPanel trong app.js): dùng chung khung .rq-drawer, NỔI ĐÈ lên nội dung – không co nội dung ứng dụng (co lại làm vỡ layout);
   nút ⤢ bung toàn màn hình (nội dung căn giữa tối đa 860px); điện thoại luôn toàn màn hình.
   Câu hỏi của người dùng: bong bóng xanh bên phải; câu trả lời: thẻ nền nhạt; câu hỏi gợi ý: chip (mặc định theo màn / tiếp theo do AI sinh). ===== */
.rq-drawer.ai-drawer { width: 440px; }
.ai-drawer .rq-top .x { flex: none; }
.ai-drawer .rq-top .ai-new { flex: none; align-self: flex-start; white-space: nowrap; }
.ai-drawer .rq-top h2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ai-drawer .rq-top .x + .x { margin-left: -4px; }
.rq-drawer.ai-drawer.full { width: 100vw; left: 0; border-left: 0; }
.ai-body { padding-top: 14px; }
.ai-wrap { max-width: 860px; margin: 0 auto; }
.ai-intro { font-size: 14px; line-height: 1.55; color: var(--text-2); background: var(--blue-50); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.ai-msg { margin-bottom: 14px; }
.ai-q { margin: 0 0 8px auto; width: fit-content; max-width: 88%; background: var(--fill-blue); color: #fff; border-radius: 14px 14px 4px 14px; padding: 8px 12px; font-size: 14px; line-height: 1.45; }
.ai-a { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 14px; font-size: 14px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.ai-a p { margin: 0 0 8px; }
.ai-a > p:last-of-type { margin-bottom: 0; }
.ai-a ul, .ai-a ol { margin: 4px 0 8px; padding-left: 20px; }
.ai-a li { margin: 3px 0; }
.ai-a .ai-h { font-weight: 700; color: var(--navy); margin-top: 6px; }
.ai-a .tbl-wrap { margin: 6px 0 8px; }
.ai-tbl th, .ai-tbl td { padding: 6px 8px; font-size: 13px; white-space: normal; }
.ai-ref { font-weight: 600; }
.ai-err { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.ai-meta { margin-top: 8px; font-size: 12px; color: var(--muted); }
.ai-act { margin-top: 10px; }
.ai-sub { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin: 16px 0 0; }
.ai-chips { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; }
.ai-chips .chip { padding: 6px 12px; text-align: left; white-space: normal; line-height: 1.35; cursor: pointer; font: inherit; font-size: 13px; max-width: 100%; }
.ai-chips.fu .chip::before { content: "↳ "; color: var(--muted); }
.ai-drawer .ai-model { margin-top: 6px; width: 100%; max-width: 320px; height: 30px; padding: 0 28px 0 10px; font-size: 13px; }
.ai-local { border: 1px solid var(--line); background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 12px 14px; font-size: 14px; line-height: 1.55; color: var(--text); } /* cùng khung với câu trả lời AI (.ai-a) – không viền nhấn màu gây phân tâm */
.ai-local-h { font-weight: 700; color: var(--navy); font-size: 15px; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ai-local p { margin: 0 0 8px; }
.ai-local ul { margin: 0 0 10px; padding-left: 20px; }
.ai-local li { margin: 4px 0; }
.ai-local .ai-local-skg { background: var(--blue-50); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
.ai-note { font-size: 12px; color: var(--fill-amber, var(--amber)); background: color-mix(in srgb, var(--amber) 12%, transparent); border-radius: 8px; padding: 5px 9px; margin: 0 0 8px; }
.ai-caret { display: inline-block; width: 7px; height: 15px; margin-left: 2px; vertical-align: -2px; background: var(--blue); border-radius: 1px; animation: aiCaret 1s steps(1) infinite; }
.ai-live > p:last-of-type, .ai-live > ul:last-of-type li:last-child { display: inline; }
@keyframes aiCaret { 50% { opacity: 0; } }
.ai-busy { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.ai-busy span { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: aiDot 1s infinite; }
.ai-busy span:nth-child(2) { animation-delay: .15s; }
.ai-busy span:nth-child(3) { animation-delay: .3s; margin-right: 4px; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-foot { display: flex; gap: 8px; align-items: flex-end; justify-content: center; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.ai-foot .ta { flex: 1; max-width: 760px; min-height: 38px; max-height: 120px; resize: none; }
.topbar .ai-btn { flex: none; white-space: nowrap; }
.topbar .ai-btn.on { background: var(--blue-50); border-color: var(--blue-100); color: var(--fill-blue); }
@media (max-width: 768px) {
  .rq-drawer.ai-drawer, .rq-drawer.ai-drawer.full { left: 0; right: 0; width: auto; max-width: none; height: 100dvh; top: 0; border-radius: 0; animation: rq-up .22s ease; }
  .ai-drawer .ai-full-btn, .topbar .ai-btn .ai-t { display: none; }
  .ai-drawer .ai-new .ai-new-t { font-size: 0; }
  .ai-drawer .ai-new .ai-new-t::after { content: "Mới"; font-size: 12px; }
}
.rq-list { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.rq-list li { margin: 4px 0; }
.rq-list.ask li::marker { content: "? "; color: var(--amber); font-weight: 700; }
.rq-rel { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.rq-rel summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue); }
.rq-mini { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rq-mini:last-child { border-bottom: 0; }
.rq-mini .rq-q { font-size: 14px; border-left-width: 2px; padding: 4px 8px; background: transparent; }

/* Dòng phân bổ dự án / nguồn vốn */
.al-head, .al-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) 96px 32px; gap: 8px; align-items: center; }
.al-row { margin-top: 6px; }
.al-row:has(.al-unit:not([style*="none"])) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr) 96px 32px; }
.al-head { font-size: 14px; font-weight: 600; color: var(--muted); }
.al-head .right { text-align: right; }
.al-pct { display: flex; align-items: center; gap: 4px; }
.al-pct .inp { text-align: right; }
.al-row .al-del { width: 32px; height: 32px; }
/* Danh mục hàng hóa */
.tbl.items tr.lot-h td { background: var(--surface-2); border-top: 1px solid var(--line); }
.tbl.items tr.lot-t td { background: var(--surface-2); }
.tbl.items tr.grand td { border-top: 2px solid var(--line); font-size: 14px; }
.tbl.it-edit td { padding: 6px 6px; vertical-align: top; }
.tbl.it-edit .it-qty, .tbl.it-edit .it-price { text-align: right; min-width: 96px; }
.tbl.it-edit .it-uom { width: 80px; }
.tbl.it-edit .it-lot { width: 70px; }
.tbl.it-edit td.it-amt { padding-top: 14px; font-variant-numeric: tabular-nums; }

/* Danh mục hàng hóa (BS09) */
.goods { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul ul { padding-left: 16px; }
.tr-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.tr-row:hover { background: var(--sb-hover); }
.tr-row.on { background: var(--blue-50); color: var(--fill-blue); font-weight: 600; }
:root[data-theme="dark"] .tr-row.on { color: var(--blue); }
.tr-car { width: 16px; flex: none; color: var(--muted); text-align: center; font-size: 12px; }
.tr-name { flex: 1; min-width: 0; }
.tr-p { font-size: 12px; font-weight: 700; color: #fff; background: var(--fill-amber, #B87400); border-radius: 10px; min-width: 18px; padding: 0 6px; text-align: center; font-variant-numeric: tabular-nums; }
.tr-row.empty .tr-name { opacity: .55; }
.g-tree-btn, .g-tree-x, .g-tree-bd { display: none; }
.mtabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 12px; margin-bottom: 16px; overflow-x: auto; }
.mtab { flex: 1; border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.mtab.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.gstat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cmp-b { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.cmp-b .k { font-size: 12px; color: var(--muted); }
.cmp-b .v { font-size: 17px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.g-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 14px; }
.g-crumbs a { color: var(--muted); font-weight: 500; }
.g-crumbs a:hover { color: var(--blue); }
.g-crumbs b { color: var(--navy); }
.g-crumbs .sep { color: var(--muted); opacity: .6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 4px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); border-radius: 20px; padding: 5px 6px 5px 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.chip span { background: var(--surface-3); color: var(--muted); border-radius: 12px; padding: 0 7px; font-size: 12px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--blue-100); background: var(--blue-50); color: var(--fill-blue); }
:root[data-theme="dark"] .chip:hover { color: var(--blue); }
.chip.empty { opacity: .6; }
.tbl tr.grp-h td { background: var(--surface-2); padding-top: 9px; padding-bottom: 9px; font-size: 14px; font-weight: 700; border-top: 1px solid var(--line); }
.tbl tr.grp-h a { color: var(--navy); }
.it-hint { color: var(--muted); line-height: 1.45; }
.it-hint:empty { display: none; }
#gd-erp-btn svg { width: 16px; height: 16px; }

.menu-btn, .sb-backdrop { display: none; }

@media (max-width: 1180px) {
  .goods { grid-template-columns: 260px minmax(0, 1fr); }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-21, .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .info, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* Điện thoại: menu trượt từ trái, nội dung 1 cột */
@media (max-width: 768px) {
  body { font-size: 14px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; max-width: 86vw; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sb-edge { display: none; }
  .rq-drawer { width: 100vw; top: auto; height: 88vh; border-left: 0; border-radius: 18px 18px 0 0; animation: rq-up .22s ease; }
  .rq-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0, 10, 50, .4); }
  .rq-body { padding: 4px 16px 24px; }
  .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 10, 50, .45); backdrop-filter: blur(2px); animation: fade .15s ease; }
  .topbar { grid-column: 1; padding: 0 12px; gap: 8px; position: relative; min-width: 0; } /* min-width 0: cột lưới co theo màn hình, tên công ty tự rút gọn "…" thay vì đẩy trang tràn ngang */
  .main { min-width: 0; }
  .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand-line); }
  .menu-btn { display: grid; }
  .top-title { display: block; }
  .top-filter { display: none; }
  .iconbtn { width: 38px; height: 38px; border-radius: 11px; }
  .userchip { padding: 3px; border-radius: 12px; }
  .userchip > div { display: none; }
  .dropdown { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; }

  .main { grid-column: 1; padding: 16px 14px 96px; }
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .page-head .grow { min-width: 0; flex-basis: 100%; }
  .page-head > :not(.grow) { flex-wrap: wrap; }
  h1 { font-size: 21px; }
  .grid { gap: 12px; }
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g5 > .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .kpi { padding: 14px 14px 12px; }
  .kpi .v { font-size: 28px; }
  .card-h { padding: 13px 14px; flex-wrap: wrap; }
  .card-h h3 { min-width: 180px; }
  .card-b { padding: 13px 14px; }
  .info, .form-grid { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv .k { margin-top: 8px; }
  .cmp { grid-template-columns: 1fr; }
  .filters { padding: 12px 14px; }
  .filters .inp, .filters .sel, .filters .search { min-width: 0; width: 100%; flex: 1 1 100%; }
  .hbar { grid-template-columns: 96px 1fr 44px; gap: 8px; font-size: 12px; }

  /* Bảng: cuộn ngang trong khung, không đẩy cả trang */
  table.tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl th, .tbl td { padding: 10px 12px; }
  .tbl td { min-width: 92px; }
  .tbl td:first-child { min-width: 168px; }
  .tbl th.c-wide, .tbl th.c-name { min-width: 220px; }
  .tbl th.c-mid { min-width: 150px; }
  .ev .crit { min-width: 200px; }

  .stepper { padding: 18px 6px 8px; }
  .step { min-width: 88px; }
  .tabs { padding: 0 6px; }
  .tabs a { padding: 12px 10px; }
  .tl li { grid-template-columns: 84px 14px 1fr; gap: 8px; }
  .tl li:not(:last-child)::after { left: 96px; }
  .tl .t { white-space: normal; }

  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; display: flex; flex-direction: column; }
  .modal-b { overflow-y: auto; padding: 16px; }
  .modal-h, .modal-f { padding: 14px 16px; }
  .modal-f { flex-wrap: wrap; }

  .paper { padding: 22px 18px; font-size: 14px; }
  .phone-wrap { gap: 18px; }
  .phone { width: 100%; height: auto; background: none; padding: 0; border-radius: 0; box-shadow: none; }
  .phone .scr { height: auto; border-radius: 18px; overflow: visible; box-shadow: var(--shadow); border: 1px solid var(--line); }
  .phone .ph-top { padding-top: 22px; border-radius: 18px 18px 22px 22px; }
  .al-head { display: none; }
  .goods { grid-template-columns: minmax(0, 1fr); }
  .g-tree-btn { display: inline-flex; flex: none; }
  .goods .card-h:has(.g-tree-btn) { flex-wrap: wrap; gap: 10px; }
  .goods .card-h:has(.g-tree-btn) .g-crumbs { flex-basis: 100%; order: 3; }
  .g-tree { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); z-index: 60; border-radius: 0 16px 16px 0; overflow-y: auto; transform: translateX(-105%); transition: transform .2s ease; margin: 0; }
  .g-tree.open { transform: none; box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.25)); }
  .g-tree .card-h { position: sticky; top: 0; background: var(--card); z-index: 1; }
  .g-tree-x { display: inline-flex; }
  .g-tree-bd.open { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(0, 10, 40, .4); }
  .gstat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .al-row, .al-row:has(.al-unit:not([style*="none"])) { grid-template-columns: 1fr 96px 32px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
  .al-row .al-proj, .al-row .al-unit, .al-row .al-fund { grid-column: 1 / -1; }
  .main [style*="grid-template-columns"], .modal [style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }

  .demo-fab { right: 12px; bottom: 12px; }
  .demo-panel { left: 10px; right: 10px; top: 58px; width: auto; }
  .toast { bottom: 70px; width: calc(100vw - 24px); text-align: center; }
}

/* ---- Chờ duyệt ---- */
.ap-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 20px; background: var(--blue-50); border-bottom: 1px solid var(--line); font-size: 14px; }
.ap-bulk b { margin-right: auto; color: var(--fill-blue); }
:root[data-theme="dark"] .ap-bulk b { color: var(--blue); }
.tbl tr.sel td { background: var(--blue-50); }
.tbl td.nowrap { white-space: nowrap; }
.ap-drawer { width: 520px; }
.ap-cmp td, .ap-cmp th { font-size: 14px; vertical-align: top; }
.ap-cmp { width: 100%; table-layout: fixed; }
.ap-cmp td { overflow-wrap: anywhere; }
.ap-cmp .code { white-space: normal; word-break: break-all; }
.ap-cmp tr > :first-child { width: 104px; }
@media (max-width: 768px) { .ap-cmp tr > :first-child { width: 76px; } .ap-cmp td, .ap-cmp th { padding-left: 6px; padding-right: 6px; } }
.ap-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* ===== Cơ chế chuyển bước – BS11 ===== */
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.step.click { cursor: pointer; }
.step.click:hover .c { transform: scale(1.06); }
.step.sel .c { outline: 2px dashed var(--fill-blue); outline-offset: 4px; }
.gate { border-top: 1px solid var(--line); padding: 14px 16px 16px; }
.gate-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.gate-h h3 { margin: 0; font-size: 15px; }
.gate-k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gate-n { display: inline-block; width: 72px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.gate-n i { display: block; height: 100%; background: var(--fill-green); border-radius: 3px; }
.conds { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.cond { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.cond .ci { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.cond.ok .ci { background: var(--green-50); color: var(--green); }
.cond.miss .ci { background: var(--red-50); color: var(--red); }
.cond.warn .ci { background: var(--amber-50); color: var(--amber); }
.cond.ev .ci { background: var(--blue-50); color: var(--blue); }
.cond.na .ci { background: var(--surface-3); color: var(--muted); } /* chưa đủ dữ liệu để kiểm tra – không tính vào số điều kiện */
.cond.na .ct b { font-weight: 500; color: var(--muted); }
.cond.f { opacity: .8; }
.cond .ct { flex: 1; min-width: 0; }
.cond .ct b { font-weight: 600; }
.cond.ok .ct b { font-weight: 500; color: var(--text-2); }
.cond .ca { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.gate-f { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.gate-f .nx { flex: 1; min-width: 240px; font-size: 14px; }
@media (max-width: 900px) { .conds { grid-template-columns: 1fr; } .cond .ca { flex-direction: column; } }
/* Điện thoại: nút của điều kiện xuống dòng dưới nội dung, để chữ không bị ép hẹp */
@media (max-width: 768px) { .cond { flex-wrap: wrap; } .cond .ca { flex-basis: 100%; flex-direction: row; justify-content: flex-start; padding-left: 32px; } .cond .ca:empty { display: none; } }

/* ===== Cấu hình theo phiên bản – BS10 ===== */
.sel.sm-sel { padding: 5px 26px 5px 8px; font-size: 12px; min-height: 0; height: auto; width: auto; max-width: 220px; }
.sel.chg, .inp.chg { border-color: var(--fill-orange); box-shadow: 0 0 0 3px var(--orange-50); }
.sel.lv-hard { color: var(--red); font-weight: 700; } .sel.lv-soft { color: var(--amber); font-weight: 700; } .sel.lv-off { color: var(--muted); }
.tbl.fc td { vertical-align: top; }
.fc-row { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 14px; }
.fc-row .badge, .fc-row .sel { flex: none; min-width: 64px; justify-content: center; }
.fc-row.off span:last-child { text-decoration: line-through; color: var(--muted); }
.tbl.mx-new td { background: var(--orange-50); }
.tbl.fc td, .tbl.fc th { white-space: normal; }
.tbl.fc td:nth-child(2) { min-width: 150px; max-width: 190px; }
.tbl.fc td:nth-child(3) .sel, .tbl.fc td:nth-child(4) .sel { width: 158px; max-width: 158px; }
.tbl.fc td:nth-child(5) { min-width: 320px; }
.fc-row span:last-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tbl.fc th .u { white-space: normal; }
.cell-k.need { outline: 2px solid var(--fill-orange); outline-offset: 2px; animation: needPulse 1.6s ease-in-out 3; }
@keyframes needPulse { 50% { outline-color: transparent; } }
.ver.appr { border-color: color-mix(in srgb, var(--orange) 35%, transparent); background: var(--orange-50); color: var(--orange); }
/* Hộp ký trình / duyệt */
.apv { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.apv .paper { max-height: 52vh; overflow: auto; font-size: 14px; }
/* Nhóm trong hộp duyệt / hộp thẩm định: cùng quy chuẩn tiêu đề nhóm (dải nền nhạt, đậm 15px, viết thường) */
.apv-side h4 { display: flex; align-items: center; gap: 8px; background: var(--blue-50); border-radius: 8px; padding: 7px 12px; min-height: 36px; box-sizing: border-box; margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--navy); text-transform: none; letter-spacing: -.01em; }
.apv-doc { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.apv-doc .n { flex: 1; min-width: 0; }
@media (max-width: 900px) { .apv { grid-template-columns: 1fr; } }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 12px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--card); color: var(--blue); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08)); }
/* Thanh 10 bước: mỗi bước đúng 2 dòng (tên ngắn + ngày) */
.stepper { padding: 22px 8px 10px; }
.step { min-width: 96px; padding: 0 2px; }
.step .n, .step .d { white-space: nowrap; }
.step .n { font-size: 12px; }
/* Menu thu gọn: kéo số đếm và chấm SKG sát góc icon để cụm icon cân giữa */
.app.sb-mini .nav .cnt { top: 2px; right: 9px; }
.app.sb-mini .nav .skg-tag { top: 6px; right: 11px; width: 6px; height: 6px; }
.app.sb-mini .nav a:has(.cnt) .skg-tag { top: auto; bottom: 6px; }
/* Đường viền phải của menu vẽ ra ngoài (không chiếm 1px bên trong) – vạch thương hiệu, logo và icon cùng tâm 36px */
@media (min-width: 769px) { .sidebar { border-right: 0; box-shadow: 1px 0 0 var(--line); } }
/* Logo Hùng Hậu ở trên + slogan dưới tên phần mềm; logo Lục Giác ở chân menu */
.sb-brand .logo img { width: 34px; height: 34px; }
.sb-brand .t2.slogan { font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--text-2); }
.sb-foot .hh .pill.lg { width: 30px; height: 30px; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.sb-foot .hh .pill.lg img { width: 26px; height: 26px; object-fit: contain; }
.sb-foot .org { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.sb-foot .org b { font-size: 12px; font-weight: 700; color: var(--text-2); }
.sb-foot .org span { font-size: 12px; color: var(--muted); }
.app.sb-mini .sb-foot .org { display: none; }
.app.sb-mini .sb-foot .hh .pill.lg { width: 30px; height: 30px; }
.app.sb-mini .sb-foot .hh .pill.lg img { height: 26px; }

/* Phạm vi dữ liệu theo quyền (1.3) – nằm cùng dòng "Số liệu tại ngày …" (.page-head .sub) để tiết kiệm một dòng; màn hẹp tự xuống dòng */
.scope-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; vertical-align: middle; padding: 2px 10px; line-height: 1.4; border-radius: 999px; background: var(--blue-50); color: var(--blue); font-size: 12px; border: 1px solid color-mix(in srgb, var(--blue) 20%, transparent); }
.scope-chip b { font-weight: 700; }
@media (max-width: 768px) { .scope-chip { display: flex; width: fit-content; max-width: 100%; margin: 4px 0 0; } }

/* Biểu đồ bấm để lọc danh sách gói */
.hbar.click { cursor: pointer; border-radius: 8px; margin-left: -6px; margin-right: -6px; padding: 0 6px; transition: background .12s; }
.hbar.click:hover { background: var(--surface-2); }
.hbar.click:hover .lab { color: var(--blue); }
.hbar.zero { opacity: .5; }
.hbar .track i.seg { cursor: pointer; transition: filter .12s; }
.hbar .track i.seg:hover { filter: brightness(1.15) saturate(1.2); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.flt-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.flt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--blue-50); color: var(--blue); border: 1px solid color-mix(in srgb, var(--blue) 25%, transparent); font-size: 12px; font-weight: 600; text-decoration: none; }
.flt-chip b { font-size: 12px; opacity: .7; }
.flt-chip:hover { background: color-mix(in srgb, var(--blue) 14%, transparent); }
.flt-chip:hover b { opacity: 1; }

/* Bản chụp báo cáo tuần – tóm tắt thay đổi so với kỳ trước */
.chg-sum { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 900px) { .chg-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.chg-k { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); background: var(--card); transition: border-color .12s, background .12s; }
.chg-k b { font-family: var(--font-num); font-size: 22px; font-weight: 700; line-height: 1.1; }
.chg-k span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.chg-k:hover { border-color: var(--blue-100); background: var(--surface-2); }
.chg-k.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-50); }
.chg-k.zero { opacity: .5; }
.chg-k.b-red b { color: var(--red); } .chg-k.b-amber b { color: var(--amber); } .chg-k.b-green b { color: var(--green); } .chg-k.b-blue b { color: var(--blue); }
.chg-k.b-red, .chg-k.b-amber, .chg-k.b-green, .chg-k.b-blue, .chg-k.b-grey { background: var(--card); padding: 10px 12px; border-radius: 10px; font-weight: 400; }
.chg + .chg { margin-top: 4px; }
.tbl tr.grp td { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 600; }
.tbl tr.out td { opacity: .65; }

/* Bảng có cột sắp xếp (màn Dự án) */
.tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl th.sortable:hover { color: var(--blue); }
.tbl th.sortable.on { color: var(--blue); }
.tbl th .sort-ic { margin-left: 4px; font-size: 12px; opacity: .45; }
.tbl th.sortable.on .sort-ic { opacity: 1; }
.card > .filters:only-child { border-bottom: 0; }
.filters .chk { align-items: center; padding: 0; white-space: nowrap; }

/* Dòng phụ dưới tên gói: 1 dòng, cắt "…", xem đủ khi rê chuột */
.sub.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 0; min-width: 100%; } /* không kéo rộng cột, cắt theo độ rộng cột */

/* Bảng dài: cuộn trong khung cao bằng màn hình → thanh cuộn ngang luôn nhìn thấy; tiêu đề cột dính trên cùng */
.tbl-wrap { overflow: auto; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); scrollbar-width: thin; }
.tbl-wrap .tbl tr:first-child > th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }
/* Cột “Mã gói” dính bên trái khi cuộn ngang */
.tbl-wrap .tbl.sticky-col tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 1px 0 0 var(--line-2); }
.tbl-wrap .tbl.sticky-col tr:first-child > th:first-child { z-index: 3; background: var(--surface-2); }
.tbl-wrap .tbl.sticky-col tr.click:hover > td:first-child { background: linear-gradient(var(--blue-50), var(--blue-50)) var(--card); }
.tbl-wrap .tbl.sticky-col tr.grp > td:first-child { position: static; background: var(--surface-2); }
@media (max-width: 768px) {
  .tbl-wrap > table.tbl { display: table; overflow: visible; } /* khung ngoài lo cuộn, để tiêu đề / cột đầu dính đúng */
  .tbl-wrap { max-height: calc(100dvh - 120px); }
}

/* Mã nằm trên tên trong cùng một ô: mã là nhãn phụ (nhỏ, đậm nhẹ), tên là điểm nhấn duy nhất */
.tbl .code.code-sm { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; }

/* BS12 – đọc tự động bản ký (AI, giả lập) */
.inp.ai-low { background: var(--amber-50); border-color: color-mix(in srgb, var(--amber) 55%, transparent); }
.ai-words { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--blue-100); border-top-color: var(--blue); border-radius: 50%; vertical-align: -2px; margin-right: 6px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dòng chú thích ngay dưới thanh tab trong thẻ */
.card-sub { padding: 10px 20px; border-bottom: 1px solid var(--line-2); }
.tabs a .badge { margin-left: 6px; vertical-align: 1px; }

/* BS13 – đánh giá, xếp hạng NCC */
.rank.big { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; flex: none; }
.vr-top { display: flex; gap: 14px; align-items: center; }
.vr-total { font-family: var(--font-num); font-weight: 700; font-size: 18px; color: var(--navy); margin-bottom: 2px; }
.ve-form { display: flex; flex-direction: column; gap: 10px; }
.ve-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 170px minmax(0, 1.4fr); gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ve-row:last-child { border-bottom: 0; }
.ve-row .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
@media (max-width: 768px) { .ve-row { grid-template-columns: 1fr; } }

/* Cấu hình đánh giá NCC */
.ve-cfg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; align-items: start; }
.ve-cfg > :nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line-2); padding-top: 14px; }
.ve-cfg .kv { grid-template-columns: 170px 1fr; }
.ve-cfg .tbl td, .ve-cfg .tbl th { padding: 7px 8px; }
@media (max-width: 1180px) { .ve-cfg { grid-template-columns: 1fr; } }

/* Bảng điều khiển demo mở từ tên người dùng (đã bỏ nút nổi góc dưới) */
.userchip .caret { font-size: 12px; color: var(--muted); margin-left: 2px; transition: transform .15s; }
.userchip.on { border-color: var(--blue-100); box-shadow: 0 0 0 3px var(--blue-50); }
.userchip.on .caret { transform: rotate(180deg); }
.demo-backdrop { position: fixed; inset: 0; z-index: 30; background: transparent; }
.demo-panel { max-height: calc(100vh - 80px); overflow-y: auto; }
@media (max-width: 768px) { .userchip .caret { display: none; } }

/* Thanh 10 bước: mỗi bước rộng tối thiểu bằng chữ của nó + 16px đệm, chữ không bao giờ dính nhau;
   thiếu chỗ thì cuộn ngang. Đường nối kéo dài thêm để luôn liền khi các bước rộng không đều. */
.step { min-width: max-content; padding: 0 6px; } /* chữ hai bước liền nhau cách tối thiểu 12px */
@media (min-width: 769px) { .stepper { padding-left: 4px; padding-right: 4px; } }
.step::before { left: auto; right: 50%; width: calc(100% + 40px); }
/* Đường nối của bước 2 kéo dài thêm 40px để luôn liền → che phần thò ra bên trái bước đầu tiên */
.step:first-child::after { content: ""; position: absolute; top: 14px; left: 0; width: calc(50% - 18px); height: 9px; background: var(--card); z-index: 1; }
/* Ô số (kể cả vầng sáng 6px của bước hiện tại / trễ hạn) nằm trên miếng che → miếng che không cắt vầng sáng (lỗi “ô trắng cạnh B1”) */
.step:first-child .c { z-index: 2; }
/* Bước hiện tại đang trễ hạn (late) vẫn là bước đã tới → đường nối dẫn vào nó cũng tô xanh như bước hiện tại */
.step.late::before { background: var(--fill-green); }
/* Đoạn nối tới các bước chưa đến: xám đủ đậm để thấy rõ trên nền thẻ (cả sáng lẫn tối); đoạn đã tới vẫn xanh */
.step::before { background: color-mix(in srgb, var(--muted) 38%, var(--card)); }

/* Trang chi tiết gói: breadcrumb kiêm dòng mã gói (mã chỉ xuất hiện một lần) + nhãn trạng thái;
   nút thao tác neo góc phải trên cùng, tiêu đề dùng hết chiều ngang bên dưới */
.pd-top { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.pd-top > .row:first-child { flex-wrap: wrap; }
.pd-id { gap: 8px; }
.pd-id .crumbs { margin: 0; }
.pd-code { font-size: 15px; font-weight: 700; color: var(--blue); }
.pd-title { margin-top: 8px; }
.pd-actions { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }

/* Menu “Thao tác” trên trang chi tiết gói */
.act-menu { position: relative; }
.act-menu > .btn .caret { font-size: 12px; color: var(--muted); }
.act-menu > .btn.on { border-color: var(--blue-100); box-shadow: 0 0 0 3px var(--blue-50); }
.act-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 31; min-width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.act-list button { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.act-list button:hover { background: var(--surface-2); }
.act-list .ic { width: 20px; text-align: center; flex: none; }
.act-list b { display: block; font-size: 14px; }
.act-list .d { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

/* Thanh tab: chỉ cuộn ngang khi nhiều tab; không có thanh cuộn dọc (do gạch chân tab đang chọn lấn 1px xuống dưới) */
.tabs { overflow-y: hidden; scrollbar-width: thin; }

/* Hồ sơ bị trả lại để sửa */
.ret-flag { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.callout.ret-box { border-left: 4px solid var(--red); }

/* Phân quyền & Người dùng */
.pq-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1180px) { .pq-grid { grid-template-columns: 1fr; } }
.pq-roles { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.pq-role { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 11px 13px; cursor: pointer; font: inherit; color: var(--text); }
.pq-role:hover { border-color: var(--blue-100); }
.pq-role.on { border-color: var(--blue); background: var(--blue-50); box-shadow: 0 0 0 2px var(--blue-50); }
.pq-role .sub { font-size: 12px; color: var(--muted); }
.pq-tbl td.c, .pq-tbl th.c { text-align: center; width: 76px; }
.pq-tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--fill-green); }
.pq-list { display: flex; flex-direction: column; gap: 4px; }
.pq-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 8px; border-radius: 10px; cursor: pointer; }
.pq-item:hover { background: var(--surface-2); }
.pq-item b { display: block; font-size: 14px; }
.pq-item .sub { display: block; font-size: 12px; color: var(--muted); }
.pq-item input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--fill-green); }
.pq-units { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 16px; }

/* Màu theo bánh xe màu: không trộn xanh dương → xanh lá (lệch ~90°) thành dải trên dữ liệu.
   Thanh tiến độ = một màu xanh lá (phần đã xong); cam (bổ túc với xanh dương) làm màu nhấn cho việc cần làm. */
.bar > i { background: var(--fill-green); }
.nav .cnt { background: var(--orange); color: #1F1300; }
/* Mọi thanh / đoạn biểu thị “đã xong, đúng hạn” dùng cùng một xanh lá với thanh tiến độ */
.mini-steps i.done { background: var(--fill-green); }

/* Cột STT (chỉ bảng dạng biểu mẫu/báo cáo) – hẹp, số căn phải; bảng báo cáo giữ cố định cả STT và Mã gói khi cuộn ngang */
.tbl th.stt, .tbl td.stt { width: 44px; min-width: 44px; max-width: 44px; box-sizing: border-box; padding-left: 8px; padding-right: 8px; }
.tbl-wrap .tbl.sticky-col.stt tr > :first-child { box-shadow: none; }
.tbl-wrap .tbl.sticky-col.stt tr > :nth-child(2) { position: sticky; left: 44px; z-index: 1; background: var(--card); box-shadow: 1px 0 0 var(--line-2); }
.tbl-wrap .tbl.sticky-col.stt tr:first-child > th:nth-child(2) { z-index: 3; background: var(--surface-2); }
.tbl-wrap .tbl.sticky-col.stt tr.click:hover > td:nth-child(2) { background: linear-gradient(var(--blue-50), var(--blue-50)) var(--card); }

/* Điện thoại: bảng trả lại và màn hình kết quả hiển thị ngay trong khung điện thoại */
.phone .scr:has(.ph-ov) { overflow: hidden; }
.phone .ph-ov { position: absolute; inset: 0; background: rgba(5, 8, 26, .45); display: flex; align-items: flex-end; z-index: 5; border-radius: inherit; animation: pop .15s ease; }
.phone .ph-sheet { background: var(--card); width: 100%; border-radius: 22px 22px 0 0; padding: 10px 16px 22px; max-height: 88%; overflow-y: auto; box-shadow: 0 -8px 24px rgba(0, 0, 0, .18); }
.phone .ph-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.phone .ph-chips { display: flex; flex-direction: column; gap: 6px; }
.phone .ph-chip { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; cursor: pointer; }
.phone .ph-chip:has(input:checked) { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--card)); font-weight: 600; }
.phone .ph-chip input { accent-color: var(--red); margin: 0; }
.phone .ph-sheet textarea { width: 100%; box-sizing: border-box; resize: none; }
.phone .ph-done { text-align: center; padding: 36px 24px; }
.phone .ph-done .ic { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 28px; color: #fff; }
.phone .ph-done .ic.ok { background: var(--fill-green, #2F7D2E); }
.phone .ph-done .ic.ret { background: var(--red); }
@media (max-width: 768px) { .phone .ph-ov { position: fixed; border-radius: 0; z-index: 60; } }

/* Giải thích trạng thái & phiên bản tài liệu (icon ⓘ ở tiêu đề “Tài liệu trình”) */
.vh-btn { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 4px; padding: 0; border-radius: 50%; border: 1px solid currentColor; background: transparent; color: var(--muted); font: italic 700 10.5px/1 Georgia, serif; text-transform: none; cursor: pointer; vertical-align: 1px; }
.vh-btn:hover, .vh-btn:focus-visible { color: var(--blue); background: var(--blue-50); outline: none; }
.vh-pop { position: fixed; z-index: 90; width: min(380px, calc(100vw - 16px)); background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 16px; font-size: 14px; line-height: 1.45; animation: pop .15s ease; text-align: left; white-space: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }
.vh-pop .vh-h { font-weight: 700; margin-bottom: 8px; }
.vh-pop .vh-r { display: grid; grid-template-columns: 82px 1fr; gap: 8px; align-items: center; margin-bottom: 4px; }
.vh-pop .vh-r .ver { justify-content: center; margin: 0; }
.vh-pop .vh-n { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); }
.vh-pop .vh-n b { color: var(--text); }

/* ======================= Bố cục gọn (29/11/2026) =======================
   Ứng dụng quản lý cần chỗ cho dữ liệu: bớt khoảng trắng, giữ cỡ chữ 14px để chiếu demo vẫn rõ.
   Chỉ áp cho máy tính; giao diện điện thoại giữ nguyên. */
@media (min-width: 769px) {
  .app { grid-template-rows: 52px 1fr; }
  .topbar { padding: 0 20px; gap: 12px; }
  .iconbtn { width: 34px; height: 34px; border-radius: 10px; }
  .iconbtn svg { width: 17px; height: 17px; }
  .userchip { padding: 2px 10px 2px 2px; border-radius: 12px; }
  .avatar { width: 28px; height: 28px; border-radius: 9px; }
  .top-filter { padding: 3px 4px 3px 10px; border-radius: 10px; }
  .top-filter select { padding: 3px 8px; }

  .sb-brand { padding: 8px 16px; min-height: 52px; }
  .sb-brand .logo { width: 34px; height: 34px; border-radius: 9px; }
  .sb-brand .logo img { width: 30px; height: 30px; }
  .sb-edge { top: 14px; }
  .sidebar .grp { margin: 12px 10px 4px; }
  .nav a { padding: 6px 12px; }
  .sb-foot { padding: 6px 12px; }

  .main { padding: 14px 20px 48px; }
  .page-head { margin-bottom: 12px; gap: 12px; align-items: center; }
  h1 { font-size: 20px; }
  .page-head .sub { margin-top: 1px; font-size: 14px; }
  .crumbs { margin-bottom: 4px; }

  .card-h { padding: 10px 14px; }
  .card-b { padding: 12px 14px; }
  .card-sub { padding: 8px 14px; }
  .grid { gap: 12px; }
  .mb16 { margin-bottom: 12px; }
  .mt16 { margin-top: 12px; }
  .mt8 { margin-top: 4px; }
  .kpi { padding: 12px 14px 10px; }
  .kpi .v { font-size: 28px; margin-top: 2px; }
  .callout { padding: 9px 12px; }
  .tabs { padding: 0 10px; }
  .tabs a { padding: 9px 12px; }
  .seg { padding: 3px; }
  .seg button { padding: 5px 12px; }

  .filters { padding: 8px 12px; gap: 8px; }
  .filters .inp, .filters .sel { padding-top: 6px; padding-bottom: 6px; }
  .btn { padding: 0 14px; }
  .inp, .sel, .ta { padding-top: 7px; padding-bottom: 7px; }

  .tbl th { padding: 7px 10px; }
  .tbl td { padding: 7px 10px; }
  .tbl tr.grp-h td { padding-top: 6px; padding-bottom: 6px; }
  .tbl-wrap { max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); }
  .tbl .nm { font-weight: 600; }
  .tbl td.nw { white-space: nowrap; }
}
.tbl .cell1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 0; min-width: 100%; } /* không kéo rộng cột */

/* Việc của tôi: một hàng tab gắn với bảng (không lồng tab trong tab); bộ lọc phụ là chip, nằm cùng hàng */
.mw-bar { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding-right: 12px; flex-wrap: wrap; }
.mw-bar .tabs { border-bottom: 0; flex: 1 1 auto; min-width: 0; }
.mw-bar .mw-one { flex: 1; padding: 10px 14px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.tabs a.zero { opacity: .55; }
.tabs a .skg-tag { margin-left: 4px; vertical-align: 1px; }
.mw-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 0; }
.mw-chips .chip { padding: 3px 5px 3px 10px; font-size: 12px; font: inherit; font-size: 12px; font-weight: 600; }
.chip.on { border-color: var(--fill-blue); background: var(--blue-50); color: var(--fill-blue); }
:root[data-theme="dark"] .chip.on { color: var(--blue); }
.chip.on span { background: var(--fill-blue); color: #fff; }

/* Việc của tôi – bảng “Cần xử lý”: cột Việc cần làm (nhãn loại việc + việc, 1 dòng) */
.task-tbl .task-l { display: flex; align-items: center; gap: 8px; width: 0; min-width: 100%; } /* không kéo rộng cột */
.task-tbl .task-l .badge { flex: none; }
.task-tbl .task-l .cell1 { flex: 1 1 0; width: 0; min-width: 0; }
.task-tbl tr.task-ret td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.task-tbl tr.task-ready td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.task-tbl th:first-child { width: 40%; }  /* cột quan trọng nhất được nhiều chỗ nhất */
.task-tbl th:nth-child(2) { width: 22%; min-width: 160px; }

/* Hộp Sửa & trình lại */
.fx-h { font-weight: 700; color: var(--navy); margin: 14px 0 8px; }
.fx-doc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.fx-doc .fx-n { flex: 1; min-width: 0; }
.fx-doc label.btn { cursor: pointer; white-space: nowrap; }
.fx-doc label.fx-ok { border-color: var(--green); color: var(--green-600); background: var(--green-50); }
.ret-box { align-items: center; }

/* Mẫu quy trình (BS02) */
.b-purple { background: rgba(124, 58, 237, .10); color: #6d28d9; }
:root[data-theme="dark"] .b-purple { background: rgba(196, 181, 253, .14); color: #c4b5fd; }
.step.na .c { border-style: dashed; opacity: .45; }
.step.na .n, .step.na .d { opacity: .5; font-style: italic; }
.mini-steps i.na { background: transparent; outline: 1px dashed var(--line); outline-offset: -1px; }
.tpl-steps { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; }
.tpl-steps span.na { opacity: .45; text-decoration: line-through; }

/* Ô nhập tiền / số: canh phải, chữ số đều */
.inp.num { text-align: right; font-variant-numeric: tabular-nums; }
.it-edit textarea.it-spec { min-width: 200px; resize: vertical; font: inherit; line-height: 1.4; }
.it-edit .it-price { min-width: 130px; }
/* Ô gợi ý hàng hóa (thay datalist) */
.g-sug { position: fixed; z-index: 2000; display: none; max-height: 320px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); padding: 4px; }
.g-sug .it { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.g-sug .it:hover, .g-sug .it.on { background: var(--blue-50); }
.it-foot { flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.it-foot label { display: inline-flex; gap: 6px; align-items: center; }
.sm-inp { width: 140px; padding: 6px 10px; }
.row.it-foot > label { display: inline-flex; flex-direction: row; white-space: nowrap; margin: 0; font-weight: 500; }

/* ===== Tạo gói thầu – 3 tab, thanh nút cố định ===== */
.cf-card { overflow: visible; }
.cf-tabs { align-items: center; }
.cf-tabs .cf-req { padding-right: 6px; } .cf-req .req, .cf-sec .req { color: var(--red); }
.cf-pane { display: none; padding: 4px 20px 20px; }
.cf-pane.on { display: block; }
.cf-sec { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.cf-sec h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; }
:root[data-theme="dark"] .cf-sec h4 { color: var(--text); }
.form-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid.g4 .span4 { grid-column: 1 / -1; }
@media (max-width: 1100px) { .form-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid.g4 .span3 { grid-column: 1 / -1; } }
@media (max-width: 640px) { .form-grid.g4 { grid-template-columns: 1fr; } .form-grid.g4 .span2 { grid-column: auto; } }
/* Form 2 cột (vd popup Điều chỉnh giá): .g2 chung bị .form-grid (3 cột, khai báo sau) đè → ô span2 chỉ chiếm 2/3, chừa trống bên phải */
.form-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Ô tải tệp bản ký căn cứ (popup Điều chỉnh giá) */
.ap-up { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ap-up .ap-file { cursor: pointer; max-width: 100%; }
.ap-up .ap-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-up .ap-file.fx-ok { border-color: var(--green); color: var(--green-600); background: var(--green-50); }
.ap-up .ap-file.err { border-color: var(--red); color: var(--red); background: var(--red-50); }
@media (max-width: 640px) { .form-grid.g2 { grid-template-columns: 1fr; } }
.field label .lbl-r { float: right; font-weight: 500; color: var(--muted); }
.inp-grp { display: flex; gap: 6px; } .inp-grp .inp { flex: 1; min-width: 0; } .inp-grp .sel { width: 74px; flex: none; }
.cf-sla { min-height: 38px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; background: var(--blue-50); font-size: 14px; }
.cf-tg { min-height: 38px; display: flex; align-items: center; }
.cf-seg { display: flex; padding: 3px; } .cf-seg label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.cf-seg label:has(input:checked) { background: var(--card); color: var(--blue); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.08)); }
.cf-seg input { accent-color: var(--blue); }
@media (max-width: 768px) { .cf-seg { flex-wrap: wrap; } .cf-seg label { flex: 1 1 auto; } }
.cf-code { align-self: center; font-size: 14px; color: var(--muted); background: var(--surface-3); border-radius: 10px; padding: 7px 12px; cursor: help; }
.cf-code b { color: var(--navy); font-size: 14px; margin-left: 4px; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .cf-code b { color: var(--text); }
.cf-tplnote { background: var(--blue-50); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.tpl-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.tpl-flow .st { background: var(--card); border: 1px solid var(--blue-100); border-radius: 8px; padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.tpl-flow .st b { color: var(--blue); margin-right: 2px; }
.tpl-flow .st.na { opacity: .45; text-decoration: line-through; border-style: dashed; }
.tpl-flow .arr { color: var(--blue); font-weight: 700; padding: 0 3px; }
.cf-foot { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -6px 18px rgba(0, 0, 0, .06); }
/* Hồ sơ đính kèm theo loại */
.att-tbl td { vertical-align: middle; }
.att-row.drag td { background: var(--blue-50); outline: 2px dashed var(--blue-100); outline-offset: -2px; }
.att-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.att-f { display: inline-flex; align-items: center; gap: 4px; max-width: 260px; background: var(--surface-3); border-radius: 8px; padding: 3px 4px 3px 8px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-up { cursor: pointer; }
/* Tiêu đề cột bảng nhập hàng hóa không xuống dòng */
.it-edit th { white-space: nowrap; }
.it-edit .it-uom { min-width: 96px; }
.cf-code b.pending { color: var(--muted); font-weight: 500; font-size: 14px; font-style: italic; }
.att-tbl .att-type { min-width: 0; width: 100%; }
.att-type.empty { color: var(--muted); }
.inp.ai-fill { background: var(--blue-50); border-color: var(--blue-100); }
.att-ai { margin-top: 6px; font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.att-ai.ok { color: var(--green-600); }
.att-warn td { padding-top: 0 !important; font-size: 12px; color: var(--red); border-top: 0 !important; }
.att-tbl input.inp { min-width: 0; }
.att-sub td { padding-top: 0 !important; border-top: 0 !important; }
.att-sub .att-ai { margin-top: 0; }
.att-row:has(+ .att-sub) td, .att-row:has(+ .att-warn) td { border-bottom: 0; }
.att-tbl .req, .hint .req { color: var(--red); font-weight: 700; }
.cf-slacap { padding: 0 20px 12px; text-align: center; }

/* ===== Timeline tiến độ gói ===== */
.tl { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tl-grid { position: relative; }
.tl-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 150px; align-items: center; gap: 0 12px; min-height: 28px; }
.tl-row + .tl-row { border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); }
.tl-row.cur { background: var(--blue-50); border-radius: 6px; }
.tl-lab { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 6px; }
.tl-lab b { color: var(--blue); margin-right: 4px; }
.tl-trk { position: relative; height: 24px; }
.tl-st { white-space: nowrap; }
.tl-plan, .tl-act, .tl-pause { position: absolute; border-radius: 4px; }
.tl-plan { top: 4px; height: 16px; background: var(--blue-100); opacity: .75; }
.tl-act { top: 8px; height: 8px; }
.tl-act.ok { background: var(--fill-green, #2e9e4f); }
.tl-act.late { background: var(--red); }
.tl-act.cur { background: var(--fill-blue, var(--blue)); }
.tl-pause { top: 4px; height: 16px; background: repeating-linear-gradient(45deg, rgba(120, 120, 120, .45) 0 4px, transparent 4px 8px); }
.tl-ret { position: absolute; top: 1px; transform: translateX(-50%); font-weight: 700; color: var(--orange, #e67e22); font-size: 14px; cursor: help; }
.tl-dia { position: absolute; top: 6px; width: 11px; height: 11px; transform: translateX(-50%) rotate(45deg); border: 2px solid var(--navy); background: var(--navy); cursor: help; }
.tl-dia.ok { background: var(--fill-green, #2e9e4f); border-color: var(--fill-green, #2e9e4f); }
.tl-dia.late { background: var(--red); border-color: var(--red); }
.tl-dia.open { background: var(--card); }
.tl-dia.late.open { background: var(--card); border-color: var(--red); }
.tl-axis { min-height: 20px; border: 0 !important; }
.tl-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.tl-tick span { position: absolute; top: 2px; left: 3px; font-size: 12px; color: var(--muted); font-style: normal; white-space: nowrap; }
.tl-over { position: absolute; inset: 0; display: grid; grid-template-columns: 170px minmax(0, 1fr) 150px; gap: 0 12px; pointer-events: none; }
.tl-over .tl-trk { height: auto; }
.tl-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--red); }
.tl-today span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--red); font-style: normal; white-space: nowrap; background: var(--card); padding: 0 3px; }
.tl .t-red { color: var(--red); font-weight: 600; } .tl .t-green { color: var(--green-600, #2e7d32); } .tl .t-blue { color: var(--blue); font-weight: 600; }
.tl .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 22px; color: var(--muted); }
.tl .legend .lg { display: inline-block; width: 18px; height: 8px; border-radius: 3px; margin-right: 6px; vertical-align: 1px; }
.lg.plan { background: var(--blue-100); height: 12px !important; } .lg.ok { background: var(--fill-green, #2e9e4f); } .lg.late { background: var(--red); } .lg.cur { background: var(--fill-blue, var(--blue)); }
.lg.pause { background: repeating-linear-gradient(45deg, rgba(120, 120, 120, .45) 0 3px, transparent 3px 6px); height: 12px !important; } .lg.today { width: 2px !important; height: 12px !important; background: var(--red); }
@media (max-width: 760px) { .tl-row, .tl-over { grid-template-columns: 92px minmax(0, 1fr) 0; } .tl-st { display: none; } }
.tl-pause { border: 1px solid rgba(120,120,120,.6); z-index: 1; }
/* ===== QUY CHUẨN TIÊU ĐỀ NHÓM – dùng chung toàn ứng dụng =====
   Mọi tiêu đề của một nhóm thông tin là MỘT DẢI NỀN NHẠT cả dòng, chữ đậm 15px viết thường, màu --navy;
   nút / nhãn / mô tả của nhóm nằm trong dải. Áp cho:
   .card-h  tiêu đề thẻ (dải liền mép trên của thẻ)      .sec-h   tiêu đề mục bên trong thân thẻ / tab
   .cf-sec  nhóm trường ở màn Tạo / Sửa gói               .gate-h  khối "Bước hiện tại" trên trang gói
   .dl-act-h nhóm con trong thẻ Tổng quan                 .fx-h    nhóm trong popup
   Không tạo kiểu tiêu đề nhóm riêng cho từng màn – dùng một trong các lớp trên. */
.cf-sec, .sec-h, .gate-h, .dl-act-h, .fx-h { display: flex; align-items: center; gap: 8px; background: var(--blue-50); border: 0; border-radius: 8px; padding: 7px 12px; min-height: 38px; box-sizing: border-box; }
.cf-sec { padding: 0 12px; margin: 22px 0 12px; }
.sec-h, .gate-h, .fx-h { margin: 0 0 10px; }
.sec-h.mt16, .fx-h:not(:first-child) { margin-top: 22px; }
.dl-act-h { justify-content: space-between; margin: 0 0 6px; }
.cf-pane > .cf-sec:first-child { margin-top: 14px; }
.card-h { background: var(--blue-50); border-bottom: 1px solid var(--line-2); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.g-tree .card-h { background: linear-gradient(var(--blue-50), var(--blue-50)), var(--card); }
/* Khối tiêu đề (h3 + mô tả) chiếm phần trái; ghi chú / nhãn phụ dồn phải, canh phải */
.card-h > div:first-child { flex: 1; min-width: 0; }
.card-h > .small:last-child:not(:first-child) { text-align: right; max-width: 45%; }
.cf-sec h4, .sec-h h3, h3.sec-h, .gate-h h3, .card-h h3, .dl-act-h b, .fx-h { margin: 0; font-size: 15px; font-weight: 700; color: var(--navy); text-transform: none; letter-spacing: -.01em; }
.sec-h .small { margin-top: 2px; }
/* Đầu trang chi tiết (gói, nhà thầu, kỳ báo cáo, tạo / sửa gói): dòng breadcrumb + mã + nhãn, nút neo góc phải; tiêu đề lớn bên dưới */
.row.pd-title { gap: 10px; flex-wrap: nowrap; }
.row.pd-title h1 { min-width: 0; }
a.pd-code:hover { text-decoration: underline; }
.pd-id .cf-code { padding: 3px 10px; font-size: 13px; }
/* Thanh nút màn Tạo gói: dính sát đáy màn hình, tràn hết bề ngang vùng nội dung (bù phần đệm của .main) */
@media (min-width: 769px) {
  .cf-foot { bottom: -48px; margin: 16px -20px -48px; padding: 12px 20px; border-radius: 0; border-width: 1px 0 0; box-shadow: 0 -4px 14px rgba(0, 0, 0, .06); }
}
@media (max-width: 768px) { .cf-foot { margin: 16px -14px 0; border-radius: 0; border-width: 1px 0 0; } }
/* Thanh nút cố định dùng chung: cao bằng chân menu trái để hai đường kẻ thẳng hàng */
:root { --foot-h: 52px; }
.sb-foot { height: var(--foot-h); box-sizing: border-box; padding-top: 0; padding-bottom: 0; display: flex; flex-direction: column; justify-content: center; flex: none; }
.act-bar .ab-l { color: var(--text-2); display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 769px) { .act-bar { height: var(--foot-h); box-sizing: border-box; padding-top: 0; padding-bottom: 0; } }
/* Trang có thanh nút: .main thành cột flex để thanh luôn nằm sát đáy kể cả khi nội dung ngắn (tab Hàng hóa, Hồ sơ đính kèm…) */
.main:has(> .act-bar) { display: flex; flex-direction: column; }
.main:has(> .act-bar) > * { flex-shrink: 0; }
.main:has(> .act-bar) > .act-bar { margin-top: auto; }
/* Hộp thoại nhập danh mục từ file */
.imp-modal { width: min(760px, 100%); }
.imp-tpl { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.imp-tpl:hover { border-color: var(--blue-100); background: var(--blue-50); }
.imp-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.imp-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.imp-or::before, .imp-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 16px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.imp-drop:hover, .imp-drop.drag { border-color: var(--blue); background: var(--blue-50); }
.imp-up { font-size: 22px; color: var(--muted); }
.imp-reading { padding: 40px 0; text-align: center; }
.imp-warn td { background: var(--amber-50); }
#imp-ov { z-index: 60; }
/* Tiêu đề nhóm: cao cố định, có nút hay không đều bằng nhau; nút trong tiêu đề thu gọn */
.cf-sec { height: 38px; box-sizing: border-box; padding-top: 0; padding-bottom: 0; flex-wrap: nowrap; }
.cf-sec > .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.att-dt { display: flex; gap: 6px; align-items: center; } .att-dt .inp { flex: 1; min-width: 0; }
.att-ok { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 0; background: var(--fill-blue, var(--blue)); color: #fff; font-weight: 700; cursor: pointer; }
.att-ok:hover { filter: brightness(1.1); }
.att-tbl th .vh-btn { cursor: help; vertical-align: 1px; }
/* Hồ sơ đính kèm: tệp và nút thêm tệp trên cùng một dòng – các hàng đều nhau */
.att-files { flex-wrap: nowrap; min-width: 0; }
.att-f { flex: 0 1 auto; min-width: 0; max-width: 220px; }
.att-up { flex: none; white-space: nowrap; }
.att-up.more { width: 28px; height: 28px; padding: 0; justify-content: center; font-size: 15px; }
.att-tbl td { height: 52px; }
.att-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-tbl th { white-space: nowrap; }

/* Ô chỉ hiển thị – giá trị tự xác định (vd. Mẫu quy trình theo hình thức lựa chọn, BS02) */
.ro-val { display: flex; align-items: center; gap: 8px; min-height: 40px; box-sizing: border-box; padding: 7px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text-2); min-width: 0; cursor: default; }
.ro-val .badge { flex: none; }
.ro-val .ro-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sửa thông tin gói (5.9): trường khóa từ B2, ô lỗi của textarea */
.inp:disabled, .sel:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.ta.err { border-color: var(--red); background: var(--red-50); }

/* Nút khắc phục cạnh điều kiện chưa đạt: chữ 14px, có viền để nhận ra là nút */
.btn.sm.cond-fix { color: var(--blue); border-color: var(--blue-100); background: var(--card); }
.btn.sm.cond-fix:hover { background: var(--blue-50); border-color: var(--blue); }
/* Cột thao tác trong bảng: nút duy nhất của mỗi dòng giãn bằng nhau theo nút dài nhất – thẳng cột, không lởm chởm */
.tbl td:last-child > .btn:only-child { width: 100%; }
/* ===== QUY CHUẨN GIẢI THÍCH NGHIỆP VỤ: ⓘ bấm hiện popover (tip() trong app.js) – không đặt đoạn giải thích trên màn hình ===== */
.tip-btn { flex: none; margin-left: 6px; vertical-align: 2px; font-weight: 700; letter-spacing: 0; }
h1 .tip-btn, h2 .tip-btn, h3 .tip-btn, h4 .tip-btn { color: var(--muted); }
.vh-pop .tip-t { font-size: 14px; line-height: 1.55; font-weight: 400; color: var(--text); }
.vh-pop .tip-t .ver { margin: 1px 0; }
/* QUY CHUẨN TAB: ⓘ cạnh tên tab đang chọn; thanh công cụ của tab (nút / nhãn) căn phải đầu nội dung, không nền */
.tab-tip { display: inline-flex; align-items: center; }
.tab-tip .tip-btn { margin-left: 6px; color: inherit; }
.tab-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; min-height: 36px; }
.tab-tools .tip-btn { margin-left: -2px; }
.tab-tools-l { margin-right: auto; color: var(--muted); font-weight: 600; }
.sub-line { color: var(--muted); margin: -4px 0 12px; }
/* ===== QUY CHUẨN LƯỚI HÀNG HÓA (xem & nhập dùng chung itemsHead / itemsSumHtml) ===== */
.tbl.items { counter-reset: itr; }
.tbl.items tr.it-row { counter-increment: itr; }
.tbl.items td.it-stt::before { content: counter(itr); }
.tbl.items .c-stt { width: 44px; }
.tbl.items .c-lot { width: 64px; }
.tbl.it-edit td.it-stt { padding-top: 14px; }
.tbl.items td.it-spec-v { color: var(--text-2); white-space: pre-line; }
.it-sum { text-align: right; font-size: 13px; margin-top: 10px; display: grid; gap: 4px; justify-items: end; }
.it-sum b { font-variant-numeric: tabular-nums; }
.it-lots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 18px; color: var(--muted); }
.it-lots b { color: var(--text); }
/* Hộp ghi ý kiến / thẩm định: kết luận 3 mức dạng lựa chọn viên thuốc, cam kết BS03 */
.rv-concl { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-opt { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13px; background: var(--card); }
.rv-opt:has(input:checked) { border-color: var(--fill-blue); background: var(--blue-50); color: var(--fill-blue); }
.rv-opt:has(input[value="Không thống nhất"]:checked) { border-color: var(--red); background: var(--red-50); color: var(--red); }
.rv-coi { align-items: flex-start; font-size: 13px; }

/* ===== QUY CHUẨN CỔNG NHÀ CUNG CẤP (BS01 – layoutVendor trong app.js): vỏ riêng cho người dùng bên ngoài –
   thanh trên mang nhận diện Lục Giác + menu ngang, không có sidebar / chuông / Trợ lý AI của phần mềm nội bộ. Nội dung dùng chung các lớp .page-head, .card, .tbl. ===== */
.vp { min-height: 100vh; background: var(--bg); }
.vp-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; background: var(--card); border-bottom: 1px solid var(--line); }
.vp-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand-line); }
.vp-top .spacer { flex: 1; }
.vp-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.vp-brand img { height: 36px; width: auto; }
.vp-brand .t1 { font-weight: 700; color: var(--navy); font-size: 15px; line-height: 1.2; }
.vp-brand .t2 { font-size: 12px; color: var(--muted); }
.vp-nav { display: flex; gap: 4px; margin-left: 16px; }
.vp-nav a { padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.vp-nav a:hover, .vp-nav a.active { background: var(--blue-50); color: var(--fill-blue); text-decoration: none; }
:root[data-theme="dark"] .vp-nav a:hover, :root[data-theme="dark"] .vp-nav a.active { color: var(--blue); }
.vp-main { max-width: 1240px; margin: 0 auto; padding: 24px 28px 48px; }
.vp-price { width: 150px; text-align: right; margin-left: auto; }
.vp-submit { justify-content: flex-end; gap: 8px; }
.vp-qa { padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; line-height: 1.5; }
.vp-qa:last-of-type { border-bottom: 0; }
@media (max-width: 768px) {
  .vp-top { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .vp-brand .t2, .vp-top .userchip > div { display: none; }
  .vp-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .vp-main { padding: 16px 12px 40px; }
  .vp-price { width: 110px; }
}
