/* ============================================================
   HR Plaza — Design System
   Brand: đỏ đô / maroon (#7B1E2B). Companies: Thực Phẩm Plaza & Ami VN
   ============================================================ */

:root{
  --maroon:#7B1E2B;
  --maroon-dark:#5e151f;
  --maroon-700:#6a1925;
  --maroon-50:#f7ecee;
  --maroon-100:#efd9dd;

  --ink:#1f2430;
  --ink-2:#4b5563;
  --muted:#8b93a3;
  --line:#e7e9ee;
  --line-2:#eef0f4;
  --bg:#f4f5f8;
  --card:#ffffff;

  --green:#1d9d6c; --green-bg:#e7f6ef;
  --amber:#c98a10; --amber-bg:#fdf3e0;
  --red:#cf3b3b;   --red-bg:#fdeaea;
  --blue:#2f6bd6;  --blue-bg:#e9f0fd;
  --violet:#6d4bd6;--violet-bg:#efeafe;
  --slate:#5b6472; --slate-bg:#eef0f4;

  --radius:14px;
  --radius-sm:10px;
  --shadow:0 1px 2px rgba(16,24,40,.04), 0 6px 20px rgba(16,24,40,.06);
  --shadow-lg:0 12px 40px rgba(16,24,40,.18);
  --sidebar-w:248px;
  --brand:#7B1E2B;   /* alias cho vài chỗ tham chiếu var(--brand) (trước đây chưa định nghĩa → fallback rỗng) */
  /* khoảng cách an toàn tai thỏ / thanh Home iPhone (0 trên máy không có notch) */
  --sat:env(safe-area-inset-top,0px);
  --sab:env(safe-area-inset-bottom,0px);
  --sal:env(safe-area-inset-left,0px);
  --sar:env(safe-area-inset-right,0px);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{
  font-family:"Be Vietnam Pro",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:var(--bg); color:var(--ink);
  font-size:14px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
button{font-family:inherit}

/* ---------- Layout ---------- */
#app{display:flex;min-height:100vh}
.main{flex:1;min-width:0;display:flex;flex-direction:column}

/* ---------- Sidebar ---------- */
.sidebar{
  width:var(--sidebar-w); flex-shrink:0;
  background:linear-gradient(180deg,var(--maroon) 0%, var(--maroon-dark) 100%);
  color:#fff; display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh;
}
.brand{display:flex;align-items:center;gap:12px;padding:20px 18px 16px;flex-shrink:0}
.brand-logo{
  width:42px;height:42px;border-radius:11px;background:#fff;
  display:grid;place-items:center;font-weight:800;font-size:16px;letter-spacing:.5px;
  overflow:hidden;flex-shrink:0;
}
.brand-logo img{width:100%;height:100%;object-fit:contain;display:block}
.brand-name{font-weight:800;font-size:17px;line-height:1.1}
.brand-sub{font-size:11px;opacity:.78;margin-top:2px}

.nav{display:flex;flex-direction:column;gap:3px;padding:8px 12px;flex:1 1 auto;min-height:0;overflow-y:auto}
/* thanh cuộn mảnh, hợp tông cho menu */
.nav::-webkit-scrollbar{width:7px}
.nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.22);border-radius:8px}
.nav::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.38)}
.nav{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.22) transparent}
.nav-item{
  position:relative;
  display:flex;align-items:center;gap:11px;padding:11px 12px;border-radius:10px;
  color:rgba(255,255,255,.86);font-weight:500;font-size:13.5px;cursor:pointer;
  transition:background .15s, color .15s;
}
.nav-item:hover{background:rgba(255,255,255,.10);color:#fff}
/* badge số thông báo ở góc trên-phải mỗi phân hệ */
.nav-badge{
  position:absolute;top:5px;right:7px;min-width:17px;height:17px;padding:0 4px;
  background:#e23b4e;color:#fff;border-radius:9px;font-size:10.5px;font-weight:800;
  line-height:17px;text-align:center;box-shadow:0 1px 3px rgba(0,0,0,.25);
}
/* badge SỐ MỚI trên từng tab (phân hệ nhiều tab) → biết ngay việc mới ở tab nào */
.tab-badge{display:none;align-items:center;justify-content:center;min-width:17px;height:17px;padding:0 4px;margin-left:5px;
  background:#e23b4e;color:#fff;border-radius:9px;font-size:10.5px;font-weight:800;line-height:17px;vertical-align:middle;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.nav-item.active{background:#fff;color:var(--maroon);font-weight:700;box-shadow:0 4px 14px rgba(0,0,0,.12)}
.nav-ic{width:20px;text-align:center;font-size:15px}

.sidebar-footer{padding:14px;border-top:1px solid rgba(255,255,255,.12);flex-shrink:0}
.sidebar-version{font-size:11px;opacity:.6;margin-top:10px;text-align:center}

/* ---------- Topbar ---------- */
.topbar{
  height:62px;background:var(--card);border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:16px;padding:0 22px;position:sticky;top:0;z-index:20;
}
.topbar-title{font-weight:700;font-size:18px}
.topbar-search{flex:1;max-width:420px;margin-left:8px}
.topbar-search-input{
  width:100%;height:38px;border:1px solid var(--line);border-radius:10px;
  padding:0 14px;font-size:14px;font-family:inherit;background:var(--bg);color:var(--ink);outline:none;
}
.topbar-search-input:focus{border-color:var(--brand);background:var(--card)}
.topbar-right{margin-left:auto;display:flex;align-items:center;gap:18px}
.icon-btn{
  border:none;background:transparent;font-size:18px;cursor:pointer;color:var(--ink-2);
  width:34px;height:34px;border-radius:8px;
}
.icon-btn:hover{background:var(--bg)}

.entity-switch{display:flex;background:var(--bg);border-radius:10px;padding:3px;gap:2px}
.es-btn{
  border:none;background:transparent;padding:7px 13px;border-radius:8px;cursor:pointer;
  font-size:12.5px;font-weight:600;color:var(--ink-2);
}
.es-btn.active{background:var(--card);color:var(--maroon);box-shadow:var(--shadow)}

.user-switch{display:flex;flex-direction:column;align-items:flex-end}
.user-switch-label{font-size:10.5px;color:var(--muted);margin-bottom:1px}
.user-select{
  border:1px solid var(--line);border-radius:9px;padding:6px 10px;font-size:13px;font-weight:600;
  color:var(--ink);background:var(--card);cursor:pointer;max-width:230px;
}
/* chip tài khoản gọn: avatar + tên cuối */
.me-chip{display:flex;align-items:center;gap:8px;padding:5px 12px 5px 5px;border-radius:999px;max-width:none}
.me-chip:hover{border-color:var(--maroon)}
.me-avatar{
  width:28px;height:28px;border-radius:50%;background:var(--maroon);color:#fff;
  display:grid;place-items:center;font-size:13px;font-weight:800;flex-shrink:0;
}
.me-name{font-weight:700;font-size:13.5px;white-space:nowrap}
/* chuông thông báo */
.bell-btn{position:relative;border:1px solid var(--line);background:var(--card);width:40px;height:40px;border-radius:10px;
  cursor:pointer;font-size:18px;display:grid;place-items:center;flex-shrink:0}
.bell-btn:hover{border-color:var(--maroon)}
.bell-badge{position:absolute;top:-5px;right:-5px;background:var(--red,#cf3b3b);color:#fff;font-size:10.5px;font-weight:800;
  min-width:18px;height:18px;border-radius:9px;display:grid;place-items:center;padding:0 4px}
.bell-badge[hidden]{display:none!important}
/* Banner châm ngôn / lời chào trên Trang tổng quan */
.quote-banner{display:flex;gap:14px;align-items:flex-start;background:linear-gradient(100deg,#7B1E2B,#a8313f);color:#fff;border-radius:14px;padding:16px 20px;margin-bottom:18px;box-shadow:0 4px 16px rgba(123,30,43,.18)}
.quote-banner .quote-ic{font-size:26px;line-height:1.2}
.quote-banner .quote-text{font-size:16px;font-weight:600;line-height:1.55}
.quote-banner .quote-author{margin-top:6px;font-size:13px;opacity:.9;display:flex;gap:10px;align-items:center}
.quote-banner .quote-occ{background:rgba(255,255,255,.2);border-radius:20px;padding:2px 10px;font-size:12px;font-weight:600}
.notif-list{display:flex;flex-direction:column}
.notif-item{display:flex;gap:12px;align-items:flex-start;padding:12px 8px;border-bottom:1px solid var(--line);cursor:pointer;border-radius:8px}
.notif-item:hover{background:var(--bg)}
.notif-item.unread{background:#fbf3f4}
.notif-dot{width:9px;height:9px;border-radius:50%;background:transparent;margin-top:6px;flex-shrink:0}
.notif-dot.on{background:var(--maroon)}

/* ---------- Phiếu đề xuất (xem trong modal) ---------- */
.paper{background:#fff;color:#1a1a1a;padding:6px 4px;font-size:14px}
/* Phiếu ĐÃ HỦY / TỪ CHỐI: đóng dấu chéo mờ lên toàn phiếu (hiện cả khi in) để không nhầm là phiếu còn
   hiệu lực — chữ ký các cấp vẫn giữ nguyên vì đó là lịch sử duyệt. (chị My 16/08) */
.paper-cancelled{position:relative}
.paper-cancelled::after{content:"ĐÃ HỦY";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-size:80px;font-weight:900;color:rgba(192,57,43,.13);transform:rotate(-24deg);pointer-events:none;
  letter-spacing:8px;z-index:5;-webkit-print-color-adjust:exact;print-color-adjust:exact}
@media print{.paper-cancelled::after{color:rgba(192,57,43,.18)}}
.paper-head{display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid var(--maroon);padding-bottom:10px}
.paper-info{width:100%;border-collapse:collapse;margin:12px 0}
.paper-info td{border:1px solid #ccc;padding:6px 10px}
.paper-info td:nth-child(odd){background:#f6f0f1;font-weight:600;width:120px}
/* 📱 MOBILE: bảng thông tin phiếu (4 ô/hàng) → xếp DỌC, mỗi nhãn kèm giá trị 1 khối full-width,
   tránh chữ dài ("Sale-BID","Hoàn tiền KH","Chử Thu Thương") vỡ dọc từng chữ cái.
   LOẠI TRỪ .dr-metric-tbl (bảng báo cáo cuối ngày) — bảng đó giữ dạng 2 cột số, có style riêng. */
@media (max-width:640px){
  .paper-info:not(.dr-metric-tbl),
  .paper-info:not(.dr-metric-tbl) tbody,
  .paper-info:not(.dr-metric-tbl) tr,
  .paper-info:not(.dr-metric-tbl) td{display:block;width:auto}
  .paper-info:not(.dr-metric-tbl) tr{margin-bottom:6px;border:1px solid #ddd;border-radius:8px;overflow:hidden}
  .paper-info:not(.dr-metric-tbl) td{border:none;border-top:1px solid #eee;padding:6px 10px;font-size:13px;word-break:normal;overflow-wrap:anywhere}
  .paper-info:not(.dr-metric-tbl) td:first-child{border-top:none}
  .paper-info:not(.dr-metric-tbl) td:nth-child(odd){width:auto;font-size:11.5px;color:#666;background:#f6f0f1;padding-bottom:2px}
  .paper-info:not(.dr-metric-tbl) td:nth-child(even){padding-top:2px;font-weight:600}
  /* bảng báo cáo cuối ngày: ép width cột số nhỏ (thắng rule .paper-info td:nth-child(odd){width:120px}) */
  .dr-metric-tbl:not(.dr-rate-tbl) td:nth-child(odd){width:auto!important}
  .dr-metric-tbl:not(.dr-rate-tbl) td:nth-child(even){width:58px!important;text-align:right}
}
.paper-amount{width:100%;border-collapse:collapse;margin:10px 0}
.paper-amount th,.paper-amount td{border:1px solid #ccc;padding:7px 10px}
.paper-amount th{background:#f6f0f1}
.paper-amount .num{text-align:right}
.paper-amount .total td{background:#fff7cc}
.sign-row{display:flex;justify-content:space-around;gap:10px;margin-top:24px;flex-wrap:wrap;align-items:flex-start}
.sign-cell{text-align:center;min-width:120px;flex:1}
/* chức danh chiều cao cố định (~2 dòng) → dấu ký thẳng hàng dù job title dài/ngắn */
.sign-role{font-weight:700;font-size:13px;min-height:36px;display:flex;align-items:center;justify-content:center;line-height:1.3}
.sign-area{height:64px;display:flex;align-items:center;justify-content:center}
.sign-mark{color:#127a2e;font-weight:700;border:1.5px solid #127a2e;border-radius:8px;padding:5px 9px;font-size:11.5px;transform:rotate(-6deg)}
.sign-mark.rej{color:#c0392b;border-color:#c0392b;transform:none}
.sign-pending{color:#bbb;font-size:12px}
.sign-name{font-weight:700}

/* file đính kèm trong form hồ sơ */
.file-chip{display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:6px 10px;font-size:13px}
.file-chip a{color:var(--maroon);font-weight:600}
/* ảnh tài sản */
.asset-thumb{width:46px;height:46px;object-fit:cover;border-radius:8px;cursor:pointer;border:1px solid var(--line)}
.asset-ph{position:relative;width:64px;height:64px;border-radius:8px;overflow:hidden;border:1px solid var(--line)}
.asset-ph img{width:100%;height:100%;object-fit:cover}
.asset-ph .ph-rm{position:absolute;top:2px;right:2px;background:rgba(0,0,0,.6);color:#fff;border:none;border-radius:50%;width:20px;height:20px;cursor:pointer;font-size:12px}
/* bảng phân quyền chi tiết */
.perm-tbl th,.perm-tbl td{padding:7px 8px;vertical-align:middle}
.perm-tbl .perm-cb{width:17px;height:17px;cursor:pointer}
.perm-override{background:#fbeff1}
.perm-scope{border:1px solid var(--line);border-radius:5px;background:var(--card)}
/* đóng băng tiêu đề bảng phân quyền + cột tên mục */
.perm-scroll{max-height:70vh;overflow:auto}
.perm-tbl thead th{position:sticky;top:0;z-index:3;background:#f1e7e9;box-shadow:0 1px 0 var(--line)}
.perm-tbl tbody td:first-child,.perm-tbl thead th:first-child{position:sticky;left:0;background:var(--card);z-index:2}
.perm-tbl thead th:first-child{z-index:4}
/* bình luận đơn từ/đề xuất */
.cmt-item{background:var(--bg);border-radius:10px;padding:9px 12px;margin-bottom:8px;font-size:13.5px}
.cmt-item.mine{background:#eef4ff}
/* danh bạ hotline — dạng bảng theo dòng */
.hotline-tbl td{vertical-align:middle}
.hl-num{font-weight:800;color:var(--maroon);font-size:15px;font-variant-numeric:tabular-nums;letter-spacing:.3px;white-space:nowrap}
.hl-actions{display:flex;gap:6px;flex-wrap:nowrap}
.hl-actions .btn{text-decoration:none;white-space:nowrap;padding:5px 10px}
.hl-call{background:#127a2e;color:#fff;border-color:#127a2e}
.hl-call:hover{background:#0e6526}
.hl-zalo{background:#0068ff;color:#fff;border-color:#0068ff}
.hl-zalo:hover{background:#0057d6}

/* ---------- Content ---------- */
.content{padding:24px 26px 60px;max-width:1500px;width:100%}
.page-head{display:flex;align-items:flex-end;gap:14px;margin-bottom:20px;flex-wrap:wrap}
.page-title{font-size:22px;font-weight:800}
.page-sub{color:var(--muted);font-size:13px;margin-top:2px}
.page-head .spacer{flex:1}

/* ---------- Cards ---------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-pad{padding:18px 20px}
.card-head{display:flex;align-items:center;gap:10px;padding:16px 20px;border-bottom:1px solid var(--line-2)}
.card-head h3{margin:0;font-size:15px;font-weight:700}
.card-head .spacer{flex:1}

/* ---------- Stat cards ---------- */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:14px}
.stat-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:11px 13px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.stat-card .ic,.stat-ic{
  width:28px;height:28px;border-radius:8px;display:grid;place-items:center;font-size:14px;margin-bottom:5px;
}
.stat-top{display:flex;align-items:center;gap:7px;margin-bottom:2px}
.stat-top .stat-ic{margin-bottom:0}
.stat-label{color:var(--muted);font-size:12px;font-weight:600}
.stat-value{font-size:20px;font-weight:800;margin-top:1px;letter-spacing:-.5px}
.stat-foot{font-size:11px;margin-top:3px;color:var(--ink-2)}
.stat-link{display:block;color:inherit;text-decoration:none;transition:.15s;cursor:pointer}
.stat-link:hover{border-color:var(--maroon-100);box-shadow:0 8px 24px rgba(123,30,43,.12);transform:translateY(-2px)}
.stat-go{font-size:11.5px;margin-top:8px;color:var(--maroon);font-weight:600;opacity:0;transition:.15s}
.stat-link:hover .stat-go{opacity:1}
.stat-card.stat-active{border-color:var(--maroon);box-shadow:0 6px 20px rgba(123,30,43,.16)}
.stat-card.stat-active .stat-go{opacity:1}
.ic.maroon{background:var(--maroon-50);color:var(--maroon)}
.ic.green{background:var(--green-bg);color:var(--green)}
.ic.amber{background:var(--amber-bg);color:var(--amber)}
.ic.blue{background:var(--blue-bg);color:var(--blue)}
.ic.violet{background:var(--violet-bg);color:var(--violet)}
.ic.red{background:var(--red-bg);color:var(--red)}
.ic.slate{background:var(--slate-bg);color:var(--slate)}

/* ---------- Mini dashboard (tổng quan nhanh trong tab Chấm công) ---------- */
.mini-dash{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:12px 14px;margin-bottom:14px}
.mini-dash .md-toggle{background:none;border:0;padding:0;font:inherit;color:var(--ink);cursor:pointer;display:flex;align-items:center;gap:6px;font-size:14px}
.mini-dash .md-toggle-static{font-size:14px;color:var(--ink)}
.mini-dash .md-caret{color:var(--muted);font-size:12px}
.mini-dash .md-body{margin-top:10px}
.mini-dash .md-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
.mini-dash .md-cards .stat-card{box-shadow:none}
.mini-dash .md-bars{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px 22px;margin-top:12px}
.md-bar-block .md-bar-title{font-size:12px;font-weight:700;color:var(--muted);margin-bottom:6px;text-transform:uppercase;letter-spacing:.3px}
.md-bar-row{display:flex;align-items:center;gap:8px;margin:4px 0;font-size:12.5px}
.md-bar-lbl{flex:0 0 40%;min-width:90px;color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.md-bar-track{flex:1;height:9px;border-radius:6px;background:var(--slate-bg);overflow:hidden}
.md-bar-fill{display:block;height:100%;border-radius:6px;transition:width .4s ease}
.md-bar-val{flex:0 0 auto;min-width:24px;text-align:right;font-variant-numeric:tabular-nums}
.md-bar-pct{flex:0 0 40px;text-align:right;color:var(--muted);font-size:11.5px;font-variant-numeric:tabular-nums}

/* ---------- Grid helpers ---------- */
.grid{display:grid;gap:16px}
.grid-2{grid-template-columns:1fr 1fr}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-2-1{grid-template-columns:2fr 1fr}
@media(max-width:1100px){.grid-2,.grid-3,.grid-2-1{grid-template-columns:1fr}}

/* Chữ GỢI Ý (placeholder) trong ô nhập: mờ + in nghiêng cho dễ phân biệt với chữ thật */
input::placeholder, textarea::placeholder, .input::placeholder{ color:#9aa0a6; opacity:.7; font-style:italic; }

/* ---------- Tables ---------- */
.table-wrap{overflow:auto;border-radius:var(--radius)}
/* Tô sáng dòng khi mở từ thông báo (deep-link ?open=) — nháy vàng rồi tắt */
@keyframes rowFlash { 0%,100%{background:transparent} 20%,60%{background:#fff3c4} }
.row-flash{animation:rowFlash 2.2s ease}
table.tbl{width:100%;border-collapse:collapse;font-size:13.5px;-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* CHẶN iOS Safari tự phóng to chữ (font boosting) khi bảng cuộn ngang → tên KH/ô bị to bất thường */
.tbl td,.tbl th,.tbl b,.tbl span{-webkit-text-size-adjust:100% !important;text-size-adjust:100% !important;max-height:1000000px}
/* Bảng chấm KPI: cuộn TRONG bảng + CỐ ĐỊNH tiêu đề cột (Tỷ trọng/Target/Thực đạt/Điểm tay…) khi kéo xuống */
.kpi-score-tbl-wrap{max-height:52vh;overflow:auto}
.kpi-score-tbl thead th{position:sticky;top:0;z-index:5;background:#f3e9ea;box-shadow:inset 0 -1px 0 var(--line,#e5d9db)}
.tbl thead th, .tbl thead td{
  text-align:left;background:#fafbfc;color:var(--ink-2);font-weight:700;font-size:12px;
  text-transform:uppercase;letter-spacing:.3px;padding:12px 14px;border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:6;white-space:nowrap;box-shadow:inset 0 -1px 0 var(--line,#e5d9db);
}
/* Bảng dài (Công nợ, danh sách đơn…) cuộn TRONG khung + GIỮ tiêu đề cột — tránh tick nhầm cột */
.table-wrap{max-height:72vh}
/* Danh sách RẤT dài: cuộn TRONG KHUNG riêng (cao ~ màn hình) → tiêu đề cột dính CHẮC ở đỉnh khung
   (top:0 tương đối với khung, KHÔNG phụ thuộc chiều cao topbar → không bị kẹt/đè giữa bảng). */
.table-wrap.tall-list{max-height:calc(100vh - 230px);overflow:auto}
.table-wrap.tall-list thead th{top:0;z-index:5}
.tbl tbody td{padding:11px 14px;border-bottom:1px solid var(--line-2);vertical-align:middle}
/* Bảng THU GỌN (Đóng gói/Chia lẻ — Tổng hợp & sơ đồ mã to→mã con): dòng sát nhau, đỡ tốn diện tích
   khi xếp 2 bảng ngang nhau. (chị My 17/08) */
.tbl.pk-tight thead th{padding:7px 10px}
.tbl.pk-tight tbody td{padding:5px 10px;line-height:1.35}
/* Bảng Hợp đồng lao động: TÊN NV không xuống dòng (cột đã nới rộng); 2 cột trạng thái siết hẹp,
   badge được phép ngắt dòng để không đẩy bảng rộng ra. (chị My 17/08) */
.lc-nv .person .n{white-space:nowrap}
.lc-nv .person .meta{min-width:0}
.tbl tbody tr:hover{background:var(--maroon-50)}
.tbl tbody tr{cursor:default}
.tbl tbody tr.clickable{cursor:pointer}
.tbl .num{text-align:right;font-variant-numeric:tabular-nums}
.t-strong{font-weight:700}
.t-muted{color:var(--muted)}

/* avatar */
.avatar{width:34px;height:34px;border-radius:50%;display:inline-grid;place-items:center;color:#fff;font-weight:700;font-size:12.5px;flex-shrink:0}
/* chấm xanh "đang online" như FB — góc dưới-phải avatar */
.ava-wrap{position:relative}
.online-dot{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;background:#2ecc40;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.06);z-index:2}
@media (prefers-color-scheme: dark){ .online-dot{border-color:#1f2430} }
.person{display:flex;align-items:center;gap:10px}
.person .meta .n{font-weight:600}
.person .meta .s{font-size:12px;color:var(--muted)}

/* ---------- Badges ---------- */
.badge{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap}
.badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.b-green{background:var(--green-bg);color:var(--green)}
.b-amber{background:var(--amber-bg);color:var(--amber)}
.b-red{background:var(--red-bg);color:var(--red)}
.b-blue{background:var(--blue-bg);color:var(--blue)}
.b-violet{background:var(--violet-bg);color:var(--violet)}
.b-slate{background:var(--slate-bg);color:var(--slate)}
.badge.plain::before{display:none}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);background:var(--card);
  color:var(--ink);padding:9px 15px;border-radius:10px;font-weight:600;font-size:13.5px;cursor:pointer;
  transition:.15s;
}
.btn:hover{background:var(--bg)}
.btn-primary{background:var(--maroon);border-color:var(--maroon);color:#fff}
.btn-primary:hover{background:var(--maroon-dark)}
.btn-ghost{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.20);color:#fff;width:100%;justify-content:center}
.btn-ghost:hover{background:rgba(255,255,255,.18)}
.btn-sm{padding:7px 11px;font-size:12.5px}
.btn-danger{color:var(--red);border-color:var(--red-bg)}
.btn-danger:hover{background:var(--red-bg)}
.btn-icon{padding:7px 9px}

/* ---------- Filter bar ---------- */
.filter-bar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.input,.select{
  border:1px solid var(--line);border-radius:10px;padding:9px 12px;font-size:13.5px;background:var(--card);
  color:var(--ink);font-family:inherit;
}
.input:focus,.select:focus{outline:none;border-color:var(--maroon);box-shadow:0 0 0 3px var(--maroon-50)}
.search{position:relative}
.search input{padding-left:34px;min-width:240px}
.search::before{content:"⌕";position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:16px}
.field-label{font-size:12.5px;font-weight:700;color:var(--ink,#2a2320);margin-bottom:6px;display:block}
/* tiêu đề MỤC trong phiếu chi tiết (File đính kèm · Người theo dõi · Bình luận) — đậm, rõ, màu maroon */
.sec-title{font-size:15px;font-weight:800;color:var(--maroon,#7B1E2B);margin-bottom:6px;display:block}
.sec-title .muted-sm{font-weight:500}

/* ---------- Tabs ---------- */
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:18px}
.tab{padding:11px 16px;cursor:pointer;font-weight:700;color:var(--ink-2);border-bottom:2px solid transparent;font-size:14px;text-decoration:none;display:inline-block}
a.tab,a.tab:hover,a.tab:visited{text-decoration:none}
/* ô nhập SỐ trong lưới KPI (đầu đơn giao/đóng gói): ẩn nút tăng/giảm để số không bị cắt */
.kpi-numin::-webkit-outer-spin-button,.kpi-numin::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.kpi-numin{-moz-appearance:textfield;appearance:textfield}
.tab:hover{color:var(--ink);background:var(--maroon-50,#faf0f1);border-radius:8px 8px 0 0}
/* TAB ĐANG CHỌN: nổi bật rõ — nền maroon nhạt + gạch chân đậm hơn + chữ đậm maroon (trước quá chìm) */
.tab.active{color:var(--maroon);border-bottom-color:var(--maroon);border-bottom-width:3px;background:var(--maroon-50,#f7e9eb);border-radius:8px 8px 0 0;font-weight:800}
/* HÀNG TAB CHÍNH: nổi bật rõ (active = viên thuốc nền maroon, chữ trắng) + tách khỏi sub-tab */
.tabs.tabs-main{gap:6px;border-bottom:2px solid var(--maroon-100,#e7c9cd);margin-bottom:8px;flex-wrap:wrap}
.tabs.tabs-main .tab{font-size:16px;font-weight:800;border-radius:10px 10px 0 0;border-bottom:3px solid transparent;padding:13px 20px}
.tabs.tabs-main .tab.active{background:var(--maroon,#7B1E2B);color:#fff;border-bottom-color:var(--maroon,#7B1E2B);box-shadow:0 2px 8px rgba(123,30,43,.25)}
/* HÀNG SUB-TAB: như "khay con" thuộc tab cha đang chọn — thụt vào, viền trái maroon, nền nhạt */
.tabs.tabs-sub{gap:6px;border-bottom:none;margin:-4px 0 16px;padding:8px 10px 8px 14px;
  background:var(--maroon-50,#fbeef0);border-left:4px solid var(--maroon,#7B1E2B);
  border-radius:0 10px 10px 0;position:relative}
/* mũi nối lên tab cha */
.tabs.tabs-sub::before{content:"↳";position:absolute;left:-2px;top:-14px;color:var(--maroon,#7B1E2B);font-weight:800;font-size:15px}
.tabs.tabs-sub .tab{font-size:12.5px;font-weight:700;padding:6px 14px;border-radius:14px;border-bottom:none;background:#fff;color:var(--ink-2);border:1px solid var(--maroon-100,#e7c9cd)}
.tabs.tabs-sub .tab:hover{border-color:var(--maroon,#7B1E2B)}
.tabs.tabs-sub .tab.active{background:var(--maroon,#7B1E2B);color:#fff;border-color:var(--maroon,#7B1E2B)}

/* Panel "Bình luận / trao đổi" nổi bật trong Báo cáo TBP (bỏ viền trên mặc định, tiêu đề maroon đậm) */
.bc-cmt-panel .cmt-wrap{border-top:none!important;padding-top:4px!important;margin-top:0!important}
.bc-cmt-panel .field-label{color:var(--maroon,#7B1E2B);font-weight:800;font-size:14px}

/* Thông tin các vị trí (JD tuyển dụng): cột Khoảng lương HẸP lại, nhường chỗ cho Mô tả ngắn (chị My 17/08).
   ĐẶT TRONG CLASS (không inline) — style="table-layout:fixed" inline bị CSS mobile [style*=] ép min-width:0
   làm chữ vỡ dọc từng ký tự. */
.jd-tbl{table-layout:fixed;width:100%}
.jd-tbl th, .jd-tbl td{vertical-align:top}
.jd-tbl td{word-break:break-word}
/* Badge phòng ban tên dài ("Hành chính nhân sự - Pháp chế") mặc định nowrap → TRÀN ĐÈ sang cột lương.
   Trong bảng này cho phép xuống dòng, bo góc mềm thay vì viên thuốc. (chị My 17/08) */
.jd-tbl .badge{white-space:normal;display:inline-block;line-height:1.35;border-radius:8px;padding:3px 8px;text-align:left}
.jd-tbl .badge::before{display:none}

/* Hồ sơ & Hợp đồng (CBCL): dòng nhiều dòng vẫn thẳng cột — canh nội dung lên TRÊN, không lệch header */
.cbcl-tbl{table-layout:fixed;width:100%}
.cbcl-tbl th, .cbcl-tbl td{vertical-align:top;overflow:hidden}
.cbcl-tbl td, .cbcl-tbl th{padding:10px 8px}                 /* giảm padding để cột đúng bề rộng đã đặt */
/* Giấy tờ công ty: dùng chung .cbcl-tbl (table-layout:fixed + colgroup) — bảng auto layout bị vỡ vì <tr> có
   class trùng tên "cd-row" với chatdock.js (display:flex trên hàng chat) → đổi tên hàng thành "cd-tr". */
.cbcl-tbl td .badge{white-space:normal;display:inline-block;line-height:1.35}
/* cột thao tác: hẹp, 3 nút xếp dọc gọn, KHÔNG kéo giãn tràn cột */
.cbcl-tbl td.cbcl-act{padding:8px 6px}
.cbcl-tbl td.cbcl-act .mini-btn{white-space:nowrap}
/* Tên SP: hiển thị bình thường (không IN HOA) — chỉ chữ cái đầu viết hoa, dữ liệu giữ nguyên */
.cbcl-tbl td.cbcl-name{text-transform:lowercase}
.cbcl-tbl td.cbcl-name::first-letter{text-transform:uppercase}
/* Nút 💬 bình luận: to & đậm tương xứng nút Xem/Hủy; xám cố định (có trao đổi) / đỏ có chấm (chưa đọc) */
.cmt-badge{display:inline-flex;align-items:center;justify-content:center;position:relative;gap:2px;
  font-size:12px;line-height:1;cursor:pointer;padding:4px 7px;border-radius:6px;border:1px solid var(--line,#e2e2e2);
  background:#fff;color:var(--ink-2,#555);font-weight:700}
.cmt-badge:hover{border-color:var(--maroon,#7B1E2B)}
.cmt-badge.unread{border-color:#e02424;background:#fdecec;color:#c0392b}
.cmt-badge .cmt-dot{position:absolute;top:-3px;right:-3px;width:8px;height:8px;border-radius:50%;background:#e02424;border:1.5px solid #fff}
/* dòng có bình luận CHƯA ĐỌC → in đậm cả dòng như email chưa đọc; mở xem thì bỏ đậm */
tr.cmt-unread-row > td{font-weight:700}
tr.cmt-unread-row > td .muted-sm{font-weight:600}
tr.cmt-unread-row{box-shadow:inset 3px 0 0 #e02424}
/* hiệu ứng phần bình luận nổi lên rồi hạ xuống để hút mắt khi mở từ nút 💬 */
@keyframes cmtPop{0%{transform:scale(1);box-shadow:0 0 0 rgba(123,30,43,0)}
  30%{transform:scale(1.02);box-shadow:0 8px 22px rgba(123,30,43,.28)}
  100%{transform:scale(1);box-shadow:0 0 0 rgba(123,30,43,0)}}
.cmt-flash{animation:cmtPop 1.1s ease-in-out;border-radius:12px;background:#fff7f8;outline:2px solid var(--maroon,#7B1E2B);outline-offset:2px}
/* flash ĐÚNG 1 bình luận cụ thể (mở từ thông báo có người phản hồi) — nổi bật tin nhắn mới */
@keyframes cmtItemFlash{0%{background:#fff3bf;box-shadow:0 0 0 rgba(123,30,43,0)}
  25%{background:#ffe98a;box-shadow:0 6px 20px rgba(123,30,43,.30)}
  100%{background:var(--bg);box-shadow:0 0 0 rgba(123,30,43,0)}}
.cmt-item.cmt-item-flash{animation:cmtItemFlash 1.8s ease-in-out;outline:2px solid var(--maroon,#7B1E2B);outline-offset:1px}
/* flash 1 DÒNG trong bảng (mở báo cáo cận date từ link phiếu auto-hủy) — tô nền vàng nhấp nháy các ô */
@keyframes rowFlash{0%{background:#fff3bf}40%{background:#ffe066}100%{background:transparent}}
tr.row-flash>td{animation:rowFlash 2.1s ease-in-out}
/* nhấp nháy ĐỎ ô "cập nhật mới nhất" khi vừa có update — báo có hoạt động mới */
@keyframes updBlink{0%,100%{opacity:1}50%{opacity:.35}}
.upd-fresh{animation:updBlink 1.3s ease-in-out infinite}
/* box lọc TRẠNG THÁI nổi bật (khi đang lọc "Chờ duyệt") — để mọi người biết có việc chờ mà vào thao tác */
.status-hl{background:#fff4e0;border:1.6px solid #e0a800;border-radius:10px;padding:4px 10px 6px}
.status-hl .field-label{color:#8a5200;font-weight:800}
.status-hl select{border-color:#e0a800}
/* link trong bình luận: màu xanh, click mở tab mới */
.cmt-link{color:#1a73e8;text-decoration:underline;word-break:break-all}
.cmt-link:hover{color:#0b57d0}
/* @mention: tên được nhắc + popup gợi ý khi gõ @ */
.cmt-mention{color:var(--maroon,#7B1E2B);font-weight:700;background:#fbeef0;border-radius:4px;padding:0 3px}
.cmt-mention-pop{position:absolute;bottom:calc(100% + 4px);left:0;right:0;max-height:220px;overflow:auto;background:#fff;border:1px solid var(--maroon-100,#e7c9cd);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.14);z-index:50}
.cmt-mention-opt{padding:8px 12px;cursor:pointer;font-size:13px}
.cmt-mention-opt:hover{background:#fbeef0}
/* Thả cảm xúc bình luận: 👍 Tán thành · ❤️ Thích · 👎 Không tán thành */
.cmt-react{border:1px solid var(--line,#e2e2e2);background:#fff;border-radius:14px;padding:1px 8px;font-size:12.5px;cursor:pointer;line-height:1.6;color:var(--ink-2,#555)}
.cmt-react:hover{border-color:var(--maroon,#7B1E2B);background:#fbeef0}
.cmt-react.on{border-color:var(--maroon,#7B1E2B);background:#fbeef0;color:var(--maroon,#7B1E2B);font-weight:700}
.cmt-react b{font-weight:700}

/* Ảnh bìa nhỏ cho tài liệu (Biểu mẫu & Quy trình) — kiểu "gáy" tài liệu */
.lib-cover{width:46px;height:58px;border-radius:6px;box-shadow:0 1px 4px rgba(0,0,0,.18);
  display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;overflow:hidden;
  border:1px solid rgba(0,0,0,.08);cursor:pointer;transition:transform .12s}
.lib-cover:hover{transform:scale(1.06)}
.lib-cover .lib-cover-ic{font-size:20px;line-height:1}
.lib-cover .lib-cover-tag{font-size:9px;font-weight:800;letter-spacing:.5px;margin-top:3px;opacity:.95}

/* ---------- Modal / Drawer ---------- */
.modal-overlay{position:fixed;inset:0;background:rgba(16,24,40,.45);z-index:100;display:flex;justify-content:center;align-items:flex-start;padding:40px 16px;overflow:auto;animation:fade .15s}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal{background:var(--card);border-radius:16px;box-shadow:var(--shadow-lg);width:100%;max-width:560px;animation:pop .18s}
.modal.lg{max-width:820px}
.modal.xl{max-width:920px}
.modal.full{max-width:96vw;width:96vw}
.modal.full .modal-body{max-height:calc(100vh - 170px)}
@keyframes pop{from{transform:translateY(8px);opacity:.6}to{transform:translateY(0);opacity:1}}
.modal-head{display:flex;align-items:center;padding:18px 22px;border-bottom:1px solid var(--line-2);cursor:move;touch-action:none;user-select:none}
.modal-head h3{margin:0;font-size:17px;font-weight:700}
/* Khi kéo phiếu né sang 1 bên: nền mờ trở nên trong suốt + cho click xuyên xuống bảng danh sách phía sau */
.modal-overlay.dragged{background:transparent;pointer-events:none}
.modal-overlay.dragged .modal{pointer-events:auto;box-shadow:0 12px 40px rgba(16,24,40,.28)}
.modal-drag-hint{margin-left:6px;margin-right:8px;font-size:11px;color:var(--muted);white-space:nowrap;opacity:.7}
@media(max-width:720px){.modal-head{cursor:default}.modal-drag-hint{display:none}}
.modal-head .x{margin-left:auto;cursor:pointer;font-size:20px;color:var(--muted);border:none;background:none;width:32px;height:32px;border-radius:8px}
.modal-head .x:hover{background:var(--bg)}
.modal-body{padding:20px 22px;max-height:70vh;overflow:auto}
.modal-foot{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;padding:16px 22px;border-top:1px solid var(--line-2)}
/* ĐIỆN THOẠI: footer nút GỌN — xếp ~3 nút/hàng (5 nút = 2 hàng), không cắt mất nút Duyệt */
@media (max-width:640px){
  .modal-foot{justify-content:center;gap:6px;padding:10px 12px;position:sticky;bottom:0;background:var(--card,#fff);box-shadow:0 -2px 8px rgba(0,0,0,.06)}
  .modal-foot .btn{flex:1 1 auto;min-width:0;justify-content:center;padding:9px 8px;font-size:13px;gap:4px;white-space:nowrap}
  .modal-body{max-height:calc(100vh - 190px)}
  /* CHỐNG TRÀN DÒNG trên điện thoại: không cho cả trang/khối trượt ngang; chữ+link dài tự xuống dòng */
  html,body{overflow-x:hidden;max-width:100%}
  .modal,.modal-body,.card,.tip,.kv,.kv-2{max-width:100%;overflow-wrap:anywhere;word-break:break-word}
  .modal-body table:not(.tbl):not(.paper-amount){display:block;max-width:100%;overflow-x:auto}
  /* 📱 BẢNG SỐ TIỀN phiếu (.paper-amount): cho CUỘN NGANG + KHÔNG bóp cột (số tiền không tách dọc từng chữ) */
  .paper-amount{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;width:100%;max-width:100%}
  .paper-amount th,.paper-amount td{white-space:nowrap !important;word-break:keep-all !important;overflow-wrap:normal !important;max-width:none !important}
  /* riêng cột nội dung (không .num, không cột hẹp .st) cho xuống dòng để tên mặt hàng dài không kéo bảng quá rộng.
     CHỈ áp min-width cho bảng KHÔNG table-layout:fixed (bảng BCL/Hủy đã có colgroup% — không ép để giữ tỉ lệ cột). */
  .paper-amount:not([style*="fixed"]) td:not(.num):not(.st){white-space:normal !important;word-break:break-word !important;min-width:110px}
  /* cột STT / ô hẹp: giữ hẹp, không ép min-width (tránh STT bị giãn to trên đt) */
  .paper-amount th.st,.paper-amount td.st{width:34px !important;min-width:34px !important;max-width:40px !important;text-align:center;white-space:nowrap !important}
  .tip,.field-label,.muted-sm{overflow-wrap:anywhere}
  a{overflow-wrap:anywhere}
  /* 📱 BẢNG DỮ LIỆU trên điện thoại: cho CUỘN NGANG trong khung, KHÔNG bóp cột (tránh chữ tách dọc từng ký tự) */
  .table-wrap{overflow-x:auto !important;-webkit-overflow-scrolling:touch}
  .table-wrap table.tbl{table-layout:auto !important;width:auto !important;min-width:100%}
  /* vô hiệu colgroup width % (khiến cột bị ép hẹp) */
  .table-wrap table.tbl col{width:auto !important}
  /* mỗi ô 1 dòng, KHÔNG tách ký tự — !important để thắng inline word-break:break-word ở từng td */
  .table-wrap table.tbl th,.table-wrap table.tbl td{white-space:nowrap !important;word-break:keep-all !important;overflow-wrap:normal !important;max-width:none !important}
  /* riêng cột dài (Tiêu đề) cho phép xuống dòng theo TỪ, nhưng rộng tối thiểu để không tách ký tự */
  .table-wrap table.tbl td.bc-title,.table-wrap table.tbl td.col-wrap{white-space:normal !important;min-width:170px;max-width:240px !important}
  /* tiêu đề bảng KHÔNG dính cứng chiếm màn hình trên mobile */
  .table-wrap table.tbl thead th{position:static !important}
}

/* drawer (slide from right) */
.drawer{margin-left:auto;border-radius:0;max-width:560px;min-height:100vh;align-self:stretch;animation:slide .2s}
.drawer.lg{max-width:760px}
@keyframes slide{from{transform:translateX(30px);opacity:.5}to{transform:translateX(0);opacity:1}}
.modal-overlay.right{padding:0;justify-content:flex-end;align-items:stretch}

/* form */
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-grid .full{grid-column:1/-1}
@media(max-width:560px){.form-grid{grid-template-columns:1fr}}
.form-grid label{display:block}
/* ô bọc bằng <span> (vd Loại chi, Mục đích chi) trong form-grid: ép BLOCK để là 1 ô lưới đầy đủ.
   Khi JS bật lại (style.display='') sẽ trở về block này thay vì inline (tránh mất ô trên mobile). */
.form-grid > span{display:block}
.form-grid .input,.form-grid .select{width:100%}

/* detail blocks */
.detail-hero{display:flex;gap:16px;align-items:center;padding:4px 0 18px;border-bottom:1px solid var(--line-2);margin-bottom:18px}
.detail-hero .avatar{width:60px;height:60px;font-size:20px}
.kv{display:grid;grid-template-columns:140px minmax(0,1fr);gap:8px 14px;font-size:13.5px}
.kv .k{color:var(--muted);font-weight:600}
.kv .v{font-weight:600;min-width:0;overflow-wrap:anywhere;word-break:break-word}
/* 2 cột (mỗi cột là 1 cặp nhãn–giá trị) — tận dụng chiều ngang drawer, không kẻ vạch */
.kv-2{grid-template-columns:130px 1fr 130px 1fr;column-gap:22px}
.kv-2 .v{word-break:break-word}
@media(max-width:620px){.kv-2{grid-template-columns:130px 1fr}}
.section-title{font-size:12.5px;text-transform:uppercase;letter-spacing:.4px;color:var(--maroon,#7B1E2B);font-weight:800;margin:20px 0 10px;border-bottom:2px solid var(--maroon-100,#e7c9cd);padding-bottom:4px}

/* Ô số bấm được (Theo dõi học tập) — hover nổi lên */
.stat-click:hover{transform:translateY(-2px);box-shadow:0 6px 18px rgba(123,30,43,.15)}

/* ≤3 khóa: trải kín 1 hàng, 3 thẻ to đều */
.kgrid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;align-items:start}
@media (max-width:900px){ .kgrid3{grid-template-columns:repeat(2,1fr)} }
@media (max-width:600px){ .kgrid3{grid-template-columns:1fr} }

/* Carousel khóa học theo chuyên đề — trượt ngang bằng nút ‹ › khi >3 khóa; mỗi thẻ ~1/3 khung */
.kcar-wrap{position:relative}
.kcar-track{display:flex;gap:16px;overflow-x:auto;scroll-behavior:smooth;padding:2px 2px 8px;scrollbar-width:thin}
.kcar-track::-webkit-scrollbar{height:7px}
.kcar-track::-webkit-scrollbar-thumb{background:#d9c2c5;border-radius:4px}
.kcar-track > .kcard{flex:0 0 calc((100% - 32px) / 3);max-width:calc((100% - 32px) / 3)}
/* nút ‹ › NỔI RÕ: nền maroon đặc, chữ trắng, to hơn — dễ nhận ra (chị My 06/08) */
.kcar-nav{position:absolute;top:calc(50% - 20px);transform:translateY(-50%);width:44px;height:44px;border-radius:50%;
  border:2px solid #fff;background:var(--maroon,#7B1E2B);color:#fff;font-size:26px;font-weight:800;line-height:1;cursor:pointer;z-index:3;
  box-shadow:0 4px 14px rgba(123,30,43,.4);display:flex;align-items:center;justify-content:center;transition:opacity .15s,transform .1s,background .15s}
.kcar-nav:hover{transform:translateY(-50%) scale(1.12);background:#a83246}
.kcar-prev{left:-16px}
.kcar-next{right:-16px}
.kcar-nav.kcar-off{opacity:.28;pointer-events:none}
/* nút "Xem thêm" trên header chuyên đề — hiệu ứng nhấn nhẹ */
.tr-seemore:hover{background:#fbeef0 !important;transform:translateY(-1px)}
.tr-seemore:active{transform:translateY(0)}
@media (max-width:900px){ .kcar-track > .kcard{flex-basis:calc((100% - 16px) / 2);max-width:calc((100% - 16px) / 2)} }
@media (max-width:600px){ .kcar-track > .kcard{flex-basis:88%;max-width:88%} .kcar-prev{left:2px} .kcar-next{right:2px} }

/* Nút nổi "Tạo mới" — luôn thấy khi cuộn danh sách dài (vd + Khóa học ở trang Đào tạo) */
.fab-add{position:fixed;right:24px;bottom:24px;z-index:150;background:var(--maroon,#7B1E2B);color:#fff;border:none;
  border-radius:30px;padding:13px 22px;font-size:14px;font-weight:700;cursor:pointer;box-shadow:0 6px 20px rgba(123,30,43,.35);
  display:flex;align-items:center;gap:6px;transition:transform .12s,box-shadow .12s}
.fab-add:hover{transform:translateY(-2px);box-shadow:0 9px 26px rgba(123,30,43,.45)}
.fab-add:active{transform:translateY(0)}
@media (max-width:640px){ .fab-add{right:16px;bottom:16px;padding:12px 18px} }

/* ---------- Toast ---------- */
/* pointer-events:none trên CONTAINER — nếu không, khung toast rỗng (z-index 1500 > cửa sổ chat 1200) phủ lên
   góc phải màn hình và NUỐT CLICK: bấm vào các hội thoại phía trên trong cửa sổ chat không ăn (chị My 14/08).
   Từng .toast bật lại pointer-events để vẫn bấm/đóng được. */
#toast-root{position:fixed;right:20px;bottom:20px;z-index:1500;display:flex;flex-direction:column;gap:10px;pointer-events:none}
#toast-root>*{pointer-events:auto}
/* NÚT TẢI/XUẤT EXCEL toàn app — xanh lá đồng bộ cho dễ nhận ra (chị My 15/08). !important để thắng style inline cũ. */
.btn-excel{background:#1a9e4b!important;border-color:#1a9e4b!important;color:#fff!important;font-weight:700!important}
.btn-excel:hover{background:#127a3e!important;border-color:#127a3e!important}

/* ===== KHỐI HỢP ĐỒNG GỐC + DÒNG CON (Phụ lục / Thỏa thuận) — chị My 15/08 =====
   HĐ gốc mở đầu 1 khối (viền trên đậm màu maroon nhạt, chữ đậm); dòng con thụt vào,
   chữ nhỏ hơn + nền hồng nhạt + mũi tên ↳ maroon rõ để thấy ngay sự liên kết. */
.lc-row.lc-root td{border-top:2px solid var(--maroon-100,#e7c9cd);background:#fff}
.lc-row.lc-root:hover td{background:#fdf7f8}
.lc-row.lc-child td{font-size:12px;color:#5b5b60;background:#faf6f7;padding-top:6px;padding-bottom:6px;border-top:1px dashed #ecdfe2}
.lc-row.lc-child:hover td{background:#f6edef}
/* Dòng HĐ CHÍNH nổi hơn hẳn dòng phụ lục: STT + tên NV đậm & to hơn (chị My 17/08) */
.lc-row.lc-root .lc-nv .person .n{font-size:14.5px;font-weight:800;color:#1a1a1a}
.lc-row.lc-child .lc-nv .person .n{font-size:12.5px;font-weight:500;color:#6b6b70}
.lc-row.lc-child .lc-nv .person .s{font-size:11px}
.lc-arrow{color:var(--maroon,#7B1E2B);font-weight:800;font-size:15px;margin:0 5px 0 12px;line-height:1}
.lc-row.lc-child .badge{font-size:10.5px;padding:1px 8px}

/* Bong bóng chat nổi đang hiện → nâng toast + nút nổi ＋ lên TRÊN bubble (56px + lề) kẻo bị che (chị My 14/08) */
body.cd-bubble-on #toast-root{bottom:92px}
body.cd-bubble-on .fab-add{bottom:92px}
.toast{background:var(--ink);color:#fff;padding:12px 18px;border-radius:11px;box-shadow:var(--shadow-lg);font-weight:600;font-size:13.5px;animation:pop .18s;display:flex;align-items:center;gap:9px}
.toast.ok{background:#13794f}
.toast.err{background:#b32d2d}

/* ---------- Attendance grid ---------- */
.att-grid{overflow:auto;border:1px solid var(--line);border-radius:var(--radius);max-height:calc(100vh - 240px)}
.att-grid table{border-collapse:collapse;font-size:12px;width:100%}
.att-grid th,.att-grid td{border:1px solid var(--line-2);padding:5px 6px;text-align:center;white-space:nowrap}
.att-grid thead th{background:#fafbfc;position:sticky;top:0;font-weight:700;z-index:2}
.att-grid td.stt,.att-grid th.stt{text-align:center;position:sticky;left:0;background:var(--card);min-width:38px;width:38px;font-weight:600;color:#888;z-index:1}
.att-grid thead th.stt{z-index:3}
.att-grid td.name,.att-grid th.name{text-align:left;position:sticky;left:38px;background:var(--card);min-width:180px;font-weight:600;z-index:1}
.att-grid thead th.name{z-index:3}
.att-grid td.tongcong-lv,.att-grid th.tongcong-lv{text-align:center;position:sticky;right:64px;min-width:64px;font-weight:800;background:#fde0e0;color:#b3261e;z-index:1}
.att-grid thead th.tongcong-lv{background:#d64545;color:#fff;z-index:3}
.att-grid td.tongcong,.att-grid th.tongcong{text-align:center;position:sticky;right:0;min-width:64px;font-weight:800;background:#dbf3e2;color:#0a5a22;z-index:1}
.att-grid thead th.tongcong{background:#1a9e45;color:#fff;z-index:3}
.att-grid td.wknd{background:#fbfbfd}
.cell{display:inline-block;width:22px;height:22px;line-height:22px;border-radius:6px;font-size:11px;font-weight:700}
/* ô công có hệ số ≠1 (vd ca full 1,5) → hiện SỐ CÔNG thay ✓, cần rộng hơn chút + viền nổi để dễ thấy */
.c-wv{width:auto;min-width:26px;padding:0 4px;font-size:10.5px;outline:1.5px solid var(--green,#127a2e);outline-offset:-1.5px}
.c-full{background:var(--green-bg);color:var(--green)}
.c-late{background:var(--amber-bg);color:var(--amber)}
.c-off{background:var(--red-bg);color:var(--red)}
.c-leave{background:var(--blue-bg);color:var(--blue)}
.c-in{background:var(--blue-bg);color:var(--blue)}   /* Đã check-in (chưa check-out) */
.c-flex{background:#e3f5f2;color:#0d7a6e}            /* Làm theo giờ (ca linh hoạt) — teal, khác hẳn check-in xanh dương */
.c-hour{width:auto;min-width:26px;padding:0 4px;background:#d6f0eb;color:#0a6157;font-weight:700;font-size:10.5px}  /* NV theo giờ: ô hiện số giờ "Xh" */
.c-short{background:var(--red-bg);color:var(--red)}  /* Công thiếu (ra sớm, không tính lương) */
.c-wfh{background:var(--violet-bg);color:var(--violet)}
.c-none{color:var(--line)}
.legend{display:flex;gap:16px;flex-wrap:wrap;margin:14px 2px 0;font-size:12.5px;color:var(--ink-2)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend .dot{width:12px;height:12px;border-radius:4px;display:inline-block}

/* ---------- Kanban (recruitment) ---------- */
.kanban{display:grid;grid-template-columns:repeat(6,minmax(190px,1fr));gap:12px;overflow-x:auto;padding-bottom:8px}
.kcol{background:var(--bg);border-radius:12px;padding:10px;min-height:120px}
.kcol-head{display:flex;align-items:center;gap:8px;font-weight:700;font-size:13px;margin-bottom:10px;padding:2px 4px}
.kcol-head .cnt{margin-left:auto;background:var(--card);border-radius:999px;padding:1px 9px;font-size:11.5px;color:var(--ink-2)}
.kcard{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:11px;margin-bottom:9px;box-shadow:var(--shadow);cursor:pointer}
.kcard:hover{border-color:var(--maroon-100)}
.kcard .n{font-weight:700;font-size:13.5px}
.kcard .p{font-size:12px;color:var(--ink-2);margin:3px 0 7px}
.kcard .src{font-size:11px;color:var(--muted)}
.kcard-actions{display:flex;gap:6px;margin-top:9px}
.mini-btn{flex:1;border:1px solid var(--line);background:var(--card);border-radius:7px;padding:4px;font-size:11px;cursor:pointer;font-weight:600}
.mini-btn:hover{background:var(--maroon-50);color:var(--maroon);border-color:var(--maroon-100)}

/* progress bar */
.bar{height:8px;background:var(--line-2);border-radius:999px;overflow:hidden}
.bar > i{display:block;height:100%;background:var(--maroon);border-radius:999px}

/* empty */
.empty{text-align:center;padding:50px 20px;color:var(--muted)}
.empty .big{font-size:40px;margin-bottom:8px;opacity:.5}

.hidden{display:none!important}

/* nav divider */
.nav-divider{height:1px;background:rgba(255,255,255,.14);margin:8px 12px}

/* ---------- Đào tạo: danh sách & xem bài giảng ---------- */
.lesson-list{display:flex;flex-direction:column;gap:12px}
.lesson-card{
  display:flex;align-items:center;gap:16px;background:var(--card);
  border:1px solid var(--line);border-radius:14px;padding:12px 14px;cursor:pointer;
  transition:box-shadow .15s, transform .15s, border-color .15s;
}
.lesson-card:hover{box-shadow:0 6px 20px rgba(0,0,0,.08);border-color:var(--maroon);transform:translateY(-1px)}
.lesson-thumb{
  position:relative;width:140px;height:84px;flex-shrink:0;border-radius:10px;
  background:center/cover no-repeat #eee;display:grid;place-items:center;font-size:30px;color:#bbb;
}
.lesson-thumb.ph{background:linear-gradient(135deg,#fbe9ea,#f3f0f2)}
.lesson-num{
  position:absolute;top:6px;left:6px;width:24px;height:24px;border-radius:50%;
  background:var(--maroon);color:#fff;font-size:12px;font-weight:700;display:grid;place-items:center;
}
.lesson-num.done{background:var(--green)}
.lesson-play{
  position:absolute;inset:0;margin:auto;width:38px;height:38px;border-radius:50%;
  background:rgba(0,0,0,.55);color:#fff;display:grid;place-items:center;font-size:15px;padding-left:3px;
}
.lesson-meta{flex:1;min-width:0}
.lesson-title{font-weight:700;font-size:15px;margin-bottom:4px}
.lesson-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
/* ===== Bài giảng dạng LƯỚI THẺ (ảnh bìa to) — thay danh sách dòng cho bắt mắt ===== */
.lesson-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;align-items:start}
@media (max-width:1000px){ .lesson-grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width:620px){ .lesson-grid{grid-template-columns:1fr} }
.lcard{background:var(--card);border:1px solid var(--line);border-radius:14px;overflow:hidden;cursor:pointer;
  display:flex;flex-direction:column;transition:box-shadow .15s,transform .15s,border-color .15s}
.lcard:hover{box-shadow:0 8px 24px rgba(0,0,0,.1);border-color:var(--maroon);transform:translateY(-2px)}
.lcard.done{border-color:#bfe3cd}
.lcard-cover{position:relative;width:100%;aspect-ratio:16/10;background:#fff center/contain no-repeat;display:grid;place-items:center;border-radius:8px}
.lcard-cover.ph{background:linear-gradient(135deg,#fbe9ea,#f3f0f2)}
.lcard-ph{font-size:40px;color:#c98187}
.lcard-num{position:absolute;top:8px;left:8px;width:28px;height:28px;border-radius:50%;background:var(--maroon);
  color:#fff;font-size:13px;font-weight:800;display:grid;place-items:center;box-shadow:0 2px 6px rgba(0,0,0,.25)}
.lcard-num.done{background:var(--green)}
.lcard-play{position:absolute;inset:0;margin:auto;width:46px;height:46px;border-radius:50%;background:rgba(0,0,0,.55);
  color:#fff;display:grid;place-items:center;font-size:18px;padding-left:3px}
.lcard-donetag{position:absolute;bottom:8px;right:8px;background:var(--green);color:#fff;font-size:11px;font-weight:700;
  padding:2px 8px;border-radius:20px;box-shadow:0 2px 6px rgba(0,0,0,.2)}
.lcard-body{padding:12px 14px;display:flex;flex-direction:column;gap:6px;flex:1}
.lcard-title{font-weight:800;font-size:15px;line-height:1.3;color:var(--ink)}
.lcard-info{font-size:12.5px}
.lcard-foot{display:flex;align-items:center;gap:8px;margin-top:auto;padding-top:6px;flex-wrap:wrap}
.lcard-foot .mini-btn{flex:0;min-width:auto}

/* video nhúng 16:9 */
.video-wrap{position:relative;width:100%;padding-top:56.25%;border-radius:14px;overflow:hidden;background:#000;margin-bottom:16px}
.video-wrap iframe,.video-wrap video{position:absolute;inset:0;width:100%;height:100%;border:0}
/* nội dung bài giảng trình bày đẹp */
.lesson-content{color:var(--ink-2);line-height:1.8;font-size:15px}
.lesson-content h4{color:var(--ink);font-size:16px;font-weight:800;margin:18px 0 8px}
.lesson-content p{margin:0 0 12px}
.lesson-content ul,.lesson-content ol{margin:0 0 12px;padding-left:22px}
.lesson-content li{margin:5px 0}
/* Màn HỌC BÀI mở rộng: khổ chữ to hơn, dòng thoáng cho dễ đọc lâu */
.lesson-read-body{font-size:16.5px;line-height:1.9}
.lesson-read-body h4{font-size:18px;margin:22px 0 10px}
.lesson-read-body p{margin:0 0 15px}
.lesson-read-body li{margin:7px 0}
/* Ảnh MINH HỌA chèn trong nội dung: máy tính giữ ~2/3 khổ (giảm 1/3) + căn giữa → gọn nhưng rõ.
   Ép cả ảnh cũ (đã lưu inline max-width:100%) lẫn ảnh mới. */
.lesson-content img, .lesson-read-body img{
  display:block; max-width:min(620px,66%) !important; width:auto; height:auto;
  margin:14px auto; border-radius:10px;
}
/* ĐIỆN THOẠI: màn hẹp sẵn → cho ảnh gần full khổ để KHÔNG bị bé, dễ nhìn. */
@media(max-width:640px){
  .lesson-content img, .lesson-read-body img{ max-width:96% !important; }
}
@media (max-width:600px){
  .lesson-card{flex-wrap:wrap}
  .lesson-thumb{width:100%;height:150px}
  .lesson-actions{width:100%;justify-content:flex-end}
}

/* ---------- Guide / HDSD ---------- */
.guide-wrap{max-width:920px}
.guide-toc{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:22px}
.guide-toc a{background:var(--card);border:1px solid var(--line);border-radius:999px;padding:7px 14px;font-size:13px;font-weight:600;color:var(--ink-2)}
.guide-toc a:hover{border-color:var(--maroon-100);color:var(--maroon);background:var(--maroon-50)}
.guide-sec{margin-bottom:18px;scroll-margin-top:80px}
.guide-sec .card-pad{padding:22px 24px}
.guide-sec h2{font-size:17px;margin:0 0 4px;display:flex;align-items:center;gap:10px}
.guide-sec h2 .gnum{width:28px;height:28px;border-radius:8px;background:var(--maroon);color:#fff;display:grid;place-items:center;font-size:14px;flex-shrink:0}
.guide-sec p{margin:8px 0;color:var(--ink-2);line-height:1.65}
.guide-sec ol,.guide-sec ul{margin:8px 0 8px 4px;padding-left:20px;line-height:1.8}
.guide-sec li{margin:3px 0}
.guide-sec ul.guide-grid{display:grid;grid-template-columns:1fr 1fr;gap:2px 24px;list-style:none;padding-left:4px;margin:10px 0}
@media(max-width:700px){.guide-sec ul.guide-grid{grid-template-columns:1fr}}
.guide-sec .tip{background:var(--maroon-50);border-left:3px solid var(--maroon);border-radius:8px;padding:11px 14px;margin:12px 0;font-size:13.5px}
.guide-sec .warn{background:var(--amber-bg);border-left:3px solid var(--amber);border-radius:8px;padding:11px 14px;margin:12px 0;font-size:13.5px}
.guide-sec kbd{background:#fff;border:1px solid var(--line);border-bottom-width:2px;border-radius:6px;padding:1px 7px;font-size:12px;font-weight:600;font-family:inherit}
.guide-steps{counter-reset:gs;list-style:none;padding:0}
.guide-steps li{counter-increment:gs;position:relative;padding:6px 0 6px 36px;margin:4px 0}
.guide-steps li::before{content:counter(gs);position:absolute;left:0;top:5px;width:24px;height:24px;border-radius:50%;background:var(--maroon-50);color:var(--maroon);font-weight:700;font-size:12px;display:grid;place-items:center}
.video-box{background:#0f1115;border-radius:12px;aspect-ratio:16/9;display:grid;place-items:center;color:#9aa3b2;margin:12px 0;border:1px dashed #2a2f3a;text-align:center;padding:20px}
.video-box .play{width:54px;height:54px;border-radius:50%;background:var(--maroon);color:#fff;display:grid;place-items:center;font-size:22px;margin-bottom:10px}
.role-table td{padding:8px 12px;border-bottom:1px solid var(--line-2);font-size:13.5px}
.role-table td:first-child{font-weight:600;white-space:nowrap}
.right-actions{display:flex;gap:8px}
.kpi-rating{display:flex;align-items:center;gap:8px}
.muted-sm{font-size:12px;color:var(--muted)}
.text-green{color:var(--green);font-weight:700}
.text-red{color:var(--red);font-weight:700}

/* thẻ quà có ảnh minh hoạ (emoji lớn) */
.gift-card{display:flex;flex-direction:column;align-items:center}
.gift-thumb{width:84px;height:84px;border-radius:16px;background:linear-gradient(135deg,var(--maroon-50),#fff);
  display:grid;place-items:center;font-size:44px;margin-bottom:10px;border:1px solid var(--line);background-size:cover;background-position:center}
/* lưới quà 5 cột, thẻ nhỏ gọn */
.gift-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}
@media(max-width:1200px){.gift-grid{grid-template-columns:repeat(4,1fr)}}
@media(max-width:900px){.gift-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:600px){.gift-grid{grid-template-columns:repeat(2,1fr)}}
.gift-card2{padding:12px;display:flex;flex-direction:column;align-items:center;position:relative;overflow:hidden}
.gift-thumb.sm{width:64px;height:64px;border-radius:12px;font-size:32px;margin-bottom:8px;background-size:cover;background-position:center;
  background-color:var(--maroon-50);display:grid;place-items:center;border:1px solid var(--line)}
.gift-name{font-weight:700;font-size:13px;text-align:center;line-height:1.3}
.gift-admin{display:none;gap:6px;margin-top:8px}
.gift-card2:hover .gift-admin{display:flex}

/* ============================================================
   RESPONSIVE — ĐIỆN THOẠI / MÁY TÍNH BẢNG (<=820px)
   ============================================================ */
.backdrop{display:none}
@media(max-width:820px){
  /* CHỐNG TRÀN NGANG toàn cục: không khối nào rộng quá màn hình điện thoại */
  html,body{overflow-x:hidden;max-width:100vw}
  .main,.content,.page-head,.card,.modal,.filters,.tip,.kv,.kv-2,.hh-box{max-width:100%;box-sizing:border-box}
  .content > *,.card{min-width:0}
  .filters{flex-wrap:wrap}
  .filters label,.filters .search{min-width:0;flex:1 1 140px}
  .filters .input,.filters .select{max-width:100%}
  /* BẢNG trên điện thoại: BỎ table-layout:fixed (nguyên nhân bóp cột → chữ vỡ dọc),
     cho cột giãn theo nội dung + cuộn ngang trong khung. Tiêu đề KHÔNG xuống dòng. */
  .table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .table-wrap table.tbl{table-layout:auto!important;min-width:max-content;width:auto}
  .table-wrap table.tbl th{white-space:nowrap}
  .table-wrap table.tbl td{white-space:normal;word-break:normal;overflow-wrap:break-word;max-width:220px}
  .table-wrap table.tbl colgroup{display:none}   /* bỏ ép width cột cứng trên mobile */
  /* chữ/link dài tự xuống dòng ở KHỐI (không phải ô bảng) */
  .card,.tip,.kv .v,.kv-2 .v,.muted-sm{overflow-wrap:anywhere;word-break:break-word}
  /* thanh sub-tab cuộn ngang gọn, không đẩy trang */
  .tabs{overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;max-width:100%}
  /* sidebar trượt từ trái, ẩn mặc định */
  .sidebar{position:fixed;top:0;left:0;height:100vh;z-index:60;width:82vw;max-width:300px;
    transform:translateX(-100%);transition:transform .25s ease;box-shadow:0 0 40px rgba(0,0,0,.3)}
  body.menu-open .sidebar{transform:translateX(0)}
  body.menu-open .backdrop{display:block;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:55}
  .sidebar.hidden{transform:translateX(-100%)} /* dùng chung với toggle cũ */
  .main{width:100%}
  /* topbar gọn cho mobile */
  .topbar{height:auto;min-height:56px;padding:8px 12px;gap:10px;flex-wrap:wrap}
  .topbar-title{font-size:16px}
  .topbar-search{order:3;width:100%;flex:1 1 100%;max-width:none;margin-left:0}
  .icon-btn{font-size:22px}
  .topbar-right{width:100%;margin-left:0;gap:10px;flex-wrap:nowrap;align-items:center;justify-content:space-between}
  /* entity-switch hiện ĐỦ 3 nút, KHÔNG cuộn ngang; chia đều chỗ */
  .entity-switch{flex:1 1 auto;min-width:0;overflow:visible;display:flex}
  .es-btn{flex:1 1 0;min-width:0;padding:7px 6px;font-size:12px;text-align:center;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  /* chip tài khoản gọn lại, không chiếm chỗ của entity-switch */
  .user-switch{flex:0 0 auto;align-items:flex-end;max-width:42vw}
  .me-chip{padding:4px 10px 4px 4px}
  .me-name{font-size:12.5px;max-width:26vw;overflow:hidden;text-overflow:ellipsis}
  /* nội dung full width, padding nhỏ */
  .content{padding:14px 12px 50px}
  .page-title{font-size:18px}
  .page-head{gap:8px}
  /* lưới về 1 cột */
  .stats{grid-template-columns:1fr 1fr;gap:10px}
  .grid-2,.grid-3,.grid-2-1,.gift-grid{grid-template-columns:1fr 1fr!important}
  /* tabs cuộn ngang thay vì xuống dòng */
  .tabs{overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch}
  .tab{white-space:nowrap;padding:11px 12px;font-size:13px}
  /* ĐT: dòng mẫu chỉ tiêu KPI — nút xuống dưới tên cho gọn */
  .ktpl-row{flex-wrap:wrap}
  .ktpl-row > div:last-child{width:100%;justify-content:flex-end}
  /* ĐIỆN THOẠI: tab CHÍNH/PHỤ thu gọn — không choán màn hình, cuộn ngang mượt (chị My 18/07) */
  .tabs.tabs-main{gap:6px;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;
    scrollbar-width:none;padding-bottom:2px;margin-bottom:10px;border-bottom:2px solid var(--maroon-100,#e7c9cd)}
  .tabs.tabs-main::-webkit-scrollbar{display:none}
  .tabs.tabs-main .tab{font-size:13px;font-weight:700;padding:8px 13px;border-radius:9px 9px 0 0;flex:0 0 auto}
  /* bỏ dấu ngắt hàng (flex-basis:100%) trên đt → tab CHÍNH gom về 1 hàng cuộn ngang, không tràn nhiều hàng chiếm chỗ */
  .tabs.tabs-main .tabs-main-break{display:none !important}
  .tabs.tabs-sub{gap:5px;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;
    scrollbar-width:none;padding:6px 8px;margin:-2px 0 12px}
  .tabs.tabs-sub::-webkit-scrollbar{display:none}
  .tabs.tabs-sub .tab{font-size:11.5px;padding:5px 11px;flex:0 0 auto}
  /* 🎯 OKR trên đt: nút không bị bóp xé chữ dọc; mỗi KR xếp DỌC (tên → thanh + nút Cập nhật cùng hàng) */
  .okr-card .mini-btn{white-space:nowrap;flex:0 0 auto}
  .okr-krrow{flex-wrap:wrap !important;gap:6px 10px !important;align-items:center}
  .okr-krrow .okr-kr-title{flex:1 1 100% !important;min-width:0 !important;font-weight:600}
  .okr-krrow .okr-kr-bar{flex:1 1 auto !important;min-width:110px !important}
  .okr-krrow .okr-kr-act{flex:0 0 auto !important;white-space:normal !important;display:flex;gap:6px;align-items:center}
  .okr-krrow .okr-kr-act .mini-btn{white-space:normal;text-align:left;font-size:12px}
  /* header card OKR: hàng nút (Chi tiết/+KR/Xoá) cho xuống dòng gọn, không tràn phải */
  .okr-card > div[style*="flex-wrap:wrap"]{gap:8px !important}
  /* bảng cuộn ngang mượt */
  .table-wrap,.att-grid{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .tbl{font-size:12.5px}
  .tbl thead th,.tbl tbody td{padding:9px 10px}
  /* QUAN TRỌNG: bảng table-layout:fixed (đề xuất, CBCL…) trên điện thoại bị bóp cột → chữ rớt từng
     ký tự dọc. Bỏ fixed + bỏ colgroup % để cột tự co theo nội dung; ẩn cột phụ (.mob-hide) cho vừa màn hình. */
  .table-wrap .tbl[style*="table-layout:fixed"]{table-layout:auto!important;width:100%!important;min-width:0!important}
  .table-wrap .tbl[style*="table-layout:fixed"] colgroup{display:none}
  .table-wrap .tbl[style*="table-layout:fixed"] td,
  .table-wrap .tbl[style*="table-layout:fixed"] th{white-space:normal;word-break:normal}
  /* ẩn cột phụ trên điện thoại — xem đầy đủ khi bấm "Xem" */
  .mob-hide{display:none!important}
  /* modal/drawer full màn hình trên mobile */
  .modal,.modal.lg,.modal.xl,.modal.full{max-width:100%;width:100%}
  .drawer,.drawer.lg{max-width:100%}
  .modal-overlay{padding:0}
  .form-grid{grid-template-columns:1fr}
  .kv,.kv-2{grid-template-columns:120px 1fr}
  /* BỘ LỌC trên đt: GRID 2 CỘT gọn (thay vì mỗi ô 1 hàng dọc → tránh đẩy bảng xuống sâu). Label nhỏ nằm trên select.
     LOẠI TRỪ #shnFilter (Cập nhật mã & sàn) — nó có layout riêng (segmented + chip cuộn), không ép grid. */
  .filter-bar:not(#shnFilter){display:grid !important;grid-template-columns:1fr 1fr;gap:8px 10px;align-items:end;padding:10px}
  .filter-bar:not(#shnFilter) > label{display:flex;flex-direction:column;gap:3px;font-size:11.5px;color:#666;font-weight:600;min-width:0}
  .filter-bar:not(#shnFilter) .search input,.filter-bar:not(#shnFilter) .select,.filter-bar:not(#shnFilter) select{min-width:0;width:100%;font-size:16px}
  /* ô tìm + nút bỏ lọc + đếm số: chiếm cả hàng cho dễ bấm */
  .filter-bar:not(#shnFilter) > .search,.filter-bar:not(#shnFilter) > [id$="Clear"],.filter-bar:not(#shnFilter) > .btn-sm{grid-column:1 / -1}
  .filter-bar:not(#shnFilter) > span[class*="muted"]{grid-column:1 / -1;margin:0 !important;text-align:right}
  /* #shnFilter cha: đảm bảo con có thể tạo vùng cuộn ngang (min-width:0 để không bị nội dung đẩy rộng) */
  #shnFilter{min-width:0;max-width:100%}
  #shnFilter > div{min-width:0;max-width:100%}
  /* chip loại tin (Cập nhật mã & sàn) cuộn ngang 1 hàng — width:100%+min-width:0 để overflow-x KÍCH HOẠT (vuốt trượt) */
  #shnFilter .shn-chipwrap{display:flex !important;flex-wrap:nowrap !important;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;width:100%;max-width:100%;min-width:0;padding-bottom:3px}
  #shnFilter .shn-chipwrap::-webkit-scrollbar{display:none}
  #shnFilter .shn-chip{flex:0 0 auto}
  /* header Cập nhật mã & sàn: mô tả full 1 hàng, 2 nút (Tải Excel/Đăng) xuống hàng dưới chia đôi — không co text dọc */
  .shn-head{flex-direction:column;align-items:stretch !important}
  .shn-head .right-actions{display:flex;gap:8px}
  .shn-head .right-actions .btn{flex:1 1 auto;justify-content:center;white-space:nowrap}
  /* segmented trạng thái cuộn ngang khi chật (thêm nút Dashboard) */
  #shnFilter .shn-segwrap{overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;max-width:100%;min-width:0}
  #shnFilter .shn-segwrap::-webkit-scrollbar{display:none}
  #shnFilter .shn-seg{white-space:nowrap;flex:0 0 auto}
  .right-actions{flex-wrap:wrap}
  /* THANH CÔNG CỤ nhiều cột (giao việc, phối hợp, biên bản họp, đề xuất…) dựng bằng grid inline
     → trên điện thoại GOM VỀ 1 CỘT để không tràn ngang. Áp cho mọi grid inline trong thẻ card,
     trừ các ô nút nhỏ (mini-toolbar, kanban, các grid dùng place-items như chấm tròn duyệt). */
  .card [style*="grid-template-columns"]:not(.apv-step):not(.kanban):not(.no-mstack){
    grid-template-columns:1fr!important;
  }
  .card [style*="grid-template-columns"]>*{min-width:0}
  /* dòng việc cần làm: thanh % + nút co lại vừa màn hình */
  .td-item input[type=range]{max-width:100%!important}
  /* chip người dùng + chuông không tràn */
  .topbar{flex-wrap:wrap}
}
@media(max-width:560px){
  /* thẻ 3 cột (tin tức, ứng viên…) → 1 cột trên điện thoại cho dễ đọc, không bị bóp méo */
  .grid-3{grid-template-columns:1fr!important}
}
@media(max-width:430px){
  .stats,.grid-2,.grid-3,.grid-2-1,.gift-grid{grid-template-columns:1fr!important}
}
/* ===== Bảng danh sách hàng hủy (form đề xuất hủy) — desktop hàng ngang, mobile card dọc ===== */
.hh-head{display:grid;grid-template-columns:0.9fr 1.5fr 0.5fr 0.6fr 1fr 1.3fr auto 28px;gap:6px;font-size:12px;color:#888;font-weight:600;margin-bottom:4px;padding:0 2px}
.hh-item{display:grid;grid-template-columns:0.9fr 1.5fr 0.5fr 0.6fr 1fr 1.3fr auto 28px;gap:6px;margin-bottom:6px;align-items:center}
.hh-f{display:block;min-width:0}
.hh-f>.input{padding:6px 8px;min-width:0;width:100%;box-sizing:border-box}
.hh-f>.hh-sl{text-align:right}
.hh-f>.mini-btn{min-width:auto;white-space:nowrap}
.hh-f>[data-lb]{}
.hh-item>.hh-rm{min-width:auto}
@media(max-width:560px){
  .hh-head{display:none}
  .hh-item{grid-template-columns:1fr;gap:10px;border:1px solid var(--line);border-radius:12px;padding:14px 12px;margin-bottom:12px;background:#fafafa;position:relative}
  .hh-f{position:relative}
  .hh-f::before{content:attr(data-lb);display:block;font-size:11.5px;font-weight:600;color:#8a8a8a;margin-bottom:3px}
  .hh-f>.input,.hh-f>.hh-img{width:100%;box-sizing:border-box;font-size:16px;padding:11px 12px} /* 16px: iOS không auto-zoom */
  .hh-f>.hh-sl{text-align:left}
  .hh-f>.hh-img{text-align:left;background:#fff}
  /* SL + ĐVT ngắn → xếp cạnh nhau cho gọn */
  .hh-item{grid-template-columns:1fr 1fr}
  .hh-f{grid-column:1 / -1}
  .hh-f.hh-half{grid-column:span 1}
  /* nút xóa dòng: góc phải trên của card */
  .hh-item>.hh-rm{position:absolute;top:8px;right:8px;width:32px;height:32px;border-radius:8px;z-index:1}
}
/* ===== Bảng nội dung bàn giao (biên bản bàn giao) — desktop ngang, mobile card dọc ===== */
.ho-item{display:grid;grid-template-columns:1.4fr 2fr 1.2fr 1.2fr 28px;gap:6px;margin-bottom:6px;align-items:center}
.ho-f{display:block;min-width:0}
.ho-f>.input{width:100%;box-sizing:border-box;padding:6px 8px;min-width:0}
.ho-item>.ho-rm{min-width:auto}
@media(max-width:560px){
  .ho-item{grid-template-columns:1fr;gap:10px;border:1px solid var(--line);border-radius:12px;padding:14px 12px;margin-bottom:12px;background:#fafafa;position:relative}
  .ho-f{position:relative}
  .ho-f::before{content:attr(data-lb);display:block;font-size:11.5px;font-weight:600;color:#8a8a8a;margin-bottom:3px}
  .ho-f>.input{font-size:16px;padding:11px 12px}
  .ho-item>.ho-rm{position:absolute;top:8px;right:8px;width:32px;height:32px;border-radius:8px}
}
/* ===== Các khối đính kèm trong form hủy hàng — đóng khung nổi bật, dễ phân biệt ===== */
.hh-box{display:block;margin-top:12px;padding:12px 14px;border-radius:12px;border:1px solid var(--line);border-left:4px solid var(--maroon);background:#fbfafd}
.hh-box-t{display:block;font-weight:700;font-size:14px;color:var(--maroon)}
.hh-box-img{border-left-color:#2e7d32;background:#f4faf4}       /* ảnh/video: xanh lá */
.hh-box-img .hh-box-t{color:#2e7d32}
.hh-box-doc{border-left-color:#1565c0;background:#f3f8fe}       /* file danh sách: xanh dương */
.hh-box-doc .hh-box-t{color:#1565c0}
.hh-box-link{border-left-color:#e08600;background:#fff9f0}     /* link: cam */
.hh-box-link .hh-box-t{color:#b26a00}
.hh-box .input{margin-top:2px}
/* tiến trình duyệt nhiều tầng */
.apv-steps{margin:2px 0}
.apv-step{display:flex;align-items:center;gap:8px;padding:2.5px 0}
.apv-dot{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;font-size:11px;font-weight:700;flex-shrink:0;color:#fff}
.apv-dot.done{background:var(--green)} .apv-dot.cur{background:var(--maroon)} .apv-dot.wait{background:var(--line);color:var(--muted)} .apv-dot.rej{background:var(--red)}
.apv-line{flex:1;min-width:0;line-height:1.3} .apv-line .n{font-weight:600;font-size:12px} .apv-line .s{font-size:10.5px;color:var(--muted)}
.apv-role{font-weight:400;font-size:10.5px;color:var(--muted)}
/* ảnh bìa tin tức */
.news-cover{height:150px;background-size:cover;background-position:center}
.news-cover-ph{display:grid;place-items:center;font-size:40px;background:linear-gradient(135deg,var(--maroon-50),#fff);color:var(--maroon-100)}
/* hover nổi nhẹ để tin tức "mời gọi" bấm vào */
.news-card:hover{transform:translateY(-3px);box-shadow:0 8px 24px rgba(0,0,0,.10)}
@media(max-width:760px){.news-hero{grid-template-columns:1fr!important}.news-hero .news-cover{height:180px!important}}

/* Ô soạn thảo có định dạng (richBox): placeholder mờ khi rỗng + con trỏ soạn thảo */
.rich-edit:focus{background:#fffdf9}
.rich-edit.rich-empty::before{content:attr(data-ph);color:#9aa0a6;font-style:italic;pointer-events:none}
.rich-b:hover,.rich-c:hover{background:#f0e6e8 !important}
.rich-edit ul,.rich-edit ol{margin:4px 0;padding-left:22px}
/* ẢNH dán vào ô soạn thảo: co vừa khung, không tràn ngang (bài giảng + tin tức) */

/* 📰 TIN TỨC soạn bằng trình soạn thảo giàu định dạng (chị My 20/08 — chèn ảnh minh hoạ giữa bài).
   Ảnh co vừa khổ bài, khoảng cách đoạn dễ đọc trên cả điện thoại. */
/* Ảnh trong bài: giới hạn CẢ chiều rộng LẪN chiều cao. Ảnh chụp màn hình điện thoại rất cao
   (vd 738×1600) — chỉ chặn chiều rộng thì vẫn chiếm gần hết màn hình (chị My 20/08).
   !important để đè style cũ nằm trực tiếp trên thẻ ảnh của các bài đã đăng. */
.nw-rich img{max-width:min(560px,100%) !important;max-height:520px !important;width:auto !important;height:auto !important;
  object-fit:contain;border-radius:10px;margin:10px auto;display:block;box-shadow:0 2px 10px rgba(0,0,0,.08);cursor:zoom-in}
/* trong ô soạn thảo cũng vậy, để lúc soạn nhìn đúng như lúc đăng */
.rich-edit img{max-width:min(560px,100%) !important;max-height:520px !important;width:auto !important;height:auto !important;
  object-fit:contain;border-radius:8px;margin:6px auto;display:block}
.nw-rich p{margin:8px 0}
.nw-rich ul,.nw-rich ol{margin:8px 0;padding-left:24px}
.nw-rich li{margin:3px 0}
.nw-rich b,.nw-rich strong{color:#1f2430}
.nw-rich table{max-width:100%;border-collapse:collapse}
.nw-rich td,.nw-rich th{border:1px solid var(--line);padding:6px 9px}

/* Sơ đồ tổ chức — 4 CỘT cân bằng: mỗi cột là 1 stack dọc, các phòng chia sẵn để cao đều,
   KHÔNG lỗ hổng do phòng cao (Kế toán). 2 kho lớn tách xuống 1 hàng full-width. */
.org-colgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:0 16px;align-items:start}
.org-col{display:flex;flex-direction:column}
@media (max-width:1100px){.org-colgrid{grid-template-columns:repeat(2,1fr)}}
@media (max-width:640px){.org-colgrid{grid-template-columns:1fr}}
.org-wide-row{display:grid;grid-template-columns:1fr 1fr;gap:0 16px;align-items:start;margin-top:0}
@media (max-width:900px){.org-wide-row{grid-template-columns:1fr}}
.org-m:hover{background:#fbf4f5}
.org-dept:last-child{margin-bottom:0}
/* người khớp ô tìm trong sơ đồ — nổi bật viền vàng + nền nhạt */
.org-hit{background:#fff7db!important;box-shadow:0 0 0 2px #e0a800;border-radius:6px;transition:opacity .15s}
/* avatar CEO/GĐ ở đỉnh: ép .avatar con lấp đầy khung tròn */
.org-topava{position:relative}
.org-topava .avatar{width:100%!important;height:100%!important;border-radius:50%!important;font-size:20px}
.org-topava .avatar>span{border-radius:50%}
/* chấm online của CEO/GĐ: to hơn, đẩy ra mép ngoài khung tròn cho khỏi bị viền che */
.org-topava .online-dot{width:14px;height:14px;right:1px;bottom:1px;border-width:2.5px}

/* Chat 1-1 nội bộ — 2 cột trên desktop, xếp dọc trên mobile */
/* CHAT: desktop = 2 cột (danh sách trái + khung phải); mobile = 1 cột chuyển đổi (list ↔ khung chat) */
.chat-wrap{display:grid;grid-template-columns:300px 1fr;gap:14px;min-height:60vh}
.chat-back{display:none}   /* nút quay lại: ẩn trên desktop */
@media (max-width:760px){
  .chat-wrap{grid-template-columns:1fr;min-height:auto}
  /* mặc định trên đt: CHỈ hiện danh sách; ẩn khung chat + nút quay lại */
  .chat-wrap .chat-col-pane{display:none}
  .chat-wrap .chat-back{display:none}
  /* khi đang mở 1 cuộc chat (JS thêm class .chatting): hiện khung chat + nút quay lại, ẩn danh sách */
  .chat-wrap.chatting .chat-col-threads{display:none}
  .chat-wrap.chatting .chat-col-pane{display:flex;min-height:70vh}
  .chat-wrap.chatting .chat-back{display:block;margin-bottom:8px;align-self:flex-start;width:auto}
}
.chat-thread:hover{background:#faf3f4}

/* ============================================================
   📱 NATIVE MOBILE POLISH (thêm 27/07 — chuẩn app điện thoại)
   Nguyên tắc AN TOÀN: chỉ BỔ SUNG, KHÔNG đụng overflow-x:hidden của body,
   KHÔNG đụng logic bảng table-layout:fixed, KHÔNG đổi cách mở popup.
   Toàn bộ nằm trong @media mobile để desktop giữ nguyên 100%.
   ============================================================ */

/* (1) Chiều cao đúng trên mobile: 100dvh không bị "nhảy" khi thanh địa chỉ iOS ẩn/hiện.
   Dùng @supports để máy cũ không hỗ trợ dvh vẫn giữ 100vh cũ. */
@supports (height:100dvh){
  @media (max-width:820px){
    #app{min-height:100dvh}
    .sidebar{height:100dvh}
    .drawer,.drawer.lg{min-height:100dvh}
  }
}

@media (max-width:820px){
  /* (2) CHỐNG iOS TỰ ZOOM khi chạm ô nhập: mọi input/select/textarea ≥16px.
     Đây là nguyên nhân chính gây "kéo lệch / phóng to" khi gõ trên iPhone. */
  .input,.select,input,select,textarea{font-size:16px !important}
  /* ô nhỏ trong bảng mặt hàng (đơn giá, SL…) vẫn 16px để không zoom, chỉ giảm padding cho gọn */
  .hh-f>.input,.cd-item .input,.bl-item .input,.pr-line input{padding:9px 10px}

  /* (3) SAFE-AREA tai thỏ / thanh Home iPhone — không bị notch che, không dính sát mép dưới.
     Chỉ thêm padding theo safe-area (0 trên máy thường nên vô hại). */
  .topbar{padding-top:calc(8px + var(--sat));padding-left:calc(12px + var(--sal));padding-right:calc(12px + var(--sar))}
  .sidebar{padding-top:var(--sat);padding-bottom:var(--sab)}
  .content{padding-left:calc(12px + var(--sal));padding-right:calc(12px + var(--sar));
    padding-bottom:calc(50px + var(--sab))}   /* chừa chỗ cho thanh Home + FAB */
  .fab-add{bottom:calc(16px + var(--sab));right:calc(16px + var(--sar))}

  /* (4) POPUP/MODAL full màn hình: chạy hết chiều cao thực + chừa safe-area,
     footer nút LUÔN dính đáy (trước đây chỉ dính ở ≤640px → khoảng 641–820px bị rơi nút). */
  .modal,.modal.lg,.modal.xl,.modal.full,.drawer,.drawer.lg{
    display:flex;flex-direction:column;max-height:100dvh}
  .modal-head{flex:0 0 auto;padding-top:calc(16px + var(--sat))}
  .modal-body{flex:1 1 auto;max-height:none !important;overflow:auto;-webkit-overflow-scrolling:touch}
  .modal-foot{flex:0 0 auto;position:sticky;bottom:0;background:var(--card,#fff);
    box-shadow:0 -2px 8px rgba(0,0,0,.06);
    padding:10px 12px calc(10px + var(--sab)) 12px}
  /* drawer (trượt phải) trên mobile cũng full + có safe-area giống modal */
  .modal-overlay.right{align-items:stretch}

  /* (5) VÙNG CHẠM đủ lớn (~44px) cho ngón tay — chuẩn native, đỡ bấm nhầm.
     Chỉ áp nút hành động chính; nút .btn-sm/.mini-btn (trong bảng) giữ nhỏ có chủ đích. */
  .btn:not(.btn-sm){min-height:44px}
  .nav-item{min-height:46px}
  .icon-btn,.bell-btn{min-width:40px;min-height:40px}
  /* menu tài khoản / mục bấm được trong danh sách dễ chạm hơn */
  .modal-head .x{width:40px;height:40px;font-size:22px}
}


/* STT tự đánh số cho từng dòng mặt hàng trong form Tạo YCMH (đối chiếu số mã với PO) */
#prItems{counter-reset:prstt}
.pr-line-stt{counter-increment:prstt}
.pr-line-stt::before{content:counter(prstt);position:absolute;left:-26px;top:8px;width:20px;text-align:right;font-size:11px;font-weight:700;color:#9aa0a6}
@media(max-width:820px){.pr-line-stt::before{display:none}}
/* Nội dung báo cáo có định dạng (rich-text): giữ list/xuống dòng đẹp */
.rtxt{white-space:normal;word-break:break-word}
.rtxt ul,.rtxt ol{margin:4px 0 4px 22px;padding:0}
.rtxt li{margin:2px 0}
.rtxt b,.rtxt strong{font-weight:700}
.rtxt img{max-width:100%;border-radius:6px}
/* CẶP ẢNH HDSD (Máy tính / Điện thoại) trong bài giảng — 2 cột trên màn rộng, tự xếp DỌC trên điện thoại */
.hd-pair{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0}
.hd-pair-col{flex:1 1 260px;min-width:220px;border:1px solid #eadfe0;border-radius:10px;overflow:hidden;background:#fff}
.hd-pair-col > div:first-child{background:#faf3f4;color:#7B1E2B;font-weight:700;font-size:12.5px;padding:6px 10px;border-bottom:1px solid #eadfe0}
.hd-pair-col img{max-width:100%;max-height:420px;border-radius:6px;display:inline-block;cursor:zoom-in}
/* KHÔNG NHÃN: ảnh trần cạnh nhau (không khung/nền) — ảnh to rõ hơn, bấm phóng to xem được */
.hd-pair-plain{flex:1 1 260px;min-width:200px;text-align:center}
.hd-pair-plain img{max-width:100%;max-height:600px;border-radius:8px;display:inline-block;cursor:zoom-in}
/* điện thoại: mỗi ô chiếm trọn 1 hàng → xếp dọc. !important để thắng style nội tuyến của ô. */
@media(max-width:640px){.hd-pair-col,.hd-pair-plain{flex:1 1 100% !important;min-width:0 !important}}

/* ===== 💬 CHAT NỔI (chatdock) — đè nổi góc phải, không co nội dung ===== */
#cdBubble{position:fixed;right:22px;bottom:22px;z-index:1200;width:56px;height:56px;border-radius:50%;border:none;background:var(--maroon,#7B1E2B);color:#fff;font-size:24px;cursor:pointer;box-shadow:0 6px 20px rgba(70,20,28,.35);display:flex;align-items:center;justify-content:center;transition:transform .15s}
#cdBubble:hover{transform:scale(1.06)}
#cdBubble.cd-on{background:#5a141d}
.cd-badge{position:absolute;top:-2px;right:-2px;min-width:20px;height:20px;padding:0 5px;border-radius:12px;background:#e11;color:#fff;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center;border:2px solid #fff}
.cd-panel{position:fixed;right:22px;bottom:88px;z-index:1200;width:var(--cd-w,440px);max-width:calc(100vw - 24px);height:var(--cd-h,min(620px,calc(100vh - 130px)));min-width:320px;min-height:320px;background:var(--card,#fff);border:1px solid var(--line,#e7dfe1);border-radius:16px;box-shadow:0 16px 48px rgba(70,20,28,.28);display:flex;flex-direction:column;overflow:hidden;animation:cdPop .16s}
@keyframes cdPop{from{transform:translateY(10px);opacity:.5}to{transform:translateY(0);opacity:1}}
.cd-head{display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--maroon,#7B1E2B);color:#fff;flex:0 0 auto}
.cd-title{flex:1;font-weight:700;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cd-icobtn{width:30px;height:30px;border:none;background:rgba(255,255,255,.15);color:#fff;border-radius:8px;cursor:pointer;font-size:17px;display:flex;align-items:center;justify-content:center;text-decoration:none}
.cd-icobtn:hover{background:rgba(255,255,255,.3)}
.cd-body{flex:1;overflow-y:auto;background:var(--bg,#f4f1f2)}
.cd-empty{padding:24px 16px;text-align:center;color:var(--muted,#8b8285);font-size:13px}
.cd-row{display:flex;align-items:center;gap:10px;padding:9px 12px;cursor:pointer;border-bottom:1px solid var(--line-2,#f0eaeb);background:var(--card,#fff)}
.cd-row:hover{background:var(--maroon-50,#f7ecee)}
.cd-row-av{width:38px;height:38px;border-radius:50%;flex:0 0 auto;display:flex;align-items:center;justify-content:center;font-size:20px;background:var(--maroon-50,#f7ecee);overflow:hidden}
.cd-row-av .avatar,.cd-row-av img{width:38px;height:38px}
.cd-row-main{flex:1;min-width:0}
.cd-row-top{display:flex;justify-content:space-between;gap:6px}
.cd-row-name{font-weight:700;font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cd-row-time{font-size:11px;color:var(--muted,#8b8285);flex:0 0 auto}
.cd-row-last{font-size:12px;color:var(--muted,#8b8285);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cd-row-last.cd-unread{color:var(--ink,#1d1a1b);font-weight:700}
.cd-row-badge{min-width:19px;height:19px;padding:0 5px;border-radius:11px;background:#e11;color:#fff;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.cd-ava{width:38px;height:38px;border-radius:50%;background:var(--maroon,#7B1E2B);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;text-transform:uppercase}
.cd-msg{margin:8px 10px;max-width:92%;min-width:0;clear:both}
/* Ảnh/file để RIÊNG 1 dòng (dưới bong bóng) — trước đây nằm chung hàng flex nên ép bong bóng
   co lại thành cột hẹp, chữ rơi dọc (chị My 14/08). */
.cd-msg-media{margin-top:4px;display:flex;flex-direction:column;gap:4px;align-items:flex-start}
.cd-mine .cd-msg-media{align-items:flex-end}
.cd-msg-media .cd-msg-img{max-width:min(240px,100%)}
.cd-mine{margin-left:auto;text-align:right}
.cd-msg-from{font-size:11px;color:var(--maroon,#7B1E2B);font-weight:700;margin-bottom:2px}
.cd-bubble2{display:inline-block;text-align:left;padding:7px 11px;border-radius:12px;background:var(--card,#fff);border:1px solid var(--line,#e7dfe1);font-size:13px;line-height:1.45;word-break:normal;overflow-wrap:anywhere;white-space:normal}
.cd-mine .cd-bubble2{background:var(--maroon,#7B1E2B);color:#fff;border-color:var(--maroon,#7B1E2B)}
.cd-msg-img{display:block;max-width:180px;border-radius:8px;margin-top:4px}
.cd-recalled{color:#999;font-size:12px}
.cd-msg-t{font-size:10px;color:var(--muted,#b8b0b2);margin-top:2px}
.cd-day{clear:both;text-align:center;margin:10px 0 6px}
.cd-day span{display:inline-block;font-size:11px;color:var(--muted,#8a8288);background:rgba(0,0,0,.06);padding:2px 12px;border-radius:11px;font-weight:600}
.cd-inputbar{display:flex;gap:6px;align-items:flex-end;padding:8px 10px;background:var(--card,#fff);border-top:1px solid var(--line,#e7dfe1);flex:0 0 auto}
#cdInput{flex:1;resize:none;border:1px solid var(--line,#e7dfe1);border-radius:18px;padding:8px 12px;font-family:inherit;font-size:13px;max-height:90px;line-height:1.4}
#cdInput:focus{outline:none;border-color:var(--maroon,#7B1E2B)}
.cd-send{width:38px;height:38px;border:none;border-radius:50%;background:var(--maroon,#7B1E2B);color:#fff;font-size:16px;cursor:pointer;flex:0 0 auto}
.cd-send:hover{background:#5a141d}
/* điện thoại: panel gần full màn */
@media(max-width:560px){.cd-panel{right:8px;left:8px;width:auto;bottom:80px;height:min(70vh,520px)}#cdBubble{right:14px;bottom:14px}}
#cdTopBtn{position:relative;background:none;border:none;cursor:pointer;font-size:19px;padding:4px 6px;line-height:1;color:inherit}
#cdTopBadge{position:absolute;top:-2px;right:-2px;min-width:16px;height:16px;padding:0 4px;border-radius:10px;background:#e11;color:#fff;font-size:10px;font-weight:800;display:flex;align-items:center;justify-content:center}
/* chat nổi: ô tìm nhanh + mục gợi ý */
.cd-search{flex:0 0 auto;padding:7px 10px;background:var(--card,#fff);border-bottom:1px solid var(--line,#e7dfe1)}
.cd-search input{width:100%;border:1px solid var(--line,#e7dfe1);border-radius:16px;padding:7px 12px;font-size:13px;font-family:inherit}
.cd-search input:focus{outline:none;border-color:var(--maroon,#7B1E2B)}
.cd-sec{padding:6px 12px 3px;font-size:11px;font-weight:800;color:var(--muted,#8b8285);text-transform:uppercase;letter-spacing:.3px;background:var(--bg,#f4f1f2)}
/* chat nổi: đính kèm ảnh/file */
.cd-attbtn{width:34px;height:34px;border:none;background:none;font-size:18px;cursor:pointer;flex:0 0 auto;border-radius:8px}
.cd-attbtn:hover{background:var(--maroon-50,#f7ecee)}
.cd-att{gap:8px;flex-wrap:wrap;padding:6px 10px;background:var(--card,#fff);border-top:1px solid var(--line,#e7dfe1)}
.cd-att-item{position:relative;width:52px;height:52px;border:1px solid var(--line,#e7dfe1);border-radius:8px;overflow:hidden;background:#f4f1f2;display:flex;align-items:center;justify-content:center}
.cd-att-item img{width:100%;height:100%;object-fit:cover}
.cd-att-file{width:auto;padding:0 8px;font-size:11px;font-weight:600;color:var(--ink-2,#5a5153)}
.cd-att-x{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:50%;border:none;background:#c0392b;color:#fff;font-size:12px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.cd-att-file .cd-att-x{position:static;margin-left:6px;width:16px;height:16px}
.cd-msg-file{display:inline-block;margin-top:4px;padding:6px 10px;border-radius:8px;background:var(--card,#fff);border:1px solid var(--line,#e7dfe1);font-size:12px;color:var(--maroon,#7B1E2B);text-decoration:none;font-weight:600}
.cd-mine .cd-msg-file{background:rgba(255,255,255,.9)}
/* chat nổi: thả cảm xúc tin nhắn */
.cd-msg-wrap{display:inline-flex;align-items:center;gap:4px;max-width:100%;min-width:0}
/* Tin dài trong chat nổi: bong bóng phải co giãn được, nếu không flex ép về min-content
   -> chữ rơi dọc từng ký tự (chị My 14/08). min-width:0 + flex-shrink cho phép xuống dòng đúng. */
.cd-msg-wrap .cd-bubble2{min-width:0;flex:1 1 auto;overflow-wrap:anywhere}
.cd-mine .cd-msg-wrap{flex-direction:row-reverse}
.cd-react-btn{opacity:0;border:none;background:var(--card,#fff);border:1px solid var(--line,#e7dfe1);border-radius:50%;width:24px;height:24px;font-size:13px;cursor:pointer;flex:0 0 auto;line-height:1;transition:opacity .12s;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.cd-msg:hover .cd-react-btn{opacity:1}
.cd-react-btn:hover{background:var(--maroon-50,#f7ecee)}
.cd-rchips{margin-top:-2px}
.cd-mine .cd-rchips{text-align:right}
.cd-rchip{display:inline-block;background:var(--card,#fff);border:1px solid var(--line,#e7dfe1);border-radius:12px;padding:0 7px;font-size:12px;line-height:19px;margin-right:3px}
.cd-react-pop{position:fixed;z-index:2000;background:var(--card,#fff);border:1px solid var(--line,#e7dfe1);border-radius:22px;box-shadow:0 8px 24px rgba(70,20,28,.22);padding:4px 6px;display:flex;gap:2px}
.cd-rpick{font-size:22px;cursor:pointer;padding:2px 4px;border-radius:8px;line-height:1;transition:transform .1s}
.cd-rpick:hover{transform:scale(1.35)}
@media(hover:none){.cd-react-btn{opacity:.55}}


/* ===== Chat nổi: kéo giãn cửa sổ (góc trên–trái) — chị My 14/08 ===== */
.cd-resize{position:absolute;top:0;left:0;width:18px;height:18px;cursor:nwse-resize;z-index:5}
.cd-resize::before{content:"";position:absolute;top:5px;left:5px;width:8px;height:8px;border-top:2px solid rgba(255,255,255,.75);border-left:2px solid rgba(255,255,255,.75);border-radius:2px 0 0 0}
.cd-panel.cd-resizing{user-select:none}
/* chip cảm xúc: rê chuột hiện tên người đã thả */
.cd-rchip{position:relative;cursor:default}
.cd-rchip[data-who]:hover::after{content:attr(data-who);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);
  background:#2b2b2b;color:#fff;font-size:11.5px;line-height:1.45;white-space:pre;padding:6px 9px;border-radius:7px;z-index:20;
  box-shadow:0 4px 14px rgba(0,0,0,.25);max-width:230px}
.cd-rchip[data-who]:hover::before{content:"";position:absolute;bottom:calc(100% + 1px);left:50%;transform:translateX(-50%);
  border:5px solid transparent;border-top-color:#2b2b2b;z-index:20}

/* Kích thước mặc định cửa sổ chat nổi (JS ghi đè khi người dùng kéo giãn) */
:root{--cd-w:440px;--cd-h:620px}
@media(max-height:760px){:root{--cd-h:calc(100vh - 150px)}}

/* @All trong tin nhắn (chị My 14/08) — gợi ý khi gõ @ + tô đậm trong bong bóng, giống Zalo */
.cd-atpop{position:fixed;z-index:2100;background:var(--card,#fff);border:1px solid var(--line,#e7dfe1);border-radius:10px;
  box-shadow:0 6px 20px rgba(70,20,28,.18);padding:8px 12px;display:flex;align-items:center;gap:9px;font-size:13px;cursor:pointer;max-width:280px}
.cd-atpop:hover{background:var(--maroon-50,#f7ecee)}
.cd-atpop-ico{width:24px;height:24px;border-radius:50%;background:#1560c0;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;flex:0 0 auto}
.cd-at-all{color:#1560c0;font-weight:700;background:#eaf3fb;border-radius:4px;padding:0 3px}

/* 🎁 ĐỔI QUÀ — hộp lưu ý trong tab Duyệt đổi quà (chị My 20/08).
   .warn chỉ có nền khi nằm trong .guide-sec nên phần này cần lớp riêng. */
.rd-note{background:var(--amber-bg);border-left:3px solid var(--amber);border-radius:8px;
  padding:11px 14px;font-size:13.5px;line-height:1.6}
.rd-note-tq{background:#f4ecf7;border-left-color:#8e44ad}

/* 🧳 CÔNG TÁC (chị My 20/08): ngày đi công tác — đủ 1 công, NV không phải chấm. */
.c-congtac{background:#e8f4fd;color:#1565c0}

/* ===== SOP & Tài liệu làm việc — khung thẻ rõ ràng (chị My 21/08) =====
   Trước đây các mục SOP dính liền nhau, nhiều chữ mà không phân tách nên khó đọc.
   Nay mỗi mục là 1 thẻ có viền + dải màu trái + tiêu đề trên nền nhạt. */
.sop-card {
  border: 1px solid #e6d9db;
  border-left: 5px solid var(--maroon, #7B1E2B);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(123, 30, 43, .06);
  transition: box-shadow .18s, border-color .18s;
}
.sop-card:hover { box-shadow: 0 4px 16px rgba(123, 30, 43, .13); border-color: #d9bfc3; }

/* THU GỌN: cả bài nằm trong <details>, chỉ hiện dải tiêu đề cho tới khi bấm (chị My 24/08). */
.sop-det > .sop-sum {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 12px 16px; cursor: pointer; list-style: none;
  background: linear-gradient(180deg, #fdf7f8 0%, #faf1f3 100%);
  transition: background .15s;
}
.sop-det > .sop-sum::-webkit-details-marker { display: none; }   /* bỏ mũi tên mặc định của trình duyệt */
.sop-det > .sop-sum:hover { background: linear-gradient(180deg, #fbeef0 0%, #f6e6e9 100%); }
.sop-det[open] > .sop-sum { border-bottom: 1px solid #f0e2e5; }
/* mũi tên tự xoay khi mở — dấu hiệu bấm được */
.sop-caret {
  flex: 0 0 auto; color: var(--maroon, #7B1E2B); font-size: 15px; line-height: 1.6;
  transition: transform .18s; display: inline-block; margin-top: 2px;
}
.sop-det[open] > .sop-sum .sop-caret { transform: rotate(90deg); }
/* STT đầu dòng — đếm theo danh sách ĐANG HIỆN (lọc phòng/loại/tìm thì đánh lại từ 1). */
.sop-stt {
  flex: 0 0 auto; min-width: 26px; height: 22px; padding: 0 6px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--maroon, #7B1E2B); color: #fff;
  border-radius: 6px; font-size: 12.5px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sop-det > .sop-sum .sop-title { display: block; margin: 6px 0 0; }
.sop-det > .sop-sum .sop-tags { display: flex; }

/* Dải tiêu đề trên nền hồng nhạt — tách hẳn khỏi phần nội dung */
.sop-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #fdf7f8 0%, #faf1f3 100%);
  border-bottom: 1px solid #f0e2e5;
}
.sop-title {
  font-size: 16.5px; font-weight: 800; color: var(--maroon, #7B1E2B);
  line-height: 1.45; margin: 6px 0 0;
}
.sop-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sop-body { padding: 14px 16px 4px; }
.sop-foot {
  padding: 8px 16px 11px; font-size: 11.5px; color: #999;
  border-top: 1px dashed #eee; margin-top: 10px;
}

/* Nội dung giàu định dạng bên trong SOP — giãn dòng, tiêu đề phụ nổi bật */
.sop-body .guide-rich { line-height: 1.75; font-size: 14.5px; color: #333; }
.sop-body .guide-rich h3 {
  font-size: 15.5px; font-weight: 800; color: var(--maroon, #7B1E2B);
  margin: 20px 0 9px; padding-left: 11px; border-left: 3px solid var(--maroon, #7B1E2B);
}
.sop-body .guide-rich h3:first-child { margin-top: 2px; }
.sop-body .guide-rich h4 { font-size: 14.5px; font-weight: 800; color: #5a3f45; margin: 15px 0 7px; }
.sop-body .guide-rich p { margin: 0 0 11px; }
.sop-body .guide-rich ul, .sop-body .guide-rich ol { margin: 0 0 12px; padding-left: 22px; }
.sop-body .guide-rich li { margin-bottom: 6px; }
.sop-body .guide-rich b, .sop-body .guide-rich strong { color: #1f1f1f; }

/* Bảng trong SOP: viền gọn, đầu bảng nền nhạt, cuộn ngang khi hẹp */
.sop-body .guide-rich table {
  width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 14px;
  display: block; overflow-x: auto;
}
.sop-body .guide-rich th {
  border: 1px solid #e8dcde; padding: 8px 10px; text-align: left;
  background: #faf3f4; color: var(--maroon, #7B1E2B); font-weight: 700; white-space: nowrap;
}
.sop-body .guide-rich td { border: 1px solid #eee; padding: 8px 10px; vertical-align: top; }
.sop-body .guide-rich tr:nth-child(even) td { background: #fcfafa; }

@media (max-width: 640px) {
  .sop-head { flex-direction: column; gap: 8px; padding: 11px 13px; }
  .sop-title { font-size: 15.5px; }
  .sop-body { padding: 12px 13px 4px; }
}

/* ===== DIỄN ĐÀN "Ngôi nhà số" — bài viết kiểu mạng xã hội (chị My 21/08) =====
   Trước đây mở bài ra trông như phiếu/tài liệu: nhãn nhỏ, chữ dày, khối bình luận
   viền xanh tách rời. Nay dựng theo lối Facebook: tác giả nổi, ảnh tràn viền,
   hàng nút hành động rõ, bình luận liền mạch. */
.fbp { margin: -4px -4px 0; }
.fbp-head { display: flex; align-items: center; gap: 11px; padding: 2px 0 12px; }
.fbp-ava { flex: 0 0 auto; }
.fbp-ava .avatar, .fbp-ava img { width: 44px !important; height: 44px !important; font-size: 16px !important; }
.fbp-who { min-width: 0; flex: 1; }
.fbp-name { font-weight: 700; font-size: 15px; color: #1c1e21; line-height: 1.3; }
.fbp-meta { font-size: 12.5px; color: #65676b; margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fbp-meta .fbp-dot { color: #b0b3b8; }
.fbp-cat {
  display: inline-block; background: #f0e6e8; color: var(--maroon, #7B1E2B);
  border-radius: 20px; padding: 1px 9px; font-size: 11.5px; font-weight: 700;
}
.fbp-seen { color: #127a2e; cursor: pointer; font-weight: 600; }

/* Nội dung bài — chữ to thoáng như status Facebook */
.fbp-body {
  white-space: pre-wrap; line-height: 1.62; font-size: 16px; color: #1c1e21;
  word-break: break-word; padding-bottom: 4px;
}
/* Bài CHỈ CÓ CHỮ, ngắn → nền màu, chữ to trắng căn giữa như Facebook (chị My 21/08).
   Nền xoay vòng theo độ dài nội dung để các bài không trùng màu nhau. */
.fbp-body.card {
  margin: 10px -18px 0; padding: 40px 26px; min-height: 240px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 24px; line-height: 1.42; font-weight: 700; color: #fff;
  white-space: pre-wrap; word-break: break-word;
  background: linear-gradient(135deg, #7B1E2B 0%, #a83247 100%);
}
.fbp-body.card.c1 { background: linear-gradient(135deg, #1f6f5c 0%, #2fa588 100%); }
.fbp-body.card.c2 { background: linear-gradient(135deg, #1e4d8c 0%, #3a7fd5 100%); }
.fbp-body.card.c3 { background: linear-gradient(135deg, #8a4b12 0%, #d0821f 100%); }
.fbp-body.card.c4 { background: linear-gradient(135deg, #4a2a7a 0%, #8355c7 100%); }
.fbp-body.card a { color: #fff; text-decoration: underline; }
@media (max-width: 640px) {
  .fbp-body.card { margin-left: -14px; margin-right: -14px; padding: 34px 20px; font-size: 20px; min-height: 200px; }
}

/* Ảnh tràn hết chiều ngang, bo góc, không còn nhãn "🖼 Ảnh (1)" */
.fbp-imgs { margin: 12px -18px 0; display: grid; gap: 3px; }
.fbp-imgs.n1 { grid-template-columns: 1fr; }
.fbp-imgs.n2 { grid-template-columns: 1fr 1fr; }
.fbp-imgs.n3, .fbp-imgs.n4 { grid-template-columns: 1fr 1fr; }
.fbp-imgs img { width: 100%; display: block; cursor: zoom-in; background: #f0f2f5; }
.fbp-imgs.n1 img { max-height: 62vh; object-fit: contain; }
.fbp-imgs:not(.n1) img { aspect-ratio: 1; object-fit: cover; }
.fbp-more {
  position: relative; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); color: #fff; font-size: 26px; font-weight: 700; cursor: zoom-in;
}

/* Dải đếm cảm xúc / bình luận — kiểu Facebook */
.fbp-count {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 0 9px; font-size: 13.5px; color: #65676b; border-bottom: 1px solid #e4e6eb;
}
.fbp-count .fbp-emo { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.fbp-count b { font-weight: 600; }

/* Hàng nút Thích · Bình luận */
.fbp-acts { display: flex; padding: 3px 0; border-bottom: 1px solid #e4e6eb; }
.fbp-act {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: none; border: none; cursor: pointer; padding: 9px 4px; border-radius: 8px;
  font-size: 14.5px; font-weight: 600; color: #65676b; font-family: inherit;
  transition: background .13s;
}
.fbp-act:hover { background: #f2f2f2; }
.fbp-act.on { color: var(--maroon, #7B1E2B); }
.fbp-act .ic { font-size: 17px; line-height: 1; }

/* Bình luận: bỏ khung xanh, để liền mạch với bài */
.fbp-cmt { padding-top: 6px; }

@media (max-width: 640px) {
  .fbp-imgs { margin-left: -14px; margin-right: -14px; }
  .fbp-body { font-size: 15.5px; }
  .fbp-body.short { font-size: 18px; }
  .fbp-act { font-size: 13.5px; }
}

/* ===== Bình luận LIỀN MẠCH kiểu Facebook — chỉ trong bài Diễn đàn (.fbp-cmt) =====
   Chị My 21/08: diễn đàn cũ hiển thị rời rạc, nhìn rối. Nay mỗi bình luận là một
   bong bóng xám bo tròn, avatar bên trái, nút Thích/Trả lời nhỏ bên dưới. */
.fbp-cmt .cmt-wrap { margin-top: 0 !important; border-top: none !important; padding-top: 4px !important; }
.fbp-cmt .sec-title { display: none; }                 /* bỏ tiêu đề "💬 Bình luận / trao đổi" */
.fbp-cmt #cmtList { max-height: none !important; overflow: visible !important; margin: 2px 0 0 !important; }
.fbp-cmt .cmt-wrap > .muted-sm:last-child { display: none; }   /* bỏ dòng mẹo dài dưới ô nhập */

/* Mỗi bình luận: avatar + bong bóng */
.fbp-cmt .cmt-item {
  margin-top: 10px !important; position: relative;
  padding-left: 42px;                                   /* chừa chỗ avatar */
  border-left: none !important;
}
.fbp-cmt .cmt-item::before {                            /* avatar chữ cái đầu */
  content: attr(data-ini);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--maroon, #7B1E2B); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: .3px;
}
/* Bong bóng: tên + nội dung gộp chung một khối xám */
.fbp-cmt .cmt-item > div:first-child {
  display: block !important; padding: 7px 12px 0; background: #f0f2f5;
  border-radius: 16px 16px 0 0; margin: 0;
}
.fbp-cmt .cmt-item > div:first-child b { font-size: 13.5px; color: #1c1e21; }
.fbp-cmt .cmt-item > div:first-child .muted-sm { display: none; }   /* giờ chuyển xuống hàng nút */
.fbp-cmt .cmt-body {
  background: #f0f2f5; border-radius: 0 0 16px 16px;
  padding: 1px 12px 8px; font-size: 14.5px; line-height: 1.5; color: #1c1e21;
}
.fbp-cmt .cmt-body .cmt-imgs img { width: 130px !important; height: 130px !important; border-radius: 12px !important; }

/* Hàng nút dưới bong bóng — chữ nhỏ, không viền */
.fbp-cmt .cmt-item > div:nth-child(3) { gap: 12px !important; margin: 3px 0 0 12px !important; }
.fbp-cmt .cmt-reply-btn, .fbp-cmt .cmt-edit-btn {
  font-size: 12.5px !important; font-weight: 600 !important; color: #65676b !important; padding: 0 !important;
}
.fbp-cmt .cmt-reply-btn:hover, .fbp-cmt .cmt-edit-btn:hover { text-decoration: underline; }

/* Trả lời lồng nhau: thụt vào, avatar nhỏ hơn */
.fbp-cmt .cmt-item .cmt-item { padding-left: 38px; margin-left: 8px !important; }
.fbp-cmt .cmt-item .cmt-item::before { width: 28px; height: 28px; font-size: 11.5px; }

/* Ô nhập bình luận: bo tròn như Facebook */
.fbp-cmt #cmtInputRow { margin-top: 12px !important; align-items: center !important; }
.fbp-cmt #cmtIn {
  border-radius: 20px !important; background: #f0f2f5 !important; border-color: transparent !important;
  padding: 9px 14px !important; font-size: 14.5px !important;
}
.fbp-cmt #cmtIn:focus { background: #fff !important; border-color: var(--line) !important; }

@media (max-width: 640px) {
  .fbp-cmt .cmt-item { padding-left: 38px; }
  .fbp-cmt .cmt-item::before { width: 29px; height: 29px; font-size: 12px; }
}

/* ===== BC nhận hàng — bảng danh sách 11 cột (chị My 21/08) =====
   ĐẶT TRONG CLASS (không inline): style="table-layout:fixed" inline bị CSS mobile
   [style*=] ở cuối file ép min-width:0 → cột co lại, badge Kho tràn đè cột NCC. */
.gr-tbl { table-layout: fixed; width: 100%; min-width: 1080px; font-size: 12.5px; }
.gr-tbl th, .gr-tbl td { vertical-align: top; }
.gr-tbl td { word-break: break-word; }

/* Bề rộng từng cột — tổng ~100% */
.gr-tbl col.c-stt   { width: 38px; }
.gr-tbl col.c-ma    { width: 104px; }
.gr-tbl col.c-anh   { width: 62px; }
.gr-tbl col.c-ngay  { width: 104px; }
.gr-tbl col.c-kho   { width: 116px; }
.gr-tbl col.c-ncc   { width: 220px; }
.gr-tbl col.c-tien  { width: 112px; }
.gr-tbl col.c-gc    { width: 96px; }
.gr-tbl col.c-nguoi { width: 116px; }
.gr-tbl col.c-nhap  { width: 132px; }
.gr-tbl col.c-chi   { width: 104px; }

/* Badge tên kho dài ("CH Hoàng Ngân") cho xuống dòng, KHÔNG tràn sang cột bên cạnh */
.gr-tbl td .badge { white-space: normal; line-height: 1.35; display: inline-block; max-width: 100%; }
.gr-tbl .num { white-space: nowrap; }

/* ===== Đầu trang BC nhận hàng — gọn trên cả máy tính lẫn điện thoại (chị My 21/08) =====
   Máy tính: tiêu đề trái · tab phải, cùng hàng.
   Điện thoại: xếp DỌC, tiêu đề không bị bóp thành nhiều dòng, tab kéo ngang. */
.gr-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.gr-head-l { min-width: 0; flex: 1 1 320px; }
.gr-head-l h1 { margin: 0 0 2px; }
.gr-head-l .page-sub { margin: 0; }
.gr-head .tabs { margin: 0; flex: 0 0 auto; }

@media (max-width: 720px) {
  .gr-head { display: block; margin-bottom: 10px; }
  .gr-head-l { margin-bottom: 10px; }
  /* Tiêu đề KHÔNG bị bóp — cho phép tràn nguyên dòng rồi tự xuống */
  .gr-head-l h1 { font-size: 21px; line-height: 1.25; white-space: normal; word-break: normal; }
  .gr-head-l .page-sub { font-size: 12.5px; line-height: 1.5; }
  /* Hàng tab kéo ngang được, không vỡ */
  .gr-head .tabs { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .gr-head .tabs .tab { flex: 0 0 auto; white-space: nowrap; }
}

/* Lưới bộ lọc BC nhận hàng — nút "+ Đăng" nằm cuối hàng trên máy tính,
   xuống dòng riêng (full width) trên điện thoại. Chị My 21/08. */
.gr-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.gr-filters > label { display: block; }
.gr-filters .gr-add-wrap { display: flex; align-items: flex-end; }
.gr-filters .gr-add-wrap .btn { width: 100%; white-space: nowrap; }
.gr-filters .gr-q { grid-column: 1 / -1; }

@media (max-width: 720px) {
  .gr-filters { grid-template-columns: 1fr 1fr; gap: 8px; }
  /* Nút Đăng: xuống dòng riêng, chiếm cả chiều ngang, nằm SAU ô Tìm */
  .gr-filters .gr-add-wrap { grid-column: 1 / -1; order: 9; }
  .gr-filters .gr-q { order: 8; }
  .gr-filters .field-label { font-size: 11.5px; }
}

/* Bảng BC nhận hàng trên điện thoại: giữ cuộn ngang (không vỡ chữ), ẩn vài cột phụ
   để đọc được nội dung chính. Chị My 21/08. */
@media (max-width: 720px) {
  .gr-tbl { min-width: 720px; font-size: 12px; }
  /* Ẩn cột Ghi chú + Người đăng — vẫn xem đủ khi mở phiếu */
  .gr-tbl col.c-gc, .gr-tbl col.c-nguoi { width: 0; }
  .gr-tbl th:nth-child(8), .gr-tbl td:nth-child(8),
  .gr-tbl th:nth-child(9), .gr-tbl td:nth-child(9) { display: none; }
  .gr-tbl col.c-ma { width: 92px; }
  .gr-tbl col.c-ncc { width: 190px; }
}

/* ===== Thư viện: nút "Xem đầy đủ" phải NỔI trên banner maroon (chị My 21/08) =====
   Trước dùng nền trắng mờ 16% → chìm hẳn, chị My đọc "5 tài liệu" mà chỉ thấy 2 dòng,
   tưởng mục chỉ có 2 file. Nay nền TRẮNG ĐẶC + chữ maroon + đổ bóng. */
.lc-xemdu {
  background: #fff;
  color: var(--maroon, #7a1f2b);
  border: 1px solid #fff;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.lc-xemdu:hover { background: #fff6f7; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0, 0, 0, .26); }
.lc-xemdu:active { transform: translateY(0); }

/* Dòng nhắc CUỐI BẢNG — người xem hết 2 dòng đầu vẫn biết còn tài liệu bị ẩn,
   không phải nhớ ngược lên nút trên banner. */
.lc-conan {
  padding: 9px 16px;
  text-align: center;
  background: #fdf6f7;
  border-top: 1px dashed #e3c3c8;
}
.lc-conan .lc-xemdu {
  background: var(--maroon, #7a1f2b);
  color: #fff;
  border-color: var(--maroon, #7a1f2b);
  box-shadow: none;
}
.lc-conan .lc-xemdu:hover { background: #8f2735; }
/* đang mở hết → ẩn dòng nhắc cuối bảng, chỉ giữ nút Thu gọn trên banner */
.lc-conan.lc-mo { display: none; }

/* ===== 📊 Thống kê Biểu mẫu & Quy trình (chị My 21/08) ===== */
.ld-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ld-card {
  background: #fff; border: 1px solid var(--line, #e6e6e6); border-radius: 12px;
  padding: 14px 16px 13px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.ld-ic { font-size: 19px; margin-bottom: 4px; }
.ld-num { font-size: 27px; font-weight: 800; line-height: 1.15; }
.ld-lb { font-size: 13px; color: #555; font-weight: 600; margin-top: 2px; }
.ld-sub { font-size: 12px; color: #888; margin-top: 5px; }

.ld-sec { padding: 14px 16px; margin-bottom: 14px; }
.ld-h { font-weight: 800; font-size: 15px; color: var(--maroon, #7a1f2b); margin-bottom: 11px; }

/* thanh tỉ lệ trong bảng xếp hạng */
.ld-bar { display: inline-block; width: 88px; height: 7px; border-radius: 4px; background: #eef0f2; overflow: hidden; vertical-align: middle; }
.ld-bar span { display: block; height: 100%; border-radius: 4px; }
.ld-bn { margin-left: 8px; font-weight: 700; font-size: 13px; vertical-align: middle; }

.ld-tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: #666; }
.ld-tbl td { font-size: 13.5px; }

/* hàng "nhóm / phòng ban" */
.ld-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f0f2f4; }
.ld-row:last-child { border-bottom: none; }
.ld-rn { width: 190px; font-weight: 600; font-size: 13.5px; flex: 0 0 auto; }
.ld-rv { width: 210px; text-align: right; font-size: 12.5px; color: #666; flex: 0 0 auto; }

/* biểu đồ cột 30 ngày */
.ld-chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 6px; overflow-x: auto; }
.ld-col { flex: 1 0 20px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.ld-col span { width: 70%; min-width: 8px; background: linear-gradient(180deg, #9c3145, #7a1f2b); border-radius: 3px 3px 0 0; }
.ld-col em { font-size: 9.5px; color: #999; font-style: normal; margin-top: 4px; white-space: nowrap; }

/* khối cảnh báo cần chú ý */
.ld-warn {
  background: #fdf2f3; border: 1px solid #f0d5d9; border-left: 4px solid var(--maroon, #7a1f2b);
  border-radius: 10px; padding: 12px 15px; margin-bottom: 14px;
}
.ld-wt { font-weight: 800; font-size: 14px; color: var(--maroon, #7a1f2b); margin-bottom: 8px; }
.ld-wi { font-size: 13.5px; padding: 4px 0; border-bottom: 1px dashed #eadadd; }
.ld-wi:last-child { border-bottom: none; }
.ld-wi a { color: var(--maroon, #7a1f2b); font-weight: 600; }

@media (max-width: 760px) {
  .ld-rn { width: 120px; font-size: 12.5px; }
  .ld-rv { width: 130px; font-size: 11.5px; }
  .ld-num { font-size: 23px; }
}
