/* =====================================================================
 *  list-50.css — Danh sách lao động: bảng máy tính + thẻ điện thoại
 *  Nạp SAU polish-46.css:
 *    <link rel="stylesheet" href="css/list-50.css?v=50a">
 *  Chỉ là CSS ghi đè (không đổi logic). Gỡ file này là về như cũ.
 *
 *  Thứ tự cột bảng (bản 50):
 *   1 ☐ · 2 STT · 3 Mã · 4 Họ tên · 5 Trạng thái · 6 Công ty · 7 Tổng công · 8 Ngày vào
 *   9 Ngày nghỉ · 10 SĐT · 11 Loại · 12 Người GT · 13 Ngân hàng · 14 Địa chỉ
 *   15 Giới tính · 16 Ngày sinh · 17 KQ PV · 18 Ảnh · 19 Ghi chú
 *   20-24 Tạo/Sửa (cột phụ, ẩn mặc định) · 25 Hành động
 * ===================================================================== */
:root {
  --l5-or: #e7770e;
  --l5-or-d: #b85a06;
  --l5-tint: #fff6ea;
  --l5-line: #f0e6da;
  --l5-line2: #f6efe6;
  --l5-ink: #2b2a28;
  --l5-mute: #8b867d;
  --l5-head: #faf5ee;
  --l5-zebra: #fffcf8;
  --l5-hover: #fff3e2;
  --l5-h: 34px;
}

/* =====================================================================
 * A) THANH CÔNG CỤ — một khối gọn, nút đều chiều cao, chia nhóm rõ
 * ===================================================================== */
