/* /chung/giao-dien/thanh-phan.css — lớp giao diện mới chung cho mọi app: nút nổi, rail + menu phụ, ô Tìm chức năng, KPI, danh sách dạng bảng, Tiện ích, form nhãn trên ô, cột Thao tác + ⋯, ô số có đơn vị. Tách từ vanphong/tg5.css (NV-GD-CHUNG-1). Màu chủ đạo đọc biến ở bien.css. */
/* vanphong/tg5.css — giao diện mới Văn phòng số (NV-VP-NUT-THUHOI-1 Đợt 3, anh Quỳnh duyệt 31/10/2026 12:15). Nạp sau tg4.css.
   Góc vuông nhẹ 4–6px · nút 3D · KPI phương án 2 · hàng nút / chip cùng chiều cao · danh sách dạng bảng lưới · màn ký bản gọn. Màu chỉ đọc var(--m-*). */
:root{--tg2-rail:88px}
body.tg2{background:var(--m-bg)}
/* ═══ Nút, chip, ô: góc 4–6px, nút nhìn rõ là nút ═══ */
.tg2-btn{border-radius:5px;min-height:36px;box-sizing:border-box}
.tg2-btn.tg2-sm{min-height:32px}
.tg2-pri{background:linear-gradient(180deg,var(--m-pl2),var(--m-pd));box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 3px 0 var(--m-pdd),0 5px 10px -5px rgba(var(--m-bong-rgb),.5)}
.tg2-pri:active:not(:disabled){transform:translateY(2px);box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 1px 0 var(--m-pdd)}
.tg2-sec{background:linear-gradient(180deg,#fff,var(--m-nut-phu));color:var(--m-tx2);border:1px solid var(--m-vien);box-shadow:0 2px 0 var(--m-vien)}
.tg2-sec:hover:not(:disabled){background:var(--m-plt)}
.tg2-sec:active:not(:disabled),.tg2-warn:active:not(:disabled){transform:translateY(1px);box-shadow:0 1px 0 var(--m-vien)}
.tg2-warn{background:linear-gradient(180deg,#fff,#FEF7F7);color:#B4322C;border:1px solid #E9BDBA;box-shadow:0 2px 0 #E9BDBA}
.tg2-ok{background:linear-gradient(180deg,#2B9A62,#1C7A3E);box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 3px 0 #155F30}
.tg2-chip{border-radius:5px;min-height:36px;box-sizing:border-box;padding:6px 14px;border:1px solid var(--m-vien);color:var(--m-tx2);box-shadow:0 2px 0 var(--m-line)}
.tg2-chip.on{background:linear-gradient(180deg,var(--m-pl2),var(--m-pd));border-color:var(--m-pd);box-shadow:0 2px 0 var(--m-pdd)}
.tg2-chip em{border-radius:3px;background:var(--m-plt);color:var(--m-pd)}
.tg2-chips{gap:8px;align-items:stretch}
.tg2-o,.tg2-card,.tg2-khoi,.tg2-inf,.tg2-wt,.tg2-hop,.tg2-sheet,.tg2-ds-khung,.tg2-tkm,.tg2-tep{border-radius:6px}
input.tg2-o,select.tg2-o,textarea.tg2-o{border-radius:5px}
/* Nhãn trạng thái theo mẫu */
.tg2-b-te{background:#E6F6EC;color:#1C7A3E}.tg2-b-am{background:#FFF3DF;color:#A15C00}.tg2-b-ro{background:#FDECEC;color:#B4322C}.tg2-b-bl,.tg2-b-pl{background:var(--m-plt);color:var(--m-pd)}.tg2-b-vi{background:var(--m-chamt);color:var(--m-cham)}
/* ═══ Rail + panel ═══ */
@media (min-width:768px){
  .tg2-app{padding-top:var(--dau-cao)}
  .tg2-rail{width:var(--tg2-rail);padding:12px 6px;gap:2px}
  .tg2-wrap:not(.tg2-khong-pn) .tg2-pnl{left:var(--tg2-rail)}
}
.tg2-plus{border-radius:6px;background:linear-gradient(180deg,var(--m-pl2),var(--m-pd));box-shadow:0 4px 0 var(--m-pdd),0 7px 12px -4px rgba(var(--m-bong-rgb),.4);margin-bottom:10px}
.tg2-plus:active{transform:translateY(2px);box-shadow:0 2px 0 var(--m-pdd)}
.tg2-ra{border-radius:6px;color:var(--m-tx);white-space:normal;padding:8px 2px;min-height:56px;box-sizing:border-box;justify-content:center}
.tg2-ra .tg2-i{color:var(--m-mu)}
.tg2-ra.on{background:var(--m-plt);color:var(--m-pd);font-weight:700}.tg2-ra.on .tg2-i{color:var(--m-pl)}
.tg2-ra .tg2-dt{background:#C2332D;border-radius:4px;right:8px}
.tg2-pnl{background:#fff}
.tg2-pnl .tg2-g{text-align:left;align-items:flex-start;display:block;font-size:12.5px;color:var(--m-mu)}
a.tg2-k{text-decoration:none}a.tg2-k *{text-decoration:none}
.tg2-pnl a{border-radius:5px;color:var(--m-tx2)}
.tg2-pnl a.on{background:linear-gradient(90deg,var(--m-pl),var(--m-pl2));color:#fff;font-weight:700;box-shadow:0 2px 0 var(--m-pdd)}
.tg2-pnl a.on .tg2-i{color:#fff}
.tg2-pnl a.on .tg2-ct{background:#fff;color:var(--m-pd)}
.tg2-pnl a .tg2-ct{border-radius:4px}
/* Ô Tìm chức năng đầu menu */
.tg5-tim{display:flex;align-items:center;gap:8px;margin:0 2px 12px;padding:0 10px;height:38px;border:1px solid var(--m-vien);border-radius:5px;background:#fff;color:var(--m-mu);box-sizing:border-box}
.tg5-tim:focus-within{border-color:var(--m-pl);box-shadow:0 0 0 2px var(--m-plb)}
.tg5-tim input{flex:1;min-width:0;border:0;outline:0;background:none;font:400 13.5px var(--tg2-phong);color:var(--m-tx)}
.tg5-tim-kq{display:none}
.tg2-pnl.tg5-dang-tim .tg2-pn-nhom{display:none!important}
.tg2-pnl.tg5-dang-tim .tg5-tim-kq{display:block}
.tg5-tim-kq small{display:block;margin:10px 10px 4px;font-size:12px;font-weight:700;color:var(--m-mu)}
.tg5-tim-trong{margin:6px 8px;padding:9px 10px;border-radius:4px;background:#FFF3DF;color:#7A4600;font-size:13px;line-height:1.4}
/* ═══ KPI phương án 2 ═══ */
.tg2-k{border-radius:6px}
.tg2-k:after{opacity:.35}
.tg2-k.tg5-cam{--a:#FFF8EA;--b:#FCEFD2;--bd:#F4E1B8;--c:#A86F10;--gi:linear-gradient(145deg,#E6AE4A,#C98A1E);--go:#A06D14}
.tg2-k.tg5-do{--a:#FDF1F3;--b:#F8E1E5;--bd:#F0CED4;--c:#B23A4C;--gi:linear-gradient(145deg,#DC6F80,#C0485A);--go:#9A3646}
.tg2-k.tg5-xanh{--a:var(--m-kx-a);--b:var(--m-kx-b);--bd:var(--m-kx-bd);--c:var(--m-pl);--gi:linear-gradient(145deg,var(--m-kx-g1),var(--m-pl));--go:var(--m-pd)}
.tg2-k.tg5-cham{--a:var(--m-chama);--b:var(--m-chamt);--bd:var(--m-chamb);--c:var(--m-cham);--gi:linear-gradient(145deg,var(--m-cham2),var(--m-cham));--go:var(--m-cham-d)}
.tg2-k .tg2-ic{border-radius:6px;box-shadow:0 3px 0 var(--go,var(--c)),0 6px 12px -4px var(--c),inset 0 1px 0 rgba(255,255,255,.35);color:#fff}
.tg2-k.on{box-shadow:0 0 0 2px var(--c);border-color:var(--c)}
@media (min-width:768px){
  .tg2-kp-gon .tg2-k{padding:12px 14px;gap:14px}
  .tg2-kp-gon .tg2-k .tg2-ic{width:42px;height:42px}
  .tg2-kp-gon .tg2-k .tg2-ic svg{width:22px;height:22px}
  .tg2-kp-gon .tg2-k .tg2-n{font-size:24px}
  .tg2-kp-gon .tg2-k .tg2-l{font-size:13.5px}
  .tg2-kp .tg2-k .tg2-ic svg{width:20px;height:20px}
}
/* ═══ Danh sách (dongDs) dạng bảng lưới từ 768px ═══ */
.tg2-dhs-stt,.tg2-dhs-macot,.tg2-dhs-dau,.tg2-dhs-them{display:none}
@media (min-width:768px){
  .tg2-ds-khung{border:1px solid var(--m-bang-kh)!important;border-radius:6px!important;overflow:hidden;box-shadow:0 2px 8px rgba(16,24,40,.05)}
  .tg2-ds-dong{display:table;width:100%;table-layout:fixed;border-collapse:separate;border-spacing:0;font-variant-numeric:tabular-nums}
  .tg2-ds-dong>.tg2-dhs{display:table-row;padding:0;background:#fff}
  .tg2-ds-dong>.tg2-dhs>*{display:table-cell;vertical-align:middle;padding:10px;border-right:1px solid var(--m-bang-k);border-bottom:1px solid var(--m-bang-k);background:#fff;box-sizing:border-box}
  .tg2-ds-dong>.tg2-dhs>*:last-child{border-right:0}
  .tg2-ds-dong>.tg2-dhs:last-child>*{border-bottom:0}
  .tg2-ds-dong>.tg2-dhs:nth-child(odd)>*{background:var(--m-zebra)}
  .tg2-ds-dong>.tg2-dhs[role=link]:hover>*{background:var(--m-bang-sang)}
  .tg2-ds-dong>.tg2-dhs.bc-an{display:none}
  .tg2-ds-dong>.tg2-dhs>.tg2-dhs-ic{display:none}
  .tg2-ds-dong .tg2-dhs-stt{display:table-cell;width:46px;text-align:center;color:var(--m-tx2)}
  .tg2-ds-dong .tg2-dhs-macot{display:table-cell;width:156px;color:var(--m-pl);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .tg2-ds-dong .tg2-dhs-ten{width:auto}
  .tg2-ds-dong .tg2-dhs-d1{display:block}
  .tg2-ds-dong .tg2-dhs-d1 b{white-space:normal;font-weight:600}
  .tg2-ds-dong .tg2-dhs-d1 .tg2-bd{margin-left:6px}
  .tg2-ds-dong .tg2-dhs-phu{white-space:normal}
  .tg2-ds-dong .tg2-dhs-phu .tg2-ma,.tg2-ds-dong .tg2-dhs-phu .tg2-ma-ngan{display:none}
  .tg2-ds-dong .tg2-dhs-phu:empty{display:none}
  .tg2-ds-dong .tg2-dhs-nhan{display:table-cell;width:150px;text-align:center}
  .tg2-ds-dong .tg2-dhs-nhan>span{display:block;margin:2px 0}
  .tg2-ds-dong .tg2-dhs-nhan .tg2-bd{white-space:normal;text-align:center;justify-content:center}
  .tg2-ds-dong .tg2-dhs-nut{display:table-cell;width:92px;text-align:center}
  .tg2-ds-dong .tg2-dhs-nut .tg2-btn{margin:2px}
  .tg2-ds-dong .tg2-dhs-cot{display:table-cell;width:108px;overflow-wrap:anywhere}
  .tg2-ds-dong .tg2-dhs-cot.bc-g{text-align:center}
  /* đầu bảng */
  .tg2-ds-dong>.tg2-dhs-dau{display:table-header-group}
  .tg2-dhs-dau>span{display:table-cell;background:linear-gradient(180deg,var(--m-bang-d1),var(--m-bang-d2));color:#fff;font-weight:700;font-size:13.5px;padding:11px 10px;text-align:center;white-space:nowrap;border-right:1px solid var(--m-bang-dv);border-bottom:1px solid var(--m-bang-dd);box-sizing:border-box}
  .tg2-dhs-dau>span:last-child{border-right:0}
  .tg2-dhs-dau .d-stt{width:46px}.tg2-dhs-dau .d-ma{width:156px}.tg2-dhs-dau .d-tt{width:150px}.tg2-dhs-dau .d-nut{width:92px}.tg2-dhs-dau .d-xc{width:44px}.tg2-dhs-dau .d-cot{width:108px}
  .tg2-ds-dong.khong-ma .tg2-dhs-macot,.tg2-ds-dong.khong-ma .d-ma{display:none}
  .tg2-ds-dong.khong-tt .tg2-dhs-nhan,.tg2-ds-dong.khong-tt .d-tt{display:none}
  .tg2-ds-dong.khong-nut .tg2-dhs-nut,.tg2-ds-dong.khong-nut .d-nut{display:none}
  .tg2-ds-dong .tg2-dhs.co-xc>:first-child{width:44px;text-align:center}
}
@media (min-width:768px) and (max-width:1100px){
  .tg2-ds-dong .tg2-dhs-macot,.tg2-dhs-dau .d-ma{width:128px}
  .tg2-ds-dong .tg2-dhs-nhan,.tg2-dhs-dau .d-tt{width:160px}
  .tg2-ds-dong .tg2-dhs-cot,.tg2-dhs-dau .d-cot{width:106px}
}
/* Chân phân trang máy chủ theo kiểu chân bảng */
.tg2-pg2{background:var(--m-panel);border-top:1px solid var(--m-bang-k);color:#374151;font-size:13.5px}
.tg2-pg2 .trang-nut .tg2-btn{min-height:32px;border-radius:4px}
/* Thẻ kiêm bộ lọc, hàng lọc: một chiều cao, thẳng hàng */
.tg2-loc{border-radius:6px}
.tg2-ph .tg2-btn,.tg2-dau-man .tg2-btn{min-height:36px}
@media (min-width:768px){
  .tg2-ds-dong>:not(.tg2-dhs):not(.tg2-dhs-dau){display:table-caption;caption-side:bottom}
}
@media (max-width:767px){.tg2-phai{display:flex;flex-wrap:wrap;gap:8px}.tg2-phai>.tg2-btn{flex:1 1 auto;margin:0}}
/* Cột riêng chỉ hiện ở dạng bảng; điện thoại giữ dòng gọn */
.tg2-dhs-cot{display:none}
@media (min-width:768px){
  .tg2-ds-dong .tg2-dhs-cot{display:table-cell}
}
/* (2)(6) Danh sách dạng bảng: chữ xuống dòng trong ô; Loại, Người lập gọn, Trích yếu nhận phần còn lại */
@media (min-width:768px){
  .tg2-ds-dong>.tg2-dhs>*{overflow-wrap:anywhere;padding:10px 8px}
  .tg2-ds-dong .tg2-dhs-macot{width:148px;overflow-wrap:normal}.tg2-dhs-dau .d-ma{width:148px}
  .tg2-ds-dong .tg2-dhs-cot,.tg2-dhs-dau .d-cot{width:112px}
  .tg2-ds-dong .tg2-dhs-cot.bc-ngay-o,.tg2-dhs-dau .d-cot:last-of-type{width:112px}
  .tg2-ds-dong .tg2-dhs-nhan,.tg2-dhs-dau .d-tt{width:138px}
  .tg2-ds-dong .tg2-dhs-nut,.tg2-dhs-dau .d-nut{width:82px}
  .tg2-ds-dong .tg2-dhs-nut .tg2-btn{padding-left:8px;padding-right:8px}
}
/* (5) Nhóm nút đầu trang: cách đều 8px, lớp chung */
.tg2-phai,.tg2-phai>span[id]{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.tg2-phai>*,.tg2-phai>span[id]>*{margin:0}
/* (4) Nút thả Tiện ích */
.tg5-tha{position:fixed;z-index:70;min-width:250px;background:#fff;border:1px solid var(--m-line);border-radius:6px;box-shadow:0 10px 26px rgba(var(--m-bong-rgb),.2);padding:4px}
.tg5-tha a{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:4px;color:var(--m-tx2);text-decoration:none;font:500 13.5px var(--tg2-phong);min-height:36px;box-sizing:border-box}
.tg5-tha a:hover,.tg5-tha a:focus-visible{background:var(--m-plt);color:var(--m-pd)}
.tg5-tha .tg2-i{color:var(--m-mu);flex:none}
.tg5-so{font-style:normal;margin-left:auto;font-size:12px;font-weight:700;padding:1px 7px;border-radius:4px;background:var(--m-pl);color:#fff}
.tg5-tha-nut .tg5-so{margin-left:0}
/* (10) Nhãn trạng thái góc 4px, giữ chấm và nền nhạt */
.tg2-bd{border-radius:4px}
@media (max-width:767px){.tg5-tha a{min-height:44px}.tg5-tha{left:12px!important;right:12px;min-width:0}}
/* (1) Chuẩn form: nhãn trên ô, ô rộng hết ô lưới, 2 cột khi vùng form từ ~640px, lề trong 18px */
label.tg2-h4,span.tg2-h4{display:block;margin:0 0 6px}
.tg2-h4 + input.tg2-o,.tg2-h4 + textarea.tg2-o,.tg2-h4 + select.tg2-o,.tg2-h4 + .goi-y,.tg2-h4 + .goi-y input.tg2-o{display:block;width:100%;box-sizing:border-box}
.tg5-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,max(300px,calc(50% - 8px))),1fr));gap:14px 16px;align-items:start}
section.tg2-khoi.tg5-form,div.tg2-khoi.tg5-form,#nd .tg2-khoi.tg5-form{padding:18px!important}
.tg5-form > *{grid-column:1 / -1;min-width:0}
.tg5-form > .tg5-truong:not(.tg5-rong){grid-column:auto}
.tg5-truong{display:block;min-width:0}
.tg5-truong input.tg2-o:not([type="checkbox"]):not([type="radio"]),.tg5-truong textarea.tg2-o,.tg5-truong select.tg2-o,.tg5-truong .goi-y{width:100%;box-sizing:border-box}
.tg5-truong .tg2-chips{margin-bottom:0}
@media (max-width:767px){section.tg2-khoi.tg5-form,div.tg2-khoi.tg5-form,#nd .tg2-khoi.tg5-form{padding:14px 12px!important}.tg5-form{gap:12px}}
/* (3) Cột Thao tác */
.tg5-an-nut{display:none!important}
.tg5-nhom-nut{display:inline-flex;align-items:center;gap:8px;max-width:100%;vertical-align:middle;white-space:nowrap}
.tg5-nhom-nut .tg2-btn{margin:0!important;min-height:32px;box-sizing:border-box;white-space:normal;vertical-align:baseline}
.tg5-nhom-nut .nut-xem-tai{display:inline-flex;align-items:center;gap:8px}
.tg5-nhom-nut .nut-xem-tai:not(:has(> :not(.tg5-an-nut))){display:none}
.tg5-nhom-nut .tg2-btn.tg5-them-nut{flex:none;align-self:stretch;width:32px;min-width:32px;padding:0!important;font-weight:800;letter-spacing:0;line-height:1}
.tg5-tha button{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;border:0;border-radius:4px;background:none;color:var(--m-tx2);font:500 13.5px var(--tg2-phong);min-height:36px;box-sizing:border-box;text-align:left;cursor:pointer}
.tg5-tha button:hover:not(:disabled){background:var(--m-plt);color:var(--m-pd)}
.tg5-tha button:disabled{opacity:.5;cursor:default}
.tg5-tha button.tg5-tha-nguy{color:#B4322C}
.tg5-tha button svg{flex:none;color:var(--m-mu)}
@media (min-width:768px){
  .tg2-ds-dong .tg2-dhs-nut .tg2-btn{white-space:normal}
  .tg2-ds-dong.co-them .tg2-dhs-nut,.tg2-ds-dong.co-them .d-nut{width:158px}
}
@media (max-width:767px){.tg5-tha button{min-height:44px}}
/* (4) Ô tìm khi màn không có cột mục: chỉ hiện ô tìm gọn, không che trang; gõ mới có kết quả */
.tg2-wrap.tg2-bay .tg2-pnl:not(:has(.tg2-pn-nhom.on)){bottom:auto!important;height:auto!important;max-height:calc(100vh - var(--dau-cao) - 16px);box-shadow:0 10px 26px rgba(var(--m-bong-rgb),.2);border-bottom:1px solid var(--m-line);border-radius:0 0 6px 0;padding-bottom:4px}
/* (5) Ô số có đơn vị: rộng tối đa 160px, đơn vị sát ngay sau ô */
.uc-truong .uc-o-dv,.uc-o-dv{display:flex!important;align-items:center;justify-content:flex-start!important;gap:6px;grid-template-columns:none}
.uc-o-dv > input{flex:0 1 160px;width:160px;max-width:160px;min-width:0;box-sizing:border-box}
.uc-o-dv > span{position:static!important;flex:none!important;margin:0!important;width:auto!important;color:var(--m-mu)}
.uc-o-dv .tg2-o,.uc-o-dv .o{padding-right:10px}
.tg2-ds-dong .tg2-dhs-nut{overflow-wrap:normal}
table.bc-bang .tg2-btn{overflow-wrap:normal}
.tg2-dhs-xc-trong{display:none}
@media (min-width:768px){.tg2-ds-dong .tg2-dhs-xc-trong{display:table-cell;width:44px}}
/* Trạng thái nút dùng chung (GiaoDien.nut, skill §5.20): đang xử lý, câu sát nút khi lỗi hoặc chưa bấm được */
.tg2-btn[aria-busy="true"]{cursor:progress;opacity:.92}
.gd-nut-cau{display:block;margin:6px 0 0;padding:6px 10px;border-radius:4px;font-size:13px;line-height:1.4;background:#FFF3DF;color:#7A4600}
.gd-nut-cau.loi{background:#FDECEC;color:#B4322C}
/* Đầu danh sách dạng bảng dính dưới đầu trang: sticky trên chính ô đầu, thẳng cột. Khung, thẻ bao ngoài overflow:clip để không làm hỏng sticky (trình duyệt cũ bỏ qua clip: vẫn hidden, đầu bảng không dính, không lệch cột) */
@media (min-width:768px){
  .tg2-dhs-dau>span{position:sticky;top:var(--bc-dinh,var(--dau-cao,64px));z-index:3}
  .tg2-card,.tg2-ds-khung{overflow:clip}
  #nd .tg2-khoi:not(.tg2-inb .tg2-khoi){overflow:clip}
}
/* KPI họ xanh lá: việc đã xong (Sổ số) */
.tg2-k.tg5-la{--a:#EEF8F2;--b:#DFF2E6;--bd:#CBE9D4;--c:#23854F;--gi:linear-gradient(145deg,#4CB27A,#23854F);--go:#1C6B3F}
