/* ============================================================================
   GIAO DIỆN DÙNG CHUNG — Hệ thống Công nợ điện ADP
   FILE: assets/style.css
   ----------------------------------------------------------------------------
   Giữ nguyên bộ TOKEN MÀU + FONT của ADP (đồng bộ với trang chủ index_home).
   Muốn đổi màu/giao diện toàn hệ thống: chỉ sửa phần :root bên dưới.
   ============================================================================ */

/* --- 1) TOKEN THIẾT KẾ ADP — Enterprise Dashboard (theo bản DEMO 2026) --- */
/* LƯỢT 1: đồng bộ bảng màu + bo góc theo file demo giao diện Lam gửi.
   Chỉ sửa trong :root → áp cho toàn hệ thống, không đụng HTML/PHP. */
:root{
  --font:'Be Vietnam Pro', 'Segoe UI', system-ui, Arial, sans-serif;
  --white:#FFFFFF;
  --bg:#EEF1F6;            /* nền tổng thể (demo) */
  --bg-soft:#F5F7FA;
  --line:#E1E5EC;
  --line-2:#EEF0F4;
  --navy:#1A1F6B;         /* navy demo — đậm hơn bản cũ #2A2E72 */
  --navy-2:#141863;
  --navy-tint:#F6F7FD;
  --navy-line:#E7E9F6;
  --orange:#FF6600;       /* cam demo — rực hơn bản cũ #F2761C */
  --orange-dark:#E25A00;
  --orange-tint:#FFF0E6;
  --amber:#FFC93C;
  --blue:#2563EB; --blue-tint:#E7EEFD;
  --green:#16A34A; --green-tint:#E4F6EB;
  --teal:#0EA5A5; --teal-tint:#DBF3F3;
  --tim:#7C3AED;  --tim-tint:#EDE7FB;
  --indigo:#2563EB; --indigo-tint:#E7EEFD;   /* Điều chỉnh (Adjustment) — cobalt, KHÔNG dùng green/teal */
  --red:#DC2626;  --red-tint:#FBE6E6;
  --cam-tint:#FFF0E6;
  --text:#161A33;         /* chữ demo */
  --text-muted:#667085;
  --text-mo:#98A0AE;      /* chữ mờ cấp 3 (demo) */

  /* ====== KÍCH THƯỚC BẢNG (chỉnh 1 chỗ, áp cho MỌI bảng cùng lúc) ======
     Đợt 2 (H3): hệ khoảng cách BẢNG DÙNG CHUNG — mọi bảng .data lấy padding/
     typography từ đây. Giữ NGUYÊN giá trị hiệu dụng cũ (11px dọc, 14px ngang)
     để không xê dịch bảng nào; chỉ tách thành biến có tên rõ ràng. */
  --table-cell-y: 11px;   /* padding DỌC của th/td */
  --table-cell-x: 14px;   /* padding NGANG của th/td */
  --table-head-x: 14px;   /* padding NGANG riêng cho thead (mặc định = cell-x) */
  --table-head-height: 44px;
  --table-row-height: 40px;
  --bang-chu: 13px;
  --bang-dem: var(--table-cell-y) var(--table-cell-x);

  --radius-lg:16px;       /* demo: thẻ/card tròn hơn */
  --radius-md:12px;
  --radius-sm:10px;
  --sidebar-w:224px;      /* UI-01: chuẩn Desktop 224px; ≥1600px nới 232px (media dưới) */
  --topbar-h:64px;
  --shadow-sm:0 1px 2px rgba(16,24,40,.04);
  --shadow-card:0 1px 3px rgba(16,24,40,.05);
  --shadow-menu:0 14px 34px rgba(16,24,40,.16);
  --control-h:36px;
  --control-radius:8px;
  --control-font:12.5px;
  --toolbar-divider-h:26px;
  --toolbar-divider-space:10px;
  --icon-label:16px;
  --icon-action:18px;
  --icon-kpi:26px;
  --footer-row-h:48px;
}

/* P3-C0-M33 FIX-03 — generic actionable module badges. */
.adp-module-badge{
  box-sizing:border-box;margin-left:auto;min-width:26px;height:26px;padding:0 7px;border-radius:7px;
  display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;
  font-size:12.5px;line-height:1;font-weight:800;border:1px solid transparent;
}
.adp-module-badge.tone-danger{color:#fff;background:#DC2626;border-color:#DC2626;}
.adp-module-badge.tone-warning{color:#B54708;background:#FEF0C7;border-color:#FEDF89;}
.adp-module-badge.tone-info{color:#175CD3;background:#EFF8FF;border-color:#B2DDFF;}
.qt-tab .adp-module-badge{margin-left:auto;}
.side-link.active .adp-module-badge,.qt-tab.active .adp-module-badge{color:#DC2626;background:#fff;border-color:#DC2626;}

/* Quản trị → Tài khoản security information architecture. */
.qt-security-section,.qt-security-recent{margin:0 0 12px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-card);}
.qt-security-section{overflow:hidden;}
.qt-security-recent{overflow:visible;}
.qt-security-heading{display:flex;align-items:center;justify-content:flex-start;gap:calc(var(--toolbar-divider-space) * 2 + 1px);padding:13px 18px;border-bottom:1px solid var(--line);}
.qt-security-heading h2{margin:0;color:var(--text);font-size:15px;}
.qt-security-subhead h4,.qt-security-drawer h4{margin:0;color:var(--navy);font-size:15px;}
.qt-security-status-chip{position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:24px;padding:3px 9px;border:1px solid transparent;border-radius:999px;font-size:11.5px;font-weight:650;line-height:16px;white-space:nowrap;}
.qt-security-status-chip::before{content:"";position:absolute;left:calc(-1px - var(--toolbar-divider-space));top:50%;width:1px;height:var(--toolbar-divider-h);background:var(--line);transform:translateY(-50%);}
.qt-security-status-chip.zero{color:#067647;background:#ECFDF3;border-color:#ABEFC6;}
.qt-security-status-chip.active{color:#B42318;background:#FEF3F2;border-color:#FECDCA;}
.qt-security-empty{margin:12px 18px;padding:10px 12px;border-radius:9px;background:#ECFDF3;color:#067647;font-size:13px;}
.qt-security-issues{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px;}
.qt-security-issue{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px;border:1px solid #FEDF89;border-radius:10px;background:#FFFAEB;font-size:12.5px;}
.qt-security-issue>b{color:#B54708}.qt-security-issue>span{flex:1 1 240px;color:#475467}.qt-security-issue form{margin:0;}
.qt-security-open{box-sizing:border-box;min-height:30px;border:1px solid #D0D5DD!important;background:#fff!important;color:var(--navy)!important;box-shadow:none!important;transform:none!important;}
.qt-security-open:hover{border-color:var(--navy)!important;background:var(--navy)!important;color:#fff!important;}
.qt-security-issue.danger{border-color:#FECDCA;background:#FEF3F2}.qt-security-issue.danger>b{color:#B42318}
.qt-security-more{padding:10px 14px;text-align:center;border-top:1px solid var(--line);}
.qt-deleted-user{display:inline-block;margin-left:4px;color:#667085;font-size:10px;background:#F2F4F7;border-radius:999px;padding:2px 6px;}
.qt-nut-security{color:#175CD3;background:#EFF8FF;border-color:#B2DDFF;}

.drawer.qt-security-drawer{width:min(1080px,calc(100vw - 24px));max-width:calc(100vw - 24px);overflow-x:hidden;}
.qt-security-drawer-body{--qt-security-space:12px;--qt-security-history-space:16px;--qt-security-control-h:28px;min-width:0;overflow-x:hidden;}
.qt-security-summary-grid{--qt-summary-pad-y:12px;--qt-summary-pad-x:12px;--qt-summary-label-h:32px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:1fr;gap:8px;align-items:stretch;}
.qt-security-summary-item{box-sizing:border-box;display:grid;grid-template-rows:var(--qt-summary-label-h) minmax(24px,1fr);align-content:stretch;gap:6px;min-height:86px;height:100%;padding:var(--qt-summary-pad-y) var(--qt-summary-pad-x);background:#F8FAFC;border-radius:8px;font-size:12px;}
.qt-security-summary-label{display:flex;align-items:flex-start;min-height:var(--qt-summary-label-h);color:var(--text-muted);font-size:12px;line-height:16px;}
.qt-security-summary-value{display:flex;align-items:center;min-height:24px;line-height:18px;}
.qt-security-summary-value b{color:#101828;font-size:12.5px;line-height:18px;overflow-wrap:anywhere;}
.qt-summary-chip{box-sizing:border-box;justify-content:center;min-width:88px;min-height:24px;}
.qt-security-subhead{display:flex;align-items:center;justify-content:space-between;gap:var(--qt-security-space);min-height:36px;margin-bottom:var(--qt-security-space)}.qt-security-subhead h4{margin:0;}
.qt-security-limit-row{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:64px;padding:var(--qt-security-space) 0;border-top:0;box-shadow:inset 0 1px 0 var(--line);font-size:12px;}
.qt-security-limit-row form{margin:0;flex-shrink:0}.qt-security-load-more{display:block;margin:10px auto 0;}
.qt-security-limit-copy{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;gap:3px;min-width:0;line-height:17px;}
.qt-security-limit-copy b{color:var(--text);font-weight:600;}.qt-security-limit-copy span{color:var(--text-muted);}
.qt-security-limit-copy .qt-security-hold-note{color:#B54708;font-weight:600;}
.qt-security-drawer .qt-security-empty{box-sizing:border-box;width:100%;margin:12px 0 0;padding:11px 12px;line-height:18px;}
@media(max-width:900px){.qt-security-issues{grid-template-columns:1fr}.qt-security-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.drawer.qt-security-drawer{width:100vw;max-width:100vw;}}
@media(max-width:560px){.qt-security-summary-grid{grid-template-columns:1fr}.qt-security-subhead,.qt-security-limit-row{align-items:flex-start;flex-direction:column;}}

/* ============================================================================
   P3-C0 M31 — Refund table/detail parity additions
   Shared `.debt-detail-drawer`, `.detail-*`, `.ct-ls-*`, `.btn-chitiet` and
   `.th-sap` rules remain the visual authority; only Refund form/content needs
   local layout rules here.
   ========================================================================== */
.ht-list .sem-text,.ht-list .sem-id{white-space:normal;}
.page-hoantien{width:100%;max-width:100%;min-width:0;overflow-x:clip;}
.page-hoantien .ht-list{width:100%;max-width:100%;min-width:0;overflow:hidden;}
.page-hoantien .ht-list .bang-scroll{width:100%;max-width:100%;min-width:0;overflow:visible;}
@media(max-width:1000px){
  .page-hoantien .ht-list .bang-scroll{overflow-x:auto;overflow-y:visible;}
  .page-hoantien .ht-list table.data thead th{position:static;}
}
@media(max-width:900px){
  .page-content-hoantien{width:100%;max-width:100vw;overflow-x:hidden;}
  .page-content-hoantien .page-hoantien{width:100%;max-width:100%;}
}
.ht-id{font-weight:600;color:var(--navy);}
.ht-list-primary,.ht-list-amount{font-weight:600;color:var(--text);}
.ht-list-code .muted{margin-top:2px;font-size:11.5px;}
.ht-list-refund{min-width:210px;line-height:1.4;}
.ht-list-refund > * + *{margin-top:2px;}
.ht-transfer-line{max-width:360px;color:var(--text-muted);font-size:12px;overflow-wrap:anywhere;}
.ht-kpi-money{font-size:18px;}
.ht-error{color:var(--red);}
.ht-toolbar-controls{display:flex;flex:1 1 560px;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;}
.ht-toolbar-controls select{max-width:210px;}
.ht-toolbar-export{margin-left:auto;}
.ht-drawer .detail-label{font-weight:500;}
.ht-drawer .detail-value{font-weight:400;}
.ht-drawer .detail-row--long .detail-value{font-weight:400;}
.ht-drawer .detail-business-value{font-weight:650;}
.ht-drawer .ct-ls-sub{font-weight:400;}
#ht-drawer-title{gap:4px;}
#ht-drawer .detail-header-secondary{box-sizing:border-box;align-self:flex-start;width:max-content;max-width:100%;padding:3px 8px;border-radius:999px;font-weight:700;line-height:1.3;}
#ht-drawer .detail-header-secondary--waiting{background:var(--orange-tint);color:var(--orange-dark);}
#ht-drawer .detail-header-secondary--unknown{background:var(--tim-tint);color:var(--tim);}
#ht-drawer .detail-header-secondary--completed{background:var(--green-tint);color:var(--green);}
.ht-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px 12px;min-width:0;}
.ht-form-grid > label,.ht-complete-form > label{display:block;min-width:0;color:var(--text-muted);font-size:12px;font-weight:500;}
.ht-form-grid > label > span,.ht-complete-form > label > span{display:block;margin-bottom:5px;}
.ht-form-grid input,.ht-form-grid textarea,.ht-complete-form input{
  box-sizing:border-box;width:100%;min-width:0;border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--text);font:inherit;font-size:13px;line-height:1.4;
}
.ht-form-grid input,.ht-complete-form input{height:38px;padding:0 11px;}
.ht-form-grid textarea{height:84px;min-height:84px;max-height:84px;padding:9px 11px;resize:none;overflow-y:auto;overflow-wrap:anywhere;}
.ht-form-grid input:focus,.ht-form-grid textarea:focus,.ht-complete-form input:focus{border-color:var(--teal);outline:2px solid rgba(5,150,105,.12);outline-offset:0;}
.ht-form-grid .wide{grid-column:1/-1;}
.ht-code-type{display:flex;align-items:flex-end;gap:0;min-width:0;margin:0;padding:0;border:0;}
.ht-code-type legend{display:block;width:100%;margin:0 0 5px;color:var(--text-muted);font-size:12px;font-weight:500;}
.ht-code-type label{position:relative;display:inline-flex;flex:1 1 0;min-width:0;cursor:pointer;}
.ht-code-type input[type="radio"]{position:absolute;opacity:0;pointer-events:none;}
.ht-code-type label span{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;height:38px;border:1px solid var(--line);background:var(--white);color:var(--text-muted);font-size:12.5px;font-weight:700;}
.ht-code-type label:first-of-type span{border-radius:8px 0 0 8px;}
.ht-code-type label:last-of-type span{margin-left:-1px;border-radius:0 8px 8px 0;}
/* SH/NSH selected semantics: SH=cobalt blue, NSH=violet. No teal/navy/green.
   Geometry, height, radius and typography are shared; only the selected color
   differs by position (SH is always the first option, NSH the second). */
.ht-code-type label:first-of-type input:checked + span{position:relative;z-index:1;border-color:#2563EB;background:#EFF6FF;color:#2563EB;}
.ht-code-type label:last-of-type input:checked + span{position:relative;z-index:1;border-color:#7C3AED;background:#F5F3FF;color:#7C3AED;}
.ht-code-type label:first-of-type input:focus-visible + span{outline:2px solid rgba(37,99,235,.30);outline-offset:1px;}
.ht-code-type label:last-of-type input:focus-visible + span{outline:2px solid rgba(124,58,237,.32);outline-offset:1px;}
.ht-form-buttons{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:14px;}
.ht-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-height:38px;padding:0;}
.ht-actions form{display:flex;align-items:center;margin:0;}
.ht-actions .btn,.ht-form-buttons .btn{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;height:38px;min-height:38px;padding:0 14px;border-radius:8px;line-height:1;}
.page-hoantien .detail-section--workflow > .detail-disclosure-body{margin-top:0;padding:12px 9px;}
#ht-drawer .detail-section--workflow + .detail-disclosure{margin-top:0;}
.page-hoantien .ht-actions .ht-state-action{border-color:var(--state-border)!important;box-sizing:border-box!important;height:40px!important;min-height:40px!important;padding:0 16px!important;border-style:solid!important;border-width:1px!important;border-radius:10px!important;background:var(--white)!important;color:var(--state-color)!important;box-shadow:none!important;transform:none!important;font-weight:700!important;transition:background .14s,border-color .14s,color .14s,box-shadow .14s!important;}
.page-hoantien .ht-actions .ht-state-action:hover:not(:disabled){border-color:var(--state-border)!important;background:var(--state-hover)!important;color:var(--state-active)!important;box-shadow:0 2px 8px var(--state-shadow)!important;}
.page-hoantien .ht-actions .ht-state-action:active:not(:disabled){border-color:var(--state-color)!important;background:var(--state-active-bg)!important;color:var(--state-active)!important;box-shadow:none!important;}
.page-hoantien .ht-actions .ht-state-action:focus-visible{outline:2px solid var(--state-ring);outline-offset:2px;box-shadow:none!important;}
.page-hoantien .ht-actions .ht-state-unknown{--state-color:#7C3AED;--state-border:#8B5CF6;--state-hover:#F5F3FF;--state-active-bg:#EDE9FE;--state-active:#6D28D9;--state-ring:rgba(124,58,237,.38);--state-shadow:rgba(124,58,237,.14);}
.page-hoantien .ht-actions .ht-state-waiting{--state-color:#EA580C;--state-border:#F97316;--state-hover:#FFF7ED;--state-active-bg:#FFEDD5;--state-active:#C2410C;--state-ring:rgba(234,88,12,.34);--state-shadow:rgba(234,88,12,.14);}
.page-hoantien .ht-actions .ht-return-btn{--state-color:#2563EB;--state-border:#2563EB;--state-hover:#EFF6FF;--state-active-bg:#DBEAFE;--state-active:#1D4ED8;--state-ring:rgba(37,99,235,.34);--state-shadow:rgba(37,99,235,.14);}
.ht-save-btn{border:1px solid #15803D;background:#15803D;color:#fff;box-shadow:0 1px 2px rgba(21,128,61,.18);}
.ht-save-btn:hover:not(:disabled){background:#116B34;border-color:#116B34;}
.ht-save-btn:disabled{border-color:#15803D!important;background:#15803D!important;color:#fff!important;box-shadow:none;cursor:not-allowed;opacity:.55;}
.ht-complete-btn{border:1px solid #15803D;background:#15803D;color:#fff;box-shadow:0 1px 2px rgba(21,128,61,.18);}
.ht-complete-btn:hover:not(:disabled){background:#116B34;border-color:#116B34;}
.ht-complete-btn:disabled{border-color:#15803D!important;background:#15803D!important;color:#fff!important;box-shadow:none;cursor:not-allowed;opacity:.55;}
.ht-inline-error{margin-top:9px;color:var(--red);font-size:12px;font-weight:500;line-height:1.4;}
.ht-complete-form input{margin-top:0;}

/* RF06-RF01: "Thay đổi trạng thái" row — two equal-width buttons that use the
   full available row width (fluid 1fr columns, not fixed 190px), so no unused
   right-side space remains. Stacks to one column on narrow widths. */
.page-hoantien .detail-section--workflow .ht-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.page-hoantien .detail-section--workflow .ht-actions form{margin:0;}
.page-hoantien .detail-section--workflow .ht-actions .ht-state-action{width:100%!important;}
@media(max-width:620px){.page-hoantien .detail-section--workflow .ht-actions{grid-template-columns:1fr;}}

@media(max-width:620px){
  .ht-toolbar-controls{flex-basis:100%;align-items:stretch;}
  .ht-toolbar-controls select{flex:1 1 100%;max-width:none;}
  .ht-toolbar-export{margin-left:0;}
  .ht-form-grid{grid-template-columns:1fr;}
  .ht-form-grid .wide{grid-column:auto;}
  .ht-actions{flex-direction:column;align-items:stretch;}
  .ht-actions .btn{width:100%;}
}
/* UI-01: từ 1600px trở lên, sidebar rộng 232px (topbar/content/footer tự căn theo biến). */
@media (min-width:1600px){ :root{ --sidebar-w:232px; } }
::selection{background:#FF660033;}

/* --- 2) RESET & NỀN CHUNG --- */
*{box-sizing:border-box;}
html{overflow-y:scroll;}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--font); -webkit-font-smoothing:antialiased; line-height:1.55;
  font-size:14px;
}
h1,h2,h3{margin:0; color:var(--text); font-weight:700;}
a{color:inherit; text-decoration:none;}
img{max-width:100%; display:block;}
ul{margin:0; padding:0; list-style:none;}
button,input,select,textarea{font-family:var(--font);}
/* Ô tìm kiếm: cả nội dung đã nhập và placeholder màu xám đều rút gọn bằng …
   khi chiều rộng không đủ, không làm vỡ bố cục thanh công cụ. */
input[type=search]{min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
input[type=search]::placeholder{overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible, a:focus-visible{
  outline:2px solid var(--navy); outline-offset:1px;
}
.ic{width:20px; height:20px; flex-shrink:0;}

/* --- 3) TOPBAR --- */
/* LƯỢT 2: topbar chỉ còn tiêu đề trang + khối user. Logo & ô chọn kỳ nằm ở sidebar. */
.topbar{
  height:var(--topbar-h); background:var(--white); border-bottom:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  width:calc(100% - var(--sidebar-w)); margin-left:var(--sidebar-w);
  padding:0 32px; position:sticky; top:0; z-index:40;
}
.tb-left{display:flex; align-items:center; gap:12px; min-width:0;}
.mobile-nav-trigger,.mobile-nav-head,.mobile-nav-backdrop{display:none;}
/* Tiêu đề trang trên topbar — chữ cam đậm (demo) */
.tb-tieude{
  font-size:23px; font-weight:800; color:var(--orange); letter-spacing:-.4px;
  margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

.tb-right{display:flex; align-items:center; gap:12px;}

/* ===== LƯỢT 3: Ô TÌM KIẾM + NÚT NHẬP DỮ LIỆU trên topbar (theo demo) ===== */
.tb-tim{position:relative; width:260px; flex-shrink:1; min-width:150px;}
.tb-tim-ico{
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  display:flex; align-items:center; color:var(--text-mo); pointer-events:none;
}
.tb-tim-ico .ic{width:17px; height:17px;}
.tb-tim input[type=search]{
  width:100%; height:40px; border:1px solid var(--line); border-radius:10px;
  padding:0 12px 0 36px; font-size:13.5px; background:var(--bg-soft); color:var(--text);
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.tb-tim input[type=search]::placeholder{color:var(--text-mo); }
.tb-tim input[type=search]:hover{border-color:var(--orange);}
.tb-tim input[type=search]:focus{
  outline:none; background:var(--white); border-color:var(--orange);
  box-shadow:0 0 0 3px rgba(255,102,0,.15);
}
/* Nút Nhập dữ liệu trên topbar */
/* Nút Nhập dữ liệu — số đo lấy ĐÚNG từ demo: cao 40, padding 0 18, gap 8,
   bo 10, chữ 13.5/700, bóng nhẹ. */
.tb-nhap{
  height:40px; padding:0 18px; gap:8px; border-radius:10px; flex-shrink:0;
  font-size:13.5px; font-weight:700;
  box-shadow:0 2px 8px rgba(16,24,40,.16);
}
.tb-nhap .ic{width:17px; height:17px;}
/* REVIEW V2 (H9): "Nhập dữ liệu" và "Nhập XML" dùng CHUNG class .tb-nhap (đã có
   sẵn từ trước, không phải class riêng của module Tiền mặt) → gắn đúng cảm giác
   tương tác của nút "Ghi nhận" (.tm-btn) tại đây, một nguồn duy nhất cho cả hai
   nút, có specificity cao hơn .btn:hover chung nên không bị ghi đè. */
/* UI-01: bỏ translateY để hover KHÔNG dịch chuyển nút; chỉ đổi nền/bóng. */
.tb-nhap:not(:disabled):hover{
  background:var(--orange-dark); box-shadow:0 6px 16px rgba(255,102,0,.28);
}
.tb-nhap:not(:disabled):active{
  background:#C94F00; box-shadow:0 3px 8px rgba(255,102,0,.22);
}
/* Vạch ngăn giữa nhóm thao tác và khối người dùng */
.tb-vach{width:1px; height:30px; background:var(--line); flex-shrink:0;}

/* Màn hình hẹp: giấu bớt cho khỏi tràn topbar */
@media (max-width:1200px){ .tb-tim{width:190px;} }
@media (max-width:1000px){ .tb-nhap .tb-nhap-chu{display:none;} .tb-nhap{padding:0 12px;} }
@media (max-width:900px){ .topbar{width:100%; margin-left:0;} }
@media (max-width:820px){ .tb-tim{display:none;} }
.tb-home{display:flex; align-items:center; gap:7px; font-size:13px; font-weight:600; color:var(--text-muted);}
.tb-home:hover{color:var(--navy);}
.tb-home .ic{width:17px; height:17px;}
/* LƯỢT 6 — KHỐI NGƯỜI DÙNG theo đúng ảnh mẫu Lam gửi:
   nút VIỀN TRẮNG bo 10px, cao 40px (bằng ô tìm & nút Nhập dữ liệu);
   avatar là Ô VUÔNG BO GÓC 30px, nền GRADIENT navy→cam. */
.tb-avatar{
  width:30px; height:30px; border-radius:8px; flex-shrink:0;
  background:linear-gradient(135deg, var(--navy), var(--orange));
  color:#fff; font-weight:700; font-size:13px;
  display:flex; align-items:center; justify-content:center;
}
.tb-user-txt{display:flex; flex-direction:column; text-align:left; line-height:1.2;}
.tb-user-txt .ten{font-weight:700; font-size:12.5px; color:var(--text); white-space:nowrap;}
.tb-user-txt .vt{font-size:10.5px; color:var(--text-muted); white-space:nowrap;}
.tb-logout{
  padding:8px 16px; border-radius:var(--radius-sm); background:var(--orange); color:#fff;
  font-weight:700; font-size:13px;
}
.tb-logout:hover{background:var(--orange-dark);}

/* --- 4) KHUNG SIDEBAR + NỘI DUNG --- */
.app-shell{display:flex; align-items:flex-start; min-height:100vh;}
.sidebar{
  width:var(--sidebar-w); flex-shrink:0;
  background:var(--white); color:var(--text);
  border-right:1px solid #E5E7EB;
  position:fixed; top:0; left:0;    /* LƯỢT 2: chạy từ đỉnh vì logo nằm trong sidebar */
  height:100vh; padding:0;
  display:flex; flex-direction:column; overflow-y:auto; z-index:45;
}
.sidebar::-webkit-scrollbar{width:8px;}
.sidebar::-webkit-scrollbar-thumb{background:#D5DAE3; border-radius:8px; border:2px solid #F5F7FA;}
.sidebar::-webkit-scrollbar-thumb:hover{background:#B9C0CD;}

/* --- LƯỢT 2: LOGO + TÊN HỆ THỐNG ở đầu sidebar --- */
/* SỬA (vòng 3): chiều cao khối logo = ĐÚNG --topbar-h (64px) để đường kẻ dưới
   logo THẲNG HÀNG với đường kẻ dưới topbar bên phải (Lam khoanh đỏ ở ảnh).
   Dùng height cố định + box-sizing:border-box → không lệch dù chữ dài/ngắn. */
.side-brand{
  display:flex; align-items:center; gap:11px;
  height:var(--topbar-h); padding:0 20px; flex-shrink:0;
  border-bottom:1px solid #EEF0F4;
  transition:opacity .15s;
}
.side-brand:hover{opacity:.82;}
/* vòng 5: logo 34 → 40px. align-items:center của .side-brand canh logo theo cả
   hàng 64px; vì khối chữ cũng canh giữa hàng đó nên logo tự nằm ĐÚNG GIỮA 2 dòng
   "ĐIỆN LỰC ADP" và "Quản lý công nợ". */
.side-brand img{width:36px; height:36px; object-fit:contain; flex-shrink:0;}
/* SỬA (vòng 4): line-height 1.15 làm 2 dòng dính nhau. Dùng gap 2px + line-height
   riêng từng dòng → "Quản lý công nợ" tách khỏi "ĐIỆN LỰC ADP", vẫn cân giữa khối. */
.side-brand-ten{display:flex; flex-direction:column; gap:2px; min-width:0;}
.side-brand-ten .full{font-weight:800; font-size:14.5px; color:var(--navy); letter-spacing:.2px; line-height:1.2;}
.side-brand-ten .sub{font-size:11px; color:var(--orange); font-weight:700; letter-spacing:.1px; line-height:1.25;}

/* --- LƯỢT 2: THẺ CHỌN KỲ LÀM VIỆC trong sidebar --- */
/* SỬA (vòng 2): cân đối lại theo góp ý của Lam.
   - 2 select CHIA ĐÔI đều nhau (mỗi ô 50%) thay vì 84px cứng → không lệch.
   - Chevron căn đúng mép phải, padding trái/phải cân, chữ không bị mũi tên đè.
   - Chip trạng thái LUÔN hiện: "Hiện tại" (xanh) hoặc "Kỳ cũ"/"Kỳ sau" (xám/cam)
     → không còn khoảng trống trơ trọi khi xem tháng khác. */
.side-ky{padding:14px; border-bottom:1px solid #EEF0F4;}
.side-ky .ky-chon{
  background:var(--navy-tint); border:1px solid var(--navy-line);
  border-radius:12px; padding:12px 8px; display:block; margin:0;
}
/* Hàng nhãn: nhãn co được, chip không bao giờ bị bóp méo (188px chỗ trống,
   nhãn ~102px + chip ~71px → vừa; gán min-width:0 + flex-shrink cho chắc). */
.ky-dau{display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:9px;}
.ky-dau .ky-nhan{min-width:0; overflow:hidden; text-overflow:ellipsis;}
.ky-dau .ky-chip{flex-shrink:0;}
/* SỬA (vòng 4): chữ 10px → 11px theo yêu cầu Lam.
   Icon lệch tâm là do line-height:1 — chữ in hoa cao ~8px trong khi icon 14px,
   nên hộp chữ và hộp icon không cùng tâm. Bỏ line-height:1, cho line-height
   bằng đúng chiều cao icon (14px) → CHỮ VÀ ICON CHUNG MỘT TÂM. */
/* vòng 5: icon 14 → 16px theo yêu cầu Lam.
   QUY TẮC: line-height của .ky-nhan phải LUÔN BẰNG chiều cao .ky-icon thì chữ
   và icon mới chung một tâm. Đổi cỡ icon → nhớ đổi line-height cho khớp. */
.ky-nhan{
  font-size:10px; font-weight:800; letter-spacing:.9px; text-transform:uppercase;
  color:var(--navy); display:inline-flex; align-items:center; gap:6px;
  line-height:14px; white-space:nowrap;
}
.ky-icon{
  display:inline-flex; align-items:center; justify-content:center;
  width:14px; height:14px; color:var(--orange); flex-shrink:0;
}
.ky-icon .ic{width:14px; height:14px; display:block;}
/* Chip trạng thái kỳ — luôn hiển thị, đổi màu theo kỳ đang xem */
.ky-chip{
  font-size:10px; font-weight:700; padding:0 8px; border-radius:999px;
  display:inline-flex; align-items:center; gap:4px; white-space:nowrap;
  height:18px; line-height:1;                 /* vòng 4: cao cố định → cùng tâm với nhãn */
  color:var(--green); background:var(--green-tint);
}
.ky-chip i{width:5px; height:5px; border-radius:50%; background:currentColor; display:inline-block; flex-shrink:0;}
.ky-chip.ky-cu{color:var(--text-muted); background:var(--line-2);}
.ky-chip.ky-sau{color:var(--orange); background:var(--orange-tint);}

/* 2 select chia đôi — dùng grid để KHÔNG lệch dù nội dung dài ngắn khác nhau */
/* UI-01.1: bỏ 2 cột cứng (100px 76px) — dễ tràn ở sidebar hẹp. Ô Tháng nhận phần
   co giãn còn lại (minmax(0,1fr) → không đẩy tràn grid); ô Năm giữ bề rộng vừa đủ
   cho "2026" + chevron. Tự vừa sidebar 224/232px, KHÔNG giảm cỡ chữ, KHÔNG ellipsis,
   KHÔNG che tràn, KHÔNG nới sidebar. */
.ky-selects{display:grid; grid-template-columns:minmax(96px,1fr) 76px; gap:6px;}
.ky-chon select{
  width:100%; min-width:0; height:38px;
  border:1px solid var(--line); border-radius:9px; background-color:var(--white);
  font-size:12.5px; font-weight:700; color:var(--text); cursor:pointer;
  /* Rule chevron toàn hệ ép padding-right:30px !important → chữ bị cắt trong ô
     hẹp. Ghi đè lại vừa đủ chỗ cho mũi tên 12px + khoảng hở. */
  padding-left:9px !important; padding-right:25px !important;
  background-position:right 7px center !important;
  text-overflow:clip;
  transition:border-color .12s, box-shadow .12s;
}
.ky-chon select:hover{border-color:var(--navy);}
.ky-chon select:focus{outline:none; border-color:var(--orange); box-shadow:0 0 0 3px rgba(255,102,0,.15);}

.side-menu{display:flex; flex-direction:column; gap:3px; padding:8px 14px; flex:1;}
/* Tiêu đề nhóm menu (mờ, chữ nhỏ in hoa) */
.side-nhom{
  font-size:10px; font-weight:800; color:#98A0AE;
  text-transform:uppercase; letter-spacing:.9px; padding:12px 12px 6px;
}
.side-nhom:not(:first-child){padding-top:16px;}
/* HOST FIX 03.2 (§5): tinh chỉnh item sidebar.
   - .side-ico trở thành Ô VUÔNG BO TRÒN 28px (trước là icon trần 19px) để trạng
     thái active có thể "bọc icon trắng trong ô nền cam" mà KHÔNG đổi cấu trúc
     HTML (vẫn <span class="side-ico"><svg></span>).
   - Ở trạng thái thường ô này trong suốt, icon xám dịu → sidebar vẫn nhẹ, các
     item vẫn thống nhất; chỉ item active mới "sáng" lên.
   - padding item nới nhẹ (9→8px dọc, 10px ngang) cho cân với ô icon 28px. */
/* UI-01: hàng menu cao 38px, bo 8px, icon 17px KHÔNG bọc ô nền riêng.
   Viền trong suốt sẵn ở MỌI mục để trạng thái active thêm viền mà không xê dịch. */
.side-link{
  display:flex; align-items:center; gap:11px; height:38px; padding:0 9px;
  border-radius:8px; border:1px solid transparent;
  font-size:13.5px; font-weight:600; color:#485061;
  transition:background .14s, color .14s, border-color .14s; position:relative;
}
.side-ico{
  flex-shrink:0; color:#98A0AE;
  display:flex; align-items:center; justify-content:center;
  transition:color .14s;
}
.side-ico .ic{width:17px; height:17px;}
/* HOVER — chỉ áp cho mục CHƯA chọn: nền xám nhạt, chữ + icon navy; không nâng, không bóng. */
.side-link:not(.active):hover{background:var(--bg-soft); color:var(--navy);}
.side-link:not(.active):hover .side-ico{color:var(--navy);}
/* ===== TRẠNG THÁI ACTIVE =====
   Nền cam rất nhạt (chuyển sắc nhẹ trái→phải) · viền trong mờ (thẻ mềm) · icon CAM ·
   chữ NAVY 600. KHÔNG bóng nổi, KHÔNG transform. Mục active đứng yên khi rê chuột. */
.side-link.active{
  background:linear-gradient(90deg,#FFEBDD,#FFF6EF);
  border-color:rgba(255,102,0,.20);
  color:var(--navy); font-weight:600;
}
.side-link.active .side-ico{color:var(--orange);}
/* Thanh cam trái: 3px rộng, 22px cao (hàng 38px → chừa 8px mỗi đầu = căn giữa),
   bo tròn hai đầu, không kéo hết chiều cao mục. */
.side-link.active::before{
  content:""; display:block; position:absolute; left:0; top:8px;
  width:3px; height:22px; border-radius:3px; background:var(--orange);
}
/* FOCUS bàn phím — viền NAVY riêng, khác hẳn accent cam của active. */
.side-link:focus-visible{outline:2px solid var(--navy); outline-offset:-2px;}
.side-foot{display:flex;align-items:center;flex:0 0 var(--footer-row-h);height:var(--footer-row-h);margin-top:auto;padding:0 14px;border-top:1px solid var(--line);}
.side-foot .side-link{width:100%;padding:0 9px;}   /* khớp đệm mới của .side-link */

.content{flex:1; min-width:0; padding:26px 32px 40px; margin-left:var(--sidebar-w);}

/* --- 5) TIÊU ĐỀ TRANG --- */
/* LƯỢT 2: tiêu đề chính đã chuyển lên TOPBAR (.tb-tieude). H1 trong .page-head
   của từng trang được ẨN THỊ GIÁC (vẫn còn trong DOM cho trình đọc màn hình,
   nên KHÔNG cần sửa 10 file trang → tránh rủi ro). Các nút/chú thích cạnh H1
   vẫn hiển thị bình thường.
   Muốn hiện lại H1 trên thân trang: thêm class "co-h1" vào .page-head đó. */
.page-head{display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px;}
.page-head h1{
  position:absolute; width:1px; height:1px; margin:-1px; padding:0;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}
.page-head.co-h1 h1{
  position:static; width:auto; height:auto; margin:0; overflow:visible;
  clip:auto; white-space:normal; font-size:23px; color:var(--orange); font-weight:800; letter-spacing:-.4px;
}
.page-head p{margin:4px 0 0; color:var(--text-muted); font-size:13.5px;}
/* Trang nào chỉ có mỗi H1 (không nút) thì .page-head rỗng → bỏ khoảng trống thừa */
.page-head:empty{display:none; margin:0;}
/* HOST FIX 02 (10) — TIỆN ÍCH DÙNG CHUNG: .page-head--gon dành cho trang mà
   .page-head KHÔNG còn nội dung hiển thị (chỉ còn H1 đã ẩn cho trình đọc màn
   hình, nên :empty không bắt được). Thu về 0 để cụm KPI bắt đầu ĐÚNG vị trí
   chuẩn của trang Thu tiền mặt (trang chuẩn không có .page-head). */
.page-head--gon{margin-bottom:0;}

/* --- 6) NÚT CHUẨN (flat) --- */
.btn{
  display:inline-flex; align-items:center; gap:7px; cursor:pointer; border:1px solid transparent;
  padding:9px 16px; border-radius:var(--radius-sm); font-size:13.5px; font-weight:700;
  transition:background .14s, border-color .14s, color .14s, box-shadow .14s, transform .14s;
  white-space:nowrap;
}
.btn .ic{width:16px; height:16px;}
.btn-navy{background:var(--navy); color:#fff;}
.btn-navy:hover{background:var(--navy-2);}
.btn-cam{background:var(--orange); color:#fff;}
.btn-cam:hover{background:var(--orange-dark);}
.btn-vien{background:var(--white); color:var(--navy); border-color:var(--line);}
.btn-vien:hover{border-color:var(--navy); background:var(--bg-soft);}
.btn.mini{padding:5px 11px; font-size:12px; border-radius:7px;}
button.mini{line-height:1.3;}
/* H9 (Đợt 2) — ROLLOUT hệ hiệu ứng nút DÙNG CHUNG cho MỌI .btn (giống cảm giác
   "Ghi nhận"/"Xuất Excel"/"Nhận bàn giao & gạch nợ"): nổi nhẹ + shadow khi hover,
   về vị trí khi active, vòng focus bàn phím, disabled KHÔNG dịch chuyển. KHÔNG
   đổi MÀU của bất kỳ biến thể nào — chỉ chuyển động/độ nổi. Các nút có hiệu ứng
   RIÊNG mạnh hơn (.btn-xuat, .tm-btn, .btn-lo, .gn-nhom …) có specificity cao hơn
   nên vẫn GIỮ hiệu ứng riêng của chúng, không bị rule chung này đè. */
/* UI-01: hover/active KHÔNG dịch chuyển phần tử — chỉ đổi bóng (bỏ translateY). */
.btn:hover{ box-shadow:0 4px 12px rgba(16,24,40,.13); }
.btn:active{ box-shadow:0 2px 6px rgba(16,24,40,.11); }
.btn:focus-visible{ outline:2px solid var(--orange); outline-offset:2px; }
.btn:disabled, .btn[disabled]{ opacity:.55; cursor:not-allowed; transform:none !important; box-shadow:none !important; }
.btn:disabled:hover, .btn[disabled]:hover{ transform:none !important; box-shadow:none !important; }

/* UI-01 — BIẾN THỂ NÚT DÙNG CHUNG (nền cho UI-02/03; KHÔNG đổi nút của trang nào).
   Màu theo VAI TRÒ: xanh lá = hoàn tất/gạch nợ · đỏ đặc = Xóa · trắng-viền-đỏ = Hoàn tác.
   Hover chỉ đổi màu/viền, không dịch chuyển. */
.btn-green{ background:var(--green); color:#fff; }
.btn-green:hover{ background:#12813B; }
.btn-do{ background:var(--red); color:#fff; }                 /* Xóa — đỏ đặc */
.btn-do:hover{ background:#B91C1C; }
.btn-hoantac{ background:var(--white); color:var(--red); border-color:#F1B9B9; }  /* Hoàn tác — trắng, viền/chữ đỏ */
.btn-hoantac:hover{ background:var(--red-tint); border-color:var(--red); }
/* Trạng thái LOADING dùng chung: giữ nguyên bề rộng, ẩn icon và hiện vòng xoay,
   không dịch chuyển chữ. Vòng xoay chỉ QUAY tại chỗ (không đổi vị trí nút/icon). */
.btn.dang-tai{ cursor:progress; pointer-events:none; }
.btn.dang-tai > .ic, .btn.dang-tai > svg{ visibility:hidden; }
.btn.dang-tai::before{
  content:""; width:15px; height:15px; border-radius:50%;
  border:2px solid currentColor; border-top-color:transparent;
  animation:btn-xoay .7s linear infinite;
}
@keyframes btn-xoay{ to{ transform:rotate(360deg); } }

/* Nút chỉ-icon (Lọc / Bỏ lọc trên thanh bộ lọc). Vuông, cao bằng input/select
   cùng hàng (~40px), chiều ngang tự cân đối, icon canh giữa. */
.btn-icon{
  flex:0 0 auto; width:36px; height:36px; padding:0;   /* lượt 7: khớp 36px */
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:var(--radius-sm); cursor:pointer;
}
.btn-icon svg{width:18px; height:18px;}
.btn-icon.mini{width:32px; height:32px;}
.btn-icon.mini svg{width:16px; height:16px;}

/* LƯỢT 7: thanh lọc theo demo — MỌI ô cao 36px (demo dùng 36; ô tìm 40px đã dời
   lên topbar nên trong thanh lọc không còn ô nào cần 40px).
   Sửa số 36 ở ĐÂY thì phải sửa cả .zns-oNgay / .zns-ngay-wrap bên dưới, vì 2 chỗ
   đó ghi cứng chiều cao — không sẽ thò ra khỏi hàng. */
.loc-bar input[type=search], .loc-bar input[type=text], .loc-bar select, .loc-bar .btn{height:36px;}

/* --- 7) THẺ KHỐI (card) --- */
.card{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:16px 18px; box-shadow:var(--shadow-card); margin-bottom:16px;
}

/* --- 8) THẺ KPI (thanh tổng) --- */
/* LƯỢT 4: đổi sang DẢI KPI LIỀN KHUNG theo demo — 4 ô nằm trong MỘT thẻ trắng,
   ngăn nhau bằng đường kẻ mảnh (thay vì 4 thẻ rời có khe hở).
   Làm HOÀN TOÀN BẰNG CSS: giữ nguyên HTML .tong-bar > .kpi của cả 8 trang
   (index, nsh, danhba, import, quantri, zns, tienmat, phathanh) → không đụng
   vào các id mà đồng bộ đa tab đang bám (tg-dathu-can, tg-conno...). */
.tong-bar{
  display:grid; grid-template-columns:repeat(4,1fr); gap:0;
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg);
  overflow:hidden; margin-bottom:24px; box-shadow:var(--shadow-card);
}
.tong-bar-3{grid-template-columns:repeat(3,1fr);}
/* HOST FIX 02 (9) — biến thể 5 ô cho KPI kết quả đọc file XML (Tổng file / Đọc
   được / Hợp lệ / Trùng / Lỗi). Bổ sung MỚI, không ảnh hưởng các trang đang dùng
   .tong-bar (4 ô) hay .tong-bar-3. */
.tong-bar-5{grid-template-columns:repeat(5,1fr);}
/* Sáu KPI chuẩn dùng chung cho hai màn nhập hóa đơn SH/NSH. */
.tong-bar-6{grid-template-columns:repeat(6,minmax(0,1fr));}
/* Ô KPI: bỏ viền/nền/bo góc riêng, chỉ còn đường kẻ ngăn bên phải */
.kpi{
  background:transparent; border:0; border-radius:0; box-shadow:none;
  border-right:1px solid var(--line-2);
  padding:16px 18px; display:flex; align-items:center; gap:13px; min-width:0;
}
.kpi:last-child{border-right:0;}

/* Màn hình hẹp: 2 cột (rồi 1 cột) — ô đầu mỗi hàng phải bỏ kẻ phải cho đúng */
@media (max-width:1100px){
  .tong-bar{grid-template-columns:repeat(2,1fr);}
  .tong-bar-3{grid-template-columns:repeat(3,1fr);}
  .tong-bar > .kpi:nth-child(2n){border-right:0;}
  .tong-bar > .kpi:nth-child(-n+2){border-bottom:1px solid var(--line-2);}
}
@media (max-width:620px){
  .tong-bar, .tong-bar-3{grid-template-columns:1fr;}
  .tong-bar > .kpi{border-right:0; border-bottom:1px solid var(--line-2);}
  .tong-bar > .kpi:last-child{border-bottom:0;}
}

/* Icon tròn 44px + vòng sáng mờ quanh (demo) thay cho ô vuông bo góc */
.kpi-ic{
  width:44px; height:44px; border-radius:50%; flex-shrink:0; border:0;
  display:flex; align-items:center; justify-content:center;
}
.kpi-ic .ic, .kpi-ic svg{width:21px !important; height:21px !important;}
.kpi-ic.i-blue{background:var(--blue-tint); color:var(--blue); box-shadow:0 0 0 4px rgba(37,99,235,.07);}
.kpi-ic.i-tim{background:var(--tim-tint); color:var(--tim); box-shadow:0 0 0 4px rgba(124,58,237,.07);}
.kpi-ic.i-green{background:var(--green-tint); color:var(--green); box-shadow:0 0 0 4px rgba(22,163,74,.07);}
.kpi-ic.i-red{background:var(--red-tint); color:var(--red); box-shadow:0 0 0 4px rgba(220,38,38,.07);}
.kpi-ic.i-cam{background:var(--orange-tint); color:var(--orange); box-shadow:0 0 0 4px rgba(255,102,0,.07);}
.kpi-txt{min-width:0;}
.kpi-nhan{font-size:12px; color:var(--text-muted); font-weight:600; margin-bottom:2px;}
.kpi-so{font-size:22px; font-weight:800; line-height:1.15; letter-spacing:-.5px;}
.kpi-so.c-blue{color:var(--blue);} .kpi-so.c-tim{color:var(--tim);}
.kpi-so.c-green{color:var(--green);} .kpi-so.c-red{color:var(--red);}
.kpi-so.c-cam{color:var(--orange-dark);}
.kpi-so.c-cam{color:var(--orange);}
/* KPI có giá trị ghép nhiều phần (vd "180 / 45 / 42"): giữ trên 1 hàng, co chữ
   vừa bề ngang ô để không bị xuống dòng. */
.kpi-so-bo{ white-space:nowrap; font-size:clamp(16px, 1.5vw, 22px); }
.kpi-don{font-size:11px; color:var(--text-mo); font-weight:600; margin-top:2px;}
.kpi-tien-do{margin-top:8px; height:6px; background:var(--line); border-radius:99px; overflow:hidden; position:relative;}
.kpi-tien-do > i{position:absolute; left:0; top:0; bottom:0; background:var(--blue); border-radius:99px;}
.kpi-pct{font-size:11.5px; color:var(--text-muted); font-weight:700; margin-left:8px;}

/* Thanh tổng kiểu cũ (2-3 ô đơn giản, dùng ở danh bạ...) vẫn chạy */
.tong-o{background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg); padding:14px 18px; box-shadow:var(--shadow-card);}
.tong-o .nhan{font-size:12.5px; color:var(--text-muted); font-weight:600;}
.tong-o .so{font-size:22px; font-weight:800; color:var(--navy); margin-top:2px;}
.tong-o.xanh .so{color:var(--green);}
.tong-o.do .so{color:var(--red);}

/* --- 9) BỘ LỌC (dồn trên 1 hàng, ô tìm co giãn) --- */
.loc-bar{display:flex; align-items:center; gap:8px; flex-wrap:nowrap; margin-bottom:16px;}
.loc-bar input[type=search], .loc-bar input[type=text]{
  flex:1 1 auto; min-width:150px;
  padding:0 12px; border:1px solid var(--line); border-radius:8px;
  font-size:12.5px; background:var(--white); color:var(--text);
}
/* Demo: select cao 36, bo 8, chữ 12.5/600, chừa 30px bên phải cho chevron */
.loc-bar select{
  flex:0 0 auto;
  padding:0 12px; border:1px solid var(--line); border-radius:8px;
  font-size:12.5px; font-weight:600; color:var(--text); background-color:var(--white); cursor:pointer;
}
.loc-bar .btn{flex:0 0 auto; border-radius:8px; font-size:12.5px; font-weight:600; padding:0 13px;}
/* Nút viền trên thanh lọc (Bỏ lọc / Xuất Excel) — theo demo: nền trắng, viền
   mảnh, chữ xám; hover đổi nền + đậm viền. */
.loc-bar .btn-vien{color:var(--text-muted); border-color:var(--line);}
.loc-bar .btn-vien:hover{background:var(--bg-soft); border-color:#D5DAE3; color:var(--text);}

/* ===== NÚT XUẤT EXCEL / XUẤT BÁO CÁO — class .btn-xuat =====
   LƯỢT 8: trước đây dùng selector theo href `[href^="xuatfile.php"]` — HỎNG với
   2 trang: Phát hành dùng <button onclick="phXuat()"> (KHÔNG có href) và ZNS
   dùng href="?...&xuat=1" (không trỏ xuatfile.php). Vì vậy 2 trang đó "không
   thấy thay đổi gì".
   Nay gắn class .btn-xuat vào ĐỦ 10 nút ở 7 file → chắc chắn, không phụ thuộc
   href. Thêm nút xuất mới ở đâu, NHỚ GẮN class .btn-xuat. */
.btn-xuat{color:var(--text); border-color:var(--line);}
.btn-xuat svg{color:var(--green); transition:color .14s;}

/* HOVER RÕ RỆT (Lam yêu cầu): nền xanh nhạt + viền xanh + chữ xanh đậm + đổ bóng.
   UI-01.1: BỎ nhấc lên (translateY) — hover/active chỉ đổi màu/viền/bóng, nút đứng yên. */
.btn-xuat:hover{
  background:var(--green-tint); border-color:var(--green); color:#0F7A38;
  box-shadow:0 4px 12px rgba(22,163,74,.22);
}
/* UI-01.1: icon giữ nguyên vị trí giữa các trạng thái (chỉ đổi màu). */
.btn-xuat:hover svg{color:#0F7A38;}
.btn-xuat:active{box-shadow:0 2px 6px rgba(22,163,74,.18);}

/* Nút xuất WORD (trang Phát hành) — icon XANH DƯƠNG, không dùng xanh lá vì
   xanh lá là màu quy ước của Excel; để cùng màu sẽ gây nhầm định dạng file. */
.btn-xuat-word svg{color:var(--blue);}
.btn-xuat-word:hover{
  background:var(--blue-tint); border-color:var(--blue); color:#1D4FD8;
  box-shadow:0 4px 12px rgba(37,99,235,.22);
}
.btn-xuat-word:hover svg{color:#1D4FD8;}
.btn-xuat-word:active{box-shadow:0 2px 6px rgba(37,99,235,.18);}
.btn-xuat{transition:background .14s, border-color .14s, color .14s, box-shadow .14s;}
/* Trên màn hẹp mới cho xuống hàng */
@media (max-width:1200px){ .loc-bar{flex-wrap:wrap;} .loc-bar input[type=search]{flex-basis:100%;} }

/* Ô chọn ngày ZNS (Hạn TT / Ngày tạm ngừng) — gọn, nhãn nhỏ nằm trên ô date.
   Đồng bộ chiều cao 40px với các ô lọc khác, bo góc, viền mảnh. */
/* Ô chọn ngày ZNS (Hạn TT / Ngày tạm ngừng) — đẩy về PHÍA PHẢI của thanh lọc
   (margin-left:auto). Nhãn nằm NGANG bên trái ô: [icon][chữ] [ô ngày].
   Đồng bộ tone CAM với thanh ô nhập trang Phát hành (nhưng nhãn cùng hàng). */
.zns-oNgay{ flex:0 0 auto; margin-left:auto; display:inline-flex; flex-direction:row; align-items:center; gap:9px; height:36px; }  /* lượt 7: khớp 36px của thanh lọc */
.zns-oNgay label{ display:inline-flex; align-items:center; gap:5px;
  font-size:12px; font-weight:600; letter-spacing:.1px;
  color:var(--navy); line-height:1; white-space:nowrap; }
.zns-oNgay label svg{ width:14px; height:14px; color:var(--orange); flex:0 0 auto; }
/* Ô ngày = text dd/mm/yyyy + nút lịch, gói trong 1 khung viền chung */
.zns-ngay-wrap{ position:relative; display:inline-flex; align-items:center; height:36px;
  box-sizing:border-box; border:1px solid var(--line); border-radius:8px;
  background:var(--white); overflow:hidden; transition:border-color .15s, box-shadow .15s; }
.zns-ngay-wrap:hover{ border-color:var(--orange); }
.zns-ngay-wrap:focus-within{ border-color:var(--orange); box-shadow:0 0 0 3px var(--orange-tint); }
.zns-ngay-wrap.ph-loi{ border-color:var(--red); box-shadow:0 0 0 3px var(--red-tint); }
.zns-ngay-wrap input[type=text]{
  width:130px; height:100%; border:none !important; outline:none; background:transparent;
  padding:0 12px; font-size:13.5px; font-weight:500; color:var(--text);
  font-variant-numeric:tabular-nums; letter-spacing:.3px; text-align:left;
}
.zns-ngay-wrap input[type=text]:focus-visible{ outline:none; }

/* Thanh lọc ZNS dùng lại .ph-o/.ph-nhan/.ph-box của Phát hành để 3 select có
   NHÃN NGANG + icon. Bố cục ngang trong KHUNG trắng bo góc (đồng bộ .ph-loc của
   Phát hành). Ô ngày (.zns-oNgay) tự đẩy về phải. */
.ph-loc-zns{
  display:flex; flex-wrap:wrap; align-items:center; gap:12px 18px;
  padding:15px 16px; border:1.5px solid var(--line); border-radius:14px;
  background:var(--white); margin-bottom:16px;
}
.ph-loc-zns .ph-o{ display:flex; align-items:center; gap:9px; min-width:0; flex:0 0 auto; }
.ph-loc-zns .ph-box--sel{ width:210px; }
.ph-loc-zns .ph-box--sel-rong{ width:238px; }   /* ô Đợt: text dài hơn */
.ph-loc-zns .zns-oNgay{ margin-left:auto; }
@media (max-width:900px){
  .ph-loc-zns .ph-o{ flex:1 1 auto; }
  .ph-loc-zns .ph-box--sel,
  .ph-loc-zns .ph-box--sel-rong{ width:auto; flex:1 1 auto; }
  .ph-loc-zns .zns-oNgay{ margin-left:0; }
}

/* Màu giá trị trong cột tiền */
td.c-do{color:var(--red); font-weight:600;}
td.c-luc{color:var(--green); font-weight:600;}

/* --- 10) BẢNG DỮ LIỆU --- */
.bang-khung{background:var(--white); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow-card);}
/* KHÔNG đặt overflow ở bang-khung/bang-scroll trên desktop: overflow (kể cả
   hidden/auto) tạo "scroll container" khiến thead position:sticky dính SAI (đè
   giữa bảng) và sinh thanh cuộn riêng. Để trống → bảng cuộn theo CẢ TRANG, thead
   dính dưới topbar, chiều dài bảng = đúng số hàng hiển thị. */
.bang-scroll{ }
/* Chỉ cho trượt ngang khi màn hẹp (bảng rộng hơn khung). */
@media (max-width:1000px){ .bang-scroll{overflow-x:auto;} }
/* LƯỢT 8: đầu bảng theo demo (padding 14/18, viền --line-2 nhạt hơn, h2 15.5px).
   Dùng chung cho MỌI trang có bảng — gồm cả Phát hành & ZNS (2 trang này không
   dùng .loc-bar nên đây là chỗ duy nhất giao diện chạm tới). */
.bang-dau{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 18px; border-bottom:1px solid var(--line-2); flex-wrap:wrap;}
.bang-dau h2{font-size:15.5px; font-weight:700; color:var(--text);}
.bang-dau .phu{font-size:12.5px; color:var(--text-muted); font-weight:500;}

table.data{width:100%; font-size:var(--bang-chu); border-collapse:separate; border-spacing:0;}
table.data th, table.data td{padding:var(--bang-dem); text-align:left; border-bottom:1px solid var(--line-2); white-space:nowrap;}
/* Đầu bảng dùng biến thể "Đậm" mặc định của demo: nền xanh nhạt, chữ navy,
   11.5px và đường cam 2px bên dưới. */
table.data thead th{
  position:sticky; top:var(--topbar-h); z-index:2;
  background:#E9EEFB; color:#1A1F6B;
  font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.5px;
  border-bottom:2px solid #FF6600;
  box-shadow:none;
}
table.data thead tr{background:#E9EEFB;}
table.data thead th.sap{cursor:pointer; user-select:none;}
table.data thead th.sap:hover{background:#DDE5F8; color:var(--navy);}
table.data thead th.sap:focus-visible,
table.data thead th.th-sap a:focus-visible{outline:2px solid var(--orange); outline-offset:2px; border-radius:3px;}
table.data thead th.sap .mui{display:inline-block;line-height:1;vertical-align:middle;opacity:.7; font-size:10px; margin-left:3px; color:var(--orange);}
table.data thead th.sap.asc .mui, table.data thead th.sap.desc .mui{opacity:1; color:var(--orange);}
table.data tbody tr{transition:background .12s;}
table.data tbody tr:hover{background:var(--bg-soft);}
table.data tbody tr:last-child td{border-bottom:none;}
table.data td.tien-so{text-align:right; font-variant-numeric:tabular-nums;}
/* Bảng Phát hành: chừa LỀ PHẢI cho cột cuối (Còn nợ / Tổng tiền) để số không
   dán sát viền phải của bảng — dịch nhẹ cụm số vào trong cho thoáng. */
table.data-ph th:last-child,
table.data-ph td:last-child,
table.data-bk th:last-child,
table.data-bk td:last-child{ padding-right:22px; }
table.data td.am{color:var(--red); font-weight:600;}

/* Tiêu đề cột có link sắp xếp (server) */
table.data thead th.th-sap{cursor:pointer; user-select:none;}
table.data thead th.th-sap:hover{background:#DDE5F8; color:var(--navy);}
table.data thead th.th-sap a{color:inherit; display:inline-flex; align-items:center; gap:3px;}
table.data thead th.th-sap .mui{font-size:10px; color:var(--orange); opacity:.7;}
table.data thead th.th-sap[aria-sort="ascending"] .mui,
table.data thead th.th-sap[aria-sort="descending"] .mui{opacity:1;}
table.data thead th.text-right{text-align:right;}
table.data thead th.text-right a{justify-content:flex-end;}

/* Bảng công nợ: gọn để KHÔNG trượt ngang trên màn thường */
.data-conno{table-layout:auto;}
.data-conno th, .data-conno td{padding:9px 8px;}
.data-conno .col-stt{width:38px; text-align:center; padding-left:6px; padding-right:6px;}
.data-conno .col-ten{max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
/* Cột Chi tiết: đệm hai bên bằng nhau để tiêu đề và nút con mắt nằm cùng một trục. */
.data-conno .col-chitiet{width:86px; min-width:86px; text-align:center; padding-left:8px; padding-right:8px;}
.data-conno td.col-chitiet .btn-chitiet{display:flex; margin:0 auto;}
.data-conno .col-ghichu{max-width:150px;}
.data-conno .col-ghichu input{width:100%; max-width:150px;}
/* các cột tiền cho phép hẹp lại */
.data-conno .tien-so{padding-left:6px; padding-right:6px;}

/* Nút xem chi tiết — icon con mắt rõ, đẹp */
/* UI-02: nút Xem chi tiết 30×30, bo 8, icon 15 (chuẩn nút icon trong bảng). */
.btn-chitiet{
  width:30px; height:30px; border-radius:8px; border:1px solid var(--line);
  background:var(--white); color:var(--navy); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  transition:background .12s, color .12s, border-color .12s, box-shadow .12s;
}
/* LƯỢT 12: icon bị lệch LÊN vì <svg> là inline element, bị đẩy theo baseline
   của dòng chữ. display:block + line-height:0 ở nút → icon canh giữa tuyệt đối. */
.btn-chitiet{ line-height:0; padding:0; }
.btn-chitiet svg{width:15px; height:15px; display:block;}
.btn-chitiet:hover{background:var(--navy); color:#fff; border-color:var(--navy); box-shadow:var(--shadow-sm);}

@keyframes nhaySang{0%,62%{background-color:#FFF6D6;}100%{background-color:transparent;}}
table.data tbody tr.vua-doi,
table.data tbody tr.vua-doi>td{animation:nhaySang 1.6s ease-out;}
table.data tbody tr.vua-doi:hover,
table.data tbody tr.vua-doi:hover>td{background-color:#FFF6D6;}

/* Nút thao tác dạng icon trong bảng */
/* Nút thao tác dạng icon trong bảng — kiểu theo demo (32px, có viền, hover đổ
   đầy navy).
   GHI CHÚ: hiện KHÔNG file nào dùng class .thaotac (các trang dùng class riêng:
   .nsh-thaotac / .db-thaotac / .qt-thaotac / .btn-chitiet). Giữ lại làm kiểu
   chuẩn cho nút icon trong bảng nếu sau này cần. */
.thaotac{display:inline-flex; gap:4px; align-items:center;}
.thaotac button, .thaotac a{
  width:32px; height:32px; border-radius:8px;
  border:1px solid var(--line); background:var(--white);
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
  color:var(--text-muted); transition:background .12s, color .12s, border-color .12s;
}
.thaotac button:hover, .thaotac a:hover{
  background:var(--navy); color:#fff; border-color:var(--navy);
}
.thaotac .ic{width:16px; height:16px;}

/* --- 10b) PHÂN TRANG --- */
.phantrang{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:13px 18px; border-top:1px solid var(--line-2);}
.pt-trai{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-muted);}
.pt-trai select{padding:6px 10px; border:1px solid var(--line); border-radius:7px; font-size:13px; font-weight:600; cursor:pointer; background:var(--white);}
.pt-phai{display:flex; align-items:center; gap:6px;}
.pt-phai .pt-info{font-size:13px; color:var(--text-muted); margin-right:6px;}
.pt-nut{
  min-width:34px; height:34px; padding:0 9px; border-radius:8px; border:1px solid var(--line);
  background:var(--white); color:var(--text); font-size:13px; font-weight:600; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
}
/* LƯỢT 11: hover đổi nền + viền cho rõ (trước chỉ đổi màu chữ, rất mờ);
   trang đang xem tô CAM — màu nhấn của ADP, nổi hơn navy trên nền trắng. */
.pt-nut{transition:background .12s, border-color .12s, color .12s;}
.pt-nut:hover:not(:disabled):not(.active){background:var(--bg-soft); border-color:#D5DAE3; color:var(--navy);}
.pt-nut.active{background:var(--orange); color:#fff; border-color:var(--orange); box-shadow:0 2px 8px rgba(255,102,0,.28);}
.pt-nut:disabled{opacity:.4; cursor:not-allowed;}
.pt-cham{padding:0 4px; color:var(--text-muted);}

/* --- 11) NHÃN TRẠNG THÁI (chip) --- */
/* LƯỢT 9: chip trạng thái theo demo — bo 7px (không còn viên thuốc 999px),
   12px/600, padding 4px 10px, kèm CHẤM TRÒN cùng màu chữ ở đầu ("● Gạch tự động").
   Chấm tạo bằng ::before → KHÔNG phải sửa PHP, và KHÔNG dính vào <select
   class="tt-select tt-*"> (select không nhận ::before) → dropdown đổi trạng thái
   ở bảng NSH vẫn nguyên vẹn. */
.tt{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 10px; border-radius:7px; font-size:12px; font-weight:600; white-space:nowrap;
}
.tt::before{
  content:""; width:6px; height:6px; border-radius:50%;
  background:currentColor; flex-shrink:0;
}
/* Màu từng trạng thái — áp cho CẢ chip <span class="tt tt-*"> LẪN ô <select class="tt-select tt-*">.
   nhan_trang_thai()/tt_nsh()/tt_thu() trong functions.php trả về đúng các tên class này. */
.tt-do,        .tt-select.tt-do{        background-color:var(--red-tint);    color:var(--red);}
.tt-xanh,      .tt-select.tt-xanh{      background-color:var(--green-tint);  color:var(--green);}
.tt-xanhla,    .tt-select.tt-xanhla{    background-color:var(--green-tint);  color:var(--green);}
.tt-cam,       .tt-select.tt-cam{       background-color:var(--cam-tint);    color:var(--orange-dark);}
.tt-xanhduong, .tt-select.tt-xanhduong{ background-color:#E3EEFB;           color:var(--blue);}
.tt-teal,      .tt-select.tt-teal{      background-color:var(--teal-tint);   color:var(--teal);}
.tt-tim,       .tt-select.tt-tim{       background-color:var(--tim-tint);    color:var(--tim);}
.tt-indigo,    .tt-select.tt-indigo{    background-color:var(--indigo-tint); color:var(--indigo);}
.tt-xam,       .tt-select.tt-xam{       background-color:var(--line-2);      color:var(--text-muted);}

/* --- 12) TRANG ĐĂNG NHẬP --- */
/* (giữ nguyên các class .login-* nếu login.php dùng — bổ sung tối thiểu) */

/* --- 13) FOOTER --- */
.site-footer{display:flex;align-items:center;justify-content:center;min-height:var(--footer-row-h);background:var(--white);border-top:1px solid var(--line);padding:0 28px;text-align:center;font-size:12.5px;color:var(--text-muted);margin-left:var(--sidebar-w);}
.site-footer b{color:var(--navy);}
@media (max-width:900px){ .site-footer{min-height:var(--footer-row-h);margin-left:0;padding:8px 16px;} }

/* --- 14) TIỆN ÍCH NHỎ --- */
.muted{color:var(--text-muted);}
.text-left{text-align:left;}
.text-center{text-align:center;}
.text-right{text-align:right;}

/* Chuẩn căn cột theo NGỮ NGHĨA. Gắn cùng class cho th và td tương ứng để tiêu
   đề/thân luôn đồng trục; các tên sem-* không mang ý nghĩa độ rộng/layout. */
table.data :is(.sem-text,.sem-id){text-align:left;}
table.data :is(.sem-select,.sem-order,.sem-status,.sem-action,.sem-short,.sem-period){text-align:center;}
table.data :is(.sem-number,.sem-money,.sem-ratio){text-align:right;font-variant-numeric:tabular-nums;}
table.data thead th:is(.sem-text,.sem-id) a{justify-content:flex-start;}
table.data thead th:is(.sem-select,.sem-order,.sem-status,.sem-action,.sem-short,.sem-period) a{justify-content:center;}
table.data thead th:is(.sem-number,.sem-money,.sem-ratio) a{justify-content:flex-end;}
.sem-nowrap{white-space:nowrap!important;}
.sem-ellipsis{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
.table-empty-state{text-align:center!important;padding:28px 14px!important;color:var(--text-muted)!important;}
.mt8{margin-top:8px;} .mt16{margin-top:16px;}
/* LƯỢT 10: nhãn nhỏ dùng chung (tòa, "phụ", "bạn", "SH", "NSH"). Mặc định navy.
   Số đo theo demo: 11.5px/700, padding 2px 9px, bo 6px. */
.badge-loai{font-size:11.5px; font-weight:700; padding:2px 9px; border-radius:6px; background:var(--navy-tint); color:var(--navy);}

/* --- MÀU RIÊNG THEO TÒA (demo): SAM tím · FHA xanh dương · FHB teal ---
   Chỉ áp cho badge CÓ data-toa → các nhãn khác ("phụ", "bạn", "SH", "NSH")
   dùng chung class .badge-loai vẫn giữ màu navy, không bị đổi lây. */
.badge-loai[data-toa="SAM"]{background:#EEE7FB; color:#7C3AED;}   /* tím  — PA Tower */
.badge-loai[data-toa="FHA"]{background:#DFF1E7; color:#12805C;}   /* xanh lá đậm — FHOME A */
.badge-loai[data-toa="FHB"]{background:#FFE8D6; color:#C2410C;}   /* cam đất   — FHOME B */
.badge-loai[data-toa="FHOME"]{background:#DCF4F4; color:#0E8A8A;} /* teal — NSH F.Home */
/* Tòa rỗng/không xác định → giữ navy mặc định */
.badge-loai[data-toa=""]{background:var(--navy-tint); color:var(--navy);}

/* --- 15) RESPONSIVE: menu ứng dụng off-canvas trên màn nhỏ --- */
@media (max-width:900px){
  .app-shell{flex-direction:column;}
  .topbar{padding:0 12px;gap:8px;}
  .tb-left{flex:1 1 auto;gap:8px;overflow:hidden;}
  .tb-right{flex:0 0 auto;gap:8px;}
  .mobile-nav-trigger{
    width:44px;height:44px;min-width:44px;padding:0;border:1px solid var(--line);
    border-radius:10px;background:var(--white);color:var(--navy);cursor:pointer;
    display:inline-flex;align-items:center;justify-content:center;
  }
  .mobile-nav-trigger:hover{background:var(--bg-soft);border-color:var(--navy);}
  .mobile-nav-trigger-icon{width:20px;display:grid;gap:4px;}
  .mobile-nav-trigger-icon i{display:block;width:20px;height:2px;border-radius:2px;background:currentColor;}
  .mobile-nav-backdrop{
    position:fixed;inset:0;z-index:44;width:100%;height:100%;padding:0;border:0;
    display:block;background:rgba(16,20,45,.42);opacity:0;visibility:hidden;
    pointer-events:none;transition:opacity .2s,visibility .2s;cursor:pointer;
  }
  .mobile-nav-backdrop[hidden]{display:none;}
  body.adp-mobile-nav-open .mobile-nav-backdrop{
    opacity:1;visibility:visible;pointer-events:auto;
  }
  html.adp-mobile-nav-open,body.adp-mobile-nav-open{overflow:hidden;}
  .sidebar{
    width:min(320px,calc(100vw - 40px));max-width:100%;height:100vh;height:100dvh;
    position:fixed;top:0;left:0;z-index:45;flex-direction:column;
    overflow-x:hidden;overflow-y:auto;border-right:1px solid var(--line);border-bottom:0;padding:0;
    box-shadow:8px 0 30px rgba(16,24,40,.18);transform:translateX(-100%);visibility:hidden;
    transition:none;
  }
  html.adp-mobile-nav-ready .sidebar{transition:transform .22s ease,visibility 0s linear .22s;}
  body.adp-mobile-nav-open .sidebar{transform:translateX(0);visibility:visible;transition-delay:0s;}
  .mobile-nav-head{
    position:sticky;top:0;z-index:2;min-height:56px;padding:6px 10px 6px 16px;
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    background:var(--white);border-bottom:1px solid var(--line);
  }
  .mobile-nav-head b{font-size:15px;color:var(--navy);}
  .mobile-nav-close{
    width:44px;height:44px;min-width:44px;padding:0;border:1px solid var(--line);
    border-radius:10px;background:var(--white);color:var(--text-muted);cursor:pointer;
    display:inline-flex;align-items:center;justify-content:center;font-size:26px;line-height:1;
  }
  .mobile-nav-close:hover{background:var(--red-tint);border-color:var(--red);color:var(--red);}
  .side-menu{flex-direction:column;gap:3px;padding:8px 14px;}
  .side-nhom{display:block;}
  .side-link{height:auto;min-height:44px;padding:7px 9px;}
  .side-link.active::before{top:8px;bottom:8px;height:auto;}
  .side-nhan{display:block;min-width:0;line-height:1.35;white-space:normal;overflow-wrap:anywhere;}
  .side-foot{margin-top:auto;margin-left:0;padding:0 14px;border-top:1px solid var(--line);}
  .side-foot .side-link{min-height:44px;}
  .side-foot .side-nhan{display:block;}
  .content{padding:16px; margin-left:0;}
}
@media (max-width:560px){
  .tb-tieude{font-size:18px;}
  .tb-user-txt,.tb-mui{display:none;}
  .topbar .tb-user{width:40px;padding:4px;justify-content:center;}
  .tb-vach{display:none;}
}

/* ============================================================================
   MỤC 1 — SỬA TRÊN BẢNG + Ô TRƯỢT CHI TIẾT
   ============================================================================ */

/* Ô chọn trạng thái ngay trên bảng (có màu theo trạng thái) */
.tt-select{
  display:inline-block; width:auto; max-width:100%;
  border:1px solid var(--line); border-radius:999px; padding:4px 18px 4px 10px;
  font-size:11.5px; font-weight:700; cursor:pointer; background-color:var(--white);
  -webkit-appearance:none; appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2398A0AE' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 7px center;
}
/* cột trạng thái NSH co theo nội dung (không kéo select rộng) */
.data .col-tt{ white-space:nowrap; }

/* Ô nhập ghi chú trên bảng */
.inp-ghichu{
  width:100%; border:1px solid transparent; border-radius:6px; padding:5px 7px;
  font-size:12.5px; background:transparent; transition:background .2s, border-color .15s;
}
.inp-ghichu:hover{ border-color:var(--line); }
.inp-ghichu:focus{ border-color:var(--navy); background:var(--white); outline:none; }

/* Nút xem chi tiết */
/* LƯỢT 11 — ĐÃ GỠ khối .btn-chitiet TRÙNG ở đây.
   Nó khai báo LẠI cùng selector với khối ở phần "10) NÚT XEM CHI TIẾT" bên trên,
   nhưng nằm SAU nên THẮNG, ép nút về 30×28px (méo, không vuông) và hover chỉ đổi
   nền nhạt. Đó là lý do nút con mắt trông lệch so với demo.
   → Nay chỉ còn MỘT khai báo duy nhất ở trên (32×32, hover đổ đầy navy). */

/* Nền mờ phía sau ô trượt */
/* ===== LỚP (z-index) — thứ tự PHẢI giữ =====
   topbar 40 < sidebar 45 < nền mờ drawer 60 < drawer 61 < menu user 120.
   LỖI ĐÃ SỬA (lượt 5): trước đây nền mờ drawer để z-index:40, drawer 41 — thấp
   hơn sidebar (45) nên khi mở ô chi tiết, SIDEBAR NỔI ĐÈ LÊN lớp mờ, nhìn như
   drawer bị lỗi. Sidebar chỉ z-index cao từ lượt 2 (khi logo dời vào sidebar). */
.drawer-bg{
  position:fixed; inset:0; background:rgba(16,20,45,.42); opacity:0; visibility:hidden;  /* lượt 11: nền mờ theo demo */
  transition:opacity .2s; z-index:60;
}
.drawer-bg.mo{ opacity:1; visibility:visible; }

/* Ô trượt chi tiết (từ phải vào) */
.drawer{
  position:fixed; top:0; right:0; height:100vh; width:420px; max-width:92vw;   /* lượt 11: 400 → 420px theo demo */
  background:var(--white); box-shadow:-8px 0 30px rgba(16,24,40,.18);
  transform:translateX(100%); transition:transform .22s ease; z-index:61;
  display:flex; flex-direction:column;
}
.drawer.mo{ transform:translateX(0); }
/* Đầu drawer: KHÔNG cần position:sticky. Demo phải dùng sticky vì cả <aside>
   của họ là vùng cuộn; ở đây .drawer là flex-column và vùng cuộn là .drawer-body
   → đầu drawer vốn đã đứng yên. Thêm sticky chỉ là code thừa gây hiểu nhầm. */
.drawer-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:18px 20px; border-bottom:1px solid var(--line-2); background:var(--white);
  flex-shrink:0;
}
.drawer-head b{ color:var(--navy); font-size:15px; }
.drawer-close{
  border:none; background:transparent; font-size:18px; cursor:pointer; color:var(--text-mo);
  width:30px; height:30px; border-radius:9px; transition:background .12s, color .12s;
}
.drawer-close:hover{ background:var(--line); color:var(--text); }
.drawer-body{ padding:18px 20px; overflow-y:auto; flex:1 1 auto; }

/* Nút nhỏ gọn dùng trong bảng (thêm số, sửa, xóa, xem lịch sử...) */
.btn.mini{ padding:3px 10px; font-size:12px; border-radius:7px; }
button.mini{ line-height:1.3; }

/* Bảng thông tin trong ô trượt */
.ct-info{ font-size:13px; }
.ct-row{ display:flex; justify-content:space-between; gap:12px; padding:5px 0; }
.ct-nhan{ color:var(--text-muted); }
.ct-gt{ font-weight:600; text-align:right; word-break:break-word; }
.ct-info hr{ border:none; border-top:1px solid var(--line); margin:8px 0; }
.ct-info code{ background:var(--bg-soft); padding:2px 6px; border-radius:5px; font-size:11.5px; }

/* Lịch sử gạch nợ trong ô trượt */
.ct-h{ font-size:13.5px; color:var(--navy); margin:18px 0 8px; }
.ct-ls-item{ border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-bottom:8px; }
.ct-ls-top{ display:flex; justify-content:space-between; font-size:13px; }
.ct-ls-sub{ font-size:11.5px; margin-top:3px; }
.ct-ls .am{ color:var(--red); }


/* ============================================================================
   MODAL NHẬP SỐ TIỀN THỰC KHI GẠCH TAY (đủ / dư / thiếu)
   ============================================================================ */
/* Modal nằm TRÊN drawer (61) vì có thể mở modal từ trong drawer. */
.modal-bg{
  position:fixed; inset:0; background:rgba(10,12,61,.4); opacity:0; visibility:hidden;
  transition:opacity .18s; z-index:70; display:flex; align-items:center; justify-content:center;
}
.modal-bg.mo{ opacity:1; visibility:visible; }
.modal{
  background:var(--white); border-radius:var(--radius-lg); box-shadow:var(--shadow-menu);
  width:360px; max-width:92vw; padding:22px; transform:translateY(8px); transition:transform .18s;
}
.modal-bg.mo .modal{ transform:translateY(0); }
/* UI-02 (Trang 1): CHỈ 3 popup của index.php đặt position:relative + chừa chỗ nút X;
   KHÔNG tác động .modal các trang khác (vd 2 modal Danh bạ). */
#modal-bg .modal, #pa-modal-bg .modal{ position:relative; }
#modal-bg .modal h3, #pa-modal-bg .modal h3{ padding-right:30px; }
/* UI-02: nút đóng X góc phải 30×30 cho popup gạch tay / hoàn tác / kết quả (chỉ index có .modal-x). */
.modal-x{
  position:absolute; top:14px; right:14px; width:30px; height:30px; padding:0; z-index:2;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--line); border-radius:8px; background:var(--white);
  color:var(--text-muted); cursor:pointer;
  transition:background .12s, color .12s, border-color .12s;
}
.modal-x svg{ width:15px; height:15px; }
.modal-x:hover{ background:var(--bg-soft); color:var(--text); border-color:#D5DAE3; }
.modal-x:focus-visible{ outline:2px solid var(--navy); outline-offset:1px; }
/* UI-02: khóa cuộn nền khi popup của trang Theo dõi công nợ đang mở. */
body.idx-khoa-cuon{ overflow:hidden; }
.modal h3{ font-size:16px; color:var(--navy); margin-bottom:4px; }
.modal .modal-sub{ font-size:12.5px; color:var(--text-muted); margin-bottom:14px; }
.modal label{ display:block; font-size:12.5px; font-weight:700; color:var(--text-muted); margin-bottom:6px; }
.modal input[type=text]{
  width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:8px;
  font-size:18px; font-weight:700; color:var(--navy); text-align:right;
}
.modal .modal-hint{ font-size:12px; margin-top:8px; min-height:18px; }
.modal .modal-hint.du{ color:var(--green); }
.modal .modal-hint.thieu{ color:var(--orange-dark); }
.modal .modal-hint.du-tien{ color:var(--blue); }
.modal .modal-actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:18px; }

/* 04B — popup kết quả hoàn tác: chi tiết server trả sau commit, chỉ cuộn dọc. */
.pa-kq-modal{width:620px;max-width:calc(100vw - 24px);max-height:calc(100vh - 32px);overflow-y:auto;overflow-x:hidden;}
.pa-kq-dau{display:flex;align-items:flex-start;gap:12px;margin-bottom:12px;}
.pa-kq-dau h3{margin:0 0 4px;}
.pa-kq-dau .modal-sub{margin:0;line-height:1.45;}
.pa-kq-ic{width:38px;height:38px;border-radius:10px;background:var(--green-tint);color:var(--green);display:inline-flex;align-items:center;justify-content:center;flex:0 0 38px;}
.pa-kq-ic svg{width:20px;height:20px;}
.pa-kq-body{min-width:0;overflow-wrap:anywhere;}
.pa-kq-meta{margin:0;display:grid;gap:7px;}
.pa-kq-meta>div{display:grid;grid-template-columns:minmax(145px, .8fr) minmax(0, 1.5fr);gap:10px;padding:7px 9px;background:var(--bg-soft);border-radius:7px;}
.pa-kq-meta dt{font-size:12px;color:var(--text-muted);font-weight:600;}
.pa-kq-meta dd{margin:0;font-size:12.5px;color:var(--text);font-weight:600;min-width:0;overflow-wrap:anywhere;}
.pa-kq-ma{font-variant-numeric:tabular-nums;}
.pa-kq-tv{margin-top:12px;border:1px solid var(--line);border-radius:9px;overflow:hidden;}
.pa-kq-tv-dau{padding:9px 11px;background:#E9EEFB;color:var(--navy);font-size:12.5px;font-weight:700;}
.pa-kq-tv-dong,.pa-kq-tong{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:9px 11px;border-top:1px solid var(--line);font-size:12.5px;}
.pa-kq-tv-dong span{min-width:0;overflow-wrap:anywhere;}
.pa-kq-tv-dong strong,.pa-kq-tong strong{white-space:nowrap;font-variant-numeric:tabular-nums;}
.pa-kq-tong{background:var(--green-tint);color:#0F7A38;font-weight:700;}
.pa-kq-duphong{padding:12px;border:1px solid var(--green);border-radius:8px;background:var(--green-tint);color:#0F7A38;font-weight:600;}
@media(max-width:560px){
  .pa-kq-meta>div{grid-template-columns:1fr;gap:3px;}
  .pa-kq-tv-dong,.pa-kq-tong{flex-direction:column;gap:4px;}
}

/* Cột ghi chú thu hẹp: không tràn, rê chuột xem đủ (qua title).
   A1.1: text-overflow:ellipsis KHÔNG có tác dụng nếu thiếu overflow:hidden +
   white-space:nowrap đi kèm — trước đây input ghi chú dài không hiện dấu "…". */
.col-ghichu{ max-width:150px; }
.inp-ghichu{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ghichu-xem{ display:inline-block; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:bottom; }
/* Cột nút chi tiết luôn hiện, không co */
td:last-child .btn-chitiet{ margin:0 auto; display:flex; }


/* Nút gợi ý mã KH theo số tiền (trang gạch nợ) */
.btn-goiy{
  border:1px solid var(--teal); background:var(--teal-tint); color:var(--teal);
  border-radius:6px; padding:3px 9px; font-size:11.5px; font-weight:700; cursor:pointer; margin-right:4px;
}
.btn-goiy:hover{ background:var(--teal); color:#fff; }
.inp-makh:focus{ border-color:var(--navy); outline:none; }

/* Dropdown gợi ý cho GẠCH GỘP (hiện ngay dưới ô nhập, không tràn ngang) */
.dropdown-kq{position:absolute; top:100%; left:0; z-index:20; min-width:260px; margin-top:2px;}
.dropdown-kq .box{background:#fff; border:1px solid var(--line); border-radius:8px; max-height:220px; overflow:auto; box-shadow:0 6px 18px rgba(0,0,0,.12);}
.dropdown-kq .muc{padding:7px 10px; cursor:pointer; border-bottom:1px solid var(--line); font-size:12.5px;}
.dropdown-kq .muc:last-child{border-bottom:none;}
.dropdown-kq .muc:hover{background:var(--bg-soft);}
.dropdown-kq .trong{background:#fff; border:1px solid var(--line); border-radius:8px; padding:7px 10px; font-size:12px; color:var(--text-muted);}

/* ============================================================================
   Ô TÍCH CHỌN LÔ (dùng chung: gạch nợ nhóm ①③④, tiền mặt)
   → Kiểu ô chọn định nghĩa gọn tại mục "Ô CHỌN NỔI BẬT" phía dưới.
   ============================================================================ */
.th-chon, .td-chon{ width:44px; text-align:center; }
/* Dòng đang được chọn: nền teal nhạt + viền trái teal đậm để nổi bật rõ */
tr.dong-chon{ background:var(--teal-tint, #E6F7F2) !important; box-shadow:inset 3px 0 0 var(--teal); }
tr.dong-chon td{ font-weight:500; }
/* Bảng nhập SH/NSH: chọn dòng chỉ đổi màu/marker, không làm toàn hàng đậm và đổi hình học. */
.shzip-pv tr.dong-chon td,.nsh-pv tr.dong-chon td{font-weight:inherit;}
/* Thanh hành động lô: dính trên đầu bảng, nổi bật khi có mục được chọn */
.thanh-lo{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:var(--bg-soft,#F7F8FA); border:1px solid var(--line); border-radius:10px;
  padding:9px 14px; margin-bottom:10px; transition:border-color .2s, background .2s;
}
.thanh-lo.co-chon{ border-color:var(--teal); background:var(--teal-tint,#E6F7F2); }
.thanh-lo .dem-lo{ font-size:12.5px; }
.thanh-lo .dem-lo b{ color:var(--teal); }
/* Đếm "Đã chọn N/tổng" GỌN cạnh nút Xuất Word tab ③ (thay thanh chọn riêng) */
.ph-dem-lo{ font-size:12.5px; color:var(--text-muted); font-weight:500; white-space:nowrap; }
.ph-dem-lo b{ color:var(--orange); font-weight:700; }
.thanh-lo .btn{ margin-left:auto; }
.thanh-lo .btn:disabled{ opacity:.5; cursor:not-allowed; }

/* ============================================================================
   TRANG ĐĂNG NHẬP — thẻ giữa màn, logo vừa phải, form gọn
   ============================================================================ */
.login-page{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#EEF1F6,#E0E5F2); padding:24px;   /* LƯỢT 1: nền demo */
}
.login-box{
  width:100%; max-width:400px; background:var(--white);
  border:1px solid var(--line); border-radius:20px;
  box-shadow:0 20px 50px rgba(16,24,40,.14);
  padding:38px 34px; text-align:center;
}
.login-box .logo-row{display:flex; justify-content:center; margin-bottom:14px;}
.login-box .logo-row img{width:88px; height:88px; object-fit:contain;}
.login-box h1{font-size:22px; font-weight:800; color:var(--navy); letter-spacing:.3px;}
.login-box .sub{font-size:13px; color:var(--text-muted); margin-top:2px; margin-bottom:24px;}
.login-box form{display:flex; flex-direction:column; gap:6px; text-align:left;}
.login-box label{font-size:12.5px; font-weight:700; color:var(--text-muted); margin-top:8px;}
.login-box input{
  padding:11px 14px; border:1px solid var(--line); border-radius:10px;
  font-size:14px; background:var(--bg-soft); color:var(--text); transition:border-color .12s, background .12s;
}
.login-box input:focus{outline:none; border-color:var(--navy); background:var(--white);}
.login-box .btn{margin-top:18px; width:100%; justify-content:center; padding:12px; font-size:15px;}
.login-loi{
  background:var(--red-tint,#FDECEC); color:var(--red); border:1px solid var(--red);
  border-radius:10px; padding:10px 14px; font-size:13px; margin-bottom:14px; font-weight:600;
}

/* ============================================================================
   FORM NHẬP DỮ LIỆU (import.php) — mục có số tròn cam
   ============================================================================ */
.nhap-form .nhap-muc{display:flex; gap:16px; align-items:flex-start;}
.nhap-so{
  width:30px; height:30px; flex-shrink:0; border-radius:50%;
  background:var(--cam-tint,#FFEEDD); color:var(--orange-dark,#E8730C);
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:15px;
}
.nhap-noidung{flex:1; min-width:0;}
.nhap-tieude{font-weight:700; font-size:14.5px; color:var(--navy); margin-bottom:10px;}
.nhap-file{
  border:1.5px dashed var(--line); border-radius:12px; padding:14px 16px; background:var(--bg-soft);
}
.nhap-file input[type=file]{font-size:13px; width:100%;}
.nhap-ghichu{font-size:12px; color:var(--text-muted); margin-top:6px;}
.nhap-ngan{height:1px; background:var(--line); margin:20px 0 20px 46px;}

/* ============================================================================
   GẠCH NỢ — 4 nhóm bảng (số tròn icon, cột lý do/gán mã, phân trang client)
   ============================================================================ */
.gn-nhom{margin-bottom:18px;}
.gn-so{
  display:inline-flex; align-items:center; justify-content:center;
  width:24px; height:24px; border-radius:50%; color:#fff; font-weight:800; font-size:13px;
  margin-right:9px; vertical-align:middle;
}
.bang-dau .bang-mota{font-size:12px; color:var(--text-muted); margin-top:5px; font-weight:400; max-width:640px;}
.gn-empty{text-align:center; padding:22px; color:var(--text-muted); font-style:italic;}

/* Cột Lý do + Gán mã (nhóm xử lý tay) */
.data-gachtay .col-lydo{width:120px;}
.lydo-chip{font-size:10.5px;}
.data-gachtay .col-noidung{max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.data-gachtay .col-ganma{min-width:340px;}
.gt-wrap{display:flex; flex-direction:column; gap:7px;}
.gt-action-layout{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;gap:7px 12px;align-items:end;width:100%;}
.gt-action-layout>.form-gachtay{display:contents;}
.gt-action-layout .gt-hang-nhap{grid-column:1/-1;grid-row:1;}
.gt-action-layout .gt-hang-nut{grid-column:1;grid-row:2;}
.gt-action-layout>.form-hoan-tien{grid-column:2;grid-row:2;align-self:end;justify-self:end;margin:0;}
.gt-action-layout.gt-refund-only>.form-hoan-tien{grid-row:1;}
@media(max-width:620px){
  .gt-action-layout{grid-template-columns:minmax(0,1fr);}
  .gt-action-layout .gt-hang-nhap{grid-column:1;grid-row:1;}
  .gt-action-layout .gt-hang-nut{grid-column:1;grid-row:2;}
  .gt-action-layout>.form-hoan-tien{grid-column:1;grid-row:3;}
  .gt-action-layout.gt-refund-only>.form-hoan-tien{grid-row:1;}
}
.gt-hang-goiy{display:flex; align-items:center; gap:6px; flex-wrap:wrap;}
.goiy-nhan{font-size:11.5px; color:var(--text-muted);}
.btn-goiy{
  font-size:12px; font-weight:700; padding:4px 12px; border-radius:8px;
  border:1px solid var(--teal); background:var(--teal-tint,#DBF3F3); color:var(--teal); cursor:pointer;
}
.btn-goiy:hover{background:var(--teal); color:#fff;}
.form-gachtay{display:flex; flex-direction:column; gap:7px; margin:0;}
.gt-hang-nhap{display:grid; grid-template-columns:minmax(0,1fr); gap:7px; align-items:start; width:100%;}
.gt-hang-nhap .inp-makh{
  box-sizing:border-box; width:100%; min-width:0; padding:7px 10px; border:1px solid var(--line);
  border-radius:8px; font-size:12.5px;
}
.kq-makh{
  box-sizing:border-box;width:100%;min-width:0;font-size:11.5px;line-height:1.4;
  display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;text-align:left;
}
.direct-lookup-kq{display:block;width:100%;}
.direct-lookup-list{display:grid;gap:6px;width:100%;margin-top:6px;}
.direct-lookup-option{
  width:100%;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  padding:8px 10px;border:1px solid var(--line-2);border-radius:8px;background:var(--white);
  color:var(--text);font:inherit;text-align:left;cursor:pointer;
}
.direct-lookup-option:hover,.direct-lookup-option:focus-visible{border-color:var(--navy);background:var(--bg-soft);outline:none;}
.direct-lookup-option span{min-width:0;overflow-wrap:anywhere;}.direct-lookup-option small{flex:0 0 auto;color:var(--navy);font-weight:700;white-space:nowrap;}
.direct-lookup-selected{width:100%;padding:8px 10px;border:1px solid var(--line-2);border-radius:8px;background:var(--bg-soft);box-sizing:border-box;text-align:left;}
.direct-result-content{box-sizing:border-box;display:block;width:100%;margin:0;padding:0 10px;text-align:left;}
.gt-hang-nut{display:flex;width:100%;gap:8px;align-items:center;justify-content:flex-start;flex-wrap:wrap;text-align:left;}
.gio-ghep{
  display:none; position:fixed; inset:0; z-index:240; margin:0; padding:24px;
  background:rgba(15,31,58,.52); align-items:center; justify-content:center;
}
.gio-ghep.mo{display:flex;}
.gio-hop{
  width:min(720px,calc(100vw - 32px)); max-height:min(760px,calc(100vh - 48px));
  display:flex; flex-direction:column; overflow:hidden; background:var(--white);
  border:1px solid var(--line); border-radius:16px; box-shadow:0 24px 70px rgba(15,31,58,.28);
}
.gio-dau{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:18px 20px 14px; border-bottom:1px solid #E5E7EB;}
.gio-dau>div{min-width:0;text-align:left;}
.gio-dau b{display:block; color:var(--navy); font-size:17px;text-align:left;}
.gio-dau span{display:block; margin-top:4px; color:var(--text-muted); font-size:12.5px; font-weight:500;text-align:left;}
.gio-dong{width:34px; height:34px; flex:0 0 auto; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--navy); font-size:24px; line-height:1; cursor:pointer;}
.gio-dong:hover{background:var(--bg-soft); border-color:var(--navy);}
.gio-than{padding:18px 20px; overflow:auto;}
/* 04C — GIỎ GẠCH GỘP TÁCH HẲN HAI LUỒNG SH / NSH.
   Trước 04C hai ô tìm SH và NSH nằm cạnh nhau trong cùng một lưới 2 cột, nên
   người dùng dựng được giỏ TRỘN rồi mới bị backend từ chối. Nay mỗi lần chỉ
   MỘT luồng hiện: `.gio-o-row` xuống 1 cột và ô của luồng không hoạt động bị
   ẩn hẳn (`display:none`, không chỉ mờ) nên không thể focus hay gõ vào. */
.gio-che-do{display:flex; gap:8px; margin-bottom:12px;}
.gio-che-do-nut{
  flex:1 1 0; padding:8px 10px; border:1px solid var(--line); border-radius:8px;
  background:var(--white); color:var(--text-muted); font-size:12.5px; font-weight:600;
  cursor:pointer; transition:background .15s ease, border-color .15s ease, color .15s ease;
}
.gio-che-do-nut:hover:not(:disabled){background:var(--bg-soft); border-color:var(--navy);}
.gio-che-do-nut:focus-visible{outline:2px solid var(--navy); outline-offset:2px;}
.gio-ghep .gio-che-do-nut[aria-pressed="true"],
.gio-ghep .gio-che-do-nut[aria-pressed="true"]:hover:not(:disabled),
.gio-ghep .gio-che-do-nut[aria-pressed="true"]:focus,
.gio-ghep .gio-che-do-nut[aria-pressed="true"]:focus-visible,
.gio-ghep .gio-che-do-nut[aria-pressed="true"]:active:not(:disabled){
  background:var(--navy); border-color:var(--navy); color:#fff;
}
.gio-che-do-nut:disabled{opacity:.5; cursor:not-allowed;}
.gio-o-row{display:grid; grid-template-columns:1fr; gap:12px; margin-bottom:14px;}
.gio-o-row .o-tim[hidden]{display:none;}
.gio-makh,.gio-nsh{width:100%; padding:9px 11px; border:1px solid var(--line); border-radius:8px; font-size:12.5px;}
.gio-bang{width:100%; font-size:12.5px; border-collapse:collapse;}
.gio-duoi{display:flex; justify-content:space-between; align-items:center; padding:14px 20px; border-top:1px solid #E5E7EB; flex-wrap:wrap; gap:12px;}
.gio-tong{font-size:12.5px;}
.gio-nut{display:flex; align-items:center; gap:8px; margin-left:auto;}
body.gio-dang-mo{overflow:hidden;}
@media(max-width:640px){
  .gio-ghep{padding:12px; align-items:flex-end;}
  .gio-hop{width:100%; max-height:calc(100vh - 24px); border-radius:16px 16px 10px 10px;}
  .gio-duoi{align-items:stretch;}
  .gio-nut{width:100%; justify-content:flex-end;}
}

/* Phân trang client-side cho nhóm gạch nợ — dùng lại look phân trang server */
.gn-phantrang{padding:10px 16px; border-top:1px solid var(--line);}
.gn-phantrang:empty{display:none;}

/* ============================================================================
   NHẬP FILE SAO KÊ (gạch nợ) — theo mẫu: icon excel tròn + nút chọn file
   ============================================================================ */
/* Bố cục 1 HÀNG NGANG gọn — tận dụng chiều rộng, giảm chiều cao:
   [icon] [tiêu đề + phụ] [nút Chọn file] [tên file] ............ [Nạp vào hàng đợi] */
.sk-nhap{padding:16px 18px; margin-bottom:16px; border-radius:16px;}
/* Tất cả trên MỘT hàng ngang, tận dụng chiều rộng, giảm chiều cao */
.sk-form{display:flex; align-items:center; gap:14px; flex-wrap:wrap;}
.sk-ic{
  width:46px; height:46px; flex-shrink:0; border-radius:12px;
  background:var(--green-tint,#E4F5EE); color:var(--green,#1D9E75);
  display:flex; align-items:center; justify-content:center; position:relative; cursor:pointer;
  border:1px solid transparent;
  transition:background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.sk-ic .ic{width:24px; height:24px;}
/* UI-02 Trang 2: vùng chọn file KHÔNG nhấc lên khi hover/focus — chỉ đổi màu/viền/bóng. */
.sk-ic:hover,.sk-ic:focus-within{
  color:#087A42; background:#D8F3E3; border-color:var(--green);
  box-shadow:0 4px 12px rgba(22,163,74,.18);
}
.sk-ic input[type=file]{position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer;}
/* Khối tiêu đề: gọn, chỉ tiêu đề + phụ đề (2 dòng), không chứa nút */
.sk-info{flex:1 1 260px; min-width:180px; display:flex; flex-direction:column; gap:2px; margin-right:2px;}
.sk-tieude{font-weight:700; font-size:14.5px; color:var(--navy); line-height:1.3;}
.sk-phu{font-size:12px; color:var(--text-muted); line-height:1.3;}
.sk-tenfile{font-size:12.5px; flex:0 1 auto; min-width:100px; max-width:340px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.sk-tenfile:empty{display:none;}
/* Nút Nạp vào hàng đợi: dồn về bên PHẢI (margin-left:auto) */
.sk-phai{display:flex; align-items:center; gap:12px; margin-left:auto; flex:0 0 auto;}
.sk-phai .btn{white-space:nowrap;}
.sk-thongke{font-size:12.5px; color:var(--text-muted); white-space:nowrap;}
.sk-thongke #sk-chua{color:var(--orange-dark);}
.sk-thongke #sk-dagach{color:var(--green);}
.sk-nap{height:40px; padding:0 16px; gap:8px; border-radius:9px;}
.sk-nap .ic{width:18px; height:18px;}
.sk-khacphuc{margin-top:10px; border-top:1px solid var(--line); padding-top:9px;}
.sk-khacphuc summary{cursor:pointer; font-size:12.5px; color:var(--text-muted); font-weight:600;}
@media (max-width:760px){
  .sk-phai{margin-left:0;}
  .sk-info{margin-right:0;}
  .sk-thongke{flex-basis:100%;}
}

/* Popup xác nhận gạch nợ — thay hộp confirm mặc định của trình duyệt. */
.gn-xacnhan{
  position:fixed; inset:0; z-index:360; padding:24px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(15,31,58,.52); backdrop-filter:blur(2px);
}
.gn-xacnhan[hidden]{display:none;}
.gn-xacnhan-hop{
  position:relative;
  width:min(500px,calc(100vw - 32px)); padding:22px;
  background:var(--white); border:1px solid var(--line); border-radius:16px;
  box-shadow:0 24px 70px rgba(15,31,58,.28);
}
/* UI-01: nút đóng góc phải 30×30 — thêm cách đóng popup thứ tư (X). */
.gn-xacnhan-x{
  position:absolute; top:14px; right:14px; width:30px; height:30px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--line); border-radius:8px; background:var(--white);
  color:var(--text-muted); cursor:pointer;
  transition:background .12s, color .12s, border-color .12s;
}
.gn-xacnhan-x svg{ width:15px; height:15px; }
.gn-xacnhan-x:hover{ background:var(--bg-soft); color:var(--text); border-color:#D5DAE3; }
.gn-xacnhan-x:focus-visible{ outline:2px solid var(--navy); outline-offset:1px; }
.gn-xacnhan-dau{display:flex; align-items:flex-start; gap:14px; padding-right:34px;}
.gn-xacnhan-ic{
  width:44px; height:44px; flex:0 0 44px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  background:var(--orange-tint); color:var(--orange);
}
.gn-xacnhan-ic .ic{width:23px; height:23px;}
.gn-xacnhan-dau h2{font-size:17px; color:var(--navy); margin:1px 0 6px;}
.gn-xacnhan-dau p{margin:0; color:var(--text-muted); font-size:13px; line-height:1.6;}
.gn-xacnhan-luu-y{
  margin:16px 0 18px; padding:10px 12px; border-radius:9px;
  background:var(--orange-tint); color:var(--orange-dark); font-size:12px;
}
.gn-xacnhan-nut{display:flex; justify-content:flex-end; gap:9px;}
.gn-xacnhan-nut .btn{min-width:92px; justify-content:center;}
body.gn-dang-xacnhan{overflow:hidden;}
@media(max-width:520px){
  .gn-xacnhan{padding:12px; align-items:flex-end;}
  .gn-xacnhan-hop{width:100%; padding:18px; border-radius:16px 16px 10px 10px;}
  .gn-xacnhan-nut .btn{flex:1;}
}

/* ============================================================================
   Ô CHỌN NỔI BẬT (checkbox) — dùng cho mọi bảng có tích chọn.
   To hơn, có viền rõ, hover/checked nổi bật (tham khảo bảng nhận tiền mặt).
   ============================================================================ */
.o-chon{
  -webkit-appearance:none; appearance:none;
  width:20px; height:20px; margin:0; cursor:pointer;
  border:2px solid #c4c8da; border-radius:6px; background:var(--white);
  position:relative; vertical-align:middle; transition:background .12s,border-color .12s,box-shadow .12s;
  flex:0 0 auto;
}
.o-chon:hover{ border-color:var(--teal); box-shadow:0 0 0 3px var(--teal-tint,#DBF3F3); }
.o-chon:checked{ background:var(--teal); border-color:var(--teal); }
.o-chon:checked::after{
  content:''; position:absolute; left:6px; top:2px; width:5px; height:10px;
  border:solid #fff; border-width:0 2.5px 2.5px 0; transform:rotate(45deg);
}
.o-chon:focus-visible{ outline:none; box-shadow:0 0 0 3px var(--teal-tint,#DBF3F3); }
/* HOST FIX 02 — trạng thái DISABLED của component checkbox dùng chung (bổ sung
   MỚI, không đổi các trạng thái cũ). Hiện chỉ bảng Xem trước XML dùng (dòng hóa
   đơn trùng bị khóa); các trang khác không có .o-chon disabled nên không đổi. */
.o-chon:disabled{ background:var(--bg-soft); border-color:#DDE1EC; cursor:not-allowed; opacity:.7; }
.o-chon:disabled:hover{ border-color:#DDE1EC; box-shadow:none; }
.o-chon:checked:disabled{ background:#AAB2C5; border-color:#AAB2C5; }

/* Thanh phân trang client-side (khối .pt-thanh trong .pt-bang) */
.pt-thanh:empty{display:none;}
.pt-bang .phantrang{border-top:1px solid var(--line);}

/* ============================================================================
   TRANG THU TIỀN MẶT — form ghi nhận thiết kế lại (icon input + hộp lưu ý)
   ============================================================================ */
.kpi-so.c-cam{ color:var(--orange); }
.tong-bar-tm{margin-bottom:16px;}
.tong-bar-tm .kpi-txt{flex:1; min-width:0;}
.tm-kpi-dau{display:flex; align-items:center; justify-content:space-between; gap:8px;}
.tm-kpi-dau .kpi-nhan{margin:0;}
.tm-kpi-chip{flex:0 0 auto; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700;}
.tm-kpi-chip.i-cam{background:#FEF3E2;color:#B4740A;}
.tm-kpi-chip.i-blue{background:#E5EDFD;color:#2563EB;}
.tm-kpi-chip.i-green{background:#E4F6EB;color:#16A34A;}
.tm-kpi-chip.i-tim{background:#EEE7FB;color:#7C3AED;}
.tm-ghinhan{ padding:0; overflow:hidden; border-radius:16px; margin-bottom:16px; }
.tm-ghi-head{ display:flex; align-items:center; gap:8px; padding:16px 18px 0; }
.tm-ghi-head h2{ margin:0; font-size:15px; color:var(--text); }
.tm-buoc{ width:26px; height:26px; border-radius:50%; flex:0 0 26px; display:flex; align-items:center; justify-content:center; background:var(--orange); color:#fff; font-size:13px; font-weight:800; }
.tm-ghi-body{ padding:14px 18px 16px; }
.tm-ghi-form{ display:grid; grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) 180px auto; gap:12px; align-items:start; width:100%; margin:0; }
.tm-o{ display:flex; flex-direction:column; gap:4px; }
.tm-o label{ display:block; margin-bottom:1px; color:#485061; font-size:12px; font-weight:600; }
.tm-inp-wrap{ display:flex; align-items:center; position:relative; }
.tm-inp{
  width:100%; height:40px; padding:0 12px; border:1px solid var(--line); border-radius:9px;
  font-size:13.5px; background:var(--bg-soft); transition:border-color .15s, box-shadow .15s, background .15s;
}
.tm-inp:focus{ outline:none; background:#fff; border-color:var(--orange); box-shadow:0 0 0 3px var(--orange-tint); }
.tm-inp-readonly{ background:#F1F3F7; color:var(--text-muted); border-color:var(--line-2); }
.tm-inp-tien{ text-align:right; font-size:14px; font-weight:700; color:var(--navy); padding-right:28px; font-variant-numeric:tabular-nums; }
.tm-inp-suffix{ position:absolute; right:12px; color:var(--text-muted); font-weight:600; font-size:13px; pointer-events:none; }
.tm-hint{ font-size:11.5px; min-height:15px; padding-left:2px; }
.tm-btn{ height:40px; margin-top:20px; padding:0 18px; gap:7px; align-self:start; justify-content:center; border-radius:9px; box-shadow:0 2px 8px rgba(16,24,40,.16); }
.tm-btn .ic{width:16px; height:16px;}
@media(max-width:1050px){.tm-ghi-form{grid-template-columns:1fr 1fr 180px;}.tm-btn{grid-column:3; margin-top:0;}}
/* Hộp lưu ý: đẩy sang PHẢI, cùng hàng với nút ghi nhận */
.tm-luuy{
  margin-left:auto; flex:0 1 320px; align-self:flex-start;
  background:var(--blue-tint); border:1px solid #cfe0f5;
  border-radius:12px; padding:10px 15px;
  display:flex; align-items:center; gap:9px; flex-wrap:wrap;
}
.tm-luuy-tit{ display:flex; align-items:center; gap:6px; font-weight:700; color:var(--blue); font-size:13px; flex-shrink:0; }
.tm-luuy-tit .ic{ width:16px; height:16px; }
.tm-luuy p{ margin:0; font-size:12px; color:var(--navy); line-height:1.4; }
@media (max-width:900px){
  .tm-luuy{ margin-left:0; flex-basis:100%; }
}

/* ============================================================================
   TIỀN MẶT — 2 NÚT HỦY TÁCH BIỆT RÕ RÀNG
   · "Hủy lượt"  = khoản CHƯA gạch → viền cam nhạt, nhẹ nhàng (không đụng công nợ)
   · "Hủy gạch"  = khoản ĐÃ gạch  → đỏ cảnh báo + icon (hoàn nguyên công nợ, admin)
   ============================================================================ */
.btn-huyluot{
  padding:5px 10px; font-size:12px; border-radius:7px;
  background:var(--white); color:var(--orange-dark); border-color:var(--orange-tint);
}
.btn-huyluot:hover{ background:var(--orange-tint); border-color:#E8A76B; color:#B45309; box-shadow:0 3px 9px rgba(180,83,9,.12); }

.btn-huygach{
  padding:5px 10px; font-size:12px; border-radius:7px; gap:5px;
  background:var(--red-tint); color:var(--red); border-color:#F0C4C4;
}
.btn-huygach:hover{ background:var(--red); color:#fff; border-color:var(--red); }
.btn-huygach .ic{ width:14px; height:14px; }

/* Nút thao tác lô: hover sáng và chuyển động rõ, tránh navy tối khó nhận biết. */
.thanh-lo-tm .btn-lo{transition:background .16s,border-color .16s,color .16s,box-shadow .16s,transform .16s;}
.thanh-lo-tm .btn-lo:not(:disabled):hover{
  background:#2563EB; border-color:#2563EB; color:#fff;
  box-shadow:0 6px 16px rgba(37,99,235,.28); transform:translateY(-1px);
}
.thanh-lo-tm .btn-lo:not(:disabled):active{background:#1D4ED8;transform:translateY(0);box-shadow:0 3px 8px rgba(37,99,235,.22);}
.thanh-lo-tm .btn-lo:not(:disabled):focus-visible{outline:2px solid #2563EB;outline-offset:2px;}

/* ============================================================================
   TIỀN MẶT — GIAO DIỆN ĐIỆN THOẠI (≤720px)
   Bảng danh sách → danh sách THẺ (card); form ghi nhận + bộ lọc xếp dọc full;
   KPI 2 cột; thanh thao tác lô DÍNH ĐÁY màn hình khi có chọn.
   Giữ NGUYÊN 1 <table> (không nhân đôi DOM) → JS chọn lô/phân trang/ghi chú chạy y hệt.
   ============================================================================ */
@media (max-width:900px){

  /* --- KPI: 2 cột, nén gọn --- */
  .tong-bar-tm{ grid-template-columns:repeat(2,1fr); gap:0; }  /* LƯỢT 4: dải liền → không khe */
  .tong-bar-tm .kpi{ padding:10px 11px; gap:9px; }
  .tong-bar-tm .kpi-ic{ width:36px; height:36px; }
  .tong-bar-tm .kpi-ic .ic, .tong-bar-tm .kpi-ic svg{ width:20px !important; height:20px !important; }
  .tong-bar-tm .kpi-so{ font-size:17px; }
  .tong-bar-tm .kpi-nhan{ font-size:11px; margin-bottom:1px; }
  .tong-bar-tm .kpi-don{ font-size:10.5px; }

  /* --- Form ghi nhận: xếp dọc, ô + nút full chiều rộng, chạm dễ --- */
  .tm-ghi-body{ flex-direction:column; align-items:stretch; gap:12px; padding:14px; }
  .tm-ghi-form{ flex-direction:column; align-items:stretch; width:100%; gap:12px; flex:1 1 auto; }
  .tm-o{ width:100%; }
  .tm-inp-wrap{ width:100%; }
  .tm-inp{ height:48px; font-size:15px; }
  .tm-inp-wrap .tm-inp,
  .tm-inp-wrap .tm-inp:not(.tm-inp-tien),
  .tm-inp-tien{ width:100%; }
  .tm-btn{ width:100%; height:50px; font-size:15px; }

  /* --- Bộ lọc: ô tìm full · 2 select xếp 2 cột · nút chia hàng --- */
  #tm-loc-bar{ gap:8px; }
  #tm-loc-bar > input[type=search]{ flex:1 1 100%; width:100%; min-width:0; height:44px; }
  #tm-loc-bar > select{ flex:1 1 calc(50% - 4px); min-width:0; height:44px; }
  #tm-loc-bar > .btn-icon{ flex:1 1 auto; height:44px; justify-content:center; }

  /* ==========================================================================
     BẢNG → THẺ GỌN (compact card). Giữ 1 <table>; mỗi <tr> là flex-wrap,
     tự xuống dòng theo mức quan trọng:
       Dòng1: Mã KH + Tòa · [checkbox phải]
       Dòng2: Tên (mờ)
       Dòng3: Số tiền (to, cam) · [pill trạng thái phải]
       Dòng4: Còn nợ · Giờ · NV  (một dòng mờ, gọn)
       Dòng5: Ghi chú + nút thao tác
     ========================================================================== */
  .bang-tm .bang-scroll{ overflow:visible; }
  .bang-tm .bang-dau{ flex-wrap:wrap; gap:8px; }
  .bang-tm table.data,
  .bang-tm table.data tbody{ display:block; width:100%; }
  .bang-tm table.data thead{ position:absolute; left:-9999px; top:-9999px; }

  .bang-tm table.data tr{
    display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px;
    width:auto; position:relative;
    background:var(--white); border:1px solid var(--line); border-radius:12px;
    padding:12px 13px; margin-bottom:11px; box-shadow:var(--shadow-sm);
  }
  .bang-tm table.data tbody tr:hover{ background:var(--white); }
  .bang-tm table.data tr.dong-chon{ border-color:var(--teal); box-shadow:0 0 0 2px var(--teal-tint); }

  /* ô = flex item; bỏ viền/nền/nhãn mặc định của bảng */
  .bang-tm table.data td{ display:block; width:auto; border:none; padding:0; white-space:normal; text-align:left; }
  .bang-tm table.data td.td-stt{ display:none; }             /* ẩn STT */

  /* thứ tự trường trong thẻ */
  .bang-tm table.data td.td-makh   { order:1; flex:0 1 auto; }
  .bang-tm table.data td.td-toa    { order:2; flex:0 0 auto; }
  .bang-tm table.data td.td-chon   { order:3; flex:0 0 auto; margin-left:auto; }
  .bang-tm table.data td.td-ten    { order:4; flex:1 1 100%; }
  .bang-tm table.data td.td-tien   { order:5; flex:1 1 auto; }
  .bang-tm table.data td.td-tt     { order:6; flex:0 0 auto; }
  .bang-tm table.data td.td-conno  { order:7; flex:0 0 auto; }
  .bang-tm table.data td.td-gio    { order:8; flex:0 0 auto; }
  .bang-tm table.data td.td-nv     { order:9; flex:1 1 auto; }
  .bang-tm table.data td.col-ghichu{ order:10; flex:1 1 60%; }
  .bang-tm table.data td.td-thaotac{ order:11; flex:0 0 auto; margin-left:auto; }

  /* Dòng 1 — Mã KH to đậm + badge tòa + checkbox phải */
  .bang-tm table.data td.td-makh b{ font-size:16px; font-weight:800; color:var(--navy); }
  .bang-tm table.data td.td-chon{ width:auto; }
  .bang-tm table.data td.td-chon:empty{ display:none; }

  /* Dòng 2 — Tên khách (mờ, phụ) */
  .bang-tm table.data td.td-ten{
    color:var(--text-muted); font-size:13px; margin-top:-2px;
    max-width:none !important; overflow:visible !important; white-space:normal !important;
  }

  /* Dòng 3 — Số tiền to cam + pill trạng thái phải */
  .bang-tm table.data td.td-tien{ text-align:left; }
  .bang-tm table.data td.td-tien b{ font-size:18px; font-weight:800; color:var(--orange-dark); }

  /* Dòng 4 — meta gọn: "Còn nợ X · Giờ · NV Tên" (mờ, nhỏ) */
  .bang-tm table.data td.td-conno,
  .bang-tm table.data td.td-gio,
  .bang-tm table.data td.td-nv{ font-size:11.5px; color:var(--text-muted); font-weight:500; }
  .bang-tm table.data td.td-conno::before{ content:"Còn nợ "; color:var(--text-muted); font-weight:500; }
  .bang-tm table.data td.td-conno.am{ color:var(--red); font-weight:700; }
  .bang-tm table.data td.td-conno.am::before{ color:var(--text-muted); font-weight:500; } /* nhãn giữ mờ */
  .bang-tm table.data td.td-gio::before{ content:"·"; margin:0 4px 0 2px; color:var(--text-muted); }
  .bang-tm table.data td.td-nv::before { content:"· NV "; color:var(--text-muted); }

  /* Dòng 5 — ghi chú + nút, có vạch ngăn nhẹ phía trên */
  .bang-tm table.data td.col-ghichu{ margin-top:6px; }
  .bang-tm table.data td.col-ghichu .inp-ghichu{
    width:100%; border:1px solid var(--line); background:var(--white);
    border-radius:8px; padding:9px 10px; font-size:13.5px;
  }
  .bang-tm table.data td.col-ghichu .ghichu-xem{ font-size:13px; }
  .bang-tm table.data td.td-thaotac{ margin-top:6px; }
  .bang-tm table.data td.td-thaotac .btn{ padding:9px 16px; font-size:13px; }

  /* --- THANH THAO TÁC LÔ: DÍNH ĐÁY màn hình, chỉ hiện khi có chọn --- */
  .thanh-lo-tm{
    position:fixed; left:0; right:0; bottom:0; z-index:40;
    margin:0; border-radius:16px 16px 0 0; border:none; border-top:1px solid var(--line);
    background:var(--white); box-shadow:0 -6px 20px -8px rgba(15,17,60,.28);
    padding:12px 16px calc(12px + env(safe-area-inset-bottom));
    transform:translateY(110%); transition:transform .22s ease; pointer-events:none;
    flex-wrap:nowrap; align-items:center; gap:10px;
  }
  .thanh-lo-tm.co-chon{ transform:translateY(0); pointer-events:auto; background:var(--white); }
  .thanh-lo-tm > span:first-of-type{ display:none; }  /* ẩn dòng "Bàn giao bởi: ..." cho gọn */
  .thanh-lo-tm .dem-lo{ font-size:13px; flex:1 1 auto; }
  .thanh-lo-tm .btn{ margin-left:0; flex:0 0 auto; height:46px; padding:0 20px; font-size:14px; }
  /* chừa chỗ cuối bảng để thẻ cuối không bị thanh đáy che */
  .card:has(.thanh-lo-tm.co-chon) .bang-tm{ padding-bottom:74px; }
}

/* ============================================================================
   MOBILE CLOSURE C2 — Thu tiền mặt mobile-full (<=900px)
   Presentation only. The existing form, filters, one-table rows, status values,
   selection handlers, note editor and role-gated actions remain the authorities.
   ========================================================================== */
.tm-mobile-search{display:none;}
.tm-checkbox-touch{display:inline-flex;align-items:center;justify-content:center;}

@media(max-width:900px){
  /* Bound every cash surface to the content box so long factual text cannot
     enlarge the page. */
  #tm-live-kpi,.tm-ghinhan,#tm-live-table,.bang-tm,.bang-tm .bang-dau,
  #tm-loc-bar,.bang-tm .bang-scroll,.bang-tm table.data,
  .bang-tm table.data tbody,.bang-tm table.data tr{
    box-sizing:border-box;min-width:0;max-width:100%;
  }

  /* KPI values may be long currency strings; keep the two-column strip while
     allowing the text box to shrink and wrap instead of clipping the page. */
  .tong-bar-tm{grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%;}
  .tong-bar-tm .kpi{box-sizing:border-box;min-width:0;padding:10px;gap:8px;}
  .tong-bar-tm .kpi-ic{width:32px;height:32px;flex:0 0 32px;}
  .tong-bar-tm .kpi-txt,.tong-bar-tm .tm-kpi-dau{min-width:0;max-width:100%;}
  .tong-bar-tm .kpi-so{
    max-width:100%;font-size:clamp(13px,3.8vw,17px);line-height:1.2;
    white-space:normal;overflow-wrap:anywhere;font-variant-numeric:tabular-nums;
  }
  .tong-bar-tm .kpi-nhan,.tong-bar-tm .kpi-don{white-space:normal;overflow-wrap:anywhere;}

  /* The parent defect came from flex-direction declarations applied to a grid.
     Establish a real single-column flex layout and reset inherited grid slots. */
  .tm-ghinhan{display:block!important;width:100%;padding:0!important;overflow:hidden!important;}
  .tm-ghinhan .tm-ghi-head{
    display:flex!important;width:auto!important;min-width:0!important;height:auto!important;
    margin:0!important;padding:14px 14px 0!important;white-space:normal!important;
  }
  .tm-ghinhan .tm-ghi-body{
    display:block!important;width:100%!important;min-width:0!important;
    padding:12px 14px 14px!important;border:0!important;
  }
  .tm-ghinhan .tm-ghi-form{
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    width:100%!important;min-width:0!important;gap:12px!important;margin:0!important;
  }
  .tm-ghinhan .tm-o{
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    width:100%!important;min-width:0!important;gap:5px!important;
  }
  .tm-ghinhan .tm-o-ico{display:none!important;}
  .tm-ghinhan .tm-o label{width:auto!important;margin:0!important;white-space:normal!important;}
  .tm-ghinhan .tm-o .tm-inp-wrap,
  .tm-ghinhan .tm-o .tm-inp{
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
  }
  .tm-ghinhan .tm-o .tm-inp{height:48px!important;min-height:48px!important;font-size:15px;}
  .tm-ghinhan .tm-o .tm-hint{
    position:static!important;display:block!important;width:100%!important;max-width:100%!important;
    min-height:15px!important;padding:0 2px!important;border:0!important;background:transparent!important;
    box-shadow:none!important;white-space:normal!important;overflow-wrap:anywhere;
  }
  .tm-ghinhan .tm-ghi-form .tm-btn{
    box-sizing:border-box;grid-column:auto!important;width:100%!important;min-width:0!important;
    min-height:50px!important;margin:0!important;align-self:stretch!important;justify-self:stretch!important;
  }

  /* Mobile uses the same GET search input as desktop's topbar bridge. */
  .bang-tm .bang-dau{align-items:stretch!important;padding:13px 12px!important;}
  .bang-tm .bang-dau>h2{width:100%;min-width:0;white-space:normal;overflow-wrap:anywhere;}
  .bang-tm .bang-dau>.bang-ngan{display:none!important;}
  #tm-loc-bar{
    display:flex!important;flex:1 1 100%!important;width:100%!important;
    margin:0!important;gap:8px!important;align-items:stretch!important;flex-wrap:wrap!important;
  }
  #tm-loc-bar .tm-mobile-search{
    grid-template-columns:minmax(0,1fr) auto;gap:8px;
    flex:1 0 100%;width:100%;min-width:0;
  }
  #tm-loc-bar .tm-mobile-search label{
    grid-column:1 / -1;color:var(--navy);font-size:12px;font-weight:700;
  }
  #tm-mobile-search-input{
    box-sizing:border-box;width:100%;min-width:0;height:44px;padding:0 11px;
    border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--text);font:inherit;
  }
  #tm-loc-bar .tm-mobile-search-submit{
    box-sizing:border-box;min-width:88px;height:44px!important;min-height:44px!important;
    padding:0 14px!important;justify-content:center;
  }
  #tm-loc-bar>select{box-sizing:border-box;flex:1 1 calc(50% - 4px);width:auto;min-width:0;max-width:100%;height:44px;}
  #tm-loc-bar>.adp-control-reset{box-sizing:border-box;min-width:44px;min-height:44px;}

  /* One DOM, one table: rows become cards through 900px. */
  .bang-tm .bang-scroll{overflow:visible!important;}
  .bang-tm table.data,.bang-tm table.data tbody{display:block!important;width:100%!important;}
  .bang-tm table.data{table-layout:auto!important;}
  .bang-tm table.data thead{position:absolute!important;left:-9999px!important;top:-9999px!important;}
  .bang-tm table.data tbody{box-sizing:border-box;padding:12px;background:var(--bg-soft);}
  .bang-tm table.data tr{
    display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:7px 9px!important;
    width:100%!important;margin:0 0 12px!important;padding:13px!important;overflow:hidden!important;
  }
  .bang-tm table.data tr:last-child{margin-bottom:0!important;}
  .bang-tm table.data td{
    box-sizing:border-box;min-width:0!important;max-width:100%!important;padding:0!important;
    border:0!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
    overflow-wrap:anywhere;word-break:break-word;
  }
  .bang-tm table.data td.td-makh{flex:1 1 150px;}
  .bang-tm table.data td.td-makh,
  .bang-tm table.data td.td-makh b{white-space:normal!important;overflow-wrap:anywhere;word-break:break-word;}
  .bang-tm table.data td.td-ten{width:100%!important;flex:1 0 100%!important;}
  .bang-tm table.data td.td-tien{min-width:0!important;}
  .bang-tm table.data td.td-tt{min-width:0!important;text-align:left!important;}
  .bang-tm table.data td.td-tt .tt{
    min-width:0!important;max-width:100%!important;white-space:normal!important;
    overflow-wrap:anywhere;justify-content:flex-start;
  }
  .bang-tm table.data td.td-nv{min-width:0!important;}
  .bang-tm table.data td.col-ghichu{
    box-sizing:border-box;flex:1 0 100%!important;width:100%!important;min-width:0!important;
    padding-top:10px!important;border-top:1px solid var(--line-2)!important;
  }
  .bang-tm table.data td.col-ghichu .inp-ghichu{
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;
    min-height:44px;padding:9px 10px;white-space:normal;overflow-wrap:anywhere;
  }
  .bang-tm table.data td.col-ghichu .ghichu-xem{
    display:block;max-width:100%;white-space:normal!important;overflow:visible!important;
    text-overflow:clip!important;overflow-wrap:anywhere;word-break:break-word;
  }
  .bang-tm table.data td.td-thaotac{
    flex:1 0 100%!important;width:100%!important;margin:0!important;text-align:right!important;line-height:normal;
  }
  .bang-tm table.data td.td-thaotac .tm-detail-open{width:44px!important;height:44px!important;min-height:44px!important;}
  #tm-drawer.tm-detail-drawer .drawer-close{
    box-sizing:border-box;flex:0 0 44px;width:44px;height:44px;min-height:44px;
  }
  #tm-drawer .tm-detail-action-list .btn{min-height:44px;}
  #tm-hoantac .gn-xacnhan-x{
    box-sizing:border-box;top:8px;right:8px;width:44px;height:44px;min-height:44px;
  }
  #tm-hoantac .gn-xacnhan-nut .btn{min-height:44px;}

  .tm-checkbox-touch{box-sizing:border-box;width:44px;height:44px;margin:-10px;cursor:pointer;}
  .tm-checkbox-touch .o-chon{width:24px;height:24px;}
  .tm-checkbox-touch .o-chon:checked::after{left:7px;top:3px;width:6px;height:12px;}

  /* Selected batch action stays reachable without covering the final record,
     list end or pagination. The button may wrap rather than widen the viewport. */
  .thanh-lo-tm{
    box-sizing:border-box;display:grid!important;grid-template-columns:minmax(72px,1fr) minmax(0,auto);
    width:100%;max-width:100%;gap:10px!important;padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .thanh-lo-tm .tm-chon-dem{min-width:0;white-space:normal;overflow-wrap:anywhere;}
  .thanh-lo-tm .btn{
    box-sizing:border-box;max-width:min(230px,65vw);height:auto!important;min-height:48px;
    padding:8px 14px!important;white-space:normal!important;text-align:center;line-height:1.2;
  }
  .bang-tm:has(.thanh-lo-tm.co-chon){padding-bottom:calc(92px + env(safe-area-inset-bottom));}
  .bang-tm .pt-thanh,.bang-tm .phantrang{max-width:100%;min-width:0;flex-wrap:wrap;}
}

@media(max-width:820px){
  #tm-loc-bar .tm-mobile-search{display:grid;}
}

@media(max-width:430px){
  #tm-loc-bar>select{flex-basis:100%;width:100%;}
  .bang-tm table.data td.td-conno,
  .bang-tm table.data td.td-gio,
  .bang-tm table.data td.td-nv{flex:1 0 100%;}
  .bang-tm table.data td.td-gio::before,
  .bang-tm table.data td.td-nv::before{content:none;margin:0;}
  .thanh-lo-tm{grid-template-columns:minmax(0,1fr);}
  .thanh-lo-tm .btn{width:100%!important;max-width:none;}
  .bang-tm:has(.thanh-lo-tm.co-chon){padding-bottom:calc(142px + env(safe-area-inset-bottom));}
}

/* ============================================================================
   BẢNG NGOÀI SINH HOẠT — cột xuống hàng + nút thao tác bo viền
   ============================================================================ */
/* Độ rộng các cột bảng NSH — cân đối theo nội dung
   (tăng Tên đơn vị + Nội dung, thu gọn các cột phụ để bù lại) */
/* Độ rộng các cột bảng NSH (table-layout:fixed) — cố định các cột phụ, hai cột
   dài (Tên đơn vị + Nội dung) chia phần còn lại. Ghi chú thu gọn, không quá rộng. */
.data-nsh{ table-layout:fixed; width:100%; }
.data-nsh .c-stt{ width:42px; text-align:center; }
.data-nsh .c-toa{ width:60px; text-align:center; }
.data-nsh .nsh-col-ten{ width:20%; }        /* Tên đơn vị — chia phần còn lại */
.data-nsh .c-mst{ width:100px; white-space:nowrap; }
.data-nsh .c-sohd{ width:78px; white-space:nowrap; }
.data-nsh .nsh-col-nd{ width:22%; }          /* Nội dung — chia phần còn lại */
.data-nsh .c-tien{ width:110px; white-space:nowrap; text-align:right; }
.data-nsh .c-tt{ width:132px; }
.data-nsh .col-ghichu{ width:96px; }         /* Ghi chú — gọn lại, không tràn rộng */
.data-nsh .c-thaotac{ width:84px; text-align:center; padding-right:22px; }
/* Tên đơn vị + Nội dung: xuống hàng để hiện đủ, không cắt cụt; các cột khác 1 dòng */
.data .nsh-col-ten{ white-space:normal; line-height:1.4; word-break:break-word; }
.data .nsh-col-nd{ white-space:normal; line-height:1.4; word-break:break-word; }
.data td.nsh-col-ten, .data td.nsh-col-nd{ vertical-align:middle; }
/* Cột thao tác: 2 nút bo viền cạnh nhau, canh giữa */
/* Cột Thao tác (cột cuối): chừa lề phải để tiêu đề "Thao tác" nằm ĐÚNG GIỮA
   cụm 2 icon (xem chi tiết + xóa), không lệch sang phải (v=61). */
.nsh-thaotac{ text-align:center; padding-right:22px; }
.nsh-nut-wrap{ display:inline-flex; gap:6px; align-items:center; justify-content:center; }
/* A1.1-UI (H6): đồng bộ hệ hiệu ứng với nút "Xem chi tiết" (.btn-chitiet) ở bảng
   Danh sách công nợ — cùng kích thước vùng bấm (32px), bo góc 9px, hover ĐỔ ĐẦY
   màu + shadow + nhấc nhẹ. Nút Xóa vẫn giữ MÀU ĐỎ nguy hiểm. */
.nsh-nut{
  width:32px; height:32px; border-radius:9px; border:1px solid var(--line);
  background:var(--white); cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  padding:0; line-height:0; transition:all .12s;
}
.nsh-nut svg{ width:17px; height:17px; display:block; }
.nsh-nut-xem{ color:var(--navy); }
.nsh-nut-xem:hover{ background:var(--navy); color:#fff; border-color:var(--navy); box-shadow:var(--shadow-sm); }
.nsh-nut-xem:active{ transform:none; }
.nsh-nut-xoa{ color:var(--red); }
.nsh-nut-xoa:hover{ background:var(--red); color:#fff; border-color:var(--red); box-shadow:var(--shadow-sm); transform:translateY(-1px); }
.nsh-nut-xoa:active{ transform:translateY(0); }
.nsh-nut:focus-visible{ outline:2px solid var(--orange); outline-offset:2px; }

/* ============================================================================
   ĐỘ RỘNG CỘT DÙNG CHUNG cho các bảng .data (thống nhất mọi bảng)
   Áp bằng class trên <th>; cột không set = tự co giãn theo nội dung.
   ============================================================================ */
.data .cw-stt{ width:44px; text-align:center; }
.data .cw-toa{ width:64px; }
.data .cw-makh{ width:96px; white-space:nowrap; }
.data .cw-tien{ width:118px; white-space:nowrap; }
/* A1.1-UI (H2) + A1.1-UI-v2: Mã KH luôn hiển thị ĐẦY ĐỦ — KHÔNG ellipsis,
   KHÔNG xuống dòng, ở MỌI bảng có cột Mã KH. Giữ các class rộng-cột cũ
   (cw-makh/db-makh/bk-makh/td-makh) cho LAYOUT (độ rộng), nhưng đảm bảo KHÔNG
   TRUNCATE bằng class semantic DÙNG CHUNG .col-makh-full — gắn trực tiếp trên
   từng ô (th/td) Mã KH ở mọi bảng: Theo dõi công nợ, Thu tiền mặt, Danh bạ,
   ZNS, Phát hành, Tra cứu lịch sử, các bảng xem trước/import.
   !important vì có nhiều quy tắc ellipsis/nth-child TỔNG QUÁT theo VỊ TRÍ cột
   trong style.css (nth-child theo từng bảng, hoặc quy tắc "td" chung cho cả
   bảng như .data-db-preview/.data-nsh-preview) — !important đảm bảo class này
   LUÔN THẮNG bất kể quy tắc nào phía trên/dưới nó trong file, kể cả quy tắc
   thêm sau này nếu không tự ý dùng !important đè lại. */
.data .cw-makh, .data .db-makh, .data .bk-makh, .data .td-makh{
  white-space:nowrap; overflow:visible; text-overflow:clip;
}
.data .bk-makh{ min-width:96px; }
.col-makh-full{
  white-space:nowrap !important;
  overflow:visible !important;
  text-overflow:clip !important;
  min-width:90px;
}
.data .cw-gio{ width:78px; white-space:nowrap; }
.data .cw-nv{ width:120px; }
.data .cw-tt{ width:128px; }
.data .cw-sdt{ width:150px; white-space:nowrap; }
.data .cw-nut{ width:84px; text-align:center; }
/* Tên KH / đơn vị: cho co giãn nhưng có trần, không cắt cụt vô lý */
.data .cw-ten{ min-width:150px; }

/* ============================================================================
   BẢNG DANH BẠ SĐT — thứ tự cột: STT · Tòa · Mã KH · Tên · SĐT · Ghi chú · Thao tác
   ============================================================================ */
.data-danhba{ table-layout:auto; }
.data-danhba .cw-stt{ width:48px; text-align:center; }
.data-danhba .db-toa{ width:70px; text-align:center; }
.data-danhba td:nth-child(2){ text-align:center; }
.data-danhba .db-makh{ width:110px; white-space:nowrap; }
.data-danhba .db-ten{ min-width:180px; max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.data-danhba .db-sdt{ min-width:210px; }
.data-danhba .col-ghichu{ max-width:170px; }
.data-danhba .col-ghichu input{ width:100%; }
/* Cột Thao tác (cột cuối): chừa lề phải để tiêu đề "Thao tác" nằm ĐÚNG GIỮA
   cụm 2 icon (thêm số + lịch sử), không lệch sang phải (v=61). */
.data-danhba .db-nut{ width:96px; text-align:center; padding-right:22px; }
.data-danhba .db-thaotac{ text-align:center; padding-right:22px; }

/* Một số điện thoại (1 dòng trong ô SĐT): số + cụm nút sửa/xóa */
.data-danhba .db-so-dong{ display:flex; align-items:center; gap:4px; padding:2px 0; }
.data-danhba .db-so-hienthi{ font-variant-numeric:tabular-nums; }
.data-danhba .db-so-tat{ text-decoration:line-through; color:var(--text-muted); }
.data-danhba .badge-phu{ font-size:10px; margin-left:2px; }
/* Cụm nút sửa/xóa của từng số: hiện rõ luôn (không ẩn mờ) */
.data-danhba .db-so-nut{ display:inline-flex; gap:2px; margin-left:2px; opacity:1; }
.data-danhba .db-chuaco{ font-style:italic; }

/* Nút icon vuông nhỏ dùng chung trong bảng danh bạ (sửa/xóa/thêm/lịch sử) */
.data-danhba .db-nut-i{
  width:28px; height:28px; border-radius:7px; border:1px solid var(--line);
  background:var(--white); color:var(--navy); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; transition:all .12s; padding:0;
}
.data-danhba .db-nut-i svg{ width:15px; height:15px; }
.data-danhba .db-nut-i:hover{ background:var(--navy); color:#fff; border-color:var(--navy); }
.data-danhba .db-nut-xoa{ color:var(--red); }
.data-danhba .db-nut-xoa:hover{ background:var(--red); color:#fff; border-color:var(--red); }
/* Cụm nút cột Thao tác (thêm số + lịch sử) — canh giữa */
.data-danhba .db-nut-wrap{ display:inline-flex; gap:6px; justify-content:center; }
.data-danhba .db-nut{ width:132px; padding-right:12px; }
.data-danhba .db-thaotac{ padding-right:12px; }

/* Xóa toàn bộ mã: nội dung ngắn, không tạo cuộn ngang ở màn hẹp. */
.db-xoa-ma-modal{ width:480px; max-width:calc(100vw - 24px); overflow-x:hidden; }
.db-xoa-ma-code{
  margin:0 0 12px; padding:9px 11px; border-radius:7px;
  background:var(--red-tint); color:var(--red); overflow-wrap:anywhere;
}
.db-xoa-ma-modal textarea{
  display:block; width:100%; box-sizing:border-box; resize:vertical;
  min-height:74px; border:1px solid var(--line); border-radius:8px;
  padding:9px 11px; font:inherit; color:var(--text); outline:none;
}
.db-xoa-ma-modal textarea:focus{ border-color:var(--navy); box-shadow:0 0 0 3px var(--navy-tint); }

/* ============================================================================
   BẢNG XEM TRƯỚC ZNS — GIỐNG HỆT BẢNG THEO DÕI CÔNG NỢ (chốt 07/2026)
   ----------------------------------------------------------------------------
   · KHÔNG khung cuộn riêng → hiện bao nhiêu hàng thì cao bấy nhiêu (theo ô
     "Hiển thị N dòng/trang"). Cuộn bằng CẢ TRANG, không có thanh trượt dọc trong bảng.
   · Hàng tiêu đề STICKY dính ngay DƯỚI topbar khi vuốt — dùng chung cơ chế
     `table.data thead th{position:sticky; top:var(--topbar-h)}` của bảng công nợ.
   ⚠ TUYỆT ĐỐI KHÔNG đặt overflow (auto/hidden) ở khung bao ngoài: nó tạo
     "scroll container" làm thead dính SAI (dính đỉnh khung thay vì dưới topbar).
   · table-layout:fixed + width cố định từng cột → bảng vừa khung, KHÔNG cuộn ngang.
     Ba cột dài (tên / địa chỉ / nội dung CK) cắt ellipsis, rê chuột xem đủ (title).
   ============================================================================ */
.data-zns{ table-layout:fixed; width:100%; }
.data-zns th, .data-zns td{ padding:9px 8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.data-zns .col-stt{ width:42px;  text-align:center; padding-left:6px; padding-right:6px; }
.data-zns .cw-sdt{ width:112px; }
.data-zns .z-ky{   width:66px;  text-align:center; }
.data-zns .cw-makh{width:92px; }
.data-zns .z-cs{   width:70px;  text-align:right; }
.data-zns .z-dtt{  width:64px;  text-align:right; }
.data-zns .z-ngay{ width:82px;  text-align:center; }
.data-zns .cw-tien{width:104px; text-align:right; }
/* 3 cột dài — co giãn theo chỗ còn lại, quá dài thì cắt (tooltip xem đủ) */
.data-zns .z-ten{  width:13%; }
.data-zns .z-dc{   width:18%; }
.data-zns .z-ndck{ width:19%; }

/* ============================================================================
   BẢNG NSH NHÓM ② (gạch nợ) — chia cột cân đối, chống tràn bằng ellipsis
   2 cột ngày+tiền: NHỎ, bằng nhau. 2 cột nội dung+đề xuất: LỚN, bằng nhau.
   ============================================================================ */
.data-nsh2{ table-layout:fixed; width:100%; }
.data-nsh2 .th-chon, .data-nsh2 .td-chon{ width:40px; }
.data-nsh2 .col-stt{ width:44px; text-align:center; }
.data-nsh2 .n2-ngay{ width:120px; white-space:nowrap; }
.data-nsh2 .n2-tien{ width:120px; white-space:nowrap; }
/* 2 cột lớn chia đều phần còn lại */
.data-nsh2 .n2-nd, .data-nsh2 .n2-dx{ width:auto; }
.data-nsh2 td.n2-nd, .data-nsh2 td.n2-dx{
  max-width:0;                 /* cho phép ellipsis trong table-layout:fixed */
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.data-nsh2 td.n2-dx b{ font-weight:700; }

/* ============================================================================
   TRANG PHÁT HÀNH ĐỊNH KỲ (phathanh.php) — chốt 07/2026
   ============================================================================ */

/* --- 5 THẺ CHỨC NĂNG: chip SỐ + tên + "ngày N" NẰM CÙNG HÀNG ---
   Trước đây "ngày N" xuống dòng riêng → thẻ cao gấp đôi, thừa chỗ trống bên phải.
   Nay gộp một hàng, ngăn cách bằng dấu chấm giữa (·) → thẻ thấp, gọn. */
.ph-tabs{
  display:grid; grid-template-columns:repeat(5, 1fr); gap:8px; margin:14px 0 12px;
}
@media (max-width:1100px){ .ph-tabs{ grid-template-columns:repeat(3, 1fr); } }
@media (max-width:700px){  .ph-tabs{ grid-template-columns:repeat(2, 1fr); } }

.ph-tab{
  display:flex; align-items:center; gap:9px; text-align:left;
  padding:9px 11px; border-radius:10px; cursor:pointer;
  background:var(--white); border:1.5px solid var(--line);
  box-shadow:0 1px 2px rgba(15,17,60,.04);
  transition:border-color .15s, box-shadow .15s, background .15s;
  font-family:inherit;
}
.ph-tab:hover{
  border-color:var(--orange);
  box-shadow:0 6px 16px -8px rgba(242,118,28,.45);
}
/* Chip số: to, đậm, tương phản cao (KHÔNG dùng glyph ①②③ — font vẽ rất mờ) */
.ph-tab .ph-so{
  flex:0 0 auto; width:26px; height:26px; border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:800; line-height:1;
  background:var(--navy); color:var(--white);
}
.ph-tab .ph-noi{ min-width:0; line-height:1.5; }
.ph-tab .ph-ten{ font-size:13px; font-weight:700; color:var(--text); }
/* Dấu chấm ngăn cách — TO, đậm, dễ thấy (trước đây bé xíu gần như vô hình) */
.ph-tab .ph-cham{
  display:inline-block; margin:0 6px; font-size:20px; font-weight:900;
  line-height:0; vertical-align:middle; color:var(--text-muted);
}
/* "ngày N" — VIÊN THUỐC nền xanh nhạt bo tròn (như bản trước), nhưng nằm CÙNG HÀNG */
.ph-tab .ph-ngay{
  display:inline-block; white-space:nowrap;
  font-size:11.5px; font-weight:700;
  padding:2px 8px; border-radius:999px;
  background:var(--navy-tint); color:var(--navy);
}
/* Thẻ ĐANG CHỌN: viền + nền cam, chip số cam */
.ph-tab.active{
  border-color:var(--orange); background:var(--orange-tint);
  box-shadow:0 6px 16px -8px rgba(242,118,28,.5);
}
.ph-tab.active .ph-so{ background:var(--orange); color:var(--white); }
.ph-tab.active .ph-ten{ color:var(--orange-dark); }
.ph-tab.active .ph-ngay{ background:var(--white); color:var(--orange-dark); }
.ph-tab.active .ph-cham{ color:var(--orange); }

/* --- THANH LỌC trang Phát hành: DỒN TRÁI ---
   ⚠ .zns-oNgay có sẵn `margin-left:auto` (dùng cho trang ZNS, đẩy ô ngày sang phải).
     Ở đây phải GỠ, nếu không các ô bị dạt sang phải, chừa khoảng trống giữa xấu. */
.ph-loc{ flex-wrap:wrap; justify-content:flex-start; gap:10px 16px; }
.ph-loc .zns-oNgay{ margin-left:0; }

/* --- BẢNG XEM TRƯỚC: giống bảng theo dõi công nợ (không cuộn trong bảng,
       thead dính dưới topbar — dùng chung table.data). --- */

/* ① BẢNG KÊ — hiển thị ĐÚNG các cột của file Excel xuất ra.
   SAM/FHB: 8 cột · FHA: 9 cột (thêm "Sản lượng trực tiếp"). */
.data-bk{ table-layout:fixed; width:100%; }
.data-bk td{ padding:9px 8px; white-space:nowrap; }
/* Tiêu đề ĐƯỢC xuống dòng — tên cột dài ("Sản lượng trực tiếp", "Điện năng tiêu thụ")
   nếu ép 1 dòng sẽ bị cắt cụt thành "SẢN LƯỢNG TRỰC TIẾ". */
.data-bk th{ padding:8px; white-space:normal; line-height:1.25; vertical-align:bottom; }
/* ⚠ Độ rộng cột do <colgroup> trong phathanh_bang.php quyết định (tổng đúng 100%),
   KHÔNG đặt width ở đây — đặt cả 2 nơi sẽ đá nhau, cột phình/hụt lung tung. */
.data-bk .col-stt{ text-align:center; }

/* ②③④⑤ DANH SÁCH — 7 cột, tên khách co giãn theo chỗ còn lại */
.data-ph{ table-layout:fixed; width:100%; }
.data-ph th, .data-ph td{ padding:9px 8px; white-space:nowrap; }
.data-ph .col-stt{ text-align:center; }
.data-ph .ph-ten{ overflow:hidden; text-overflow:ellipsis; }
.data-ph .ph-tien{ text-align:right; }

/* ============================================================================
   PHÁT HÀNH ĐỊNH KỲ — bổ sung: dấu chấm tiêu đề to hơn + ô nhập đẹp hơn.
   ============================================================================ */

/* Dấu chấm ngăn cách màu xám ở tiêu đề bảng xem trước — TO & đậm hơn,
   trước đây nhỏ gần như vô hình. */
.bang-dau .phu .cham-xam{
  font-size:18px; font-weight:900; line-height:0;
  vertical-align:middle; color:var(--text-muted); margin:0 2px;
}

/* --- Ô NHẬP trang Phát hành — KIỂU ZNS: nhãn NẰM NGANG bên trái + khung nhập ---
   Mỗi ô = .ph-o (nhãn ngang + khung). Các ô canh TRÁI, cách đều nhau bằng gap
   cố định. Cỡ chữ/icon ĐỒNG BỘ ZNS (nhãn 12px, icon 14px, khung 40px, chữ 13.5px).
   QUAN TRỌNG: input dùng border:none !important để KHÔNG bị .loc-bar input (nếu có)
   vẽ thêm viền → tránh "2 đường viền". Khung ngoài .ph-box là viền DUY NHẤT.
   Ô "Cập nhật đến" đủ rộng cho chuỗi "22h48 ngày 13/07/2026". */
.ph-loc{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start;
  gap:14px 20px;
  padding:15px 16px; border:1.5px solid var(--line); border-radius:14px;
  background:var(--white); margin-bottom:16px;
}
.ph-o{ display:flex; align-items:center; gap:9px; min-width:0; flex:0 0 auto; }
.ph-nhan{
  display:inline-flex; align-items:center; gap:5px;
  font-size:12px; font-weight:600; letter-spacing:.1px;
  color:var(--navy); line-height:1; white-space:nowrap; flex:0 0 auto;
}
.ph-nhan svg{ width:14px; height:14px; color:var(--orange); flex:0 0 auto; }

/* LƯỢT 8: ô nhập trang Phát hành — bo 10→8, viền 1.5→1 cho đồng bộ demo.
   Giữ height:40px (khác thanh lọc 36px) vì đây là ô nhập chính, có nhãn riêng. */
.ph-box{
  display:flex; align-items:center; height:40px; box-sizing:border-box;
  border:1px solid var(--line); border-radius:8px; background:var(--white);
  padding:0 12px; gap:8px; min-width:0; flex:0 0 auto; overflow:hidden;
  transition:border-color .15s, box-shadow .15s;
}
.ph-box:hover{ border-color:var(--orange); }
.ph-box:focus-within{ border-color:var(--orange); box-shadow:0 0 0 3px var(--orange-tint); }
.ph-box.ph-loi{ border-color:var(--red); box-shadow:0 0 0 3px var(--red-tint); }
.ph-box input,
.ph-box select{
  border:none !important; outline:none; background:transparent; height:100%; width:100%;
  padding:0; margin:0; min-width:0; box-shadow:none;
  font-size:13.5px; font-weight:500; color:var(--text); font-family:inherit; text-align:left;
}
/* Khung .ph-box đã có focus-indicator riêng (viền + quầng cam) → bỏ outline
   navy mặc định của input/select khi focus bằng bàn phím, tránh "2 viền". */
.ph-box input:focus-visible,
.ph-box select:focus-visible{ outline:none; }
.ph-box input::placeholder{ color:var(--text-muted); font-weight:400; }
/* Bề rộng khung theo nội dung (đủ chỗ, không cắt chữ) */
.ph-box--sel { width:228px; }
.ph-box--gio { width:230px; }   /* đủ cho "22h48 ngày 13/07/2026" */
.ph-box--ngay{ width:138px; }   /* đủ cho "dd/mm/yyyy" */

/* Ô tòa (select) — mũi tên riêng, bỏ mũi tên mặc định */
.ph-box--sel{ padding-right:10px; }
.ph-box--sel select{
  appearance:none; -webkit-appearance:none; cursor:pointer;
  padding-right:22px; text-overflow:ellipsis;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23FF6600' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 2px center;
}
.ph-inp-gio{ letter-spacing:.2px; font-variant-numeric:tabular-nums; }
.ph-inp-ngay{ letter-spacing:.3px; font-variant-numeric:tabular-nums; }

/* Ô Số thông báo: [Số] [___] [/TB-ADP] — ô nhập có NỀN NHẠT tách khỏi affix */
.ph-box--tb{ width:176px; padding:0 6px; gap:0; }
.ph-box--tb .ph-box-pre,
.ph-box--tb .ph-box-suf{
  font-size:12px; font-weight:600; white-space:nowrap; letter-spacing:.2px;
  flex:0 0 auto; padding:0 7px;
}
.ph-box--tb .ph-box-pre{ color:var(--navy); }
.ph-box--tb .ph-box-suf{ color:var(--orange); }
.ph-inp-tb{
  text-align:center !important; font-variant-numeric:tabular-nums; letter-spacing:1px;
  font-weight:600; color:var(--navy); flex:1 1 auto;
  background:var(--bg-oto,#F3F5FA); border:1px solid var(--line-2) !important;
  border-radius:7px; height:28px; margin:0 2px;
}

@media (max-width:900px){
  .ph-loc{ gap:12px 16px; }
  .ph-o{ flex:1 1 auto; }
  .ph-box{ width:auto; flex:1 1 auto; }
}

/* ===== TRANG TRA CỨU LỊCH SỬ (tracuu.php) — quy cách giống Theo dõi công nợ ===== */
.loc-bar .loc-nhan{ display:inline-flex; align-items:center; gap:6px; }
.loc-bar .loc-tu-den{ font-size:12.5px; font-weight:700; color:var(--navy); }
/* Thanh lọc tra cứu: khoảng cách gọn để ô Mã KH không bị kéo dài */
.loc-tracuu{ gap:10px; flex-wrap:wrap; }
.loc-tracuu .o-ngay{ width:112px; }
.loc-tracuu select{ min-width:150px; }
.loc-tracuu select[name=nv]{ min-width:168px; }
/* Ô có icon bên trái (mã KH) */
.o-icon{ position:relative; display:inline-flex; align-items:center; }
.o-icon svg{ position:absolute; left:10px; width:16px; height:16px; color:var(--text-muted); pointer-events:none; }
.o-icon input{ padding-left:32px !important; }
.o-makh input{ width:130px; }
.loc-bar .o-ngay{ width:118px; text-align:left; font-variant-numeric:tabular-nums; letter-spacing:.3px; }
.data-tracuu td, .data-tracuu th{ vertical-align:top; }
.data-tracuu .tc-chitiet{ white-space:normal; min-width:280px; max-width:520px; }
.nhan-cn{ display:inline-block; padding:2px 9px; border-radius:20px;
  background:var(--navy-tint); color:var(--navy); font-size:12px; font-weight:600; white-space:nowrap; }
.tc-cm{ margin-top:3px; font-size:12px; line-height:1.5; }
.tc-cm .tc-cu{ color:var(--text-muted); }
.tc-cm .tc-moi{ color:var(--navy); font-weight:500; }
.tc-cm .tc-mt{ color:var(--orange); font-weight:700; }
.tc-phantrang{ display:flex; align-items:center; gap:6px; flex-wrap:wrap;
  justify-content:center; padding:14px 8px; }
.tc-phantrang .pt-nut{ display:inline-flex; align-items:center; justify-content:center;
  min-width:34px; height:34px; padding:0 10px; border:1.5px solid var(--line);
  border-radius:9px; background:var(--white); color:var(--navy); font-size:13px;
  font-weight:600; text-decoration:none; transition:border-color .15s, background .15s; }
.tc-phantrang .pt-nut:hover{ border-color:var(--orange); }
.tc-phantrang .pt-nut.active{ background:var(--orange); color:#fff; border-color:var(--orange); }

/* ===== ĐỒNG BỘ MŨI TÊN DROPDOWN TOÀN HỆ THỐNG =====
   Mọi <select> dùng chung 1 chevron CAM, kích thước 12px (như trang Tra cứu /
   Phát hành). Bỏ mũi tên mặc định của trình duyệt. Áp cả các select trong
   .loc-bar, .ky-chon, .pt-trai, .tt-select... để đồng nhất. */
select{
  -webkit-appearance:none !important; -moz-appearance:none !important; appearance:none !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23FF6600' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;
  background-position:right 10px center !important;
  background-size:12px 12px !important;
  padding-right:30px !important;
}
/* Ô select trong .ph-box đã có chevron riêng đặt sát mép phải (2px) — giữ nguyên vị trí đó */
.ph-box--sel select{ background-position:right 2px center !important; padding-right:22px !important; }
/* Bỏ mũi tên mặc định ở IE/Edge cũ */
select::-ms-expand{ display:none; }

/* ===== LƯỢT 10: LÀM ĐẸP DANH SÁCH SỔ XUỐNG =====
   LƯU Ý KỸ THUẬT: trình duyệt KHÔNG cho CSS tạo kiểu phần danh sách <option>
   khi nó bung ra (đó là widget của hệ điều hành). Chỉ tạo kiểu được:
     (1) chính ô <select>, (2) trạng thái mở/focus, (3) từng dòng <option> ở
     mức hạn chế (màu chữ/nền, khoảng đệm — Windows/Linux nhận, macOS bỏ qua).
   Muốn đẹp hoàn toàn phải viết dropdown giả bằng JS — việc lớn, dễ vỡ bàn phím
   và trình đọc màn hình, nên KHÔNG làm ở đợt này. */
select{ color:var(--text); }
/* Ô select khi ĐANG MỞ / focus: viền cam + quầng sáng → thấy rõ ô nào đang chọn */
select:focus{
  outline:none; border-color:var(--orange) !important;
  box-shadow:0 0 0 3px rgba(255,102,0,.15) !important;
}
/* Từng dòng trong danh sách sổ xuống */
select option{
  background:var(--white); color:var(--text);
  padding:9px 12px; font-weight:500;
}
select option:checked{ background:var(--orange-tint); color:var(--orange-dark); font-weight:700; }
/* Dòng nhóm/ngăn cách (vd "— Tất cả tòa —") cho nhạt đi */
select option[value=""]{ color:var(--text-mo); }
select optgroup{ font-size:11px; font-weight:800; color:var(--navy); background:var(--bg-soft); }

/* ===== VIỀN CAM KHI HOVER / FOCUS — ĐỒNG BỘ TOÀN HỆ =====
   Mọi ô nhập, ô tìm kiếm, select, textarea, checkbox: hover hoặc focus → viền cam.
   Dùng box-shadow để không làm nhảy layout (không đổi width do border). */
input[type=text], input[type=search], input[type=number], input[type=date],
input[type=password], input[type=email], input[type=tel], select, textarea{
  transition:border-color .15s, box-shadow .15s;
}
input[type=text]:hover, input[type=search]:hover, input[type=number]:hover,
input[type=date]:hover, input[type=password]:hover, input[type=email]:hover,
input[type=tel]:hover, select:hover, textarea:hover{
  border-color:var(--orange) !important;
}
input[type=text]:focus, input[type=search]:focus, input[type=number]:focus,
input[type=date]:focus, input[type=password]:focus, input[type=email]:focus,
input[type=tel]:focus, select:focus, textarea:focus{
  border-color:var(--orange) !important;
  box-shadow:0 0 0 3px var(--orange-tint) !important;
  outline:none !important;
}
/* Ô nhập nằm trong khung (.ph-box, .zns-ngay-wrap) — viền cam áp lên KHUNG
   khi con được hover/focus (vì input trong đó border:none). */
.ph-box:hover, .zns-ngay-wrap:hover,
.ph-box:focus-within, .zns-ngay-wrap:focus-within{
  border-color:var(--orange) !important;
}
.ph-box:focus-within, .zns-ngay-wrap:focus-within{
  box-shadow:0 0 0 3px var(--orange-tint) !important;
}
/* Checkbox native: giữ hiệu ứng cam; component .o-chon dùng riêng hệ teal. */
input[type=checkbox]:not(.o-chon){ accent-color:var(--orange); cursor:pointer; }
input[type=checkbox]:not(.o-chon):not(:disabled):hover{ outline:2px solid var(--orange-tint); outline-offset:1px; }

/* ============================================================================
   TOOLTIP TOÀN HỆ (v=61) — hiện nội dung đầy đủ khi ô bảng bị cắt bởi "..."
   ----------------------------------------------------------------------------
   Cơ chế: JS (footer.php) dò mọi ô trong table.data mà scrollWidth > clientWidth
   (tức đang bị ellipsis) → gắn data-tip. Hover → hiện bong bóng navy.
   KHÔNG dùng title gốc (chậm ~1s, chữ nhỏ, không đổi màu được).
   ============================================================================ */
#tip-toan-he{
  position:fixed; z-index:9999; pointer-events:none;
  max-width:420px; padding:7px 11px; border-radius:8px;
  background:var(--navy); color:#fff;
  font-size:12.5px; font-weight:500; line-height:1.45;
  box-shadow:0 6px 20px rgba(0,0,0,.22);
  white-space:normal; word-break:break-word;
  opacity:0; transform:translateY(3px); transition:opacity .12s, transform .12s;
}
#tip-toan-he.hien{ opacity:1; transform:translateY(0); }
#tip-toan-he::after{
  content:''; position:absolute; left:var(--tip-mui,14px); bottom:-5px;
  border:5px solid transparent; border-top-color:var(--navy); border-bottom:0;
}
#tip-toan-he.duoi::after{ bottom:auto; top:-5px;
  border-top:0; border-bottom:5px solid var(--navy); }
/* Ô đang bị cắt: gợi ý có thể xem đầy đủ */
table.data [data-tip]{ cursor:help; }

/* Tra cứu lịch sử — cột STT (v=61) */
.data-tracuu .tc-stt{ width:46px; text-align:center; padding-left:6px; padding-right:6px; }

/* ============================================================================
   THANH LỌC — PHƯƠNG ÁN 3 "LAI" (v=63 — sửa lỗi v=62 vẫn còn hở khoảng trắng)
   ----------------------------------------------------------------------------
   VẤN ĐỀ GỐC: mọi ô đều flex:0 0 auto → co hết về trái, thừa mảng trắng lớn ở
   thanh lọc (thấy rõ ở Danh bạ và Tra cứu lịch sử).

   ⚠ v=62 SỬA CHƯA TRIỆT ĐỂ. Có HAI thứ cùng gây hở, phải bỏ CẢ HAI:
     1) `max-width:520px/420px` trên ô co giãn → ô NGỪNG giãn khi chạm trần,
        phần dư biến thành khoảng trắng ngay giữa thanh lọc (đúng vùng Lam
        khoanh đỏ trong ảnh). Muốn "không thừa khoảng trống" thì KHÔNG được
        đặt trần cho ô này.
     2) `margin-left:auto` trên cụm nút → tranh khoảng thừa với ô co giãn.
        Khi ô đã flex:1 1 auto (không trần) thì nó tự nuốt sạch phần dư và cụm
        nút TỰ bị đẩy sát mép phải — thêm margin-left:auto vừa thừa vừa phá.

   CÁCH ĐÚNG (v=63):
     • `.o-linh-hoat` : flex:1 1 auto, KHÔNG max-width → nuốt hết phần dư.
     • Các <select>   : giữ kích thước tự nhiên (không bị kéo giãn méo).
     • `.loc-nut-cuoi`: KHÔNG margin-left:auto — để ô co giãn đẩy sang phải.
   Kết quả: lấp đầy hàng ngang, KHÔNG còn khoảng trắng thừa, cân ở mọi cỡ màn.
   ============================================================================ */
.loc-bar input[type=search].o-linh-hoat,
.loc-bar input[type=text].o-linh-hoat{
  flex:1 1 auto; min-width:180px;
}
/* Ô co giãn nằm trong bọc .o-icon (Tra cứu: icon + input) */
.loc-bar .o-icon.o-linh-hoat{ flex:1 1 auto; min-width:180px; }
.loc-bar .o-icon.o-linh-hoat input{ flex:1 1 auto; min-width:0; width:100%; }

/* Cụm nút cuối thanh: đứng liền nhau, KHÔNG margin-left:auto.
   LÝ DO (v=63): ô .o-linh-hoat đã flex:1 1 auto và KHÔNG còn max-width nên nó
   nuốt sạch khoảng thừa → cụm nút TỰ động bị đẩy tới sát mép phải. Nếu thêm
   margin-left:auto thì thành HAI thứ cùng tranh khoảng thừa → thanh lọc lại hở. */
.loc-bar .loc-nut-cuoi{
  display:inline-flex; align-items:center; gap:8px; flex:0 0 auto;
}
@media (max-width:1200px){
  .loc-bar input[type=search].o-linh-hoat,
  .loc-bar input[type=text].o-linh-hoat,
  .loc-bar .o-icon.o-linh-hoat{ flex:1 1 260px; }
}

/* ============================================================================
   ĐỔI MẬT KHẨU + QUẢN TRỊ (v=62)
   ============================================================================ */

/* --- Hộp báo (dùng ở doimatkhau.php + quantri.php) --- */
.canh-bao{
  padding:10px 14px; border-radius:var(--radius-sm); font-size:13px;
  font-weight:600; margin-bottom:14px; border:1px solid transparent;
}
.canh-bao-do{   background:#FDEBEB; color:var(--red);    border-color:#F5C6C6; }
.canh-bao-xanh{ background:#E8F6EE; color:#1E7B45;       border-color:#BFE5CE; }
.canh-bao-cam{  background:var(--orange-tint); color:var(--orange-dark); border-color:#F6D3B4; }

/* --- Form dọc: nhãn trên, ô dưới --- */
.form-doc .f-nhan{
  display:block; margin:12px 0 5px; font-size:12.5px; font-weight:700; color:var(--navy);
}
.form-doc input[type=text], .form-doc input[type=password], .form-doc select{
  width:100%; height:40px; padding:9px 12px;
  border:1px solid var(--line); border-radius:var(--radius-sm);
  font-size:13.5px; background:var(--white); color:var(--text);
}
.form-doc .f-goiy{ font-size:11.5px; color:var(--text-muted); margin-top:4px; }

/* --- Thanh đo độ mạnh mật khẩu (assets/matkhau.js) --- */
.mk-manh{ margin:7px 0 2px; }
.mk-thanh{
  height:6px; border-radius:99px; background:var(--line); overflow:hidden;
}
.mk-thanh i{ display:block; height:100%; border-radius:99px; transition:width .18s, background .18s; }
.mk-chu{ font-size:11.5px; margin-top:4px; color:var(--text-muted); text-align:left; }
.mk-yeu  .mk-thanh i{ background:var(--red); }    .mk-yeu  .mk-chu b{ color:var(--red); }
.mk-vua  .mk-thanh i{ background:var(--orange); } .mk-vua  .mk-chu b{ color:var(--orange-dark); }
.mk-kha  .mk-thanh i{ background:#EAB308; }       .mk-kha  .mk-chu b{ color:#A16207; }
.mk-tot  .mk-thanh i{ background:#22A45D; }      .mk-tot  .mk-chu b{ color:#1E7B45; }
.mk-yeucau{ font-size:11.5px; color:var(--text-muted); line-height:1.6; text-align:left; }
.mk-yeucau b{ color:var(--navy); }
/* Nút đổi mật khẩu luôn hiện: chưa đạt policy là cam nhạt rõ ràng, không xám. */
[data-mk-doi-form] [data-mk-submit]:disabled,
[data-mk-doi-form] [data-mk-submit]:disabled:hover{
  opacity:1!important; cursor:not-allowed; color:#fff!important;
  border-color:#F3A267!important; background:#F5B27F!important;
  box-shadow:none!important; filter:none!important; transform:none!important;
}
/* Trong khung đăng nhập thì căn giữa cho cân */
.login-box .mk-yeucau{ text-align:center; margin-top:12px; }
.login-box .mk-manh{ margin-bottom:2px; }

/* ============================================================================
   TRANG QUẢN TRỊ (quantri.php) — v=62
   ============================================================================ */

/* --- 4 CHỨC NĂNG: thẻ chip số — BÁM ĐÚNG KHUÔN .ph-tab của trang Phát hành ---
   Khác .ph-tab: chia 4 cột (Phát hành có 5), và là thẻ <a> (điều hướng bằng
   URL ?tab=) thay vì <button>, nên phải bỏ gạch chân của link. */
.qt-tabs{
  display:grid; grid-template-columns:repeat(5, 1fr); gap:8px; margin:14px 0 12px;
}
@media (max-width:1100px){ .qt-tabs{ grid-template-columns:repeat(2, 1fr); } }
@media (max-width:560px){  .qt-tabs{ grid-template-columns:1fr; } }

.qt-tab{
  display:flex; align-items:center; gap:9px; text-align:left;
  padding:9px 11px; border-radius:10px; cursor:pointer;
  background:var(--white); border:1.5px solid var(--line);
  box-shadow:0 1px 2px rgba(15,17,60,.04);
  transition:border-color .15s, box-shadow .15s, transform .12s, background .15s;
  font-family:inherit; text-decoration:none;
}
.qt-tab:hover{
  border-color:var(--orange); transform:translateY(-2px);
  box-shadow:0 6px 16px -8px rgba(242,118,28,.45);
}
/* Chip số: to, đậm, tương phản cao (KHÔNG dùng glyph ①②③ — font vẽ rất mờ) */
.qt-tab .qt-so{
  flex:0 0 auto; width:26px; height:26px; border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:800; line-height:1;
  background:var(--navy); color:var(--white);
}
.qt-tab .qt-noi{ min-width:0; line-height:1.5; }
.qt-tab .qt-ten{ font-size:13px; font-weight:700; color:var(--text); }
.qt-tab .qt-cham{
  display:inline-block; margin:0 6px; font-size:20px; font-weight:900;
  line-height:0; vertical-align:middle; color:var(--text-muted);
}
.qt-tab .qt-phu{
  display:inline-block; white-space:nowrap;
  font-size:11.5px; font-weight:700;
  padding:2px 8px; border-radius:999px;
  background:var(--navy-tint); color:var(--navy);
}
/* Thẻ ĐANG CHỌN: viền + nền cam, chip số cam */
.qt-tab.active{
  border-color:var(--orange); background:var(--orange-tint);
  box-shadow:0 6px 16px -8px rgba(242,118,28,.5);
}
.qt-tab.active .qt-so{ background:var(--orange); color:var(--white); }
.qt-tab.active .qt-ten{ color:var(--orange-dark); }
.qt-tab.active .qt-phu{ background:var(--white); color:var(--orange-dark); }
.qt-tab.active .qt-cham{ color:var(--orange); }

/* --- Hộp mật khẩu tạm (hiện MỘT LẦN sau khi tạo/cấp lại) --- */
.qt-mktam{
  background:var(--orange-tint); border:1.5px solid var(--orange);
  border-radius:var(--radius-lg); padding:14px 18px; margin-bottom:16px;
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
}
.qt-mktam-nhan{
  display:inline-flex; align-items:center; gap:7px;
  color:var(--orange-dark); font-weight:700; font-size:13px;
}
.qt-mktam-nhan svg{ width:18px; height:18px; }
.qt-mktam-so{
  font-family:ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size:19px; font-weight:800; letter-spacing:1.5px;
  background:var(--white); color:var(--navy);
  padding:7px 14px; border-radius:8px; border:1px solid var(--orange);
  user-select:all;
}
.qt-mktam-ghi{ flex:1 1 100%; font-size:11.5px; color:var(--orange-dark); line-height:1.6; }

/* --- Khối ghi chú "nguyên tắc / vì sao" --- */
.qt-ghichu{ font-size:12.5px; line-height:1.75; }
.qt-ghichu ul{ margin:8px 0 0; padding-left:20px; }
.qt-ghichu li{ margin-bottom:4px; color:var(--text-muted); }
.qt-ghichu li b{ color:var(--text); }
.qt-ghichu code{
  background:var(--bg-soft); padding:1px 5px; border-radius:4px;
  font-size:11.5px; color:var(--navy);
}

/* --- Bảng tài khoản --- */
.data-qtuser .qt-stt{ width:46px; text-align:center; }
.data-qtuser .qt-hoten{ max-width:200px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.data-qtuser .qt-thaotac{ width:160px; text-align:center; padding-right:22px; }
.qt-nut-wrap{ display:inline-flex; gap:5px; align-items:center; justify-content:center; }
/* Dùng lại nút icon vuông của danh bạ cho bảng quản trị */
.data-qtuser .db-nut-i{
  width:28px; height:28px; border-radius:7px; border:1px solid var(--line);
  background:var(--white); color:var(--navy); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; transition:all .12s; padding:0;
}
.data-qtuser .db-nut-i svg{ width:15px; height:15px; }
.data-qtuser .db-nut-i:hover{ background:var(--navy); color:#fff; border-color:var(--navy); }
.data-qtuser .db-nut-xoa{ color:var(--red); }
.data-qtuser .db-nut-xoa:hover{ background:var(--red); color:#fff; border-color:var(--red); }

/* --- Bảng dung lượng: thanh tỉ lệ --- */
.data-qtbang .qt-stt{ width:46px; text-align:center; }
.data-qtbang .qt-tile{ width:190px; }
.qt-thanh{
  display:inline-block; width:110px; height:7px; border-radius:99px;
  background:var(--line); overflow:hidden; vertical-align:middle; margin-right:7px;
}
.qt-thanh i{ display:block; height:100%; background:var(--navy); border-radius:99px; }

/* --- Bảng khoá/giá trị (Môi trường, Migration) --- */
.data-qtkv td{ padding:9px 18px; }
.data-qtkv td:first-child{ color:var(--text-muted); width:52%; }
.qt-cot2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:12px; }
@media (max-width:1000px){ .qt-cot2{ grid-template-columns:1fr; } }

/* --- Bảng kiểm tra toàn vẹn --- */
.data-qtkt .qt-stt{ width:46px; text-align:center; }
.data-qtkt .qt-so{ width:120px; }
.data-qtkt .qt-ktten{ white-space:normal; max-width:340px; font-weight:600; }
.data-qtkt .qt-ktY{ white-space:normal; max-width:460px; font-size:12px; line-height:1.6; }

/* --- Form dọn nhật ký --- */
.qt-don-form{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:14px; }
.qt-don-form .o-ngay{
  height:40px; padding:9px 12px; width:130px;
  border:1px solid var(--line); border-radius:var(--radius-sm);
  font-size:13.5px; font-variant-numeric:tabular-nums;
}

/* ============================================================================
   MENU NGƯỜI DÙNG (topbar) + POPUP HƯỚNG DẪN (v=64)
   ============================================================================ */

/* --- Khối người dùng giờ là NÚT mở menu --- */
.tb-user-boc{ position:relative; flex-shrink:0; }
/* Bỏ border-left cũ: vạch ngăn nay là phần tử riêng .tb-vach (giống demo),
   để border-left nữa sẽ thành HAI vạch. */
.topbar .tb-user{
  display:flex; align-items:center; gap:10px;
  height:40px; padding:4px 10px 4px 5px;
  background:var(--white); border:1px solid var(--line);
  border-radius:10px; cursor:pointer; font-family:inherit;
  transition:background .12s, border-color .12s;
}
.topbar .tb-user:hover{ background:var(--bg-soft); }
.tb-mui{ display:flex; align-items:center; color:var(--text-mo); flex-shrink:0; }
.tb-mui svg{ width:15px; height:15px; transition:transform .15s; }
#tb-user-nut[aria-expanded="true"] .tb-mui svg{ transform:rotate(180deg); }

/* --- Menu xổ xuống --- */
.tb-menu{
  position:absolute; top:calc(100% + 8px); right:0; z-index:120;
  min-width:230px; padding:6px;
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--radius-md); box-shadow:var(--shadow-menu);   /* LƯỢT 5: theo demo */
  opacity:0; visibility:hidden; transform:translateY(-6px);
  transition:opacity .14s, transform .14s, visibility .14s;
}
.tb-menu.mo{ opacity:1; visibility:visible; transform:translateY(0); }
.tb-menu-dau{
  padding:9px 11px 10px; border-bottom:1px solid var(--line); margin-bottom:5px;
  display:flex; flex-direction:column; gap:2px;
}
.tb-menu-dau b{ font-size:13px; color:var(--text); }
.tb-menu-dau span{ font-size:11px; color:var(--text-muted); }
.tb-menu-muc{
  display:flex; align-items:center; gap:10px;
  padding:9px 11px; border-radius:8px;
  font-size:13px; font-weight:600; color:var(--text); cursor:pointer;
  transition:background .12s, color .12s;
}
.tb-menu-muc svg{ width:16px; height:16px; flex:0 0 auto; color:var(--navy); }
.tb-menu-muc:hover{ background:var(--navy-tint); color:var(--navy); }
.tb-menu-thoat{ color:var(--red); }
.tb-menu-thoat svg{ color:var(--red); }
.tb-menu-thoat:hover{ background:#FDEBEB; color:var(--red); }

/* --- Popup hướng dẫn --- */
.hd-nen{
  position:fixed; inset:0; z-index:200; background:rgba(15,17,60,.45);
  opacity:0; visibility:hidden; transition:opacity .18s, visibility .18s;
}
.hd-nen.mo{ opacity:1; visibility:visible; }
.hd-hop{
  position:fixed; z-index:201; top:50%; left:50%;
  transform:translate(-50%,-48%) scale(.98);
  width:min(860px, calc(100vw - 40px)); max-height:min(86vh, 900px);
  display:flex; flex-direction:column; min-width:0; min-height:0;
  background:var(--white); border-radius:var(--radius-lg);
  box-shadow:0 24px 64px -12px rgba(15,17,60,.45);
  opacity:0; visibility:hidden;
  transition:opacity .18s, transform .18s, visibility .18s;
}
.hd-hop.mo{ opacity:1; visibility:visible; transform:translate(-50%,-50%) scale(1); }
.hd-dau{
  display:flex; align-items:center; justify-content:space-between;
  padding:15px 20px; border-bottom:1px solid var(--line); flex:0 0 auto;
}
.hd-dau b{ font-size:16px; color:var(--orange); }
.hd-dong{
  width:32px; height:32px; border-radius:8px; border:1px solid var(--line);
  background:var(--white); color:var(--text-muted); font-size:20px; line-height:1;
  cursor:pointer; transition:all .12s;
}
.hd-dong:hover{ background:var(--red); color:#fff; border-color:var(--red); }
.hd-than{
  padding:20px 24px 24px; overflow-y:auto; overflow-x:hidden;
  flex:1 1 auto; min-width:0; min-height:0;
  overscroll-behavior:contain; scrollbar-gutter:stable;
}
.hd-dangtai{ padding:40px; text-align:center; color:var(--text-muted); font-size:13px; }

/* --- Popup đổi mật khẩu --- */
.mkp-nen{
  position:fixed; inset:0; z-index:220; background:rgba(15,31,58,.48);
  opacity:0; visibility:hidden; transition:opacity .18s, visibility .18s;
}
.mkp-nen.mo{opacity:1; visibility:visible;}
.mkp-hop{
  position:fixed; z-index:221; top:50%; left:50%; width:min(520px,calc(100vw - 32px));
  transform:translate(-50%,-48%) scale(.98); background:var(--white); border:1px solid var(--line);
  border-radius:16px; box-shadow:0 24px 64px rgba(15,31,58,.34);
  opacity:0; visibility:hidden; transition:opacity .18s, transform .18s, visibility .18s;
}
.mkp-hop.mo{opacity:1; visibility:visible; transform:translate(-50%,-50%) scale(1);}
.mkp-dau{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:17px 20px 14px; border-bottom:1px solid #E5E7EB;}
.mkp-dau b{display:block; color:var(--orange); font-size:17px;}
.mkp-dau span{display:block; margin-top:3px; color:var(--text-muted); font-size:12px;}
.mkp-dong{width:32px; height:32px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--text-muted); font-size:22px; line-height:1; cursor:pointer;}
.mkp-dong:hover{background:var(--red); border-color:var(--red); color:#fff;}
.mkp-than{padding:8px 20px 18px;}
.mkp-than .mk-yeucau{margin-top:10px;}
.mkp-duoi{display:flex; justify-content:flex-end; gap:8px; padding:13px 20px; border-top:1px solid #E5E7EB;}
.mkp-bao{display:none; margin-top:10px; padding:9px 11px; border-radius:8px; font-size:12.5px; font-weight:600;}
.mkp-bao.loi{display:block; background:#FDEBEB; color:var(--red); border:1px solid #F5C6C6;}
.mkp-bao.ok{display:block; background:#E8F6EE; color:#1E7B45; border:1px solid #BFE5CE;}
@media(max-width:560px){.mkp-hop{max-height:calc(100vh - 24px); overflow:auto;}}

/* --- Nội dung hướng dẫn --- */
.hd-noi{
  max-width:100%; min-width:0; font-size:13.5px; line-height:1.75; color:var(--text);
  overflow-wrap:anywhere;
}
.hd-mo{ margin:0 0 14px; }
.hd-vt{ color:var(--orange-dark); }
.hd-noi p{ margin:6px 0; }
.hd-noi ul, .hd-noi ol{ margin:6px 0; padding-left:20px; }
.hd-noi li{ margin-bottom:5px; }
.hd-noi code{
  background:var(--bg-soft); padding:1px 5px; border-radius:4px;
  max-width:100%; font-size:12px; color:var(--navy); overflow-wrap:anywhere;
}
.hd-noi img, .hd-noi video, .hd-noi canvas{ display:block; max-width:100%; height:auto; }
.hd-noi table{
  display:block; max-width:100%; overflow-x:auto; border-collapse:collapse;
  -webkit-overflow-scrolling:touch;
}
.hd-noi pre{
  max-width:100%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere;
}
.hd-h3{
  font-size:14px; color:var(--navy); margin:22px 0 10px;
  padding-bottom:6px; border-bottom:2px solid var(--navy-tint);
}
/* Khối "2 điều quan trọng nhất" */
.hd-thanh-canh{
  background:var(--orange-tint); border-left:4px solid var(--orange);
  border-radius:8px; padding:12px 16px; margin:14px 0;
}
.hd-thanh-canh > b{ color:var(--orange-dark); font-size:13px; }
.hd-thanh-canh ol{ margin:7px 0 0; }
/* Các bước trong tháng */
.hd-buoc{ display:flex; flex-direction:column; gap:9px; }
.hd-b{ display:flex; gap:11px; align-items:flex-start; }
.hd-b > div{ min-width:0; }
.hd-b b{ font-size:13px; color:var(--text); }
.hd-b p{ margin:2px 0 0; color:var(--text-muted); font-size:12.5px; }
.hd-so{
  flex:0 0 auto; width:24px; height:24px; border-radius:7px; margin-top:1px;
  display:flex; align-items:center; justify-content:center;
  background:var(--navy); color:#fff; font-size:13px; font-weight:800;
}
/* Mỗi màn hình */
.hd-muc{
  border:1px solid var(--line); border-radius:10px;
  max-width:100%; min-width:0; padding:12px 15px; margin-bottom:10px; background:var(--white);
}
.hd-muc > b{
  display:flex; align-items:center; flex-wrap:wrap; min-width:0; gap:8px;
  font-size:13.5px; color:var(--navy); margin-bottom:5px;
}
.hd-muc > b svg{ width:17px; height:17px; flex:0 0 auto; color:var(--orange); }
.hd-muc--admin{ border-color:var(--orange); background:var(--orange-tint); }
.hd-chi{
  margin-left:auto; font-size:10.5px; font-weight:700; padding:2px 8px;
  max-width:100%; flex:0 0 auto; border-radius:999px; background:var(--orange); color:#fff;
}
.hd-tip{
  background:var(--navy-tint); border-radius:7px;
  padding:8px 11px; margin-top:7px !important;
  font-size:12.5px; color:var(--navy);
}
/* Sơ đồ vòng đời tiền mặt */
.hd-luong{
  display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin:8px 0;
}
.hd-luong span{
  padding:5px 11px; border-radius:999px; font-size:12px; font-weight:700;
  max-width:100%; white-space:normal; overflow-wrap:anywhere;
  background:var(--navy-tint); color:var(--navy);
}
.hd-luong i{ color:var(--orange); font-style:normal; font-weight:800; }

.hd-mucluc{ display:none; }

@media (max-width:900px){
  .hd-hop{
    width:min(860px, calc(100vw - 20px));
    height:calc(100vh - 20px); max-height:calc(100vh - 20px);
  }
  .hd-dau{ min-width:0; padding:10px 12px; gap:10px; }
  .hd-dau b{ min-width:0; overflow-wrap:anywhere; }
  .hd-dong{ width:44px; height:44px; flex:0 0 44px; touch-action:manipulation; }
  .hd-than{ padding:14px; }
  .hd-noi a{
    display:inline-flex; align-items:center; min-height:44px; max-width:100%;
    overflow-wrap:anywhere; touch-action:manipulation;
  }
  .hd-mucluc{
    position:sticky; z-index:2; top:-14px;
    display:flex; flex-wrap:wrap; gap:6px;
    margin:-2px 0 14px; padding:8px 0;
    background:var(--white); border-bottom:1px solid var(--line);
  }
  .hd-mucluc a{
    display:inline-flex; align-items:center; min-height:44px; max-width:100%;
    padding:7px 10px; border:1px solid var(--line); border-radius:9px;
    color:var(--navy); background:var(--bg-soft); font-size:12px;
    font-weight:700; line-height:1.25; text-decoration:none; touch-action:manipulation;
  }
  .hd-mucluc a[aria-current="location"]{
    color:#fff; background:var(--navy); border-color:var(--navy);
  }
  .hd-h3{ scroll-margin-top:110px; }
  .hd-b, .hd-b > div, .hd-b p, .hd-muc > b{ max-width:100%; overflow-wrap:anywhere; }
}
@supports (height:100dvh){
  @media (max-width:900px){
    .hd-hop{ height:calc(100dvh - 20px); max-height:calc(100dvh - 20px); }
  }
}

/* ============================================================================
   P3-C0-MOBILE-CLOSURE-02-C4-DANHBA — route-local mobile-full presentation.
   Danh bạ keeps its card surface through 900px; the shared card breakpoint and
   every backend/AJAX contract remain unchanged.
   ========================================================================== */
.page-danhba .db-mobile-search,
.page-danhba .db-phone-status,
.page-danhba .db-action-label,
.page-danhba .db-note-preview{display:none;}
body.db-khoa-cuon{overflow:hidden;}

@media(max-width:900px){
  .page-danhba{width:100%;max-width:100%;min-width:0;overflow:visible;}
  .page-danhba .tong-bar-danhba{
    display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;
  }
  .page-danhba .kpi-danhba{box-sizing:border-box;min-width:0;min-height:88px;padding:13px 14px;}
  .page-danhba .kpi-danhba .kpi-nhan,
  .page-danhba .kpi-danhba .kpi-don{white-space:normal;line-height:1.35;}
  .page-danhba .db-business-note{margin:0 0 10px;overflow-wrap:anywhere;}

  .page-danhba .bang-khung,
  .page-danhba .bang-scroll{box-sizing:border-box;width:100%;max-width:100%;min-width:0;overflow:visible!important;}
  .page-danhba .bang-toolbar{
    display:flex!important;flex-wrap:wrap!important;align-items:stretch!important;gap:10px!important;
    box-sizing:border-box;width:100%;padding:13px 12px!important;
  }
  .page-danhba .bang-toolbar > h2{width:100%;min-width:0;white-space:normal;line-height:1.4;}
  .page-danhba .bang-toolbar > .bang-ngan{display:none!important;}
  .page-danhba .loc-trong-bang{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr)) auto!important;
    flex:1 1 100%!important;width:100%!important;min-width:0!important;max-width:none!important;
    margin:0!important;gap:9px!important;align-items:stretch!important;
  }
  .page-danhba .loc-trong-bang > .adp-control-select{
    box-sizing:border-box;width:100%!important;max-width:none!important;min-width:0!important;
    height:44px!important;min-height:44px!important;
  }
  .page-danhba .loc-trong-bang > .adp-control-select--sort{grid-column:1 / 3;}
  .page-danhba .loc-trong-bang > .adp-control-reset{
    box-sizing:border-box;grid-column:3;grid-row:1;width:44px!important;min-width:44px!important;
    height:44px!important;min-height:44px!important;margin:0!important;padding:0!important;justify-content:center;
  }
  .page-danhba .bang-toolbar > .adp-control-excel{
    box-sizing:border-box;flex:1 1 100%;width:100%;min-height:44px;margin:0!important;justify-content:center;
  }

  .page-danhba table.data-danhba,
  .page-danhba table.data-danhba thead,
  .page-danhba table.data-danhba tbody{display:block;width:100%;min-width:0;}
  .page-danhba table.data-danhba{table-layout:auto;border-collapse:separate;}
  .page-danhba table.data-danhba .adp-card-sort-title{
    display:block;position:static;width:100%;height:auto;margin:0;padding:12px 12px 7px;
    overflow:visible;clip:auto;white-space:normal;border:0;background:#E9EEFB;color:var(--navy);
    font-size:12px;font-weight:700;text-align:left;text-transform:uppercase;letter-spacing:.45px;
  }
  .page-danhba table.data-danhba thead{
    position:static!important;padding:0 12px 12px;background:#E9EEFB;border-bottom:1px solid var(--line);
  }
  .page-danhba table.data-danhba thead tr{display:flex;flex-wrap:wrap;gap:7px;background:transparent;}
  .page-danhba table.data-danhba thead th{
    display:none!important;position:static!important;width:auto!important;height:auto!important;
    padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;
  }
  .page-danhba table.data-danhba thead th.th-sap{display:block!important;}
  .page-danhba table.data-danhba thead th.th-sap a{
    display:inline-flex;width:auto!important;min-height:44px;padding:8px 11px;
    border:1px solid #CCD4E5;border-radius:8px;background:var(--white);color:var(--navy);
    font-size:11.5px;line-height:1.2;text-transform:none;letter-spacing:0;
  }
  .page-danhba table.data-danhba tbody{
    display:grid;gap:12px;box-sizing:border-box;padding:12px;background:var(--bg-soft);
  }
  .page-danhba table.data-danhba tbody tr{
    display:grid;width:100%;min-width:0;overflow:hidden;border:1px solid var(--line);
    border-radius:12px;background:var(--white);box-shadow:var(--shadow-sm);
  }
  .page-danhba table.data-danhba tbody tr[hidden]{display:none!important;}
  .page-danhba table.data-danhba tbody tr:not([data-card-empty]) td{
    display:grid!important;grid-template-columns:minmax(92px,30%) minmax(0,1fr);gap:10px;
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:none!important;
    padding:9px 12px!important;border:0!important;border-bottom:1px solid var(--line-2)!important;
    overflow:visible!important;text-overflow:clip!important;white-space:normal!important;
    text-align:left!important;vertical-align:top;overflow-wrap:anywhere;word-break:normal;
  }
  .page-danhba table.data-danhba tbody tr:not([data-card-empty]) td:last-child{border-bottom:0!important;}
  .page-danhba table.data-danhba tbody tr:not([data-card-empty]) td::before{
    content:attr(data-label);display:block;min-width:0;color:var(--text-muted);
    font-size:11.5px;font-weight:700;line-height:1.45;
  }
  .page-danhba table.data-danhba .adp-card-value,
  .page-danhba table.data-danhba tbody td > .adp-card-value{
    grid-column:2;display:block;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;
  }
  .page-danhba table.data-danhba td[data-card-emphasis="primary"] > .adp-card-value{
    color:var(--navy);font-weight:650;
  }
  .page-danhba table.data-danhba .db-ten{
    display:grid!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
  }
  .page-danhba table.data-danhba .db-phone-list{display:flex;flex-direction:column;gap:7px;}
  .page-danhba table.data-danhba .db-so-dong{
    display:flex;flex-wrap:wrap;align-items:center;gap:5px 8px;min-width:0;padding:0;
  }
  .page-danhba table.data-danhba .db-so-hienthi{
    flex:0 1 auto;max-width:100%;white-space:nowrap!important;overflow-wrap:normal;word-break:keep-all;
  }
  .page-danhba .db-phone-status{
    display:inline-flex;align-items:center;width:max-content;max-width:100%;padding:3px 7px;border-radius:999px;
    font-size:10.5px;font-weight:650;line-height:1.35;white-space:nowrap;
  }
  .page-danhba .db-phone-status--active{background:var(--green-tint);color:#12813B;}
  .page-danhba .db-phone-status--inactive{background:var(--bg-soft);color:var(--text-muted);}
  .page-danhba table.data-danhba .db-note-value{display:flex;flex-direction:column;gap:8px;width:100%;}
  .page-danhba table.data-danhba .db-note-preview{
    display:block;min-width:0;max-width:100%;color:var(--text);font-weight:400;
    line-height:1.5;white-space:normal;overflow-wrap:anywhere;word-break:normal;
  }
  .page-danhba table.data-danhba .inp-ghichu-db{
    box-sizing:border-box;width:100%;height:44px;min-height:44px;padding:0 11px;
    overflow:visible;text-overflow:clip;white-space:normal;
  }
  .page-danhba table.data-danhba .ghichu-xem{
    overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;
  }
  .page-danhba table.data-danhba .db-thaotac{display:grid!important;}
  .page-danhba table.data-danhba .db-nut-wrap{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:100%;
  }
  .page-danhba table.data-danhba .db-nut-i,
  .page-danhba table.data-danhba .db-nut-i:disabled{
    box-sizing:border-box;width:100%!important;min-width:0!important;height:44px!important;min-height:44px!important;
    padding:0 9px!important;gap:7px;justify-content:center;border-radius:8px!important;
  }
  .page-danhba table.data-danhba .db-action-label{display:inline;min-width:0;line-height:1.2;white-space:nowrap;}
  .page-danhba table.data-danhba tbody tr[data-card-empty]{display:block;box-shadow:none;}
  .page-danhba table.data-danhba tbody tr[data-card-empty] td{
    display:block;width:100%;height:auto;min-height:110px;padding:30px 16px!important;
    border:0!important;white-space:normal;text-align:center;overflow-wrap:anywhere;
  }
  .page-danhba table.data-danhba tbody tr[data-card-empty] td::before{content:none;}

  .page-danhba .phantrang-danhba{align-items:flex-start;padding:12px;gap:12px;}
  .page-danhba .phantrang-danhba .pt-trai,
  .page-danhba .phantrang-danhba .pt-phai{width:100%;gap:8px;}
  .page-danhba .phantrang-danhba select,
  .page-danhba .phantrang-danhba .pt-nut{height:44px!important;min-height:44px!important;}
  .page-danhba .phantrang-danhba .pt-nut{width:44px!important;min-width:44px!important;}

  #db-modal-bg,#db-chon-so-bg,#db-xoaso-bg,.db-import-choice-bg{
    box-sizing:border-box;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right))
      max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  }
  #db-modal-bg .modal,#db-chon-so-bg .modal,#db-xoaso-bg .modal,.db-import-choice-bg .modal{
    box-sizing:border-box;width:100%!important;max-width:520px!important;max-height:calc(100dvh - 24px)!important;
    padding:18px!important;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;
  }
  .db-entry-modal .ui-action-btn,.db-chon-so-modal .ui-action-btn,
  .db-xoaso-modal .ui-action-btn,.db-import-choice-modal .ui-action-btn{
    height:44px!important;min-height:44px!important;
  }
  .db-modal-field input{height:44px!important;min-height:44px!important;}
  .db-import-choice-close{width:44px;height:44px;min-width:44px;flex-basis:44px;}
  .db-import-choice-option{min-height:72px;}
  .db-chon-so-modal .db-chon-so-item{min-height:44px;}
  #db-chon-so-ok,#db-xoaso-huy,#db-xoaso-ok{height:44px!important;min-height:44px!important;}
  #db-ls-drawer.db-ls-drawer{
    box-sizing:border-box;width:min(460px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;
  }
  #db-ls-drawer .drawer-head{padding:max(12px,env(safe-area-inset-top)) 14px 12px;}
  #db-ls-drawer .drawer-close{width:44px;height:44px;min-width:44px;flex:0 0 44px;}
  #db-ls-drawer .drawer-body{padding:14px;padding-bottom:max(14px,env(safe-area-inset-bottom));}
}

@media(max-width:820px){
  .page-danhba .db-mobile-search{display:block;grid-column:1 / -1;width:100%;min-width:0;}
  .page-danhba .db-mobile-search > label{
    display:block;margin:0 0 5px;color:var(--navy);font-size:12px;font-weight:700;
  }
  .page-danhba .db-mobile-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;}
  .page-danhba .db-mobile-search-row input{
    box-sizing:border-box;width:100%;min-width:0;height:44px;padding:0 11px;border:1px solid var(--line);
    border-radius:8px;background:var(--white);color:var(--text);font:inherit;
  }
  .page-danhba .db-mobile-search-submit{
    box-sizing:border-box;height:44px!important;min-height:44px!important;padding:0 13px!important;justify-content:center;
  }
}

@media(max-width:560px){
  .page-danhba .tong-bar-danhba{grid-template-columns:1fr;}
  .page-danhba .loc-trong-bang{grid-template-columns:minmax(0,1fr) 44px!important;}
  .page-danhba .loc-trong-bang > .adp-control-select,
  .page-danhba .loc-trong-bang > .adp-control-select--sort{grid-column:1 / -1;}
  .page-danhba .loc-trong-bang > .adp-control-reset{grid-column:2;grid-row:5;}
  .page-danhba .db-mobile-search{grid-column:1 / -1;}
  .page-danhba table.data-danhba tbody tr:not([data-card-empty]) td{
    grid-template-columns:minmax(82px,31%) minmax(0,1fr);padding:9px 10px!important;
  }
  .page-danhba .db-mobile-search-submit span{display:none;}
  .db-modal-actions,.db-xoaso-actions,.db-chon-so-modal .modal-actions,
  .db-import-choice-actions{display:grid!important;grid-template-columns:1fr 1fr;width:100%;}
  .db-modal-actions .btn,.db-xoaso-actions .btn,.db-chon-so-modal .modal-actions .btn,
  .db-import-choice-actions .btn{width:100%;margin:0!important;justify-content:center;}
}
@media (max-width:430px){
  .hd-than{ padding:12px; }
  .hd-mucluc{ top:-12px; margin-bottom:12px; }
  .hd-noi{ font-size:13px; line-height:1.65; }
  .hd-thanh-canh, .hd-muc{ padding:10px 11px; }
  .hd-chi{ margin-left:25px; }
}

/* Trang đăng nhập — dòng nhắc "Quên mật khẩu?" (v=65) */
.login-quenmk{
  margin:14px 0 0; text-align:center;
  font-size:12px; color:var(--text-muted); line-height:1.6;
}
.login-quenmk b{ color:var(--navy); }


/* ===== THEO DÕI CÔNG NỢ — THỐNG KÊ THEO TRẠNG THÁI ===== */
/* Hai nút hủy tiền mặt có cùng kích thước và căn chỉnh. */
.btn-huyluot, .btn-huygach{
  width:72px; min-width:72px; height:30px; padding:5px 9px;
  display:inline-flex; align-items:center; justify-content:center; gap:5px;
}
.btn-huyluot .ic, .btn-huygach .ic{ width:14px; height:14px; flex:0 0 auto; }

/* 04B — nhịp tương tác dùng chung cho các hành động nghiệp vụ. Màu sắc vẫn
   do lớp ngữ nghĩa hiện hữu (.btn-cam/.btn-huygach/.db-nut-xoa) quyết định. */
.ui-action-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:5px;
  min-height:30px; transition:transform .12s ease, box-shadow .12s ease,
    background-color .12s ease, border-color .12s ease, color .12s ease;
}
.ui-action-btn .ic,
.ui-action-btn svg{ width:14px; height:14px; flex:0 0 auto; }
.ui-action-btn:not(:disabled):hover{ transform:translateY(-1px); }
.ui-action-btn:not(:disabled):active{ transform:translateY(0); box-shadow:none; }
/* UI-02 (Trang 1): CHỈ nút .ui-action-btn của index.php (3 popup + nút hoàn tác trong
   drawer .pa-btn-hoantac) KHÔNG nhấc lên khi hover/active; các trang khác giữ baseline. */
#modal-bg .ui-action-btn:not(:disabled):hover,
#pa-modal-bg .ui-action-btn:not(:disabled):hover,
.pa-btn-hoantac:not(:disabled):hover,
#modal-bg .ui-action-btn:not(:disabled):active,
#pa-modal-bg .ui-action-btn:not(:disabled):active,
.pa-btn-hoantac:not(:disabled):active{ transform:none; }
.ui-action-btn:focus-visible{
  outline:3px solid color-mix(in srgb, var(--blue) 35%, transparent);
  outline-offset:2px;
}
.ui-action-btn:disabled{ opacity:.5; cursor:not-allowed; transform:none; box-shadow:none; }
.ui-icon-action{ width:28px; min-width:28px; height:28px; min-height:28px; padding:0; }
.ui-action-danger{ --ui-action-tone:var(--red); }

/* ============================================================================
   CHUẨN HÓA GIAO DIỆN v85 — tiêu đề + bộ lọc + xuất file trong một card header
   ============================================================================ */
.bang-toolbar{justify-content:flex-start; align-items:center; gap:10px;}
.bang-toolbar > h2{flex:0 0 auto; white-space:nowrap; margin:0;}
.bang-ngan{width:1px; height:var(--toolbar-divider-h); flex:0 0 1px; background:var(--line);}
.bang-toolbar .loc-trong-bang{
  flex:1 1 560px; min-width:0; margin:0; padding:0;
  background:transparent; border:0; border-radius:0; box-shadow:none;
  flex-wrap:wrap; gap:8px;
}
.bang-toolbar .loc-trong-bang input[type=search].o-linh-hoat,
.bang-toolbar .loc-trong-bang input[type=text].o-linh-hoat,
.bang-toolbar .loc-trong-bang .o-icon.o-linh-hoat{
  flex:1 1 190px; min-width:170px; max-width:310px;
}
.bang-toolbar .loc-trong-bang input[type=search]{flex-basis:auto;}
.bang-toolbar .bang-xuat{margin-left:auto; flex:0 0 auto; white-space:nowrap; height:36px;}
.bang-toolbar-rong .loc-trong-bang{flex-basis:760px;}

/* Riêng ô Trạng thái của bảng công nợ: chevron và tương tác trung tính/xanh,
   không dùng cam như các bộ lọc hành động của hệ thống. */
.data-theodoi .tt-select{
  border-color:transparent;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  transition:border-color .15s,box-shadow .15s,filter .15s;
}
.data-theodoi .tt-select:hover{border-color:#B9CDF5;filter:saturate(.94);}
.data-theodoi .tt-select:focus{
  border-color:#7EA2E8 !important; box-shadow:0 0 0 3px rgba(37,99,235,.12) !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231A1F6B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
}
.bang-tieu-de{display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0;}
.bang-chip-canhbao{
  display:inline-flex; align-items:center; gap:5px; padding:4px 9px;
  border-radius:999px; background:var(--red-tint); color:var(--red);
  font-size:11.5px; font-weight:600; white-space:nowrap;
}
.bang-chip-canhbao svg{width:14px; height:14px; flex:0 0 auto;}
.bang-chip-canhbao:hover{box-shadow:0 0 0 1px var(--red);}
.bang-rong{padding:30px 18px; text-align:center; color:var(--text-muted); font-size:13px;}
@media (max-width:1450px){
  .bang-toolbar > h2{flex-basis:auto;}
  .bang-toolbar .loc-trong-bang{flex-basis:100%; order:3;}
  .bang-toolbar .bang-xuat{margin-left:auto;}
  .bang-toolbar .bang-ngan{display:none;}
}
@media (max-width:760px){
  .bang-toolbar .loc-trong-bang input[type=search].o-linh-hoat,
  .bang-toolbar .loc-trong-bang input[type=text].o-linh-hoat,
  .bang-toolbar .loc-trong-bang .o-icon.o-linh-hoat{max-width:none; flex-basis:100%;}
}

/* Đăng nhập: icon nằm trong ô, không thay đổi autocomplete hay hành vi form. */
.login-input-wrap{position:relative; display:block; width:100%;}
.login-input-wrap .login-input-ic{
  position:absolute; left:13px; top:50%; transform:translateY(-50%);
  width:18px; height:18px; display:flex; color:var(--text-muted); pointer-events:none;
}
.login-input-wrap .login-input-ic svg{width:18px; height:18px;}
.login-box .login-input-wrap input{display:block; width:100%; padding-left:42px;}
.login-input-wrap:focus-within .login-input-ic{color:var(--orange);}

/* Nhập dữ liệu: vùng chọn file hỗ trợ bấm và kéo-thả trên input file gốc. */
.nhap-file.nhap-drop{
  position:relative; min-height:96px; padding:18px; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
  text-align:center; transition:border-color .15s, background .15s, box-shadow .15s;
}
.nhap-drop:hover,.nhap-drop:focus-within,.nhap-drop.dang-keo{
  border-color:var(--orange); background:var(--orange-tint);
  box-shadow:0 0 0 3px rgba(255,102,0,.10);
}
.nhap-drop input[type=file]{position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer;}
.nhap-drop-ic{display:flex; width:28px; height:28px; color:var(--text-muted);}
.nhap-drop-ic svg{width:28px; height:28px;}
.nhap-drop-chu{font-size:13px; color:var(--text-muted);}
.nhap-drop-chu b{color:var(--navy);}
.nhap-file-ten{font-size:11.5px; color:var(--orange-dark); font-weight:600; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}

/* ==========================================================================
   GHI ĐÈ CUỐI v87 — nút Bỏ lọc phải thắng mọi rule 36px/hover xám của .loc-bar.
   Đặt cuối file để cả kích thước lẫn hiệu ứng luôn giống cơ chế nút Xuất Excel.
   ========================================================================== */
.loc-bar .btn-boloc,
.bang-toolbar .loc-bar .btn-boloc{
  width:36px; min-width:36px; height:36px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  background:var(--white); color:var(--orange); border-color:var(--line);
  line-height:0;
  transition:background .14s, color .14s, border-color .14s, box-shadow .14s;
}
.loc-bar .btn-boloc svg,
.bang-toolbar .loc-bar .btn-boloc svg{
  width:24px !important; height:24px !important; display:block; color:var(--orange);
  transition:transform .45s cubic-bezier(.34,1.2,.44,1), color .14s;
}
/* UI-01.1: BỎ nhấc lên (translateY) — nút đứng yên; chỉ đổi màu/viền/bóng.
   Riêng icon vẫn XOAY tại chỗ (rotate, không dời vị trí) như hiệu ứng "bỏ lọc". */
.loc-bar .btn-boloc:hover,
.bang-toolbar .loc-bar .btn-boloc:hover{
  background:var(--orange-tint); color:var(--orange-dark); border-color:var(--orange);
  box-shadow:0 4px 12px rgba(255,102,0,.22);
}
.loc-bar .btn-boloc:hover svg,
.bang-toolbar .loc-bar .btn-boloc:hover svg{
  color:var(--orange-dark); transform:rotate(-360deg);
}
.loc-bar .btn-boloc:active,
.bang-toolbar .loc-bar .btn-boloc:active{
  box-shadow:0 2px 6px rgba(255,102,0,.18);
}

/* ==========================================================================
   CHUẨN HÓA KÍCH THƯỚC CỘT v90
   Cột định danh/ngày/tiền/thao tác giữ nhịp ổn định; tên, nội dung và ghi chú
   nhận phần không gian còn lại. Các bảng khác cấu trúc có class riêng, không
   dùng chung kích thước một cách cưỡng ép.
   ========================================================================== */
table.data thead th{white-space:normal; line-height:1.25; vertical-align:middle;}
table.data tbody td{vertical-align:middle;}
table.data .th-chon, table.data .td-chon{text-align:center; padding-left:5px; padding-right:5px;}

/* Theo dõi công nợ — 12 cột, tổng 100%. */
.data-theodoi{table-layout:fixed; width:100%;}
/* H3 (Đợt 2): phân bổ lại 12 cột cho cân đối — thu hẹp STT/Ghi chú/Thao tác,
   Tên KH rộng hơn, các cột tiền gần nhau, Trạng thái đủ chỗ nhãn dài, Mã KH đủ
   rộng (KHÔNG ellipsis). Tổng = 100%. */
.data-theodoi th:nth-child(1){width:3.5%;}   /* STT */
.data-theodoi th:nth-child(2){width:5%;}     /* Tòa */
.data-theodoi th:nth-child(3){width:9%;}     /* Mã KH */
.data-theodoi th:nth-child(4){width:16.5%;}  /* Tên KH */
.data-theodoi th:nth-child(5){width:8%;}     /* Tổng tiền */
.data-theodoi th:nth-child(6){width:7.5%;}   /* Nợ cũ */
.data-theodoi th:nth-child(7){width:7.5%;}   /* Đã nộp */
.data-theodoi th:nth-child(8){width:8%;}     /* Còn nợ */
.data-theodoi th:nth-child(9){width:7.5%;}   /* Tiền dư */
.data-theodoi th:nth-child(10){width:13%;}   /* Trạng thái */
.data-theodoi th:nth-child(11){width:9%;}    /* Ghi chú */
.data-theodoi th:nth-child(12){width:5.5%;}  /* Thao tác / Xem chi tiết */
.data-theodoi .col-stt,.data-theodoi .col-chitiet{width:auto; min-width:0;}
.data-theodoi .col-ten,.data-theodoi .col-ghichu{max-width:none;}
/* A1.1-UI-v2: bỏ nth-child(3) khỏi danh sách ellipsis — cột 3 = Mã KH, KHÔNG
   được cắt (xem .col-makh-full bên dưới, nơi gán class trực tiếp cho ô này). */
.data-theodoi td:nth-child(4),
.data-theodoi td:nth-child(5),.data-theodoi td:nth-child(6),
.data-theodoi td:nth-child(7),.data-theodoi td:nth-child(8),
.data-theodoi td:nth-child(9){overflow:hidden; text-overflow:ellipsis;}
.data-theodoi .col-ghichu input{width:100%; max-width:none;}

/* Danh bạ — ưu tiên Tên, SĐT và Ghi chú. */
.data-danhba{table-layout:fixed; width:100%;}
.data-danhba th:nth-child(1){width:5%;}
.data-danhba th:nth-child(2){width:7%;}
.data-danhba th:nth-child(3){width:11%;}
.data-danhba th:nth-child(4){width:22%;}
.data-danhba th:nth-child(5){width:24%;}
.data-danhba th:nth-child(6){width:20%;}
.data-danhba th:nth-child(7){width:11%;}
.data-danhba .cw-stt,.data-danhba .db-toa,.data-danhba .db-makh,
.data-danhba .db-nut{width:auto;}
.data-danhba .db-ten{min-width:0; max-width:none;}
.data-danhba .db-sdt{min-width:0;}
.data-danhba .col-ghichu{max-width:none;}
.data-danhba td:nth-child(4),.data-danhba td:nth-child(6){overflow:hidden; text-overflow:ellipsis;}

/* Ngoài sinh hoạt — tên/nội dung rộng, mã số và thao tác gọn. */
.data-nsh{table-layout:fixed; width:100%;}
.data-nsh th:nth-child(1){width:4%;}
.data-nsh th:nth-child(2){width:6%;}
.data-nsh th:nth-child(3){width:17%;}
.data-nsh th:nth-child(4){width:10%;}
.data-nsh th:nth-child(5){width:8%;}
.data-nsh th:nth-child(6){width:18%;}
.data-nsh th:nth-child(7){width:10%;}
.data-nsh th:nth-child(8){width:12%;}
.data-nsh th:nth-child(9){width:8%;}
.data-nsh th:nth-child(10){width:7%;}
.data-nsh .c-stt,.data-nsh .c-toa,.data-nsh .c-mst,.data-nsh .c-sohd,
.data-nsh .nsh-col-ten,.data-nsh .nsh-col-nd,.data-nsh .c-tien,
.data-nsh .c-tt,.data-nsh .col-ghichu,.data-nsh .c-thaotac{width:auto;}
.data-nsh .nsh-col-ten,.data-nsh .nsh-col-nd{overflow:hidden; text-overflow:ellipsis;}

/* Thu tiền mặt — class ở tiêu đề quyết định toàn bộ cột, có/không checkbox đều cân.
   REVIEW V2: bảng KHÔNG được cuộn ngang trên Desktop (1366/1440/1920) → bỏ
   min-width cố định (vốn > vùng nội dung thực tế ở 1366px và gây thanh cuộn
   ngang). Đây là NGUỒN DUY NHẤT khai báo bề rộng cột của .data-tm — các rule
   cw-ten/cw-nut từng bị khai lại (và ghi đè âm thầm) ở cuối file đã được gộp
   về đây, không còn khai trùng ở nơi khác. RF11 uses the shorter canonical
   operational tokens and proves their full badge geometry without ellipsis. */
.data-tm{table-layout:fixed; width:100%;}
/* UI-02 Trang 3: toolbar Thu tiền mặt được phép XUỐNG HÀNG có kiểm soát (không đổi
   thứ tự thao tác) → không tràn ngang khi có nút lô "Nhận bàn giao & gạch nợ". Scoped .bang-tm. */
.bang-tm .bang-toolbar{flex-wrap:wrap;}
/* RF11: 12-column operational hierarchy, total = 100% with the optional select
   column. Shorter canonical status tokens return width to identity, money and
   the factual note column without desktop overflow. */
.data-tm .th-chon{width:3%;}
.data-tm .cw-stt{width:4%;}
.data-tm .cw-gio{width:7%;}
.data-tm .cw-toa{width:5%;}
.data-tm .cw-makh{width:10%;}
.data-tm .cw-ten{width:16%;}
.data-tm .cw-tien{width:9%;}
.data-tm .cw-conno{width:8%;}
.data-tm .cw-nv{width:8%;}
.data-tm .cw-tt{width:14%;}
.data-tm .cw-ghichu{width:8%;}
.data-tm .cw-nut{width:8%;}
/* Giảm nhẹ padding ngang để mọi tiêu đề vừa cột (không cắt), riêng STT căn giữa
   và padding nhỏ hơn để hiện trọn "STT". Selector table.data-tm để thắng độ ưu
   tiên của rule padding chung (table.data th,td). */
table.data-tm th,table.data-tm td{padding-left:10px;padding-right:10px;}
.data-tm .cw-stt,.data-tm .td-stt{padding-left:5px;padding-right:5px;text-align:center;}
/* CHỈ Tên KH, NV nhận và Ghi chú được phép ellipsis (kèm title). */
.data-tm .td-ten,.data-tm .td-nv,.data-tm .col-ghichu{overflow:hidden; text-overflow:ellipsis;}
.data-tm .td-ten{max-width:none !important;}
/* Các tiêu đề KHÔNG được cắt (ghi đè rule ellipsis chung ở cuối file). */
.data-tm thead th.th-chon,.data-tm thead th.cw-stt,.data-tm thead th.cw-gio,
.data-tm thead th.cw-toa,.data-tm thead th.cw-makh,.data-tm thead th.cw-tien,
.data-tm thead th.cw-nut{overflow:visible;text-overflow:clip;}
/* Giờ ghi hai dòng: giờ ở trên, ngày ở dưới (màu nhẹ hơn); title đầy đủ trên td. */
.data-tm .td-gio .tm-ngay-ghi{color:var(--text-muted);}
@media(min-width:1100px){
  .data-tm td.td-gio{white-space:nowrap; line-height:1.2; text-align:left;}
  .data-tm .td-gio .tm-gio-chinh{display:block; font-weight:500; font-size:12.75px; color:var(--text);}
  .data-tm .td-gio .tm-ngay-ghi{display:block; font-size:11px; color:var(--text-muted); margin-top:1px;}
}
/* Ô Trạng thái: chip KHÔNG được tràn khỏi cell sang cột Ghi chú, nhưng KHÔNG
   được cắt chữ bằng ellipsis (cột đã đủ rộng ở trên) — chỉ ẩn phần vượt nếu có. */
.data-tm .td-tt{overflow:hidden;}
.data-tm .td-tt .tt{max-width:100%; white-space:nowrap; vertical-align:middle;}
/* HOST FIX 02 — Ghi chú hẹp: một dòng, ellipsis + title, KHÔNG làm cao thêm dòng. */
.data-tm td.col-ghichu{white-space:nowrap;}
.data-tm td.col-ghichu .inp-ghichu{width:100%; min-width:0; text-overflow:ellipsis;}
.data-tm td.col-ghichu .ghichu-xem{display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.data-tm .td-tien b{font-weight:600;}
.data-tm .td-conno{font-weight:400;}
.data-tm .td-conno.am{color:var(--red);font-weight:700;}
/* HOST FIX 02 — ô Thao tác khi công nợ đang TTTM / CK CTY: nút khóa + link xem
   công nợ xếp dọc, chữ nhỏ gọn để không phá bề rộng cột. */
.data-tm .tm-thaotac-khoa{display:inline-flex; flex-direction:column; gap:4px; align-items:stretch; line-height:1;}
.data-tm .tm-thaotac-khoa .btn{height:26px; padding:0 6px; font-size:10.75px; gap:3px; white-space:nowrap;}
.data-tm .btn-khoa-ck:disabled{opacity:.65; cursor:not-allowed;}
.data-tm .btn-xemcongno{color:var(--navy); font-weight:700;}
.data-tm .btn-xemcongno:hover{border-color:var(--orange); color:var(--orange-dark);}

/* ZNS — đúng 12 cột (STT + 11 cột file xuất). */
.data-zns{table-layout:fixed; width:100%;}
.data-zns .col-stt{width:3.5%;}
.data-zns .cw-sdt{width:9%;}
.data-zns .z-ky{width:6%;}
.data-zns .z-ten{width:12%;}
.data-zns .cw-makh{width:8%;}
.data-zns .z-dc{width:14%;}
.data-zns .z-cs{width:5%;}
.data-zns .z-dtt{width:6%;}
.data-zns .z-ngay{width:8%;}
.data-zns .cw-tien{width:9%;}
.data-zns .z-ndck{width:14.5%;}

/* Tra cứu lịch sử — chi tiết chiếm phần lớn, các mã/thời gian vừa dữ liệu. */
.data-tracuu{table-layout:fixed; width:100%;}
.data-tracuu th:nth-child(1){width:4%;}
.data-tracuu th:nth-child(2){width:12%;}
.data-tracuu th:nth-child(3){width:13%;}
.data-tracuu th:nth-child(4){width:12%;}
.data-tracuu th:nth-child(5){width:13%;}
.data-tracuu th:nth-child(6){width:8%;}
.data-tracuu th:nth-child(7){width:10%;}
.data-tracuu th:nth-child(8){width:28%;}
.data-tracuu .tc-stt{width:auto;}
.data-tracuu .tc-chitiet{min-width:0; max-width:none; overflow-wrap:anywhere;}
/* A1.1-UI-v2: bỏ nth-child(6) khỏi danh sách ellipsis — cột 6 = Mã KH, KHÔNG
   được cắt (xem .col-makh-full bên dưới). */
.data-tracuu td:nth-child(3),.data-tracuu td:nth-child(4),
.data-tracuu td:nth-child(5){overflow:hidden; text-overflow:ellipsis;}

/* Import xem trước. */
.data-import{table-layout:fixed; width:100%;}
.data-import th:nth-child(1){width:4%;}.data-import th:nth-child(2){width:5%;}
.data-import th:nth-child(3){width:8%;}.data-import th:nth-child(4){width:14%;}
.data-import th:nth-child(5),.data-import th:nth-child(6),.data-import th:nth-child(7){width:10%;}
.data-import th:nth-child(8){width:8%;}.data-import th:nth-child(9){width:9%;}
.data-import th:nth-child(10){width:22%;}
.data-import td:nth-child(4),.data-import td:nth-child(10){overflow:hidden; text-overflow:ellipsis;}

/* Gạch nợ: bốn cấu trúc độc lập. */
.data-gn-auto{table-layout:fixed; width:100%;}
.data-gn-auto th:nth-child(1){width:4%;}.data-gn-auto th:nth-child(2){width:4%;}
.data-gn-auto th:nth-child(3){width:12%;}.data-gn-auto th:nth-child(4){width:9%;}
.data-gn-auto th:nth-child(5){width:9%;}.data-gn-auto th:nth-child(6){width:14%;}
.data-gn-auto th:nth-child(7),.data-gn-auto th:nth-child(8){width:10%;}
.data-gn-auto th:nth-child(9){width:8%;}.data-gn-auto th:nth-child(10){width:20%;}
.data-gn-auto td:nth-child(3),.data-gn-auto td:nth-child(6),.data-gn-auto td:nth-child(10){overflow:hidden; text-overflow:ellipsis;}

.data-nsh2{table-layout:fixed; width:100%;}
.data-nsh2 th:nth-child(1){width:4%;}.data-nsh2 th:nth-child(2){width:5%;}
.data-nsh2 th:nth-child(3){width:12%;}.data-nsh2 th:nth-child(4){width:12%;}
.data-nsh2 th:nth-child(5){width:33%;}.data-nsh2 th:nth-child(6){width:34%;}
.data-nsh2 .th-chon,.data-nsh2 .td-chon,.data-nsh2 .col-stt,
.data-nsh2 .n2-ngay,.data-nsh2 .n2-tien,.data-nsh2 .n2-nd,.data-nsh2 .n2-dx{width:auto;}

.data-gn-doisoat{table-layout:fixed; width:100%;}
.data-gn-doisoat th:nth-child(1){width:4%;}.data-gn-doisoat th:nth-child(2){width:5%;}
.data-gn-doisoat th:nth-child(3){width:13%;}.data-gn-doisoat th:nth-child(4){width:10%;}
.data-gn-doisoat th:nth-child(5){width:10%;}.data-gn-doisoat th:nth-child(6){width:16%;}
.data-gn-doisoat th:nth-child(7){width:12%;}.data-gn-doisoat th:nth-child(8){width:30%;}
.data-gn-doisoat td:nth-child(3),.data-gn-doisoat td:nth-child(6),.data-gn-doisoat td:nth-child(8){overflow:hidden; text-overflow:ellipsis;}

.data-gachtay{table-layout:fixed; width:100%;}
.data-gachtay th:nth-child(1){width:5%;}.data-gachtay th:nth-child(2){width:10%;}
.data-gachtay th:nth-child(3){width:12%;}.data-gachtay th:nth-child(4){width:22%;}
.data-gachtay th:nth-child(5){width:12%;}.data-gachtay th:nth-child(6){width:39%;}
.data-gachtay .col-lydo,.data-gachtay .col-ganma{width:auto; min-width:0;}
.data-gachtay .col-noidung{max-width:none;}

/* Bảng xem trước khi nhập Danh bạ / NSH. */
.data-db-preview,.data-nsh-preview{table-layout:fixed; width:100%;}
.data-db-preview th:nth-child(1){width:18%;}.data-db-preview th:nth-child(2){width:20%;}
.data-db-preview th:nth-child(3),.data-db-preview th:nth-child(4){width:31%;}
/* HOST FIX 03.3 — ĐÃ GỠ 8 rule `.data-nsh-preview th:nth-child(1..8)` ở đây.
   LÝ DO (nguyên nhân gốc của lỗi kéo dài qua FIX 02 → 03.2): bộ rule cũ chỉ phủ
   8 CỘT ĐẦU và tổng đúng 100%; nhưng bảng Xem trước XML nay có 9 CỘT, nên cột 9
   (Tình trạng) nhận thêm width từ rule khác → TỔNG DANH NGHĨA ~106% → bảng vượt
   khung. Nghiêm trọng hơn: `.data-nsh-preview th:nth-child(n)` có độ ưu tiên
   (0,2,1) CAO HƠN `.data-nsh-preview .xlc-*` (0,2,0), nên mọi tỷ lệ % chỉnh ở
   nsh_import.php suốt ba đợt trước đều BỊ GHI ĐÈ ÂM THẦM (đo thực tế: Kỳ nhận
   19% thay vì 6%, Tên đơn vị nhận 11% thay vì 27%).
   Nay bề rộng 9 cột do DUY NHẤT <colgroup> trong nsh_import.php điều khiển.
   Các rule `.data-db-preview` (bảng xem trước Danh bạ — bảng KHÁC) giữ nguyên. */
.data-db-preview td,.data-nsh-preview td{overflow:hidden; text-overflow:ellipsis;}

/* Quản trị. */
.data-qtuser,.data-qtbang,.data-qtkt{table-layout:fixed; width:100%;}
.data-qtuser th:nth-child(1){width:5%;}.data-qtuser th:nth-child(2){width:14%;}
.data-qtuser th:nth-child(3){width:17%;}.data-qtuser th:nth-child(4){width:11%;}
.data-qtuser th:nth-child(5){width:12%;}.data-qtuser th:nth-child(6){width:13%;}
.data-qtuser th:nth-child(7){width:13%;}.data-qtuser th:nth-child(8){width:15%;}
.data-qtuser .qt-stt,.data-qtuser .qt-thaotac{width:auto;}
.data-qtuser .qt-hoten{max-width:none;}
.data-qtuser td:nth-child(2),.data-qtuser td:nth-child(3),
.data-qtuser td:nth-child(6),.data-qtuser td:nth-child(7){overflow:hidden; text-overflow:ellipsis;}

.data-qtbang th:nth-child(1){width:6%;}.data-qtbang th:nth-child(2){width:23%;}
.data-qtbang th:nth-child(3){width:14%;}.data-qtbang th:nth-child(4){width:11%;}
.data-qtbang th:nth-child(5){width:13%;}.data-qtbang th:nth-child(6){width:13%;}
.data-qtbang th:nth-child(7){width:20%;}
.data-qtbang .qt-stt,.data-qtbang .qt-tile{width:auto;}

.data-qtkv td:first-child{width:42%;}.data-qtkv td:last-child{width:58%;}
.data-qtkt th:nth-child(1){width:6%;}.data-qtkt th:nth-child(2){width:31%;}
.data-qtkt th:nth-child(3){width:14%;}.data-qtkt th:nth-child(4){width:49%;}
.data-qtkt .qt-stt,.data-qtkt .qt-so{width:auto;}
.data-qtkt .qt-ktten,.data-qtkt .qt-ktY{max-width:none;}

/* ==========================================================================
   CHUẨN HÓA v95 — Gạch nợ · thao tác lô tiền mặt · Ngoài sinh hoạt
   ========================================================================== */
/* Nút Ghi nhận và các nút Gạch theo lô: hover nổi rõ, cùng một ngôn ngữ chuyển động. */
.tm-btn:not(:disabled){transition:background .16s,box-shadow .16s,transform .16s;}
.tm-btn:not(:disabled):hover{box-shadow:0 6px 16px rgba(255,102,0,.25);transform:translateY(-1px);}
.tm-btn:not(:disabled):active{box-shadow:0 3px 8px rgba(255,102,0,.20);transform:translateY(0);}
.gn-nhom .bang-dau button[type=submit]:not(:disabled){transition:background .16s,border-color .16s,box-shadow .16s,filter .16s;}
/* UI-02 Trang 2: nút header nhóm KHÔNG nhấc lên (bỏ translateY). */
.gn-nhom .bang-dau button[type=submit]:not(:disabled):hover{filter:brightness(.94);}
.gn-nhom .btn-auto-gach:not(:disabled):hover{background:#12813B!important;border-color:#12813B!important;box-shadow:0 6px 16px rgba(22,163,74,.25);}
.gn-nhom .btn-nsh4-gach:not(:disabled):hover{background:#12813B!important;border-color:#12813B!important;box-shadow:0 6px 16px rgba(22,163,74,.24);}
.gn-nhom .btn-ds:not(:disabled):hover{background:#6D28D9!important;border-color:#6D28D9!important;box-shadow:0 6px 16px rgba(124,58,237,.24);}
.gn-nhom .bang-dau button[type=submit]:not(:disabled):active{box-shadow:none;}

/* ============================================================================
   UI-02 TRANG 2 (GẠCH NỢ) — MÀU NÚT THEO VAI TRÒ + KHÔNG NHẤC LÊN (scoped).
   Chỉ áp trong container của trang Gạch nợ (.sk-nhap/.gn-nhom/.gio-ghep/#gn-xacnhan),
   KHÔNG dùng bare class (vd .btn-them còn dùng ở Danh bạ). ============================ */
/* Gạch / Gạch đã chọn / Gạch gộp = xanh lá */
.gn-nhom .btn-auto-gach, .gn-nhom .btn-nsh4-gach, .gn-nhom .btn-them, .gn-nhom .btn-mo-gio, .gio-ghep .gio-gach{
  background:var(--green); color:#fff; border-color:transparent;
}
/* Hoàn tiền = light-outline action geometry/feedback (như Xuất Excel), nhưng
   giữ semantic Refund ấm và luôn nhẹ hơn Gạch/Gạch gộp. */
.form-hoan-tien .btn-refund{
  min-height:32px;padding:0 10px;border:1px solid var(--orange);border-radius:var(--control-radius);
  background:var(--orange);color:#fff;box-shadow:0 2px 7px rgba(255,102,0,.18);transform:none;
  transition:background .14s,border-color .14s,color .14s,box-shadow .14s;
}
.form-hoan-tien .btn-refund:not(:disabled):hover{
  background:var(--orange-dark);color:#fff;border-color:var(--orange-dark);box-shadow:0 4px 11px rgba(226,90,0,.24);transform:none;
}
.form-hoan-tien .btn-refund:not(:disabled):active{
  background:#C94F00;color:#fff;border-color:#C94F00;box-shadow:none;transform:none;
}
.form-hoan-tien .btn-refund:focus-visible{outline:2px solid var(--orange);outline-offset:2px;box-shadow:none;}
/* Xác nhận nộp TK = tím */
.gn-nhom .btn-ds, .gn-nhom .btn-nop-tk{ background:var(--tim); color:#fff; border-color:transparent; }
/* Nút xác nhận trong popup #gn-xacnhan: mặc định xanh lá (gạch), tím khi nộp TK */
#gn-xn-dongy{ background:var(--green); color:#fff; }
#gn-xn-dongy.gn-nop-tk{ background:var(--tim); }
.gn-refund-modal .gn-xacnhan-ic{background:var(--orange-tint);color:var(--orange-dark);}
.gn-refund-modal #gn-xn-dongy.gn-refund-confirm{
  background:var(--orange);border-color:var(--orange);color:#fff;
}
.gn-refund-modal #gn-xn-dongy.gn-refund-confirm:not(:disabled):hover{
  background:var(--orange-dark);border-color:var(--orange-dark);color:#fff;
}
.gn-refund-modal #gn-xn-dongy.gn-refund-confirm:focus-visible{outline:2px solid var(--orange-dark);outline-offset:2px;}
/* Hover đổi màu (không dịch chuyển) cho các nút chưa có rule hover riêng */
.gn-nhom .btn-them:not(:disabled):hover, .gn-nhom .btn-mo-gio:not(:disabled):hover, .gio-ghep .gio-gach:not(:disabled):hover{ background:#12813B; }
.gn-nhom .btn-nop-tk:not(:disabled):hover{ background:#6D28D9; }
#gn-xn-dongy:not(:disabled):hover{ background:#12813B; }
#gn-xn-dongy.gn-nop-tk:not(:disabled):hover{ background:#6D28D9; }
/* UI-02: chiều cao nút có chữ theo đúng ngữ cảnh toolbar / bảng / modal. */
.gn-nhom .bang-dau .ui-action-btn{height:36px;}
.data-gachtay .ui-action-btn{height:32px;}
.gio-ghep .gio-nut .ui-action-btn{height:40px;}
/* Không nút nào của trang Gạch nợ dịch chuyển khi hover/active */
.sk-nhap .ui-action-btn:not(:disabled):hover, .sk-nhap .ui-action-btn:not(:disabled):active,
.gn-nhom .ui-action-btn:not(:disabled):hover, .gn-nhom .ui-action-btn:not(:disabled):active,
.gio-ghep .ui-action-btn:not(:disabled):hover, .gio-ghep .ui-action-btn:not(:disabled):active,
#gn-xacnhan .ui-action-btn:not(:disabled):hover, #gn-xacnhan .ui-action-btn:not(:disabled):active{ transform:none; }

/* Tiền mặt: khối chọn lô gọn nằm cùng hàng bộ lọc. */
.tm-chon-gon{
  display:flex;align-items:center;gap:10px;flex:0 0 auto;margin:0;
  min-height:38px;padding:4px 5px 4px 11px;border:1px solid var(--teal);
  border-radius:10px;background:var(--teal-tint);
}
.tm-chon-dem{font-size:12px;color:var(--text-muted);white-space:nowrap;}
.tm-chon-dem b{color:var(--teal);font-weight:700;}
.tm-chon-gon .btn-lo{height:30px;padding:0 11px;font-size:12px;border-radius:7px;transition:background .16s,border-color .16s,color .16s,box-shadow .16s,transform .16s;}
.tm-chon-gon .btn-lo:not(:disabled):hover{background:var(--orange-dark);border-color:var(--orange-dark);color:#fff;box-shadow:0 6px 16px rgba(255,102,0,.25);transform:translateY(-1px);}
.tm-chon-gon .btn-lo:not(:disabled):active{background:#D95100;transform:translateY(0);box-shadow:0 3px 8px rgba(255,102,0,.20);}
.tm-chon-gon .btn-lo:disabled{opacity:.48;cursor:not-allowed;}
@media(min-width:1180px){
  /* UI-02 Trang 3 FIX: cho phép xuống hàng ở Desktop để toolbar không tràn ngang. */
  .bang-tm .bang-toolbar{flex-wrap:wrap;}
  .bang-tm .bang-toolbar .loc-trong-bang{order:initial;flex:1 1 360px;min-width:310px;}
  .bang-tm .bang-toolbar .bang-ngan{display:block;}
  .bang-tm .bang-toolbar .bang-xuat{margin-left:0;}
}
@media(max-width:700px){.tm-chon-gon > .tm-chon-dem:first-of-type{display:inline-flex;}}

/* Ngoài sinh hoạt: KPI và thanh công cụ theo mẫu. */
.tong-bar-nsh{margin-bottom:16px;}
.tong-bar-nsh .kpi-txt{flex:1;min-width:0;}
.nsh-kpi-dau{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.nsh-kpi-dau .kpi-nhan{margin:0;}
.nsh-kpi-chip{flex:0 0 auto;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;}
.nsh-kpi-chip.i-blue{background:#E5EDFD;color:#2563EB;}.nsh-kpi-chip.i-tim{background:#EEE7FB;color:#7C3AED;}
.nsh-kpi-chip.i-green{background:#E4F6EB;color:#16A34A;}.nsh-kpi-chip.i-red{background:#FBE6E6;color:#DC2626;}
.nsh-congcu{margin-bottom:16px;}
.nsh-congcu-dau{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.nsh-congcu-dau .btn{height:38px;padding:0 15px;border-radius:9px;font-size:13px;}
.nsh-congcu-dau .nsh-them{box-shadow:0 2px 8px rgba(16,24,40,.16);transition:background .16s,box-shadow .16s,transform .16s;}
.nsh-congcu-dau .nsh-them:hover{box-shadow:0 6px 16px rgba(255,102,0,.22);transform:translateY(-1px);}
.nsh-congcu-dau .nsh-xml{color:var(--text);}.nsh-congcu-dau .nsh-xml .ic{color:var(--tim);}
.nsh-congcu-dau .nsh-xml:hover{background:var(--bg-soft);border-color:#D5DAE3;}
.nsh-congcu-phu{font-size:12px;color:var(--text-mo);}
.nsh-congcu .form-them{padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--white);box-shadow:var(--shadow-card);}
.nsh-congcu .form-them label{font-size:12px;font-weight:600;color:#485061;}
.nsh-congcu .form-them input,.nsh-congcu .form-them select{height:38px;margin-top:5px;border:1px solid var(--line);border-radius:8px;background:var(--bg-soft);}

/* Bảng Theo dõi từng dùng padding 9px của .data-conno nên header thấp hơn chuẩn
   4px. Chỉ cân lại chiều dọc header; giữ padding ngang 8px để đủ 12 cột. */
.data-theodoi thead th{padding-top:11px;padding-bottom:11px;}

/* ========================================================================== 
   CHUẨN HÓA v97 — form tiền mặt 1 hàng, popup lô, XML NSH, trạng thái chung
   ========================================================================== */
/* Form Ghi nhận: tiêu đề + ba trường + nút cùng một hàng trên desktop. */
@media(min-width:1100px){
  .tm-ghinhan{display:flex;align-items:flex-start;padding:14px 18px;gap:18px;}
  .tm-ghi-head{flex:0 0 190px;padding:7px 0 0;border:0;white-space:nowrap;}
  .tm-ghi-body{flex:1 1 auto;min-width:0;padding:0;}
  .tm-ghi-form{grid-template-columns:minmax(170px,1fr) minmax(180px,1fr) 180px auto;gap:12px;}
  .tm-btn{margin-top:20px;}
}

/* Bước 1 giữ màu cam; thao tác nhận bàn giao chuyển sang tím. */
.tong-bar-tm .kpi:first-child .kpi-ic{background:#FEF3E2;color:#F59E0B;box-shadow:0 0 0 4px #FEF7EC;}
.tong-bar-tm .kpi:first-child .kpi-so{color:#B4740A;}
.tm-chon-gon .btn-lo{background:#7C3AED;border-color:#7C3AED;color:#fff;}
.tm-chon-gon .btn-lo:not(:disabled):hover{background:#6D28D9;border-color:#6D28D9;box-shadow:0 6px 16px rgba(124,58,237,.28);}
.tm-chon-gon .btn-lo:not(:disabled):active{background:#5B21B6;box-shadow:0 3px 8px rgba(124,58,237,.22);}

/* Popup nhận bàn giao: đồng bộ popup gạch nợ nhưng dùng màu tím nghiệp vụ. */
.tm-xacnhan .gn-xacnhan-ic{background:#EEE7FB;color:#7C3AED;}
.tm-xacnhan .gn-xacnhan-luu-y{background:#F5F1FD;color:#6D28D9;}
.tm-xn-dongy{background:#7C3AED;color:#fff;border-color:#7C3AED;}
.tm-xn-dongy:hover{background:#6D28D9;border-color:#6D28D9;box-shadow:0 5px 14px rgba(124,58,237,.25);}

/* Ngoài sinh hoạt chỉ nhập XML: nút tím nổi bật và có phản hồi rõ. */
.nsh-congcu-dau .nsh-xml{
  background:#7C3AED;color:#fff;border-color:#7C3AED;
  box-shadow:0 2px 8px rgba(124,58,237,.18);
  transition:background .16s,border-color .16s,box-shadow .16s,transform .16s;
}
.nsh-congcu-dau .nsh-xml .ic{color:#fff;}
.nsh-congcu-dau .nsh-xml:hover{background:#6D28D9;border-color:#6D28D9;color:#fff;box-shadow:0 6px 16px rgba(124,58,237,.27);transform:translateY(-1px);}
.nsh-congcu-dau .nsh-xml:active{background:#5B21B6;transform:translateY(0);}
.nsh-congcu #form-xml button[type=submit]{background:#7C3AED;color:#fff;border-color:#7C3AED;transition:background .16s,box-shadow .16s,transform .16s;}
.nsh-congcu #form-xml button[type=submit]:hover{background:#6D28D9;box-shadow:0 5px 14px rgba(124,58,237,.24);transform:translateY(-1px);}

/* Cột thao tác NSH căn giữa tuyệt đối cả tiêu đề và nội dung. */
.data-nsh thead th.c-thaotac,.data-nsh td.nsh-thaotac{text-align:center!important;padding-left:8px!important;padding-right:8px!important;}
.data-nsh .nsh-nut-wrap{width:100%;justify-content:center;}

/* Trạng thái của Theo dõi + NSH dùng cùng kiểu chip vuông mềm, chevron xám;
   không dùng mũi tên, viền hoặc quầng cam của select bộ lọc. */
.data-theodoi .tt-select,.data-nsh .tt-select{
  width:auto;max-width:132px;min-height:27px;
  padding:4px 23px 4px 9px!important;border:1px solid transparent!important;border-radius:7px;
  font-size:11.5px;font-weight:600;
  background-position:right 7px center!important;background-size:10px 10px!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")!important;
  transition:border-color .15s,box-shadow .15s,filter .15s;
}
.data-theodoi .tt-select:hover,.data-nsh .tt-select:hover{border-color:#CAD5E7!important;filter:saturate(.94);}
.data-theodoi .tt-select:focus,.data-nsh .tt-select:focus{
  outline:none;border-color:#9BB2D7!important;box-shadow:0 0 0 3px rgba(26,31,107,.09)!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%231A1F6B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")!important;
}
.data-nsh .tt,.data-theodoi .tt{border-radius:7px;font-size:11.5px;font-weight:600;}

/* Cùng một chiều cao tối thiểu cho header mọi bảng; header có 2 dòng vẫn tự nở. */
table.data thead th{height:42px;box-sizing:border-box;}

/* v98: khóa cùng một số đo thật cho hai header người dùng đang đối chiếu.
   Dùng padding + line-height thay vì chỉ height (table-cell có thể bỏ qua height). */
.data-theodoi thead th,.data-tm thead th{
  height:44px!important;padding-top:12px!important;padding-bottom:12px!important;
  line-height:18px!important;box-sizing:border-box!important;
}

/* Khóa cao độ nút Ghi nhận bằng đúng hàng ô nhập trên desktop. */
@media(min-width:1100px){
  .tm-ghi-form{align-items:start!important;}
  .tm-ghi-form .tm-btn{
    height:40px!important;margin-top:20px!important;align-self:start!important;
  }
}

/* NSH: cột trạng thái gọn theo nội dung, trả diện tích cho tên và nội dung HĐ. */
.data-nsh th:nth-child(3){width:18.5%;}
.data-nsh th:nth-child(6){width:19.5%;}
.data-nsh th:nth-child(8){width:9%;}
.data-nsh .tt-select{max-width:112px;}

/* ========================================================================== 
   CHUẨN HÓA v99 — Tiền mặt một hàng thật · XML topbar · trạng thái theo màu
   ========================================================================== */
/* Form tiền mặt: icon + nhãn + ô nhập cùng một trục như thanh thông tin mẫu. */
.tm-o-ico{display:none;color:var(--orange);align-items:center;justify-content:center;flex:0 0 auto;}
.tm-o-ico .ic{width:15px;height:15px;}
@media(min-width:1100px){
  .tm-ghinhan{
    display:flex!important;align-items:center!important;gap:16px!important;
    padding:13px 18px!important;overflow:visible;
  }
  .tm-ghi-head{flex:0 0 190px!important;padding:0!important;align-items:center!important;}
  .tm-ghi-body{flex:1 1 auto!important;min-width:0;padding:0!important;}
  .tm-ghi-form{
    display:flex!important;align-items:center!important;gap:12px!important;
    width:100%;margin:0;
  }
  .tm-o{
    display:flex!important;flex-direction:row!important;align-items:center!important;
    gap:8px!important;min-width:0;position:relative;
  }
  .tm-o-makh{flex:1.08 1 0;}
  .tm-o-ten{flex:1.12 1 0;}
  .tm-o-tien{flex:.9 1 0;}
  .tm-o-ico{display:flex;}
  .tm-o label{margin:0!important;white-space:nowrap;font-size:12px;line-height:1;}
  .tm-o .tm-inp-wrap{flex:1 1 auto;min-width:0;}
  .tm-o .tm-inp{height:40px;min-width:0;}
  .tm-o .tm-hint{
    display:none;position:absolute;z-index:8;top:44px;left:23px;
    min-height:0;max-width:calc(100% - 23px);padding:5px 8px;border-radius:7px;
    background:var(--white);border:1px solid var(--line);box-shadow:var(--shadow-menu);
    white-space:normal;
  }
  .tm-o .tm-hint:not(:empty){display:block;}
  .tm-ghi-form .tm-btn{height:40px!important;margin:0!important;align-self:center!important;}
}

/* Ghi nhận giữ màu cam nghiệp vụ nhưng dùng đúng hiệu ứng của nút lô màu tím. */
.tm-btn:not(:disabled){
  background:var(--orange);border-color:var(--orange);color:#fff;
  transition:background .16s,border-color .16s,box-shadow .16s,transform .16s;
}
.tm-btn:not(:disabled):hover{
  background:var(--orange-dark);border-color:var(--orange-dark);
  box-shadow:0 6px 16px rgba(255,102,0,.28);transform:translateY(-1px);
}
.tm-btn:not(:disabled):active{background:#C94F00;transform:translateY(0);box-shadow:0 3px 8px rgba(255,102,0,.22);}
.tm-btn:not(:disabled):focus-visible{outline:2px solid var(--orange);outline-offset:2px;}

/* Nút XML topbar dùng chung hiệu ứng .tb-nhap (mục H9 review v2, xem khối
   ".tb-nhap:not(:disabled):hover" cạnh khai báo .tb-nhap gốc) — không còn
   override riêng ở đây để tránh hai nguồn hiệu ứng lệch nhau. */
.nsh-congcu{margin-bottom:0;}
.nsh-congcu #form-xml{margin-bottom:16px;}

/* Tiền mặt: cột thao tác — bề rộng đã khai ở khối .data-tm phía trên (nguồn
   duy nhất); ở đây chỉ còn căn giữa nội dung ô. */
.data-tm thead th.cw-nut,.data-tm td.td-thaotac{text-align:center!important;padding-left:6px!important;padding-right:6px!important;}
.data-tm td.td-thaotac{line-height:0;}
.data-tm td.td-thaotac form{display:inline-flex!important;margin:0!important;}
/* UI-02 Trang 3: nút thao tác tự giãn ngang (ghi đè width 72px của .btn-huygach/.btn-huyluot
   TRONG PHẠM VI cột thao tác Thu tiền mặt — không đụng global) → "Hoàn tác gạch" không bị cắt. */
.data-tm td.td-thaotac .btn{height:32px;padding:0 7px;font-size:11.25px;gap:4px;line-height:1;width:auto;min-width:0;}
.data-tm td.td-thaotac .btn .ic{width:13px;height:13px;}

/* NSH: hai trạng thái có cùng bề ngang và luôn hiện đủ chữ. */
.data-nsh th:nth-child(3){width:18%;}
.data-nsh th:nth-child(6){width:18%;}
.data-nsh th:nth-child(8){width:11%;}
.data-nsh thead th.c-tt,.data-nsh td.col-tt{text-align:center;}
.data-nsh .tt,.data-nsh .tt-select{
  width:130px!important;min-width:130px!important;max-width:130px!important;
  box-sizing:border-box;overflow:visible;text-overflow:clip;
}
.data-nsh .tt{justify-content:flex-start;}

/* Mũi tên select lấy đúng màu trạng thái. */
.data-theodoi .tt-select.tt-do,.data-nsh .tt-select.tt-do{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23DC2626' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")!important;}
.data-theodoi .tt-select.tt-xanh,.data-nsh .tt-select.tt-xanh,
.data-theodoi .tt-select.tt-xanhla,.data-nsh .tt-select.tt-xanhla{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2316A34A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")!important;}
.data-theodoi .tt-select.tt-cam,.data-nsh .tt-select.tt-cam{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23E25A00' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")!important;}
.data-theodoi .tt-select.tt-xanhduong,.data-nsh .tt-select.tt-xanhduong{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")!important;}
.data-theodoi .tt-select.tt-teal,.data-nsh .tt-select.tt-teal{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%230EA5A5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")!important;}
.data-theodoi .tt-select.tt-tim,.data-nsh .tt-select.tt-tim{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237C3AED' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")!important;}
.data-theodoi .tt-select.tt-xam,.data-nsh .tt-select.tt-xam{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")!important;}

/* Hover giống nút Xuất Excel về nền/viền/bóng, nhưng không nhấc hoặc dịch nút. */
.data-theodoi .tt-select:hover,.data-nsh .tt-select:hover,
.data-theodoi .tt-select:focus,.data-nsh .tt-select:focus{
  border-color:currentColor!important;filter:none!important;transform:none!important;
  box-shadow:0 4px 12px color-mix(in srgb,currentColor 24%,transparent)!important;
}

/* ========================================================================== 
   CHUẨN HÓA v100 — đường ngăn Tiền mặt · lọc · ZNS · header mọi bảng
   ========================================================================== */
/* Tiền mặt: đường ngăn dọc sau tiêu đề, giống .bang-ngan của đầu bảng. */
@media(min-width:1100px){
  .tm-ghinhan .tm-ghi-body{
    border-left:1px solid var(--line);
    padding-left:16px!important;
  }
  /* Icon và nhãn dùng đúng thông số trang Phát hành định kỳ. */
  .tm-o-ico .ic{width:14px;height:14px;color:var(--orange);}
  .tm-o label{
    color:var(--navy)!important;font-size:12px!important;font-weight:600!important;
    letter-spacing:.1px;line-height:1!important;
  }
  .tm-o .tm-inp{font-size:13.5px;font-weight:500;color:var(--text);}
}

/* Ghi nhận và nhận bàn giao dùng cùng nhịp chuyển động/đổ bóng. */
.tm-btn:not(:disabled),.tm-chon-gon .btn-lo:not(:disabled){
  transition:background .16s,border-color .16s,color .16s,box-shadow .16s,transform .16s;
}
.tm-btn:not(:disabled):hover,.tm-chon-gon .btn-lo:not(:disabled):hover{transform:translateY(-1px);}
.tm-btn:not(:disabled):active,.tm-chon-gon .btn-lo:not(:disabled):active{transform:translateY(0);}

/* Bộ lọc nằm trong header bảng: thống nhất cỡ, độ đậm và cao độ chữ. */
.loc-bar input[type=search],.loc-bar input[type=text],.loc-bar select,.loc-bar .btn{
  font-family:var(--font)!important;font-size:12.5px!important;font-weight:600!important;
  line-height:1!important;letter-spacing:0!important;
}
.loc-bar input[type=search]::placeholder,.loc-bar input[type=text]::placeholder{font-weight:400;}

/* ZNS: dành đủ chỗ cho CS đầu/CS cuối và cấm xuống dòng ở hai tiêu đề này. */
.data-zns .z-dc{width:13%!important;}
.data-zns .z-cs{width:6%!important;}
.data-zns .z-ndck{width:13.5%!important;}
.data-zns thead th.z-cs{white-space:nowrap!important;overflow:visible;text-overflow:clip;}

/* ==========================================================================
   HOST FIX 02 (9) — HỆ THÀNH PHẦN DÙNG CHUNG CHO CÁC TRANG "NHẬP DỮ LIỆU"
   --------------------------------------------------------------------------
   Dùng bởi CẢ HAI trang: nsh_import.php (Nhập hóa đơn XML) và import.php
   (Nhập dữ liệu công nợ). Trước đây khối này nằm trong <style> nội tuyến của
   nsh_import.php với tiền tố .xml* → không dùng lại được. Nay chuyển về đây,
   đổi sang tiền tố trung tính .nhapw-* để hai trang dùng CHUNG một nguồn khai
   báo (không nhân bản CSS, không tạo class gần giống nhau theo tên trang).
   KPI của hai trang dùng component hệ thống .tong-bar/.kpi (chuẩn Thu tiền mặt),
   KHÔNG khai báo kiểu KPI riêng.
   ========================================================================== */
.nhapw{width:100%;max-width:none;}
.nhapw-dau{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px;}
.nhapw-dau p{margin:0;color:var(--text-muted);font-size:13px;line-height:1.5;}
/* Thanh các bước (stepper) */
.nhapw-buoc{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px;}
.nhapw-buoc .b{display:flex;align-items:center;gap:8px;padding:8px 14px;border-radius:10px;background:var(--bg-soft);
  border:1px solid var(--line);color:var(--text-muted);font-size:12.5px;font-weight:600;}
/* HOST FIX 03 (§4): số 1/2/3 lệch tâm DỌC vì kế thừa line-height:1.55 của
   body (đã có tiền lệ với .ky-icon — xem ghi chú "Icon lệch tâm là do
   line-height" phía trên) — line-box 12px*1.55≈18.6px không nằm giữa vòng
   tròn 20px một cách đối xứng theo baseline chữ số. Khóa line-height BẰNG
   đúng chiều cao vòng tròn (20px) để tâm chữ số trùng tâm hình học của
   vòng tròn ở MỌI trạng thái (active/done/mặc định — cả ba chỉ đổi
   background, không đổi box model, nên sửa một chỗ áp dụng chung). */
.nhapw-buoc .b .so{width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;
  background:#D9DFEA;color:#fff;font-size:12px;font-weight:800;line-height:20px;}
.nhapw-buoc .b.done{color:#0F7A38;border-color:#86D9A5;background:#E4F6EB;}
.nhapw-buoc .b.done .so{background:#16A34A;}
.nhapw-buoc .b.active{color:var(--navy);border-color:var(--orange);background:#FFF3E9;}
.nhapw-buoc .b.active .so{background:var(--orange);}
/* Khu vực kéo-thả / chọn file */
.nhapw-drop{border:2px dashed #C4CBDB;border-radius:14px;background:var(--bg-soft);padding:30px 20px;text-align:center;
  cursor:pointer;transition:border-color .15s,background .15s;display:block;position:relative;}
/* Ô <input type=file> phủ kín vùng thả nhưng trong suốt: giữ được thuộc tính
   `required` của trình duyệt (dùng attribute `hidden` sẽ khiến Chrome báo
   "not focusable" và CHẶN submit). Trang Nhập XML dùng input[hidden] + JS click
   nên không bị rule này ảnh hưởng (hidden vẫn display:none). */
.nhapw-drop input[type=file]{position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer;}
.nhapw-drop:hover,.nhapw-drop.hover,.nhapw-drop.dang-keo{border-color:var(--orange);background:#FFF6EF;}
.nhapw-drop .ic-tep{width:42px;height:42px;color:var(--orange);margin:0 auto 8px;display:block;}
.nhapw-drop b{display:block;font-size:14px;color:var(--navy);}
.nhapw-drop span{display:block;color:var(--text-muted);font-size:12.5px;margin-top:3px;}
/* Bước chọn ZIP NSH dùng cùng nhịp gọn với SH, không tách thông tin thành quá
   nhiều dòng cao. */
.adp-upload-drop--compact{padding:22px 20px;}
.adp-upload-drop--compact .ic-tep{width:42px;height:42px;margin-bottom:1px;}
.adp-upload-drop--compact .import-drop-support{font-size:12px;}
/* Một visual shell cho kết quả nhập SH/NSH; KPI nghiệp vụ vẫn lấy từ từng
   authoritative result contract và số card tự co theo dữ liệu thực. */
.import-result-shell{border-color:var(--green)!important;background:var(--white)!important;padding:0;overflow:hidden;box-shadow:var(--shadow-card);}
.import-result-shell::before{content:"";display:block;height:4px;background:var(--green);}
.import-result-head{display:flex;align-items:center;gap:12px;margin-bottom:14px;padding:18px 18px 0;}
.import-result-success-icon{display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 42px!important;width:42px!important;height:42px!important;border-radius:50%!important;background:var(--green)!important;color:#fff!important;}
.import-result-success-icon .ic,.import-result-success-icon svg{width:22px!important;height:22px!important;color:#fff!important;stroke:currentColor!important;}
.import-result-head h2{margin:0;color:var(--navy);font-size:20px;line-height:1.25;}
.import-result-subtitle{margin:3px 0 0;color:var(--text-muted);font-size:13px;line-height:1.4;}
.import-result-kpis{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));margin:0;border-left:0;border-right:0;border-radius:0;box-shadow:none;}
.import-result-kpis .kpi{min-height:88px;padding:14px 18px;align-items:flex-start;}
.import-result-kpis .kpi-txt{display:flex;flex-direction:column;justify-content:center;min-height:60px;}
.import-result-kpis .kpi-nhan{font-size:11px;line-height:1.35;margin-bottom:3px;}
.import-result-kpis .kpi-so{font-size:22px;font-weight:800;line-height:1.2;}
.import-result-kpis .kpi-don{font-size:11px;line-height:1.35;margin-top:3px;min-height:15px;}
.import-result-kpis .import-kpi-attention{color:var(--orange-dark);}
.import-result-kpis .import-kpi-info{color:var(--navy);}
.import-result-kpis .import-kpi-text{color:var(--navy);font-size:16px;line-height:1.35;}
.import-result-meta{margin:0;padding:12px 18px 0;font-size:12.5px;line-height:1.5;}
.import-result-actions{margin:14px 18px 18px;}
.import-success-mode > .nhapw-dau,.import-success-mode > .nhapw-buoc,.import-success-mode > .import-new-workflow{display:none;}
.nsh-detail-danger{margin-top:18px;padding-top:16px;border-top:1px solid var(--line);}
.nsh-detail-danger .ct-h{margin:0 0 8px;}
.nsh-detail-danger-copy,.nsh-detail-delete-reason{font-size:12.5px;line-height:1.5;margin:0 0 10px;}
.nsh-detail-delete-reason{margin-top:8px;color:var(--text-muted);overflow-wrap:anywhere;}
.nsh-detail-delete-form{margin:0;}
.nsh-detail-delete{min-height:36px;}
@media(max-width:1100px){.import-result-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:620px){
  .import-result-head{align-items:flex-start;}
  .import-result-head h2{font-size:18px;}
  .import-result-kpis{grid-template-columns:1fr;}
}

/* Small-difference/read-model parity: one deterministic status component for
   SH and NSH. Fixed inline-size prevents content-dependent divergence. */
:root{--adp-debt-status-width:164px;--adp-debt-status-height:30px;}
.data-theodoi .debt-status-token,.data-nsh .debt-status-token{
  box-sizing:border-box!important;inline-size:var(--adp-debt-status-width)!important;
  width:var(--adp-debt-status-width)!important;min-width:var(--adp-debt-status-width)!important;
  max-width:var(--adp-debt-status-width)!important;height:var(--adp-debt-status-height)!important;
  padding:5px 10px!important;border-radius:7px!important;font-size:11.5px!important;
  line-height:18px!important;vertical-align:middle!important;white-space:nowrap!important;
  align-items:center;justify-content:flex-start;overflow:visible;text-overflow:clip;
}
.accepted-variance-indicator{display:block;margin-top:5px;color:var(--orange-dark);
  font-size:10.5px;line-height:1.25;font-weight:600;white-space:normal;}
.gn-search-bridge{display:none!important;}
.gn-queue-loading{min-height:280px;display:flex;align-items:flex-start;justify-content:center;}
.gn-queue-state{box-sizing:border-box;margin-top:28px;padding:14px 16px;border:1px solid var(--line);border-radius:10px;background:var(--white);display:flex;align-items:center;gap:11px;color:var(--text-muted);}
.gn-queue-state-copy{display:flex;min-width:0;flex:1 1 auto;flex-direction:column;gap:2px;line-height:1.35;}
.gn-queue-state-copy b{color:var(--navy);font-size:13.5px;font-weight:700;}
.gn-queue-state-copy small{font-size:12px;color:var(--text-muted);}
.gn-queue-loading-card{font-weight:600;}
.gn-queue-loading-dot{width:10px;height:10px;border-radius:50%;background:var(--orange);box-shadow:0 0 0 5px var(--orange-tint);animation:gnQueuePulse 1s ease-in-out infinite alternate;}
.gn-queue-loading-error{border-color:#F1C7C7;background:var(--red-tint);color:var(--red);}
.gn-queue-loading-error .gn-queue-state-copy b,.gn-queue-loading-error .gn-queue-state-copy small{color:var(--red);}
.gn-queue-error-icon{display:inline-flex;width:24px;height:24px;flex:0 0 24px;align-items:center;justify-content:center;border-radius:50%;background:var(--red);color:#fff;font-size:14px;font-weight:800;}
.gn-queue-retry{flex:0 0 auto;}
.gn-queue-loaded{animation:gnQueueReveal .16s ease-out;}
@keyframes gnQueuePulse{to{opacity:.45;transform:scale(.82)}}
@keyframes gnQueueReveal{from{opacity:.7;transform:translateY(3px)}to{opacity:1;transform:none}}
@media(min-width:901px){
  /* RF01: the desktop shell retains the C0 `.card` geometry even though the
     state element no longer carries that generic class. Mobile overrides stay
     isolated below in the max-width:900px contract. */
  #gachno-vung .gn-queue-state{
    width:auto;margin:28px 0 16px;padding:16px 18px;
    border:1px solid var(--line);border-radius:var(--radius-lg);
    background:var(--white);box-shadow:var(--shadow-card);
  }
  #gachno-vung .gn-queue-loading-error{border-color:var(--line);background:var(--white);}
}
.gn-lydo-doisoat{box-sizing:border-box;display:block;width:100%;margin:6px 0 0;padding:7px 9px;border:1px solid var(--line);
  border-radius:7px;font:inherit;text-align:left;}
.cash-helper-result{display:flex;align-items:flex-start;gap:8px;margin-top:6px;line-height:1.4;}

/* P3-C0 detail simplification: document actions stay in Hóa đơn / kỳ. */
.detail-document-actions{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 3px;}
.detail-document-action{min-height:32px;display:inline-flex;align-items:center;justify-content:center;}
.detail-original-invoice{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-top:9px;padding-top:9px;border-top:1px dashed var(--line-2);}
.detail-original-invoice .detail-label{margin-right:auto;}
.detail-admin-link{display:flex;justify-content:flex-end;margin:14px 2px 2px;}

/* Quản trị > Công nợ reuses the existing cards, buttons, fields and modal. */
.qt-debt-selector{margin-top:12px;}
/* Một thanh điều khiển gọn: tiêu đề · Loại · [select] · nhãn · [ô tìm có kính lúp]. */
.qt-debt-search{display:flex;flex-wrap:nowrap;align-items:center;gap:10px 12px;padding:11px 16px;border-bottom:1px solid var(--line);}
.qt-debt-search-title{flex:0 0 auto;margin:0;font-size:15.5px;font-weight:700;color:var(--text);}
.qt-debt-search-divider{display:block;flex:0 0 1px;width:1px;height:24px;margin:0 2px;background:var(--line);align-self:center;}
.qt-debt-search label{display:flex;align-items:center;min-width:0;gap:8px;color:var(--text);font-size:12.5px;font-weight:650;white-space:nowrap;}
.qt-debt-search label>span{color:var(--navy);}
.qt-debt-search label:first-of-type{flex:0 0 auto;}
/* P3-C0-L3A — Ô tìm gọn lại (không chiếm hết chỗ trống): rộng thực dụng ~480px,
   co được theo màn hình, không tạo tràn ngang. flex-grow=0 để không kéo dài. */
.qt-debt-search-main{flex:0 1 480px;min-width:0;max-width:500px;}
.qt-debt-search select,.qt-debt-search input{box-sizing:border-box;height:40px;border:1px solid var(--line);border-radius:9px;background:var(--white);padding:0 11px;color:var(--text);transition:border-color .15s ease,box-shadow .15s ease;}
/* P3-C0-L3A — Select "Loại" đủ rộng để hiện trọn "Ngoài sinh hoạt (NSH)". */
.qt-debt-search select{width:auto;min-width:210px;}
/* Theo mẫu tìm kiếm toàn hệ thống: kính lúp chỉ là affordance bên trong ô, Enter gửi form. */
.qt-debt-search-field{position:relative;display:flex;flex:1 1 auto;min-width:0;}
.qt-debt-search-field input{width:100%;min-width:0;flex:1 1 auto;padding-left:38px;}
.qt-debt-search-icon{position:absolute;left:0;top:0;display:inline-flex;align-items:center;justify-content:center;width:38px;height:40px;color:var(--text-muted);pointer-events:none;transition:color .15s ease;}
.qt-debt-search-icon svg{width:17px;height:17px;}
.qt-debt-search-field:focus-within .qt-debt-search-icon{color:var(--orange);}
.qt-debt-search select:hover,.qt-debt-search input:hover{border-color:#AEBBCB;}
.qt-debt-search select:focus,.qt-debt-search input:focus{border-color:var(--teal);outline:0;box-shadow:0 0 0 3px var(--teal-tint);}
.qt-debt-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;max-height:300px;overflow-y:auto;padding:10px 16px 12px;}
.qt-debt-result{display:grid;gap:3px;min-width:0;padding:9px 11px;border:1px solid var(--line);border-radius:9px;background:var(--white);color:var(--text);text-decoration:none;}
.qt-debt-result:hover,.qt-debt-result.active{border-color:var(--teal);background:#EEF7F4;}
.qt-debt-result span,.qt-debt-result small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.qt-debt-result span{font-size:12.5px;}.qt-debt-result small{color:var(--text-muted);}
.qt-debt-context{margin:12px 0;overflow:hidden;}
.qt-debt-heading{display:flex;align-items:center;justify-content:flex-start;flex-wrap:nowrap;gap:18px;padding:12px 16px;}
.qt-debt-identity{display:flex;align-items:center;flex:0 1 auto;min-width:0;gap:7px 11px;white-space:nowrap;}
.qt-debt-identity>b{flex:0 0 auto;}
.qt-debt-subject{min-width:0;padding-left:11px;border-left:1px solid var(--line-2);color:var(--text-muted);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;}
.qt-debt-current-invoice{display:inline-flex;align-items:center;flex-wrap:wrap;gap:8px;}
.qt-debt-current-invoice .tt{flex:0 0 auto;}
.qt-debt-amount{display:flex;align-items:center;flex:0 0 auto;padding:3px 0 3px 16px;border-left:1px solid var(--line);}
.qt-debt-balance{color:var(--navy);white-space:nowrap;}
.qt-debt-workspace{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:12px;align-items:start;}
.qt-debt-column{display:flex;min-width:0;flex-direction:column;gap:10px;}
.qt-debt-area>.bang-dau{padding:12px 16px;}
.qt-debt-area-body{padding:14px 16px;}
.qt-debt-business-column #qt-debt-info{padding-top:10px;padding-bottom:10px;}
.qt-debt-business-column #qt-debt-info .detail-row{padding-top:6px;padding-bottom:6px;}
.qt-debt-area .ct-ls-item{margin-bottom:9px;}
.qt-debt-audit-region{width:100%;margin:0;}
.qt-debt-audit-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;}
.qt-debt-audit-grid .detail-disclosure{min-width:0;}
.qt-debt-audit-grid .detail-disclosure + .detail-disclosure{margin-top:0;padding-top:0;border-top:0;}
.qt-debt-audit-region .detail-value{min-width:0;overflow-wrap:anywhere;word-break:normal;}
.qt-debt-related{overflow:hidden;}
.qt-debt-related-label{display:flex;align-items:baseline;justify-content:flex-start;flex-wrap:wrap;gap:5px 10px;padding:12px 16px;}
/* Tiêu đề thẻ ngang hàng (Lịch sử / Xử lý / Thông tin / Nhật ký) dùng CHUNG
   một kiểu tiêu đề chính (.bang-dau h2 = var(--text)); không tự đổi màu riêng. */
.qt-debt-related-label h2{margin:0;}
.qt-debt-related-label>span{color:var(--text-muted);font-size:11.5px;}
.qt-debt-related-list{display:grid;gap:7px;padding:10px 16px 12px;}
.qt-debt-related-item{display:grid;gap:5px;min-width:0;padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--text);text-decoration:none;}
.qt-debt-related-item:hover{border-color:var(--teal);background:#EEF7F4;}
.qt-debt-related-item.selected{border-color:var(--teal);background:#EEF7F4;box-shadow:inset 3px 0 0 var(--teal);}
.qt-debt-related-title{display:flex;align-items:center;flex-wrap:wrap;gap:5px 7px;min-width:0;}
.qt-debt-related-title>b{font-size:13px;}
.qt-debt-related-item small{overflow:hidden;color:var(--text-muted);font-size:11.5px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap;}
.qt-debt-related-meta{display:grid;gap:2px;min-width:0;}
.qt-debt-related-meta small{display:block;overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;}
.qt-debt-related-meta .qt-debt-related-current{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;font-weight:600;}
.qt-debt-related-current-text{min-width:0;overflow-wrap:anywhere;}
.qt-debt-related-current .tt{flex:0 0 auto;}
.qt-debt-related-predecessor{font-weight:450;}
.qt-debt-related-id{color:var(--text-muted)!important;font-weight:400;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:normal!important;}
.qt-document-health .bang-dau{justify-content:flex-start;gap:10px;padding:10px 16px;}
.qt-debt-completed{display:grid;gap:10px;justify-items:start;}
.qt-debt-delete{margin:0 16px 16px;padding-top:14px;border-top:1px solid var(--line);}
.qt-debt-delete h3{font-size:13px;margin:0 0 7px;color:var(--navy);}
#qt-debt-void-form{display:grid;gap:10px;}
#qt-debt-void-reason{box-sizing:border-box;width:100%;height:96px;min-height:96px;max-height:96px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;resize:none;overflow-y:auto;font:inherit;line-height:1.45;}
#qt-debt-void-form .btn{justify-self:start;}
#qt-debt-clean-form{display:grid;gap:10px;}
#qt-debt-clean-reason{box-sizing:border-box;width:100%;height:104px;min-height:104px;max-height:104px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:var(--white);color:var(--text);resize:none;overflow-y:auto;font:inherit;line-height:1.45;}
#qt-debt-clean-reason:focus{border-color:var(--navy);outline:2px solid rgba(23,58,103,.12);outline-offset:1px;}
#qt-debt-clean-form .btn{justify-self:start;}
.qt-debt-confirm{position:relative;max-width:480px;}
.qt-debt-confirm h3{padding-right:34px;margin:0 0 10px;color:var(--navy);}
.qt-debt-confirm p{line-height:1.6;margin:0 0 16px;}
#qt-debt-audit .lifecycle-technical-history .detail-value{overflow-wrap:anywhere;word-break:normal;}

@media(max-width:950px){
  .qt-debt-workspace{grid-template-columns:1fr;}
  .qt-debt-results{grid-template-columns:1fr;}
}
@media(max-width:900px){
  .qt-debt-heading{align-items:flex-start;}
  .qt-debt-identity{flex-wrap:wrap;row-gap:5px;white-space:normal;}
  .qt-debt-subject{flex-basis:100%;padding-left:0;border-left:0;overflow:visible;text-overflow:clip;}
  .qt-debt-search-main{flex:1 1 300px;}
  .qt-debt-search input{min-width:180px;}
}
@media(max-width:760px){
  .qt-debt-search{align-items:stretch;flex-direction:column;}
  .qt-debt-search-title{width:100%;}
  .qt-debt-search-divider{display:none;}
  .qt-debt-search label{display:grid;width:100%;gap:4px;white-space:normal;}
  .qt-debt-search-main{flex:0 0 auto;}
  .qt-debt-search select,.qt-debt-search input{width:100%;min-width:0;}
}
@media(max-width:620px){
  .qt-debt-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:5px 12px;}
  .qt-debt-amount{align-self:start;padding:3px 0 3px 12px;border-top:0;border-left:1px solid var(--line);}
  .qt-debt-audit-grid{grid-template-columns:1fr;}
  .qt-debt-audit-grid .detail-disclosure{grid-column:auto;}
  .qt-debt-related-item small{white-space:normal;overflow-wrap:anywhere;}
}
/* Danh sách file đã chọn */
.nhapw-flist{margin-top:14px;display:flex;flex-direction:column;gap:6px;}
.nhapw-fitem{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--line);
  border-radius:9px;background:var(--white);font-size:12.5px;}
.nhapw-fitem .ten{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;color:var(--text);}
.nhapw-fitem .co{color:var(--text-muted);white-space:nowrap;}
.nhapw-fitem .xoa{border:none;background:none;color:var(--red);cursor:pointer;font-size:17px;line-height:1;padding:2px 6px;border-radius:6px;}
.nhapw-fitem .xoa:hover{background:var(--red-tint);}
.nhapw-fdem{margin-top:10px;font-size:12.5px;color:var(--text-muted);}
.nhapw-fdem b{color:var(--navy);}
/* Hàng nút thao tác cuối mỗi bước */
.nhapw-nut{margin-top:14px;display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
/* Phần đầu của chính khung bảng xem trước (không phải thẻ nổi độc lập). */
.import-preview-info{
  background:var(--white);border-bottom:1px solid var(--line);padding:12px 16px;
  border-radius:calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}
.import-preview-info > b{display:block;color:var(--text);}
.import-preview-info > p{margin:4px 0 0!important;}
.import-preview-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;}
.import-selection-summary{display:inline-flex;align-items:center;align-self:stretch;font-size:12.5px;}
.import-preview-actions .import-cancel{margin-left:auto;}
.import-save-note{
  border:1px solid var(--line);background:var(--white);border-radius:var(--radius-lg);
  box-shadow:var(--shadow-card);padding:11px 14px;font-size:12.5px;color:var(--text-muted);margin-top:10px;
}
/* Khối chọn file có đánh số thứ tự (trang Nhập dữ liệu công nợ có 2 mục file).
   HOST FIX 03.2 (§6 + §7): đổi từ FLEX-NGANG (số ở cột trái, nội dung ở cột
   phải) sang BLOCK — số thứ tự nay nằm TRONG hàng .tieude.
   · §7: nhờ vậy vùng thả file không còn bị thụt trái 38px (26px số + 12px gap)
     trong khi mép phải vẫn sát container; mọi ô thả file / ghi chú / hàng nút
     giờ dùng CHUNG một mép container → lề trái và phải đều nhau.
   · §6: .tieude là flex căn giữa trục dọc, nên chấm tròn số và chữ tiêu đề
     thẳng hàng tuyệt đối; line-height:26px của .so khóa chữ số vào đúng tâm
     vòng tròn (cùng loại lỗi line-height kế thừa đã sửa cho stepper ở FIX 03). */
.nhapw-muc{display:block;}
.nhapw-muc + .nhapw-muc{margin-top:18px;}
.nhapw-muc .tieude{
  display:flex; align-items:center; gap:10px;
  font-size:13.5px;font-weight:700;color:var(--navy);margin-bottom:8px;
}
.nhapw-muc .so{width:26px;height:26px;flex:0 0 auto;border-radius:50%;background:var(--orange);color:#fff;
  display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;line-height:26px;}
.nhapw-ghichu{margin-top:8px;font-size:12px;color:var(--text-muted);line-height:1.5;}
.nhapw-ften{display:block;margin-top:6px;font-size:12.5px;font-weight:600;color:var(--navy);}
/* HOST FIX 03.1 (§3.2): lưới BA ô file-tòa riêng biệt (Nhập dữ liệu công nợ) —
   dùng lại NGUYÊN component .nhapw-drop, chỉ thêm bố cục lưới 3 cột Desktop,
   xuống 1 cột khi màn hẹp để không tràn ngang. */
.nhapw-toa-luoi{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;}
@media(max-width:900px){.nhapw-toa-luoi{grid-template-columns:1fr;}}
.nhapw-drop-toa{padding:20px 14px;}
.nhapw-drop-toa .ic-tep{width:32px;height:32px;margin-bottom:6px;}

/* Tất cả bảng dùng đúng hàng tiêu đề chuẩn của Theo dõi công nợ.
   Không cho nhãn xuống dòng làm hàng cao hơn; nội dung dài tự rút gọn bằng …. */
table.data thead th{
  height:var(--table-head-height)!important;max-height:var(--table-head-height)!important;
  padding-top:12px!important;padding-bottom:12px!important;
  line-height:18px!important;vertical-align:middle!important;box-sizing:border-box!important;
  white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;
}

/* ========================================================================== 
   CHUẨN HÓA v102 — nhãn form Tiền mặt và trạng thái hai nút nghiệp vụ
   ========================================================================== */
/* Chỉ đồng bộ CỠ chữ và icon với .ph-nhan trang Phát hành định kỳ;
   không thay đổi cấu trúc, chiều rộng hoặc khoảng cách của form Tiền mặt. */
.tm-o label,.ph-nhan{
  font-size:12px!important;font-weight:600!important;
}
.tm-o-ico .ic,.ph-nhan svg{
  width:14px!important;height:14px!important;
}

/* Hai nút khác màu nghiệp vụ nhưng dùng chung hoàn toàn số đo hiệu ứng:
   cùng thời gian chuyển, độ nâng, bóng, trạng thái nhấn và vòng focus. */
.tm-action-btn{
  --tm-action-bg:var(--orange);
  --tm-action-hover:var(--orange-dark);
  --tm-action-active:#C94F00;
  --tm-action-shadow:rgba(255,102,0,.28);
  --tm-action-shadow-active:rgba(255,102,0,.22);
  background:var(--tm-action-bg)!important;border-color:var(--tm-action-bg)!important;color:#fff!important;
  box-shadow:0 2px 8px rgba(16,24,40,.16);
  transition:background .16s,border-color .16s,color .16s,box-shadow .16s,transform .16s!important;
}
.tm-action-btn-tim{
  --tm-action-bg:#7C3AED;
  --tm-action-hover:#6D28D9;
  --tm-action-active:#5B21B6;
  --tm-action-shadow:rgba(124,58,237,.28);
  --tm-action-shadow-active:rgba(124,58,237,.22);
}
.tm-action-btn:not(:disabled):hover{
  background:var(--tm-action-hover)!important;border-color:var(--tm-action-hover)!important;color:#fff!important;
  box-shadow:0 6px 16px var(--tm-action-shadow)!important;transform:translateY(-1px)!important;
}
.tm-action-btn:not(:disabled):active{
  background:var(--tm-action-active)!important;border-color:var(--tm-action-active)!important;
  box-shadow:0 3px 8px var(--tm-action-shadow-active)!important;transform:translateY(0)!important;
}
.tm-action-btn:not(:disabled):focus-visible{
  outline:2px solid var(--tm-action-bg)!important;outline-offset:2px;
}
.tm-action-btn:disabled{
  opacity:.48!important;cursor:not-allowed!important;box-shadow:none!important;
}
/* UI-02 Trang 3: KHÔNG nút nào của Thu tiền mặt dịch chuyển khi hover/active
   (thắng translateY !important cũ; scoped các selector riêng của Thu tiền mặt,
   gồm cả nút thao tác trong bảng và popup hoàn tác — không đụng .ui-action-btn global). */
.tm-btn:not(:disabled):hover,.tm-btn:not(:disabled):active,
.tm-action-btn:not(:disabled):hover,.tm-action-btn:not(:disabled):active,
.tm-chon-gon .btn-lo:not(:disabled):hover,.tm-chon-gon .btn-lo:not(:disabled):active,
.thanh-lo-tm .btn-lo:not(:disabled):hover,.thanh-lo-tm .btn-lo:not(:disabled):active,
.data-tm .ui-action-btn:not(:disabled):hover,.data-tm .ui-action-btn:not(:disabled):active,
#tm-hoantac .ui-action-btn:not(:disabled):hover,#tm-hoantac .ui-action-btn:not(:disabled):active{ transform:none !important; }

/* ========================================================================== 
   CHUẨN HÓA v103 — PRG Tiền mặt · Zalo dưới form · icon theo ZNS
   ========================================================================== */
/* Khóa đúng cùng một hộp 14x14 với icon "Tòa nhà" trong bộ lọc ZNS. */
.ph-loc-zns .ph-nhan .ic,.tm-ghi-form .tm-o-ico .ic{
  width:14px!important;height:14px!important;
  min-width:14px!important;max-width:14px!important;
  min-height:14px!important;max-height:14px!important;
  flex:0 0 14px!important;
}

/* Tin dán Zalo nằm liền dưới khối ghi nhận, trước danh sách lượt thu. */
.tm-zalo-box{margin-top:0;margin-bottom:16px;}
.tm-zalo-dau{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;}
.tm-zalo-noidung{
  display:block;width:100%;box-sizing:border-box;
  border:1px solid var(--line);border-radius:8px;padding:8px 10px;
  font-family:var(--font);font-size:13px;line-height:1.45;resize:vertical;
}

/* ==========================================================================
   UI-02 TRANG 4 — NGOÀI SINH HOẠT
   Chỉ đồng bộ giao diện trong vùng NSH; không thay đổi component trang khác.
   ========================================================================== */
/* KPI dùng đúng cấu trúc và cao độ chung của Trang 3, không còn chip phụ. */
#nsh-vung .tong-bar-nsh .kpi-txt{flex:1 1 auto;min-width:0;}
#nsh-vung .tong-bar-nsh .kpi-so{white-space:nowrap;}

/* Toolbar: control 36px; nút Bỏ lọc dùng cùng kích thước icon với toolbar chung. */
#nsh-vung .bang-toolbar{align-items:center;}
#nsh-vung .bang-toolbar .loc-trong-bang{
  flex:1 1 500px;min-width:0;flex-wrap:nowrap;align-items:center;
}
#nsh-vung .bang-toolbar .loc-trong-bang select{height:36px;min-width:0;}
#nsh-vung .bang-toolbar .loc-trong-bang select[name="toa"]{width:112px;}
#nsh-vung .bang-toolbar .loc-trong-bang select[name="tt"]{width:150px;}
#nsh-vung .bang-toolbar .loc-trong-bang select[name="sx"]{width:198px;}
#nsh-vung .bang-toolbar .btn-boloc{
  width:36px;min-width:36px;height:36px;padding:0;align-self:center;
}
#nsh-vung .bang-toolbar .btn-boloc svg{
  width:24px!important;height:24px!important;
}
#nsh-vung .bang-toolbar .bang-xuat{
  height:36px;background:var(--green);border-color:var(--green);color:#fff;
  transform:none;white-space:nowrap;
}
#nsh-vung .bang-toolbar .bang-xuat svg{color:#fff;}
#nsh-vung .bang-toolbar .bang-xuat:hover{
  background:#12813B;border-color:#12813B;color:#fff;transform:none;
}
#nsh-vung .bang-toolbar .bang-xuat:active{transform:none;}

/* Bảng 10 cột: tổng đúng 100%, hai cột dài ellipsis và mã quan trọng đọc đủ. */
#nsh-vung .data-nsh th:nth-child(1){width:4%;}
#nsh-vung .data-nsh th:nth-child(2){width:5%;}
#nsh-vung .data-nsh th:nth-child(3){width:17%;}
#nsh-vung .data-nsh th:nth-child(4){width:9%;}
#nsh-vung .data-nsh th:nth-child(5){width:8%;}
#nsh-vung .data-nsh th:nth-child(6){width:17%;}
#nsh-vung .data-nsh th:nth-child(7){width:10%;}
#nsh-vung .data-nsh th:nth-child(8){width:13%;}
#nsh-vung .data-nsh th:nth-child(9){width:9%;}
#nsh-vung .data-nsh th:nth-child(10){width:8%;}
#nsh-vung .data-nsh td.nsh-col-ten,
#nsh-vung .data-nsh td.nsh-col-nd{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;word-break:normal;
}
#nsh-vung .data-nsh .nsh-mst,
#nsh-vung .data-nsh .nsh-sohd{
  white-space:nowrap;overflow:visible;text-overflow:clip;font-variant-numeric:tabular-nums;
}
#nsh-vung .data-nsh .tien-so{text-align:right;white-space:nowrap;}
#nsh-vung .data-nsh .tt:not(.debt-status-token),
#nsh-vung .data-nsh .tt-select:not(.debt-status-token){
  width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box;
}
#nsh-vung .data-nsh .inp-ghichu{
  width:100%;height:30px;box-sizing:border-box;line-height:18px;
}

/* Hai nút thao tác NSH: icon-only 30x30, không co và không dịch chuyển. */
#nsh-vung .data-nsh .nsh-nut{
  width:30px;min-width:30px;height:30px;flex:0 0 30px;padding:0;
  transition:background .14s,color .14s,border-color .14s,box-shadow .14s;
}
#nsh-vung .data-nsh .nsh-nut svg{width:15px;height:15px;}
#nsh-vung .data-nsh .nsh-nut:hover,
#nsh-vung .data-nsh .nsh-nut:active{transform:none!important;}
#nsh-vung .data-nsh .nsh-nut:disabled{
  opacity:.48;cursor:not-allowed;box-shadow:none;
}

/* Drawer chi tiết: chỉ cuộn dọc, close 30x30 và nút hoàn tác dạng chữ cao 32px. */
#nsh-drawer{overflow-x:hidden;}
#nsh-drawer .drawer-body{min-width:0;overflow-x:hidden;}
#nsh-drawer .drawer-close{
  width:30px;min-width:30px;height:30px;padding:0;
  display:inline-flex;align-items:center;justify-content:center;transform:none;
}
#nsh-drawer .drawer-close:hover,
#nsh-drawer .drawer-close:active{transform:none;}
#nsh-drawer .drawer-close:focus-visible{outline:2px solid var(--navy);outline-offset:2px;}
#nsh-drawer .ct-row{align-items:flex-start;}
#nsh-drawer .ct-nhan{flex:0 0 38%;}
#nsh-drawer .ct-gt{min-width:0;overflow-wrap:anywhere;}
#nsh-drawer .ct-ls-top{gap:10px;align-items:flex-start;}
#nsh-drawer .ct-ls-top b{white-space:nowrap;}
#nsh-drawer .pa-btn-nsh{
  width:auto!important;min-width:0!important;height:32px;padding:0 10px;
  white-space:nowrap;transform:none;
}
#nsh-drawer .pa-btn-nsh:hover,
#nsh-drawer .pa-btn-nsh:active{transform:none!important;}
#nsh-drawer .pa-btn-nsh:focus-visible{outline:2px solid var(--red);outline-offset:2px;}

/* Modal hoàn tác/kết quả: giữa màn hình, chỉ cuộn dọc và nút footer cao 40px. */
#pa-modal-bg-nsh .nsh-pa-modal{
  width:520px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);
  overflow-x:hidden;overflow-y:auto;
}
#pa-modal-bg-nsh textarea{
  display:block;width:100%;max-width:100%;box-sizing:border-box;resize:vertical;
}
#pa-modal-bg-nsh .modal-actions,
#pa-kq-bg-nsh .modal-actions{flex-wrap:wrap;}
#pa-modal-bg-nsh .modal-actions .btn,
#pa-kq-bg-nsh .modal-actions .btn{
  width:auto!important;min-width:0!important;height:40px;padding:0 14px;
  white-space:nowrap;transform:none;
}
#pa-modal-bg-nsh .modal-actions .btn:hover,
#pa-modal-bg-nsh .modal-actions .btn:active,
#pa-kq-bg-nsh .modal-actions .btn:hover,
#pa-kq-bg-nsh .modal-actions .btn:active{transform:none!important;}
#pa-modal-bg-nsh #pa-nsh-ok{background:var(--red);border-color:var(--red);color:#fff;}
#pa-modal-bg-nsh #pa-nsh-ok:hover{background:#B91C1C;border-color:#B91C1C;}
#pa-modal-bg-nsh #pa-nsh-ok:focus-visible{outline:2px solid var(--red);outline-offset:2px;}
/* HOST-ACCEPTANCE REVIEW-FIX 01 §9 — nút Đóng popup "Hoàn tác thành công" NSH
   theo ĐÚNG quy ước success-modal hiện hành của ứng dụng (giống SH #pa-kq-dong):
   XANH success, cao 40px, không transform. BỎ navy-only cũ của NSH. */
#pa-kq-bg-nsh #pa-kq-dong-nsh{
  height:40px!important; min-height:40px!important; padding:0 18px!important;
  background:var(--green)!important; border:1px solid var(--green)!important; color:#fff!important;
  box-shadow:none!important; transform:none!important; font-weight:600!important;
}
#pa-kq-bg-nsh #pa-kq-dong-nsh:hover{ background:#12813B!important; border-color:#12813B!important; color:#fff!important; }
#pa-kq-bg-nsh #pa-kq-dong-nsh:active{ background:#0F6E33!important; border-color:#0F6E33!important; color:#fff!important; }
#pa-kq-bg-nsh #pa-kq-dong-nsh:focus-visible{ outline:2px solid var(--green)!important; outline-offset:2px!important; }

@media(max-width:1399px){
  #nsh-vung .bang-toolbar .loc-trong-bang{flex-basis:100%;order:3;}
  #nsh-vung .bang-toolbar .bang-xuat{margin-left:auto;}
}

/* ==========================================================================
   UI-03 PAGE 1 — THÔNG BÁO ZNS
   Chỉ đồng bộ trình bày trang ZNS; không thay đổi component hoặc trang khác.
   ========================================================================== */
.page-head-zns{margin:0;}
.page-head-zns .zns-page-title{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* KPI cùng nhịp với các trang UI-02 và không tăng chiều cao theo số lớn. */
#zns-vung .tong-bar-zns{margin-bottom:16px;}
#zns-vung .tong-bar-zns .kpi-txt{flex:1 1 auto;min-width:0;}
#zns-vung .tong-bar-zns .kpi-so{white-space:nowrap;}
#zns-vung .tong-bar-zns .zns-kpi-thieu{color:var(--red);font-weight:700;}

/* Bộ lọc ZNS: bốn control cao 36px, độ rộng đủ đọc và wrap có kiểm soát. */
#zns-vung .ph-loc-zns{
  margin-top:0;gap:12px 14px;align-items:center;
}
#zns-vung .ph-loc-zns .ph-box,
#zns-vung .ph-loc-zns .zns-ngay-wrap{height:36px;}
#zns-vung .ph-loc-zns .zns-filter-dot .ph-box{width:244px;}
#zns-vung .ph-loc-zns .zns-filter-toa .ph-box{width:176px;}
#zns-vung .ph-loc-zns .zns-filter-tt .ph-box{width:210px;}
#zns-vung .ph-loc-zns .zns-ngay-wrap input[type=text]{height:100%;}
#zns-vung .ph-loc-zns select:disabled,
#zns-vung .ph-loc-zns input:disabled{opacity:.55;cursor:not-allowed;}

/* Đầu bảng và nút Excel giữ một hàng khi đủ chỗ, không chồng lấn khi wrap. */
#zns-vung .bang-zns .bang-dau{align-items:center;}
#zns-vung .bang-zns .bang-tieu-de{flex:1 1 auto;min-width:0;}
#zns-vung .bang-zns .bang-chip-canhbao{max-width:100%;}
#zns-vung .bang-zns .btn-xuat{
  flex:0 0 auto;width:auto;min-width:0;height:36px;padding:0 12px;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  background:var(--green);border-color:var(--green);color:#fff;
  white-space:nowrap;transform:none;
}
#zns-vung .bang-zns .btn-xuat svg{color:#fff;}
#zns-vung .bang-zns .btn-xuat:hover{
  background:#12813B;border-color:#12813B;color:#fff;transform:none;
}
#zns-vung .bang-zns .btn-xuat:active{transform:none;}
#zns-vung .bang-zns .btn-xuat:focus-visible{
  outline:2px solid var(--green);outline-offset:2px;
}

/* Bảng 12 cột: tổng đúng 100%, mã/số/ngày đọc đủ, ba cột dài dùng ellipsis. */
#zns-vung .bang-zns .bang-scroll{overflow-x:visible;}
#zns-vung .data-zns{table-layout:fixed;width:100%;}
#zns-vung .data-zns th,
#zns-vung .data-zns td{padding-left:6px;padding-right:6px;}
#zns-vung .data-zns .col-stt{width:3.5%;}
#zns-vung .data-zns .cw-sdt{width:10%;}
#zns-vung .data-zns .z-ky{width:5.5%;}
#zns-vung .data-zns .z-ten{width:12%;}
#zns-vung .data-zns .cw-makh{width:8.5%;}
#zns-vung .data-zns .z-dc{width:13%!important;}
#zns-vung .data-zns .z-cs{width:6%!important;}
#zns-vung .data-zns .z-dtt{width:6%;}
#zns-vung .data-zns .z-ngay{width:9%;}
#zns-vung .data-zns .cw-tien{width:9.5%;}
#zns-vung .data-zns .z-ndck{width:11%!important;}
#zns-vung .data-zns .z-ten,
#zns-vung .data-zns .z-dc,
#zns-vung .data-zns .z-ndck{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#zns-vung .data-zns .cw-sdt,
#zns-vung .data-zns .cw-makh,
#zns-vung .data-zns .z-ky,
#zns-vung .data-zns .z-cs,
#zns-vung .data-zns .z-dtt,
#zns-vung .data-zns .z-ngay,
#zns-vung .data-zns .cw-tien{
  white-space:nowrap;overflow:visible;text-overflow:clip;
}
#zns-vung .data-zns .z-cs,
#zns-vung .data-zns .z-dtt,
#zns-vung .data-zns .cw-tien{text-align:right;}
#zns-vung .data-zns .z-ky,
#zns-vung .data-zns .z-ngay{text-align:center;}
#zns-vung .data-zns .zns-hang-thieu-sdt > td{background:#FFF4F4;}
#zns-vung .data-zns .zns-hang-thieu-sdt:hover > td{background:#FDECEC;}
#zns-vung .data-zns .zns-sdt-thieu{
  color:var(--red);font-size:12px;font-weight:700;
}
#zns-vung .data-zns .zns-table-empty{
  padding:30px;text-align:center;color:var(--text-muted);
}

/* Trạng thái rỗng và liên kết hướng dẫn, không dùng màu/khoảng cách inline. */
#zns-vung .zns-empty{
  max-width:760px;min-height:150px;margin:0 auto;padding:32px 24px;text-align:center;
}
#zns-vung .zns-empty-title{margin-bottom:8px;color:var(--navy);}
#zns-vung .zns-empty-copy{max-width:520px;margin:0 auto;line-height:1.55;}
#zns-vung .zns-empty-link{color:var(--orange-dark);font-weight:700;}
#zns-vung .zns-empty-link:focus-visible{
  outline:2px solid var(--orange);outline-offset:2px;border-radius:3px;
}

@media(max-width:1399px){
  #zns-vung .ph-loc-zns .zns-oNgay{margin-left:0;}
  #zns-vung .bang-zns .bang-dau{align-items:flex-start;}
}

/* ==========================================================================
   UI-03 PAGE2 — PHÁT HÀNH ĐỊNH KỲ
   Chỉ đồng bộ trình bày trong vùng Phát hành; nghiệp vụ và JavaScript giữ nguyên.
   ========================================================================== */
.page-head-phathanh{margin:0;}
.page-head-phathanh .ph-page-title{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

#ph-vung .tong-bar-ph{margin-bottom:16px;}
#ph-vung .tong-bar-ph .kpi-txt{flex:1 1 auto;min-width:0;}
#ph-vung .tong-bar-ph .kpi-so{white-space:nowrap;}

#ph-vung .ph-tabs{margin-top:0;}
#ph-vung .ph-tab{
  min-height:58px;transform:none;
  transition:border-color .15s,box-shadow .15s,background .15s,color .15s;
}
#ph-vung .ph-tab:hover,
#ph-vung .ph-tab:active{transform:none;}
#ph-vung .ph-tab:focus-visible{
  outline:2px solid var(--orange);outline-offset:2px;
}
#ph-vung .ph-tab[aria-pressed="true"],
#ph-vung .ph-tab[aria-pressed="true"]:hover,
#ph-vung .ph-tab[aria-pressed="true"]:active{
  border-color:var(--orange);background:var(--orange-tint);
  box-shadow:0 6px 16px -8px rgba(242,118,28,.5);
}
#ph-vung .ph-tab:disabled{opacity:.55;cursor:not-allowed;box-shadow:none;}
#ph-vung .ph-tab .ph-noi{display:flex;align-items:center;flex-wrap:wrap;}

#ph-vung .ph-loc{align-items:center;}
#ph-vung .ph-loc .ph-o{max-width:100%;}
#ph-vung .ph-loc .ph-box{height:40px;}
#ph-vung .ph-loc .ph-box--gio{width:232px;}
#ph-vung .ph-loc .ph-box--ngay{width:140px;}
#ph-vung .ph-loc input:disabled,
#ph-vung .ph-loc select:disabled{opacity:.55;cursor:not-allowed;}

/* UI Regression Fix 01: trạng thái tương tác của control ZNS/Phát hành.
   Chỉ đổi màu viền/quầng; không đổi kích thước, padding hoặc vị trí control. */
#zns-vung .ph-box:hover:not(.ph-loi):not(:has(:disabled)),
#ph-vung .ph-box:hover:not(.ph-loi):not(:has(:disabled)){
  border-color:#C4C8DA!important;box-shadow:none!important;
}
#zns-vung .ph-box:focus-within:not(.ph-loi):not(:has(:disabled)),
#ph-vung .ph-box:focus-within:not(.ph-loi):not(:has(:disabled)){
  border-color:var(--navy)!important;
  box-shadow:0 0 0 2px rgba(26,31,107,.16)!important;
}
#zns-vung .ph-box:has(:disabled),
#ph-vung .ph-box:has(:disabled){
  border-color:var(--line)!important;box-shadow:none!important;
}
#zns-vung .ph-box.ph-loi,
#zns-vung .ph-box.ph-loi:hover,
#zns-vung .ph-box.ph-loi:focus-within,
#ph-vung .ph-box.ph-loi,
#ph-vung .ph-box.ph-loi:hover,
#ph-vung .ph-box.ph-loi:focus-within{
  border-color:var(--red)!important;
  box-shadow:0 0 0 3px var(--red-tint)!important;
}

#ph-vung .bang-ph{margin-top:14px;}
#ph-vung .bang-ph .bang-dau{align-items:center;flex-wrap:wrap;}
#ph-vung .bang-ph .bang-dau h2{flex:1 1 420px;min-width:0;}
#ph-vung .ph-actions{
  display:flex;align-items:center;justify-content:flex-end;gap:10px;
  flex:0 1 auto;min-width:0;flex-wrap:wrap;
}
#ph-vung .ph-actions .btn-xuat{
  width:auto;min-width:0;height:36px;padding:0 12px;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  background:var(--green);border-color:var(--green);color:#fff;
  white-space:nowrap;transform:none;
}
#ph-vung .ph-actions .btn-xuat svg{color:#fff;}
#ph-vung .ph-actions .btn-xuat:hover{
  background:#12813B;border-color:#12813B;color:#fff;transform:none;
}
#ph-vung .ph-actions .btn-xuat:active{transform:none;}
#ph-vung .ph-actions .btn-xuat:focus-visible{
  outline:2px solid var(--green);outline-offset:2px;
}
#ph-vung .ph-actions .btn-xuat-word{
  background:var(--blue);border-color:var(--blue);color:#fff;
}
#ph-vung .ph-actions .btn-xuat-word:hover{
  background:#1D4FD8;border-color:#1D4FD8;color:#fff;
}
#ph-vung .ph-actions .btn-xuat-word:focus-visible{
  outline-color:var(--blue);
}

#ph-vung .bang-ph .bang-scroll{overflow-x:visible;}
#ph-vung .data-bk,
#ph-vung .data-ph{table-layout:fixed;width:100%;}
#ph-vung .data-bk th,
#ph-vung .data-ph th{white-space:normal;overflow:visible;text-overflow:clip;}
#ph-vung .data-bk th{
  height:44px!important;max-height:none!important;
  padding-top:8px!important;padding-bottom:8px!important;
  line-height:1.25!important;white-space:normal!important;
}
#ph-vung .data-bk td,
#ph-vung .data-ph td{white-space:nowrap;}
#ph-vung .data-bk .bk-makh,
#ph-vung .data-ph .cw-makh{overflow:visible;text-overflow:clip;white-space:nowrap;}
#ph-vung .data-bk .tien-so,
#ph-vung .data-ph .ph-tien{white-space:nowrap;text-align:right;}
#ph-vung .data-ph .ph-ten{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#ph-vung .data-ph .th-chon,
#ph-vung .data-ph .td-chon{text-align:center;}

#ph-vung .ph-empty{
  max-width:760px;min-height:150px;margin:14px auto 16px;
  padding:32px 24px;text-align:center;
}
#ph-vung .ph-empty-title{margin-bottom:8px;color:var(--navy);}
#ph-vung .ph-empty-copy{max-width:560px;margin:0 auto;line-height:1.55;}
#ph-vung .ph-empty-link{color:var(--orange-dark);font-weight:700;}
#ph-vung .ph-empty-link:focus-visible{
  outline:2px solid var(--orange);outline-offset:2px;border-radius:3px;
}

@media(max-width:1499px){
  #ph-vung .ph-tabs{grid-template-columns:repeat(3,minmax(0,1fr));}
  #ph-vung .bang-ph .bang-dau{align-items:flex-start;}
}

/* ==========================================================================
   CONTROL GROUP ROLLOUT 01 — PRODUCTION
   Hai mẫu opt-in dùng chung: thanh lọc gọn 36px và field ngang 40px.
   ========================================================================== */
.adp-control-toolbar{
  align-items:center;flex-wrap:wrap;gap:10px;
}
.adp-control-toolbar > h2{align-self:center;}
.adp-control-toolbar .adp-control-group--congno{
  flex:0 0 848px;min-width:848px;margin:0;padding:0;order:initial;
  display:flex;align-items:center;gap:8px;flex-wrap:nowrap;
  background:transparent;border:0;border-radius:0;box-shadow:none;
}
.adp-control-toolbar .adp-control-select{
  box-sizing:border-box;flex:0 0 auto;height:36px;
  padding:0 30px 0 12px!important;border:1px solid var(--line);border-radius:8px;
  background-color:var(--white);color:var(--text);
  font-family:var(--font);font-size:12.5px!important;font-weight:600!important;
  line-height:1!important;white-space:nowrap;cursor:pointer;transform:none;
  transition:border-color .15s,box-shadow .15s,background .15s,color .15s;
}
.adp-control-toolbar .adp-control-select--date-kind{width:170px;}
.adp-control-toolbar .adp-control-select--building{width:160px;}
.adp-control-toolbar .adp-control-select--status{width:200px;}
.adp-control-toolbar .adp-control-select--sort{width:250px;}
.adp-control-toolbar .adp-control-select:not(:disabled):hover{
  border-color:#C4C8DA;box-shadow:none;transform:none;
}
.adp-control-toolbar .adp-control-select:focus,
.adp-control-toolbar .adp-control-select:focus-visible{
  outline:0!important;border-color:var(--navy)!important;
  box-shadow:0 0 0 2px rgba(26,31,107,.16)!important;transform:none!important;
}
.adp-control-toolbar .adp-control-select:disabled{
  background-color:var(--bg-soft);border-color:var(--line);color:var(--text-mo);
  cursor:not-allowed;opacity:.72;box-shadow:none;transform:none;
}
.adp-control-toolbar .adp-control-reset{
  box-sizing:border-box;flex:0 0 36px;width:36px;min-width:36px;height:36px;
  padding:0;border-width:1px;border-radius:8px;background:var(--white);
  border-color:var(--line);color:var(--orange);transform:none;
  transition:background .15s,border-color .15s,color .15s,box-shadow .15s;
}
.adp-control-toolbar .adp-control-reset svg{
  width:22px!important;height:22px!important;color:var(--orange);
  transform:rotate(0);transform-origin:center;
  transition:transform .45s cubic-bezier(.34,1.2,.44,1),color .15s;
}
.adp-control-toolbar .adp-control-reset:hover{
  background:var(--orange-tint)!important;border-color:var(--orange)!important;
  color:var(--orange-dark)!important;
  box-shadow:0 4px 12px rgba(255,102,0,.18)!important;transform:none!important;
}
.adp-control-toolbar .adp-control-reset:hover svg{
  color:var(--orange-dark)!important;transform:rotate(-360deg)!important;
}
.adp-control-toolbar .adp-control-reset:active{
  background:#FFE5D4!important;border-color:var(--orange-dark)!important;
  box-shadow:0 2px 6px rgba(255,102,0,.16)!important;transform:none!important;
}
.adp-control-toolbar .adp-control-reset:focus-visible{
  outline:2px solid var(--orange);outline-offset:2px;
}
.adp-control-excel{
  box-sizing:border-box;flex:0 0 auto;width:auto;min-width:0;height:36px;margin-left:0;
  padding:0 12px;border-width:1px;border-radius:8px;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  background:var(--green);border-color:var(--green);color:#fff;
  font-size:12.5px;font-weight:600;line-height:1;white-space:nowrap;transform:none;
  transition:background .15s,border-color .15s,box-shadow .15s;
}
.adp-control-excel svg{
  width:16px;height:16px;color:#fff;flex:0 0 auto;
}
.adp-control-excel:hover{
  background:#12813B!important;border-color:#12813B!important;color:#fff!important;
  box-shadow:0 4px 12px rgba(18,129,59,.20)!important;transform:none!important;
}
.adp-control-excel:active{
  background:#0F6E33!important;border-color:#0F6E33!important;
  box-shadow:0 2px 6px rgba(18,129,59,.18)!important;transform:none!important;
}
.adp-control-excel:focus-visible{
  outline:2px solid var(--green);outline-offset:2px;
}
@media(max-width:1450px){
  .adp-control-toolbar:not(.adp-control-toolbar--wide) > h2{flex:1 1 100%;}
  .adp-control-toolbar .bang-ngan{display:none;}
  .adp-control-toolbar .adp-control-group--congno{flex:0 0 848px;min-width:848px;order:initial;}
  .adp-control-toolbar .adp-control-excel{margin-left:0;order:initial;}
}

/* Production control system: opt-in only. */
.adp-control-toolbar .adp-control-group{
  margin:0;padding:0;display:flex;align-items:center;gap:8px;flex-wrap:nowrap;
  background:transparent;border:0;border-radius:0;box-shadow:none;
}
.adp-control-toolbar .adp-control-group--standard{flex:0 0 670px;min-width:670px;}
.adp-control-toolbar .adp-control-group--cash-list{flex:0 0 610px;min-width:610px;}
.adp-control-toolbar .adp-control-group--history{
  flex:1 1 100%;min-width:0;gap:10px;align-items:center;
}
.adp-control-subgroup,
.adp-control-actions{
  display:inline-flex;align-items:center;gap:8px;min-width:0;flex-wrap:nowrap;
}
.adp-control-toolbar .adp-control-input{
  box-sizing:border-box;flex:0 0 auto;height:36px!important;
  padding:0 12px!important;border:1px solid var(--line)!important;border-radius:8px;
  background:var(--white);color:var(--text);font-family:var(--font);
  font-size:12.5px!important;font-weight:600!important;line-height:1!important;
  white-space:nowrap;transform:none!important;
  transition:border-color .15s,box-shadow .15s,background .15s,color .15s;
}
.adp-control-toolbar .adp-control-input--date{width:160px!important;}
.adp-control-toolbar .adp-control-input--customer{width:160px;}
.adp-control-toolbar .adp-control-select--feature{width:170px;}
.adp-control-toolbar .adp-control-select--operation{width:180px;}
.adp-control-toolbar .adp-control-select--staff{width:180px;}
.adp-control-toolbar .adp-control-input:not(:disabled):hover{
  border-color:#C4C8DA!important;box-shadow:none!important;
}
.adp-control-toolbar .adp-control-input:focus,
.adp-control-toolbar .adp-control-input:focus-visible{
  outline:0!important;border-color:var(--navy)!important;
  box-shadow:0 0 0 2px rgba(26,31,107,.16)!important;transform:none!important;
}
.adp-control-toolbar .adp-control-input:disabled{
  background:var(--bg-soft);border-color:var(--line)!important;color:var(--text-mo);
  cursor:not-allowed;opacity:.72;box-shadow:none!important;
}
.adp-control-toolbar .adp-control-select[aria-invalid="true"],
.adp-control-toolbar .adp-control-input[aria-invalid="true"],
.adp-control-toolbar .adp-control-error,
.adp-control-toolbar .adp-control-error:hover,
.adp-control-toolbar .adp-control-error:focus{
  border-color:var(--red)!important;
  box-shadow:0 0 0 2px rgba(220,38,38,.16)!important;
}
.adp-control-toolbar .adp-control-submit{
  box-sizing:border-box;flex:0 0 36px;width:36px;min-width:36px;height:36px;
  padding:0;border-width:1px;border-radius:8px;transform:none!important;
}
.adp-control-toolbar .adp-control-submit:active{transform:none!important;}
.adp-control-toolbar .adp-control-submit:focus-visible{
  outline:2px solid var(--navy);outline-offset:2px;
}

.adp-control-word{
  box-sizing:border-box;width:auto;min-width:0;height:36px!important;padding:0 12px;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  background:var(--blue)!important;border-color:var(--blue)!important;color:#fff!important;
  white-space:nowrap;transform:none!important;
}
.adp-control-word svg{width:16px;height:16px;color:#fff;flex:0 0 auto;}
.adp-control-word:hover{background:#1D4FD8!important;border-color:#1D4FD8!important;}
.adp-control-word:active{transform:none!important;}
.adp-control-word:focus-visible{outline:2px solid var(--blue);outline-offset:2px;}

/* Type B: icon, label and 40px control stay on one horizontal axis. */
.adp-field-group{align-items:center;}
.adp-field-row{align-items:center;min-width:0;}
.adp-field-label{
  display:inline-flex!important;align-items:center!important;gap:5px!important;
  margin:0!important;color:var(--navy)!important;font-size:12px!important;
  font-weight:600!important;line-height:1!important;white-space:nowrap!important;
  flex:0 0 auto;
}
.adp-field-label svg,
.adp-field-icon svg{
  width:14px!important;height:14px!important;min-width:14px!important;
  color:var(--orange)!important;flex:0 0 auto;
}
.adp-field-box{height:40px!important;box-sizing:border-box;}
.adp-field-box:not(.tm-inp-wrap):not(.ph-loi):hover:not(:has(:disabled)){
  border-color:#C4C8DA!important;box-shadow:none!important;
}
.adp-field-box:not(.tm-inp-wrap):not(.ph-loi):focus-within:not(:has(:disabled)){
  border-color:var(--navy)!important;
  box-shadow:0 0 0 2px rgba(26,31,107,.16)!important;
}
.adp-field-box:not(.tm-inp-wrap):has(:disabled){
  background:var(--bg-soft);border-color:var(--line)!important;
  color:var(--text-mo);box-shadow:none!important;
}
.adp-field-box.ph-loi,
.adp-field-box.ph-loi:hover,
.adp-field-box.ph-loi:focus-within{
  border-color:var(--red)!important;box-shadow:0 0 0 3px var(--red-tint)!important;
}
.adp-field-row .tm-inp{height:40px!important;transform:none!important;}
.adp-field-row .tm-inp:not(:disabled):hover{border-color:#C4C8DA!important;}
.adp-field-row .tm-inp:focus,
.adp-field-row .tm-inp:focus-visible{
  outline:0!important;border-color:var(--navy)!important;
  box-shadow:0 0 0 2px rgba(26,31,107,.16)!important;transform:none!important;
}
.adp-field-row .tm-inp:disabled{
  background:var(--bg-soft);color:var(--text-mo);box-shadow:none!important;
}
.adp-field-row .tm-inp[aria-invalid="true"],
.adp-field-input[aria-invalid="true"]{
  border-color:var(--red)!important;
  box-shadow:0 0 0 2px rgba(220,38,38,.16)!important;
}
.adp-field-input{
  box-sizing:border-box;height:40px!important;border:1px solid var(--line)!important;
  border-radius:8px;background:var(--white);transform:none!important;
}
.adp-field-input:hover:not(:disabled){border-color:#C4C8DA!important;}
.adp-field-input:focus,
.adp-field-input:focus-visible{
  outline:0!important;border-color:var(--navy)!important;
  box-shadow:0 0 0 2px rgba(26,31,107,.16)!important;
}

.adp-action-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.adp-action-row--batch{flex:0 0 auto;}
.adp-action-button{transform:none!important;white-space:nowrap;}
.adp-action-button:active{transform:none!important;}
.adp-action-button:focus-visible{outline:2px solid var(--navy);outline-offset:2px;}
.adp-upload-drop{transform:none;transition:border-color .15s,box-shadow .15s,background .15s;}
.adp-upload-drop:hover{border-color:#C4C8DA!important;}
.adp-upload-drop:focus,
.adp-upload-drop:focus-visible,
.adp-upload-drop:focus-within{
  outline:0!important;border-color:var(--navy)!important;
  box-shadow:0 0 0 2px rgba(26,31,107,.16)!important;
}

@media(min-width:1451px){
  .adp-control-group--history{flex-wrap:nowrap!important;}
}
@media(max-width:1450px){
  .adp-control-toolbar .adp-control-group--standard{flex:0 0 670px;min-width:670px;}
  .adp-control-toolbar .adp-control-group--cash-list{flex:0 0 610px;min-width:610px;}
  .adp-control-group--history{flex-wrap:wrap!important;}
  .adp-control-group--history .adp-control-subgroup--primary{flex:0 0 auto;}
  .adp-control-group--history .adp-control-subgroup--secondary{flex:0 0 auto;}
  .adp-control-toolbar > .adp-control-group{order:0!important;}
  .adp-control-toolbar > .adp-control-excel{order:1!important;margin-left:0;}
}

/* ========================================================================== 
   UI-03 PAGE 3 — DANH BẠ SỐ ĐIỆN THOẠI (scoped production review)
   ========================================================================== */
.alert-danhba{margin:0 0 12px;padding:12px 14px;line-height:1.45;}
.alert-danhba--error{border-color:var(--red);background:var(--red-tint);color:var(--red);}
.alert-danhba--success{border-color:var(--green);background:var(--green-tint);color:var(--green);}

.page-danhba{min-width:0;}
.page-danhba .tong-bar-danhba{margin-bottom:14px;}
.page-danhba .kpi-danhba{min-height:94px;padding:15px 18px;align-items:center;}
.page-danhba .kpi-danhba .kpi-ic{flex:0 0 44px;align-self:center;}
.page-danhba .kpi-danhba .kpi-txt{min-width:0;}
.page-danhba .kpi-danhba .kpi-so{font-variant-numeric:tabular-nums;white-space:nowrap;}
.page-danhba .kpi-danhba .kpi-nhan,
.page-danhba .kpi-danhba .kpi-don{overflow:visible;text-overflow:clip;white-space:nowrap;}

.db-preview-actions .ui-action-btn,
.db-entry-modal .ui-action-btn,
.db-xoa-ma-modal .ui-action-btn,
.db-import-choice-modal .ui-action-btn{
  box-sizing:border-box;height:40px;padding:0 14px;align-items:center;white-space:nowrap;
  transform:none!important;
}
.db-preview-actions .ui-action-btn:hover,
.db-preview-actions .ui-action-btn:active,
.db-entry-modal .ui-action-btn:hover,
.db-entry-modal .ui-action-btn:active,
.db-xoa-ma-modal .ui-action-btn:hover,
.db-xoa-ma-modal .ui-action-btn:active,
.db-import-choice-modal .ui-action-btn:hover,
.db-import-choice-modal .ui-action-btn:active{transform:none!important;}
.db-preview-actions .ui-action-btn:focus-visible,
.db-entry-modal .ui-action-btn:focus-visible,
.db-xoa-ma-modal .ui-action-btn:focus-visible,
.db-import-choice-modal .ui-action-btn:focus-visible{
  outline:2px solid var(--navy);outline-offset:2px;
}
.tb-nhap-danhba{border:0;cursor:pointer;transform:none!important;}
.tb-nhap-danhba:hover,
.tb-nhap-danhba:active{transform:none!important;}
.tb-nhap-danhba:focus-visible{outline:2px solid var(--navy);outline-offset:2px;}

.db-import-choice-bg{box-sizing:border-box;padding:16px;}
.db-import-choice-modal{
  box-sizing:border-box;width:520px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);
  overflow-x:hidden;overflow-y:auto;transform:none!important;
}
.db-import-choice-bg.mo .db-import-choice-modal{transform:none!important;}
.db-import-choice-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;}
.db-import-choice-heading{display:flex;align-items:flex-start;gap:12px;min-width:0;}
.db-import-choice-icon{
  width:42px;height:42px;flex:0 0 42px;border-radius:12px;
  display:inline-flex;align-items:center;justify-content:center;
  color:var(--orange);background:var(--orange-tint);
}
.db-import-choice-icon .ic{width:22px;height:22px;}
.db-import-choice-heading h3{margin:1px 0 4px;color:var(--navy);font-size:18px;line-height:1.3;}
.db-import-choice-heading p{margin:0;color:var(--text-muted);font-size:12.5px;line-height:1.45;}
.db-import-choice-close{
  box-sizing:border-box;width:32px;height:32px;flex:0 0 32px;padding:0;border:1px solid var(--line);
  border-radius:9px;background:var(--white);color:var(--text-muted);cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;transform:none;
}
.db-import-choice-close:hover{border-color:var(--orange);color:var(--orange);background:var(--orange-tint);}
.db-import-choice-close:active{transform:none;}
.db-import-choice-close:focus-visible{outline:2px solid var(--navy);outline-offset:2px;}
.db-import-choice-options{display:grid;gap:10px;margin-top:18px;}
.db-import-choice-option{
  position:relative;box-sizing:border-box;width:100%;min-height:72px;margin:0;padding:13px 14px;
  border:1px solid var(--line);border-radius:12px;background:var(--white);color:var(--text);
  display:flex;align-items:center;gap:12px;text-align:left;cursor:pointer;transform:none;
}
.db-import-choice-option:hover{border-color:var(--orange);background:var(--orange-tint);transform:none;}
.db-import-choice-option:active{transform:none;}
.db-import-choice-option:focus-visible,
.db-import-choice-file:focus-within{outline:2px solid var(--navy);outline-offset:2px;}
.db-import-choice-option-icon{
  width:38px;height:38px;flex:0 0 38px;border-radius:10px;
  display:inline-flex;align-items:center;justify-content:center;color:var(--navy);background:var(--blue-tint);
}
.db-import-choice-option-icon .ic{width:20px;height:20px;}
.db-import-choice-option > span:last-of-type{display:grid;gap:3px;min-width:0;}
.db-import-choice-option b{font-size:13.5px;line-height:1.35;}
.db-import-choice-option small{color:var(--text-muted);font-size:11.5px;line-height:1.4;}
.db-import-choice-form{min-width:0;margin:0;}
.db-import-choice-file{overflow:hidden;}
.db-import-choice-input{
  position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;
}
.db-import-choice-help{display:block;margin:7px 4px 0;font-size:11.5px;line-height:1.4;}
.db-import-choice-actions{
  display:flex;justify-content:flex-end;margin-top:17px;padding-top:14px;border-top:1px solid var(--line);
}
.page-danhba .db-business-note{font-size:12px;line-height:1.45;margin:0 2px;}
.page-danhba .db-table-card{margin-top:8px;min-width:0;}

.page-danhba .data-danhba{table-layout:fixed;width:100%;min-width:0;}
.page-danhba .data-danhba th,
.page-danhba .data-danhba td{box-sizing:border-box;min-width:0;}
.page-danhba .data-danhba th:nth-child(1){width:4%;}
.page-danhba .data-danhba th:nth-child(2){width:6%;}
.page-danhba .data-danhba th:nth-child(3){width:11%;}
.page-danhba .data-danhba th:nth-child(4){width:20%;}
.page-danhba .data-danhba th:nth-child(5){width:26%;}
.page-danhba .data-danhba th:nth-child(6){width:21%;}
.page-danhba .data-danhba th:nth-child(7){width:12%;}
.page-danhba .data-danhba--readonly th:nth-child(1){width:5%;}
.page-danhba .data-danhba--readonly th:nth-child(2){width:8%;}
.page-danhba .data-danhba--readonly th:nth-child(3){width:13%;}
.page-danhba .data-danhba--readonly th:nth-child(4){width:26%;}
.page-danhba .data-danhba--readonly th:nth-child(5){width:30%;}
.page-danhba .data-danhba--readonly th:nth-child(6){width:18%;}
.page-danhba .data-danhba tbody td{vertical-align:top;}
.page-danhba .data-danhba tbody td:nth-child(1),
.page-danhba .data-danhba tbody td:nth-child(2){padding-top:14px;}
.page-danhba .data-danhba tbody td:nth-child(2) .badge-loai{
  display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;vertical-align:middle;
}
.page-danhba .data-danhba .db-ten{
  display:table-cell;min-width:0;max-width:none;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;
}
.page-danhba .data-danhba .db-sdt{min-width:0;overflow:visible;}
.page-danhba .data-danhba .db-so-dong{
  display:flex;align-items:center;gap:6px;min-width:0;padding:3px 0;
}
.page-danhba .data-danhba .db-so-hienthi{
  flex:1 1 auto;min-width:0;white-space:nowrap;font-variant-numeric:tabular-nums;
}
.page-danhba .data-danhba .db-so-nut{
  display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;margin-left:0;
}
.page-danhba .data-danhba .badge-phu{display:inline-flex;vertical-align:middle;white-space:nowrap;}
.page-danhba .data-danhba .col-ghichu{max-width:none;overflow:hidden;}
.page-danhba .data-danhba .inp-ghichu-db{
  box-sizing:border-box;width:100%;min-width:0;height:32px;padding:0 9px;
  border:1px solid var(--line);border-radius:8px;background:var(--white);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transform:none;
}
.page-danhba .data-danhba .inp-ghichu-db:hover{border-color:#C4C8DA;}
.page-danhba .data-danhba .inp-ghichu-db:focus,
.page-danhba .data-danhba .inp-ghichu-db:focus-visible{
  outline:0;border-color:var(--navy);box-shadow:0 0 0 2px rgba(26,31,107,.16);
}
.page-danhba .data-danhba .inp-ghichu-db:disabled,
.page-danhba .data-danhba .inp-ghichu-db[readonly]{
  background:var(--bg-soft);color:var(--text-mo);cursor:not-allowed;box-shadow:none;
}
.page-danhba .data-danhba .ghichu-xem{
  display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.page-danhba .data-danhba .db-nut,
.page-danhba .data-danhba .db-thaotac{width:auto;padding-right:10px;text-align:center;}
.page-danhba .data-danhba .db-nut-wrap{display:inline-flex;align-items:center;justify-content:center;gap:5px;}
.page-danhba .data-danhba .db-nut-i{
  box-sizing:border-box;width:30px;height:30px;min-width:30px;padding:0;
  display:inline-flex;align-items:center;justify-content:center;transform:none!important;
}
.page-danhba .data-danhba .db-nut-i svg{width:15px;height:15px;}
.page-danhba .data-danhba .db-nut-i:hover,
.page-danhba .data-danhba .db-nut-i:active{transform:none!important;}
.page-danhba .data-danhba .db-nut-i:focus-visible{
  outline:2px solid var(--navy);outline-offset:2px;
}
.page-danhba .data-danhba .db-nut-xoa:focus-visible,
.page-danhba .data-danhba .ui-action-danger:focus-visible{outline-color:var(--red);}
.page-danhba .db-empty-state{
  height:126px;padding:34px 18px!important;text-align:center;color:var(--text-muted);
  line-height:1.55;vertical-align:middle!important;
}

.page-danhba .phantrang-danhba{gap:10px 16px;flex-wrap:wrap;}
.page-danhba .phantrang-danhba .pt-trai,
.page-danhba .phantrang-danhba .pt-phai{min-width:0;flex-wrap:wrap;}
.page-danhba .phantrang-danhba select{height:32px;min-width:66px;}
.page-danhba .phantrang-danhba .pt-nut{width:32px;height:32px;transform:none;}
.page-danhba .phantrang-danhba .pt-nut:hover,
.page-danhba .phantrang-danhba .pt-nut:active{transform:none;}
.page-danhba .phantrang-danhba select:focus-visible,
.page-danhba .phantrang-danhba .pt-nut:focus-visible{
  outline:2px solid var(--navy);outline-offset:2px;
}

.db-preview-card{border-color:var(--tim);padding:0;overflow:hidden;}
.db-preview-head{padding:14px 16px 10px;color:var(--tim);font-size:15px;}
.db-preview-stats{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:0 16px 10px;}
.db-preview-chip{
  display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border-radius:999px;
  background:var(--bg-soft);color:var(--text-muted);font-size:11.5px;white-space:nowrap;
}
.db-preview-chip--new{background:var(--green-tint);color:var(--green);}
.db-preview-chip--warning{background:#FFF0E6;color:var(--orange-dark);font-weight:700;}
.db-preview-chip--navy{background:var(--navy-tint);color:var(--navy);}
.db-preview-help{font-size:12.5px;line-height:1.45;margin:0;padding:0 16px 12px;}
.db-preview-warning-text{color:var(--orange-dark);}
.db-preview-scroll{height:auto;min-height:0;overflow:visible;border-radius:0;border-left:0;border-right:0;box-shadow:none;}
.db-preview-scroll .bang-scroll{overflow:visible;}
/* Trên desktop giữ nguyên contract bảng chung: không tạo scroll container quanh
   sticky thead. Chỉ màn hẹp mới cuộn ngang; tại đó header preview để static để
   không bám sai vào container ngang và tạo dải trống/offset. */
@media (max-width:1000px){
  .db-preview-scroll .bang-scroll{overflow-x:auto;overflow-y:visible;}
  .db-preview-scroll .data-db-preview thead th{position:static;}
}
.db-preview-card .data-db-preview{table-layout:fixed;width:100%;min-width:720px;}
.db-preview-card .data-db-preview th:nth-child(1){width:5%;}
.db-preview-card .data-db-preview th:nth-child(2){width:19%;}
.db-preview-card .data-db-preview th:nth-child(3){width:22%;}
.db-preview-card .data-db-preview th:nth-child(4){width:27%;}
.db-preview-card .data-db-preview th:nth-child(5){width:27%;}
.db-preview-card .db-preview-check{text-align:center;}
.db-preview-card .db-preview-row--warning{background:#FFF6E5;}
.db-preview-card .data-db-preview tr.dong-chon{background:var(--teal-tint,#E6F7F2)!important;}
.db-preview-card .db-preview-status{font-size:12px;font-weight:600;}
.db-preview-card .db-tabular{font-variant-numeric:tabular-nums;}
.db-preview-card .db-preview-empty-number{font-style:italic;}
.db-preview-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin:0;padding:12px 16px;}

.db-entry-modal{
  box-sizing:border-box;width:460px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);
  overflow-x:hidden;overflow-y:auto;
}
.db-modal-title{margin:0 0 16px;color:var(--navy);font-size:18px;line-height:1.3;}
.db-modal-fields{display:flex;flex-direction:column;gap:12px;}
.db-modal-field{display:flex;flex-direction:column;gap:6px;color:var(--navy);font-size:12.5px;font-weight:600;}
.db-modal-field input,
.db-xoa-ma-modal input,
.db-xoa-ma-modal textarea{
  box-sizing:border-box;width:100%;min-width:0;border:1px solid var(--line);border-radius:8px;
  background:var(--white);color:var(--text);font:inherit;font-weight:400;
}
.db-modal-field input,
.db-xoa-ma-modal input{height:40px;padding:0 11px;}
.db-modal-field input:focus,
.db-modal-field input:focus-visible,
.db-xoa-ma-modal input:focus,
.db-xoa-ma-modal input:focus-visible,
.db-xoa-ma-modal textarea:focus,
.db-xoa-ma-modal textarea:focus-visible{
  outline:0;border-color:var(--navy);box-shadow:0 0 0 2px rgba(26,31,107,.16);
}
.db-modal-field input:disabled{background:var(--bg-soft);color:var(--text-mo);cursor:not-allowed;}
.db-modal-help{font-size:11.5px;font-weight:400;line-height:1.4;}
.db-modal-actions{gap:9px;flex-wrap:wrap;}
.db-xoa-ma-modal{
  box-sizing:border-box;width:520px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);
  overflow-x:hidden;overflow-y:auto;
}
.db-xoa-ma-modal .modal-sub{line-height:1.5;margin:0 0 14px;}
.db-xoa-ma-modal label{display:block;margin:10px 0 6px;color:var(--navy);font-size:12.5px;font-weight:600;}
.db-xoa-ma-modal .db-xoa-ma-code{border:1px solid rgba(220,38,38,.18);font-variant-numeric:tabular-nums;}
.db-xoa-ma-modal .modal-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;}

#db-ls-drawer.db-ls-drawer{width:460px;max-width:calc(100vw - 24px);overflow-x:hidden;}
#db-ls-drawer .drawer-head{position:relative;z-index:1;padding:16px 18px;}
#db-ls-drawer .drawer-close{
  box-sizing:border-box;width:32px;height:32px;min-width:32px;padding:0;
  display:inline-flex;align-items:center;justify-content:center;transform:none;
}
#db-ls-drawer .drawer-close:hover,
#db-ls-drawer .drawer-close:active{transform:none;}
#db-ls-drawer .drawer-close:focus-visible{outline:2px solid var(--navy);outline-offset:2px;}
#db-ls-drawer .drawer-body{min-width:0;padding:16px 18px;overflow-x:hidden;overflow-y:auto;}
#db-ls-drawer .ct-ls-item{padding:12px;border-radius:10px;overflow-wrap:anywhere;}
#db-ls-drawer .ct-ls-top{align-items:flex-start;gap:10px;}
#db-ls-drawer .ct-ls-top b{flex:0 0 auto;color:var(--navy);white-space:nowrap;}
#db-ls-drawer .ct-ls-top span{min-width:0;text-align:right;overflow-wrap:anywhere;}
#db-ls-drawer .ct-ls-sub{line-height:1.45;overflow-wrap:anywhere;}

/* ========================================================================== 
   UI-03 PAGE 4B — TRA CỨU LỊCH SỬ (scoped production review)
   ========================================================================== */
.tb-tim.tb-tim--history{width:360px;max-width:32vw;}

.page-tracuu{min-width:0;overflow-x:clip;}
.page-tracuu .tong-bar{margin-bottom:14px;}
.page-tracuu .kpi{min-width:0;min-height:92px;padding:15px 18px;align-items:center;}
.page-tracuu .kpi-txt{min-width:0;}
.page-tracuu .kpi-so{font-variant-numeric:tabular-nums;white-space:nowrap;}
.page-tracuu .kpi-nhan,
.page-tracuu .kpi-don{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

.page-tracuu .bang-khung{min-width:0;overflow:visible;}
.page-tracuu .adp-control-toolbar{gap:10px;padding:13px 16px;}
.page-tracuu .adp-control-toolbar > h2{min-width:0;margin:0;line-height:1.3;}
.page-tracuu .adp-control-toolbar .bang-ngan{display:none;}
.page-tracuu .adp-control-group--history{width:100%;}
.page-tracuu .adp-control-toolbar input.adp-control-input{
  flex:0 0 auto;min-width:0;
}
.page-tracuu .adp-control-subgroup,
.page-tracuu .adp-control-actions{max-width:100%;}
.page-tracuu .adp-control-actions{margin-left:0;}
.page-tracuu .adp-control-reset,
.page-tracuu .adp-control-excel{position:relative;}
.page-tracuu .adp-control-excel{
  background:var(--green)!important;border-color:var(--green)!important;color:#fff!important;
}
.page-tracuu .adp-control-excel svg{color:#fff!important;}
.page-tracuu .adp-control-excel:hover{
  background:#12813B!important;border-color:#12813B!important;color:#fff!important;
}
.page-tracuu .adp-control-excel:hover svg{color:#fff!important;}
.page-tracuu .adp-control-excel:active{
  background:#0F6E33!important;border-color:#0F6E33!important;color:#fff!important;
  transform:none!important;
}
.page-tracuu .adp-control-excel:active svg{color:#fff!important;}
.page-tracuu .adp-control-reset:focus-visible,
.page-tracuu .phantrang select:focus-visible,
.page-tracuu .pt-nut:focus-visible{
  outline:2px solid var(--orange);outline-offset:2px;
}
.page-tracuu .adp-control-excel:focus-visible{
  outline:2px solid var(--green);outline-offset:2px;
}

.page-tracuu .bang-scroll{width:100%;max-width:100%;min-width:0;}
.page-tracuu .data-tracuu{table-layout:fixed;width:100%;}
.page-tracuu .data-tracuu th,
.page-tracuu .data-tracuu td{box-sizing:border-box;padding:9px 8px;line-height:1.4;}
.page-tracuu .data-tracuu th{
  overflow:visible;text-overflow:clip;white-space:normal;vertical-align:middle;
}
.page-tracuu .data-tracuu th.th-sap a{
  width:100%;min-width:0;align-items:center;white-space:normal;line-height:1.25;
}
.page-tracuu .data-tracuu th.th-sap .mui{flex:0 0 auto;}
.page-tracuu .data-tracuu td{vertical-align:top;}
.page-tracuu .data-tracuu .tc-time,
.page-tracuu .data-tracuu .tc-money{white-space:nowrap;}
.page-tracuu .data-tracuu .tc-money{
  text-align:right;font-variant-numeric:tabular-nums;font-weight:600;
}
.page-tracuu .data-tracuu .tc-person,
.page-tracuu .data-tracuu .tc-operation,
.page-tracuu .data-tracuu .col-makh-full{
  min-width:0;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
}
.page-tracuu .data-tracuu .tc-role{font-size:11px;}
.page-tracuu .data-tracuu .tc-feature{min-width:0;overflow:hidden;}
.page-tracuu .data-tracuu .nhan-cn{
  display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.page-tracuu .data-tracuu .tc-chitiet{
  min-width:0;max-width:none;white-space:normal;overflow-wrap:anywhere;word-break:break-word;
}
.page-tracuu .data-tracuu .tc-chitiet > div:first-child{font-weight:500;color:var(--text);}
.page-tracuu .data-tracuu .tc-cm{display:block;margin-top:4px;white-space:normal;overflow-wrap:anywhere;}
.page-tracuu .data-tracuu .tc-empty{
  height:92px;padding:30px 16px;text-align:center;white-space:normal;vertical-align:middle;
}
.page-tracuu .phantrang{min-width:0;}
.page-tracuu .pt-trai,
.page-tracuu .pt-phai{min-width:0;flex-wrap:wrap;}

@media(max-width:1450px){
  .tb-tim.tb-tim--history{width:320px;max-width:30vw;}
  .page-tracuu .adp-control-group--history{row-gap:9px;}
  .page-tracuu .adp-control-group--history .adp-control-subgroup--primary,
  .page-tracuu .adp-control-group--history .adp-control-subgroup--secondary{
    flex:1 1 100%;width:100%;
  }
}

@media(min-width:1800px){
  .page-tracuu .adp-control-toolbar--wide > h2{flex:0 0 auto;}
  .page-tracuu .adp-control-group--history{flex:1 1 auto;width:auto;}
}

@media(max-width:1100px){
  .page-tracuu .tong-bar-3{grid-template-columns:repeat(3,minmax(0,1fr));}
  .page-tracuu .kpi{padding:13px 12px;}
  .page-tracuu .data-tracuu th,
  .page-tracuu .data-tracuu td{padding-left:6px;padding-right:6px;}
}

@media(max-width:760px){
  .page-tracuu .tong-bar-3{grid-template-columns:1fr;}
  .page-tracuu .adp-control-subgroup{flex-wrap:wrap;}
  .page-tracuu .adp-control-toolbar .adp-control-input,
  .page-tracuu .adp-control-toolbar .adp-control-select{max-width:100%;}
  .page-tracuu .phantrang{align-items:flex-start;}
}

@media(max-width:1450px){
  .page-danhba .data-danhba th:nth-child(1){width:4%;}
  .page-danhba .data-danhba th:nth-child(2){width:6%;}
  .page-danhba .data-danhba th:nth-child(3){width:11%;}
  .page-danhba .data-danhba th:nth-child(4){width:19%;}
  .page-danhba .data-danhba th:nth-child(5){width:27%;}
  .page-danhba .data-danhba th:nth-child(6){width:21%;}
  .page-danhba .data-danhba th:nth-child(7){width:12%;}
}

/* ========================================================================== 
   UI-04 — GLOBAL DESKTOP CONSISTENCY CONSOLIDATION 01
   Token chung cho desktop; không thay đổi nghiệp vụ hoặc cấu trúc dữ liệu.
   ========================================================================== */

/* Search topbar: mọi trang dùng cùng một kích thước tại cùng viewport. */
.tb-tim,
.tb-tim.tb-tim--history{
  width:clamp(280px,22vw,360px);max-width:360px;min-width:260px;
  flex:0 1 auto;
}

/* KPI: icon 26px trong vòng tròn 48px, chỉ tăng nhẹ chiều cao card. */
.tong-bar .kpi-ic,
.page-danhba .kpi-danhba .kpi-ic{
  width:48px;height:48px;flex:0 0 48px;
}
.tong-bar .kpi-ic .ic,
.tong-bar .kpi-ic svg{
  width:var(--icon-kpi)!important;height:var(--icon-kpi)!important;
}
.tong-bar-tm .kpi:first-child .kpi-ic{
  background:var(--blue-tint);color:var(--blue);box-shadow:0 0 0 4px rgba(37,99,235,.07);
}
.tong-bar-tm .kpi:first-child .kpi-so{color:var(--blue);}

/* Label icon chung 16px; icon text-action/file 18px. */
.adp-field-label svg,
.adp-field-icon svg,
.tm-ghi-form .tm-o-ico .ic,
.ph-loc-zns .ph-nhan .ic,
#zns-vung .adp-field-label svg,
#ph-vung .adp-field-label svg{
  width:var(--icon-label)!important;height:var(--icon-label)!important;
  min-width:var(--icon-label)!important;max-width:var(--icon-label)!important;
  min-height:var(--icon-label)!important;max-height:var(--icon-label)!important;
  flex:0 0 var(--icon-label)!important;
}
.btn-xuat svg,
.adp-control-excel svg,
.adp-control-word svg,
.adp-action-button svg,
.tm-action-btn svg,
.sk-nap svg{
  width:var(--icon-action)!important;height:var(--icon-action)!important;
  min-width:var(--icon-action)!important;flex:0 0 var(--icon-action)!important;
}

/* ZNS + Phát hành: cùng token control với toolbar Theo dõi công nợ. */
#zns-vung .adp-field-box,
#zns-vung .zns-ngay-wrap,
#ph-vung .adp-field-box{
  height:var(--control-h)!important;border:1px solid var(--line)!important;
  border-radius:var(--control-radius)!important;background:var(--white);
  transition:border-color .15s,box-shadow .15s,background .15s,color .15s!important;
}
#zns-vung .adp-field-box input,
#zns-vung .adp-field-box select,
#zns-vung .zns-ngay-wrap input,
#ph-vung .adp-field-box input,
#ph-vung .adp-field-box select{
  font-family:var(--font)!important;font-size:var(--control-font)!important;
  font-weight:600!important;line-height:1!important;
}
#zns-vung .adp-field-box:active,
#zns-vung .zns-ngay-wrap:active,
#ph-vung .adp-field-box:active{transform:none!important;}

/* NSH: rộng đủ cho nhãn lựa chọn nhưng vẫn vừa toolbar 1366px. */
#nsh-vung .adp-control-toolbar .adp-control-group--standard{
  flex:0 1 680px;min-width:0;
}
#nsh-vung .adp-control-toolbar .adp-control-select--building{width:180px!important;}
#nsh-vung .adp-control-toolbar .adp-control-select--status{width:220px!important;}
#nsh-vung .adp-control-toolbar .adp-control-select--sort{width:220px!important;}

/* Excel/Word: cùng hình học và state, chỉ khác màu semantic theo loại file. */
a.btn-xuat:not(.btn-xuat-word),
button.btn-xuat:not(.btn-xuat-word),
.adp-control-excel,
#zns-vung .bang-zns .btn-xuat,
#ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word),
.page-tracuu .adp-control-excel{
  box-sizing:border-box!important;width:auto!important;min-width:0!important;
  height:var(--control-h)!important;padding:0 12px!important;gap:8px!important;
  border:1px solid var(--green)!important;border-radius:var(--control-radius)!important;
  background:#F4FBF6!important;color:var(--green)!important;
  font-size:var(--control-font)!important;font-weight:600!important;line-height:1!important;
  box-shadow:none!important;transform:none!important;
  transition:background .15s,border-color .15s,color .15s,box-shadow .15s!important;
}
a.btn-xuat:not(.btn-xuat-word) svg,
button.btn-xuat:not(.btn-xuat-word) svg,
.adp-control-excel svg,
#zns-vung .bang-zns .btn-xuat svg,
#ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word) svg,
.page-tracuu .adp-control-excel svg{color:var(--green)!important;}
a.btn-xuat:not(.btn-xuat-word):not([aria-disabled="true"]):hover,
button.btn-xuat:not(.btn-xuat-word):not(:disabled):hover,
.adp-control-excel:not([aria-disabled="true"]):not(:disabled):hover,
#zns-vung .bang-zns .btn-xuat:hover,
#ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word):hover,
.page-tracuu .adp-control-excel:hover{
  background:var(--green-tint)!important;border-color:var(--green)!important;
  color:#12813B!important;box-shadow:0 4px 12px rgba(22,163,74,.14)!important;
  transform:none!important;
}
a.btn-xuat:not(.btn-xuat-word):active,
button.btn-xuat:not(.btn-xuat-word):active,
.adp-control-excel:active,
#zns-vung .bang-zns .btn-xuat:active,
#ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word):active,
.page-tracuu .adp-control-excel:active{
  background:#D8F1E1!important;border-color:#12813B!important;color:#0F6E33!important;
  box-shadow:none!important;transform:none!important;
}
a.btn-xuat:not(.btn-xuat-word):focus-visible,
button.btn-xuat:not(.btn-xuat-word):focus-visible,
.adp-control-excel:focus-visible{
  outline:2px solid var(--green)!important;outline-offset:2px!important;
}
.btn-xuat-word,
.adp-control-word,
#ph-vung .ph-actions .btn-xuat-word{
  box-sizing:border-box!important;width:auto!important;min-width:0!important;
  height:var(--control-h)!important;padding:0 12px!important;gap:8px!important;
  border:1px solid var(--blue)!important;border-radius:var(--control-radius)!important;
  background:#F5F8FF!important;color:var(--blue)!important;
  font-size:var(--control-font)!important;font-weight:600!important;line-height:1!important;
  box-shadow:none!important;transform:none!important;
  transition:background .15s,border-color .15s,color .15s,box-shadow .15s!important;
}
.btn-xuat-word svg,
.adp-control-word svg,
#ph-vung .ph-actions .btn-xuat-word svg{color:var(--blue)!important;}
.btn-xuat-word:not(:disabled):hover,
.adp-control-word:not(:disabled):hover,
#ph-vung .ph-actions .btn-xuat-word:not(:disabled):hover{
  background:var(--blue-tint)!important;border-color:var(--blue)!important;
  color:#1D4FD8!important;box-shadow:0 4px 12px rgba(37,99,235,.14)!important;
  transform:none!important;
}
.btn-xuat-word:active,
.adp-control-word:active{
  background:#D9E5FC!important;border-color:#1D4FD8!important;color:#1D4FD8!important;
  box-shadow:none!important;transform:none!important;
}
.btn-xuat-word:focus-visible,
.adp-control-word:focus-visible{
  outline:2px solid var(--blue)!important;outline-offset:2px!important;
}
.btn-xuat:disabled,
.adp-control-excel:disabled,
.adp-control-word:disabled,
.btn-xuat[aria-disabled="true"]{
  opacity:.48!important;cursor:not-allowed!important;box-shadow:none!important;
}

/* Thu tiền mặt: một action group theo thứ tự summary → nghiệp vụ → Excel. */
.bang-tm .adp-control-toolbar > .adp-action-row--batch{
  flex:0 1 auto;width:auto;order:initial;justify-content:flex-end;margin-left:auto;
}
.bang-tm .thanh-lo-tm{gap:10px;flex-wrap:wrap;}
.bang-tm .thanh-lo-tm .btn-lo{margin-left:0;}
.tm-ghi-icon{
  width:30px;height:30px;flex:0 0 30px;border-radius:9px;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--orange-tint);color:var(--orange);
}
.tm-ghi-icon svg{width:18px;height:18px;}
@media(min-width:1100px){
  .tm-ghinhan{gap:12px!important;}
  .tm-ghi-head{flex:0 0 160px!important;}
  .tm-o-makh{flex:.82 1 0;}
  .tm-o-ten{flex:1.05 1 0;}
  .tm-o-tien{flex:1.22 1 0;}
}

/* Gạch nợ: hai cluster chọn dòng dùng cùng hình học và responsive. */
.gn-nhom .gn-selection-cluster{
  box-sizing:border-box;min-height:38px;padding:4px 5px 4px 11px;
  display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;
  margin-left:auto!important;border:1px solid var(--teal);border-radius:10px;
  background:var(--teal-tint);transition:border-color .15s,background .15s;
}
.gn-nhom .gn-selection-cluster .dem-lo{
  color:var(--text-muted);font-size:12px;white-space:nowrap;
}
.gn-nhom .gn-selection-cluster .dem-lo b{color:var(--teal);font-weight:700;}
.gn-nhom .gn-selection-cluster .btn{
  height:30px;margin-left:0;padding:0 11px;border-radius:7px;font-size:12px;
}
.gn-nhom .gn-selection-cluster .btn svg{width:18px;height:18px;flex:0 0 18px;}
.gn-nhom .gn-selection-cluster.co-chon{border-color:var(--teal);background:var(--teal-tint);}
@media(max-width:1100px){
  .gn-nhom .bang-dau{align-items:flex-start;flex-wrap:wrap;}
  .gn-nhom .gn-selection-cluster{margin-left:0!important;}
}

/* Quản trị: màu Tỷ lệ theo ngưỡng, gồm cả thanh và chữ phần trăm. */
.qt-tile{font-weight:700;white-space:nowrap;}
.qt-tile.qt-rate-low{color:var(--green);}
.qt-tile.qt-rate-medium{color:var(--blue);}
.qt-tile.qt-rate-high{color:var(--orange-dark);}
.qt-tile.qt-rate-critical{color:var(--red);}
.qt-tile.qt-rate-low .qt-thanh i{background:var(--green);}
.qt-tile.qt-rate-medium .qt-thanh i{background:var(--blue);}
.qt-tile.qt-rate-high .qt-thanh i{background:var(--orange);}
.qt-tile.qt-rate-critical .qt-thanh i{background:var(--red);}

/* ========================================================================== 
   UI-04 REVIEW FIX 01 — ba hiệu chỉnh thị giác còn lại trên desktop.
   ========================================================================== */

/* RF12 — Cash list uses the available desktop width before wrapping. Title is
   left, factual filters are the flexible middle, and Excel remains right.
   The optional batch action is a compact second line because it is a separate
   business operation, not part of the list filters. */
@media(min-width:721px) and (max-width:1700px){
  .bang-tm .adp-control-toolbar{
    box-sizing:border-box;align-items:center;gap:8px 10px;padding:10px 14px;
    flex-wrap:wrap;
  }
  .bang-tm .adp-control-toolbar > h2{
    flex:0 1 auto!important;width:auto;min-width:205px;order:0;
    margin:0;white-space:nowrap;
  }
  .bang-tm .adp-control-toolbar > .bang-ngan{display:block;order:0;}
  .bang-tm .adp-control-toolbar > .adp-control-group--cash-list{
    flex:0 1 auto;width:auto;min-width:0;max-width:none;order:0!important;
    justify-content:flex-start;flex-wrap:nowrap!important;
  }
  .bang-tm .adp-control-toolbar .adp-control-select--building{width:132px;}
  .bang-tm .adp-control-toolbar .adp-control-select--status{width:176px;}
  .bang-tm .adp-control-toolbar .adp-control-select--staff{width:150px;}
  .bang-tm .adp-control-toolbar > .adp-control-excel{
    flex:0 0 auto;order:0!important;margin-left:auto;
  }
  .bang-tm .adp-control-toolbar > .adp-action-row--batch{
    box-sizing:border-box;flex:1 1 100%;width:100%;max-width:100%;order:1!important;
    justify-content:flex-end;margin-left:auto!important;flex-wrap:nowrap;
  }
}
@media(min-width:721px) and (max-width:1050px){
  .bang-tm .adp-control-toolbar{flex-wrap:wrap;}
  .bang-tm .adp-control-toolbar > h2{flex:1 1 auto!important;min-width:0;}
  .bang-tm .adp-control-toolbar > .bang-ngan{display:none;}
  .bang-tm .adp-control-toolbar > .adp-control-group--cash-list{
    flex:1 1 100%;width:100%;order:1!important;justify-content:flex-start;
  }
  .bang-tm .adp-control-toolbar > .adp-control-excel{order:0!important;margin-left:auto;}
  .bang-tm .adp-control-toolbar > .adp-action-row--batch{order:2!important;}
}

/* STT/Tòa là nhãn ngắn: không áp dụng ellipsis của header dài. */
#nsh-vung .data-nsh thead th.c-stt,
#nsh-vung .data-nsh thead th.c-toa,
.page-danhba .data-danhba thead th.cw-stt,
.page-danhba .data-danhba thead th.db-toa{
  overflow:visible!important;text-overflow:clip!important;white-space:nowrap!important;
}
.page-danhba .data-danhba thead th.db-toa.th-sap a{
  max-width:100%;overflow:visible;text-overflow:clip;white-space:nowrap;
}
.page-danhba .data-danhba thead th.db-toa.th-sap .mui{flex:0 0 auto;}

@media(min-width:1001px){
  #nsh-vung .data-nsh thead th.c-stt{width:4.5%!important;}
  #nsh-vung .data-nsh thead th.c-toa{width:5.5%!important;}
  #nsh-vung .data-nsh thead th.nsh-col-ten{width:16.5%!important;}
  #nsh-vung .data-nsh thead th.nsh-col-nd{width:16.5%!important;}

  .page-danhba .data-danhba--editable thead th.cw-stt{width:5%!important;}
  .page-danhba .data-danhba--editable thead th.db-toa{width:7%!important;}
  .page-danhba .data-danhba--editable thead th.db-ten{width:19%!important;}
  .page-danhba .data-danhba--editable thead th.db-sdt{width:25%!important;}
}

/* ==========================================================================
   UI-05A — CLAUDE CORE (từ baseline exact-only). Chỉ tinh chỉnh thị giác:
   không transform/translateY cho nút bị chạm; phạm vi class rõ ràng; không
   phá icon-only action / KPI / sidebar / bảng.
   ========================================================================== */

/* Thu tiền mặt — "Xóa" (đỏ destructive) vs "Hoàn tác gạch" (rose, cảnh báo nhẹ
   hơn) dùng CHUNG hình học .btn-huygach nhưng khác màu để không giống hệt nhau.
   .tm-act-hoantac chỉ đổi màu, giữ nguyên chiều cao/padding/radius/icon. */
.data-tm .tm-act-hoantac,
#tm-hoantac .tm-act-hoantac{
  background:#FFF1F4; color:#BE123C; border-color:#FBCFE0;
}
.data-tm .tm-act-hoantac svg,
#tm-hoantac .tm-act-hoantac svg{ color:#BE123C; }
.data-tm .tm-act-hoantac:not(:disabled):hover,
#tm-hoantac .tm-act-hoantac:not(:disabled):hover{
  background:#FCE7EE; border-color:#F7A8C4; color:#9F1239;
  box-shadow:0 3px 9px rgba(190,18,60,.12); transform:none;
}
.data-tm .tm-act-hoantac:focus-visible,
#tm-hoantac .tm-act-hoantac:focus-visible{
  outline:2px solid #E11D74; outline-offset:2px;
}

/* Gạch nợ — modal "Nhập sao kê" (dùng shell .gn-xacnhan + dropzone .nhapw-drop).
   Không lộ native control; tên file dài không tràn; footer nút chính cao 40px. */
#sk-modal .gn-xacnhan-hop{ width:min(560px, calc(100vw - 32px)); }
#sk-modal .gn-xacnhan-ic{ background:var(--orange-tint); color:var(--orange); }
#sk-modal .sk-drop{ margin:2px 0 0; padding:26px 18px; }
#sk-modal .sk-drop .sk-tenfile{
  max-width:100%; overflow-wrap:anywhere; word-break:break-word; white-space:normal;
}
#sk-modal .sk-modal-thongke{
  display:flex; flex-wrap:wrap; gap:8px 22px; margin:14px 0 4px;
}
#sk-modal .sk-tk-chip{ font-size:12.5px; color:var(--text-muted); white-space:nowrap; }
#sk-modal .sk-tk-chua b{ color:var(--orange-dark); }
#sk-modal .sk-tk-da b{ color:var(--green); }
#sk-modal .sk-modal-note{
  margin:6px 0 16px; padding:10px 12px; border-radius:9px;
  background:var(--bg-soft); color:var(--text-muted);
  font-size:12.5px; line-height:1.55;
}
#sk-modal .sk-modal-nut{ margin-top:2px; }
#sk-modal .sk-khacphuc{ margin-top:14px; }

/* Thu tiền mặt — cụm batch (viền teal .tm-chon-gon) + nút Excel đứng riêng.
   Wrapper .tm-batch-line đóng vai trò .adp-action-row--batch cũ (layout không đổi);
   Excel là anh em NGOÀI form nên viền cụm không bao quanh Excel (5B). */
.bang-tm .adp-control-toolbar > .tm-batch-line{ align-items:center; gap:10px; }
.bang-tm .tm-batch-line > .tm-chon-gon{ margin:0; }
.bang-tm .tm-batch-line > .adp-control-excel{ margin-left:0; flex:0 0 auto; }
@media(min-width:721px) and (max-width:1700px){
  .bang-tm .adp-control-toolbar > .tm-batch-line{ flex-wrap:nowrap; }
}

/* Tra cứu — nhãn "Chức năng": màu ỔN ĐỊNH theo key (deterministic; cùng chức năng
   luôn cùng màu, không random). Fallback .nhan-cn giữ nguyên cho key lạ. */
.page-tracuu .nhan-cn[data-cn="congno"]   { background:var(--blue-tint);  color:var(--blue); }
.page-tracuu .nhan-cn[data-cn="gachno"]   { background:var(--teal-tint);  color:#0B7C7C; }
.page-tracuu .nhan-cn[data-cn="tienmat"]  { background:var(--orange-tint); color:var(--orange-dark); }
.page-tracuu .nhan-cn[data-cn="nsh"]      { background:var(--tim-tint);   color:var(--tim); }
.page-tracuu .nhan-cn[data-cn="danhba"]   { background:var(--green-tint); color:#12813B; }
.page-tracuu .nhan-cn[data-cn="phathanh"] { background:#E7EAF6;           color:#3C4796; }
.page-tracuu .nhan-cn[data-cn="zns"]      { background:#E0F2F1;           color:#00897B; }
.page-tracuu .nhan-cn[data-cn="import"]   { background:#E6F4EA;           color:#1E7E4E; }
.page-tracuu .nhan-cn[data-cn="export"]   { background:#FFF0E6;           color:#C2410C; }
.page-tracuu .nhan-cn[data-cn="quantri"]  { background:#FCE7EC;           color:#BE123C; }
.page-tracuu .nhan-cn[data-cn="hethong"]  { background:#EDEFF3;           color:#475569; }

/* Quản trị — nút "Thêm tài khoản": top-level cao 40px, icon+chữ căn giữa theo
   trục dọc, KHÔNG mini, không transform/translateY, không layout shift. */
.qt-btn-them{
  height:40px; padding:0 16px; gap:8px; border-radius:9px;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:13.5px; transform:none;
}
.qt-btn-them svg, .qt-btn-them .ic{ width:18px; height:18px; flex:0 0 auto; }
.qt-btn-them:not(:disabled):hover,
.qt-btn-them:not(:disabled):active{ transform:none; box-shadow:none; }
.qt-btn-them:focus-visible{ outline:2px solid var(--orange-dark); outline-offset:2px; }

/* Thu tiền mặt — Khối "Nhận tiền mặt" (5A): ô nhập phải có chiều rộng đọc được,
   không bị nút Ghi nhận ép co gần mất.
   · 1366/1440 (≤1599): reflow — nhãn trên, ô nhập full chiều rộng cột (cân đối).
   · 1600/1920 (≥1600): một hàng gọn; ô Mã KH có min-width để không quá hẹp. */
@media(min-width:1100px) and (max-width:1599px){
  .tm-ghinhan{ align-items:flex-start!important; }
  .tm-ghi-head{ flex:0 0 170px!important; }
  .tm-o{ flex-direction:column!important; align-items:stretch!important; gap:4px!important; }
  .tm-o-ico{ display:none!important; }
  .tm-o label{ white-space:nowrap!important; }
  .tm-o .tm-inp-wrap{ width:100%!important; }
  .tm-o .tm-inp{ width:100%!important; min-width:0!important; }
  .tm-ghi-form .tm-btn{ align-self:flex-end!important; margin:0!important; }
}
@media(min-width:1600px){
  .tm-o-makh .tm-inp{ min-width:140px!important; }
}

/* ==========================================================================
   UI-BTN-MODAL-BATCH-01 — §3 CHUẨN NÚT SEMANTIC
   Mặc định: nền tint rất nhạt · viền nhạt cùng màu · icon+chữ semantic đậm.
   Hover: nền semantic đậm · viền cùng màu · icon+chữ TRẮNG · KHÔNG transform.
   Focus-visible: vòng semantic. Disabled: trung tính. Dùng token --sb/--sb-*.
   ========================================================================== */
/* --- token theo chức năng --- */
.btn-chitiet{ --sb:var(--navy); --sb-tint:var(--navy-tint); --sb-fg:var(--navy); --sb-bd:#C9CEEC; }
.data-danhba .db-sua-so{ --sb:#4F46E5; --sb-tint:#ECECFB; --sb-fg:#4338CA; --sb-bd:#C7C6F4; }
.data-danhba .btn-ls-so{ --sb:var(--tim); --sb-tint:var(--tim-tint); --sb-fg:#6D28D9; --sb-bd:#D6C6F5; }
.data-danhba .btn-them-so, .qt-btn-them{ --sb:var(--green); --sb-tint:var(--green-tint); --sb-fg:#12813B; --sb-bd:#B7E3C6; }
.adp-control-excel, .page-tracuu .adp-control-excel,
a.btn-xuat:not(.btn-xuat-word), button.btn-xuat:not(.btn-xuat-word),
#zns-vung .bang-zns .btn-xuat, #ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word){
  --sb:var(--green); --sb-tint:#F4FBF6; --sb-fg:var(--green); --sb-bd:#B7E3C6; }
.btn-xuat-word, .adp-control-word{ --sb:var(--blue); --sb-tint:#F5F8FF; --sb-fg:var(--blue); --sb-bd:#BBD0FB; }
/* UI-06A-RF: Hoàn tác DÙNG CHUNG hệ ĐỎ với Xóa (bỏ rose/magenta #E11D74).
   Mặc định nền đỏ rất nhạt + viền/chữ/icon đỏ; hover nền đỏ đặc + chữ trắng. */
.tm-act-hoantac, .btn-hoantac, .pa-btn-hoantac, .pa-btn-nsh{
  --sb:var(--red); --sb-tint:var(--red-tint); --sb-fg:var(--red); --sb-bd:#F1B9B9; }
.btn-huygach:not(.tm-act-hoantac):not(.pa-btn-nsh),
.data-danhba .db-nut-xoa, .data-qtuser .db-nut-xoa, .nsh-nut-xoa, .btn-xoa{
  --sb:var(--red); --sb-tint:var(--red-tint); --sb-fg:var(--red); --sb-bd:#F1B9B9; }

/* --- hành vi dùng chung (đè các rule cũ bằng !important, source cuối) --- */
.btn-chitiet,
.data-danhba .db-sua-so, .data-danhba .btn-ls-so, .data-danhba .btn-them-so, .qt-btn-them,
.adp-control-excel, .page-tracuu .adp-control-excel,
a.btn-xuat:not(.btn-xuat-word), button.btn-xuat:not(.btn-xuat-word),
#zns-vung .bang-zns .btn-xuat, #ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word),
.btn-xuat-word, .adp-control-word,
.tm-act-hoantac, .btn-hoantac, .pa-btn-hoantac, .pa-btn-nsh,
.btn-huygach:not(.tm-act-hoantac):not(.pa-btn-nsh),
.data-danhba .db-nut-xoa, .data-qtuser .db-nut-xoa, .nsh-nut-xoa, .btn-xoa{
  background:var(--sb-tint)!important; border:1px solid var(--sb-bd)!important; color:var(--sb-fg)!important;
  box-shadow:none!important; transform:none!important;
  transition:background .14s, border-color .14s, color .14s!important;
}
.btn-chitiet svg, .data-danhba .db-sua-so svg, .data-danhba .btn-ls-so svg, .data-danhba .btn-them-so svg, .qt-btn-them svg,
.adp-control-excel svg, .page-tracuu .adp-control-excel svg,
a.btn-xuat:not(.btn-xuat-word) svg, button.btn-xuat:not(.btn-xuat-word) svg,
.btn-xuat-word svg, .adp-control-word svg,
.tm-act-hoantac svg, .btn-hoantac svg, .pa-btn-hoantac svg, .pa-btn-nsh svg,
.btn-huygach:not(.tm-act-hoantac):not(.pa-btn-nsh) svg,
.data-danhba .db-nut-xoa svg, .data-qtuser .db-nut-xoa svg, .nsh-nut-xoa svg, .btn-xoa svg{ color:var(--sb-fg)!important; }

.btn-chitiet:not(:disabled):hover,
.data-danhba .db-sua-so:not(:disabled):hover, .data-danhba .btn-ls-so:not(:disabled):hover, .data-danhba .btn-them-so:not(:disabled):hover, .qt-btn-them:not(:disabled):hover,
.adp-control-excel:not(:disabled):not([aria-disabled="true"]):hover, .page-tracuu .adp-control-excel:not([aria-disabled="true"]):hover,
a.btn-xuat:not(.btn-xuat-word):not([aria-disabled="true"]):hover, button.btn-xuat:not(.btn-xuat-word):not(:disabled):hover,
.btn-xuat-word:not(:disabled):hover, .adp-control-word:not(:disabled):hover,
.tm-act-hoantac:not(:disabled):hover, .btn-hoantac:not(:disabled):hover, .pa-btn-hoantac:not(:disabled):hover, .pa-btn-nsh:not(:disabled):hover,
.btn-huygach:not(.tm-act-hoantac):not(.pa-btn-nsh):not(:disabled):hover,
.data-danhba .db-nut-xoa:not(:disabled):hover, .data-qtuser .db-nut-xoa:not(:disabled):hover, .nsh-nut-xoa:not(:disabled):hover, .btn-xoa:not(:disabled):hover{
  background:var(--sb)!important; border-color:var(--sb)!important; color:#fff!important; transform:none!important; box-shadow:none!important;
}
.btn-chitiet:not(:disabled):hover svg,
.data-danhba .db-sua-so:not(:disabled):hover svg, .data-danhba .btn-ls-so:not(:disabled):hover svg, .data-danhba .btn-them-so:not(:disabled):hover svg, .qt-btn-them:not(:disabled):hover svg,
.adp-control-excel:not(:disabled):hover svg, a.btn-xuat:not(.btn-xuat-word):hover svg, button.btn-xuat:not(.btn-xuat-word):hover svg,
.btn-xuat-word:not(:disabled):hover svg, .adp-control-word:not(:disabled):hover svg,
.tm-act-hoantac:not(:disabled):hover svg, .btn-hoantac:not(:disabled):hover svg, .pa-btn-hoantac:not(:disabled):hover svg, .pa-btn-nsh:not(:disabled):hover svg,
.btn-huygach:not(.tm-act-hoantac):not(.pa-btn-nsh):not(:disabled):hover svg,
.data-danhba .db-nut-xoa:not(:disabled):hover svg, .data-qtuser .db-nut-xoa:not(:disabled):hover svg, .nsh-nut-xoa:not(:disabled):hover svg, .btn-xoa:not(:disabled):hover svg{ color:#fff!important; }

.btn-chitiet:active, .qt-btn-them:active, .tm-act-hoantac:active, .btn-hoantac:active,
.pa-btn-hoantac:active, .pa-btn-nsh:active, .btn-huygach:active, .nsh-nut-xoa:active,
.data-danhba .db-nut-i:active, .data-qtuser .db-nut-i:active{ transform:none!important; }

.btn-chitiet:focus-visible,
.data-danhba .db-sua-so:focus-visible, .data-danhba .btn-ls-so:focus-visible, .data-danhba .btn-them-so:focus-visible, .qt-btn-them:focus-visible,
.adp-control-excel:focus-visible, .btn-xuat:focus-visible, .btn-xuat-word:focus-visible, .adp-control-word:focus-visible,
.tm-act-hoantac:focus-visible, .btn-hoantac:focus-visible, .pa-btn-hoantac:focus-visible, .pa-btn-nsh:focus-visible,
.btn-huygach:not(.tm-act-hoantac):not(.pa-btn-nsh):focus-visible,
.data-danhba .db-nut-xoa:focus-visible, .data-qtuser .db-nut-xoa:focus-visible, .nsh-nut-xoa:focus-visible, .btn-xoa:focus-visible{
  outline:2px solid var(--sb)!important; outline-offset:2px!important; box-shadow:none!important;
}

/* disabled trung tính — không hover thành nền đặc */
.qt-btn-them:disabled, .tm-act-hoantac:disabled, .btn-hoantac:disabled, .pa-btn-hoantac:disabled,
.pa-btn-nsh:disabled, .btn-huygach:disabled, .adp-control-excel:disabled, .btn-xuat:disabled,
.btn-xuat-word:disabled, .adp-control-word:disabled, .nsh-nut-xoa:disabled, .btn-xoa:disabled,
.data-danhba .db-nut-i:disabled, .data-qtuser .db-nut-i:disabled{
  background:var(--bg-soft)!important; border-color:var(--line)!important; color:var(--text-muted)!important; box-shadow:none!important;
}
.qt-btn-them:disabled svg, .btn-huygach:disabled svg, .adp-control-excel:disabled svg,
.data-danhba .db-nut-i:disabled svg{ color:var(--text-muted)!important; }

/* icon-only cột Thao tác chuẩn 30×30 (§3) */
.data-danhba .db-nut-i, .data-qtuser .db-nut-i{ width:30px!important; height:30px!important; border-radius:8px!important; }

/* §3/§11 — KHÔNG nút action/semantic nào dịch chuyển (bỏ translateY toàn cục của
   .ui-action-btn; các nút nghiệp vụ/xác nhận popup đều đứng yên khi hover/active). */
.ui-action-btn:not(:disabled):hover, .ui-action-btn:not(:disabled):active,
#adp-xn-dongy:hover, #adp-xn-huy:hover, #gn-xn-dongy:hover, #tm-xn-dongy:hover{ transform:none!important; }

/* ==========================================================================
   UI-BTN-MODAL-BATCH-01 — §5 POPUP HOÀN TÁC
   Textarea "Lý do hoàn tác": cao cố định, KHÔNG kéo giãn, nội dung dài cuộn
   trong ô (không đẩy popup cao mất kiểm soát). Footer 40px, căn phải, gap đều.
   ========================================================================== */
/* HOST-ACCEPTANCE REVIEW-FIX 01 §5 — ô "Lý do hoàn tác" (SH #pa-modal-lydo, NSH
   #pa-nsh-lydo, và Tiền mặt #tm-ht-lydo cùng nhóm) dùng CHUNG hình dạng ô nhập
   như ô "Lý do xóa dữ liệu" đã chấp nhận (#qt-debt-clean-reason): bo góc ~8px,
   viền + nền + padding + focus giống, cao CỐ ĐỊNH ~76px, KHÔNG kéo giãn, nội dung
   dài cuộn dọc bên trong, full width, KHÔNG làm popup phình. Dùng CSS chung. */
#tm-ht-lydo, #pa-modal-lydo, #pa-nsh-lydo, .ui-reason-textarea{
  box-sizing:border-box!important; width:100%!important;
  padding:10px 12px!important; border:1px solid var(--line)!important; border-radius:8px!important;
  background:var(--white)!important; color:var(--text)!important; font:inherit!important; line-height:1.45!important;
  resize:none!important; overflow-y:auto!important;
  height:76px!important; min-height:76px!important; max-height:76px!important;
}
#tm-ht-lydo:focus, #pa-modal-lydo:focus, #pa-nsh-lydo:focus, .ui-reason-textarea:focus{
  border-color:var(--navy)!important; outline:2px solid rgba(23,58,103,.12)!important; outline-offset:1px!important;
}
.pa-modal .modal-actions, .nsh-pa-modal .modal-actions{
  display:flex!important; justify-content:flex-end!important; gap:10px!important; align-items:center;
}
#pa-modal-ok, #pa-modal-huy, #pa-nsh-ok, #pa-nsh-huy, #tm-ht-dongy, #tm-ht-huy{
  height:40px!important; min-height:40px!important;
  display:inline-flex!important; align-items:center; justify-content:center; gap:7px;
}
#pa-modal-ok svg, #pa-nsh-ok svg, #tm-ht-dongy svg{ width:16px; height:16px; flex:0 0 auto; }

/* §4 — MÀU NÚT MỞ = MÀU POPUP. UI-06A-RF: Hoàn tác dùng hệ ĐỎ (icon + vùng
   cảnh báo + nút xác nhận + focus) — KHÔNG còn rose/magenta. Tiêu đề vẫn navy. */
#tm-hoantac .gn-xacnhan-ic{ background:var(--red-tint)!important; color:var(--red)!important; }
#tm-hoantac .gn-xacnhan-luu-y{ background:var(--red-tint)!important; color:#B91C1C!important; }
/* showConfirm theme 'undo' (đỏ) — dùng cho các xác nhận Hoàn tác qua showConfirm */
#adp-xacnhan .gn-xacnhan-hop[data-loai="undo"] .gn-xacnhan-ic{ background:var(--red-tint); color:var(--red); }
#adp-xacnhan .gn-xacnhan-hop[data-loai="undo"] .gn-xacnhan-luu-y{ background:var(--red-tint); color:#B91C1C; }

/* ==========================================================================
   UI-BTN-MODAL-BATCH-01 — §8 BỐN CỤM BATCH ACTION
   Chưa chọn: TRUNG TÍNH (không teal) · nút disabled trung tính · không hover đặc.
   Đã chọn (.co-chon): tint semantic nhạt · viền semantic · nút bật · hover đặc.
   Bốn cụm cùng geometry; icon dùng chung ic('gachno'); KHÔNG transform.
   ========================================================================== */
/* token semantic theo cụm */
#form-auto, #form-nsh4{ --cl:var(--green); --cl-tint:var(--green-tint); --cl-bd:#B7E3C6; }
#form-doisoat, .bang-tm .tm-chon-gon{ --cl:var(--tim); --cl-tint:var(--tim-tint); --cl-bd:#D6C6F5; }

/* hộp cụm — mặc định trung tính */
.gn-nhom .gn-selection-cluster, .bang-tm .tm-chon-gon{
  background:var(--white)!important; border-color:var(--line)!important;
  transition:background .15s, border-color .15s!important;
}
.gn-nhom .gn-selection-cluster .dem-lo, .gn-nhom .gn-selection-cluster .dem-lo b,
.bang-tm .tm-chon-dem, .bang-tm .tm-chon-dem b{ color:var(--text-muted)!important; }
/* đã chọn → tint semantic */
.gn-nhom .gn-selection-cluster.co-chon, .bang-tm .tm-chon-gon.co-chon{
  background:var(--cl-tint)!important; border-color:var(--cl-bd)!important;
}
.gn-nhom .gn-selection-cluster.co-chon .dem-lo b, .bang-tm .tm-chon-gon.co-chon .tm-chon-dem b{ color:var(--cl)!important; }

/* nút batch: disabled TRUNG TÍNH (không mờ màu semantic), không hover đặc */
.gn-nhom .bang-dau button[type=submit]:disabled, .bang-tm .tm-chon-gon .btn-lo:disabled{
  background:var(--bg-soft)!important; color:var(--text-muted)!important;
  border-color:var(--line)!important; box-shadow:none!important; opacity:1!important; filter:none!important;
}
.gn-nhom .bang-dau button[type=submit]:disabled svg, .bang-tm .tm-chon-gon .btn-lo:disabled svg{ color:var(--text-muted)!important; }
/* KHÔNG transform trên mọi nút batch (§8) */
.gn-nhom .bang-dau button[type=submit], .bang-tm .tm-chon-gon .btn-lo,
.gn-nhom .bang-dau button[type=submit]:hover, .bang-tm .tm-chon-gon .btn-lo:hover,
.gn-nhom .bang-dau button[type=submit]:active, .bang-tm .tm-chon-gon .btn-lo:active{ transform:none!important; }
/* icon batch canh giữa, cùng cỡ */
.gn-nhom .bang-dau button[type=submit] svg, .bang-tm .tm-chon-gon .btn-lo svg{ width:16px; height:16px; flex:0 0 auto; }

/* ==========================================================================
   UI-BTN-MODAL-BATCH-01 — §6 MODAL NHẬP SAO KÊ + §7 CÔNG CỤ KHẮC PHỤC
   ========================================================================== */
/* §6 — modal không vượt viewport; nội dung dài cuộn TRONG hộp (footer thấy rõ). */
#sk-modal .gn-xacnhan-hop{ max-height:calc(100vh - 40px); overflow-y:auto; }
/* nút "Nạp vào hàng đợi": màu chủ đạo (cam), hover đậm, icon+chữ TRẮNG, không transform. */
#sk-modal .sk-nap{ background:var(--orange)!important; border-color:var(--orange)!important; color:#fff!important; transform:none!important; box-shadow:none!important; }
#sk-modal .sk-nap svg{ color:#fff!important; }
#sk-modal .sk-nap:not(:disabled):hover{ background:var(--orange-dark)!important; border-color:var(--orange-dark)!important; color:#fff!important; transform:none!important; }
#sk-modal .sk-nap:not(:disabled):hover svg{ color:#fff!important; }
#sk-modal .sk-nap:focus-visible{ outline:2px solid var(--orange)!important; outline-offset:2px; }

/* §7 — Công cụ khắc phục: vùng mở rộng trong modal, cảnh báo + checkbox + nút gated. */
#sk-modal .sk-kp-canhbao{ margin:8px 0 10px; padding:9px 11px; border-radius:8px; background:var(--orange-tint); color:var(--orange-dark); font-size:12px; line-height:1.55; }
#sk-modal .sk-kp-form{ display:flex; flex-direction:column; gap:9px; }
#sk-modal .sk-kp-check{ display:flex; align-items:flex-start; gap:7px; font-size:12.5px; color:var(--text); cursor:pointer; }
#sk-modal .sk-kp-check input{ margin-top:1px; flex:0 0 auto; }
#sk-modal .sk-kp-nut{ align-self:flex-start; height:36px; background:var(--orange)!important; border-color:var(--orange)!important; color:#fff!important; transform:none!important; box-shadow:none!important; }
#sk-modal .sk-kp-nut:not(:disabled):hover{ background:var(--orange-dark)!important; border-color:var(--orange-dark)!important; color:#fff!important; }
#sk-modal .sk-kp-nut:disabled{ background:var(--bg-soft)!important; border-color:var(--line)!important; color:var(--text-muted)!important; cursor:not-allowed; }

/* ==========================================================================
   UI-BTN-MODAL-BATCH-01 — REVIEW-FIX-01 (nguồn cuối, đè các rule cũ)
   §3 nút Xem chi tiết NSH · §4 cột Thao tác Quản trị · §5 heading+cảnh báo
   popup Hoàn tác SH/NSH · §6 theme undo showConfirm · §7 màu trigger=popup/drawer.
   ========================================================================== */

/* ---- §3 — .nsh-nut-xem: semantic NAVY (tint→solid), KHÔNG transform, focus navy ---- */
#nsh-vung .data-nsh .nsh-nut-xem, .nsh-nut-xem{
  background:var(--navy-tint)!important; border:1px solid #C9CEEC!important; color:var(--navy)!important;
  box-shadow:none!important; transform:none!important;
  transition:background .14s, border-color .14s, color .14s!important;
}
#nsh-vung .data-nsh .nsh-nut-xem svg, .nsh-nut-xem svg{ color:var(--navy)!important; }
#nsh-vung .data-nsh .nsh-nut-xem:not(:disabled):hover, .nsh-nut-xem:not(:disabled):hover{
  background:var(--navy)!important; border-color:var(--navy)!important; color:#fff!important;
  transform:none!important; box-shadow:none!important;
}
#nsh-vung .data-nsh .nsh-nut-xem:not(:disabled):hover svg, .nsh-nut-xem:not(:disabled):hover svg{ color:#fff!important; }
#nsh-vung .data-nsh .nsh-nut-xem:active, .nsh-nut-xem:active{ transform:none!important; }
#nsh-vung .data-nsh .nsh-nut-xem:focus-visible, .nsh-nut-xem:focus-visible{
  outline:2px solid var(--navy)!important; outline-offset:2px!important; box-shadow:none!important;
}

/* ---- §4 — cột Thao tác Quản trị: mỗi nút một màu semantic (tint→solid) ---- */
.data-qtuser .qt-nut-sua{    --sb:#4F46E5; --sb-tint:#ECECFB; --sb-fg:#4338CA; --sb-bd:#C7C6F4; }
.data-qtuser .qt-nut-mk{     --sb:#7C3AED; --sb-tint:#EDE7FB; --sb-fg:#6D28D9; --sb-bd:#D6C6F5; }
.data-qtuser .qt-nut-go,
.data-qtuser .qt-nut-mokhoa{ --sb:#0EA5A5; --sb-tint:#DBF3F3; --sb-fg:#0F766E; --sb-bd:#A7E0D8; }
.data-qtuser .qt-nut-khoa{   --sb:var(--orange); --sb-tint:var(--orange-tint); --sb-fg:var(--orange-dark); --sb-bd:#F5C9A8; }
/* .qt-nut-xoa (Xóa tài khoản) dùng .db-nut-xoa đỏ destructive từ block §3. */

.data-qtuser .qt-nut-sua, .data-qtuser .qt-nut-mk, .data-qtuser .qt-nut-go,
.data-qtuser .qt-nut-mokhoa, .data-qtuser .qt-nut-khoa{
  background:var(--sb-tint)!important; border:1px solid var(--sb-bd)!important; color:var(--sb-fg)!important;
  box-shadow:none!important; transform:none!important;
  transition:background .14s, border-color .14s, color .14s!important;
}
.data-qtuser .qt-nut-sua svg, .data-qtuser .qt-nut-mk svg, .data-qtuser .qt-nut-go svg,
.data-qtuser .qt-nut-mokhoa svg, .data-qtuser .qt-nut-khoa svg{ color:var(--sb-fg)!important; }
.data-qtuser .qt-nut-sua:not(:disabled):hover, .data-qtuser .qt-nut-mk:not(:disabled):hover,
.data-qtuser .qt-nut-go:not(:disabled):hover, .data-qtuser .qt-nut-mokhoa:not(:disabled):hover,
.data-qtuser .qt-nut-khoa:not(:disabled):hover{
  background:var(--sb)!important; border-color:var(--sb)!important; color:#fff!important;
  transform:none!important; box-shadow:none!important;
}
.data-qtuser .qt-nut-sua:not(:disabled):hover svg, .data-qtuser .qt-nut-mk:not(:disabled):hover svg,
.data-qtuser .qt-nut-go:not(:disabled):hover svg, .data-qtuser .qt-nut-mokhoa:not(:disabled):hover svg,
.data-qtuser .qt-nut-khoa:not(:disabled):hover svg{ color:#fff!important; }
.data-qtuser .qt-nut-sua:active, .data-qtuser .qt-nut-mk:active, .data-qtuser .qt-nut-go:active,
.data-qtuser .qt-nut-mokhoa:active, .data-qtuser .qt-nut-khoa:active{ transform:none!important; }
.data-qtuser .qt-nut-sua:focus-visible, .data-qtuser .qt-nut-mk:focus-visible, .data-qtuser .qt-nut-go:focus-visible,
.data-qtuser .qt-nut-mokhoa:focus-visible, .data-qtuser .qt-nut-khoa:focus-visible{
  outline:2px solid var(--sb)!important; outline-offset:2px!important; box-shadow:none!important;
}

/* ---- §5 — popup Hoàn tác SH/NSH: heading icon ĐỎ; TIÊU ĐỀ NAVY (QĐ UI-06A-RF).
   Geometry icon 40×40 ở block §2+§7 phía dưới; cảnh báo đỏ nhạt. ---- */
#pa-modal-bg .modal > h3, #pa-modal-bg-nsh .nsh-pa-modal > h3{
  display:flex; align-items:center; gap:8px; color:var(--navy)!important;
}
#pa-modal-bg .modal > h3 svg, #pa-modal-bg-nsh .nsh-pa-modal > h3 svg{
  width:18px; height:18px; flex:0 0 auto; color:var(--red);
}
#pa-modal-canhbao:not(:empty), #pa-nsh-canhbao:not(:empty){
  background:var(--red-tint)!important; color:#B91C1C!important; font-weight:600;
  border-radius:8px; padding:8px 10px; margin-top:8px;
}

/* ---- §6 — showConfirm theme 'undo': nút xác nhận tint→solid ĐỎ (đè inline JS) ---- */
#adp-xacnhan .gn-xacnhan-hop[data-loai="undo"] #adp-xn-dongy{
  background:var(--red-tint)!important; border-color:#F1B9B9!important; color:var(--red)!important;
}
#adp-xacnhan .gn-xacnhan-hop[data-loai="undo"] #adp-xn-dongy:hover,
#adp-xacnhan .gn-xacnhan-hop[data-loai="undo"] #adp-xn-dongy:focus-visible{
  background:var(--red)!important; border-color:var(--red)!important; color:#fff!important;
}
#adp-xacnhan .gn-xacnhan-hop[data-loai="undo"] #adp-xn-dongy:focus-visible{
  outline:2px solid var(--red)!important; outline-offset:2px!important;
}

/* ---- §7A — drawer Tài khoản: Thêm=green · Sửa=indigo (trigger đã đúng ở §3) ---- */
#dr-luu.dr-luu-them{ background:var(--green)!important; border-color:var(--green)!important; color:#fff!important; box-shadow:none!important; transform:none!important; }
#dr-luu.dr-luu-them:not(:disabled):hover{ background:#12813B!important; border-color:#12813B!important; color:#fff!important; }
#dr-luu.dr-luu-them:focus-visible{ outline:2px solid var(--green)!important; outline-offset:2px!important; }
#dr-luu.dr-luu-sua{ background:#4F46E5!important; border-color:#4F46E5!important; color:#fff!important; box-shadow:none!important; transform:none!important; }
#dr-luu.dr-luu-sua:not(:disabled):hover{ background:#4338CA!important; border-color:#4338CA!important; color:#fff!important; }
#dr-luu.dr-luu-sua:focus-visible{ outline:2px solid #4F46E5!important; outline-offset:2px!important; }
#dr.dr-mode-them .drawer-head{ border-bottom-color:#B7E3C6; }
#dr.dr-mode-them .drawer-head b{ color:#12813B; }
#dr.dr-mode-sua .drawer-head{ border-bottom-color:#C7C6F4; }
#dr.dr-mode-sua .drawer-head b{ color:#4338CA; }

/* ---- §7B — popup Danh bạ: Thêm số=green · Sửa số=indigo (khớp trigger) ---- */
#db-modal-ok.db-ok-them{ background:var(--green)!important; border-color:var(--green)!important; color:#fff!important; box-shadow:none!important; transform:none!important; }
#db-modal-ok.db-ok-them:not(:disabled):hover{ background:#12813B!important; border-color:#12813B!important; color:#fff!important; }
#db-modal-ok.db-ok-them:focus-visible{ outline:2px solid var(--green)!important; outline-offset:2px!important; }
#db-modal-ok.db-ok-sua{ background:#4F46E5!important; border-color:#4F46E5!important; color:#fff!important; box-shadow:none!important; transform:none!important; }
#db-modal-ok.db-ok-sua:not(:disabled):hover{ background:#4338CA!important; border-color:#4338CA!important; color:#fff!important; }
#db-modal-ok.db-ok-sua:focus-visible{ outline:2px solid #4F46E5!important; outline-offset:2px!important; }
.db-entry-modal.db-mode-them .db-modal-title{ color:#12813B; }
.db-entry-modal.db-mode-sua .db-modal-title{ color:#4338CA; }

/* ==========================================================================
   UI-BTN-MODAL-BATCH-01 — REVIEW-FIX-02 (nguồn CUỐI cùng)
   §3 nút Xuất Word: semantic component thắng specificity trên MỌI trang
      (đè cả arm #ph-vung .ph-actions cũ). §4 focus input popup Danh bạ theo mode.
   ========================================================================== */

/* ---- §3 — Xuất Word (.btn-xuat-word / .adp-control-word) ----
   Gồm arm #ph-vung .ph-actions … để THẮNG rule ID cũ (1,4,0) ở Phát hành;
   các arm không-ID để thắng trên mọi trang khác (nguồn cuối, cùng !important). */
.btn-xuat-word, .adp-control-word,
#ph-vung .ph-actions .btn-xuat-word{
  height:36px!important;
  background:#F5F8FF!important; border:1px solid #BBD0FB!important; color:var(--blue)!important;
  box-shadow:none!important; transform:none!important;
  transition:background .15s, border-color .15s, color .15s!important;
}
.btn-xuat-word svg, .adp-control-word svg,
#ph-vung .ph-actions .btn-xuat-word svg{ color:var(--blue)!important; }

.btn-xuat-word:not(:disabled):hover, .adp-control-word:not(:disabled):hover,
#ph-vung .ph-actions .btn-xuat-word:not(:disabled):hover{
  background:var(--blue)!important; border-color:var(--blue)!important; color:#fff!important;
  box-shadow:none!important; transform:none!important;
}
.btn-xuat-word:not(:disabled):hover svg, .adp-control-word:not(:disabled):hover svg,
#ph-vung .ph-actions .btn-xuat-word:not(:disabled):hover svg{ color:#fff!important; }

.btn-xuat-word:active, .adp-control-word:active,
#ph-vung .ph-actions .btn-xuat-word:active{ transform:none!important; box-shadow:none!important; }

.btn-xuat-word:focus-visible, .adp-control-word:focus-visible,
#ph-vung .ph-actions .btn-xuat-word:focus-visible{
  outline:2px solid var(--blue)!important; outline-offset:2px!important; box-shadow:none!important;
}

.btn-xuat-word:disabled, .adp-control-word:disabled,
#ph-vung .ph-actions .btn-xuat-word:disabled,
.btn-xuat-word[aria-disabled="true"], .adp-control-word[aria-disabled="true"]{
  background:var(--bg-soft)!important; border-color:var(--line)!important; color:var(--text-muted)!important;
  box-shadow:none!important; opacity:1!important;
}
.btn-xuat-word:disabled svg, .adp-control-word:disabled svg,
.btn-xuat-word[aria-disabled="true"] svg, .adp-control-word[aria-disabled="true"] svg{ color:var(--text-muted)!important; }

/* ---- §4 — focus trường nhập popup Danh bạ theo mode (bỏ orange) ----
   Thêm số = green · Sửa số = indigo. Khớp màu tiêu đề + nút xác nhận (Fix 01). */
.db-entry-modal.db-mode-them .db-modal-field input:focus,
.db-entry-modal.db-mode-them .db-modal-field input:focus-visible{
  outline:none!important; border-color:var(--green)!important; box-shadow:0 0 0 3px rgba(22,163,74,.22)!important;
}
.db-entry-modal.db-mode-sua .db-modal-field input:focus,
.db-entry-modal.db-mode-sua .db-modal-field input:focus-visible{
  outline:none!important; border-color:#4F46E5!important; box-shadow:0 0 0 3px rgba(79,70,229,.22)!important;
}

/* ==========================================================================
   UI-05A-CLAUDE-CONTACTS-UI-01 — Danh bạ ZNS (nguồn CUỐI)
   4 nút Thao tác dùng lại class semantic sẵn có (Sửa=.db-sua-so indigo ·
   Lịch sử=.btn-ls-so tím · Thêm=.btn-them-so green · Xóa=.db-nut-xoa đỏ);
   disabled trung tính đã có ở .data-danhba .db-nut-i:disabled. Ở đây chỉ thêm:
   modal Chọn số + modal Xóa số.
   ========================================================================== */

/* Cột Thao tác đủ chỗ cho 4 nút 30px (Sửa·Lịch sử·Thêm·Xóa). Bảng table-layout:fixed
   theo %; nới cột Thao tác 11%→14% (lấy từ Ghi chú 20%→17%), tổng vẫn 100%. */
.page-danhba .data-danhba th:nth-child(6){ width:17%; }   /* Ghi chú */
.page-danhba .data-danhba th:nth-child(7){ width:14%; }   /* Thao tác */
.page-danhba .data-danhba .db-nut-wrap{ flex-wrap:nowrap; }

/* --- Modal CHỌN SỐ (mã nhiều số) --- */
.db-chon-so-modal{ max-width:440px; }
.db-chon-so-list{ display:flex; flex-direction:column; gap:8px; margin:14px 0 4px; max-height:46vh; overflow-y:auto; }
.db-chon-so-modal .db-chon-so-item{
  display:grid; grid-template-columns:18px minmax(0,1fr); align-items:center; column-gap:12px;
  min-height:44px; padding:8px 12px; margin:0; box-sizing:border-box; cursor:pointer;
  border:1px solid var(--line); border-radius:9px; background:var(--white);
  transition:border-color .12s, background .12s, box-shadow .12s;
}
.db-chon-so-item:hover{ border-color:#C7C6F4; background:#F7F7FD; }
.db-chon-so-item input{
  width:18px; height:18px; display:block; margin:0; align-self:center; justify-self:center;
  accent-color:#4F46E5;
}
.db-chon-so-item:has(input:checked){ border-color:#4F46E5; background:#ECECFB; box-shadow:0 0 0 1px #4F46E5 inset; }
.db-chon-so-item:has(input:focus-visible){ outline:2px solid #4F46E5; outline-offset:2px; }
.db-chon-so-sdt{
  display:flex; align-items:center; min-width:0; margin:0; line-height:1.35;
  font-weight:600; color:var(--text); letter-spacing:.01em;
}
/* nút Tiếp tục — theo mode: sửa=indigo · xóa=đỏ · disabled trung tính */
#db-chon-so-ok{ height:40px; min-height:40px; }
#db-chon-so-ok.db-chon-so-ok--sua:not(:disabled){ background:#4F46E5!important; border-color:#4F46E5!important; color:#fff!important; box-shadow:none!important; transform:none!important; }
#db-chon-so-ok.db-chon-so-ok--sua:not(:disabled):hover{ background:#4338CA!important; border-color:#4338CA!important; }
#db-chon-so-ok.db-chon-so-ok--sua:not(:disabled):focus-visible{ outline:2px solid #4F46E5!important; outline-offset:2px!important; }
#db-chon-so-ok.db-chon-so-ok--xoa:not(:disabled){ background:var(--red)!important; border-color:var(--red)!important; color:#fff!important; box-shadow:none!important; transform:none!important; }
#db-chon-so-ok.db-chon-so-ok--xoa:not(:disabled):hover{ background:#B91C1C!important; border-color:#B91C1C!important; }
#db-chon-so-ok.db-chon-so-ok--xoa:not(:disabled):focus-visible{ outline:2px solid var(--red)!important; outline-offset:2px!important; }
#db-chon-so-ok:disabled{ background:var(--bg-soft)!important; border-color:var(--line)!important; color:var(--text-muted)!important; box-shadow:none!important; cursor:not-allowed; }

/* --- Modal XÓA SỐ (semantic đỏ, footer 40px) --- */
.db-xoaso-modal{ max-width:440px; max-height:calc(100vh - 40px); overflow-y:auto; }
.db-xoaso-title{ display:flex; align-items:center; gap:8px; color:var(--red)!important; margin-bottom:12px; }
.db-xoaso-title svg{ width:18px; height:18px; flex:0 0 auto; color:var(--red); }
.db-xoaso-info{ display:flex; flex-direction:column; gap:8px; margin:2px 0 12px; }
.db-xoaso-hang{ display:flex; align-items:baseline; justify-content:space-between; gap:14px; font-size:13px; }
.db-xoaso-nhan{ color:var(--text-muted); flex:0 0 auto; }
.db-xoaso-hang b, .db-xoaso-hang span:last-child{ color:var(--text); text-align:right; overflow-wrap:anywhere; }
.db-xoaso-canhbao{
  background:var(--red-tint)!important; color:#B91C1C!important; font-weight:600;
  border-radius:8px; padding:9px 11px; font-size:12.5px; line-height:1.55; margin-bottom:2px;
}
.db-xoaso-actions{ display:flex!important; justify-content:flex-end!important; gap:10px!important; align-items:center; margin-top:18px; }
#db-xoaso-huy, #db-xoaso-ok{ height:40px!important; min-height:40px!important; display:inline-flex!important; align-items:center; justify-content:center; gap:7px; }
#db-xoaso-ok svg{ width:16px; height:16px; flex:0 0 auto; }
/* nút Xóa số: đỏ tint→solid */
#db-xoaso-ok.db-xoaso-ok{ background:var(--red-tint)!important; border:1px solid #F1B9B9!important; color:var(--red)!important; box-shadow:none!important; transform:none!important; transition:background .14s,border-color .14s,color .14s!important; }
#db-xoaso-ok.db-xoaso-ok svg{ color:var(--red)!important; }
#db-xoaso-ok.db-xoaso-ok:not(:disabled):hover{ background:var(--red)!important; border-color:var(--red)!important; color:#fff!important; transform:none!important; }
#db-xoaso-ok.db-xoaso-ok:not(:disabled):hover svg{ color:#fff!important; }
#db-xoaso-ok.db-xoaso-ok:focus-visible{ outline:2px solid var(--red)!important; outline-offset:2px!important; box-shadow:none!important; }
#db-xoaso-ok.db-xoaso-ok:disabled{ opacity:.6; cursor:not-allowed; }

/* ==========================================================================
   UI-05A-CLAUDE-INTEGRATION-REVIEW-FIX-01 — đồng bộ chiều cao nút footer = 40px
   showConfirm (nút Hủy #adp-xn-huy + nút Xác nhận #adp-xn-dongy, MỌI theme) và
   drawer Tài khoản (nút #dr-luu ở cả mode Thêm/Sửa). CSS thuần; KHÔNG đổi màu/
   theme/tint-to-solid/icon/focus/contract; .btn vốn inline-flex+căn giữa nên chỉ
   cần ép chiều cao → không layout shift khi hover/focus, không đổi padding ngang.
   ========================================================================== */
#adp-xn-huy, #adp-xn-dongy, #dr-luu{
  height:40px!important; min-height:40px!important;
}

/* ==========================================================================
   UI-06A-CLAUDE-REBUILD-01 — NGUỒN CUỐI (đè các rule cũ khi cần). UI-ONLY.
   (1) "TT Chuyển khoản" · (2) đồng bộ popup/modal · (3) dropdown/select cam +
   custom menu · (4) ô ngày cam + Từ/Đến · (5) Quản trị mục 4 · (6) Xuất Excel.
   QUYẾT ĐỊNH MÀU: mặc định trung tính · HOVER/FOCUS/OPEN = CAM · option hover =
   cam nhạt · option ĐANG CHỌN = KHÔNG cam (navy nhạt + dấu check). Error=đỏ giữ,
   disabled=xám giữ. KHÔNG đổi kích thước/không nhấc control khi tương tác.
   ========================================================================== */

/* --------------------------------------------------------------------------
   §3 — SELECT/INPUT LỌC & FORM: đổi hover/focus/open NAVY→CAM (đè rule cũ).
   Giữ đặc tả selector y hệt rule navy để cùng độ ưu tiên + đứng sau → thắng.
   -------------------------------------------------------------------------- */
/* toolbar select (Theo dõi / NSH / Tiền mặt / Danh bạ / Tra cứu) */
.adp-control-toolbar .adp-control-select:not(:disabled):hover{
  border-color:var(--orange)!important; box-shadow:none!important; transform:none!important;
}
.adp-control-toolbar .adp-control-select:focus,
.adp-control-toolbar .adp-control-select:focus-visible,
.adp-control-toolbar .adp-control-select.adp-cs-open{
  outline:0!important; border-color:var(--orange)!important;
  box-shadow:0 0 0 3px var(--orange-tint)!important; transform:none!important;
}
/* toolbar input (mã KH / ngày Tra cứu = .adp-control-input / --date) */
.adp-control-toolbar .adp-control-input:not(:disabled):hover{
  border-color:var(--orange)!important; box-shadow:none!important;
}
.adp-control-toolbar .adp-control-input:focus,
.adp-control-toolbar .adp-control-input:focus-visible{
  outline:0!important; border-color:var(--orange)!important;
  box-shadow:0 0 0 3px var(--orange-tint)!important;
}
/* khung field 40px (Phát hành/ZNS: ô ngày + select bọc trong .ph-box/.zns-ngay-wrap) */
.adp-field-box:not(.tm-inp-wrap):not(.ph-loi):hover:not(:has(:disabled)){
  border-color:var(--orange)!important; box-shadow:none!important;
}
.adp-field-box:not(.tm-inp-wrap):not(.ph-loi):focus-within:not(:has(:disabled)),
.adp-field-box:not(.tm-inp-wrap):not(.ph-loi).adp-cs-open{
  border-color:var(--orange)!important; box-shadow:0 0 0 3px var(--orange-tint)!important;
}
/* input field trực tiếp (nếu có border riêng) */
.adp-field-input:hover:not(:disabled){ border-color:var(--orange)!important; }
.adp-field-input:focus, .adp-field-input:focus-visible{
  outline:0!important; border-color:var(--orange)!important;
  box-shadow:0 0 0 3px var(--orange-tint)!important;
}
/* Tiền mặt tm-inp */
.adp-field-row .tm-inp:not(:disabled):hover{ border-color:var(--orange)!important; }
.adp-field-row .tm-inp:focus, .adp-field-row .tm-inp:focus-visible{
  outline:0!important; border-color:var(--orange)!important;
  box-shadow:0 0 0 3px var(--orange-tint)!important;
}
/* select đơn lẻ (header kỳ · phân trang · select trong modal) khi custom-menu MỞ:
   viền + quầng cam rõ (native select:focus đã cam sẵn ở block toàn hệ). */
select.adp-cs-open{
  border-color:var(--orange)!important; box-shadow:0 0 0 3px var(--orange-tint)!important;
}
/* ZNS / Phát hành: khung field bọc bằng ID (#zns-vung/#ph-vung) nên phải đè
   viền theo ĐÚNG ID-scope mới thắng rule nền `border:...var(--line)!important`. */
#zns-vung .adp-field-box:not(.tm-inp-wrap):not(.ph-loi):hover:not(:has(:disabled)),
#zns-vung .zns-ngay-wrap:not(.ph-loi):hover:not(:has(:disabled)),
#ph-vung .adp-field-box:not(.tm-inp-wrap):not(.ph-loi):hover:not(:has(:disabled)){
  border-color:var(--orange)!important;
}
#zns-vung .adp-field-box:not(.tm-inp-wrap):not(.ph-loi):focus-within:not(:has(:disabled)),
#zns-vung .adp-field-box.adp-cs-open,
#zns-vung .zns-ngay-wrap:not(.ph-loi):focus-within:not(:has(:disabled)),
#ph-vung .adp-field-box:not(.tm-inp-wrap):not(.ph-loi):focus-within:not(:has(:disabled)),
#ph-vung .adp-field-box.adp-cs-open{
  border-color:var(--orange)!important; box-shadow:0 0 0 3px var(--orange-tint)!important;
}
/* giữ error đỏ trong ID-scope (đè cam ở trên) */
#zns-vung .adp-field-box.ph-loi, #zns-vung .zns-ngay-wrap.ph-loi,
#ph-vung .adp-field-box.ph-loi{
  border-color:var(--red)!important; box-shadow:0 0 0 3px var(--red-tint)!important;
}

/* --------------------------------------------------------------------------
   §1 + §3-I — STATUS SELECT TRONG BẢNG (Theo dõi / NSH)
   • "TT Chuyển khoản" & nhãn dài hiển thị ĐỦ: bỏ trần cắt chữ, chừa caret.
   • Giữ TINT NỀN semantic; hover/focus/open = viền + quầng CAM (không đổi cỡ).
   -------------------------------------------------------------------------- */
/* UI-06A-RF §6 — WIDTH GỌN: trigger KHÔNG lấy theo option hướng dẫn dài
   (bỏ width:auto → native select tự nới theo option 286px lấn cột Ghi chú).
   Nhãn dài sao kê + padding/caret hiển thị thoáng trong shared width 164px
   ⇒ hiển thị đủ MỌI trạng thái, KHÔNG ellipsis, KHÔNG cắt chữ, KHÔNG lấn Ghi chú.
   Option hướng dẫn dài chỉ hiện trong custom menu (wrap, muted). */
.data-theodoi .tt-select, .data-nsh .tt-select{
  width:var(--adp-debt-status-width)!important;max-width:var(--adp-debt-status-width)!important;
  min-width:var(--adp-debt-status-width)!important;
  padding-right:24px!important; text-overflow:clip!important;
}
.data-nsh .tt-select{max-width:var(--adp-debt-status-width)!important;} /* đè max-width:112px cũ */
/* UI-06A-RF §8 — VIỀN hover/focus/open THEO SEMANTIC (status select là NGOẠI LỆ
   so với toolbar cam). Giữ nền/chữ tint semantic; token --ttb/--ttbr theo lớp. */
.tt-select.tt-do{        --ttb:var(--red);    --ttbr:var(--red-tint); }
.tt-select.tt-xanh,
.tt-select.tt-xanhla{    --ttb:var(--green);  --ttbr:var(--green-tint); }
.tt-select.tt-cam{       --ttb:var(--orange); --ttbr:var(--orange-tint); }
.tt-select.tt-teal{      --ttb:var(--teal);   --ttbr:var(--teal-tint); }
.tt-select.tt-xanhduong{ --ttb:var(--blue);   --ttbr:var(--blue-tint); }
.tt-select.tt-tim{       --ttb:var(--tim);    --ttbr:var(--tim-tint); }
.tt-select.tt-indigo{    --ttb:var(--indigo); --ttbr:var(--indigo-tint); }
.tt-select.tt-xam{       --ttb:#8A93A6;       --ttbr:var(--line-2); }
.data-theodoi .tt-select:hover, .data-nsh .tt-select:hover,
.data-theodoi .tt-select:focus, .data-nsh .tt-select:focus,
.data-theodoi .tt-select:focus-visible, .data-nsh .tt-select:focus-visible,
.data-theodoi .tt-select.adp-cs-open, .data-nsh .tt-select.adp-cs-open{
  border-color:var(--ttb, var(--orange))!important;
  box-shadow:0 0 0 3px var(--ttbr, var(--orange-tint))!important;
  filter:none!important; transform:none!important;
}

/* --------------------------------------------------------------------------
   §9 — CUSTOM SELECT MENU (listbox tự vẽ, phủ trên native select)
   option hover/active = NỀN CAM RẤT NHẠT · option ĐANG CHỌN = navy nhạt + dấu
   check (KHÔNG cam) · disabled mờ · nhóm optgroup có tiêu đề.
   -------------------------------------------------------------------------- */
.adp-cs-menu{
  position:fixed; z-index:100050; margin:0; padding:5px;
  min-width:120px; max-height:288px; overflow-y:auto; overscroll-behavior:contain;
  background:var(--white); border:1px solid var(--line); border-radius:10px;
  box-shadow:0 16px 40px rgba(15,31,58,.20);
  font-family:var(--font); font-size:12.5px; color:var(--text);
}
.adp-cs-menu[hidden]{ display:none; }
.adp-cs-opt{
  display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:7px;
  color:var(--text); font-weight:600; line-height:1.35; cursor:pointer;
  white-space:normal; word-break:break-word;
}
.adp-cs-opt-tick{ width:15px; height:15px; flex:0 0 15px; opacity:0; color:var(--navy); display:inline-flex; }
.adp-cs-opt-tick svg{ width:15px; height:15px; }
.adp-cs-opt-lab{ min-width:0; }
/* ĐANG CHỌN — navy nhạt + chữ đậm + dấu check (KHÔNG dùng cam) */
.adp-cs-opt[aria-selected="true"]{ background:var(--navy-tint); color:var(--navy); font-weight:700; }
.adp-cs-opt[aria-selected="true"] .adp-cs-opt-tick{ opacity:1; }
/* HOVER / ACTIVE (chuột rê hoặc bàn phím) — nền CAM RẤT NHẠT */
.adp-cs-opt:hover:not([aria-disabled="true"]),
.adp-cs-opt.adp-cs-active{ background:var(--orange-tint); color:var(--orange-dark); }
.adp-cs-opt[aria-disabled="true"]{ color:var(--text-mo); cursor:not-allowed; background:transparent; opacity:.72; }
.adp-cs-grp{ padding:8px 10px 3px; font-size:11px; font-weight:800; color:var(--navy); letter-spacing:.2px; }

/* --------------------------------------------------------------------------
   §14 — NÚT XUẤT EXCEL (ZNS · Phát hành · mọi trang dùng .adp-control-excel):
   mặc định OUTLINE xanh (nền xanh rất nhạt, viền/chữ/icon xanh) → hover NỀN ĐẶC
   chữ/icon trắng. 36px · padding ngang 14px · radius 8px · icon 16px · gap 7px ·
   KHÔNG transform. Nhãn/URL/điều kiện disabled động GIỮ NGUYÊN.
   -------------------------------------------------------------------------- */
.adp-control-excel{
  height:36px!important; padding:0 14px!important; gap:7px!important;
  border:1px solid var(--green)!important; border-radius:8px!important;
  background:var(--green-tint)!important; color:var(--green)!important;
  box-shadow:none!important; transform:none!important;
}
.adp-control-excel svg{ width:16px!important; height:16px!important; color:var(--green)!important; }
.adp-control-excel:not(:disabled):hover{
  background:var(--green)!important; border-color:var(--green)!important; color:#fff!important;
  box-shadow:none!important; transform:none!important;
}
.adp-control-excel:not(:disabled):hover svg{ color:#fff!important; }
.adp-control-excel:not(:disabled):active{ transform:none!important; box-shadow:none!important; }
.adp-control-excel:focus-visible{ outline:2px solid var(--green)!important; outline-offset:2px; }
.adp-control-excel:disabled, .adp-control-excel[aria-disabled="true"]{
  background:var(--bg-soft)!important; border-color:var(--line)!important;
  color:var(--text-mo)!important; box-shadow:none!important; transform:none!important;
}
.adp-control-excel:disabled svg{ color:var(--text-mo)!important; }

/* --------------------------------------------------------------------------
   §2 + §7 — ĐỒNG BỘ POPUP/MODAL: width chuẩn 520 / rộng 720 · max-height 88vh ·
   body cuộn khi tràn. Icon Hoàn tác SH/NSH đồng bộ với Hoàn tác gạch tiền mặt.
   -------------------------------------------------------------------------- */
/* modal chuẩn (.modal) — 360→520; cao tự động; cuộn khi tràn màn hình */
.modal{
  width:min(520px, calc(100vw - 32px))!important;
  max-width:min(520px, calc(100vw - 32px))!important;
  max-height:88vh; overflow-y:auto; overflow-x:hidden;
}
/* modal RỘNG: kết quả hoàn tác (có bảng) → 720 */
.pa-kq-modal{
  width:min(720px, calc(100vw - 24px))!important;
  max-width:min(720px, calc(100vw - 24px))!important; max-height:88vh!important;
}
/* gn-xacnhan: chuẩn 520; Nhập sao kê (rộng) 720; giỏ Gạch nợ gộp đã 720 */
.gn-xacnhan-hop{ width:min(520px, calc(100vw - 32px)); max-height:88vh; overflow-y:auto; }
#sk-modal .gn-xacnhan-hop{ width:min(720px, calc(100vw - 32px)); max-height:88vh; }
.gio-hop{ max-height:88vh; }
/* Hoàn tác giao dịch (SH #pa-modal / NSH #pa-nsh): icon ĐỎ trong khối bo tròn
   40px ở đầu tiêu đề — khớp icon 40px của Hoàn tác gạch tiền mặt (#tm-hoantac).
   UI-06A-RF: glyph 20px, tiêu đề navy (màu heading đặt ở §5 trên). */
#pa-modal-bg .modal > h3, #pa-modal-bg-nsh .nsh-pa-modal > h3{ gap:12px!important; margin-bottom:8px; }
#pa-modal-bg .modal > h3 svg, #pa-modal-bg-nsh .nsh-pa-modal > h3 svg{
  width:40px!important; height:40px!important; padding:10px!important; box-sizing:border-box!important;
  background:var(--red-tint)!important; color:var(--red)!important; border-radius:11px!important; flex:0 0 40px!important;
}

/* --------------------------------------------------------------------------
   §5 — QUẢN TRỊ MỤC 4: ô ngày cam · nút "Dọn nhật ký cũ" = ĐỎ (xoá vĩnh viễn) ·
   geometry đồng bộ (40px, radius 8, gap, không transform).
   -------------------------------------------------------------------------- */
.qt-don-form{ gap:10px; align-items:center; }
.qt-don-form .o-ngay{ height:40px!important; border-radius:8px!important; }
.qt-don-form .o-ngay:hover{ border-color:var(--orange)!important; }
.qt-don-form .o-ngay:focus, .qt-don-form .o-ngay:focus-visible{
  outline:0!important; border-color:var(--orange)!important;
  box-shadow:0 0 0 3px var(--orange-tint)!important;
}
.qt-don-form button[type=submit]{
  height:40px!important; padding:0 14px!important; gap:7px; border-radius:8px!important;
  transform:none!important;
  background:var(--red-tint)!important; color:var(--red)!important; border:1px solid #F1B9B9!important;
}
.qt-don-form button[type=submit] svg{ width:16px; height:16px; }
.qt-don-form button[type=submit]:hover{
  background:var(--red)!important; color:#fff!important; border-color:var(--red)!important; transform:none!important;
}
.qt-don-form button[type=submit]:hover svg{ color:#fff!important; }
.qt-don-form button[type=submit]:focus-visible{ outline:2px solid var(--red)!important; outline-offset:2px; }

/* --------------------------------------------------------------------------
   §4 — NHÃN "Từ" / "Đến" (Tra cứu lịch sử): label thật, cùng hàng ô ngày.
   -------------------------------------------------------------------------- */
.adp-date-lbl{ display:inline-flex; align-items:center; white-space:nowrap; flex:0 0 auto; margin:0; cursor:default; }
.adp-control-subgroup--primary{ gap:6px; }
@media(max-width:1180px){
  .loc-tracuu .adp-control-subgroup--primary{ flex-wrap:wrap; }
}

/* ============================================================================
   UI-06A-CLAUDE-REBUILD-REVIEW-FIX-01 — NGUON CUOI CUNG (de moi rule o tren).
   QD nguoi dung: TIEU DE MOI MODAL = NAVY 18/24/700 · icon container 40×40 ·
   glyph 20×20 · mo ta 14/20 · callout 14/20 · footer nut 40px. Hoan tac = he DO.
   Chi UI: KHONG doi id/name/option value/handler/endpoint.
   ============================================================================ */

/* ---- (A) GEOMETRY modal dung chung .gn-xacnhan (showConfirm · sk-modal ·
        tm-hoantac · tm-xacnhan · gn-xacnhan) — icon 40, glyph 20, title navy ---- */
.gn-xacnhan-ic{ width:40px!important; height:40px!important; flex:0 0 40px!important; border-radius:11px!important; }
.gn-xacnhan-ic .ic, .gn-xacnhan-ic svg{ width:20px!important; height:20px!important; }
.gn-xacnhan-dau{ gap:12px!important; }
.gn-xacnhan-dau h2{ font-size:18px!important; line-height:24px!important; font-weight:700!important; color:var(--navy)!important; margin:1px 0 6px!important; }
.gn-xacnhan-dau p{ font-size:14px!important; line-height:20px!important; color:var(--text-muted)!important; }
.gn-xacnhan-luu-y{ font-size:14px!important; line-height:20px!important; }
.gn-xacnhan-nut .btn{ height:40px!important; min-height:40px!important; }

/* ---- (B) GEOMETRY modal dung chung .modal-bg > .modal (danhba · qt-them ·
        SH/NSH undo). Header icon 40×40 qua .adp-modal-head + .adp-modal-ic. ---- */
.adp-modal-head{ display:flex; align-items:flex-start; gap:12px; margin:0 0 16px; min-width:0; }
.adp-modal-head-txt{ min-width:0; }
.adp-modal-head-txt .modal-sub{ margin:2px 0 0; }
.adp-modal-ic{ width:40px; height:40px; flex:0 0 40px; border-radius:11px; display:inline-flex; align-items:center; justify-content:center; }
.adp-modal-ic svg{ width:20px; height:20px; }
.adp-modal-ic > span{ display:inline-flex; align-items:center; justify-content:center; }
.adp-modal-ic.ic-green{  background:var(--green-tint);  color:var(--green); }
.adp-modal-ic.ic-blue{   background:var(--blue-tint);   color:#4338CA; }
.adp-modal-ic.ic-red{    background:var(--red-tint);    color:var(--red); }
.adp-modal-ic.ic-navy{   background:var(--navy-tint);   color:var(--navy); }
.adp-modal-ic.ic-orange{ background:var(--orange-tint); color:var(--orange); }
.adp-modal-ic.ic-tim{    background:var(--tim-tint);    color:var(--tim); }
.adp-modal-head h3, .db-modal-title, .db-xoaso-title,
.db-entry-modal.db-mode-them .db-modal-title,
.db-entry-modal.db-mode-sua .db-modal-title{
  color:var(--navy)!important; font-size:18px!important; line-height:24px!important; font-weight:700!important;
  margin:0!important; display:block!important;
}
.db-xoaso-title svg{ display:none!important; }
.modal .modal-sub{ font-size:14px!important; line-height:20px!important; }
.modal .modal-actions .btn{ height:40px!important; min-height:40px!important; }

/* ---- (C) SAO KE — icon Excel XANH vung "Chon file sao ke" ---- */
#sk-modal .sk-drop .sk-ic-excel{ width:30px!important; height:30px!important; color:var(--green)!important; margin:0 auto 8px!important; display:block!important; }
#sk-modal .sk-drop .sk-ic-excel svg{ width:30px!important; height:30px!important; color:var(--green)!important; }

/* ---- (D) NHAN TIEN MAT — 3 field bang nhau (grid 3×1fr + nut auto).
        Nhan co dinh 96px (du "So tien thuc thu" 95px) -> 3 input width bang nhau. ---- */
@media(min-width:1100px){
  .tm-ghi-form{ display:grid!important; grid-template-columns:repeat(3, minmax(0,1fr)) auto!important;
    gap:12px!important; align-items:center!important; }
  .tm-ghi-form .tm-o{ min-width:0; }
  .tm-ghi-form .tm-o label{ flex:0 0 96px!important; width:96px!important; }
  .tm-ghi-form .tm-o .tm-inp-wrap{ flex:1 1 auto!important; min-width:0; width:auto!important; }
  .tm-ghi-form .tm-btn{ margin:0!important; align-self:center!important; }
}

/* ---- (E) DANH BA — icon header doi theo mode Them(green)/Sua(indigo) ---- */
.db-modal-ic{ background:var(--green-tint); color:var(--green); }
.db-modal-ic .db-ic-sua{ display:none; }
.db-entry-modal.db-mode-sua .db-modal-ic{ background:var(--blue-tint); color:#4338CA; }
.db-entry-modal.db-mode-sua .db-modal-ic .db-ic-them{ display:none; }
.db-entry-modal.db-mode-sua .db-modal-ic .db-ic-sua{ display:inline-flex; }

/* ---- (F) DOI MAT KHAU (mkp) — tieu de NAVY, header co icon khoa (accent cam) ---- */
.mkp-dau-main{ display:flex; align-items:flex-start; gap:12px; min-width:0; }
.mkp-dau b{ color:var(--navy)!important; font-size:18px!important; line-height:24px!important; font-weight:700!important; }
.mkp-dau-txt span{ display:block; margin-top:3px; color:var(--text-muted); font-size:12.5px; }

/* ---- (G) QUAN TRI — Quet lai / Mo Tra cuu = XANH (giong Excel chuan) ·
        cum Xoa nhat ky gon theo noi dung. ---- */
.qt-nut-xanh{
  height:36px!important; padding:0 14px!important; gap:7px!important;
  border:1px solid var(--green)!important; border-radius:8px!important;
  background:var(--green-tint)!important; color:var(--green)!important;
  box-shadow:none!important; transform:none!important;
  transition:background .15s,border-color .15s,color .15s!important;
}
.qt-nut-xanh svg{ width:16px!important; height:16px!important; color:var(--green)!important; }
.qt-nut-xanh:not(:disabled):hover{ background:var(--green)!important; border-color:var(--green)!important; color:#fff!important; }
.qt-nut-xanh:not(:disabled):hover svg{ color:#fff!important; }
.qt-nut-xanh:active{ transform:none!important; box-shadow:none!important; }
.qt-nut-xanh:focus-visible{ outline:2px solid var(--green)!important; outline-offset:2px!important; box-shadow:none!important; }
.qt-don-form{ display:inline-flex!important; flex-wrap:wrap; width:auto!important; }
.qt-don-form .adp-field-row{ margin:0; }
.qt-don-form .o-ngay{ width:132px!important; }

/* ---- (H) ZNS / PHAT HANH — SELECT la CONTROL DUY NHAT (bo khung vuong mo /
        double-box). Khung .adp-field-box lo vien + quang cam; select ben trong
        KHONG vien/nen/quang/bo-goc rieng. Bo goc rounded giong mau Theo doi. ---- */
#zns-vung .ph-box--sel > select, #ph-vung .ph-box--sel > select,
#zns-vung .ph-box--sel > select:hover, #ph-vung .ph-box--sel > select:hover,
#zns-vung .ph-box--sel > select:focus, #ph-vung .ph-box--sel > select:focus,
#zns-vung .ph-box--sel > select:focus-visible, #ph-vung .ph-box--sel > select:focus-visible,
#zns-vung .ph-box--sel > select.adp-cs-open, #ph-vung .ph-box--sel > select.adp-cs-open{
  border:0!important; background:transparent!important; box-shadow:none!important;
  outline:0!important; border-radius:8px!important;
}

/* ---- (J) THEM TAI KHOAN modal (chuyen tu drawer) — 520px, header green, footer 40px ---- */
.qt-them-modal{ padding-top:20px; }
.qt-them-modal .adp-modal-head{ padding-right:34px; }
.qt-them-modal .f-goiy{ margin:4px 0 2px; }
.qt-them-actions{ display:flex!important; justify-content:flex-end!important; gap:10px!important; align-items:center; margin-top:18px!important; }
#qt-them-huy, #qt-them-tao{ height:40px!important; min-height:40px!important; display:inline-flex!important; align-items:center; justify-content:center; }
#qt-them-tao{ background:var(--green)!important; border:1px solid var(--green)!important; color:#fff!important; box-shadow:none!important; transform:none!important; font-weight:600; }
#qt-them-tao:not(:disabled):hover{ background:#12813B!important; border-color:#12813B!important; }
#qt-them-tao:focus-visible{ outline:2px solid var(--green)!important; outline-offset:2px!important; }
#qt-them-tao:disabled{ background:var(--bg-soft)!important; border-color:var(--line)!important; color:var(--text-muted)!important; cursor:not-allowed; }

/* ---- (I) TRA CUU — toolbar: MỘT hàng ở màn rộng (1600/1920), TỐI ĐA hai hàng ở
        màn hẹp (1366/1440). Tiêu đề KHÔNG ép full-width (co giãn, không chiếm cả
        hàng); cụm lọc co giãn cùng trục; Excel LUÔN bên phải. Nhãn Từ/Đến dính ô
        nhờ subgroup nowrap. Thay cho các rule cũ ép h2 flex:1 1 100%. ---- */
.page-tracuu .adp-control-toolbar--wide{
  display:flex!important; flex-wrap:nowrap!important; align-items:center!important;
  row-gap:10px!important; column-gap:12px!important;
}
.page-tracuu .adp-control-toolbar--wide > h2{
  flex:0 0 auto!important; min-width:0!important; margin:0!important;
  white-space:nowrap!important; overflow:visible!important; text-overflow:clip!important;
}
.page-tracuu .adp-control-toolbar--wide > .bang-ngan{ display:none!important; }
.page-tracuu .adp-control-toolbar--wide > .loc-tracuu{
  flex:1 1 auto!important; width:auto!important; min-width:0!important;
  margin-left:auto!important; justify-content:flex-end!important;
  align-items:center!important; row-gap:10px!important; column-gap:10px!important; flex-wrap:wrap!important;
}
.page-tracuu .adp-control-toolbar--wide > .bang-xuat{
  flex:0 0 auto!important; margin-left:0!important; align-self:center!important; order:9!important;
}
.page-tracuu .loc-tracuu .adp-control-subgroup{
  display:inline-flex!important; align-items:center!important; gap:8px!important;
  flex:0 0 auto!important; min-width:0!important; flex-wrap:nowrap!important;
}
/* Màn rộng ≥1451: ép cụm lọc một hàng + thu nhẹ control để 1600px vừa một hàng. */
@media (min-width:1451px){
  .page-tracuu .adp-control-group--history{ flex-wrap:nowrap!important; }
  .page-tracuu .adp-control-toolbar .adp-control-input--date{ width:138px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--feature{ width:156px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--operation{ width:166px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--staff{ width:156px!important; }
}
/* Màn hẹp ≤1450: cụm lọc được xuống dòng nhưng subgroup KHÔNG chiếm 100%
   (nếu 100% sẽ thành 3 hàng) → giữ tối đa hai hàng gọn, Excel vẫn bên phải. */
@media (max-width:1450px){
  /* Hai subgroup là hai đơn vị wrap nguyên khối: tối đa hai hàng, không tách Từ/Đến. */
  .page-tracuu .adp-control-toolbar--wide > h2{ flex:0 0 auto!important; }
  .page-tracuu .adp-control-toolbar--wide > .loc-tracuu{ margin-left:auto!important; flex:1 1 auto!important; }
  .page-tracuu .adp-control-toolbar--wide > .bang-xuat{ margin-left:0!important; }
  .page-tracuu .adp-control-group--history{ flex-wrap:wrap!important; }
  .page-tracuu .adp-control-group--history .adp-control-subgroup--primary,
  .page-tracuu .adp-control-group--history .adp-control-subgroup--secondary{
    flex:0 0 auto!important; width:auto!important;
  }
  .page-tracuu .adp-control-toolbar .adp-control-input--date{ width:130px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--feature{ width:150px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--operation{ width:158px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--staff{ width:150px!important; }
}
@media (max-width:1180px){
  .page-tracuu .adp-control-toolbar--wide{ flex-wrap:wrap!important; }
  .page-tracuu .adp-control-toolbar--wide > .loc-tracuu{ order:2!important; margin-left:0!important; }
  .page-tracuu .adp-control-toolbar--wide > .bang-xuat{ margin-left:auto!important; }
}

/* ==========================================================================
   UI-06A RF2 §11 — BỎ DOUBLE-BOX ở ô nhập ZNS / Phát hành
   --------------------------------------------------------------------------
   Khung (.ph-box / .zns-ngay-wrap) là control DUY NHẤT: một viền + một quầng.
   Input BÊN TRONG không được tự vẽ viền/nền/quầng/bo ở BẤT KỲ trạng thái nào
   (mặc định/hover/focus) — nếu không sẽ thành "ô lồng ô" như ảnh phản hồi.
   .ph-box thêm overflow:hidden (như .zns-ngay-wrap) để cắt mọi quầng con.
   "Số thông báo" trở thành segmented phẳng: [Số] input [/TB-ADP] — bỏ ô nổi.
   Đặt CUỐI file để thắng rule input:focus toàn hệ + .ph-inp-tb cũ.
   ========================================================================== */
/* Chỉ INPUT (ngày/giờ/Số thông báo) — KHÔNG đụng <select> để giữ mũi tên chevron.
   Ring của select (nếu có) đã bị .ph-box{overflow:hidden} cắt sẵn. */
.ph-box > input, .zns-ngay-wrap > input,
.ph-box > input:hover, .ph-box > input:focus, .ph-box > input:focus-visible, .ph-box > input:active,
.zns-ngay-wrap > input:hover, .zns-ngay-wrap > input:focus, .zns-ngay-wrap > input:focus-visible, .zns-ngay-wrap > input:active{
  border:0 !important; box-shadow:none !important; background-color:transparent !important;
  outline:0 !important; border-radius:0 !important;
}
/* Số thông báo: input PHẲNG, cao hết khung, không nền/viền/bo/lề (đè .ph-inp-tb cũ). */
#ph-vung .ph-box--tb .ph-inp-tb,
#ph-vung .ph-box--tb .ph-inp-tb:hover,
#ph-vung .ph-box--tb .ph-inp-tb:focus,
#ph-vung .ph-box--tb .ph-inp-tb:focus-visible{
  height:100% !important; margin:0 !important; padding:0 6px !important;
  background:transparent !important; border:0 !important; border-radius:0 !important;
  box-shadow:none !important;
}

/* ==========================================================================
   UI-06A RF2 §10 — Nút Xuất Excel ZNS / Phát hành
   --------------------------------------------------------------------------
   Default (nền xanh rất nhạt + viền/chữ/icon xanh, 36px, radius 8) và focus
   ring xanh đã có từ rule Excel chung. Ở ĐÂY chỉ chỉnh HOVER = nền xanh ĐẶC +
   chữ/icon TRẮNG (không translate) và ACTIVE = xanh đậm hơn, cho khớp spec.
   KHÔNG đụng nút Word (loại trừ .btn-xuat-word). ========================== */
#zns-vung .bang-zns .btn-xuat:not(.btn-xuat-word):hover,
#ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word):hover{
  background:var(--green)!important; border-color:var(--green)!important;
  color:#fff!important; box-shadow:none!important; transform:none!important;
}
#zns-vung .bang-zns .btn-xuat:not(.btn-xuat-word):hover svg,
#ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word):hover svg{ color:#fff!important; }
#zns-vung .bang-zns .btn-xuat:not(.btn-xuat-word):active,
#ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word):active{
  background:#0F6E33!important; border-color:#0F6E33!important; color:#fff!important;
  box-shadow:none!important; transform:none!important;
}
#zns-vung .bang-zns .btn-xuat:not(.btn-xuat-word):active svg,
#ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word):active svg{ color:#fff!important; }
#zns-vung .bang-zns .btn-xuat:not(.btn-xuat-word):focus-visible,
#ph-vung .ph-actions .btn-xuat:not(.btn-xuat-word):focus-visible{
  outline:2px solid var(--green)!important; outline-offset:2px!important;
}

/* ==========================================================================
   UI-06A RF2 §5 — Nút "Đóng và cập nhật" (popup Hoàn tác thành công)
   Đổi từ navy đặc → XANH SUCCESS, cao 40px, không transform, footer cân đối.
   ========================================================================== */
#pa-modal-bg #pa-kq-dong{
  height:40px!important; min-height:40px!important; padding:0 18px!important;
  background:var(--green)!important; border:1px solid var(--green)!important; color:#fff!important;
  box-shadow:none!important; transform:none!important; font-weight:600!important;
}
#pa-modal-bg #pa-kq-dong:hover{ background:#12813B!important; border-color:#12813B!important; color:#fff!important; }
#pa-modal-bg #pa-kq-dong:active{ background:#0F6E33!important; border-color:#0F6E33!important; color:#fff!important; }
#pa-modal-bg #pa-kq-dong:focus-visible{ outline:2px solid var(--green)!important; outline-offset:2px!important; }
.pa-modal-thanh-cong > #pa-modal-title svg{
  background:var(--green-tint)!important; color:var(--green)!important;
}

/* ==========================================================================
   UI-06A RF2 §7 — Popup "Xóa lượt thu" (nút xác nhận DANGER của showConfirm)
   --------------------------------------------------------------------------
   Hover-fill giống nút Hoàn tác gạch: mặc định nền đỏ RẤT NHẠT + viền/chữ đỏ;
   hover nền đỏ ĐẶC + chữ trắng; active đỏ đậm; focus ring đỏ; không transform.
   Đè inline-style footer.php gán (JS chỉ set background inline → !important thắng).
   Áp dụng cho MỌI xác nhận danger dùng chung (nhất quán hệ nút semantic).
   ========================================================================== */
#adp-xacnhan .gn-xacnhan-hop[data-loai="danger"] #adp-xn-dongy{
  background:var(--red-tint)!important; border:1px solid #F0C4C4!important; color:var(--red)!important;
  box-shadow:none!important; transform:none!important;
}
#adp-xacnhan .gn-xacnhan-hop[data-loai="danger"] #adp-xn-dongy:hover{
  background:var(--red)!important; border-color:var(--red)!important; color:#fff!important;
}
#adp-xacnhan .gn-xacnhan-hop[data-loai="danger"] #adp-xn-dongy:active{
  background:#B91C1C!important; border-color:#B91C1C!important; color:#fff!important;
}
#adp-xacnhan .gn-xacnhan-hop[data-loai="danger"] #adp-xn-dongy:focus-visible{
  outline:2px solid var(--red)!important; outline-offset:2px!important;
}
/* Khoảng thở giữa nội dung và footer cho confirm không có textarea. */
#adp-xacnhan .gn-xacnhan-nut{ margin-top:16px!important; }

/* ==========================================================================
   UI-06A RF2 §8 — Nút "Hoàn tác gạch" trong modal tm-hoantac
   --------------------------------------------------------------------------
   Bỏ width:72px cố định của .btn-huygach (vốn dành cho nút "Xóa" nhỏ trong bảng)
   → nút tự giãn theo chữ: icon + "Hoàn tác gạch" hiện đủ, KHÔNG cắt, KHÔNG tràn
   footer; padding 16, gap 8, icon 16 (bỏ mọi lề âm), chữ 14/20. Màu hover-fill
   đỏ đã có sẵn từ hệ .tm-act-hoantac.
   ========================================================================== */
#tm-hoantac .gn-xacnhan-nut #tm-ht-dongy{
  width:auto!important; min-width:0!important; height:40px!important;
  padding:0 16px!important; gap:8px!important; white-space:nowrap!important;
  font-size:14px!important; line-height:20px!important;
}
#tm-hoantac .gn-xacnhan-nut #tm-ht-dongy svg,
#tm-hoantac .gn-xacnhan-nut #tm-ht-dongy .ic{
  width:16px!important; height:16px!important; margin:0!important; flex:0 0 auto!important;
}

/* ==========================================================================
   UI-06A RF2 §9 — Nút Xóa NSH disabled khi khoản CHƯA đủ điều kiện xóa
   (không đủ delete guard). Muted, KHÔNG hover, con trỏ cấm; aria-disabled ở HTML.
   ========================================================================== */
#nsh-vung .data-nsh .nsh-nut-xoa-off,
#nsh-vung .data-nsh .nsh-nut-xoa-off:hover,
#nsh-vung .data-nsh .nsh-nut-xoa-off:active{
  background:var(--bg-soft)!important; border-color:var(--line)!important; color:var(--text-muted)!important;
  cursor:not-allowed!important; opacity:.55; box-shadow:none!important; transform:none!important;
}
#nsh-vung .data-nsh .nsh-nut-xoa-off svg{ color:var(--text-muted)!important; }

/* ============================================================================
   UI-06B — ADMIN / NHẬN TIỀN MẶT / TRA CỨU LỊCH SỬ
   Chỉ hình học và tương tác UI; giữ nguyên contract form, handler và nghiệp vụ.
   ============================================================================ */

/* A — Dọn nhật ký: nhãn + ngày + action là một cụm control cùng trục. */
.qt-don-form{
  display:flex!important; align-items:center!important; flex-wrap:nowrap!important;
  width:auto!important; gap:12px!important;
}
.qt-don-form > .adp-field-row{
  display:inline-flex!important; align-items:center!important; flex:0 0 auto!important;
  gap:11px!important; margin:0!important;
}
.qt-don-form .adp-field-label{
  display:inline-flex!important; align-items:center!important; gap:8px!important;
  color:var(--navy)!important; font-size:15px!important; line-height:20px!important;
  font-weight:600!important; white-space:nowrap!important;
}
.qt-don-form .adp-field-label svg,
.qt-don-form .adp-field-label .ic{
  width:18px!important; height:18px!important; min-width:18px!important; max-width:18px!important;
  min-height:18px!important; max-height:18px!important;
  flex:0 0 18px!important; color:var(--orange)!important;
}
.qt-don-form .o-ngay{ flex:0 0 132px!important; width:132px!important; }
.qt-don-form button[type=submit]{
  flex:0 0 auto!important; min-width:max-content; white-space:nowrap!important;
}
@media(max-width:900px){
  .qt-don-form{ flex-wrap:wrap!important; }
  .qt-don-form > .adp-field-row{ flex-wrap:nowrap!important; }
}

/* B — Modal Sửa tài khoản: một overlay, form POST cũ, footer 40px. */
.qt-sua-modal{
  position:relative; width:min(540px, calc(100vw - 32px))!important;
  max-width:min(540px, calc(100vw - 32px))!important; padding-top:20px;
}
.qt-sua-modal .adp-modal-head{ padding-right:34px; }
.qt-sua-form input[type=text],
.qt-sua-form select{ text-align:left!important; font-size:13.5px!important; font-weight:500!important; }
.qt-sua-actions{
  display:flex!important; justify-content:flex-end!important; align-items:center!important;
  gap:10px!important; margin-top:18px!important;
}
#qt-sua-huy, #qt-sua-luu{
  height:40px!important; min-height:40px!important; display:inline-flex!important;
  align-items:center!important; justify-content:center!important; transform:none!important;
}
#qt-sua-luu{
  background:#4F46E5!important; border:1px solid #4F46E5!important; color:#fff!important;
  box-shadow:none!important; font-weight:600!important;
}
#qt-sua-luu:not(:disabled):hover{ background:#4338CA!important; border-color:#4338CA!important; transform:none!important; }
#qt-sua-luu:active{ background:#3730A3!important; border-color:#3730A3!important; transform:none!important; }
#qt-sua-luu:focus-visible{ outline:2px solid #4F46E5!important; outline-offset:2px!important; }
#qt-sua-luu:disabled{
  background:var(--bg-soft)!important; border-color:var(--line)!important;
  color:var(--text-muted)!important; cursor:not-allowed; transform:none!important;
}

/* C — Nhận tiền mặt: title + 3 field + action trên đúng một hàng desktop. */
@media(min-width:1320px){
  .tm-ghinhan{
    display:flex!important; align-items:flex-start!important; gap:12px!important;
    padding:13px 18px!important; overflow:visible!important;
  }
  .tm-ghinhan .tm-ghi-head{
    flex:0 0 140px!important; width:140px!important; min-width:140px!important;
    margin:21px 0 0!important; padding:0!important; gap:8px!important;
    align-items:center!important; white-space:nowrap!important;
  }
  .tm-ghinhan .tm-ghi-icon{ width:28px!important; height:28px!important; flex:0 0 28px!important; }
  .tm-ghinhan .tm-ghi-icon svg{ width:19px!important; height:19px!important; }
  .tm-ghinhan .tm-ghi-head h2{
    font-size:15px!important; line-height:20px!important; font-weight:700!important;
    white-space:nowrap!important;
  }
  .tm-ghinhan .tm-ghi-body{
    flex:1 1 auto!important; min-width:0!important; padding:0 0 0 12px!important;
    border-left:1px solid var(--line)!important;
  }
  .tm-ghinhan .tm-ghi-form{
    display:grid!important;
    grid-template-columns:176px minmax(210px,280px) 190px max-content!important;
    gap:12px!important; align-items:start!important; justify-content:start!important;
    width:100%!important; margin:0!important;
  }
  .tm-ghinhan .tm-o{
    display:grid!important; grid-template-columns:14px minmax(0,1fr)!important;
    grid-template-rows:16px 40px auto!important; column-gap:5px!important; row-gap:4px!important;
    align-items:center!important; min-width:0!important; position:relative!important;
  }
  .tm-ghinhan .tm-o-ico{
    display:inline-flex!important; grid-column:1!important; grid-row:1!important;
    width:14px!important; height:14px!important;
  }
  .tm-ghinhan .tm-o-ico .ic,
  .tm-ghinhan .tm-o-ico svg{ width:14px!important; height:14px!important; }
  .tm-ghinhan .tm-o label{
    grid-column:2!important; grid-row:1!important; width:auto!important;
    flex:0 0 auto!important; margin:0!important; font-size:12px!important;
    line-height:16px!important; font-weight:600!important; white-space:nowrap!important;
  }
  .tm-ghinhan .tm-o .tm-inp-wrap{
    grid-column:1 / -1!important; grid-row:2!important;
    width:100%!important; min-width:0!important; height:40px!important;
  }
  .tm-ghinhan .tm-o .tm-inp{
    width:100%!important; min-width:0!important; height:40px!important;
  }
  .tm-ghinhan .tm-o .tm-hint{
    position:static!important; grid-column:1 / -1!important; grid-row:3!important;
    display:block!important; width:auto!important; max-width:none!important;
    min-height:0!important; padding:2px 2px 0!important; box-shadow:none!important;
    border:0!important; background:transparent!important; white-space:normal!important;
  }
  .tm-ghinhan .tm-o .tm-hint:empty{ display:none!important; }
  .tm-ghinhan .tm-ghi-form .tm-btn{
    grid-column:4!important; height:40px!important; min-width:112px!important;
    width:auto!important; margin:20px 0 0!important; align-self:start!important;
    white-space:nowrap!important;
  }
}

/* Ngoài dải desktop đích: các field wrap nguyên nhóm, tối đa hai hàng gọn. */
@media(min-width:901px) and (max-width:1319px){
  .tm-ghinhan{ display:flex!important; align-items:flex-start!important; gap:12px!important; padding:13px 18px!important; }
  .tm-ghinhan .tm-ghi-head{ flex:0 0 140px!important; width:140px!important; padding:7px 0 0!important; }
  .tm-ghinhan .tm-ghi-body{ flex:1 1 auto!important; min-width:0!important; padding:0 0 0 12px!important; }
  .tm-ghinhan .tm-ghi-form{ display:grid!important; grid-template-columns:minmax(165px,1fr) minmax(210px,1.2fr)!important; gap:12px!important; }
  .tm-ghinhan .tm-o{ min-width:0!important; }
  .tm-ghinhan .tm-ghi-form .tm-btn{ grid-column:2!important; margin:0!important; justify-self:start!important; }
}

/* D — Tra cứu: title + line + filter trái; chỉ Excel đẩy sát phải. */
.page-tracuu .adp-control-toolbar--wide{
  display:flex!important; align-items:center!important; column-gap:10px!important; row-gap:10px!important;
}
.page-tracuu .adp-control-toolbar--wide > h2{
  flex:0 0 auto!important; width:auto!important; min-width:0!important; margin:0!important;
  white-space:nowrap!important; overflow:visible!important; text-overflow:clip!important;
}
.page-tracuu .adp-control-toolbar--wide > .bang-ngan{
  display:block!important; width:1px!important; height:24px!important; flex:0 0 1px!important;
  margin:0 2px!important; background:var(--line)!important; align-self:center!important;
}
.page-tracuu .adp-control-toolbar--wide > .loc-tracuu{
  width:auto!important; min-width:0!important; margin-left:0!important;
  justify-content:flex-start!important; align-items:center!important; gap:8px!important;
}
.page-tracuu .loc-tracuu .adp-control-subgroup{
  display:inline-flex!important; align-items:center!important; flex:0 0 auto!important;
  width:auto!important; min-width:0!important; gap:6px!important; flex-wrap:nowrap!important;
}
.page-tracuu .adp-control-toolbar--wide > .bang-xuat{
  flex:0 0 auto!important; width:auto!important; margin-left:auto!important;
  align-self:center!important; white-space:nowrap!important;
}
@media(min-width:1451px){
  .page-tracuu .adp-control-toolbar--wide{ flex-wrap:nowrap!important; }
  .page-tracuu .adp-control-toolbar--wide > .loc-tracuu{
    flex:0 1 auto!important; flex-wrap:nowrap!important; order:0!important;
  }
  .page-tracuu .adp-control-toolbar--wide > .bang-xuat{ order:0!important; }
  .page-tracuu .adp-control-toolbar .adp-control-input--date{ width:132px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--feature{ width:150px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--operation{ width:158px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--staff{ width:150px!important; }
}
@media(min-width:1260px) and (max-width:1450px){
  .page-tracuu .adp-control-toolbar--wide{ flex-wrap:wrap!important; }
  .page-tracuu .adp-control-toolbar--wide > h2{ order:0!important; }
  .page-tracuu .adp-control-toolbar--wide > .bang-ngan{ order:0!important; }
  .page-tracuu .adp-control-toolbar--wide > .bang-xuat{ order:1!important; margin-left:auto!important; }
  .page-tracuu .adp-control-toolbar--wide > .loc-tracuu{
    order:2!important; flex:1 0 100%!important; margin-left:0!important;
    flex-wrap:nowrap!important; justify-content:flex-start!important;
  }
  .page-tracuu .adp-control-toolbar .adp-control-input--date{ width:130px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--feature{ width:150px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--operation{ width:158px!important; }
  .page-tracuu .adp-control-toolbar .adp-control-select--staff{ width:150px!important; }
}

/* ============================================================================
   UI-06B-ADMIN-CASH-HISTORY-COMPACT-01-REVIEW-FIX-01
   Chỉ hình học, trạng thái tương tác và validation phía trình duyệt.
   ============================================================================ */

/* A — Nhận tiền mặt: ba nhóm bằng nhau, mỗi nhóm icon + nhãn + input cùng trục. */
@media(min-width:1260px){
  .tm-ghinhan{
    display:flex!important; align-items:flex-start!important; gap:12px!important;
    padding:13px 18px!important; overflow:visible!important;
  }
  .tm-ghinhan .tm-ghi-head{
    display:flex!important; flex:0 0 136px!important; width:136px!important; min-width:136px!important;
    height:40px!important; margin:0!important; padding:0!important; gap:8px!important;
    align-items:center!important; white-space:nowrap!important;
  }
  .tm-ghinhan .tm-ghi-icon{ width:28px!important; height:28px!important; flex:0 0 28px!important; }
  .tm-ghinhan .tm-ghi-icon svg{ width:19px!important; height:19px!important; }
  .tm-ghinhan .tm-ghi-head h2{
    margin:0!important; font-size:15px!important; line-height:20px!important;
    font-weight:700!important; white-space:nowrap!important;
  }
  .tm-ghinhan .tm-ghi-body{
    flex:1 1 auto!important; min-width:0!important; width:auto!important;
    padding:0 0 0 12px!important; border-left:1px solid var(--line)!important;
  }
  .tm-ghinhan .tm-ghi-form{
    display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr)) max-content!important;
    gap:12px!important; align-items:start!important; justify-content:stretch!important;
    width:100%!important; min-width:0!important; margin:0!important;
  }
  .tm-ghinhan .tm-o{
    display:grid!important; grid-template-columns:14px max-content minmax(0,1fr)!important;
    grid-template-rows:40px auto!important; column-gap:6px!important; row-gap:4px!important;
    align-items:center!important; min-width:0!important; width:auto!important; position:relative!important;
  }
  .tm-ghinhan .tm-o-ico{
    display:inline-flex!important; grid-column:1!important; grid-row:1!important;
    width:14px!important; height:14px!important; align-items:center!important;
  }
  .tm-ghinhan .tm-o-ico .ic,
  .tm-ghinhan .tm-o-ico svg{ width:14px!important; height:14px!important; }
  .tm-ghinhan .tm-o label{
    grid-column:2!important; grid-row:1!important; width:auto!important; margin:0!important;
    font-size:12px!important; line-height:16px!important; font-weight:600!important;
    white-space:nowrap!important; align-self:center!important;
  }
  .tm-ghinhan .tm-o .tm-inp-wrap{
    grid-column:3!important; grid-row:1!important; width:100%!important; min-width:0!important;
    height:40px!important; align-self:center!important;
  }
  .tm-ghinhan .tm-o .tm-inp{
    width:100%!important; min-width:0!important; height:40px!important;
  }
  .tm-ghinhan .tm-o .tm-hint{
    position:static!important; grid-column:1 / -1!important; grid-row:2!important;
    display:block!important; width:auto!important; max-width:none!important; min-height:0!important;
    padding:2px 2px 0!important; border:0!important; background:transparent!important;
    box-shadow:none!important; white-space:normal!important;
  }
  .tm-ghinhan .tm-o .tm-hint:empty{ display:none!important; }
  .tm-ghinhan .tm-ghi-form .tm-btn{
    grid-column:4!important; grid-row:1!important; height:40px!important; min-height:40px!important;
    min-width:112px!important; width:auto!important; margin:0!important; align-self:start!important;
    white-space:nowrap!important;
  }
}

/* B — Hệ nút quản trị tint → solid, đúng semantic và không dịch chuyển. */
#qt-sua-luu{
  background:#ECECFB!important; border:1px solid #AFADEB!important; color:#4338CA!important;
  box-shadow:none!important; transform:none!important; font-weight:600!important;
}
#qt-sua-luu:not(:disabled):hover{
  background:#4F46E5!important; border-color:#4F46E5!important; color:#fff!important; transform:none!important;
}
#qt-sua-luu:not(:disabled):active{
  background:#3730A3!important; border-color:#3730A3!important; color:#fff!important; transform:none!important;
}
#qt-sua-luu:focus-visible{ outline:2px solid #4F46E5!important; outline-offset:2px!important; box-shadow:none!important; }

.data-qtuser .qt-nut-mk{
  background:#F3E8FF!important; border-color:#D8B4FE!important; color:#7E22CE!important;
  box-shadow:none!important; transform:none!important;
}
.data-qtuser .qt-nut-mk svg{ color:#7E22CE!important; }
.data-qtuser .qt-nut-mk:not(:disabled):hover{
  background:#7C3AED!important; border-color:#7C3AED!important; color:#fff!important; transform:none!important;
}
.data-qtuser .qt-nut-mk:not(:disabled):hover svg{ color:#fff!important; }
.data-qtuser .qt-nut-mk:not(:disabled):active{
  background:#5B21B6!important; border-color:#5B21B6!important; color:#fff!important; transform:none!important;
}
.data-qtuser .qt-nut-mk:focus-visible{ outline:2px solid #7C3AED!important; outline-offset:2px!important; box-shadow:none!important; }

#adp-xacnhan .gn-xacnhan-hop[data-loai="warning"] #adp-xn-dongy{
  height:40px!important; min-height:40px!important; background:#F3E8FF!important;
  border:1px solid #D8B4FE!important; color:#7E22CE!important; box-shadow:none!important; transform:none!important;
}
#adp-xacnhan .gn-xacnhan-hop[data-loai="warning"] #adp-xn-dongy:hover{
  background:#7C3AED!important; border-color:#7C3AED!important; color:#fff!important; transform:none!important;
}
#adp-xacnhan .gn-xacnhan-hop[data-loai="warning"] #adp-xn-dongy:active{
  background:#5B21B6!important; border-color:#5B21B6!important; color:#fff!important; transform:none!important;
}
#adp-xacnhan .gn-xacnhan-hop[data-loai="warning"] #adp-xn-dongy:focus-visible{
  outline:2px solid #7C3AED!important; outline-offset:2px!important; box-shadow:none!important;
}

.qt-btn-them,
#qt-them-tao{
  background:var(--green-tint)!important; border:1px solid #A7DDB8!important;
  color:#12813B!important; box-shadow:none!important; transform:none!important; font-weight:600!important;
}
.qt-btn-them svg{ color:#12813B!important; }
.qt-btn-them:not(:disabled):hover,
#qt-them-tao:not(:disabled):hover{
  background:var(--green)!important; border-color:var(--green)!important;
  color:#fff!important; box-shadow:none!important; transform:none!important;
}
.qt-btn-them:not(:disabled):hover svg{ color:#fff!important; }
.qt-btn-them:not(:disabled):active,
#qt-them-tao:not(:disabled):active{
  background:#0F6E33!important; border-color:#0F6E33!important; color:#fff!important; transform:none!important;
}
.qt-btn-them:focus-visible,
#qt-them-tao:focus-visible{ outline:2px solid var(--green)!important; outline-offset:2px!important; box-shadow:none!important; }
#qt-them-tao:disabled,
#qt-them-tao:disabled:hover{
  background:var(--bg-soft)!important; border-color:var(--line)!important;
  color:var(--text-muted)!important; cursor:not-allowed!important; transform:none!important;
}

/* C — Modal Thêm tài khoản: lỗi nội tuyến, không dùng validation bubble native. */
.qt-them-form .qt-field-error{
  margin:4px 0 0; min-height:17px; color:var(--red); font-size:12.5px;
  line-height:17px; font-weight:600;
}
.qt-them-form .qt-field-error:empty{ display:none; }
.qt-them-form input[aria-invalid="true"],
.qt-them-form select[aria-invalid="true"]{
  border-color:var(--red)!important; box-shadow:0 0 0 3px var(--red-tint)!important;
}
.qt-them-form .f-goiy{ font-size:12.5px; line-height:17px; }

/* D — Tra cứu: một hàng ở cả bốn viewport desktop, form co giãn hết phần giữa. */
@media(min-width:1260px){
  .page-tracuu .adp-control-toolbar--wide{
    display:flex!important; flex-wrap:nowrap!important; align-items:center!important;
    gap:8px!important; min-width:0!important;
  }
  .page-tracuu .adp-control-toolbar--wide > h2{
    flex:0 0 auto!important; width:auto!important; min-width:0!important; margin:0!important;
    white-space:nowrap!important; font-size:15px!important; line-height:20px!important;
  }
  .page-tracuu .adp-control-toolbar--wide > .bang-ngan{
    display:block!important; flex:0 0 1px!important; width:1px!important; height:24px!important;
    margin:0 2px!important; background:var(--line)!important; align-self:center!important;
  }
  .page-tracuu .adp-control-toolbar--wide > .loc-tracuu{
    display:flex!important; flex:1 1 auto!important; width:auto!important; min-width:0!important;
    margin-left:0!important; gap:6px!important; flex-wrap:nowrap!important;
    justify-content:flex-start!important; align-items:center!important; order:0!important;
  }
  .page-tracuu .loc-tracuu .adp-control-subgroup{
    display:flex!important; width:auto!important; min-width:0!important;
    align-items:center!important; gap:6px!important; flex-wrap:nowrap!important;
  }
  .page-tracuu .loc-tracuu .adp-control-subgroup--primary{ flex:4 1 0!important; }
  .page-tracuu .loc-tracuu .adp-control-subgroup--secondary{ flex:1.25 1 0!important; }
  .page-tracuu .loc-tracuu .adp-control-subgroup--primary > .adp-control-input,
  .page-tracuu .loc-tracuu .adp-control-subgroup--primary > .adp-control-select,
  .page-tracuu .loc-tracuu .adp-control-subgroup--secondary > .adp-control-select{
    flex:1 1 0!important; width:0!important; min-width:0!important; max-width:none!important;
  }
  .page-tracuu .loc-tracuu .adp-control-actions{
    display:inline-flex!important; flex:0 0 36px!important; width:36px!important; min-width:36px!important;
  }
  .page-tracuu .loc-tracuu .adp-control-reset{
    display:inline-flex!important; width:36px!important; min-width:36px!important; height:36px!important;
  }
  .page-tracuu .adp-control-toolbar--wide > .bang-xuat{
    flex:0 0 auto!important; width:auto!important; margin-left:auto!important;
    align-self:center!important; white-space:nowrap!important; order:0!important;
  }
}

/* E — Tất cả popup có icon: icon và toàn bộ khối title/subtitle cùng tâm Y. */
.gn-xacnhan-dau{ align-items:center!important; padding-right:46px!important; }
.gn-xacnhan-dau > div{
  display:flex!important; flex-direction:column!important; justify-content:center!important;
  gap:3px!important; min-width:0!important;
}
.gn-xacnhan-dau h2,
.gn-xacnhan-dau p{ margin:0!important; }
.adp-modal-head{ align-items:center!important; }
.adp-modal-head-txt{
  display:flex!important; flex-direction:column!important; justify-content:center!important;
  gap:3px!important; min-width:0!important;
}
.adp-modal-head-txt .modal-sub{ margin:0!important; }
.mkp-dau,
.mkp-dau-main{ align-items:center!important; }
.mkp-dau-main > .adp-modal-ic{ margin:0!important; display:inline-flex!important; }
.mkp-dau-txt{
  display:flex!important; flex-direction:column!important; justify-content:center!important;
  gap:3px!important; min-width:0!important;
}
.mkp-dau-txt span{ margin:0!important; }
.pa-kq-dau{ align-items:center!important; }
.pa-kq-dau > div{
  display:flex!important; flex-direction:column!important; justify-content:center!important;
  gap:3px!important; min-width:0!important;
}
.pa-kq-ic{ width:40px!important; height:40px!important; flex:0 0 40px!important; }
.pa-kq-dau h3,
.pa-kq-dau .modal-sub{ margin:0!important; }
.db-import-choice-head,
.db-import-choice-heading{ align-items:center!important; }
.db-import-choice-heading{ gap:12px!important; }
.db-import-choice-heading > div{
  display:flex!important; flex-direction:column!important; justify-content:center!important;
  gap:3px!important; min-width:0!important;
}
.db-import-choice-icon{
  width:40px!important; height:40px!important; flex:0 0 40px!important; border-radius:11px!important;
}
.db-import-choice-icon .ic,
.db-import-choice-icon svg{ width:20px!important; height:20px!important; }
.db-import-choice-heading h3,
.db-import-choice-heading p{ margin:0!important; }

/* SH/NSH cần wrapper hẹp vì subtitle vốn là sibling của title. */
.adp-pa-modal-head{
  display:grid!important; grid-template-columns:40px minmax(0,1fr)!important;
  grid-template-rows:auto auto!important; column-gap:12px!important; row-gap:3px!important;
  align-items:center!important; margin:0 0 8px!important; min-width:0!important;
}
#pa-modal-bg .adp-pa-modal-head{ padding-right:48px!important; }
.qt-sua-modal .adp-modal-head,
.qt-them-modal .adp-modal-head{ padding-right:46px!important; }
.adp-pa-modal-head > h3{ display:contents!important; }
.adp-pa-modal-head > h3 > svg{
  grid-column:1!important; grid-row:1 / 3!important; align-self:center!important;
  width:40px!important; height:40px!important; padding:10px!important; box-sizing:border-box!important;
  border-radius:11px!important; background:var(--red-tint)!important; color:var(--red)!important;
}
.adp-pa-modal-head > h3 > span{
  grid-column:2!important; grid-row:1!important; align-self:end!important;
  color:var(--navy)!important; font-size:18px!important; line-height:24px!important; font-weight:700!important;
}
.adp-pa-modal-head > .modal-sub{
  grid-column:2!important; grid-row:2!important; align-self:start!important;
  margin:0!important; font-size:14px!important; line-height:20px!important; min-width:0!important;
}
.pa-modal-thanh-cong .adp-pa-modal-head{
  display:flex!important; align-items:center!important; min-height:40px!important;
}
.pa-modal-thanh-cong .adp-pa-modal-head > h3{
  display:flex!important; align-items:center!important; gap:12px!important; margin:0!important;
}
.pa-modal-thanh-cong .adp-pa-modal-head > h3 > svg{ flex:0 0 40px!important; }
.pa-modal-thanh-cong .adp-pa-modal-head > h3 > span{ align-self:center!important; }
.pa-modal-thanh-cong #pa-modal-sub{ display:none!important; }
.pa-modal-thanh-cong .adp-pa-modal-head > #pa-modal-title > svg{
  background:var(--green-tint)!important; color:var(--green)!important;
}
/* P3-B4C — chốt semantic alignment sau toàn bộ rule lịch sử để class gắn trực
   tiếp trên cột luôn là authority, kể cả ở bảng đã có selector module riêng. */
table.data :is(.sem-text,.sem-id){text-align:left!important;}
table.data :is(.sem-select,.sem-order,.sem-status,.sem-action,.sem-short,.sem-period){text-align:center!important;}
table.data :is(.sem-number,.sem-money,.sem-ratio){text-align:right!important;font-variant-numeric:tabular-nums;}
table.data thead th:is(.sem-text,.sem-id) a{justify-content:flex-start!important;}
table.data thead th:is(.sem-select,.sem-order,.sem-status,.sem-action,.sem-short,.sem-period) a{justify-content:center!important;}
table.data thead th:is(.sem-number,.sem-money,.sem-ratio) a{justify-content:flex-end!important;}

/* ========================================================================== 
   P3-C0 RF03 — SH/NSH detail, result and debt-KPI parity (final authority)
   ========================================================================== */

/* Debt detail drawers share one frame and one information language. */
.debt-detail-drawer{
  width:480px;max-width:calc(100vw - 24px);height:100vh;height:100dvh;overflow-x:hidden;
}
.debt-detail-drawer .debt-detail-drawer-head{
  box-sizing:border-box;min-height:68px;padding:17px 20px;
}
.debt-detail-drawer .debt-detail-drawer-head b{
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:var(--navy);font-size:15px;font-weight:700;line-height:1.35;
}
.debt-detail-drawer .drawer-close{
  box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;
  flex:0 0 32px;width:32px;height:32px;padding:0;
}
.debt-detail-drawer .debt-detail-drawer-body{
  min-width:0;padding:18px 20px 24px;overflow-x:hidden;
}
.detail-section{margin:0;padding:0;min-width:0;}
.detail-section + .detail-section{
  margin-top:18px;padding-top:16px;border-top:1px solid var(--line-2);
}
.detail-section .detail-section-title{
  margin:0 0 9px;color:var(--navy);font-size:12px;font-weight:800;
  line-height:1.35;letter-spacing:.045em;text-transform:uppercase;
}
.detail-rows{font-size:13px;line-height:1.45;}
.detail-row{
  display:grid;grid-template-columns:minmax(126px,42%) minmax(0,1fr);
  align-items:start;column-gap:16px;padding:6px 0;
}
.detail-label{min-width:0;color:var(--text-muted);font-size:12.5px;font-weight:500;line-height:1.45;}
.detail-value{
  min-width:0;color:var(--text);font-size:12.5px;font-weight:600;line-height:1.45;
  text-align:right;overflow-wrap:anywhere;word-break:normal;
}
.detail-value .tt{vertical-align:middle;}
.detail-value code{display:inline-block;max-width:100%;white-space:normal;overflow-wrap:anywhere;}
.detail-business-value{font-family:var(--font);font-weight:600;}
.detail-business-value--wrap{
  display:block;max-width:100%;
  white-space:normal;overflow-wrap:anywhere;word-break:normal;
}
.detail-empty{margin:0;font-size:12.5px;line-height:1.5;}
.detail-section .ct-ls-item{margin-bottom:8px;}
.detail-section--management.nsh-detail-danger{margin-top:18px;padding-top:16px;border-top:1px solid var(--line-2);}
.detail-section--management.nsh-detail-danger .detail-section-title{margin:0 0 9px;}
.invoice-identity{max-width:100%;font-variant-numeric:tabular-nums;}

/* One result shell with four authoritative batch KPIs. */
.import-result-kpis{grid-template-columns:repeat(4,minmax(0,1fr));}
.import-result-kpis .kpi{box-sizing:border-box;min-height:92px;}
.import-result-status{
  display:flex;align-items:center;gap:9px;min-height:48px;box-sizing:border-box;
  padding:11px 18px;border-top:1px solid var(--line-2);background:var(--bg-soft);
  color:var(--text);font-size:12.5px;line-height:1.4;
}
.import-result-status-label{color:var(--text-muted);font-weight:600;}
.import-result-status strong{color:var(--navy);font-variant-numeric:tabular-nums;}
.import-result-status-badge{margin-left:auto;white-space:nowrap;}
.import-result-meta{padding:12px 18px 0;}
.import-result-actions{
  margin:14px 18px 18px;padding-top:14px;border-top:1px solid var(--line-2);
}
.import-result-actions .adp-action-button{
  box-sizing:border-box;height:40px;min-height:40px;padding:0 15px;border-radius:9px;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  font-size:13px;font-weight:700;
}
.import-result-actions .import-result-nav{
  background:var(--white);border-color:var(--line);color:var(--navy);
}
.import-result-actions .import-result-nav:hover{
  background:var(--bg-soft);border-color:var(--navy);color:var(--navy);
}

/* SH/NSH debt-page KPI strips: shared height, baselines, icon and spacing. */
.debt-kpi-strip{margin-bottom:16px;}
.debt-kpi-strip > .kpi{
  box-sizing:border-box;min-height:96px;padding:16px 18px;align-items:center;gap:13px;
}
.debt-kpi-strip .kpi-ic{width:44px;height:44px;flex:0 0 44px;}
.debt-kpi-strip .kpi-ic .ic,.debt-kpi-strip .kpi-ic svg{width:var(--icon-kpi)!important;height:var(--icon-kpi)!important;}
.debt-kpi-strip .kpi-txt{flex:1 1 auto;min-width:0;}
.debt-kpi-strip .kpi-nhan{min-height:17px;line-height:17px;margin:0 0 2px;}
.debt-kpi-strip .kpi-so{min-height:26px;line-height:26px;font-variant-numeric:tabular-nums;white-space:nowrap;}
.debt-kpi-strip .kpi-don{min-height:15px;line-height:15px;margin-top:2px;}

@media(max-width:1100px){
  .import-result-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
  .import-result-kpis > .kpi:last-child{grid-column:1 / -1;border-top:1px solid var(--line-2);}
  .debt-kpi-strip > .kpi{min-height:92px;}
}
@media(max-width:620px){
  .debt-detail-drawer{max-width:100vw;width:100vw;}
  .debt-detail-drawer .debt-detail-drawer-head{min-height:62px;padding:14px 16px;}
  .debt-detail-drawer .debt-detail-drawer-body{padding:15px 16px 22px;}
  .detail-row{grid-template-columns:1fr;row-gap:2px;padding:7px 0;}
  .detail-value{text-align:left;}
  .invoice-identity{white-space:normal!important;overflow-wrap:anywhere;}
  .import-result-kpis{grid-template-columns:1fr;}
  .import-result-kpis > .kpi:last-child{grid-column:auto;}
  .import-result-status{align-items:flex-start;flex-wrap:wrap;}
  .import-result-status-badge{margin-left:0;}
  .import-result-actions{align-items:stretch;}
  .import-result-actions .adp-action-button{width:100%;}
  .debt-kpi-strip > .kpi{min-height:84px;padding:13px 14px;}
}

/* ========================================================================== 
   P3-C0 POST-M27 detail disclosure implementation — shared contracts (v157)
   ========================================================================== */
.debt-detail-drawer .debt-detail-drawer-head b{
  display:flex;flex-direction:column;justify-content:center;gap:2px;
}
.detail-header-primary{
  display:block;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;color:var(--navy);font-size:15px;font-weight:750;line-height:1.25;
}
.detail-header-secondary{
  display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:var(--text-muted);font-size:11.5px;font-weight:600;line-height:1.25;
}
.detail-row--long{grid-template-columns:1fr;row-gap:4px;padding:8px 0;}
.detail-row--long .detail-value{text-align:left;font-weight:550;}
.detail-section--general .detail-row--long{align-items:start;}
.detail-section--general .detail-row--long .detail-label,
.detail-section--general .detail-row--long .detail-value{line-height:1.45;}
.detail-disclosure{
  margin:0;padding:0;border:0;min-width:0;
}
.debt-detail-drawer .detail-disclosure + .detail-disclosure{
  margin-top:12px;padding-top:12px;border-top:1px solid var(--line-2);
}
.detail-disclosure summary{
  display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;
  min-height:38px;box-sizing:border-box;padding:7px 9px;border-radius:8px;
  color:var(--navy);font-size:12px;font-weight:800;line-height:1.35;
  letter-spacing:.045em;text-transform:uppercase;list-style:none;transition:background .16s,color .16s;
}
.detail-disclosure summary::-webkit-details-marker{display:none;}
.detail-disclosure summary:hover,.detail-disclosure summary:focus-visible{background:var(--bg-soft);outline:none;}
.detail-disclosure[open] > summary{background:#EEF7F4;color:var(--teal);}
.detail-disclosure-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 22px;width:22px;height:22px;}
.detail-disclosure-icon svg{width:18px;height:18px;transition:transform .18s ease;transform:rotate(0deg);}
.detail-disclosure[open] > summary .detail-disclosure-icon svg{transform:rotate(180deg);}
.detail-disclosure-body{margin-top:7px;padding:0 9px 3px;}
.detail-management-subtitle{margin:10px 0 7px;color:var(--navy);font-size:12px;font-weight:750;line-height:1.4;}
.detail-management-subtitle:first-child{margin-top:0;}
.detail-section--management .lifecycle-management{margin-top:14px;padding-top:12px;border-top:1px dashed var(--line-2);}
.lifecycle-technical-fields{margin-top:7px;padding-top:5px;border-top:1px dashed var(--line-2);}
.lifecycle-technical-history .detail-value{word-break:break-all;}
.lifecycle-revision-summary .tt{
  padding:3px 8px;font-size:11.5px;font-weight:500;white-space:normal;line-height:1.4;opacity:.86;
}
.lifecycle-revision-summary .tt::before{width:5px;height:5px;}

.invoice-cell{min-width:0;max-width:100%;overflow:hidden;}
.invoice-stack{display:flex;flex-direction:column;min-width:0;max-width:100%;line-height:1.15;}
.invoice-number{
  display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:var(--text);font-size:12.5px;font-weight:600;font-variant-numeric:tabular-nums;
}
.invoice-symbol{
  display:block;min-width:0;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:var(--text-muted);font-size:11px;font-weight:500;letter-spacing:.01em;
}
.nsh-pv{table-layout:fixed;}
.nsh-pv .c-sohd{width:11%;}
.subject-identity{color:var(--navy);font-weight:700;letter-spacing:.005em;}
.sem-money b{font-weight:800;}

/* NSH main page is a debt register. Invoice identity/content remain searchable
   and available in Detail/import flows, while this production table reserves
   width for the same financial concepts as SH. */
/* HOST-ACCEPTANCE REVIEW-FIX 01 §12 — bảng NSH RESPONSIVE như SH (.data-theodoi):
   BỎ min-width:1490px và các width cột cố định bằng pixel (nguyên nhân tràn ngang
   ở cùng viewport mà SH vừa khít). Dùng phân bổ % cho 12 cột (tổng 100%),
   table-layout:fixed + width:100% → bảng vừa vùng nội dung, không đẩy trang ngang.
   Màn hẹp: .bang-scroll tự cuộn cục bộ (@media max-width:1000px). */
.data-nsh--debt-parity{table-layout:fixed;width:100%;}
.data-nsh--debt-parity col.c-stt{width:3.5%;}
.data-nsh--debt-parity col.c-toa{width:5%;}
.data-nsh--debt-parity col.c-mst{width:10%;}
.data-nsh--debt-parity col.nsh-col-ten{width:18%;}
.data-nsh--debt-parity col.c-tongtien{width:8%;}
.data-nsh--debt-parity col.c-nocu{width:7.5%;}
.data-nsh--debt-parity col.c-danop{width:7.5%;}
.data-nsh--debt-parity col.c-conno{width:8%;}
.data-nsh--debt-parity col.c-tiendu{width:7.5%;}
.data-nsh--debt-parity col.c-tt{width:calc(var(--adp-debt-status-width) + 20px);}
.data-nsh--debt-parity col.col-ghichu{width:10%;}
.data-nsh--debt-parity col.c-thaotac{width:6%;}
#nsh-vung .data-nsh--debt-parity thead th{width:auto!important;}
.payment-method-token{font-size:11px;padding:3px 8px;vertical-align:middle;}
@media(max-width:1000px){
  .data-nsh--debt-parity{min-width:1220px;}
}
.data-tm .td-tt{white-space:nowrap;text-align:center;}
.data-tm .td-tt .tt{min-width:118px;justify-content:flex-start;box-sizing:border-box;}
.tm-detail-drawer .ct-h{margin:0 0 10px;}
.tm-detail-action-card{margin-bottom:0;}
.tm-detail-action-top{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.tm-detail-action-top b{color:var(--navy);font-size:13px;white-space:nowrap;}
.tm-detail-action-meta{margin-top:7px;color:var(--text-muted);font-size:12px;line-height:1.45;}
.tm-detail-action-list{display:flex;flex-wrap:wrap;gap:8px;align-items:center;min-width:0;}
.tm-detail-action-list:not(:empty){margin-top:11px;padding-top:11px;border-top:1px solid var(--line-2);}
.tm-detail-action-list form{display:flex!important;max-width:100%;margin:0!important;}
.tm-detail-action-list .tm-btn-hoantac{
  box-sizing:border-box;width:auto!important;min-width:0!important;max-width:100%;height:36px;
  margin:0!important;padding:0 12px!important;gap:7px;line-height:1.2;white-space:nowrap;
  transform:none!important;
}
.tm-detail-action-list .tm-btn-hoantac svg,
.tm-detail-action-list .tm-btn-hoantac .ic{margin:0!important;flex:0 0 auto;}
.qt-threshold-config{margin-bottom:14px;overflow:hidden;}
.qt-threshold-summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px;background:var(--white);}
.qt-threshold-summary::-webkit-details-marker{display:none;}
.qt-threshold-summary>span:first-child{display:flex;align-items:baseline;gap:14px;min-width:0;}
.qt-threshold-summary b{font-size:16px;color:var(--text);}
.qt-threshold-summary-info>small{padding-left:14px;border-left:1px solid var(--line);color:var(--text-muted);font-weight:600;}
.qt-threshold-chevron{display:inline-flex;transition:transform .18s;color:var(--text-muted);}
.qt-threshold-config[open] .qt-threshold-chevron{transform:rotate(180deg);}
.qt-threshold-content{padding:16px 18px 18px;border-top:1px solid var(--line-2);}
.qt-threshold-form{display:grid;grid-template-columns:minmax(140px,160px) minmax(140px,160px) minmax(240px,420px) max-content;padding:0;gap:18px;align-items:start;}
.qt-threshold-form label{display:flex;flex-direction:column;gap:6px;font-weight:650;color:var(--navy);}
.qt-threshold-form label small{font-size:11px;color:var(--text-muted);font-weight:500;}
.qt-threshold-form input,.qt-threshold-form textarea{box-sizing:border-box;width:100%;border:1px solid var(--line);border-radius:9px;padding:9px 11px;font:inherit;color:var(--text);background:var(--white);}
.qt-threshold-form input{height:40px;font-weight:400;}
.qt-threshold-form .ui-reason-textarea{font-weight:400!important;}
.qt-threshold-form .qt-threshold-reason-control{height:40px!important;min-height:40px!important;max-height:40px!important;resize:none!important;overflow-y:auto!important;padding-top:9px!important;padding-bottom:9px!important;}
.qt-threshold-reason{width:100%;min-width:0;}
.qt-threshold-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;padding-top:28px;white-space:nowrap;}
.qt-threshold-actions .btn{min-height:40px;}
.qt-threshold-unsaved{color:var(--orange-dark);font-size:12.5px;font-weight:700;}
.qt-threshold-history{margin-top:18px;padding-top:16px;border-top:1px solid var(--line-2);}
.qt-threshold-history h3{margin:0 0 10px;color:var(--navy);font-size:15px;}
.qt-threshold-history ol{list-style:none;margin:0;padding:0;display:grid;gap:7px;}
.qt-threshold-history li{display:grid;grid-template-columns:minmax(145px,.8fr) minmax(220px,1fr) minmax(240px,1.4fr);align-items:start;gap:8px 16px;padding:10px 12px;border:1px solid var(--line-2);border-radius:8px;background:var(--bg-soft);font-size:12.5px;}
.qt-threshold-history li[hidden],.qt-threshold-history-more[hidden]{display:none;}
.qt-threshold-history-meta{display:flex;flex-direction:column;gap:3px;}.qt-threshold-history time{color:var(--text-muted);}.qt-threshold-history b{color:var(--navy);}
.qt-threshold-history-values{display:grid;gap:4px;}.qt-threshold-history-values>span{display:flex;align-items:baseline;gap:7px;}.qt-threshold-history-values small{width:30px;color:var(--text-muted);font-size:12.5px;line-height:1.5;font-weight:600;}
.qt-threshold-history-reason{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:baseline;gap:7px;color:var(--text);}.qt-threshold-history-reason>small{color:var(--text-muted);font-size:12.5px;line-height:1.5;font-weight:600;}.qt-threshold-history-reason>span{max-height:3em;overflow-y:auto;overflow-wrap:anywhere;font-size:12.5px;font-weight:400;line-height:1.5;}
.qt-threshold-history-more{min-height:34px;margin-top:10px;padding:0 12px;}
@media(max-width:1050px){.qt-threshold-form{grid-template-columns:repeat(2,minmax(140px,160px)) minmax(240px,1fr)}.qt-threshold-actions{grid-column:1/-1;padding-top:0;justify-content:flex-start}}
@media(max-width:900px){.qt-threshold-history li{grid-template-columns:minmax(140px,.7fr) minmax(220px,1fr)}.qt-threshold-history-reason{grid-column:1/-1}}
@media(max-width:700px){.qt-threshold-summary>span:first-child{align-items:flex-start;flex-direction:column;gap:4px}.qt-threshold-summary-info>small{padding-left:0;border-left:0}.qt-threshold-form{grid-template-columns:repeat(2,minmax(0,1fr))}.qt-threshold-reason{grid-column:1/-1}.qt-threshold-actions{align-items:flex-start;flex-direction:column}}
@media(max-width:420px){.qt-threshold-form{grid-template-columns:minmax(0,1fr)}.qt-threshold-reason,.qt-threshold-actions{grid-column:auto}.qt-threshold-history li{grid-template-columns:minmax(0,1fr)}.qt-threshold-history-reason{grid-column:auto}}

/* Refund list: one desktop title/filter/export row; topbar is the only visible search. */
.ht-list-toolbar{margin:0;flex-wrap:nowrap;justify-content:flex-start;}
.ht-list-toolbar>h2{flex:0 0 auto;white-space:nowrap;}
.ht-toolbar-divider{width:1px;height:var(--toolbar-divider-h);flex:0 0 1px;background:var(--line);}
.ht-list-toolbar>select{flex:0 0 auto;}
.ht-list-toolbar .ht-toolbar-export{margin-left:auto;flex:0 0 auto;white-space:nowrap;}
@media(max-width:760px){
  .ht-list-toolbar{flex-wrap:wrap;}
  .ht-list-toolbar .ht-toolbar-export{margin-left:0;}
  .ht-toolbar-divider{display:none;}
}
.data-nsh--debt-parity .nsh-col-ten{white-space:normal;line-height:1.4;word-break:break-word;}
.data-nsh--debt-parity .nsh-mst{white-space:normal;overflow-wrap:anywhere;line-height:1.35;}
.data-nsh--debt-parity .c-tongtien,
.data-nsh--debt-parity .c-nocu,
.data-nsh--debt-parity .c-danop,
.data-nsh--debt-parity .c-conno,
.data-nsh--debt-parity .c-tiendu{text-align:right;white-space:nowrap;}

.confirmation-summary{margin:6px 0 2px;}
.confirmation-row{background:var(--white);}
.confirmation-row:hover{background:var(--white)!important;}
.confirmation-row>td:first-child{border-left:0!important;}

/* ========================================================================== 
   M32 — Tra cứu QR & hóa đơn (SH-only, read/download-only)
   ========================================================================== */
.tracuuqr-head{align-items:center;gap:18px;margin-bottom:0;}
/* One stable desktop 50/50 contract for every state. Empty/error keeps the
   second grid track visually empty (no fake card); result content later occupies
   that same track, so the left card has no horizontal width jump. */
.tracuuqr-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:18px;}
/* Result state explicitly retains the same balanced half/half contract. */
.tracuuqr-workspace--result{grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
/* HC-03: while cash QR content is collapsed, the natural left card defines the
   row and both peer panels share one outer height. Once a cash QR is expanded,
   the right panel grows with its content while the left returns to natural height. */
.tracuuqr-workspace--paid{align-items:stretch;}
.tracuuqr-workspace--paid.tracuuqr-workspace--cash-expanded{align-items:start;}
.tracuuqr-workspace--paid.tracuuqr-workspace--cash-expanded .tracuuqr-operations{align-self:start;}
.tracuuqr-operations{min-width:0;overflow:hidden;padding:0;}
.tracuuqr-search{padding:16px;}
.tracuuqr-section-heading{display:flex;align-items:center;gap:11px;}
/* Headings use the factual ADP logo navy (#0A005E), not the generic app navy. */
.tracuuqr-section-heading h2{margin:0;color:#0A005E;font-size:16px;line-height:1.35;}
.tracuuqr-step{display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px;width:34px;height:34px;border-radius:10px;background:#FFF0E6;color:var(--orange-dark);font-size:12px;font-weight:800;letter-spacing:.04em;}
.tracuuqr-search-form{display:grid;grid-template-columns:max-content minmax(150px,1fr) auto;align-items:center;gap:10px;margin-top:14px;}
.tracuuqr-search-form label{font-size:12.5px;font-weight:600;color:var(--text-muted);white-space:nowrap;}
.tracuuqr-search-form input{box-sizing:border-box;height:36px;min-width:0;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--text);font-size:12.5px;text-transform:uppercase;transition:border-color .15s,box-shadow .15s;}
.tracuuqr-search-form input::placeholder{text-transform:none;}
.tracuuqr-search-form input:focus{outline:none;border-color:var(--orange);box-shadow:0 0 0 3px var(--orange-tint);}
.tracuuqr-search-form .btn{height:36px;min-height:36px;padding-inline:14px;border-radius:8px;font-size:12.5px;}
.tracuuqr-empty,.tracuuqr-message{display:flex;align-items:center;gap:11px;padding:16px;border-top:1px solid var(--line);color:var(--text-muted);background:#FAFBFD;}
.tracuuqr-message>svg{width:28px;height:28px;flex:0 0 28px;color:var(--orange);}
/* Empty state reads as a quiet status line, not a heading. */
.tracuuqr-empty>svg{width:18px;height:18px;flex:0 0 18px;color:var(--text-muted);}
.tracuuqr-empty b{display:inline;color:var(--text-muted);font-size:13px;font-weight:500;}
.tracuuqr-message--error{border-color:#F1C7C7;background:#FFF8F8;color:#B91C1C;}
.tracuuqr-message--error>svg{color:#DC2626;}
.tracuuqr-summary{padding:16px;border-top:1px solid var(--line);}
.tracuuqr-status{display:inline-flex;margin:14px 0 10px;}
.tracuuqr-meta{display:grid;margin:0;border:1px solid #E4E8EF;border-radius:12px;background:#FAFBFD;overflow:hidden;}
.tracuuqr-meta>div{display:grid;grid-template-columns:112px minmax(0,1fr);align-items:center;gap:10px;padding:11px 14px;border-bottom:1px solid #E7EAF0;}
.tracuuqr-meta>div:last-child{border-bottom:0;}
.tracuuqr-meta dt{color:var(--text-muted);font-size:12px;font-weight:600;}
.tracuuqr-meta dd{margin:0;color:var(--text);font-size:14px;font-weight:500;overflow-wrap:anywhere;}
.tracuuqr-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px;}
.tracuuqr-actions .tracuuqr-btn-pdf:only-child{grid-column:1/-1;width:calc((100% - 10px)/2);justify-self:center;}
.tracuuqr-actions .btn,.tracuuqr-cash-card .btn{display:inline-flex;align-items:center;justify-content:center;height:36px;min-height:36px;padding:0 14px;border:1px solid transparent;border-radius:8px;font-size:12.5px;font-weight:700;box-shadow:none;transform:none!important;transition:background .14s,border-color .14s,color .14s,box-shadow .14s;}
.tracuuqr-actions .btn:hover,.tracuuqr-cash-card .btn:hover{box-shadow:0 4px 12px rgba(16,24,40,.13)!important;}
.tracuuqr-actions .btn:active,.tracuuqr-cash-card .btn:active{box-shadow:0 2px 6px rgba(16,24,40,.11)!important;}
.tracuuqr-btn-qr{border-color:#2563EB!important;color:#fff!important;background:#2563EB!important;}
.tracuuqr-btn-qr:hover{border-color:#1D4ED8!important;background:#1D4ED8!important;color:#fff!important;}
.tracuuqr-btn-qr:active{border-color:#1E40AF!important;background:#1E40AF!important;color:#fff!important;}
.tracuuqr-btn-qr:focus-visible{outline:2px solid #2563EB!important;outline-offset:2px!important;}
.tracuuqr-btn-pdf{border-color:#16A34A!important;color:#fff!important;background:#16A34A!important;}
.tracuuqr-btn-pdf:hover{border-color:#15803D!important;background:#15803D!important;color:#fff!important;}
.tracuuqr-btn-pdf:active{border-color:#166534!important;background:#166534!important;color:#fff!important;}
.tracuuqr-btn-pdf:focus-visible{outline:2px solid #16A34A!important;outline-offset:2px!important;}
.tracuuqr-pdf-missing{display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 12px;border:1px dashed #CDD3DE;border-radius:9px;background:#F7F8FA;color:var(--text-muted);font-size:13px;font-weight:650;}
.tracuuqr-pdf-missing svg{width:18px;height:18px;}
/* Peer outer panel: same 1px gray frame, radius and separation as the left .card.
   This is deliberately separate from the borderless inner preview stage. */
.tracuuqr-preview-panel{min-width:0;height:auto;padding:16px;background:#fff;border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow-card);}
.tracuuqr-preview-head{display:flex;align-items:flex-start;gap:18px;margin-bottom:16px;}
.tracuuqr-preview-head h2{color:var(--text);font-size:19px;}
/* The payment card is a self-contained designed artifact (its own white card on a
   light ground). The web preview therefore shows it on ONE neutral panel surface
   with no extra stage border, image border or drop shadow — no nested frames. */
.tracuuqr-preview{margin:0;text-align:center;}
.tracuuqr-preview-stage{display:flex;justify-content:center;padding:0;border:0;border-radius:0;background:transparent;}
/* HC-02: the frame is now baked into the PNG, so no CSS image border. Web preview
   keeps rounded corners via border-radius; the downloaded PNG has square corners. */
.tracuuqr-preview img{display:block;width:min(100%,440px);height:auto;margin:0 auto;border:0;border-radius:14px;background:transparent;box-shadow:none;}
.tracuuqr-preview-panel--paid{display:flex;flex-direction:column;background:#fff;align-self:stretch;}
/* Paid emblem — a finished, centred completion badge with a larger ringed check.
   Centred in the true right-card content box (inside padding); one clean pill. */
.tracuuqr-paid-state{display:flex;flex:1 1 auto;min-height:180px;align-items:center;justify-content:center;padding:8px;background:transparent;text-align:center;}
/* HOST-CORRECTION-01: paid badge made more compact so it no longer dominates the
   right column — same centred, ringed green identity, smaller footprint. */
.tracuuqr-paid-emblem{display:inline-flex;max-width:100%;align-items:center;justify-content:center;gap:13px;padding:11px 22px 11px 13px;border:1px solid #A7E0B8;border-radius:999px;background:linear-gradient(135deg,#EAFBF0 0%,#FFFFFF 100%);color:#15803D;font-size:20px;font-weight:800;line-height:1.15;box-shadow:0 8px 20px rgba(21,128,61,.10);}
.tracuuqr-paid-mark{display:inline-flex;align-items:center;justify-content:center;flex:0 0 60px;width:60px;height:60px;border:2px solid #34C759;border-radius:50%;background:#E9F9EF;color:#15803D;box-shadow:0 0 0 6px rgba(52,199,89,.09);}
.tracuuqr-paid-mark svg{width:32px;height:32px;stroke-width:3;}
/* Paid + pending-cash: ONE card, TWO balanced internal regions. Each region takes
   an equal share and centres its own block — paid emblem in the top region, cash
   block in the lower region — separated by a simple divider. */
/* Paid + pending-cash: paid emblem sits in a natural-height top region; the cash
   region takes the remaining space and centres its block. The cash region grows
   with its own content (content-sized, never a fixed equal share), so expanding
   the cash QR reflows and grows the card instead of overlapping the paid region. */
.tracuuqr-preview-panel--with-cash .tracuuqr-paid-state{flex:0 0 auto;min-height:150px;padding:16px 8px;}
.tracuuqr-cash{display:flex;flex:1 1 auto;min-height:0;justify-content:center;flex-direction:column;margin-top:0;padding:18px 6px 6px;border:0;border-top:1px solid #E0E5ED;border-radius:0;background:transparent;}
.tracuuqr-cash h2{margin:0 0 14px;color:#0A005E;font-size:17px;}
.tracuuqr-cash-toggle,.tracuuqr-cash-list>label{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:12px 14px;border:1px solid #DDE3EC;border-radius:10px;background:#FAFBFD;cursor:pointer;}
.tracuuqr-cash-toggle input,.tracuuqr-cash-list input{width:18px;height:18px;accent-color:var(--orange);}
.tracuuqr-cash-toggle span,.tracuuqr-cash-list span{display:grid;gap:2px;color:var(--text);font-size:13px;}
.tracuuqr-cash-toggle strong,.tracuuqr-cash-list strong{font-weight:700;}
.tracuuqr-cash-toggle small,.tracuuqr-cash-list small{color:var(--text-muted);font-size:12px;font-weight:500;}
.tracuuqr-cash-toggle b,.tracuuqr-cash-list b{color:var(--orange-dark);white-space:nowrap;}
.tracuuqr-cash-list{display:grid;gap:8px;margin:0;padding:0;border:0;}
.tracuuqr-cash-list legend{margin-bottom:9px;color:var(--navy);font-size:13px;font-weight:700;}
.tracuuqr-cash-card{padding-top:16px;text-align:center;}
.tracuuqr-cash-card[hidden]{display:none;}
.tracuuqr-cash-card img{display:block;width:min(100%,440px);height:auto;margin:0 auto;border:0;border-radius:14px;box-shadow:none;}
.tracuuqr-cash-card .btn{min-width:220px;margin-top:12px;}

/* Refund carryover — the three state actions use the same outline→fill
   component; only these semantic variables differ. Popup state is tagged by
   hoantien.php so shared warnings elsewhere are not recolored. */
#adp-xacnhan .gn-xacnhan-hop[data-refund-state]{--refund-state:#2563EB;--refund-border:#2563EB;--refund-hover:#EFF6FF;--refund-active-bg:#DBEAFE;--refund-active:#1D4ED8;--refund-tint:#EFF6FF;--refund-ring:rgba(37,99,235,.34);--refund-shadow:rgba(37,99,235,.14);}
#adp-xacnhan .gn-xacnhan-hop[data-refund-state="unknown"]{--refund-state:#7C3AED;--refund-border:#8B5CF6;--refund-hover:#F5F3FF;--refund-active-bg:#EDE9FE;--refund-active:#6D28D9;--refund-tint:#F5F3FF;--refund-ring:rgba(124,58,237,.38);--refund-shadow:rgba(124,58,237,.14);}
#adp-xacnhan .gn-xacnhan-hop[data-refund-state="waiting"]{--refund-state:#EA580C;--refund-border:#F97316;--refund-hover:#FFF7ED;--refund-active-bg:#FFEDD5;--refund-active:#C2410C;--refund-tint:#FFF7ED;--refund-ring:rgba(234,88,12,.34);--refund-shadow:rgba(234,88,12,.14);}
#adp-xacnhan .gn-xacnhan-hop[data-refund-state] .gn-xacnhan-ic{background:var(--refund-tint)!important;color:var(--refund-state)!important;}
#adp-xacnhan .gn-xacnhan-hop[data-refund-state] #adp-xn-dongy{height:40px!important;min-height:40px!important;padding:0 16px!important;border:1px solid var(--refund-border)!important;border-radius:10px!important;background:#fff!important;color:var(--refund-state)!important;font-weight:700!important;box-shadow:none!important;transform:none!important;transition:background .14s,border-color .14s,color .14s,box-shadow .14s!important;}
#adp-xacnhan .gn-xacnhan-hop[data-refund-state] #adp-xn-dongy:hover{border-color:var(--refund-border)!important;background:var(--refund-hover)!important;color:var(--refund-active)!important;box-shadow:0 2px 8px var(--refund-shadow)!important;}
#adp-xacnhan .gn-xacnhan-hop[data-refund-state] #adp-xn-dongy:active{border-color:var(--refund-state)!important;background:var(--refund-active-bg)!important;color:var(--refund-active)!important;box-shadow:none!important;}
#adp-xacnhan .gn-xacnhan-hop[data-refund-state] #adp-xn-dongy:focus-visible{outline:2px solid var(--refund-ring)!important;outline-offset:2px!important;}

/* C3 RF02: keep the workspace single-column until the unchanged three-part
   lookup form has stable room in each desktop column. */
@media(max-width:1200px){
  .tracuuqr-workspace{grid-template-columns:1fr;max-width:640px;margin-inline:auto;}
  .tracuuqr-preview-panel{grid-row:auto;}
  .tracuuqr-preview img{width:min(100%,440px);}
}
/* C3 mobile-full presentation remains limited to phone/tablet widths. */
@media(max-width:900px){
  .tracuuqr-workspace{grid-template-columns:1fr;width:calc(100vw - 32px);max-width:640px;margin-inline:auto;}
  .tracuuqr-workspace>.card{margin-bottom:0;}
  .tracuuqr-preview-panel{grid-row:auto;}
  .tracuuqr-preview img{width:min(100%,440px);}
  .tracuuqr-search-form input,
  .tracuuqr-search-form .btn{height:44px;min-height:44px;}
  .tracuuqr-actions .btn,
  .tracuuqr-cash-card .btn{height:auto;min-height:44px;padding-block:8px;line-height:1.3;white-space:normal;}
  .tracuuqr-cash-toggle,
  .tracuuqr-cash-list>label{box-sizing:border-box;min-height:44px;}
  .tracuuqr-cash-toggle:focus-within,
  .tracuuqr-cash-list>label:focus-within{outline:2px solid var(--orange);outline-offset:2px;}
  .tracuuqr-message span,
  .tracuuqr-section-heading h2,
  .tracuuqr-cash-toggle span,
  .tracuuqr-cash-list span{min-width:0;overflow-wrap:anywhere;}
  .tracuuqr-preview-panel,
  .tracuuqr-preview-stage,
  .tracuuqr-cash-card{min-width:0;max-width:100%;}
  .tracuuqr-cash-card .btn{width:min(100%,220px);min-width:0;}
  .tracuuqr-workspace--paid{align-items:start;}
  .tracuuqr-preview-panel--paid{align-self:auto;}
}
@media(max-width:800px){
  .tracuuqr-head{align-items:flex-start;flex-direction:column;}
  .tracuuqr-preview-head{flex-direction:column;}
}
@media(max-width:560px){
  .tracuuqr-workspace{gap:14px;}
  .tracuuqr-search,.tracuuqr-summary,.tracuuqr-preview-panel{padding:14px;}
  .tracuuqr-cash{padding:16px 0 0;}
  .tracuuqr-search-form{grid-template-columns:1fr;}
  .tracuuqr-search-form .btn{width:100%;}
  .tracuuqr-actions{grid-template-columns:1fr;gap:8px;margin-top:10px;}
  .tracuuqr-actions .tracuuqr-btn-pdf:only-child{width:100%;}
  .tracuuqr-preview-stage{padding:0;border-radius:12px;}
  .tracuuqr-preview img{border-radius:11px;}
  .tracuuqr-paid-state{min-height:0;padding:18px 8px;}
  .tracuuqr-paid-emblem{gap:12px;padding:11px 18px 11px 12px;font-size:20px;}
  .tracuuqr-paid-mark{flex-basis:58px;width:58px;height:58px;}
  .tracuuqr-cash-toggle,.tracuuqr-cash-list>label{grid-template-columns:auto 1fr;}
  .tracuuqr-cash-toggle b,.tracuuqr-cash-list b{grid-column:2;}
}
@media(max-width:430px){
  .tracuuqr-meta>div{grid-template-columns:1fr;gap:4px;padding:10px 12px;}
  .tracuuqr-paid-emblem{gap:10px;padding:9px 14px 9px 10px;font-size:18px;}
  .tracuuqr-paid-mark{flex-basis:48px;width:48px;height:48px;box-shadow:0 0 0 4px rgba(52,199,89,.09);}
  .tracuuqr-paid-mark svg{width:27px;height:27px;}
}

.import-result-head{align-items:flex-start;}
.import-result-heading{min-width:0;flex:1 1 auto;}
.import-result-header-meta{
  display:inline-flex;align-items:center;gap:7px;flex-wrap:wrap;width:fit-content;margin-top:9px;
  padding:4px 5px 4px 9px;border:1px solid var(--line-2);border-radius:10px;background:var(--bg-soft);
  color:var(--text-muted);font-size:12.5px;line-height:1.4;
}
.import-result-header-meta strong{color:var(--navy);font-variant-numeric:tabular-nums;padding-right:7px;border-right:1px solid var(--line);}
.import-result-header-meta .import-result-status-badge{margin-left:0;}
.import-result-kpis{grid-template-columns:repeat(4,minmax(0,1fr));}
.import-result-kpis .kpi{box-sizing:border-box;display:grid;grid-template-columns:42px minmax(0,1fr);grid-template-rows:17px 28px 15px;align-content:center;align-items:center;column-gap:13px;row-gap:2px;min-height:92px;padding:14px 18px;}
.import-result-kpis .kpi-ic{grid-column:1;grid-row:2;width:42px;height:42px;align-self:center;}
.import-result-kpis .kpi-txt{display:contents;min-height:0;}
.import-result-kpis .kpi-nhan{grid-column:2;grid-row:1;min-width:0;margin:0;font-size:11px;line-height:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.import-result-kpis .kpi-so{grid-column:2;grid-row:2;display:flex;align-items:center;min-width:0;height:28px;font-size:22px;font-weight:800;line-height:28px;font-variant-numeric:tabular-nums;white-space:nowrap;}
.import-result-kpis .kpi-don{grid-column:2;grid-row:3;min-width:0;height:15px;margin:0;color:var(--text-muted);font-size:11px;line-height:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.import-result-kpis .kpi:nth-child(1) .kpi-so{color:var(--green);}
.import-result-kpis .kpi:nth-child(2) .kpi-so{color:var(--orange-dark);}
.import-result-kpis .kpi:nth-child(3) .kpi-so{color:var(--red);}
.import-result-kpis .kpi:nth-child(4) .kpi-so{color:var(--blue);}
.import-result-safety{margin-bottom:0;}
.import-result-batch-meta{padding-top:7px;margin-bottom:0;}

.nsh-detail-delete:disabled,.nsh-detail-delete[aria-disabled="true"]{
  opacity:.45!important;filter:saturate(.35);cursor:not-allowed!important;box-shadow:none!important;
}
.nsh-detail-delete:disabled:hover{transform:none!important;background:var(--red)!important;}
.nsh-detail-delete-reason{margin:8px 0 0;color:var(--text-muted);font-size:12px;line-height:1.45;}

@media(max-width:1100px){
  .import-result-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
  .import-result-kpis > .kpi:last-child{grid-column:auto;}
}
@media(max-width:620px){
  .detail-header-primary{font-size:14px;}
  .detail-row--long{row-gap:3px;}
  .invoice-number{font-size:12px;}
  .invoice-symbol{font-size:10.5px;}
  .import-result-kpis{grid-template-columns:1fr;}
}

/* RF09 Cash host polish: retain the established status geometry/colors while
   giving the longest label balanced inline breathing room. */
.data-tm .td-tt .tt{min-width:126px;padding-left:10px;padding-right:10px;}

/* The locked hint and its active navigation are one action pair. They share a
   row and control height when space permits, and wrap safely in narrow drawers. */
.data-tm .tm-thaotac-khoa,
.tm-detail-action-list .tm-thaotac-khoa{
  display:inline-flex;flex-direction:row;align-items:center;gap:6px;flex-wrap:wrap;
  max-width:100%;line-height:1;
}
.data-tm .tm-thaotac-khoa .btn,
.tm-detail-action-list .tm-thaotac-khoa .btn{
  box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;
  width:auto;min-width:0;height:32px;padding:0 9px;font-size:11px;gap:4px;white-space:nowrap;
}

/* ==========================================================================
   P3-C0 M33 — Admin security presentation/refresh + Refund typography only
   ========================================================================== */
/* Drawer security history keeps its own responsive column layout. */
.qt-security-table{font-size:var(--bang-chu);}
.qt-security-table .sem-order{width:54px;}
.qt-security-recent .bang-dau h2{color:var(--text);}
.qt-security-recent{margin-top:12px;}
.qt-security-history-table{table-layout:fixed;}
.qt-security-history-table th:nth-child(1){width:6%;}
.qt-security-history-table th:nth-child(2){width:15%;}
.qt-security-history-table th:nth-child(3){width:13%;}
.qt-security-history-table th:nth-child(4){width:18%;}
.qt-security-history-table th:nth-child(5){width:13%;}
.qt-security-history-table th:nth-child(6){width:21%;}
.qt-security-history-table th:nth-child(7){width:14%;}
.qt-security-history-table :is(th,td):nth-child(3),
.qt-security-history-table :is(th,td):nth-child(4),
.qt-security-history-table :is(th,td):nth-child(6),
.qt-security-history-table :is(th,td):nth-child(7){white-space:normal;overflow-wrap:anywhere;}
.qt-security-drawer .bang-scroll{overflow-x:visible;}
.qt-security-drawer .qt-security-history-table thead th{position:sticky;top:0;}
.qt-security-drawer .detail-section-title{margin-bottom:var(--qt-security-space);}
.qt-security-drawer .detail-section + .detail-section{margin-top:var(--qt-security-space);padding-top:var(--qt-security-space);}
.qt-security-drawer #qt-security-history{margin-top:0;padding-top:var(--qt-security-history-space);}
.qt-security-drawer #qt-security-history>.detail-section-title{margin-bottom:var(--qt-security-history-space);}
.qt-security-drawer .qt-security-subhead .detail-section-title{margin:0;}
.qt-security-drawer .detail-section.qt-security-focus{border-radius:8px;box-shadow:0 0 0 3px rgba(37,99,235,.16);transition:box-shadow .2s;}

.data-qtuser{--qt-account-status-w:124px;--qt-account-status-child-h:24px;--qt-account-status-child-line:12px;--qt-account-status-tree-indent:10px;--qt-account-status-tree-line:#D0D5DD;}
.qt-account-status-stack{box-sizing:border-box;display:inline-flex;flex-direction:column;align-items:flex-start;gap:4px;width:calc(var(--qt-account-status-w) + var(--qt-account-status-tree-indent));max-width:100%;}
.qt-account-status-main{box-sizing:border-box;display:flex;width:var(--qt-account-status-w);min-width:var(--qt-account-status-w);align-items:center;justify-content:center;margin:0;font-weight:700;}
.qt-account-status-children{position:relative;display:grid;grid-auto-flow:row;grid-auto-rows:var(--qt-account-status-child-h);align-items:stretch;gap:4px;width:var(--qt-account-status-w);margin-left:var(--qt-account-status-tree-indent);}
.qt-account-status-children::before{content:"";position:absolute;left:calc(-1 * var(--qt-account-status-tree-indent));top:-4px;bottom:calc(var(--qt-account-status-child-h) / 2);border-left:1px solid var(--qt-account-status-tree-line);}
.qt-account-status-child{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--qt-account-status-w);min-width:var(--qt-account-status-w);max-width:var(--qt-account-status-w);height:var(--qt-account-status-child-h);min-height:var(--qt-account-status-child-h);max-height:var(--qt-account-status-child-h);margin:0;padding-block:0;padding-inline:7px;border:0;border-radius:7px;font-size:10px;font-weight:600;line-height:var(--qt-account-status-child-line);white-space:nowrap;opacity:1;transform:none;}
.qt-account-status-child::after{content:"";position:absolute;left:calc(-1 * var(--qt-account-status-tree-indent));top:50%;width:var(--qt-account-status-tree-indent);border-top:1px solid var(--qt-account-status-tree-line);}
.qt-account-status-child::before{width:6px;min-width:6px;height:6px;flex:0 0 6px;align-self:center;}
.qt-account-status-child.tt-do{background:rgba(220,38,38,.09);}
.qt-account-status-child.tt-indigo{background:rgba(37,99,235,.09);}
.qt-role-chip{box-sizing:border-box;justify-content:center;min-width:88px;}

/* Refund KPI values share one three-row text model: label, primary value and
   reserved optional meta. Centering the common grid aligns every value with
   the icon without per-card offsets. */
.refund-kpi-strip .kpi-txt{display:grid;grid-template-rows:17px 26px 17px;align-items:center;}
.refund-kpi-strip .kpi-nhan,
.refund-kpi-strip .kpi-so,
.refund-kpi-strip .kpi-don{box-sizing:border-box;min-height:0;margin:0;align-self:center;}
.refund-kpi-strip .kpi-nhan{height:17px;line-height:17px;}
.refund-kpi-strip .kpi-so{height:26px;line-height:26px;}
.refund-kpi-strip .kpi-don{height:15px;line-height:15px;}

.data-qtuser th:nth-child(1){width:5%;}.data-qtuser th:nth-child(2){width:11%;}
.data-qtuser th:nth-child(3){width:11%;}.data-qtuser th:nth-child(4){width:9%;}
.data-qtuser th:nth-child(5){width:15%;}.data-qtuser th:nth-child(6){width:11%;}
.data-qtuser th:nth-child(7){width:13%;}.data-qtuser th:nth-child(8){width:12%;}
.data-qtuser th:nth-child(9){width:13%;}
.data-qtuser .qt-lichsu,.data-qtuser .qt-thaotac{width:auto;text-align:center;}
.data-qtuser td:nth-child(8),.data-qtuser td:nth-child(9){overflow:visible;}
.data-qtuser .qt-lichsu .db-nut-i{margin:0 auto;}
.data-qtuser tbody td{vertical-align:middle;}

.qt-security-clear{
  box-sizing:border-box;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  height:var(--qt-security-control-h)!important;min-height:var(--qt-security-control-h)!important;padding:0 10px!important;
  border-radius:7px!important;background:var(--white)!important;font-size:12px!important;font-weight:650!important;line-height:1!important;
  box-shadow:none!important;transform:none!important;
  transition:background .14s,border-color .14s,color .14s!important;
}
.qt-security-clear-all{border:1px solid #D97706!important;color:#B54708!important;}
.qt-security-clear-one,.qt-security-clear-ip{border:1px solid #2563EB!important;color:#1D4ED8!important;}
.qt-security-clear-all:hover:not(:disabled),.qt-security-clear-all:active:not(:disabled),.qt-security-clear-all:focus-visible{
  border-color:#D97706!important;background:#D97706!important;color:#fff!important;box-shadow:none!important;transform:none!important;
}
.qt-security-clear-one:hover:not(:disabled),.qt-security-clear-one:active:not(:disabled),.qt-security-clear-one:focus-visible,
.qt-security-clear-ip:hover:not(:disabled),.qt-security-clear-ip:active:not(:disabled),.qt-security-clear-ip:focus-visible{border-color:#2563EB!important;background:#2563EB!important;color:#fff!important;box-shadow:none!important;transform:none!important;}
.qt-security-clear:focus-visible{outline-offset:2px!important;}
.qt-security-clear-all:focus-visible{outline:2px solid rgba(217,119,6,.42)!important;}
.qt-security-clear-one:focus-visible,.qt-security-clear-ip:focus-visible{outline:2px solid rgba(37,99,235,.42)!important;}

/* Refund list hierarchy: only money, customer identifier, recipient and the
   existing status badge retain emphasis; source IDs and secondary lines do not. */
.page-hoantien .ht-list tbody td{font-weight:400;}
.page-hoantien .ht-list .ht-id{color:var(--text);font-weight:500;}
.page-hoantien .ht-list .ht-list-primary,
.page-hoantien .ht-list .ht-list-amount{color:var(--text);font-weight:500;}
.page-hoantien .ht-list .muted,
.page-hoantien .ht-list .ht-transfer-line{font-weight:400;}
.page-hoantien .ht-list table.data{table-layout:fixed;}
.page-hoantien .ht-list th:nth-child(1){width:5%;}.page-hoantien .ht-list th:nth-child(2){width:15%;}
.page-hoantien .ht-list th:nth-child(3){width:11%;}.page-hoantien .ht-list th:nth-child(4){width:15%;}
.page-hoantien .ht-list th:nth-child(5){width:31%;}.page-hoantien .ht-list th:nth-child(6){width:15%;}
.page-hoantien .ht-list th:nth-child(7){width:8%;}

@media(max-width:900px){
  .qt-security-drawer .bang-scroll{overflow-x:auto;}
  .qt-security-history-table{min-width:980px;}
}

/* ============================================================================
   SYSTEM-WIDE-UI-MOBILE-FOUNDATION-B-01 / B-02
   Additive/opt-in responsive table-to-card foundation. A table participates
   only with `.adp-responsive-cards`; labels come from explicit `data-label`
   metadata, never from broad sem-* categories. B-02 adds Hoàn tiền adoption.
   ========================================================================== */
.adp-responsive-cards .adp-card-sort-title{
  position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0;
}
.tc-mobile-search,.ht-mobile-search{display:none;}
.ht-sort-control{display:contents;}
.ht-sort-control > label{display:none;}
.ht-refund-readonly{display:none;}

@media(max-width:900px){
  /* Locked mobile-shell UI exception: hide only explicitly hooked Excel/list
     exports. Backend export authority and non-Excel actions stay unchanged. */
  .adp-control-excel{display:none!important;}

  /* B-03 mobile-read policy: the Hoàn tiền drawer remains a readable detail
     surface while every mutation form/action is absent from layout and focus. */
  .page-hoantien #ht-drawer .ht-refund-form,
  .page-hoantien #ht-drawer .detail-section--workflow,
  .page-hoantien #ht-drawer .detail-section--complete{display:none!important;}
  .page-hoantien #ht-drawer .ht-refund-readonly{display:block;}
}

@media(max-width:820px){
  /* The desktop topbar search is hidden by the shell at this width, so expose
     the same `tim` input inside the existing GET filter form. */
  .page-tracuu .tc-mobile-search{
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;width:100%;
  }
  .page-tracuu .tc-mobile-search label{grid-column:1 / -1;color:var(--navy);font-size:12px;font-weight:700;}
  .page-tracuu .tc-mobile-search-input{box-sizing:border-box;width:100%!important;min-width:0!important;max-width:none!important;height:44px!important;}
  .page-tracuu .tc-mobile-search-submit{
    box-sizing:border-box;height:44px!important;min-height:44px!important;padding:0 14px!important;
    justify-content:center;border-color:var(--orange)!important;background:var(--orange)!important;color:var(--white)!important;
  }

  .page-hoantien .ht-mobile-search{
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;
    flex:1 0 100%;width:100%;min-width:0;order:-1;
  }
  .page-hoantien .ht-mobile-search label{grid-column:1 / -1;color:var(--navy);font-size:12px;font-weight:700;}
  .page-hoantien .ht-mobile-search-input{box-sizing:border-box;width:100%;min-width:0;height:44px;padding:0 11px;border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--text);font:inherit;}
  .page-hoantien .ht-mobile-search-submit{
    box-sizing:border-box;height:44px!important;min-height:44px!important;padding:0 14px!important;
    justify-content:center;border-color:var(--orange)!important;background:var(--orange)!important;color:var(--white)!important;
  }
}

@media(max-width:760px){
  .adp-card-table-scroll{overflow:visible!important;}
  table.data.adp-responsive-cards,
  table.data.adp-responsive-cards thead,
  table.data.adp-responsive-cards tbody{display:block;width:100%;}
  table.data.adp-responsive-cards{table-layout:auto;border-collapse:separate;}

  /* Existing server-sort anchors remain the single sorting authority. */
  table.data.adp-responsive-cards .adp-card-sort-title{
    display:block;position:static;width:100%;height:auto;margin:0;padding:12px 12px 7px;
    overflow:visible;clip:auto;white-space:normal;border:0;
    background:#E9EEFB;color:var(--navy);font-size:12px;font-weight:700;
    text-align:left;text-transform:uppercase;letter-spacing:.45px;
  }
  table.data.adp-responsive-cards thead{
    position:static;padding:0 12px 12px;background:#E9EEFB;
    border-bottom:1px solid var(--line);
  }
  table.data.adp-responsive-cards thead tr{display:flex;flex-wrap:wrap;gap:7px;background:transparent;}
  table.data.adp-responsive-cards thead th{
    display:none!important;position:static!important;width:auto!important;height:auto!important;
    padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;
  }
  table.data.adp-responsive-cards thead th.th-sap{display:block!important;}
  table.data.adp-responsive-cards thead th.th-sap a{
    display:inline-flex;width:auto!important;min-height:36px;padding:7px 10px;
    border:1px solid #CCD4E5;border-radius:8px;background:var(--white);color:var(--navy);
    font-size:11.5px;line-height:1.2;text-transform:none;letter-spacing:0;
  }
  table.data.adp-responsive-cards thead th.th-sap[aria-sort="ascending"] a,
  table.data.adp-responsive-cards thead th.th-sap[aria-sort="descending"] a{
    border-color:var(--orange);box-shadow:0 0 0 1px rgba(255,102,0,.14);
  }

  table.data.adp-responsive-cards tbody{
    display:grid;gap:12px;padding:12px;background:var(--bg-soft);
  }
  table.data.adp-responsive-cards tbody tr{
    display:grid;width:100%;min-width:0;overflow:hidden;
    border:1px solid var(--line);border-radius:12px;background:var(--white);
    box-shadow:var(--shadow-sm);transition:border-color .12s,box-shadow .12s;
  }
  table.data.adp-responsive-cards tbody tr:hover{background:var(--white);border-color:#CDD3DE;}
  table.data.adp-responsive-cards tbody tr:not([data-card-empty]) td{
    display:grid;grid-template-columns:minmax(96px,34%) minmax(0,1fr);gap:10px;
    width:100%!important;min-width:0!important;max-width:none!important;
    padding:9px 12px!important;border:0!important;border-bottom:1px solid var(--line-2)!important;
    overflow:visible!important;text-overflow:clip!important;white-space:normal!important;
    text-align:left!important;vertical-align:top;overflow-wrap:anywhere;word-break:break-word;
  }
  table.data.adp-responsive-cards tbody tr:not([data-card-empty]) td:last-child{border-bottom:0!important;}
  table.data.adp-responsive-cards tbody tr:not([data-card-empty]) td::before{
    content:attr(data-label);display:block;min-width:0;color:var(--text-muted);
    font-size:11.5px;font-weight:700;line-height:1.45;text-transform:none;
  }
  table.data.adp-responsive-cards .adp-card-value,
  table.data.adp-responsive-cards tbody td > *{grid-column:2;min-width:0;max-width:100%;}
  table.data.adp-responsive-cards tbody td[data-card-emphasis="primary"] .adp-card-value{
    color:var(--navy);font-weight:650;
  }
  /* Card hierarchy is only a neutral default. Existing business-semantic
     classes remain the color authority when they are present on a cell/value. */
  table.data.adp-responsive-cards tbody td:is(.am,.c-do,.c-red) .adp-card-value,
  table.data.adp-responsive-cards tbody .adp-card-value:is(.am,.c-do,.c-red){color:var(--red);}
  table.data.adp-responsive-cards tbody td:is(.c-luc,.c-green) .adp-card-value,
  table.data.adp-responsive-cards tbody .adp-card-value:is(.c-luc,.c-green){color:var(--green);}
  table.data.adp-responsive-cards tbody td.c-blue .adp-card-value,
  table.data.adp-responsive-cards tbody .adp-card-value.c-blue{color:var(--blue);}
  table.data.adp-responsive-cards tbody tr[data-card-empty]{display:block;box-shadow:none;}
  table.data.adp-responsive-cards tbody tr[data-card-empty] td{
    display:block;width:100%;height:auto;min-height:92px;padding:30px 16px!important;
    border:0!important;white-space:normal;text-align:center;
  }
  table.data.adp-responsive-cards tbody tr[data-card-empty] td::before{content:none;}

  /* Hoàn tiền already exposes the complete server-sort select, so its mobile
     cards do not repeat the sortable desktop header as a second control set. */
  .page-hoantien table.data.adp-responsive-cards thead{display:none!important;}
  .page-hoantien .ht-list-toolbar{align-items:stretch;}
  .page-hoantien .ht-list-toolbar > h2{width:100%;white-space:normal;}
  .page-hoantien .ht-toolbar-controls{flex:1 1 100%;width:100%;min-width:0;}
  .page-hoantien .ht-sort-control{display:flex;flex:1 1 100%;flex-direction:column;gap:5px;min-width:0;}
  .page-hoantien .ht-sort-control > label{display:block;color:var(--navy);font-size:12px;font-weight:700;}
  .page-hoantien .ht-sort-control > select{width:100%;max-width:none;}
  .page-hoantien table.data.adp-responsive-cards .adp-card-value,
  .page-hoantien table.data.adp-responsive-cards .adp-card-value > *{
    min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  }
  .page-hoantien table.data.adp-responsive-cards .sem-action .adp-card-value{display:flex;align-items:center;}

  /* B-03 Tra cứu mobile-read policy: results start directly with cards; desktop
     sortable headers remain the unchanged server-sort authority above 760px. */
  .page-tracuu table.data.adp-responsive-cards .adp-card-sort-title,
  .page-tracuu table.data.adp-responsive-cards thead{display:none!important;}

  /* Tra cứu pilot: undo desktop ellipsis only inside opted-in mobile cards. */
  .page-tracuu table.data.adp-responsive-cards :is(.tc-person,.tc-operation,.col-makh-full,.tc-feature){
    overflow:visible!important;text-overflow:clip!important;white-space:normal!important;
  }
  .page-tracuu table.data.adp-responsive-cards .nhan-cn{
    display:inline-flex;max-width:100%;overflow:visible;text-overflow:clip;
    white-space:normal;overflow-wrap:anywhere;
  }
  .page-tracuu table.data.adp-responsive-cards .tc-chitiet > *{grid-column:2;}
  .page-tracuu table.data.adp-responsive-cards .tc-chitiet::before{grid-row:1 / span 2;}
  .page-tracuu table.data.adp-responsive-cards .tc-cm span{white-space:normal;overflow-wrap:anywhere;}

  .page-tracuu .adp-control-toolbar--wide{
    display:flex!important;flex-direction:column;align-items:stretch!important;gap:10px!important;
    padding:13px 12px!important;
  }
  .page-tracuu .adp-control-toolbar--wide > h2{width:100%!important;white-space:normal!important;}
  .page-tracuu .adp-control-toolbar--wide > .bang-ngan{display:none!important;}
  .page-tracuu .adp-control-toolbar--wide > .loc-tracuu{
    display:flex!important;flex-direction:column;align-items:stretch!important;
    width:100%!important;margin:0!important;gap:9px!important;order:0!important;
  }
  .page-tracuu .loc-tracuu .adp-control-subgroup--primary{
    display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;
    width:100%!important;gap:8px!important;flex:0 0 auto!important;
  }
  .page-tracuu .loc-tracuu .adp-control-subgroup--primary > .adp-control-select{
    grid-column:1 / -1;width:100%!important;min-width:0!important;max-width:none!important;
  }
  .page-tracuu .loc-tracuu .adp-control-subgroup--primary > .adp-control-input{
    width:100%!important;min-width:0!important;max-width:none!important;
  }
  .page-tracuu .loc-tracuu .adp-control-subgroup--secondary{
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
    width:100%!important;gap:8px!important;flex:0 0 auto!important;
  }
  .page-tracuu .loc-tracuu .adp-control-subgroup--secondary > .adp-control-select{
    width:100%!important;min-width:0!important;max-width:none!important;
  }
  .page-tracuu .loc-tracuu .adp-control-actions{margin:0!important;}
  .page-tracuu .adp-control-toolbar--wide > .bang-xuat{
    order:0!important;width:100%!important;margin:0!important;justify-content:center!important;
  }
  .page-tracuu .phantrang{padding:12px;gap:10px;}
  .page-tracuu .pt-trai,.page-tracuu .pt-phai{width:100%;justify-content:flex-start;}
}

/* ============================================================================
   SYSTEM-WIDE-UI-MOBILE-FOUNDATION-B-04 — NSH mobile read-only presentation.
   The shared responsive-card foundation remains the sole card system. Desktop
   keeps the native table, editable note and existing workflow unchanged.
   ========================================================================== */
.nsh-mobile-search,.nsh-empty-mobile-message,.nsh-note-readonly{display:none;}
.nsh-note-readonly--desktop{display:inline-block;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom;}
.nsh-sort-control{display:contents;}
.nsh-sort-control > label{display:none;}

@media(max-width:900px){
  .tb-nhap-xml,
  #nsh-vung .nsh-empty-import,
  #nsh-vung .nsh-empty-desktop-guidance,
  #nsh-vung .inp-ghichu,
  #nsh-drawer #pa-nhom-vung-nsh,
  #nsh-drawer .pa-btn-nsh,
  #nsh-drawer .detail-admin-link,
  #pa-modal-bg-nsh,
  #pa-kq-bg-nsh{display:none!important;}

  #nsh-vung .nsh-empty-mobile-message{
    display:block;max-width:520px;margin:0 auto;color:var(--text-muted);
  }
  #nsh-vung .nsh-note-readonly{
    display:block;max-width:none;overflow:visible;text-overflow:clip;
    white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  }
}

@media(max-width:820px){
  #nsh-vung .bang-toolbar .loc-trong-bang{
    width:100%!important;min-width:0!important;flex-wrap:wrap!important;
  }
  #nsh-vung .nsh-mobile-search{
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;
    flex:1 0 100%;width:100%;min-width:0;order:-1;
  }
  #nsh-vung .nsh-mobile-search > label{
    grid-column:1 / -1;color:var(--navy);font-size:12px;font-weight:700;
  }
  #nsh-vung .nsh-mobile-search-input{
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:none!important;
    height:44px!important;padding:0 11px;border:1px solid var(--line);border-radius:8px;
    background:var(--white);color:var(--text);font:inherit;
  }
  #nsh-vung .nsh-mobile-search-submit{
    box-sizing:border-box;height:44px!important;min-height:44px!important;padding:0 14px!important;
    justify-content:center;border-color:var(--orange)!important;background:var(--orange)!important;color:var(--white)!important;
  }
}

@media(max-width:760px){
  #nsh-vung .bang-toolbar{align-items:stretch!important;}
  #nsh-vung .bang-toolbar > h2{width:100%;white-space:normal;}
  #nsh-vung .bang-toolbar > .bang-ngan{display:none!important;}
  #nsh-vung .bang-toolbar .loc-trong-bang{
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
    width:100%!important;min-width:0!important;gap:9px!important;
  }
  #nsh-vung .loc-trong-bang > .nsh-mobile-search,
  #nsh-vung .loc-trong-bang > .adp-control-select,
  #nsh-vung .loc-trong-bang > .nsh-sort-control{grid-column:1 / -1;width:100%!important;}
  #nsh-vung .loc-trong-bang > .adp-control-select{max-width:none!important;}
  #nsh-vung .nsh-sort-control{display:flex;flex-direction:column;gap:5px;min-width:0;}
  #nsh-vung .nsh-sort-control > label{display:block;color:var(--navy);font-size:12px;font-weight:700;}
  #nsh-vung .nsh-sort-control > select{width:100%!important;max-width:none!important;}

  #nsh-vung .data-nsh--debt-parity.adp-responsive-cards{min-width:0;}
  #nsh-vung table.data.adp-responsive-cards colgroup,
  #nsh-vung table.data.adp-responsive-cards thead{display:none!important;}
  #nsh-vung table.data.adp-responsive-cards .adp-card-value,
  #nsh-vung table.data.adp-responsive-cards .adp-card-value > *{
    min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  }
  #nsh-vung table.data.adp-responsive-cards .sem-money .adp-card-value{white-space:nowrap;}
  #nsh-vung table.data.adp-responsive-cards .accepted-variance-indicator{
    display:block;margin-top:5px;white-space:normal;overflow-wrap:anywhere;
  }
  #nsh-vung table.data.adp-responsive-cards .nsh-nut-wrap{justify-content:flex-start;}
}

/* ============================================================================
   SYSTEM-WIDE-UI-MOBILE-FOUNDATION-B-04-REVIEW-FIX-01 — narrow host polish.
   Presentation only: shared account control, accepted mobile search/filter
   geometry, Hoàn tiền card action alignment and NSH document-action density.
   ========================================================================== */
@media(max-width:900px){
  .topbar .tb-user{
    width:40px;min-width:40px;max-width:40px;padding:4px;gap:0;justify-content:center;
  }
  .topbar .tb-user-txt,
  .topbar .tb-mui{display:none;}

  #nsh-drawer a.detail-document-action[href*="kind=xml"]{display:none!important;}
}

@media(max-width:820px){
  .page-tracuu .tc-mobile-search,
  .page-hoantien .ht-mobile-search{
    grid-template-columns:minmax(0,1fr) 64px;
  }
  .page-tracuu .tc-mobile-search-input,
  .page-hoantien .ht-mobile-search-input{
    box-sizing:border-box;height:44px!important;min-height:44px!important;margin:0;
  }
  .page-tracuu .tc-mobile-search-submit,
  .page-hoantien .ht-mobile-search-submit{
    box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;
    width:64px;min-width:64px;max-width:64px;height:44px!important;min-height:44px!important;
    margin:0;padding:0!important;line-height:1;
  }
}

@media(max-width:760px){
  .page-hoantien .ht-toolbar-controls > select[name="tt"],
  .page-hoantien .ht-toolbar-controls > select[name="loai_ma"]{
    flex:1 0 100%;width:100%;max-width:none;
  }
  .page-hoantien .ht-toolbar-controls > .ht-sort-control{
    flex:1 1 0;width:auto;min-width:0;max-width:none;
  }
  .page-hoantien .ht-toolbar-controls > .btn-boloc{
    flex:0 0 36px;align-self:flex-end;margin:0;
  }
  .page-hoantien table.data.adp-responsive-cards td.sem-action .adp-card-value{
    justify-content:flex-start;
  }
  .page-hoantien table.data.adp-responsive-cards td.sem-action .btn-chitiet{
    margin:0;
  }

  #nsh-vung .bang-toolbar .loc-trong-bang > .nsh-sort-control{
    grid-column:1 / 2;width:auto!important;min-width:0;
  }
  #nsh-vung .bang-toolbar .loc-trong-bang > .nsh-sort-control > select{
    width:100%!important;max-width:none!important;
  }
  #nsh-vung .bang-toolbar .loc-trong-bang > .btn-boloc{
    grid-column:2;align-self:end;margin:0;
  }
}

/* ============================================================================
   SYSTEM-WIDE-UI-MOBILE-FOUNDATION-B-05 — SH mobile read-only presentation.
   The shared responsive-card foundation remains the sole card system. Desktop
   keeps the native table and existing mutation workflow unchanged.
   ========================================================================== */
.sh-mobile-search,.sh-empty-mobile-message,.sh-note-readonly,.sh-status-readonly{display:none;}
.sh-sort-control{display:contents;}
.sh-sort-control > label{display:none;}

@media(max-width:900px){
  #sh-vung .bang-toolbar .loc-trong-bang{
    flex:1 1 100%!important;width:100%!important;min-width:0!important;flex-wrap:wrap!important;
  }
  .tb-nhap-sh,
  #sh-vung .sh-empty-import,
  #sh-vung .sh-empty-desktop-guidance,
  #sh-vung .inp-ghichu,
  #sh-vung .sel-tt,
  #sh-vung #drawer #pa-nhom-vung,
  #sh-vung #drawer :is(.pa-btn-hoantac,.pa-btn-huy-doi-soat),
  #sh-vung #drawer .detail-admin-link,
  #sh-vung #pa-modal-bg,
  #sh-vung #modal-bg{display:none!important;}

  #sh-vung .sh-empty-mobile-message{
    display:block;max-width:520px;margin:0 auto;color:var(--text-muted);
  }
  #sh-vung .sh-note-readonly{
    display:block;max-width:none;overflow:visible;text-overflow:clip;
    white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  }
  #sh-vung .sh-status-readonly{display:inline-flex;}
}

@media(max-width:820px){
  #sh-vung .bang-toolbar .loc-trong-bang{
    flex:1 1 100%!important;width:100%!important;min-width:0!important;flex-wrap:wrap!important;
  }
  #sh-vung .sh-mobile-search{
    display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:8px;
    flex:1 0 100%;width:100%;min-width:0;order:-1;
  }
  #sh-vung .sh-mobile-search > label{
    grid-column:1 / -1;color:var(--navy);font-size:12px;font-weight:700;
  }
  #sh-vung .sh-mobile-search-input{
    box-sizing:border-box;width:100%!important;min-width:0!important;max-width:none!important;
    height:44px!important;min-height:44px!important;margin:0;padding:0 11px;
    border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--text);font:inherit;
  }
  #sh-vung .sh-mobile-search-submit{
    box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;
    width:64px;min-width:64px;max-width:64px;height:44px!important;min-height:44px!important;
    margin:0;padding:0!important;line-height:1;border-color:var(--orange)!important;
    background:var(--orange)!important;color:var(--white)!important;
  }
}

@media(max-width:760px){
  #sh-vung .bang-toolbar{align-items:stretch!important;}
  #sh-vung .bang-toolbar > h2{width:100%;white-space:normal;}
  #sh-vung .bang-toolbar > .bang-ngan{display:none!important;}
  #sh-vung .bang-toolbar .loc-trong-bang{
    display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;
    width:100%!important;min-width:0!important;gap:9px!important;
  }
  #sh-vung .loc-trong-bang > .sh-mobile-search,
  #sh-vung .loc-trong-bang > .adp-control-select,
  #sh-vung .loc-trong-bang > .sh-sort-control{grid-column:1 / -1;width:100%!important;}
  #sh-vung .loc-trong-bang > .adp-control-select{max-width:none!important;}
  #sh-vung .sh-sort-control{display:flex;flex-direction:column;gap:5px;min-width:0;}
  #sh-vung .sh-sort-control > label{display:block;color:var(--navy);font-size:12px;font-weight:700;}
  #sh-vung .sh-sort-control > select{width:100%!important;max-width:none!important;}
  #sh-vung .bang-toolbar .loc-trong-bang > .sh-sort-control{
    grid-column:1 / 2;width:auto!important;min-width:0;
  }
  #sh-vung .bang-toolbar .loc-trong-bang > .btn-boloc{
    grid-column:2;align-self:end;margin:0;
  }

  #sh-vung table.data.adp-responsive-cards{min-width:0;}
  #sh-vung table.data.adp-responsive-cards thead{display:none!important;}
  #sh-vung table.data.adp-responsive-cards .adp-card-value,
  #sh-vung table.data.adp-responsive-cards .adp-card-value > *{
    min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  }
  #sh-vung table.data.adp-responsive-cards .sem-money .adp-card-value{white-space:nowrap;}
  #sh-vung table.data.adp-responsive-cards .accepted-variance-indicator{
    display:block;margin-top:5px;white-space:normal;overflow-wrap:anywhere;
  }
  #sh-vung table.data.adp-responsive-cards td.sem-action .adp-card-value{
    display:flex;align-items:center;justify-content:flex-start;
  }
  #sh-vung table.data.adp-responsive-cards td.sem-action .btn-chitiet{margin:0;}
}

/* ============================================================================
   SYSTEM-WIDE-UI-MOBILE-FOUNDATION-B-06 — shared host closures and Gạch nợ
   MOBILE-READ. Presentation only; desktop writers and backend authority stay
   unchanged.
   ========================================================================== */
.debt-detail-drawer .debt-detail-drawer-body{overscroll-behavior-y:contain;}
html:has(.debt-detail-drawer.mo),
body:has(.debt-detail-drawer.mo){overflow:hidden;}

.gn-guidance-mobile{display:none;}

@media(max-width:900px){
  /* SH document policy: lifecycle PDF anchors carry target=_blank; XML anchors
     do not. Keep this distinction scoped to the SH business detail drawer. */
  #drawer a.detail-document-action:not([target="_blank"]){display:none!important;}

  /* Gạch nợ is inspection-only on mobile. All writer controls remain in the
     unchanged desktop DOM and retain their existing server-side authority. */
  .topbar .sk-mo-modal,
  #gachno-vung #sk-modal,
  #gachno-vung #gn-xacnhan,
  #gachno-vung .gn-selection-cluster,
  #gachno-vung .gn-mobile-write,
  #gachno-vung .gio-ghep{display:none!important;}

  #gachno-vung .gn-guidance-desktop{display:none;}
  #gachno-vung .gn-guidance-mobile{display:inline;}

  #gachno-vung .gn-queue-loading{box-sizing:border-box;width:100%;max-width:none;min-height:0;display:block;margin:0 0 12px;}
  #gachno-vung .gn-queue-state{width:100%;max-width:none;margin:0;padding:12px 14px;border-color:#F3D4B5;background:var(--orange-tint);box-shadow:none;}
  #gachno-vung .gn-queue-loading-error{border-color:#F1C7C7;background:var(--red-tint);}
  #gachno-vung .gn-queue-retry{min-height:44px;padding:0 14px;}
}

@media(max-width:431px){
  #gachno-vung .gn-queue-loading-error{
    display:grid;grid-template-columns:24px minmax(0,1fr);align-items:start;
    column-gap:11px;row-gap:10px;
  }
  #gachno-vung .gn-queue-loading-error .gn-queue-retry{
    box-sizing:border-box;grid-column:2;width:100%;max-width:100%;min-width:0;
    min-height:44px;margin:0;flex:none;
  }
}

@media(max-width:820px){
  #gachno-vung .gn-search-bridge{
    display:grid!important;grid-template-columns:minmax(0,1fr) 64px;gap:8px;
    width:100%;min-width:0;margin:0 0 12px;
  }
  #gachno-vung .gn-search-bridge > label{
    grid-column:1 / -1;color:var(--navy);font-size:12px;font-weight:700;
  }
  #gachno-vung .gn-mobile-search-input{
    box-sizing:border-box;width:100%;min-width:0;height:44px;min-height:44px;margin:0;padding:0 11px;
    border:1px solid var(--line);border-radius:8px;background:var(--white);color:var(--text);font:inherit;
  }
  #gachno-vung .gn-mobile-search-submit{
    box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;
    width:64px;min-width:64px;max-width:64px;height:44px;min-height:44px;margin:0;padding:0;
    border-color:var(--orange)!important;background:var(--orange)!important;color:var(--white)!important;line-height:1;
  }
}

@media(max-width:760px){
  /* Zero debt is an ordinary neutral monetary value. Positive `.am` debt keeps
     the established red semantic authority and primary emphasis. */
  #sh-vung table.data.adp-responsive-cards td.col-conno:not(.am) .adp-card-value,
  #nsh-vung table.data.adp-responsive-cards td.c-conno:not(.am) .adp-card-value{
    color:var(--text)!important;font-weight:400!important;
  }

  #gachno-vung .gn-nhom > .bang-dau{align-items:flex-start;}
  #gachno-vung .gn-nhom > .bang-dau > div,
  #gachno-vung .gn-nhom > .bang-dau > h2{min-width:0;width:100%;}
  #gachno-vung .gn-nhom .bang-mota{white-space:normal;overflow-wrap:anywhere;}
  #gachno-vung table.data.adp-responsive-cards{min-width:0;}
  #gachno-vung table.data.adp-responsive-cards thead{display:none!important;}
  #gachno-vung table.data.adp-responsive-cards tbody tr[hidden]{display:none!important;}
  #gachno-vung table.data.adp-responsive-cards .adp-card-value,
  #gachno-vung table.data.adp-responsive-cards .adp-card-value > *{
    min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  }
  #gachno-vung table.data.adp-responsive-cards td.sem-money .adp-card-value{white-space:nowrap;}
  #gachno-vung table.data.adp-responsive-cards td.sem-status .adp-card-value{
    display:flex;align-items:center;justify-content:flex-start;
  }
  #gachno-vung .gn-nsh-proposal{
    display:flex!important;flex-direction:column;align-items:flex-start!important;gap:5px;
  }
  #gachno-vung .gn-nsh-proposal-toa,
  #gachno-vung .gn-nsh-proposal-name,
  #gachno-vung .gn-nsh-proposal-invoice,
  #gachno-vung .gn-nsh-proposal-status,
  #gachno-vung .gn-nsh-proposal-detail{display:block;max-width:100%;margin:0!important;}
  #gachno-vung .gn-nsh-proposal-invoice::first-letter{font-size:0;}
  #gachno-vung .gn-nsh-proposal-name,
  #gachno-vung .gn-nsh-proposal-invoice,
  #gachno-vung .gn-nsh-proposal-detail{white-space:normal;overflow-wrap:anywhere;word-break:break-word;}
  #gachno-vung #gn-group4-manual{scroll-margin-top:72px;}
  #gachno-vung .gn-kh-trangthai{align-items:flex-start!important;}
  #gachno-vung .pt-thanh{padding:10px 12px;}
}

/* ============================================================================
   SYSTEM-WIDE-UI-MOBILE-FOUNDATION-B-07 — ZNS mobile read-only presentation.
   The existing GET filters remain available, while desktop maintenance/export
   links return unchanged above 900px. Cards reuse the shared opt-in foundation.
   ========================================================================== */
.zns-missing-phone-mobile,
.zns-empty-mobile-copy{display:none;}

@media(max-width:900px){
  #zns-vung .zns-missing-phone-desktop,
  #zns-vung .zns-empty-desktop-copy{display:none!important;}
  #zns-vung .zns-missing-phone-mobile{display:inline-flex;}
  #zns-vung .zns-empty-mobile-copy{display:block;}
  #zns-vung .tong-bar-zns .kpi,
  #zns-vung .tong-bar-zns .kpi-txt{min-width:0;}
  #zns-vung .tong-bar-zns .kpi-so{max-width:100%;font-variant-numeric:tabular-nums;}
}

@media(max-width:760px){
  #zns-vung .ph-loc-zns{
    display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;
    width:100%;min-width:0;gap:10px;padding:14px;
  }
  #zns-vung .ph-loc-zns > .adp-field-row{
    display:flex;flex-direction:column;align-items:stretch;
    width:100%;min-width:0;height:auto;margin-left:0;gap:6px;
  }
  #zns-vung .ph-loc-zns .adp-field-label{width:100%;min-width:0;line-height:1.35;}
  #zns-vung .ph-loc-zns .adp-field-box,
  #zns-vung .ph-loc-zns .zns-ngay-wrap{
    flex:1 1 auto;width:100%!important;min-width:0;height:44px!important;min-height:44px;
  }
  #zns-vung .ph-loc-zns select,
  #zns-vung .ph-loc-zns .zns-ngay-wrap input[type=text],
  #zns-vung .ph-loc-zns .zns-date-mobile{width:100%!important;min-width:0;height:100%!important;}

  #zns-vung .bang-zns .bang-dau{align-items:flex-start;}
  #zns-vung .bang-zns .bang-tieu-de{width:100%;}
  #zns-vung .bang-zns .bang-chip-canhbao{white-space:normal;overflow-wrap:anywhere;}
  #zns-vung .data-zns.adp-responsive-cards{min-width:0;}
  #zns-vung .data-zns.adp-responsive-cards thead{display:none!important;}
  #zns-vung .data-zns.adp-responsive-cards tbody tr:not([data-card-empty]) td{width:100%!important;}
  #zns-vung .data-zns.adp-responsive-cards .adp-card-value,
  #zns-vung .data-zns.adp-responsive-cards .adp-card-value > *{
    min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  }
  #zns-vung .data-zns.adp-responsive-cards :is(.cw-sdt,.cw-makh,.z-ky,.z-cs,.z-dtt,.z-ngay,.cw-tien) .adp-card-value{
    white-space:normal;overflow-wrap:anywhere;
  }
  #zns-vung .data-zns.adp-responsive-cards .zns-hang-thieu-sdt{
    border-color:#F0B8B8;background:#FFF4F4;
  }
  #zns-vung .data-zns.adp-responsive-cards .zns-hang-thieu-sdt > td,
  #zns-vung .data-zns.adp-responsive-cards .zns-hang-thieu-sdt:hover > td{background:transparent;}
  #zns-vung .bang-zns .pt-thanh{padding:10px 12px;}
}

/* ============================================================================
   SYSTEM-WIDE-UI-MOBILE-FOUNDATION-B-08 — B-07 presentation closures and
   Phát hành định kỳ MOBILE-READ. Business/export authority is unchanged.
   ========================================================================== */
.zns-missing-phone-status,
.zns-date-mobile,
.ph-mobile-meta,
.ph-empty-mobile-copy{display:none;}

@media(max-width:900px){
  #zns-vung .zns-ngay-wrap,
  #zns-vung .zns-ngay-wrap:hover,
  #zns-vung .zns-ngay-wrap:focus-within{
    border-color:transparent;background:var(--bg-soft);box-shadow:none;cursor:default;
  }
  #zns-vung .zns-date-desktop{display:none!important;}
  #zns-vung .zns-date-mobile{
    box-sizing:border-box;display:flex;align-items:center;width:100%;height:100%;
    padding:0 12px;color:var(--text);font-size:13.5px;font-weight:500;
    line-height:1.35;font-variant-numeric:tabular-nums;letter-spacing:.3px;
    cursor:default;pointer-events:none;
  }
  #zns-vung .ph-loc-zns > .zns-oNgay{
    display:grid!important;grid-template-columns:minmax(0,1fr) minmax(118px,130px);
    align-items:center!important;gap:10px!important;width:100%;max-width:100%;height:auto;margin-left:0;
  }
  #zns-vung .ph-loc-zns > .zns-oNgay > .adp-field-label{
    width:auto!important;min-width:0;white-space:normal!important;line-height:1.3!important;
  }
  #zns-vung .ph-loc-zns > .zns-oNgay > .zns-ngay-wrap{
    box-sizing:border-box;width:100%!important;min-width:0;height:44px!important;min-height:44px;
  }
  #zns-vung .zns-missing-phone-status{
    display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:0;
    border:0;background:transparent;box-shadow:none;color:var(--red);
    font-size:11.5px;font-weight:600;line-height:1.45;white-space:normal;
    overflow-wrap:anywhere;cursor:default;pointer-events:none;
  }
  #zns-vung .zns-missing-phone-status svg{width:14px;height:14px;flex:0 0 auto;}

  #ph-vung .ph-document-param,
  #ph-vung .ph-actions,
  #ph-vung .ph-selection{display:none!important;}
  #ph-vung .ph-mobile-meta{
    display:grid;grid-template-columns:minmax(0,1fr);gap:9px;
    margin:-4px 0 14px;padding:12px;border:1.5px solid var(--line);
    border-radius:14px;background:var(--white);
  }
  #ph-vung .ph-mobile-meta > div{
    display:grid;grid-template-columns:minmax(112px,.9fr) minmax(0,1.1fr);
    align-items:center;gap:10px;min-width:0;
  }
  #ph-vung .ph-mobile-meta dt{
    display:flex;align-items:center;gap:5px;min-width:0;color:var(--navy);
    font-size:12px;font-weight:700;line-height:1.35;
  }
  #ph-vung .ph-mobile-meta dt svg{width:14px;height:14px;flex:0 0 auto;color:var(--orange);}
  #ph-vung .ph-mobile-meta dd{
    box-sizing:border-box;display:flex;align-items:center;width:100%;min-width:0;min-height:44px;
    margin:0;padding:7px 10px;border:1px solid var(--line);border-radius:8px;
    background:var(--bg-soft);color:var(--text);font-size:13px;font-weight:500;
    line-height:1.35;overflow-wrap:anywhere;font-variant-numeric:tabular-nums;
  }
  #ph-vung .ph-empty-desktop-copy{display:none!important;}
  #ph-vung .ph-empty-mobile-copy{display:block;}
  #ph-vung .tong-bar-ph .kpi,
  #ph-vung .tong-bar-ph .kpi-txt{min-width:0;}
  #ph-vung .tong-bar-ph .kpi-so{
    max-width:100%;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;
  }
  #ph-vung .ph-tabs{grid-template-columns:minmax(0,1fr);}
  #ph-vung .ph-tab{
    display:grid;grid-template-columns:26px minmax(0,1fr);align-items:center;
    min-width:0;min-height:46px;padding:8px 10px;
  }
  #ph-vung .ph-tab .ph-noi{
    display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;
    width:100%;white-space:normal;overflow-wrap:anywhere;
  }
  #ph-vung .ph-tab .ph-cham{display:none;}
  #ph-vung .ph-tab .ph-ngay{justify-self:end;}
  #ph-vung .bang-ph .bang-dau{align-items:flex-start;}
  #ph-vung .bang-ph .bang-dau h2{min-width:0;white-space:normal;overflow-wrap:anywhere;}
}

@media(max-width:760px){
  #ph-vung .ph-loc{
    display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;
    width:100%;min-width:0;gap:10px;padding:14px;
  }
  #ph-vung .ph-loc > .adp-field-row:not(.ph-document-param){
    display:flex;flex-direction:column;align-items:stretch;width:100%;min-width:0;gap:6px;
  }
  #ph-vung .ph-loc .adp-field-label{width:100%;min-width:0;line-height:1.35;}
  #ph-vung .ph-loc .ph-box--sel{
    flex:1 1 auto;width:100%!important;max-width:none;min-width:0;height:44px;
  }
  #ph-vung .ph-loc .ph-box--sel select{width:100%;min-width:0;height:100%;}
  #ph-vung .data-bk.adp-responsive-cards,
  #ph-vung .data-ph.adp-responsive-cards{min-width:0;}
  #ph-vung .data-bk.adp-responsive-cards colgroup,
  #ph-vung .data-ph.adp-responsive-cards colgroup,
  #ph-vung .data-bk.adp-responsive-cards thead,
  #ph-vung .data-ph.adp-responsive-cards thead{display:none!important;}
  #ph-vung .adp-responsive-cards tbody tr:not([data-card-empty]) td{width:100%!important;}
  #ph-vung .adp-responsive-cards .adp-card-value,
  #ph-vung .adp-responsive-cards .adp-card-value > *{
    min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  }
  #ph-vung .adp-responsive-cards td.sem-money .adp-card-value{white-space:nowrap;}
  #ph-vung .data-ph.adp-responsive-cards .ph-ten{
    overflow:visible!important;text-overflow:clip!important;white-space:normal!important;
  }
  #ph-vung .bang-ph .pt-thanh{padding:10px 12px;}
}

/* ============================================================================
   P3-C0-MOBILE-CLOSURE-02-C0-SHARED-TOUCH-TARGETS — mobile read-detail
   controls. Enlarge only the tappable box; desktop density and icon artwork
   remain unchanged.
   ========================================================================== */
@media(max-width:900px){
  #sh-vung .btn-chitiet,
  #nsh-vung .data-nsh .nsh-nut-xem,
  .page-hoantien .btn-chitiet{
    box-sizing:border-box;width:44px;height:44px;
  }
  #nsh-vung .data-nsh .nsh-nut-xem{min-width:44px;flex:0 0 44px;}

  #drawer.debt-detail-drawer #drawer-close,
  #nsh-drawer.debt-detail-drawer #nsh-drawer-close,
  #ht-drawer.debt-detail-drawer #ht-drawer-close{
    flex:0 0 44px;width:44px;height:44px;
  }
}

/* C4 Danh bạ desktop boundary guards. Card values must not expand fixed table
   cells, and the narrow 901–1100 desktop band keeps controls/table overflow
   inside their own route-local containers. */
@media(min-width:901px){
  .page-danhba .data-danhba .adp-card-value{min-width:0;max-width:100%;}
  .page-danhba .data-danhba .db-ten > .adp-card-value{
    display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
}
@media(min-width:901px) and (max-width:1100px){
  .page-danhba .bang-toolbar{flex-wrap:wrap;}
  .page-danhba .bang-toolbar > h2{flex:1 1 auto;min-width:0;}
  .page-danhba .bang-toolbar > .bang-ngan{display:none;}
  .page-danhba .bang-toolbar > .loc-trong-bang{
    flex:1 1 100%;width:100%;min-width:0;max-width:100%;margin:0;flex-wrap:wrap;
  }
  .page-danhba .bang-toolbar > .adp-control-excel{margin-left:auto;}
  .page-danhba .bang-scroll{box-sizing:border-box;width:100%;max-width:100%;overflow-x:auto;overflow-y:visible;}
  .page-danhba .data-danhba{min-width:720px;}
}
@media(max-width:900px){
  #db-modal-bg .db-entry-modal .db-modal-field input,
  #db-modal-bg .db-entry-modal .ui-action-btn,
  #db-chon-so-bg .db-chon-so-modal .ui-action-btn,
  #db-xoaso-bg .db-xoaso-modal .ui-action-btn,
  .db-import-choice-bg .db-import-choice-modal .ui-action-btn{
    height:44px!important;min-height:44px!important;
  }
  .db-import-choice-bg .db-import-choice-close,
  #db-ls-drawer.db-ls-drawer .drawer-close{
    width:44px!important;height:44px!important;min-width:44px!important;flex:0 0 44px!important;
  }
}

/* ============================================================================
   POST-C4 CASH MOBILE REDESIGN 01 — route-local presentation only.
   Cash keeps its existing inputs, one GET search authority, one table, note
   editor, selection hooks and drawer actions. Only hierarchy and geometry move.
   ========================================================================== */
/* RF-04: the nested `.tm-customer-summary` customer card + hidden state-carrier
   were removed. The Tên khách hàng field is now a plain readonly input (same
   shape as Mã KH / Số tiền), so all three intake fields share one flex/grid
   mechanism and scale together. Its former CSS (state-carrier, customer-summary,
   customer-summary-icon/copy/line, and the RF-02 grid blocks that only existed
   to place that card) is intentionally deleted — see the intake @media blocks
   below and the v99 one-row flex layout (`@media(min-width:1100px)`). */
.tm-filter-field{display:contents;}
.tm-filter-field>label,.tm-reset-label{display:none;}

@media(max-width:900px){
  /* Compact 2x2 KPI language shared with SH/NSH without touching KPI values. */
  .tong-bar-tm{margin-bottom:12px!important;border-radius:12px;}
  .tong-bar-tm .kpi{min-height:68px;padding:8px 9px!important;gap:7px!important;}
  .tong-bar-tm .kpi-ic{width:30px!important;height:30px!important;flex-basis:30px!important;box-shadow:none!important;}
  .tong-bar-tm .kpi-ic .ic,.tong-bar-tm .kpi-ic svg{width:17px!important;height:17px!important;}
  .tong-bar-tm .kpi-so{font-size:clamp(14px,3.7vw,18px)!important;line-height:1.1!important;letter-spacing:-.25px;}
  .tong-bar-tm .kpi-nhan{font-size:10.5px!important;line-height:1.2;}
  .tong-bar-tm .kpi-don{font-size:9.5px!important;margin-top:1px;}

  /* Intake: state carrier remains in DOM; the factual mirror reads as a compact
     information block rather than a second editable field. */
  .tm-ghinhan{margin-bottom:12px!important;border-radius:12px!important;}
  .tm-ghinhan .tm-ghi-head{padding:11px 12px 0!important;gap:7px!important;}
  .tm-ghinhan .tm-ghi-head h2{font-size:15px;}
  .tm-ghinhan .tm-ghi-icon{width:28px;height:28px;flex-basis:28px;border-radius:8px;}
  .tm-ghinhan .tm-ghi-icon svg{width:16px;height:16px;}
  .tm-ghinhan .tm-ghi-body{padding:9px 12px 12px!important;}
  .tm-ghinhan .tm-ghi-form{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    gap:8px!important;align-items:start!important;
  }
  .tm-ghinhan .tm-o{gap:4px!important;}
  .tm-ghinhan .tm-o .tm-inp{height:44px!important;min-height:44px!important;font-size:14px;}
  .tm-ghinhan .tm-o .tm-hint{min-height:13px!important;font-size:11px;line-height:1.25;}
  .tm-ghinhan .tm-o-makh>.tm-hint:empty{display:none!important;}
  .tm-ghinhan .tm-ghi-form .tm-btn{height:44px!important;min-height:44px!important;font-size:14px;}

  /* SH-style labelled filter stack. The local search remains hidden at 821–900,
     where the established topbar bridge is the sole visible search control. */
  .bang-tm .bang-dau{gap:10px!important;padding:12px!important;}
  #tm-loc-bar{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    gap:9px!important;width:100%!important;
  }
  #tm-loc-bar .tm-filter-field{display:flex;flex-direction:column;align-items:stretch;gap:5px;min-width:0;width:100%;}
  #tm-loc-bar .tm-filter-field>label,
  #tm-loc-bar .tm-mobile-search>label{display:block;color:var(--navy);font-size:12px;font-weight:700;line-height:1.25;}
  #tm-loc-bar .tm-filter-field>select{
    box-sizing:border-box;width:100%!important;max-width:none!important;min-width:0!important;
    height:44px!important;min-height:44px!important;
  }
  #tm-loc-bar>.adp-control-reset{
    box-sizing:border-box;display:flex!important;width:100%!important;min-width:0!important;
    height:44px!important;min-height:44px!important;justify-content:center!important;gap:7px;
  }
  #tm-loc-bar>.adp-control-reset .tm-reset-label{display:inline;}
  #tm-loc-bar .tm-mobile-search{width:100%;min-width:0;}
  #tm-mobile-search-input{height:44px!important;min-height:44px!important;}

  /* Cash card hierarchy through 900px. */
  .bang-tm table.data tbody{padding:10px!important;}
  .bang-tm table.data tr{
    gap:5px 8px!important;margin-bottom:10px!important;padding:11px 12px!important;
    border-radius:11px!important;box-shadow:0 2px 8px rgba(15,23,42,.06)!important;
  }
  .bang-tm table.data td.td-makh{order:1!important;flex:1 1 150px!important;}
  .bang-tm table.data td.td-toa{order:2!important;}
  .bang-tm table.data td.td-chon{order:3!important;margin-left:2px!important;}
  .bang-tm table.data td.td-ten{order:4!important;flex:1 0 100%!important;margin:0!important;color:var(--text)!important;font-size:13.5px!important;font-weight:600;line-height:1.35;}
  .bang-tm table.data td.td-tien{order:5!important;flex:1 1 150px!important;margin-top:4px;}
  .bang-tm table.data td.td-tt{order:6!important;flex:0 1 auto!important;margin-top:4px;}
  .bang-tm table.data td.td-conno{order:7!important;flex:0 1 auto!important;}
  .bang-tm table.data td.td-gio{order:8!important;flex:0 1 auto!important;}
  .bang-tm table.data td.td-nv{order:9!important;flex:0 1 auto!important;}
  .bang-tm table.data td.col-ghichu{order:10!important;}
  .bang-tm table.data td.td-thaotac{order:11!important;}
  .bang-tm table.data td.td-makh b{font-size:15px!important;line-height:1.25;color:var(--navy)!important;}
  .bang-tm table.data td.td-tien b{font-size:19px!important;line-height:1.2;color:var(--orange-dark)!important;}
  .bang-tm table.data td.td-tt .tt{
    box-sizing:border-box;min-width:0!important;min-height:26px;padding:4px 9px!important;
    border-radius:999px!important;font-size:10.75px!important;font-weight:700!important;line-height:1.15;
  }
  .bang-tm table.data td.td-conno,
  .bang-tm table.data td.td-gio,
  .bang-tm table.data td.td-nv{font-size:11px!important;line-height:1.35;color:var(--text-muted)!important;font-weight:500!important;}
  .bang-tm table.data td.td-conno.am{color:var(--red)!important;font-weight:700!important;}
  .bang-tm table.data td.td-gio .tm-gio-chinh,
  .bang-tm table.data td.td-gio .tm-ngay-ghi{display:inline!important;font-size:inherit!important;color:inherit!important;}
  .bang-tm table.data td.td-gio .tm-ngay-ghi{margin:0 0 0 4px!important;}

  /* Note input and detail action share one restrained footer row. The original
     note input/event hooks stay live, so persistence semantics do not change. */
  .bang-tm table.data td.col-ghichu{
    box-sizing:border-box;display:flex!important;align-items:center;gap:6px;
    flex:1 1 210px!important;width:auto!important;min-width:0!important;
    margin:5px 0 0!important;padding:8px 0 0!important;border-top:1px solid var(--line-2)!important;
  }
  .bang-tm table.data td.col-ghichu::before{
    content:"Ghi chú:";flex:0 0 auto;color:var(--text-muted);font-size:11px;font-weight:600;
  }
  .bang-tm table.data td.col-ghichu .inp-ghichu{
    flex:1 1 auto;box-sizing:border-box;width:auto!important;min-width:0!important;max-width:100%!important;
    height:40px!important;min-height:40px!important;padding:7px 9px!important;border-radius:8px!important;font-size:12.5px!important;
  }
  .bang-tm table.data td.col-ghichu .ghichu-xem{flex:1 1 auto;min-width:0;font-size:12.5px!important;line-height:1.35;}
  .bang-tm table.data td.td-thaotac{
    box-sizing:border-box;flex:0 0 44px!important;width:44px!important;min-width:44px!important;
    margin:5px 0 0!important;padding:8px 0 0!important;border-top:1px solid var(--line-2)!important;
    text-align:right!important;
  }
  .bang-tm table.data td.td-thaotac .tm-detail-open{
    box-sizing:border-box;width:44px!important;height:44px!important;min-height:44px!important;
    margin:0!important;border-radius:9px!important;
  }
  .bang-tm table.data td.td-thaotac .tm-detail-open svg{width:21px!important;height:21px!important;}
}

@media(min-width:560px) and (max-width:900px){
  .tm-ghinhan .tm-ghi-form{grid-template-columns:repeat(2,minmax(0,1fr))!important;column-gap:10px!important;}
  .tm-ghinhan .tm-o-makh{grid-column:1;}
  .tm-ghinhan .tm-o-ten{grid-column:2;}
  .tm-ghinhan .tm-o-tien,.tm-ghinhan .tm-ghi-form .tm-btn{grid-column:1 / -1!important;}
}

@media(min-width:821px) and (max-width:900px){
  body:has(#tm-loc-bar) #tb-tim-boc,
  body:has(#tm-loc-bar) #tb-tim{
    box-sizing:border-box;height:44px!important;min-height:44px!important;
  }
}

@media(max-width:430px){
  .bang-tm table.data td.td-conno,
  .bang-tm table.data td.td-gio,
  .bang-tm table.data td.td-nv{flex:0 1 auto!important;}
  .bang-tm table.data td.td-gio::before{content:"·"!important;margin:0 1px!important;}
  .bang-tm table.data td.td-nv::before{content:"· NV "!important;margin:0!important;}
  .bang-tm table.data td.col-ghichu{flex-basis:calc(100% - 52px)!important;}
}

@media(min-width:901px){
  /* Explicit desktop firewall: table mechanics remain the unchanged desktop
     table; new filter labels and reset copy do not alter its established row. */
  .tm-filter-field{display:contents;}
  .tm-filter-field>label,.tm-reset-label{display:none!important;}
}

/* ============================================================================
   P3-C0-MOBILE-CLOSURE-02-POST-PREPROD-CASH-RF-01
   Cash-only presentation closure. Business fields, GET/POST names, selection,
   note persistence, detail actions and the single table DOM remain unchanged.
   ========================================================================== */
@media(max-width:900px){
  /* Mobile KPI authority: four full-width rows at every mobile viewport. */
  .tong-bar-tm{
    grid-template-columns:minmax(0,1fr)!important;
    width:100%;
  }
  .tong-bar-tm>.kpi{
    box-sizing:border-box;min-height:62px;padding:9px 12px!important;
    border-right:0!important;border-bottom:1px solid var(--line-2)!important;
  }
  .tong-bar-tm>.kpi:last-child{border-bottom:0!important;}
  .tong-bar-tm .kpi-so{white-space:nowrap!important;overflow-wrap:normal!important;}

  /* One local, labelled search authority across the complete mobile band. */
  body:has(#tm-loc-bar) #tb-tim-boc{display:none!important;}
  #tm-loc-bar .tm-mobile-search{
    display:grid!important;grid-template-columns:minmax(0,1fr) 64px!important;
    gap:8px!important;width:100%;min-width:0;
  }
  #tm-loc-bar .tm-mobile-search-submit{
    width:64px!important;min-width:64px!important;max-width:64px!important;
    padding:0!important;
  }
  #tm-loc-bar>.adp-control-reset{
    justify-self:end!important;width:44px!important;min-width:44px!important;
    max-width:44px!important;height:44px!important;min-height:44px!important;
    padding:0!important;justify-content:center!important;
  }
  #tm-loc-bar>.adp-control-reset .tm-reset-label{display:none!important;}

  /* Card header: #STT · Mã KH, then building badge and the 44px checkbox target. */
  .bang-tm table.data td.td-stt{
    display:block!important;order:1!important;flex:0 0 auto!important;
    width:auto!important;padding:0!important;color:var(--text-muted)!important;
    font-size:12px!important;font-weight:600!important;line-height:1.25!important;
  }
  .bang-tm table.data td.td-stt::before{content:"#";}
  .bang-tm table.data td.td-stt::after{content:" ·";}
  .bang-tm table.data td.td-makh{order:2!important;flex:1 1 96px!important;}
  .bang-tm table.data td.td-toa{order:3!important;align-self:center!important;}
  .bang-tm table.data td.td-chon{
    order:4!important;align-self:center!important;flex:0 0 44px!important;
    width:44px!important;margin-left:0!important;text-align:center!important;
  }
  .bang-tm table.data td.td-chon:empty{display:none!important;}
  .bang-tm table.data td.td-chon .tm-checkbox-touch{
    width:44px!important;height:44px!important;margin:-8px 0!important;
  }
  .bang-tm table.data td.td-ten{order:5!important;}
  .bang-tm table.data td.td-tien{order:6!important;}
  .bang-tm table.data td.td-tt{order:7!important;}
  .bang-tm table.data td.td-conno{order:8!important;}
  .bang-tm table.data td.td-gio{order:9!important;}
  .bang-tm table.data td.td-nv{
    order:10!important;color:var(--navy)!important;font-weight:600!important;
  }
  .bang-tm table.data td.col-ghichu{
    order:11!important;flex:1 0 calc(100% - 54px)!important;
  }
  .bang-tm table.data td.col-ghichu .inp-ghichu{
    height:44px!important;min-height:44px!important;
  }
  .bang-tm table.data td.td-thaotac{order:12!important;}
}

@media(min-width:901px){
  /* Desktop firewall: native table semantics.
     RF-03 root-cause fix — the previous firewall set overflow-x:auto here, which
     turned .bang-scroll into a scroll container on the WHOLE desktop band. That
     violates the documented base rule (see the .bang-scroll note near the top of
     this file) and makes the shared `table.data thead th{position:sticky;
     top:64px;z-index:2}` header stick WRONG inside the short box: it shifts down
     ~64px, lands on top of the (single) data row and — with z-index:2 — paints
     OVER it, so the row reads as hidden even though the DOM says "1 lượt".
     Fix = do NOT force a scroll container here; let the base govern:
       • ≥1001px  → base .bang-scroll is empty → overflow visible → the table
                    scrolls with the PAGE and the header sticks under the topbar,
                    exactly like every other data table, so real rows render;
       • 901–1000px → base `@media(max-width:1000px){.bang-scroll{overflow-x:auto}}`
                    still gives local horizontal scroll (no page overflow); the
                    RF-03 sticky reset just below keeps the header at the box top
                    in that container so it can never overlap the row. */
  .bang-tm .bang-scroll{
    box-sizing:border-box;width:100%;max-width:100%;
  }
  .bang-tm table.data{display:table;width:100%;}
  .bang-tm table.data tbody{display:table-row-group;}
  .bang-tm table.data tr{display:table-row;}
  .bang-tm .data-tm td.td-toa,
  .bang-tm .data-tm td.td-makh{
    overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  }
  .bang-tm .adp-control-toolbar>.adp-control-group--cash-list{
    min-width:0!important;max-width:100%;
  }
}

@media(min-width:901px) and (max-width:1100px){
  /* RF-03: this is the only desktop band where the cash table is deliberately
     kept wider than the sidebar-reduced content (`.data-tm{min-width:1040px}`
     below), so it must scroll LOCALLY here instead of forcing a page-wide
     horizontal scrollbar. Enable the local scroll container across the whole
     band (the shared base only covers ≤1000px) and pin the sticky header to the
     box top: inside a horizontal-only scroller the shared `top:64px` would shift
     the header down onto the row (z-index:2) and hide it — `top:0` keeps it at
     the box top, where it never overlaps a data row. Above 1100px the table fits
     the content, so no container is created and the header sticks under the
     topbar with normal page scrolling. */
  .bang-tm .bang-scroll{overflow-x:auto;overflow-y:visible;}
  .bang-tm table.data thead th{top:0;}
}

@media(min-width:901px) and (max-width:1100px){
  /* The desktop boundary has a sidebar-reduced content width. Keep complete
     field groups readable and let only the factual table scroll locally. */
  .tong-bar-tm{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .tong-bar-tm>.kpi{min-width:0;}
  .tong-bar-tm .kpi-so{white-space:nowrap;}
  .tm-ghinhan{
    display:block!important;padding:0!important;overflow:hidden!important;
  }
  .tm-ghinhan .tm-ghi-head{
    width:auto!important;min-width:0!important;margin:0!important;
    padding:14px 16px 0!important;white-space:normal!important;
  }
  .tm-ghinhan .tm-ghi-body{
    width:100%!important;padding:12px 16px 16px!important;border-left:0!important;
  }
  .tm-ghinhan .tm-ghi-form{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;width:100%!important;
  }
  .tm-ghinhan .tm-o{
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    gap:5px!important;width:100%!important;min-width:0!important;
  }
  .tm-ghinhan .tm-o>.tm-o-ico{display:none!important;}
  .tm-ghinhan .tm-o>.adp-field-label{
    flex:0 0 auto!important;width:auto!important;height:auto!important;
    white-space:nowrap!important;
  }
  .tm-ghinhan .tm-o .tm-inp-wrap{width:100%!important;min-width:0!important;}
  .tm-ghinhan .tm-o-makh{grid-column:1;}
  .tm-ghinhan .tm-o-ten{grid-column:2;}
  .tm-ghinhan .tm-o-tien{grid-column:1;}
  .tm-ghinhan .tm-ghi-form .tm-btn{
    grid-column:2!important;width:100%!important;min-width:0!important;
    margin:0!important;align-self:end!important;justify-self:stretch!important;
  }
  .bang-tm .data-tm{min-width:1040px;}
}

/* RF-04: the RF-02 `@media(min-width:1260px)` block that hid the Tên label/icon
   and stretched the removed `.tm-customer-summary` across the field track is
   deleted — the Tên field is now an ordinary labelled readonly input. */

/* ============================================================================
   P3-C0-MOBILE-CLOSURE-02-POST-PREPROD-CASH-RF-02
   Cash-only review-fix: pair the final mobile filter with reset and restore the
   established wide-desktop intake hierarchy. No form/action hooks change.
   ========================================================================== */
@media(max-width:900px){
  #tm-loc-bar{
    grid-template-columns:minmax(0,1fr) 44px!important;
    align-items:end!important;
  }
  #tm-loc-bar .tm-mobile-search,
  #tm-loc-bar .tm-filter-field{
    grid-column:1 / -1!important;
  }
  #tm-loc-bar .tm-filter-field:nth-last-child(2){
    grid-column:1!important;
  }
  #tm-loc-bar>.adp-control-reset{
    grid-column:2!important;align-self:end!important;justify-self:end!important;
    width:44px!important;min-width:44px!important;max-width:44px!important;
    height:44px!important;min-height:44px!important;padding:0!important;
  }
  #tm-loc-bar>.adp-control-reset .tm-reset-label{display:none!important;}
}

@media(min-width:1101px) and (max-width:1259px){
  /* RF-04: narrow desktop (requirement E) — balanced 2-col / 2-row grid. All
     three field groups are full-width flex-column cells with one-line labels
     (no vertical label, no card). Range trimmed to ≤1259 so ≥1260 uses the
     one-row flex layout (requirement A). */
  .tm-ghinhan{display:block!important;padding:0!important;overflow:hidden!important;}
  .tm-ghinhan .tm-ghi-head{
    width:auto!important;min-width:0!important;margin:0!important;
    padding:14px 16px 0!important;white-space:normal!important;
  }
  .tm-ghinhan .tm-ghi-body{
    width:100%!important;padding:12px 16px 16px!important;border-left:0!important;
  }
  .tm-ghinhan .tm-ghi-form{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;width:100%!important;
  }
  .tm-ghinhan .tm-o{
    display:flex!important;flex-direction:column!important;align-items:stretch!important;
    gap:5px!important;width:100%!important;min-width:0!important;
  }
  .tm-ghinhan .tm-o>.tm-o-ico{display:none!important;}
  .tm-ghinhan .tm-o>.adp-field-label{
    display:block!important;flex:0 0 auto!important;width:auto!important;height:auto!important;
    white-space:nowrap!important;
  }
  .tm-ghinhan .tm-o .tm-inp-wrap{width:100%!important;min-width:0!important;}
  .tm-ghinhan .tm-o-makh{grid-column:1;}
  .tm-ghinhan .tm-o-ten{grid-column:2;}
  .tm-ghinhan .tm-o-tien{grid-column:1;}
  .tm-ghinhan .tm-ghi-form .tm-btn{
    grid-column:2!important;grid-row:auto!important;width:100%!important;min-width:0!important;
    margin:0!important;align-self:end!important;justify-self:stretch!important;
  }
}

/* RF-04: the RF-02 `@media(min-width:1320px)` grid + `.tm-o-ten` sub-grid block
   (which existed only to seat the removed `.tm-customer-summary` card) is
   deleted. The complete desktop intake layout is now defined once, in the
   authoritative RF-04 block at the very end of this file (see below). */

/* ============================================================================
   P3-C0-MOBILE-CLOSURE-02-POST-PREPROD-CASH-RF-07 — AUTHORITATIVE INTAKE LAYOUT
   RF-04 regressed the desktop "Nhận tiền mặt" hierarchy: labels sat ABOVE the
   inputs, the debt amount dropped under Tên khách hàng, and the amount helper
   fell to the bottom of the card. RF-05 restores the original inline hierarchy:
   every field is  [icon] [label] [control]  on ONE horizontal axis; the Tên
   field shows ONLY the name (no debt / status / helper line under it); the
   compare helper (= / < / > công nợ) is a single one-line row that belongs to
   the Số tiền field alone. The three field groups scale together. Controls use
   white ZNS-style backgrounds. Presentation only — no field/name/id/GET/POST/
   handler change; mobile ≤900px untouched. Highest specificity + last in file
   → wins over every legacy intake rule (incl. the RF-04 blocks above). */

/* White, ZNS-style controls (also overrides the grey readonly Tên background). */
.tm-ghinhan .tm-o .tm-inp,
.tm-ghinhan .tm-o .tm-inp-readonly{
  background:var(--white)!important;border:1px solid var(--line)!important;
  border-radius:9px!important;color:var(--text)!important;
}

.tm-ghinhan .tm-hint--error{color:var(--red);}

@media(min-width:901px){
  .tm-ghinhan{
    display:flex!important;align-items:flex-start!important;gap:16px!important;
    padding:13px 18px!important;overflow:visible!important;
  }
  /* head "Nhận tiền mặt" + vertical divider before the fields */
  .tm-ghinhan .tm-ghi-head{
    flex:0 0 auto!important;width:auto!important;min-width:0!important;
    height:40px!important;margin:0!important;padding:0!important;white-space:nowrap!important;align-self:flex-start!important;
  }
  .tm-ghinhan .tm-ghi-body{
    flex:1 1 auto!important;min-width:0!important;
    padding:0 0 0 16px!important;border-left:1px solid var(--line)!important;
  }
  .tm-ghinhan .tm-ghi-form{
    display:flex!important;align-items:flex-start!important;gap:12px!important;
    width:100%!important;margin:0!important;
  }
  /* Field = inline [icon][label][control] on grid row 1; a reserved one-line row
     2 carries the helper for THIS field only (empty for Mã KH / Tên KH), which
     keeps all three groups the same height and aligned. */
  .tm-ghinhan .tm-o{
    display:grid!important;
    grid-template-columns:auto auto minmax(0,1fr)!important;
    grid-template-rows:40px auto!important;
    align-items:center!important;column-gap:4px!important;row-gap:0!important;min-width:0!important;
  }
  .tm-ghinhan .tm-o-makh,
  .tm-ghinhan .tm-o-ten,
  .tm-ghinhan .tm-o-tien{flex:1 1 0!important;min-width:0!important;}
  .tm-ghinhan .tm-o>.tm-o-ico{
    display:inline-flex!important;grid-column:1!important;grid-row:1!important;
    flex:0 0 auto!important;width:15px!important;height:15px!important;color:var(--orange)!important;
  }
  .tm-ghinhan .tm-o>.tm-o-ico .ic,
  .tm-ghinhan .tm-o>.tm-o-ico svg{width:15px!important;height:15px!important;}
  .tm-ghinhan .tm-o>.adp-field-label{
    grid-column:2!important;grid-row:1!important;margin:0!important;
    font-size:12px!important;line-height:16px!important;font-weight:600!important;
    color:var(--navy)!important;white-space:nowrap!important;
  }
  .tm-ghinhan .tm-o>.tm-inp-wrap{
    grid-column:3!important;grid-row:1!important;width:100%!important;min-width:0!important;height:40px!important;
  }
  .tm-ghinhan .tm-o>.tm-inp{width:100%!important;min-width:0!important;height:40px!important;padding:0 8px!important;}
  /* keep room for the "đ" suffix on the amount input */
  .tm-ghinhan .tm-o-tien>.tm-inp-tien{padding-right:24px!important;}
  /* Status belongs to the amount field only; an empty state reserves no row. */
  .tm-ghinhan .tm-o>.tm-hint{
    grid-column:1 / -1!important;grid-row:2!important;justify-self:end!important;margin:10px 0 0!important;padding:0!important;
    min-height:0!important;line-height:16px!important;font-size:11.5px!important;
    white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important;
  }
  .tm-ghinhan .tm-o>.tm-hint:empty{display:none!important;}
  /* Debt comparison reuses the system's compact status-chip geometry/tone and
     overrides legacy helper declarations that carried !important. */
  .tm-ghinhan .tm-o>.tm-debt-status{
    box-sizing:border-box!important;display:inline-flex!important;align-items:center!important;
    width:max-content!important;max-width:none!important;min-height:24px!important;
    padding:3px 7px!important;border:1px solid transparent!important;border-radius:999px!important;
    font-size:11.5px!important;font-weight:650!important;line-height:16px!important;white-space:nowrap!important;
  }
  .tm-ghinhan .tm-o>.tm-debt-status--equal{color:#067647!important;background:#ECFDF3!important;border-color:#ABEFC6!important;}
  .tm-ghinhan .tm-o>.tm-debt-status--under{color:#B54708!important;background:#FFFAEB!important;border-color:#FEDF89!important;}
  .tm-ghinhan .tm-o>.tm-debt-status--over{color:#175CD3!important;background:#EFF8FF!important;border-color:#B2DDFF!important;}
  .tm-ghinhan .tm-o>.tm-debt-status--error{color:#B42318!important;background:#FEF3F2!important;border-color:#FECDCA!important;}
  .tm-ghinhan .tm-ghi-form>.tm-btn{
    flex:0 0 auto!important;align-self:flex-start!important;
    height:40px!important;min-height:40px!important;min-width:112px!important;width:auto!important;margin:0!important;white-space:nowrap!important;
  }
}

@media(min-width:901px) and (max-width:1259px){
  /* Requirement E — the three fields may wrap to two rows, but each field keeps
     the inline [icon][label][control] hierarchy. */
  .tm-ghinhan .tm-ghi-form{flex-wrap:wrap!important;}
  .tm-ghinhan .tm-o-makh,
  .tm-ghinhan .tm-o-ten,
  .tm-ghinhan .tm-o-tien{flex:1 1 calc(50% - 12px)!important;}
  .tm-ghinhan .tm-ghi-form>.tm-btn{flex:1 1 100%!important;align-self:stretch!important;justify-content:center!important;}
}

/* ============================================================================
   P3-C0-MOBILE-CLOSURE-02-POST-PREPROD-CASH-MOBILE-RF-03
   Authoritative CASH MOBILE presentation (<=900px). Cash adopts the Công nợ
   sinh hoạt (SH) mobile experience as its DIRECT UI authority:
     • outer width/padding == SH content box;
     • KPI == SH `.kpi` rhythm (44px round icon / 21px glyph / 16-18 padding /
       kpi-nhan 12px-600 / kpi-so 22px-800/-.5px), one full-width row per metric;
     • intake + list controls sized to SH mobile controls (search input 44px,
       building select 36px, reset 36px, submit "Tìm" 44px);
     • the cash card is the SH label|value row grammar (per-cell
       `label 34% | value` from data-label, matching the SH <=760 card);
     • checkbox is the single documented Cash exception (STT row, right aligned);
     • the batch action is a sticky bottom bar shown only when >=1 is selected.
   The card / list toolbar / batch / pagination rules are scoped under the
   `#tm-live-table` id so this final layer decisively supersedes every earlier
   pure-class cash-mobile rule (compact / RF-01 / RF-02) without whack-a-mole.
   Desktop RF-07 (>=901px) is untouched. Presentation only — no field/name/id/
   GET/POST/handler/selection/note/pagination/business change.
   ========================================================================== */
@media(max-width:900px){
  /* ---- Fluid width root fix (RF-03-RF-02 F1) ----
     At <=900 the shell is `.app-shell{display:flex;flex-direction:column;
     align-items:flex-start}`. `align-items:flex-start` means `.content` is NOT
     stretched on the cross (horizontal) axis, so it collapses to its max-content
     width. Because Cash is fully fluid (min-width:0 everywhere) that max-content
     is small (~430px), which made Cash content look FIXED/narrow and stop growing
     past ~430px on wider mobile/landscape viewports. Force the Cash content box
     (page-scoped via :has(#tm-live-table)) to stretch to the full available
     width so every Cash region follows the viewport. No global `.content`
     change, no fixed/max-width, no transform, no 100vw. */
  .content:has(#tm-live-table){align-self:stretch!important;width:auto!important;}

  /* ---- Outer-width parity: every cash region fills the content box fluidly ---- */
  #tm-live-kpi,.tong-bar-tm,.tm-ghinhan,#tm-live-table,.bang-tm{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;
    margin-left:0!important;margin-right:0!important;
  }

  /* ---- KPI: SH `.kpi` rhythm, one explicit full-width row per cash metric ---- */
  .tong-bar-tm{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;margin:0 0 16px!important;
    border-radius:var(--radius-lg)!important;overflow:hidden!important;
  }
  .tong-bar-tm>.kpi{
    box-sizing:border-box!important;display:flex!important;align-items:center!important;
    width:100%!important;min-width:0!important;min-height:92px!important;
    padding:16px 18px!important;gap:13px!important;
    border-right:0!important;border-bottom:1px solid var(--line-2)!important;
  }
  .tong-bar-tm>.kpi:last-child{border-bottom:0!important;}
  .tong-bar-tm .kpi-ic{
    width:44px!important;height:44px!important;flex:0 0 44px!important;
    border-radius:50%!important;box-shadow:none!important;
  }
  .tong-bar-tm .kpi-ic .ic,.tong-bar-tm .kpi-ic svg{width:21px!important;height:21px!important;}
  .tong-bar-tm .kpi-txt,.tong-bar-tm .tm-kpi-dau{min-width:0!important;width:100%!important;}
  .tong-bar-tm .kpi-nhan{
    margin:0 0 2px!important;font-size:12px!important;font-weight:600!important;
    line-height:1.35!important;color:var(--text-muted)!important;
  }
  .tong-bar-tm .kpi-so{
    max-width:100%!important;font-size:clamp(18px,5.2vw,22px)!important;font-weight:800!important;
    line-height:1.15!important;letter-spacing:-.5px!important;font-variant-numeric:tabular-nums!important;
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  }
  .tong-bar-tm .kpi-don{margin-top:3px!important;font-size:11.5px!important;line-height:1.3!important;}

  /* ---- Intake "Nhận tiền mặt": icon BEFORE label; SH control sizes ---- */
  .tm-ghinhan{
    display:block!important;width:100%!important;margin:0 0 16px!important;
    padding:0!important;border-radius:var(--radius-lg)!important;overflow:hidden!important;
  }
  .tm-ghinhan .tm-ghi-head{
    display:flex!important;align-items:center!important;width:100%!important;height:auto!important;
    margin:0!important;padding:16px 16px 0!important;gap:10px!important;white-space:normal!important;
  }
  .tm-ghinhan .tm-ghi-icon{width:34px!important;height:34px!important;flex:0 0 34px!important;border-radius:10px!important;}
  .tm-ghinhan .tm-ghi-icon svg{width:19px!important;height:19px!important;}
  .tm-ghinhan .tm-ghi-head h2{font-size:16px!important;line-height:1.35!important;}
  .tm-ghinhan .tm-ghi-body{display:block!important;width:100%!important;padding:16px!important;border:0!important;}
  .tm-ghinhan .tm-ghi-form{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;min-width:0!important;margin:0!important;gap:14px!important;align-items:stretch!important;
  }
  /* Field = [icon][label] on row 1, control on row 2, helper on row 3. The icon
     sits INLINE before the label (never above it). */
  .tm-ghinhan .tm-o,
  .tm-ghinhan .tm-o-makh,.tm-ghinhan .tm-o-ten,.tm-ghinhan .tm-o-tien{
    display:grid!important;grid-column:1!important;
    grid-template-columns:auto minmax(0,1fr)!important;
    align-items:center!important;column-gap:6px!important;row-gap:6px!important;
    width:100%!important;min-width:0!important;
  }
  .tm-ghinhan .tm-o>.tm-o-ico{
    display:inline-flex!important;grid-column:1!important;grid-row:1!important;
    align-items:center!important;justify-content:center!important;flex:0 0 auto!important;
    width:16px!important;height:16px!important;color:var(--orange)!important;
  }
  .tm-ghinhan .tm-o>.tm-o-ico .ic,.tm-ghinhan .tm-o>.tm-o-ico svg{width:16px!important;height:16px!important;}
  .tm-ghinhan .tm-o>.adp-field-label{
    grid-column:2!important;grid-row:1!important;justify-self:start!important;margin:0!important;
    color:var(--navy)!important;font-size:12.5px!important;font-weight:700!important;
    line-height:1.35!important;white-space:normal!important;
  }
  .tm-ghinhan .tm-o>.tm-inp-wrap{
    grid-column:1 / -1!important;grid-row:2!important;
    box-sizing:border-box!important;width:100%!important;min-width:0!important;height:auto!important;
  }
  /* Group 1 — Mã KH input == SH mobile search input (44px). */
  .tm-ghinhan .tm-o-makh .tm-inp{
    box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:100%!important;
    height:44px!important;min-height:44px!important;padding:0 12px!important;border-radius:8px!important;font-size:14px!important;
  }
  /* Group 2 — Tên khách hàng + Số tiền thực thu == SH mobile building select (36px). */
  .tm-ghinhan .tm-o-ten .tm-inp,
  .tm-ghinhan .tm-o-tien .tm-inp{
    box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:100%!important;
    height:36px!important;min-height:36px!important;padding:0 12px!important;border-radius:8px!important;font-size:13px!important;
  }
  .tm-ghinhan .tm-o-tien .tm-inp-tien{padding-right:28px!important;}
  /* Helper is LOCKED (text/color/semantics): keep the RF-01 pill presentation
     verbatim, only re-seat it on the field's third grid row. */
  .tm-ghinhan .tm-o>.tm-hint{
    grid-column:1 / -1!important;grid-row:3!important;justify-self:start!important;
    margin:0!important;padding:0!important;min-height:0!important;
  }
  .tm-ghinhan .tm-o>.tm-hint:empty{display:none!important;}
  .tm-ghinhan .tm-o>.tm-hint:not(:empty){
    box-sizing:border-box!important;position:static!important;display:flex!important;align-items:center!important;
    width:fit-content!important;max-width:100%!important;min-height:38px!important;
    margin:3px 0 0!important;padding:8px 12px!important;border:1px solid transparent!important;
    border-radius:999px!important;box-shadow:none!important;font-size:12px!important;font-weight:700!important;
    line-height:1.4!important;white-space:normal!important;overflow-wrap:anywhere!important;
  }
  .tm-ghinhan .tm-o>.tm-hint.tm-debt-status--equal{color:#067647!important;background:#ECFDF3!important;border:1px solid #ABEFC6!important;}
  .tm-ghinhan .tm-o>.tm-hint.tm-debt-status--under{color:#B54708!important;background:#FFFAEB!important;border:1px solid #FEDF89!important;}
  .tm-ghinhan .tm-o>.tm-hint.tm-debt-status--over{color:#175CD3!important;background:#EFF8FF!important;border:1px solid #B2DDFF!important;}
  .tm-ghinhan .tm-o>.tm-hint.tm-debt-status--error{color:#B42318!important;background:#FEF3F2!important;border:1px solid #FECDCA!important;}
  /* Ghi nhận height == SH "Tìm" submit (44px); never taller. */
  .tm-ghinhan .tm-ghi-form>.tm-btn{
    box-sizing:border-box!important;grid-column:1!important;width:100%!important;min-width:0!important;
    height:44px!important;min-height:44px!important;max-height:44px!important;margin:0!important;
    border-radius:8px!important;align-self:stretch!important;justify-self:stretch!important;
    justify-content:center!important;font-size:14px!important;
  }

  /* ---- List toolbar: SH "Danh sách công nợ" cluster order ---- */
  #tm-live-table .bang-tm .bang-dau{
    box-sizing:border-box!important;display:flex!important;flex-direction:column!important;
    align-items:stretch!important;width:100%!important;padding:16px!important;gap:14px!important;
  }
  #tm-live-table .bang-tm .bang-dau>h2{order:1!important;width:100%!important;margin:0!important;font-size:16px!important;line-height:1.4!important;white-space:normal!important;}
  #tm-live-table .bang-tm .bang-dau>.bang-ngan{display:none!important;}
  #tm-live-table #tm-loc-bar{
    order:2!important;display:grid!important;grid-template-columns:minmax(0,1fr) 36px!important;
    align-items:end!important;width:100%!important;min-width:0!important;margin:0!important;gap:12px 10px!important;flex-wrap:nowrap!important;
  }
  /* 1) search input + Tìm */
  #tm-live-table #tm-loc-bar .tm-mobile-search{
    display:grid!important;grid-template-columns:minmax(0,1fr) 64px!important;grid-column:1 / -1!important;
    width:100%!important;min-width:0!important;gap:8px!important;
  }
  #tm-live-table #tm-loc-bar .tm-mobile-search>label{
    display:block!important;grid-column:1 / -1!important;color:var(--navy)!important;
    font-size:12.5px!important;font-weight:700!important;line-height:1.35!important;
  }
  #tm-live-table #tm-mobile-search-input{
    box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:none!important;
    height:44px!important;min-height:44px!important;margin:0!important;padding:0 12px!important;border-radius:8px!important;
  }
  #tm-live-table #tm-loc-bar .tm-mobile-search-submit{
    box-sizing:border-box!important;width:64px!important;min-width:64px!important;max-width:64px!important;
    height:44px!important;min-height:44px!important;margin:0!important;padding:0!important;
    border-radius:8px!important;justify-content:center!important;
  }
  /* 2) Tòa · 3) Trạng thái · 4) Nhân viên — self-describing selects, no loose label */
  #tm-live-table #tm-loc-bar .tm-filter-field{
    display:flex!important;grid-column:1 / -1!important;flex-direction:column!important;
    align-items:stretch!important;width:100%!important;min-width:0!important;gap:0!important;
  }
  #tm-live-table #tm-loc-bar .tm-filter-field>label{display:none!important;}
  #tm-live-table #tm-loc-bar .tm-filter-field>select{
    box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:none!important;
    height:36px!important;min-height:36px!important;margin:0!important;border-radius:8px!important;
  }
  /* the last filter shares its row with the reset (Nhân viên + reset, or the
     final visible filter + reset when the role has no Nhân viên select) */
  #tm-live-table #tm-loc-bar .tm-filter-field:has(+ .adp-control-reset){grid-column:1!important;}
  #tm-live-table #tm-loc-bar>.adp-control-reset{
    box-sizing:border-box!important;display:inline-flex!important;grid-column:2!important;
    justify-self:end!important;align-self:end!important;
    width:36px!important;min-width:36px!important;max-width:36px!important;
    height:36px!important;min-height:36px!important;padding:0!important;gap:0!important;justify-content:center!important;
  }
  #tm-live-table #tm-loc-bar>.adp-control-reset .tm-reset-label{display:none!important;}
  #tm-live-table #tm-loc-bar>.adp-control-reset svg{width:20px!important;height:20px!important;}
  #tm-live-table .bang-tm .bang-dau>.adp-control-excel{
    order:4!important;width:100%!important;height:44px!important;min-height:44px!important;
    margin:0!important;justify-content:center!important;
  }

  /* ---- Batch action = sticky bottom bar (visible only when >=1 selected) ---- */
  #tm-live-table .bang-tm .tm-batch-line{
    box-sizing:border-box!important;order:3!important;display:block!important;
    width:100%!important;min-width:0!important;margin:0!important;padding:0!important;
  }
  #tm-live-table .bang-tm .thanh-lo-tm{
    box-sizing:border-box!important;position:fixed!important;left:0!important;right:0!important;bottom:0!important;z-index:60!important;
    display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,auto)!important;align-items:center!important;
    width:100%!important;max-width:100%!important;margin:0!important;
    padding:12px 16px calc(12px + env(safe-area-inset-bottom))!important;gap:10px!important;
    border:0!important;border-top:1px solid var(--line)!important;border-radius:16px 16px 0 0!important;
    background:var(--white)!important;box-shadow:0 -6px 20px -8px rgba(15,17,60,.28)!important;
    transform:translateY(115%)!important;transition:transform .22s ease!important;pointer-events:none!important;
  }
  #tm-live-table .bang-tm .thanh-lo-tm.co-chon{transform:translateY(0)!important;pointer-events:auto!important;}
  #tm-live-table .bang-tm .thanh-lo-tm .tm-chon-dem{
    min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.35!important;
  }
  #tm-live-table .bang-tm .thanh-lo-tm .btn{
    box-sizing:border-box!important;width:auto!important;max-width:min(230px,60vw)!important;
    height:auto!important;min-height:46px!important;margin:0!important;padding:8px 14px!important;
    white-space:normal!important;text-align:center!important;line-height:1.2!important;justify-content:center!important;
  }
  /* Bottom compensation so the sticky bar never hides the last card, pagination
     or footer while the user works on a selected card near the bottom. */
  #tm-live-table .bang-tm:has(.thanh-lo-tm.co-chon){padding-bottom:calc(96px + env(safe-area-inset-bottom))!important;}
  .content:has(#tm-live-table .thanh-lo-tm.co-chon){padding-bottom:calc(96px + env(safe-area-inset-bottom))!important;}

  /* ======================================================================
     CASH CARD — SH label|value row grammar (direct SH-card template).
     One <table> DOM; each <tr> is a card, each <td> is a `label | value` row.
     ====================================================================== */
  #tm-live-table .bang-tm .bang-scroll{overflow:visible!important;}
  #tm-live-table .bang-tm table.data,
  #tm-live-table .bang-tm table.data tbody{display:block!important;width:100%!important;min-width:0!important;}
  #tm-live-table .bang-tm table.data{table-layout:auto!important;border-collapse:separate!important;}
  #tm-live-table .bang-tm table.data thead{position:absolute!important;left:-9999px!important;top:-9999px!important;}
  #tm-live-table .bang-tm table.data tbody{box-sizing:border-box!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;padding:12px!important;background:var(--bg-soft)!important;}

  /* Card shell == SH card (border / radius / white bg / soft shadow). */
  #tm-live-table .bang-tm table.data tr{
    box-sizing:border-box!important;display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;
    gap:0!important;
    width:100%!important;min-width:0!important;max-width:100%!important;margin:0!important;padding:0!important;
    border:1px solid var(--line)!important;border-radius:12px!important;background:var(--white)!important;
    box-shadow:var(--shadow-sm)!important;overflow:hidden!important;
  }
  #tm-live-table .bang-tm table.data tr.dong-chon{border-color:var(--tim)!important;box-shadow:0 0 0 2px var(--tim-tint)!important;}

  /* Row = SH grammar: label (34%, min 96px) on the left, value on the right. */
  #tm-live-table .bang-tm table.data td{
    box-sizing:border-box!important;display:flex!important;align-items:flex-start!important;gap:10px!important;
    width:100%!important;min-width:0!important;max-width:none!important;grid-column:1 / -1!important;
    margin:0!important;padding:9px 12px!important;border:0!important;border-bottom:1px solid var(--line-2)!important;
    text-align:left!important;vertical-align:top!important;white-space:normal!important;overflow:visible!important;
    text-overflow:clip!important;overflow-wrap:anywhere!important;word-break:break-word!important;
  }
  #tm-live-table .bang-tm table.data td::before{
    content:attr(data-label)!important;flex:0 0 34%!important;min-width:96px!important;max-width:34%!important;margin:0!important;
    color:var(--text-muted)!important;font-size:11.5px!important;font-weight:700!important;line-height:1.45!important;text-transform:none!important;
  }
  #tm-live-table .bang-tm table.data td>*{min-width:0!important;max-width:100%!important;}
  #tm-live-table .bang-tm table.data td:last-child{border-bottom:0!important;}

  /* Row order (SH sequence): STT · Tòa · Mã KH · Tên · Số tiền · Còn nợ ·
     Trạng thái · Thời gian · NV ghi · Ghi chú · Chi tiết. */
  /* RF-03-RF-01/RF-02: STT + checkbox share ONE visual row. STT stretches to the
     row height and centres vertically so it aligns with the 44px checkbox, and
     both cells' bottom dividers meet as one continuous line (see td.td-chon). */
  #tm-live-table .bang-tm table.data td.td-stt{
    display:flex!important;align-items:center!important;align-self:stretch!important;
    grid-column:1!important;grid-row:1!important;
  }
  #tm-live-table .bang-tm table.data td.td-stt::before{align-self:center!important;}
  #tm-live-table .bang-tm table.data td.td-stt::after{content:none!important;}
  #tm-live-table .bang-tm table.data td.td-toa{grid-column:1 / -1!important;grid-row:2!important;}
  #tm-live-table .bang-tm table.data td.td-makh{grid-column:1 / -1!important;grid-row:3!important;}
  #tm-live-table .bang-tm table.data td.td-ten{grid-column:1 / -1!important;grid-row:4!important;}
  #tm-live-table .bang-tm table.data td.td-tien{grid-column:1 / -1!important;grid-row:5!important;}
  #tm-live-table .bang-tm table.data td.td-conno{grid-column:1 / -1!important;grid-row:6!important;}
  #tm-live-table .bang-tm table.data td.td-tt{grid-column:1 / -1!important;grid-row:7!important;}
  #tm-live-table .bang-tm table.data td.td-gio{grid-column:1 / -1!important;grid-row:8!important;}
  #tm-live-table .bang-tm table.data td.td-nv{grid-column:1 / -1!important;grid-row:9!important;}
  #tm-live-table .bang-tm table.data td.col-ghichu{grid-column:1 / -1!important;grid-row:10!important;}
  #tm-live-table .bang-tm table.data td.td-thaotac{grid-column:1 / -1!important;grid-row:11!important;}
  /* labels always come from data-label (defeat legacy compact ::before/::after) */
  #tm-live-table .bang-tm table.data td.td-stt::before,
  #tm-live-table .bang-tm table.data td.td-conno::before,
  #tm-live-table .bang-tm table.data td.td-gio::before,
  #tm-live-table .bang-tm table.data td.td-nv::before,
  #tm-live-table .bang-tm table.data td.col-ghichu::before{content:attr(data-label)!important;margin:0!important;}

  /* Checkbox = the single Cash exception: same visual line as STT, hard right,
     never its own "Chọn" row and never breaking the SH row grammar. */
  #tm-live-table .bang-tm table.data td.td-chon{
    grid-column:2!important;grid-row:1!important;justify-self:end!important;align-self:stretch!important;
    display:flex!important;align-items:center!important;justify-content:flex-end!important;
    width:auto!important;min-width:0!important;margin:0!important;padding:6px 12px!important;border-bottom:1px solid var(--line-2)!important;
  }
  #tm-live-table .bang-tm table.data td.td-chon::before{content:none!important;}
  #tm-live-table .bang-tm table.data td.td-chon:empty{display:none!important;}
  #tm-live-table .bang-tm table.data td.td-chon .tm-checkbox-touch{width:44px!important;height:44px!important;margin:0!important;}

  /* Value presentation (SH parity + cash business colours). */
  #tm-live-table .bang-tm table.data td.td-stt{color:var(--text)!important;font-size:13px!important;font-weight:600!important;}
  #tm-live-table .bang-tm table.data td.td-makh b{color:var(--navy)!important;font-size:14px!important;font-weight:700!important;line-height:1.35!important;}
  #tm-live-table .bang-tm table.data td.td-ten{color:var(--navy)!important;font-size:13.5px!important;font-weight:600!important;line-height:1.4!important;}
  #tm-live-table .bang-tm table.data td.td-tien b{color:var(--orange-dark)!important;font-size:14px!important;font-weight:700!important;line-height:1.35!important;}
  #tm-live-table .bang-tm table.data td.td-conno,
  #tm-live-table .bang-tm table.data td.td-gio,
  #tm-live-table .bang-tm table.data td.td-nv{color:var(--text)!important;font-size:13px!important;font-weight:500!important;line-height:1.4!important;}
  #tm-live-table .bang-tm table.data td.td-conno.am{color:var(--red)!important;font-weight:700!important;}
  #tm-live-table .bang-tm table.data td.td-gio .tm-gio-chinh,
  #tm-live-table .bang-tm table.data td.td-gio .tm-ngay-ghi{display:inline!important;font-size:inherit!important;color:inherit!important;}
  #tm-live-table .bang-tm table.data td.td-gio .tm-ngay-ghi{margin-left:4px!important;}
  #tm-live-table .bang-tm table.data td.td-tt .tt{
    box-sizing:border-box!important;display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;
    min-width:0!important;max-width:100%!important;min-height:26px!important;padding:4px 10px!important;
    border-radius:999px!important;font-size:11px!important;font-weight:700!important;line-height:1.3!important;white-space:normal!important;
  }

  /* Ghi chú — label left; editable input (role allowed) or read-only text right. */
  #tm-live-table .bang-tm table.data td.col-ghichu .inp-ghichu{
    box-sizing:border-box!important;flex:1 1 auto!important;width:auto!important;min-width:0!important;max-width:100%!important;
    height:44px!important;min-height:44px!important;padding:8px 11px!important;border-radius:8px!important;font-size:13px!important;
  }
  #tm-live-table .bang-tm table.data td.col-ghichu .ghichu-xem{
    flex:1 1 auto!important;min-width:0!important;max-width:100%!important;
    font-size:13px!important;line-height:1.45!important;color:var(--text)!important;
  }

  /* Chi tiết — label left; compact eye icon at the value column. */
  #tm-live-table .bang-tm table.data td.td-thaotac .tm-detail-open{
    box-sizing:border-box!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
    width:44px!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0!important;border-radius:9px!important;
  }
  #tm-live-table .bang-tm table.data td.td-thaotac .tm-detail-open svg{width:21px!important;height:21px!important;}

  /* Empty state stays a single centred message inside the card grid. */
  #tm-live-table .bang-tm table.data td.table-empty-state{
    display:block!important;grid-column:1 / -1!important;width:100%!important;
    padding:28px 16px!important;border:0!important;text-align:center!important;color:var(--text-muted)!important;
  }
  #tm-live-table .bang-tm table.data td.table-empty-state::before{content:none!important;}

  /* Pagination: two calm rows with wrapping page controls. */
  #tm-live-table .bang-tm .pt-thanh,
  #tm-live-table .bang-tm .phantrang{box-sizing:border-box!important;width:100%!important;min-width:0!important;max-width:100%!important;}
  #tm-live-table .bang-tm .phantrang{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:center!important;
    padding:14px 12px!important;gap:12px!important;
  }
  #tm-live-table .bang-tm .pt-trai,
  #tm-live-table .bang-tm .pt-phai{
    box-sizing:border-box!important;display:flex!important;width:100%!important;min-width:0!important;
    align-items:center!important;justify-content:center!important;gap:7px!important;flex-wrap:wrap!important;text-align:center!important;
  }
  #tm-live-table .bang-tm .pt-trai select{height:44px!important;min-height:44px!important;}
  #tm-live-table .bang-tm .pt-phai .pt-info{flex:1 0 100%!important;margin:0 0 2px!important;text-align:center!important;}
  #tm-live-table .bang-tm .pt-nut{width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;}
}

/* RF-03-RF-01 F1: cash portrait KPI reuses SH portrait geometry EXACTLY.
   SH authority `.debt-kpi-strip > .kpi` @media(max-width:620px) == min-height:84px;
   padding:13px 14px (this file, line ~7029). No invented size; the earlier
   Cash-specific <=430 divergence (88px / 15px 16px) is removed. */
@media(max-width:620px){
  .tong-bar-tm>.kpi{min-height:84px!important;padding:13px 14px!important;}
}

@media(max-width:430px){
  .tm-ghinhan .tm-ghi-head{padding:16px 14px 0!important;}
  .tm-ghinhan .tm-ghi-body{padding:15px 14px 16px!important;}
  #tm-live-table .bang-tm .bang-dau{padding:14px!important;}
  #tm-live-table .bang-tm .thanh-lo-tm{grid-template-columns:minmax(0,1fr)!important;}
  #tm-live-table .bang-tm .thanh-lo-tm .btn{width:100%!important;max-width:none!important;}
  #tm-live-table .bang-tm table.data tbody{padding:10px!important;}
  /* RF-03-RF-01 F2: the <=430 card `::before` override (38% / min 88px) is
     removed so the SH card geometry `minmax(96px,34%)` (34% / min 96px, defined
     in the <=900 RF-03 block) is retained at portrait exactly. */
}