.ld-toolbar {
  gap: 8px !important;
  padding: 8px 10px;
  margin-bottom: 10px !important;
  background: #fff;
  border: 1px solid var(--l5-line);
  border-radius: 14px;
  align-items: center;
}
.ld-toolbar .btn,
.ld-toolbar .btn-group > .btn {
  height: var(--l5-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 10px;
  white-space: nowrap;
}
.ld-toolbar .btn-group { flex: none; }
.ld-toolbar .btn-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ld-toolbar .btn-group > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ld-toolbar .btn-group > .adv-i { width: 32px; padding: 0; flex: none; }
.ld-toolbar .btn-group > .btn-group { display: inline-flex; }
.ld-toolbar .btn-group > .btn-group > .btn { border-radius: 0; }
.ld-toolbar .btn i { font-size: .98rem; line-height: 1; }
/* nhóm "xuất / in" bên trái, nhóm "hiển thị" đẩy về phải trên màn rộng */
@media (min-width: 992px) {
  .ld-toolbar #freezeColGroup { margin-left: auto; }
}
/* chữ phụ "Lao động" ở nút Excel / In: chỉ hiện khi màn thật rộng */
@media (min-width: 768px) and (max-width: 1599.98px) { .ld-toolbar .ld-opt { display: none; } }
@media (max-width: 767.98px) { #tab-list #dataDisplaySection .ld-toolbar .l5-audit-grp, #tab-list .ld-toolbar .l5-audit-grp { display: none !important; } }
/* nút Cột phụ (do 15-danh-sach-50.js thêm) */
.ld-toolbar .l5-audit-btn.active { background: var(--l5-or); border-color: var(--l5-or); color: #fff; }

/* =====================================================================
 * B) BẢNG MÁY TÍNH
 * ===================================================================== */
.table-wrapper {
  border-radius: 14px !important;
  border: 1px solid var(--l5-line) !important;
  box-shadow: 0 1px 2px rgba(60, 40, 10, .04), 0 6px 18px -10px rgba(60, 40, 10, .18) !important;
  /* chiều cao theo màn hình: tiêu đề luôn dính, thanh cuộn nằm sát đáy */
  max-height: calc(100vh - 150px) !important;
  min-height: 240px;
  background: #fff;
  scrollbar-gutter: stable;
}
#dataTable {
  --bs-table-bg: transparent;
  border-collapse: separate !important;
  border-spacing: 0;
  width: 100%;
  margin: 0 !important;
  font-size: .84rem;
  color: var(--l5-ink);
}
#dataTable > :not(caption) > * > * { border-width: 0 0 1px 0 !important; border-color: var(--l5-line2) !important; }
#dataTable td, #dataTable th { padding: 7px 8px; vertical-align: middle; }

/* tiêu đề: dính trên, chữ nhỏ viết hoa, một dòng */
#dataTable thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--l5-head) !important;
  color: #7a6f60;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
  text-align: left !important;
  white-space: nowrap;
  padding-top: 11px;
  padding-bottom: 11px;
  border-bottom: 1px solid #ead9c4 !important;
  box-shadow: 0 1px 0 #ead9c4;
}
#dataTable thead th .btn-link { font-size: .9rem; vertical-align: baseline; }

/* các dòng: kẻ ngang mảnh, xen kẽ màu rất nhạt, hover ấm */
#dataTable tbody tr:nth-child(even) > td { background: var(--l5-zebra); }
#dataTable tbody tr:hover > td { background: var(--l5-hover) !important; }
#dataTable tbody tr.bk-selected > td { background: #e8f1ff !important; }
#dataTable tbody tr.table-danger > td { background: #fff1f0 !important; }
#dataTable tbody tr.lb-st-left > td { color: #6b645a; }
#dataTable tbody tr.lb-vet-row > td:nth-child(2) { box-shadow: inset 3px 0 0 #e0a526; }

/* ---- độ rộng & kiểu từng cột ---- */
#dataTable th:nth-child(1), #dataTable td:nth-child(1) { width: 34px; min-width: 34px; padding-left: 6px; padding-right: 6px; text-align: center; }
#dataTable th:nth-child(2), #dataTable td:nth-child(2) { width: 40px; min-width: 40px; text-align: center !important; color: var(--l5-mute); font-variant-numeric: tabular-nums; }
/* Mã NLĐ / mã đợt */
#dataTable td:nth-child(3) { min-width: 84px; max-width: 110px; }
#dataTable td:nth-child(3) .fw-semibold { font-size: .82rem; font-variant-numeric: tabular-nums; }
/* Họ tên */
#dataTable td:nth-child(4) { min-width: 190px; max-width: 280px; white-space: normal !important; }
#dataTable td:nth-child(4) .lb-nm { font-size: .92rem; font-weight: 700 !important; letter-spacing: -.005em; flex-wrap: wrap; gap: 2px 4px; }
/* Trạng thái · Công ty · SĐT */
#dataTable td:nth-child(5) { width: 100px; min-width: 100px; }
#dataTable td:nth-child(6) { min-width: 110px; max-width: 160px; white-space: normal !important; }
#dataTable th:nth-child(7), #dataTable td:nth-child(7) { min-width: 64px; text-align: right !important; font-variant-numeric: tabular-nums; }
#dataTable td:nth-child(7) strong { font-size: 1rem; font-weight: 800; color: var(--l5-or-d); }
/* Ngày: không bao giờ xuống dòng, số thẳng hàng */
#dataTable td:nth-child(8), #dataTable td:nth-child(9), #dataTable td:nth-child(16) {
  min-width: 84px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* Tổng công (cột 7) nổi bật, canh phải; SĐT (cột 10) */
#dataTable td:nth-child(10) { min-width: 128px; white-space: nowrap; }
#dataTable td:nth-child(10) .phone-cell { font-variant-numeric: tabular-nums; letter-spacing: .04em; font-weight: 600; }
#dataTable td:nth-child(11), #dataTable td:nth-child(12) { min-width: 88px; }
#dataTable td:nth-child(13) { min-width: 170px; }
/* Địa chỉ & Ghi chú: tối đa 2 dòng, rê chuột xem đủ qua title (do JS gắn) */
#dataTable td:nth-child(14), #dataTable td:nth-child(19) {
  white-space: normal !important;
  min-width: 190px;
  max-width: 260px;
  line-height: 1.35;
}
#dataTable td:nth-child(14) > *, #dataTable td:nth-child(19) > * { max-width: 100%; }
#dataTable td.l5-clamp {
  display: table-cell;
}
#dataTable td.l5-clamp::before { content: none; }
#dataTable td .l5-cl {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
#dataTable td:nth-child(15), #dataTable td:nth-child(17) { min-width: 80px; }
#dataTable td:nth-child(18) { min-width: 70px; }
/* cột phụ (tạo / sửa) — nhỏ, nhạt */
#dataTable td:nth-child(n+20):nth-child(-n+24) { font-size: .76rem; color: var(--l5-mute); font-variant-numeric: tabular-nums; }
#dataTable td:nth-child(24), #dataTable th:nth-child(24) { text-align: center !important; }
/* ẩn / hiện cột phụ */
#dataTable.l5-hide-audit th:nth-child(n+20):nth-child(-n+24),
#dataTable.l5-hide-audit td:nth-child(n+20):nth-child(-n+24) { display: none; }

