/* =====================================================================
 *  polish-46.css — chỉnh gọn giao diện Danh sách (bảng + thẻ điện thoại) và Phiếu ứng lương
 *  Nạp SAU style.css:  <link rel="stylesheet" href="css/polish-46.css?v=46p1">
 *  Chỉ là CSS ghi đè – không đổi logic. Gỡ file này là về như cũ.
 * ===================================================================== */
:root {
  --pl-or: #e7770e;
  --pl-or-soft: #fff4e5;
  --pl-line: #f0e6da;
  --pl-ink: #2b2a28;
  --pl-mute: #8b867d;
  --pl-mute2: #a8a399;
}

/* ---------------------------------------------------------------------
 * 1) BẢNG (máy tính) – ô "Mã NLĐ / Mã đợt" và ô "Họ tên"
 * ------------------------------------------------------------------- */
/* mã đợt dài không còn tràn sang cột bên cạnh */
#dataTable tbody td:nth-child(3) small {
  display: block;
  margin-top: 2px;
  font-size: .68rem;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--pl-mute2) !important;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  word-break: break-all;
}
#dataTable tbody td:nth-child(3) .fw-semibold { letter-spacing: .01em; }

/* dòng "Tạo · Sửa": nhỏ, nhạt, một dòng, tên đậm vừa */
.lb-by {
  display: block;
  margin-top: 3px;
  font-size: .7rem !important;
  line-height: 1.3;
  color: var(--pl-mute) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.lb-by b { font-weight: 600; color: #6b645a; }

/* thẻ lao động + vị trí nằm CHUNG một hàng (trước đây mỗi thứ một dòng) */
#dataTable tbody td .the-chips,
#dataTable tbody td .vt-line,
.ld-main .the-chips,
.ld-main .vt-line {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 5px 6px 0 0;
  gap: 4px;
  max-width: 100%;
}
.the-add {
  width: 24px;
  height: 24px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  border: 1px dashed #d9d2c7 !important;
  background: #fff !important;
  color: var(--pl-mute2) !important;
  font-size: 12px !important;
  transition: border-color .15s, color .15s;
}
.the-add:hover, .the-add.has { color: var(--pl-or) !important; border-color: #f6b36b !important; }

.vt-chip {
  font-size: 11.5px;
  line-height: 1;
  height: 24px;
  padding: 0 9px;
  font-weight: 600;
  letter-spacing: .005em;
}
.vt-chip.vt-add {
  background: #fff;
  border: 1px dashed #f6b36b;
  color: #c2410c;
  font-weight: 500;
}
.vt-chip.vt-add:hover { background: var(--pl-or-soft); }

/* ---------------------------------------------------------------------
 * 2) THẺ ĐIỆN THOẠI – từng lao động
 * ------------------------------------------------------------------- */
.ld-card {
  border-radius: 16px !important;
  border: 1px solid var(--pl-line) !important;
  box-shadow: 0 1px 2px rgba(60, 40, 10, .05), 0 6px 18px rgba(253, 126, 20, .07) !important;
  padding: 14px 14px 12px !important;
}
.ld-main { overflow: visible !important; }

/* tên + trạng thái */
.ld-name {
  font-size: 1.1rem !important;
  line-height: 1.25 !important;
  margin-bottom: 2px !important;
  flex-wrap: wrap;
  row-gap: 4px;
}
.ld-name .lb-stp { margin-left: 0 !important; }

/* hàng mã NLĐ + huy hiệu */
.ld-main > .small.mb-1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin-bottom: 0 !important;
  font-size: .78rem;
  color: var(--pl-mute);
}
.ld-main > .small.mb-1 > b { color: var(--pl-ink); font-size: .82rem; letter-spacing: .02em; }

/* SĐT: gọn, nút mắt + sao chép thành 2 nút tròn cùng cỡ */
.ld-phone {
  margin: 6px 0 4px !important;
  font-size: .98rem !important;
  gap: 4px !important;
  letter-spacing: .04em;
  color: #1f4fbf !important;
}
.ld-phone .btn-link {
  width: 30px;
  height: 30px;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f6f3ee;
  text-decoration: none;
  font-size: .95rem;
}
.ld-phone .btn-link:active { background: var(--pl-or-soft); }

/* khối thông tin: nhãn nhỏ xám + giá trị đậm vừa, các ô cách đều */
.ld-info-list {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px 18px !important;
  margin: 6px 0 2px !important;
  padding-top: 8px;
  border-top: 1px solid #f4eee6;
  font-size: .9rem !important;
}
.ld-info-list > .ld-info,
.ld-info-list > div.ld-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 0 1 auto;
}
.ld-info .ld-label,
.ld-label {
  display: block;
  font-size: .66rem !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--pl-mute) !important;
  line-height: 1.2;
}
.ld-info { color: var(--pl-ink); font-weight: 500; line-height: 1.3; }
.ld-info b { font-weight: 700; }
/* ô dài (địa chỉ, ghi chú) chiếm trọn hàng */
.ld-info.ld-wide { flex: 1 1 100% !important; }
/* khối "Tạo lúc / Cập nhật" (chỉ hiện khi không ở chế độ gọn) */
.ld-info-list.mt-1 { border-top: 1px dashed #efe7db; }
.ld-info-list.mt-1 .ld-info { flex-direction: row; gap: 6px; flex: 1 1 100%; font-weight: 400; font-size: .78rem; color: var(--pl-mute); }
.ld-info-list.mt-1 .ld-label { display: inline; text-transform: none; letter-spacing: 0; font-size: .78rem !important; }

/* nút ảnh "Xem 1 / Xem 2": hết xanh dương lệch tông, thành chip cam nhạt */
.ld-image-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.ld-image-list a,
.ld-image-list .btn,
.ld-image-list button {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px !important;
  border-radius: 999px !important;
  border: 1px solid #f6c89a !important;
  background: var(--pl-or-soft) !important;
  color: #b45309 !important;
  font-size: .78rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  box-shadow: none !important;
}
.ld-image-list a:active, .ld-image-list .btn:active { background: #ffe8c9 !important; }

/* hàng nút thao tác: đều nhau, đủ lớn để chạm */
.ld-actions.ld-actions-bottom {
  display: flex;
  gap: 8px;
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px solid #f4eee6;
}
.ld-actions.ld-actions-bottom .btn {
  flex: 1 1 0;
  max-width: 64px;
  height: 36px;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1rem;
}

/* ---------------------------------------------------------------------
 * 3) THẺ PHIẾU ỨNG LƯƠNG  (bố cục gọn: tiền · trạng thái · nhận tiền · người nhập · nút)
 * ------------------------------------------------------------------- */
.adv-tk {
  gap: 8px;
  padding: 11px 13px 10px;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(60, 40, 10, .05), 0 4px 14px rgba(60, 40, 10, .04);
}
.adv-tk-top { align-items: center; gap: 8px; }
.adv-tk-meta { gap: 4px 8px; }
.adv-tk-lan { font-size: .72rem; padding: 2px 8px; }
.adv-tk-date { font-size: .82rem; font-weight: 600; color: #6b645a; }
.adv-tk-amt { font-size: 1.3rem; letter-spacing: -.02em; }
.adv-tk-amt .adv-cur { font-size: .62em; font-weight: 700; margin-left: 2px; opacity: .8; letter-spacing: 0; }

.adv-tk-st { gap: 5px; margin-top: -2px; }
.adv-tk-st .badge { font-size: .7rem; font-weight: 600; padding: .32em .7em; border-radius: 999px; }

/* nhãn nằm trên một cột hẹp, chữ thường → không đè lên giá trị */
.adv-tk-kv {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) !important;
  gap: 8px 8px !important;
  padding-top: 9px;
  border-top: 1px dashed #efe2cf;
  font-size: .84rem;
}
.adv-tk-kv > span:nth-child(odd) {
  font-size: .72rem !important;
  font-weight: 600;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--pl-mute) !important;
  line-height: 1.5;
  padding-top: 2px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adv-tk-kv > :nth-child(even) { min-width: 0; line-height: 1.35; }

/* tài khoản nhận: hàng 1 = ngân hàng + chép, hàng 2 = số TK + mắt/chép, hàng 3 = tên chủ TK */
.adv-tk-kv .bank-cell { white-space: normal; min-width: 0; font-size: .84rem; }
.adv-tk-kv .bx-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 6px;
  align-items: center;
}
.adv-tk-kv .bx-grid > :nth-child(1), .adv-tk-kv .bx-grid > :nth-child(2) { order: 2; }
.adv-tk-kv .bx-grid > :nth-child(3), .adv-tk-kv .bx-grid > :nth-child(4) { order: 1; }
.adv-tk-kv .bx-chip { max-width: 100%; font-size: .76rem; }
.adv-tk-kv .bank-stk { font-size: .92rem; letter-spacing: .06em; line-height: 24px; }
.adv-tk-kv .bx-cp { width: 26px; height: 26px; opacity: .8; }
.adv-tk-kv .bx-sub {
  max-width: 100%;
  margin-top: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: .72rem;
  line-height: 1.3;
  color: var(--pl-mute);
}

/* người nhập: tên · giờ · "đã sửa" trên cùng một dòng, gọn */
.adv-who { display: flex; flex-wrap: wrap; align-items: center; gap: 1px 6px; line-height: 1.35; }
.adv-who-n { font-weight: 600; font-size: .82rem; color: var(--pl-ink); }
.adv-who-t { font-size: .72rem; color: var(--pl-mute); }
.adv-who-t::before { content: "·"; margin-right: 6px; color: var(--pl-mute2); }
.adv-who .badge { font-size: .64rem; font-weight: 600; border-radius: 999px; padding: .25em .6em; }

/* chân thẻ: mã phiếu nhạt; "Đã chi" nổi bật; 5 nút phụ đều nhau trên MỘT hàng */
.adv-tk-foot { display: flex; flex-direction: column; align-items: stretch; gap: 7px; padding-top: 8px; }
.adv-id {
  font-size: .66rem;
  color: var(--pl-mute2);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.adv-tk-act { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.adv-tk .adv-tk-act .btn.btn-success {
  flex: 1 1 100% !important;
  min-height: 38px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.adv-tk .adv-tk-act .adv-ab {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  min-height: 40px !important;
  padding: 4px 2px !important;
  border-radius: 10px;
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.1;
}
.adv-tk .adv-tk-act .adv-ab > i { font-size: 1rem; line-height: 1; }
.adv-tk .adv-tk-act .adv-ab .adv-cap,
.adv-tk .adv-tk-act .adv-ab.adv-ab-t .adv-cap {
  display: block;
  max-width: 100%;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================================================================
 * 4) THẺ LAO ĐỘNG (điện thoại) – bản rõ ràng: đầu thẻ · SĐT · lưới thông tin · nút có chữ
 * ===================================================================== */
/* đầu thẻ: tên (co giãn) + trạng thái + vòng số đợt luôn nằm CÙNG một hàng */
.ld-card .ld-name { flex-wrap: nowrap !important; align-items: flex-start; gap: 8px; font-size: 1.06rem !important; }
.ld-card .ld-name > span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ld-card .ld-name > :not(:first-child) { flex: none; }
.ld-card .ld-name .lb-stp { font-size: .74rem !important; padding: 2px 8px !important; margin: 1px 0 0 !important; }
.ld-card .ld-name .dq-dot { margin-left: 0 !important; width: 26px; height: 26px; }

/* SĐT: một ô nền nhẹ – số bên trái, nút bên phải */
.ld-card .ld-phone {
  background: #faf7f2;
  border: 1px solid #f1e8dc;
  border-radius: 12px;
  padding: 3px 5px 3px 12px;
  margin: 8px 0 6px !important;
  justify-content: flex-start;
}
.ld-card .ld-phone::before {
  content: "SĐT";
  font-size: .62rem;
  font-weight: 700;
  line-height: 1;
  font-family: inherit;
  letter-spacing: .06em;
  color: var(--pl-mute);
  margin-right: 4px;
}
.ld-card .ld-phone .phone-cell { flex: 1 1 auto; min-width: 0; font-size: .98rem; }
.ld-card .ld-phone .btn-link { background: #fff; border: 1px solid #efe6da; }

/* lưới thông tin 2 cột: nhãn nhỏ phía trên, giá trị rõ ràng bên dưới */
.ld-card .ld-info-list.ld-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px !important;
  margin: 8px 0 0 !important;
  padding-top: 9px;
  border-top: 1px solid #f4eee6;
  font-size: .92rem !important;
}
.ld-card .ld-info-list.ld-grid:not(:has(.ld-info)) { display: none !important; }
.ld-card .ld-info-list.ld-grid > .ld-info { flex: initial; }
.ld-card .ld-info-list.ld-grid > .ld-info.ld-wide { grid-column: 1 / -1; }
.ld-card .ld-info-list.ld-grid .ld-info { font-weight: 600; color: var(--pl-ink); }
.ld-card .ld-info-list.ld-grid .ld-label { margin-bottom: 1px; }
/* Tổng công nổi bật */
.ld-card .ld-info-list.ld-grid .ld-info b { font-size: 1.05rem; color: var(--pl-or); }

/* khối ngân hàng, ảnh: cách đều */
.ld-card .ld-bank { margin: 10px 0 0 !important; }
.ld-card .ld-image-list { margin-top: 10px; }

/* hàng nút: có chữ, 4 nút đều nhau */
.ld-card .ld-actions.ld-actions-bottom {
  display: flex;
  gap: 8px;
  margin-top: 12px !important;
  padding-top: 11px;
  border-top: 1px solid #f4eee6;
}
.ld-card .ld-actions.ld-actions-bottom > .btn {
  flex: 1 1 0 !important;
  max-width: none !important;
  min-width: 0;
  height: 46px !important;
  padding: 4px 2px !important;
  margin: 0 !important;
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px !important;
  line-height: 1;
}
.ld-card .ld-actions.ld-actions-bottom > .btn > i { font-size: 1.05rem; line-height: 1; }
.lb-ab-cap { display: none; }
.ld-card .lb-ab-cap { display: block; font-size: .66rem; font-weight: 700; letter-spacing: 0; white-space: nowrap; }

/* khung hỏi lại khi bấm lần 1 (nằm ngay trong thẻ, không bật popup) */
.ld-card .ld-actions-bottom.is-asking > .btn { display: none !important; }
.lb-ask {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px 12px;
  border-radius: 14px;
  background: #fff7ec;
  border: 1px solid #f6c89a;
  animation: lbAskIn .16s ease-out;
}
.lb-ask.is-danger { background: #fef3f2; border-color: #fbc9c4; }
.lb-ask-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem; color: #9a3412; }
.lb-ask.is-danger .lb-ask-h { color: #b42318; }
.lb-ask-h i { font-size: 1.1rem; }
.lb-ask-d { margin: 4px 0 10px; font-size: .82rem; line-height: 1.45; color: #5f584f; }
.lb-ask-b { display: flex; gap: 8px; }
.lb-ask-b button { flex: 1 1 0; height: 40px; border-radius: 10px; font-size: .86rem; font-weight: 700; cursor: pointer; }
.lb-ask-b .no { background: #fff; border: 1px solid #e5ded3; color: #6b645a; flex: 0 0 34%; }
.lb-ask-b .ok { background: var(--pl-or); border: 0; color: #fff; }
.lb-ask.is-danger .lb-ask-b .ok { background: #d92d20; }
@keyframes lbAskIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* =====================================================================
 * 5) THẺ LAO ĐỘNG – bản cân đối: TÊN nổi bật, mọi chi tiết khác nhỏ & gọn
 * ===================================================================== */
.ld-card { padding: 12px 13px 11px !important; }

/* tên: to nhất thẻ */
.ld-card .ld-name { font-size: 1.14rem !important; font-weight: 800; letter-spacing: -.01em; margin-bottom: 3px !important; }
.ld-card .ld-name .lb-stp { font-size: .68rem !important; padding: 1px 7px !important; }
.ld-card .ld-name .dq-dot { width: 22px; height: 22px; font-size: .7rem; }

/* mã NLĐ: nhỏ lại */
.ld-card .ld-main > .small.mb-1 > b { font-size: .74rem; font-weight: 700; color: #6b645a; }
.ld-card .lb-by { font-size: .66rem !important; margin-top: 1px; }

/* thẻ lao động + vị trí: chip nhỏ như nhãn phụ (cao 20px, chữ 10.5px) */
.ld-card .the-chips, .ld-card .vt-line, .ld-card .vt-crow { margin: 4px 5px 0 0; gap: 3px; }
.ld-card .the-chip { font-size: 10.5px !important; line-height: 16px !important; padding: 1px 7px !important; font-weight: 600; }
.ld-card .the-chip i { font-size: 10.5px !important; }
.ld-card .the-add { width: 20px !important; height: 20px !important; font-size: 10.5px !important; }
.ld-card .vt-chip { font-size: 10.5px !important; height: 20px !important; padding: 0 8px !important; font-weight: 600; }
.ld-card .vt-chip.vt-lg { font-size: 10.5px !important; min-height: 0 !important; padding: 0 8px !important; }
.ld-card .vt-chip i { font-size: 10px; }
.ld-card .vt-chip .vt-cv { font-size: 8px; }

/* SĐT: ô thấp hơn, số nhỏ hơn */
.ld-card .ld-phone { margin: 6px 0 4px !important; padding: 1px 4px 1px 10px; border-radius: 10px; }
.ld-card .ld-phone .phone-cell { font-size: .84rem !important; letter-spacing: .08em; }
.ld-card .ld-phone .btn-link { width: 26px; height: 26px; font-size: .82rem; }
.ld-card .ld-phone::before { font-size: .58rem; }
.ld-card .ld-main .mb-1 .badge, .ld-card .ld-main .mb-1 [class*="badge"] { font-size: .66rem; }

/* khối thông tin: gộp thành một bảng liền mạch, chữ nhỏ, cột đều */
.ld-card .ld-info-list.ld-grid {
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)) !important;
  gap: 6px 10px !important;
  margin: 6px 0 0 !important;
  padding-top: 7px;
  border-top: 1px solid #f4eee6;
  font-size: .8rem !important;
}
.ld-card .ld-info-list.ld-grid ~ .ld-info-list.ld-grid { border-top: 0; margin-top: 5px !important; padding-top: 0; }
.ld-card .ld-info-list.ld-grid .ld-info {
  font-size: .8rem !important;
  font-weight: 600;
  line-height: 1.25;
  align-items: flex-start;
  gap: 0;
}
.ld-card .ld-info-list.ld-grid .ld-label { font-size: .58rem !important; letter-spacing: .05em; margin-bottom: 1px; }
/* dòng dài (Công ty, Địa chỉ): nhãn trái – giá trị phải, trên một hàng */
.ld-card .ld-info-list.ld-grid > .ld-info.ld-wide {
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}
.ld-card .ld-info.ld-wide .ld-label { flex: none; min-width: 46px; }
.ld-card .ld-info.ld-wide > :not(.ld-label) { min-width: 0; }
/* chip "công ty tôi quản lý": nhỏ, vừa chữ (không kéo dài hết hàng) */
.ld-card .lb-mine {
  display: inline-flex !important;
  align-items: center;
  width: auto;
  max-width: 100%;
  gap: 4px;
  padding: 1px 8px !important;
  font-size: .74rem !important;
  line-height: 1.5;
  border-radius: 999px;
}
.ld-card .lb-mine i { font-size: .72rem; }
.ld-card .ld-info-list.ld-grid .ld-info b { font-size: .9rem; }

/* tài khoản ngân hàng + ảnh: nhỏ gọn */
.ld-card .bq-add.bq-add-card { padding: 5px 8px !important; margin: 7px 0 2px !important; font-size: .76rem !important; border-radius: 10px; }
.ld-card .ld-bank { margin: 7px 0 2px !important; }
.ld-card .ld-image-list { margin-top: 7px; gap: 5px; }
.ld-card .ld-image-list a, .ld-card .ld-image-list .btn, .ld-card .ld-image-list button { height: 24px !important; padding: 0 9px !important; font-size: .7rem !important; }

/* nút thao tác: thấp hơn một chút cho cân với thẻ */
.ld-card .ld-actions.ld-actions-bottom { margin-top: 9px !important; padding-top: 9px; }
.ld-card .ld-actions.ld-actions-bottom > .btn { height: 42px !important; }
.ld-card .lb-ab-cap { font-size: .62rem; }

/* ---- Bảng máy tính: cùng tinh thần – chip phụ nhỏ hơn tên ---- */
#dataTable tbody td .the-chip { font-size: 10.5px !important; line-height: 16px !important; padding: 1px 7px !important; }
#dataTable tbody td .the-add { width: 20px !important; height: 20px !important; }
#dataTable tbody td .vt-chip { font-size: 10.5px !important; height: 20px !important; padding: 0 8px !important; }

/* =====================================================================
 * 6) THẺ LAO ĐỘNG – BỐ CỤC CHUẨN: đầu thẻ → SĐT → bảng thông tin 3×3 → dòng dài → ngân hàng → nút
 *    Nhịp dọc cố định 8px, một hệ cột duy nhất, chữ không bao giờ gãy giữa ngày tháng.
 * ===================================================================== */
.ld-card .ld-main { display: flex; flex-direction: column; gap: 0; }

/* ---- đầu thẻ ---- */
.ld-card .ld-main > .small.mb-1 { margin: 1px 0 0 !important; gap: 4px 6px; }
.ld-card .lb-by { margin: 2px 0 0 !important; }
.ld-card .the-chips, .ld-card .vt-line { margin: 7px 6px 0 0 !important; }
/* cảnh báo SĐT dùng chung: gọn, một dòng */
.ld-card .ld-main > div.mb-1 { margin: 7px 0 0 !important; }
.ld-card .ld-main > div.mb-1 > * { font-size: .68rem !important; line-height: 1.4; padding: 2px 9px !important; max-width: 100%; }
.ld-card .ld-phone { margin: 8px 0 0 !important; }

/* ---- bảng thông tin 3 cột × 3 hàng ---- */
.ld-spec {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 0;
  border: 1px solid #f0e6da;
  border-radius: 12px;
  overflow: hidden;
  background: #fffdfa;
}
.ld-cell {
  min-width: 0;
  padding: 7px 10px 8px;
  border-right: 1px solid #f4ede3;
  border-bottom: 1px solid #f4ede3;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ld-cell:nth-child(3n) { border-right: 0; }
.ld-cell:nth-last-child(-n+3) { border-bottom: 0; }
.ld-lab {
  display: block;
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--pl-mute);
  line-height: 1.2;
}
.ld-val {
  display: block;
  min-width: 0;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--pl-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.ld-cell-cong { background: #fff4e5; }
.ld-cell-cong .ld-lab { color: #b45309; }
.ld-cell-cong .ld-val b { font-size: 1rem; font-weight: 800; color: var(--pl-or); }
.ld-val .lb-mine { padding: 0 !important; background: none !important; border: 0 !important; font-size: inherit !important; color: inherit !important; gap: 4px; }
.ld-val .lb-mine i { color: var(--pl-or); }

/* ---- dòng dài: nhãn trái – giá trị phải ---- */
.ld-rows { margin: 4px 0 0; }
.ld-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 7px 2px;
  border-bottom: 1px solid #f4ede3;
}
.ld-row:last-child { border-bottom: 0; }
.ld-rv { font-size: .82rem; font-weight: 600; line-height: 1.35; color: var(--pl-ink); overflow-wrap: anywhere; }

/* ---- ngân hàng · ảnh · nút: cùng nhịp ---- */
.ld-card .ld-bank { margin: 6px 0 0 !important; }
.ld-card .bq-add.bq-add-card { margin: 6px 0 0 !important; }
.ld-card .ld-image-list { margin: 8px 0 0 !important; }
.ld-card .ld-actions.ld-actions-bottom { margin-top: 10px !important; }

/* =====================================================================
 * 7) TAB DANH SÁCH (điện thoại) – đầu trang gọn: bộ lọc mỏng · công cụ dạng ô 3 cột · thanh điều hướng 1 hàng
 * ===================================================================== */
#vtStrip { display: none !important; }            /* khung Vị trí/chỉ tiêu đã bỏ khỏi Danh sách */

@media (max-width: 576px) {
  /* ---- Bộ lọc: ô thấp 40px, nút Lọc / Xoá lọc cùng hàng nhỏ gọn ---- */
  #filterSection { --lb-h: 40px; --lb-fs: .9rem; padding: 10px 12px 12px !important; border-radius: 16px; }
  #filterSection .lb-filter-head { margin-bottom: 8px; }
  #filterSection .lb-filter-head h6 { font-size: .86rem; }
  #filterSection .lb-fgrid { gap: 7px; }
  #filterSection .lb-act-main { gap: 7px; margin-top: 2px; }
  #filterSection .lb-act-main .btn { height: 40px; font-size: .88rem; border-radius: 12px; }
  .lb-f-toggle { padding: 4px 11px; font-size: .76rem; }

  /* ---- Công cụ: nút "Công cụ khác" mỏng, khi mở ra là lưới ô 3 cột ---- */
  .ld-toolbar { gap: 7px !important; margin-bottom: 8px !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .ld-toolbar > .lb-t-toggle { min-height: 38px !important; font-size: .84rem !important; border-radius: 12px !important; padding: 0 12px !important; }
  .ld-toolbar > .btn,
  .ld-toolbar > .adv-bg > .btn:first-child,
  .ld-toolbar > #stkCtlGroup .btn:not(.adv-i),
  .ld-toolbar > #stkCtlGroup > .btn-group > .btn {
    min-height: 58px !important;
    padding: 6px 4px !important;
    border-radius: 12px !important;
    flex-direction: column;
    gap: 4px !important;
    font-size: .7rem !important;
    font-weight: 600 !important;
    line-height: 1.15;
    text-align: center;
    white-space: normal !important;
  }
  .ld-toolbar .btn i { font-size: 1.15rem !important; }
  .ld-toolbar .ld-opt { display: none; }
  .ld-toolbar .dropdown-toggle::after { display: none; }
  .ld-toolbar > .adv-bg, .ld-toolbar > #stkCtlGroup { min-width: 0; }
  .ld-toolbar > .adv-bg > .btn:first-child { width: 100%; }
  #stkModeTxt, #stkModeTxt * { white-space: normal; }
  #stkModeTxt .stk-v, #stkModeTxt .stk-t { display: block; }

  /* ---- Dòng đếm + đồng bộ: nhỏ gọn ---- */
  #tableCountInfo { margin: 2px 0 6px 2px !important; font-size: .8rem; }
  #tableCountInfo .lb-sync { font-size: .7rem; }
}

/* ---- Thanh điều hướng danh sách thẻ: 1 hàng duy nhất ---- */
@media (max-width: 767.98px) {
  #ldCardBox .sbox-bar { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; margin: 0 0 8px; }
  #ldCardBox:not(.ld-fs) .sbox-bar .sbox-info { display: none; }
  #ldCardBox .sbox-bar .btn {
    flex: 1 1 0;
    min-width: 0;
    height: 34px;
    padding: 0 6px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: .74rem !important;
    font-weight: 600;
    border-radius: 10px;
    white-space: nowrap;
  }
  #ldCardBox:not(.ld-fs) #ldFsBtn { flex: 0 0 44px; }
  #ldCardBox:not(.ld-fs) #ldFsBtn span { display: none; }
}

/* =====================================================================
 * 8) THANH CÔNG CỤ DANH SÁCH – 6 ô đồng nhất (icon tròn cùng cỡ · chữ nhỏ cùng cỡ) + thanh điều hướng 1 hàng
 *    (đặt độ ưu tiên cao để thắng các lớp v74 cũ trong style.css)
 * ===================================================================== */
@media (max-width: 576px) {
  body #dataDisplaySection .ld-toolbar {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
  }
  body #dataDisplaySection .ld-toolbar > .lb-t-toggle {
    grid-column: 1 / -1 !important;
    min-height: 36px !important;
    font-size: .8rem !important;
    border-radius: 12px !important;
    padding: 0 12px !important;
  }
  /* nhóm bọc nút: kéo nút giãn đầy ô để mọi ô cao bằng nhau */
  body #dataDisplaySection .ld-toolbar > .adv-bg,
  body #dataDisplaySection .ld-toolbar > #printButton { display: flex !important; min-width: 0; }
  body #dataDisplaySection .ld-toolbar > .adv-bg > .btn:first-child { flex: 1 1 auto !important; width: 100%; }

  /* nhóm STK: chiếm 2 cột, chia đôi đều → thành 2 ô bằng các ô khác */
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup {
    grid-column: span 2 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-width: 0;
  }
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup > .btn-group { display: flex !important; min-width: 0; }
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup > .btn-group > .btn { flex: 1 1 auto; width: 100%; }
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup > .adv-i { display: none !important; }

  /* ô chuẩn */
  body #dataDisplaySection .ld-toolbar > .adv-bg > .btn:first-child,
  body #dataDisplaySection .ld-toolbar > #printButton,
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup .btn:not(.adv-i) {
    min-height: 70px !important;
    height: auto !important;
    padding: 9px 4px 7px !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px !important;
    font-size: .72rem !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;
    letter-spacing: 0;
    text-align: center;
    white-space: normal !important;
    background: #fff !important;
    background-image: none !important;
    border: 1px solid #ece3d6 !important;
    color: #4a4036 !important;
    box-shadow: 0 1px 2px rgba(80, 50, 20, .05) !important;
  }
  body #dataDisplaySection .ld-toolbar .btn span,
  body #dataDisplaySection .ld-toolbar .btn .stk-lbl { font-size: .72rem !important; font-weight: 600 !important; }

  /* icon: vòng tròn 32px cùng cỡ cho cả 6 ô */
  body #dataDisplaySection .ld-toolbar > .adv-bg > .btn:first-child > i,
  body #dataDisplaySection .ld-toolbar > #printButton > i,
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup .btn:not(.adv-i) > i {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #fff1e3;
    color: #bf550a !important;
    font-size: 1.05rem !important;
    line-height: 1;
  }

  /* nút chính "Xuất Excel": nền cam, icon tròn trắng mờ */
  body #dataDisplaySection .ld-toolbar > .adv-bg:first-child > .btn:first-child {
    background-image: linear-gradient(180deg, #cb5e0f 0%, #b24c07 100%) !important;
    border-color: #a94707 !important;
    color: #fff !important;
    box-shadow: 0 8px 16px -8px rgba(191, 85, 10, .6) !important;
  }
  body #dataDisplaySection .ld-toolbar > .adv-bg:first-child > .btn:first-child span { color: #fff !important; }
  body #dataDisplaySection .ld-toolbar > .adv-bg:first-child > .btn:first-child > i { background: rgba(255, 255, 255, .22); color: #fff !important; }

  /* ô "Thêm STK": dòng 2 là phạm vi (Công ty tôi / Tất cả …) nhỏ, màu cam */
  body #dataDisplaySection .ld-toolbar #stkModeTxt { display: flex !important; flex-direction: column; align-items: center; gap: 1px; line-height: 1.1; }
  body #dataDisplaySection .ld-toolbar #stkModeTxt .stk-t { font-size: .72rem !important; font-weight: 600 !important; }
  body #dataDisplaySection .ld-toolbar #stkModeTxt .stk-v { font-size: .6rem !important; font-weight: 600 !important; color: #bf550a; opacity: 1; }

  /* trạng thái đang bật */
  body #dataDisplaySection .ld-toolbar #stkCtlGroup #stkEyeBtn.active,
  body #dataDisplaySection .ld-toolbar #stkCtlGroup #stkModeBtn.on {
    background: #fff4e5 !important; border-color: #efc79d !important; color: #8e3c06 !important;
  }
  body #dataDisplaySection .ld-toolbar #bkModeBtn.active {
    background: #bf550a !important; border-color: #bf550a !important; color: #fff !important;
  }
  body #dataDisplaySection .ld-toolbar #bkModeBtn.active > i { background: rgba(255, 255, 255, .22); color: #fff !important; }
}

@media (max-width: 767.98px) {
  /* thanh điều hướng danh sách thẻ: 4 nút đều nhau trên 1 hàng */
  body #ldCardBox:not(.ld-fs) .sbox-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr 46px;
    gap: 6px !important;
    margin-bottom: 8px !important;
    align-items: stretch;
  }
  body #ldCardBox:not(.ld-fs) .sbox-bar .sbox-info { display: none !important; }
  body #ldCardBox:not(.ld-fs) .sbox-bar .btn,
  body #ldCardBox:not(.ld-fs) .sbox-bar #ldDensityBtn {
    grid-column: auto !important;
    justify-self: stretch !important;
    min-height: 34px !important;
    height: 34px;
    padding: 0 6px !important;
    border-radius: 10px !important;
    font-size: .74rem !important;
    font-weight: 600 !important;
    gap: 5px !important;
    background: #fff !important;
    color: #4a4036 !important;
    border: 1px solid #ece3d6 !important;
  }
  body #ldCardBox:not(.ld-fs) .sbox-bar .btn i { font-size: .95rem; color: #bf550a; }
  body #ldCardBox:not(.ld-fs) .sbox-bar #ldFsBtn {
    background: #bf550a !important;
    border-color: #bf550a !important;
    color: #fff !important;
    padding: 0 !important;
  }
  body #ldCardBox:not(.ld-fs) .sbox-bar #ldFsBtn i { color: #fff; font-size: 1.05rem; }
  body #ldCardBox:not(.ld-fs) .sbox-bar #ldFsBtn span { display: none; }
}

/* ---- Nút mắt / sao chép SĐT: vùng chạm 36px, chạm là ăn ngay (không chờ 300ms) ---- */
.ld-card .ld-phone { position: relative; z-index: 1; }
.ld-card .ld-phone .btn-link,
.ld-card .ld-phone [data-lb-act="phone"] {
  width: 36px !important;
  height: 36px !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(231, 119, 14, .15);
  cursor: pointer;
}
.ld-card .ld-phone .btn-link i { pointer-events: none; }

/* =====================================================================
 * 9) THÊM Ô "HIỆN SĐT" – 7 ô: hàng 1 (Excel · In · Theo người) · hàng 2 (Chọn nhiều · Hiện SĐT · Hiện STK) · hàng 3 (Thêm STK: cả hàng)
 * ===================================================================== */
@media (max-width: 576px) {
  body #dataDisplaySection .ld-toolbar > #phoneCtlGroup { display: flex !important; min-width: 0; }
  body #dataDisplaySection .ld-toolbar > #phoneCtlGroup > .btn:first-child { flex: 1 1 auto !important; width: 100%; }

  /* nhóm STK mở ra thành 2 phần tử riêng trong lưới */
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup { display: contents !important; }
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup > #stkEyeBtn { width: 100%; }
  /* "Thêm STK · phạm vi": hàng ngang, icon trái – chữ giữa, cao gọn */
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup > .btn-group {
    grid-column: 1 / -1;
    display: flex !important;
    min-width: 0;
  }
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup > .btn-group > #stkModeBtn {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 46px !important;
    padding: 6px 14px !important;
    gap: 10px !important;
  }
  body #dataDisplaySection .ld-toolbar > #stkCtlGroup > .btn-group > #stkModeBtn > i { width: 28px; height: 28px; }
  body #dataDisplaySection .ld-toolbar #stkModeBtn #stkModeTxt { flex-direction: row !important; align-items: baseline; gap: 8px; }
  body #dataDisplaySection .ld-toolbar #stkModeBtn #stkModeTxt .stk-v::before { content: "· "; }

  body #dataDisplaySection .ld-toolbar #phoneEyeBtn.active {
    background: #fff4e5 !important; border-color: #efc79d !important; color: #8e3c06 !important;
  }
}