/* ---- Hành động: dính mép phải để luôn bấm được, không phải cuộn ngang ---- */
@media (min-width: 992px) {
  #dataTable th:last-child, #dataTable td:last-child {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #fff;
    box-shadow: -8px 0 10px -8px rgba(60, 40, 10, .22);
    padding-left: 10px;
  }
  #dataTable thead th:last-child { z-index: 5; background: var(--l5-head) !important; text-align: center !important; }
  #dataTable tbody tr:nth-child(even) > td:last-child { background: var(--l5-zebra); }
  #dataTable tbody tr:hover > td:last-child { background: var(--l5-hover) !important; }
  #dataTable tbody tr.bk-selected > td:last-child { background: #e8f1ff !important; }
  #dataTable td:last-child { text-align: center; }
  #dataTable td:last-child .btn, #dataTable td:last-child button {
    width: 30px; height: 30px; padding: 0 !important;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 9px; font-size: .9rem;
  }
}
/* cố định cột (Mã + Họ tên) đã có sẵn trong style.css — chỉ làm đẹp bóng & nền */
#dataTable.ld-freeze thead th:nth-child(3), #dataTable.ld-freeze thead th:nth-child(4) { background: var(--l5-head) !important; }
#dataTable.ld-freeze tbody td:nth-child(3), #dataTable.ld-freeze tbody td:nth-child(4) { background: #fff; }
#dataTable.ld-freeze tbody tr:nth-child(even) > td:nth-child(3),
#dataTable.ld-freeze tbody tr:nth-child(even) > td:nth-child(4) { background: var(--l5-zebra); }
#dataTable.ld-freeze tbody tr:hover > td:nth-child(3),
#dataTable.ld-freeze tbody tr:hover > td:nth-child(4) { background: var(--l5-hover) !important; }
#dataTable.ld-freeze tbody tr.bk-selected > td:nth-child(3),
#dataTable.ld-freeze tbody tr.bk-selected > td:nth-child(4) { background: #e8f1ff !important; }

/* dòng báo trống / đang tải */
#dataTable tbody tr.lb-empty-row > td { padding: 36px 12px; text-align: center; background: #fff !important; }

/* =====================================================================
 * C) PHÂN TRANG
 * ===================================================================== */
#paginationControls { gap: 4px; flex-wrap: wrap; justify-content: center; }
#paginationControls .page-link {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px !important; border: 1px solid var(--l5-line); color: var(--l5-ink); background: #fff;
  font-size: .82rem; font-weight: 600;
}
#paginationControls .page-item.active .page-link { background: var(--l5-or); border-color: var(--l5-or); color: #fff; }
#paginationControls .page-item.disabled .page-link { opacity: .45; }
#tableCountInfo { font-style: normal !important; font-size: .78rem; color: var(--l5-mute); margin: 0 2px 8px !important; }

/* =====================================================================
 * D) MÁY TÍNH BẢNG / LAPTOP NHỎ (768–1199): gọn hơn, ẩn bớt cột ít dùng
 * ===================================================================== */
@media (min-width: 768px) and (max-width: 1199.98px) {
  #dataTable { font-size: .8rem; }
  #dataTable td, #dataTable th { padding: 7px 8px; }
  #dataTable th:nth-child(3), #dataTable td:nth-child(3) { display: none; }   /* mã (vẫn có dưới tên khi bật cố định) */
  #dataTable td:nth-child(14), #dataTable td:nth-child(19) { min-width: 150px; max-width: 200px; }
}

/* =====================================================================
 * E) ĐIỆN THOẠI — danh sách thẻ
 * ===================================================================== */
@media (max-width: 767.98px) {
  /* thanh công cụ: lưới đều 2 cột, nút cao vừa ngón tay */
  .ld-toolbar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px !important;
    padding: 8px;
    border-radius: 14px;
  }
  .ld-toolbar > *, .ld-toolbar .btn-group { min-width: 0; width: 100%; }
  .ld-toolbar .btn-group { display: flex; }
  .ld-toolbar .btn-group > .btn:first-child { flex: 1 1 auto; min-width: 0; }
  .ld-toolbar .btn, .ld-toolbar .btn-group > .btn { height: 40px; font-size: .8rem; padding: 0 8px; }
  .ld-toolbar .btn-group > .adv-i { width: 36px; }
  .ld-toolbar #stkCtlGroup { grid-column: 1 / -1; }
  .ld-toolbar .lb-t-toggle { grid-column: 1 / -1; }
  .ld-opt { display: none; }

  /* thanh trên khung cuộn thẻ: dính, một hàng nút đều nhau */
  #ldCardBox .sbox-bar {
    position: sticky; top: 0; z-index: 6;
    display: flex; align-items: center; gap: 6px;
    padding: 6px 2px 8px;
    background: linear-gradient(#fff 82%, rgba(255, 255, 255, 0));
  }
  #ldCardBox .sbox-bar .sbox-info { flex: 1 1 auto; font-size: .72rem; color: var(--l5-mute); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #ldCardBox .sbox-bar .btn { height: 34px; padding: 0 10px; font-size: .76rem; font-weight: 600; border-radius: 10px; display: inline-flex; align-items: center; gap: 4px; flex: none; }

  /* thẻ */
  #ldCardList { gap: 10px; padding-bottom: 12px; }
  .ld-card {
    border: 1px solid var(--l5-line) !important;
    border-radius: 16px !important;
    background: #fff;
    box-shadow: 0 1px 2px rgba(60, 40, 10, .05), 0 8px 20px -14px rgba(60, 40, 10, .3);
    position: relative;
  }
  /* vạch màu trạng thái bên trái: nhìn lướt biết ngay ai đang làm / đã nghỉ / huỷ */
  .ld-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #cfc8bd; border-radius: 16px 0 0 16px;
  }
  .ld-card:not(.lb-st-left)::before { background: #22a06b; }
  .ld-card.lb-st-left::before { background: #b9b2a6; }
  .ld-card.lb-vet-row::before { background: #e0a526; }
  .ld-card.bk-selected { outline: 2px solid #2f7cf6; background: #f3f8ff; }
  .ld-card .ld-main { padding-left: 4px; }

  /* lưới thông tin: 3 cột đều, nhãn nhỏ trên – giá trị đậm dưới, kẻ mảnh */
  .ld-card .ld-spec {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 8px 0 6px;
    border: 1px solid var(--l5-line2);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
  }
  .ld-card .ld-cell {
    padding: 6px 8px;
    min-width: 0;
    border-right: 1px solid var(--l5-line2);
    border-bottom: 1px solid var(--l5-line2);
  }
  .ld-card .ld-cell:nth-child(3n) { border-right: 0; }
  .ld-card .ld-cell:nth-last-child(-n+3) { border-bottom: 0; }
  .ld-card .ld-cell .ld-lab { display: block; font-size: .6rem; letter-spacing: .05em; text-transform: uppercase; color: var(--l5-mute); font-weight: 700; margin-bottom: 1px; }
  .ld-card .ld-cell .ld-val { display: block; font-size: .82rem; font-weight: 600; color: var(--l5-ink); overflow-wrap: anywhere; line-height: 1.25; }
  .ld-card .ld-cell-cong { background: var(--l5-tint); }
  .ld-card .ld-cell-cong .ld-val b { font-size: 1.05rem; color: var(--l5-or-d); font-weight: 800; }

  /* địa chỉ / ghi chú: dạng dòng nhãn + giá trị, tối đa 3 dòng */
  .ld-card .ld-rows { margin: 4px 0 2px; }
  .ld-card .ld-row { display: flex; gap: 8px; padding: 3px 0; font-size: .8rem; line-height: 1.35; }
  .ld-card .ld-row .ld-lab { flex: none; width: 56px; font-size: .6rem; text-transform: uppercase; letter-spacing: .05em; color: var(--l5-mute); font-weight: 700; padding-top: 2px; }
  .ld-card .ld-row .ld-rv { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

  /* nút hành động cuối thẻ: lưới đều, cao bằng ngón tay (44px) */
  .ld-card .ld-actions.ld-actions-bottom { gap: 6px !important; }
  .ld-card .ld-actions.ld-actions-bottom > .btn { min-height: 44px; border-radius: 12px; }
}

/* tránh thẻ co giãn lạ trên màn rất nhỏ */
@media (max-width: 359.98px) {
  .ld-card .ld-spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-card .ld-cell:nth-child(3n) { border-right: 1px solid var(--l5-line2); }
  .ld-card .ld-cell:nth-child(2n) { border-right: 0; }
}

@media print {
  .ld-toolbar, #paginationControls, .l5-audit-btn { display: none !important; }
  .table-wrapper { max-height: none !important; box-shadow: none !important; }
}

/* =====================================================================
 * F) ĐIỆN THOẠI (≤576px) — bản 51
 *  F1 thanh gọn đầu tab · F2 ngăn kéo Lọc / Công cụ · F3 bảng chọn · F4 thẻ + vị trí cùng một dòng
 * ===================================================================== */
#l6Bar, #l6Back, #l6SelBack, #l6Sel { display: none; }

@media (max-width: 576px) {
  html.l6-lock, html.l6-lock body { overflow: hidden !important; }

  /* F1 — thanh gọn: dính trên, danh sách hiện ngay bên dưới */
  #l6Bar {
    display: flex; align-items: center; gap: 8px;
    position: sticky; top: 0; z-index: 30;
    margin: 0 0 8px; padding: 8px 2px;
    background: rgba(250, 247, 242, .94);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  #l6Bar .l6-q {
    flex: 1 1 auto; min-width: 0; height: 44px;
    display: flex; align-items: center; gap: 8px; padding: 0 12px;
    background: #fff; border: 1px solid var(--l5-line); border-radius: 14px;
    box-shadow: 0 1px 2px rgba(60, 40, 10, .05);
  }
  #l6Bar .l6-q:focus-within { border-color: var(--l5-or); box-shadow: 0 0 0 3px rgba(231, 119, 14, .16); }
  #l6Bar .l6-q > .bi { color: var(--l5-mute); font-size: 1rem; flex: none; }
  #l6Bar .l6-q input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--l5-ink); height: 100%; padding: 0; }
  #l6Bar .l6-q input::-webkit-search-cancel-button { display: none; }
  #l6Bar .l6-qx { border: 0; background: none; color: #b9b2a6; padding: 4px; font-size: 1.05rem; line-height: 1; flex: none; }
  #l6Bar .l6-b {
    flex: none; height: 44px; min-width: 44px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; position: relative;
    background: #fff; border: 1px solid var(--l5-line); border-radius: 14px;
    color: #8e3c06; font-size: .84rem; font-weight: 700;
    box-shadow: 0 1px 2px rgba(60, 40, 10, .05);
  }
  #l6Bar .l6-b i { font-size: 1.05rem; }
  #l6Bar .l6-b.has { background: var(--l5-tint); border-color: #f1cfa8; }
  #l6Bar .l6-b[aria-expanded="true"] { background: var(--l5-or); border-color: var(--l5-or); color: #fff; }
  #l6Bar .l6-b em {
    font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--l5-or); color: #fff; font-size: .68rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
  }
  #l6Bar .l6-b em[hidden] { display: none; }
  @media (max-width: 380px) { #l6Bar .l6-b span { display: none; } #l6Bar .l6-b { padding: 0; width: 44px; } }

  /* F2 — bộ lọc & công cụ = ngăn kéo từ dưới lên (mặc định ẩn hẳn) */
  #tab-list #filterSection:not(.l6-sheet-on),
  #tab-list .ld-toolbar:not(.l6-sheet-on) { display: none !important; }
  #l6Back, #l6SelBack {
    display: block; position: fixed; inset: 0; z-index: 2000;
    background: rgba(31, 24, 15, .45); opacity: 0; pointer-events: none; transition: opacity .18s;
  }
  #l6SelBack { z-index: 2100; }
  #l6Back.on, #l6SelBack.on { opacity: 1; pointer-events: auto; }

  #tab-list #filterSection.l6-sheet-on,
  #tab-list .ld-toolbar.l6-sheet-on {
    position: fixed !important; left: 0; right: 0; bottom: 0; top: auto;
    z-index: 2050; margin: 0 !important;
    max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
    border: 0 !important; border-radius: 22px 22px 0 0 !important;
    background: #fff; box-shadow: 0 -12px 40px rgba(31, 24, 15, .28) !important;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    animation: l6up .22s cubic-bezier(.2, .8, .2, 1);
  }
  #tab-list .ld-toolbar.l6-sheet-on { display: grid !important; padding-top: 0 !important; }
  @keyframes l6up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

  /* đầu ngăn kéo: thanh kéo + tiêu đề + nút đóng */
  .l6-sh-head {
    position: sticky; top: 0; z-index: 5; grid-column: 1 / -1 !important; width: auto !important;
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 -14px 6px; padding: 16px 14px 10px;
    background: #fff; border-bottom: 1px solid var(--l5-line2);
  }
  .l6-sh-grip { position: absolute; top: 6px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: #ddd3c7; }
  .l6-sh-t { display: flex; align-items: center; gap: 8px; font-size: 1rem; color: var(--l5-ink); }
  .l6-sh-t i { color: var(--l5-or); }
  .l6-sh-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f5efe7; color: #6b645a; display: inline-flex; align-items: center; justify-content: center; }
  /* trong ngăn kéo: ẩn nút gấp/mở cũ, hiện đủ mọi ô */
  #filterSection.l6-sheet-on .lb-f-toggle, .ld-toolbar.l6-sheet-on > .lb-t-toggle { display: none !important; }
  #filterSection.l6-sheet-on .lb-filter-head { display: none; }
  #filterSection.l6-sheet-on .lb-fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 6px; }
  #filterSection.l6-sheet-on .lb-fgrid > * { display: block !important; grid-column: auto !important; min-width: 0; }
  #filterSection.l6-sheet-on .lb-fgrid > .m2 { grid-column: 1 / -1 !important; }
  #filterSection.l6-sheet-on .lb-fgrid .form-control, #filterSection.l6-sheet-on .lb-fgrid .form-select { height: 44px; font-size: 16px; }
  #filterSection.l6-sheet-on #dateModeBox { display: flex !important; }
  /* nút Lọc / Xoá lọc dính đáy ngăn kéo */
  #filterSection.l6-sheet-on .lb-factions { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
  #filterSection.l6-sheet-on .lb-act-main {
    position: sticky; bottom: -1px; z-index: 4;
    display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px;
    margin: 0 -14px; padding: 10px 14px calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(rgba(255, 255, 255, 0), #fff 22%);
  }
  #filterSection.l6-sheet-on .lb-act-main > .btn { height: 46px; font-size: .88rem; font-weight: 700; border-radius: 12px; }
  #filterSection.l6-sheet-on .lb-act-main > .btn:nth-child(1) { grid-column: 1 / 2; }
  #filterSection.l6-sheet-on .lb-act-main > .lb-sw-wrap { grid-column: 1 / -1; }
  /* công cụ: lưới 2 cột, ô to dễ bấm */
  .ld-toolbar.l6-sheet-on > .btn, .ld-toolbar.l6-sheet-on > .btn-group { min-height: 50px; }
  .ld-toolbar.l6-sheet-on .btn { height: 50px; font-size: .86rem; border-radius: 14px; }
  .ld-toolbar.l6-sheet-on .btn-group { display: flex; }
  .ld-toolbar.l6-sheet-on .btn-group .adv-i { display: none; }
  .ld-toolbar.l6-sheet-on #stkCtlGroup { grid-column: 1 / -1; }
  #tab-list #dataDisplaySection .ld-toolbar.l6-sheet-on .l5-audit-grp { display: none !important; }

  /* gọn các phần thừa nằm giữa thanh và danh sách */
  #tab-list #tableCountInfo { margin: 0 2px 6px !important; font-size: .8rem; }

  /* F3 — bảng chọn (thay hộp mặc định) */
  #l6Sel {
    display: flex; flex-direction: column;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 2150;
    max-height: 78vh; max-height: 78dvh;
    background: #fff; border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(31, 24, 15, .3);
    transform: translateY(105%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #l6Sel.on { transform: none; visibility: visible; }
  #l6Sel .l6-sh-head { margin: 0; flex: none; }
  .l6-ss { flex: none; display: flex; align-items: center; gap: 8px; margin: 10px 14px 4px; padding: 0 12px; height: 42px; background: #f8f4ee; border-radius: 12px; }
  .l6-ss[hidden] { display: none; }
  .l6-ss input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; min-width: 0; }
  .l6-ss > .bi { color: var(--l5-mute); }
  .l6-ol { overflow-y: auto; overscroll-behavior: contain; padding: 6px 10px 14px; }
  .l6-o {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 52px; padding: 8px 12px; margin: 2px 0;
    border: 0; border-radius: 14px; background: transparent; text-align: left; color: var(--l5-ink);
  }
  .l6-o:active { background: #f5efe7; }
  .l6-ot { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
  .l6-ot b { font-size: .95rem; font-weight: 600; overflow-wrap: anywhere; }
  .l6-ot small { font-size: .76rem; color: var(--l5-mute); margin-top: 2px; overflow-wrap: anywhere; }
  .l6-o.is-empty .l6-ot b { color: var(--l5-mute); font-weight: 500; }
  .l6-ok { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #e4dacd; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: .8rem; }
  .l6-ok i { opacity: 0; }
  .l6-o.is-sel { background: var(--l5-tint); }
  .l6-o.is-sel .l6-ot b { color: var(--l5-or-d); font-weight: 700; }
  .l6-o.is-sel .l6-ok { background: var(--l5-or); border-color: var(--l5-or); }
  .l6-o.is-sel .l6-ok i { opacity: 1; }
  .l6-o.is-dis { opacity: .4; }
  .l6-og { padding: 12px 12px 4px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--l5-mute); }
  .l6-none { padding: 28px 12px; text-align: center; color: var(--l5-mute); font-size: .9rem; }

  /* F4 — thẻ: "thẻ lao động" + "vị trí" cùng một dòng, tự xuống dòng khi thật sự hết chỗ, không bao giờ bị cắt */
  .ld-card .ld-main { display: flex; flex-direction: row !important; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; column-gap: 6px; row-gap: 0; width: 100%; flex: 1 1 100%; }
  .ld-card .ld-main > * { flex: 0 0 100%; min-width: 0; max-width: 100%; }
  .ld-card .ld-main > .the-chips, .ld-card .ld-main > .vt-line { flex: 0 1 auto; margin: 6px 0 0 !important; max-width: 100%; }
  .ld-card .ld-main > .the-chips { flex-wrap: nowrap; }
  .ld-card .vt-chip, .ld-card .the-chip { max-width: 100%; overflow: visible; text-overflow: clip; white-space: normal; height: auto !important; min-height: 22px; line-height: 1.25 !important; }
  .ld-card .lb-by { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.35; }
  .ld-card .ld-name { flex-wrap: wrap !important; }
  .ld-card .ld-name > span:first-child { flex: 1 1 120px; }
}
