/* =====================================================
   TASK MANAGEMENT 2.0 — STYLES.CSS
   Quy ước biến màu / khoảng cách / bo góc dùng chung.
   Toàn bộ tương tác mở/đóng (modal, panel, tab) dùng
   kỹ thuật CSS thuần: input[type=radio/checkbox] ẩn +
   :checked / :has(). Không phụ thuộc JavaScript để chạy.
   ===================================================== */

/* ---------- 1. BIẾN DÙNG CHUNG (DESIGN TOKENS) ---------- */
:root {
  /* Thanh cuộn chung: mảnh, nhạt, hơi trong suốt (chủ dự án chốt 12/11/2026) — đổi 1 chỗ là cả dự án đổi theo */
  --scroll-thumb: rgba(148, 163, 184, 0.32);
  --scroll-thumb-hover: rgba(148, 163, 184, 0.6);
  /* Màu chính: xanh crystal theo yêu cầu */
  --primary: #38bdf8;
  --primary-600: #0ea5e9;
  --primary-50: #eaf7ff;
  --primary-100: #d3edfd;

  /* Màu cảnh báo / xoá: hồng đỏ theo yêu cầu */
  --danger: #fb7185;
  --danger-600: #e11d48;
  --danger-50: #fff1f3;
  --danger-100: #ffe1e6;

  /* Màu hỗ trợ mức ưu tiên & trạng thái */
  --warning: #fbbf24;
  --warning-50: #fffbea;
  --success: #34d399;
  --success-50: #ecfdf5;
  /* Chữ đậm đọc được trên nền nhạt cùng màu (đang dùng rải rác dưới dạng mã cứng) */
  --success-700: #047857;
  --warning-700: #92400e;
  --warning-600: #d97706; /* nền nút cảnh báo: đủ tương phản với chữ trắng */
  --warning-100: #fef3c7;
  --success-600: #059669;
  --success-100: #d1fae5;

  /* Trung tính */
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --border-soft: #edf1f6;
  --bg: #f6f8fb;
  --surface: #ffffff;

  /* Bố cục */
  --sidebar-w: 264px;
  --topbar-h: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Đổ bóng nhẹ, không lạm dụng */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.18);

  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- 2. RESET TỐI THIỂU ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
/* Mọi khung cuộn BÊN TRONG trang: xám, mảnh. Chỉ thanh ngoài cùng của html giữ màu xanh ở trên.
   Cần quy tắc này vì scrollbar-color của html kế thừa xuống mọi phần tử (thành xanh), còn scrollbar-width thì không (thành dày).
   Độ ưu tiên thấp (body *) nên khung nào tự khai báo riêng (ẩn thanh cuộn ngang của hàng tab, màu theo ghi chú dán…) vẫn giữ kiểu riêng. */
body * {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: #f6f8fb63;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
button {
  font-family: inherit;
  cursor: pointer;
}
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
img,
svg {
  display: block;
}

/* Focus hiển thị rõ cho bàn phím, không bỏ hẳn outline */
:focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 2px;
}

/* Tôn trọng người dùng tắt hiệu ứng chuyển động */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Lớp chỉ dành cho trình đọc màn hình (nhãn hỗ trợ truy cập) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. INPUT ĐIỀU KHIỂN TRẠNG THÁI (ẨN) ----------
   Các radio/checkbox này không hiển thị, chỉ dùng làm
   "công tắc" cho CSS. Nhờ :has() ở mức <body>, các input
   này có thể nằm ngay cạnh nút/label kích hoạt chúng
   (không bắt buộc phải nằm ở đầu <body>).
   Lưu ý khả năng truy cập: đây là kỹ thuật CSS thuần tạm
   thời. Khi viết JS thật, nên đổi các <label for="...">
   thành <button> + addEventListener để phím Tab/Enter/Esc
   hoạt động đầy đủ (label không tự nhận focus bàn phím).
------------------------------------------------------------ */
/* position: fixed ở góc trên: bấm <label for=...> sẽ focus vào ô ẩn này; nếu để absolute
   (nằm cuối trang) trình duyệt tự cuộn tới đó -> đóng bảng chi tiết bị nhảy xuống cuối trang */
.state-toggle {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- 4. KHUNG TỔNG THỂ ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- 5. SIDEBAR TRÁI ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 0; /* lề nằm ở từng khối bên trong: thanh cuộn của khối giữa sát mép mà chữ không bị bó */
  gap: 0;
}
/* Hộp bọc 2 nhóm điều hướng (chính + Dự án / Tin nhắn): 2 nhóm cách nhau 40px.
   Chỉ khối này cuộn; logo ở trên và Cài đặt ở dưới đứng yên */
.sidebar-nav-box {
  display: flex;
  flex-direction: column;
  gap: 40px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 14px 16px;
  overflow-x: hidden; /* thu gọn thanh bên: chữ bị che dần, không hiện thanh cuộn ngang */
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 20px 20px 12px;
}
.sidebar-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-text strong {
  display: block;
  font-size: 14px;
}
.sidebar-brand-text span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-group-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    padding: 6px 10px 2px;
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: space-between;
}

/* Mục điều hướng: label bọc input radio ẩn (nav-page) */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover {
  background: var(--bg);
}
.nav-item .nav-icon {
  color: var(--muted);
  flex-shrink: 0;
}
.nav-item .nav-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}
/* Chưa tải xong dữ liệu (hoặc tải lỗi): ô số trống thì ẩn, không hiện số giả */
.nav-item .nav-count:empty {
  display: none;
}
/* Trạng thái đang chọn: dựa vào input:checked nằm trong label */
.nav-item:has(.nav-radio:checked) {
  background: var(--primary-50);
  color: var(--primary-600);
}
.nav-item:has(.nav-radio:checked) .nav-icon {
  color: var(--primary-600);
}
.nav-item:has(.nav-radio:checked) .nav-count {
  background: #fff;
  color: var(--primary-600);
}

/* Mục "Dự án": là 1 trang + mũi tên xổ / thu danh sách dự án (mặc định thu gọn) */
.nav-projects-head {
  position: relative;
}
.nav-projects-item {
  padding-right: 40px; /* chừa chỗ cho mũi tên */
}
.nav-projects-caret {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}
.nav-projects-caret::before {
  content: "";
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5.5px solid currentColor;
  transform: rotate(-90deg);
  transition: transform 0.18s ease;
}
.nav-projects-caret:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}
.sidebar-projects:has(#sidebar-projects-open:checked) .nav-projects-caret[for="sidebar-projects-open"]::before {
  transform: none;
}
.sidebar-projects-open {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.sidebar-projects-body {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding-left: 10px;
}
.sidebar-projects:has(#sidebar-projects-open:checked) .sidebar-projects-body {
  display: flex;
  animation: navTeamIn 0.2s ease-out;
}
/* Đang ở trang Dự án: nền xanh nhạt, chữ xanh đậm (đậm hơn mục thường để thấy rõ đang ở đâu) */
.nav-projects-item:has(.nav-radio:checked) {
  background: var(--primary-50);
  color: #0369a1;
  font-weight: 600;
}
.nav-projects-item:has(.nav-radio:checked) .nav-icon {
  color: #0369a1;
}
/* Đang ở 1 dự án con: mục "Dự án" chỉ đổi màu chữ để biết mình đang trong khu Dự án */
.sidebar-projects:has(#sidebar-projects-list .nav-radio:checked) .nav-projects-item[for="nav-projects"],
.sidebar-projects:has(#sidebar-projects-list .nav-radio:checked) .nav-projects-item[for="nav-projects"] .nav-icon {
  color: var(--primary-600);
}
/* Mục "Thành viên": xổ ra Mọi người / Nhóm / Sơ đồ tổ chức / Vai trò & phân quyền (cùng kiểu với Dự án) */
.nav-members-group:has(#sidebar-members-open:checked) .nav-projects-caret::before,
.nav-reports-group:has(#sidebar-reports-open:checked) .nav-projects-caret::before {
  transform: none;
}
/* Mục "Báo cáo": xổ ra Báo cáo tổng quát / Đội nhóm / Phân bổ công việc (cùng kiểu với Thành viên) */
.sidebar-reports-body {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 18px;
}
.nav-reports-group:has(#sidebar-reports-open:checked) .sidebar-reports-body {
  display: flex;
  animation: navTeamIn 0.2s ease-out;
}
.sidebar-members-body {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 18px;
}
.nav-members-group:has(#sidebar-members-open:checked) .sidebar-members-body {
  display: flex;
  animation: navTeamIn 0.2s ease-out;
}
.nav-sub-item {
  width: 100%;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.nav-sub-item .nav-icon { width: 16px; height: 16px; }
/* Mục con đang mở: chỉ đổi chữ sang xanh, KHÔNG tô nền (nền xanh để dành cho mục cha) -> dễ phân biệt trên / dưới */
.nav-sub-item.is-active {
  background: transparent;
  color: var(--primary-600);
  font-weight: 600;
}
.nav-sub-item.is-active .nav-icon { color: var(--primary-600); }
.nav-sub-item.is-active:hover { background: var(--bg); }
/* Dự án con trong danh sách dự án ở thanh bên: cùng quy tắc với mục con */
#sidebar-projects-list .nav-item:has(.nav-radio:checked) { background: transparent; font-weight: 600; }
#sidebar-projects-list .nav-item:has(.nav-radio:checked):hover { background: var(--bg); }
/* Mục "Tin nhắn": xổ ra những người chat gần đây (cùng kiểu với Thành viên) */
.nav-chat-group:has(#sidebar-chat-open:checked) .nav-projects-caret::before {
  transform: none;
}
.sidebar-chat-body {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 18px;
}
.nav-chat-group:has(#sidebar-chat-open:checked) .sidebar-chat-body {
  display: flex;
  animation: navTeamIn 0.2s ease-out;
}
.chat-sub-item .chat-sub-avatar { width: 20px; height: 20px; flex-shrink: 0; font-size: 9px; }
.chat-sub-item .chat-sub-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub-item.is-unread .chat-sub-name { font-weight: 700; color: var(--ink); }
.chat-sub-empty { padding: 6px 10px; font-size: 12.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .nav-projects-caret::before { transition: none; }
  .sidebar-projects:has(#sidebar-projects-open:checked) .sidebar-projects-body,
  .nav-members-group:has(#sidebar-members-open:checked) .sidebar-members-body,
  .nav-reports-group:has(#sidebar-reports-open:checked) .sidebar-reports-body,
  .nav-chat-group:has(#sidebar-chat-open:checked) .sidebar-chat-body { animation: none; }
}

.project-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Đội dự án dưới mục dự án đang chọn: dây cong → trưởng nhóm (viền vàng) → thành viên */
.nav-project-team {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 10px 8px 11px; /* dây cong bắt đầu thẳng dưới chấm màu dự án */
}
.nav-project:has(.nav-radio:checked) .nav-project-team {
  display: flex;
  animation: navTeamIn 0.2s ease-out;
}
@keyframes navTeamIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.nav-team-curve {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: -3px;
}
.nav-team-curve path,
.nav-team-arrow path {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}
.nav-team-arrow {
  flex-shrink: 0;
}
.nav-team-avatar,
.nav-project-team .avatar.nav-team-avatar {
  width: 26px;
  height: 26px;
  font-size: 10px;
  flex-shrink: 0;
}
.nav-team-manager .avatar.nav-team-avatar {
  border: 2px solid var(--warning);
}
.nav-team-members {
  display: flex;
  align-items: center;
}
.nav-team-members > * + * {
  margin-left: -6px; /* xếp chồng nhẹ cho gọn */
}
.nav-team-more,
.nav-team-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--border-soft);
  color: var(--ink-soft);
  font-weight: 700;
  cursor: default;
}
.nav-team-empty {
  border: 2px dashed var(--warning);
  background: var(--surface);
}
.nav-team-none {
  font-size: 12px;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .nav-project:has(.nav-radio:checked) .nav-project-team { animation: none; }
}

.sidebar-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px dashed var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
}
.sidebar-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary-600);
  background: var(--primary-50);
}

/* Nút thu gọn sidebar trên mobile */
.sidebar-close-btn {
  display: none;
}

/* ---------- 6. VÙNG NỘI DUNG CHÍNH ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}
.topbar-menu-btn {
  display: none;
}
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb strong {
  color: var(--ink);
  font-weight: 600;
}
.topbar-spacer {
  flex: 1;
}
.wide-box .icon-btn {
  width: 25px;
  height: 25px;
}
.detail-panel .icon-btn {
  width: 30px;
  height: 30px;
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  position: relative;
}
.icon-btn:hover {
  background: var(--bg);
}
.icon-btn .badge-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  border: 2px solid var(--surface);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}
/* ---------- Popup "Thông báo" (chuông trên topbar) ----------
   Cùng kỹ thuật checkbox ẩn + :has() với calendar-picker/role-filter. */
.notif-picker {
  position: relative;
}
.notif-picker-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 400px;
  max-width: calc(100vw - 32px);
  max-height: min(640px, calc(100vh - 90px));
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}
.notif-picker:has(.notif-picker-toggle:checked) .notif-picker-panel {
  display: flex;
}
/* Bảng thông báo bản chỉnh (notifications.js renderNotifications): đầu · tab · thanh "Mới nhất" · danh sách cuộn · chân */
.notif-picker-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px; }
.notif-picker-panel-head h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); }
/* Nút đóng: nền đỏ nhạt + X đỏ; rê chuột = nền đỏ đậm + X trắng (thắng quy tắc nút X đỏ chung .icon-btn:has(icon-close)) */
.notif-picker-panel-head .icon-btn.np-close { width: 30px; height: 30px; border-color: transparent; background: var(--danger-50); color: var(--danger-600); box-shadow: none; transition: background-color 0.15s ease, color 0.15s ease; }
.notif-picker-panel-head .icon-btn.np-close:hover { border-color: var(--danger-600); background: var(--danger-600); color: #fff; box-shadow: none; }
.notif-picker-panel-head .icon-btn.np-close:focus-visible { box-shadow: 0 0 0 3px var(--danger-100); }
@media (prefers-reduced-motion: reduce) { .notif-picker-panel-head .icon-btn.np-close { transition: none; } }
/* Đầu / tab / chân giữ nguyên chiều cao, chỉ danh sách co lại và cuộn (không thì hàng tab bị ép mất chữ) */
.notif-picker-panel > * { flex-shrink: 0; }
.np-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border-soft, var(--border)); overflow-x: auto; scrollbar-width: none; }
.np-tab { display: inline-flex; align-items: center; gap: 6px; margin-bottom: -1px; padding: 9px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; cursor: pointer; }
.np-tab:hover { color: var(--ink); }
.np-tab.is-active { border-bottom-color: var(--primary-600); color: var(--primary-600); }
.np-tab:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--primary-100); border-radius: 6px 6px 0 0; }
.np-tab-n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg); font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center; color: var(--ink-soft); }
.np-tab.is-active .np-tab-n { background: var(--primary-600); color: #fff; }
.np-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px 4px; font-size: 13px; font-weight: 700; color: var(--ink); }
.np-readall { border: 0; background: transparent; padding: 0; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--primary-600); cursor: pointer; }
.np-readall:hover { text-decoration: underline; }
.notif-picker-panel > .notif-picker-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 8px 8px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.np-day { padding: 12px 8px 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.np-row { position: relative; margin-bottom: 4px; border-radius: 10px; }
.np-row.is-unread { background: var(--primary-50); }
.np-row.is-unread::before { content: ""; position: absolute; top: 20px; left: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary-600); }
.np-row.is-child { margin: 0 0 2px 46px; }
.np-row.is-child::before { top: 14px; left: -10px; }
.np-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 10px; cursor: pointer; outline: none; }
.np-row.is-child .np-item { padding: 7px 10px; }
.np-item:hover { background: rgba(15, 23, 42, 0.035); }
.np-item:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.np-av, .np-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.np-av .np-avatar { width: 34px; height: 34px; font-size: 13px; }
.np-ic { color: var(--ink-soft); background: var(--bg); }
.np-ic.tone-amber { background: #fef3c7; color: #b45309; }
.np-ic.tone-red { background: #ffe4e6; color: #e11d48; }
.np-ic.tone-blue { background: var(--primary-100); color: var(--primary-600); }
.np-ic.tone-green { background: #d1fae5; color: #059669; }
.np-ic.tone-violet { background: #ede9fe; color: #7c3aed; }
.np-ic.tone-orange { background: #ffedd5; color: #ea580c; }
.np-ic.tone-teal { background: #ccfbf1; color: #0f766e; }
.np-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-right: 52px; }
.np-text { font-size: 13.5px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; }
.np-text b { font-weight: 700; color: var(--ink); }
.np-row:not(.is-unread) .np-text { color: var(--ink-soft); }
.np-row:not(.is-unread) .np-text b { font-weight: 700; color: var(--ink); }
.np-text b.np-code { color: var(--primary-600); letter-spacing: 0.02em; }
.np-text b.np-xu { color: #b45309; }
.np-sub { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-quote { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 12.5px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.np-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.np-chip { padding: 1px 8px; border-radius: 6px; background: var(--bg); font-size: 11.5px; font-weight: 600; color: var(--ink-soft); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-row.is-unread .np-chip:not(.is-warn):not(.is-bad) { background: var(--surface); }
.np-chip.is-warn { background: #fef3c7; color: #b45309; }
.np-chip.is-bad { background: #ffe4e6; color: #e11d48; }
.np-time { margin-left: auto; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.np-more { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; color: var(--primary-600); }
.np-caret { transform: rotate(90deg); transition: transform 0.15s ease; }
.np-caret.is-open { transform: rotate(-90deg); }
/* Rê vào dòng: nút ✓ đã đọc / chưa đọc (luôn hiện khi focus bằng bàn phím) */
.np-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s ease; }
.np-row:hover > .np-tools, .np-tools:focus-within, .np-row:focus-within > .np-tools { opacity: 1; }
.np-tool { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.np-tool:hover { border-color: var(--primary); color: var(--primary-600); }
.np-tool:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary-100); border-color: var(--primary); }
.np-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; text-align: center; }
.np-empty p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.np-empty-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #d1fae5; color: #059669; }
.np-end { margin: 10px 0 4px; font-size: 12px; text-align: center; color: var(--ink-soft); }
.np-sentinel { height: 1px; }
.np-skel { display: flex; gap: 10px; padding: 12px 16px; }
.np-skel span { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.np-skel i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%); background-size: 200% 100%; animation: npSkel 1.2s ease-in-out infinite; }
.np-skel .np-skel-av { flex: none; width: 34px; height: 34px; border-radius: 50%; }
@keyframes npSkel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.np-body .notif-invite-actions { display: flex; }
@media (prefers-reduced-motion: reduce) { .np-tools, .np-caret { transition: none; } .np-skel i { animation: none; } }

@media (max-width: 620px) {
  .notif-picker-panel {
    position: fixed;
    top: var(--topbar-h);
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100dvh - var(--topbar-h) - 16px);
  }
}
.page-content {
  padding: 24px;
  flex: 1;
  scrollbar-gutter: stable;
}
.page-view {
  display: none;
}
/* Hiện đúng "trang" đang chọn: JS (render.js) gán/gỡ class
   .is-active theo dự án hiện tại — không gán cứng id dự án
   1/2/3 như trước, để thêm/xóa dự án không làm gãy điều hướng. */
.page-view.is-active {
  display: block;
}

/* ---------- 7. HEADER DỰ ÁN ---------- */
.project-header {
  margin-bottom: 20px;
}
.project-header-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.project-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.project-title-group h1 {
  font-size: 21px;
  font-weight: 700;
}
.project-title-group p {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin-top: 3px;
  max-width: 62ch;
}
/* Dòng "Trưởng nhóm: ..." dưới mô tả dự án */
.project-manager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.project-manager .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}
.project-manager.is-missing {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--danger-50);
  color: var(--danger-600);
}
.project-header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.project-progress {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}
.progress-track {
  flex: 1;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--border-soft);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), var(--primary-600));
}
.progress-fill.is-checklist {
  background: var(--success);
}
.progress-label {
font-size: 12px;
    color: var(--ink-soft);
    text-transform: capitalize;
    white-space: nowrap;
}

/* ---------- 8. TOOLBAR: TAB KANBAN/LIST + TÌM KIẾM + LỌC ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.view-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 3px;
  box-shadow: inset 0 3px 8px rgba(15, 23, 42, 0.10), inset 0 1px 2px rgba(15, 23, 42, 0.08), inset 0 -1px 0 rgba(255, 255, 255, 0.9);
}
.view-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}
.view-tab:has(.view-radio:checked) {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
/* Hiệu ứng bấm tab Kanban / Danh sách / Lịch / Quy trình: bấm giữ thu nhỏ, thả ra phóng to vượt nhẹ rồi
   về cỡ thật (đường cong lò xo). Dùng transition chứ không dùng animation để renderAll() tự làm mới không làm tab nảy lại. */
.view-tab {
  cursor: pointer;
  transform: scale(1);
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
  will-change: transform;
}
.view-tab:hover { transform: scale(1.05); color: var(--ink); }
.view-tab:has(.view-radio:checked) { transform: scale(1.03); }
.view-tab:active {
  transform: scale(0.9);
  transition-duration: 0.12s, 0.25s, 0.25s, 0.25s; /* lúc nhấn co lại nhanh, thả ra mới nảy chậm */
}
.view-tab:has(.view-radio:focus-visible) { box-shadow: 0 0 0 3px var(--primary-100); }
.view-tab svg { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.view-tab:has(.view-radio:checked) svg { transform: scale(1.12); color: var(--primary-600); }
@media (prefers-reduced-motion: reduce) {
  .view-tab, .view-tab svg { transition: none; }
  .view-tab:hover, .view-tab:active, .view-tab:has(.view-radio:checked), .view-tab:has(.view-radio:checked) svg { transform: none; }
}

/* Chuyển Kanban / List trong từng trang dự án. Dùng hậu tố id
   (-kanban / -list) thay vì gán cứng view1/view2/view3, nhờ vậy
   dự án mới thêm (id bất kỳ) vẫn chuyển tab đúng mà không cần
   sửa CSS. :has() đặt ngay trên .page-view nên chỉ ảnh hưởng
   đúng trang dự án chứa cặp radio đó. */
.page-view:has(input[id$="-list"]:checked) .kanban-board {
  display: none;
}
.page-view:has(input[id$="-kanban"]:checked) .task-list-view {
  display: none;
}

/* Lịch: ẩn theo mặc định, chỉ hiện khi tab "Lịch" đang chọn; khi đó
   ẩn luôn Kanban và Danh sách (dùng chung nhóm radio view-project-*). */
.calendar-view {
  display: none;
}
.page-view:has(input[id$="-calendar"]:checked) .kanban-board,
.page-view:has(input[id$="-calendar"]:checked) .task-list-view {
  display: none;
}
.page-view:has(input[id$="-calendar"]:checked) .calendar-view {
  display: block;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--surface);
  min-width: 220px;
  color: var(--muted);
}
.search-field input {
  border: 0;
  outline: 0;
  flex: 1;
  color: var(--ink);
  background: transparent;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.toolbar-spacer {
  flex: 1;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-600);
  background: var(--primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--primary-600);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}
.btn-secondary:hover {
  background: var(--bg);
}
.btn-danger-ghost {
  color: var(--danger-600);
  border-color: var(--danger-100);
  background: var(--danger-50);
}
.search-clear-btn {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
}
.search-clear-btn:hover {
  background: var(--bg);
  color: var(--ink-soft);
}

/* ---------- 9. KANBAN ---------- */
.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(272px, 1fr);
  gap: 16px;
  overflow: hidden;
  padding-bottom: 8px;
}
.kanban-board {
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge cũ */
}
.kanban-board::-webkit-scrollbar {
  display: none;              /* Chrome, Safari, Edge mới */
}
.kanban-column {
  display: flex;
  flex-direction: column;
  min-width: 272px;
}
.kanban-column-head {
  display: flex;
  align-items: center;
  gap: 9px;
  text-transform: capitalize;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.kanban-column-head h2 {
  font-weight: 700;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-icon-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.kanban-column-head h2 {
    font-size: 13.5px;
    font-family: var(--font-ui);
    font-weight: 500;
}
.column-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  padding: 0 7px;
}
.column-add-btn {
  margin-left: auto;
}
.kanban-column-body {
  background: transparent;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  flex: 1;
}

/* Thẻ công việc — chỉ hiện thông tin cần thiết */
.task-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 13px 13px 12px;
  box-shadow: var(--shadow-sm);
}
.task-card:hover {
  border-color: var(--primary-100);
}
.task-card {
  cursor: pointer;
}
.task-card-due-top {
  margin-bottom: 8px;
}
.task-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.task-card-title {
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-ui);
    text-transform: capitalize;
    color: var(--ink);
    line-height: 1.35;
    flex: 1;
}
.task-card-desc {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Thanh tiến độ checklist (nhãn "Milestone" + vạch xanh, kiểu 2/8, 5/8) */
.task-card-progress {
  margin-top: 11px;
}
.task-card-progress-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-family: var(--font-ui);
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.task-card-progress-label svg {
  color: var(--muted);
  flex-shrink: 0;
}
.task-card-progress-count {
  margin-left: auto;
  color: var(--muted);
  font-weight: 500;
}
.task-card-progress-track {
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--border-soft);
  overflow: hidden;
}
.task-card-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--success);
  transition: width 0.2s ease;
}

/* Kéo-thả công việc giữa các cột Kanban */
.task-card[draggable="true"] {
  cursor: grab;
}
.task-card.is-dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.kanban-column-body {
  transition:
    background 0.12s ease,
    outline-color 0.12s ease;
}
.kanban-column-body.is-drag-over {
  background: var(--primary-50);
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
}
.task-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  flex-wrap: wrap;
}
.priority-pill {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.priority-high {
  background: var(--danger-50);
  color: var(--danger-600);
}
.priority-medium {
  background: var(--warning-50);
  color: #b45309;
}
.priority-low {
  background: var(--primary-50);
  color: var(--primary-600);
}
.due-chip {
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.due-chip.is-overdue {
  color: var(--danger-600);
  font-weight: 600;
}
.checklist-chip {
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.task-card-bottom {
  display: flex;
  align-items: center;
  margin-top: 11px;
}
.task-card-bottom .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
  border-width: 0;
  box-shadow: 0 0 0 2px var(--surface);
}
.task-card-actions {
  margin-left: auto;
  display: flex;
  gap: 2px;
}
.task-card-actions .icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
}
.task-card-actions .icon-btn:hover {
  background: var(--bg);
}
.star-btn.is-favorite {
  color: var(--warning);
  border: 1px solid var(--warning);
}
.unassigned-hint {
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
}
/* ---------- Hiệu ứng mờ-dần-đổ-xuống khi tải trang lần đầu ----------
   Chỉ chạy trong khoảng "cửa sổ" ngắn sau khi trang vừa load (nhờ
   class .is-first-load gắn tạm trên <body> bằng app.js), tránh thẻ
   bị nháy lại animation mỗi khi renderAll() dựng lại HTML. */
@keyframes card-fade-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Thẻ Kanban: delay tính theo cột + vị trí, gán inline từ JS
   (kanbanBoardHTML) để đổ theo cột trái -> phải, trên -> dưới. */
body.is-first-load .task-card {
  animation: card-fade-in 0.3s ease-out both;
}

body.is-first-load .flat-task-row,
body.is-first-load .member-card {
  animation: card-fade-in 0.45s ease-out both;
}

body.is-first-load .task-list-view .flat-task-row:nth-child(1),
body.is-first-load .member-grid .member-card:nth-child(1),
body.is-first-load .today-group .flat-task-row:nth-child(1) { animation-delay: 0.02s; }
body.is-first-load .member-grid .member-card:nth-child(2),
body.is-first-load .today-group .flat-task-row:nth-child(2) { animation-delay: 0.07s; }
body.is-first-load .member-grid .member-card:nth-child(3),
body.is-first-load .today-group .flat-task-row:nth-child(3) { animation-delay: 0.12s; }
body.is-first-load .member-grid .member-card:nth-child(4),
body.is-first-load .today-group .flat-task-row:nth-child(4) { animation-delay: 0.17s; }
body.is-first-load .member-grid .member-card:nth-child(5),
body.is-first-load .today-group .flat-task-row:nth-child(5) { animation-delay: 0.22s; }
body.is-first-load .member-grid .member-card:nth-child(n+6),
body.is-first-load .today-group .flat-task-row:nth-child(n+6) { animation-delay: 0.27s; }

@media (prefers-reduced-motion: reduce) {
  body.is-first-load .task-card,
  body.is-first-load .flat-task-row,
  body.is-first-load .member-card {
    animation: none;
  }
}
/* ---------- 10. DANH SÁCH CÔNG VIỆC (LIST VIEW) ---------- */
.task-list-group {
  margin-bottom: 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.task-list-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-soft);
}
.task-list-group-head .column-count {
  margin-left: 2px;
}
.task-list-group-head .column-add-btn {
  margin-left: auto;
}

/* Mũi tên thu gọn / mở rộng từng nhóm trạng thái (To Do, On Process...).
   Cùng kỹ thuật checkbox ẩn + :has() dùng xuyên suốt file này: checkbox
   nằm ngay trước label header, nên dùng tổ hợp + (kề nhau) để xoay icon,
   và :has() ở .task-list-group để ẩn/hiện phần bảng bên dưới. */
.list-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.list-group-chevron:hover {
  background: rgba(15, 23, 42, 0.06);
}
.list-group-chevron svg {
  transition: transform 0.2s ease;
  transform: rotate(-90deg);
}
.list-group-toggle:checked + .task-list-group-head .list-group-chevron svg {
  transform: rotate(90deg);
}
/* Thu / mở nhóm trạng thái trong dạng Danh sách: co giãn chiều cao mượt 0.2s (lưới 1fr <-> 0fr) thay vì ẩn hẳn.
   Thân bảng chỉ bị cắt (overflow hidden) khi đang đóng / đang co; mở xong mới bỏ cắt (đổi sau 0.2s) để menu sửa tại ô
   và cuộn ngang trên màn hẹp không bị che. Đóng thì ẩn hẳn (visibility) để phím Tab không lọt vào dòng bị giấu */
.task-list-group > .task-table-scroll {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease, border-color 0.2s ease, visibility 0s;
}
.task-list-group > .task-table-scroll > .task-table-v2 {
  min-height: 0;
  overflow: visible;
  transition: overflow 0s linear 0.2s;
  transition-behavior: allow-discrete;
}
.task-list-group:has(.list-group-toggle:checked) > .task-table-scroll {
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease, border-color 0.2s ease, visibility 0s linear 0.2s;
}
.task-list-group:has(.list-group-toggle:checked) > .task-table-scroll > .task-table-v2 { overflow: hidden; transition: none; }
.task-list-view .task-list-group[style*="--gbg"]:has(.list-group-toggle:checked) > .task-table-scroll { margin-top: 0; border-color: transparent; border-width: 0; }
@media (prefers-reduced-motion: reduce) {
  .task-list-group > .task-table-scroll, .task-list-group:has(.list-group-toggle:checked) > .task-table-scroll { transition: none; }
}

/* Cho phép bảng cuộn ngang riêng (không kéo lệch toàn trang) khi nhiều cột
   không vừa màn hình hẹp, thay vì ẩn bớt cột. */
.task-table-scroll {
  /* overflow-x: auto; */
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  min-width: 760px;
}
.task-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.task-table th svg {
  display: inline-block;
  margin-right: 5px;
  vertical-align: -2px;
  color: var(--muted);
}
.task-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
  vertical-align: middle;
}
.task-table tr:last-child td {
  border-bottom: 0;
}
.task-row-name {
  font-weight: 600;
}
.task-row-desc {
  color: var(--ink-soft);
  font-size: 12.5px;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-table .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
  border-width: 0;
}

/* ---------- 11. TRANG HÔM NAY / ĐÃ ĐÁNH DẤU ---------- */
.simple-page-head {
  margin-bottom: 20px;
}
.simple-page-head h1 {
  font-size: 21px;
  font-weight: 700;
}
.simple-page-head p {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin-top: 3px;
}

.today-group {
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 3px 8px rgba(15, 23, 42, 0.10), inset 0 1px 2px rgba(15, 23, 42, 0.08), inset 0 -1px 0 rgba(255, 255, 255, 0.9);
}
.today-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 10px;
}
.today-group-title .status-dot {
  width: 9px;
  height: 9px;
}
.today-group-title.is-overdue {
  color: var(--danger-600);
}

.flat-task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: ease 0.3s;
}
.flat-task-row:hover{
  box-shadow: inset 0 3px 8px rgba(15, 23, 42, 0.10), inset 0 1px 2px rgba(15, 23, 42, 0.08), inset 0 -1px 0 rgba(255, 255, 255, 0.9);
}
.flat-task-row .task-star {
  flex-shrink: 0;
}
.flat-task-main {
  min-width: 0;
  flex: 1;
}
.flat-task-title {
  font-size: 13.5px;
  font-weight: 600;
}
.flat-task-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.project-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  color: #fff;
  flex-shrink: 0;
}
.flat-task-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- 12. TRẠNG THÁI RỖNG / KHÔNG KẾT QUẢ ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 46px 24px;
  color: var(--ink-soft);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.empty-state h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.empty-state p {
  font-size: 13px;
  margin-top: 5px;
  max-width: 34ch;
}
.empty-state .btn-primary,
.empty-state .btn-secondary {
  margin-top: 16px;
}
.empty-state.is-no-results .empty-state-icon {
  background: var(--danger-50);
  color: var(--danger-600);
}

/* ---------- 12b. TRANG THÀNH VIÊN ---------- */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  transition: ease 0.3s;
}
.member-card:hover {
  border-color: var(--primary-100);
}
/* ---------- Hiệu ứng hover nổi bật cho thẻ có thể click ---------- */
.task-card,
.member-card {
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.task-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(56, 189, 248, 0.18);
}

.member-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(56, 189, 248, 0.18);
}

/* Bấm giữ (active) thì hơi lún xuống lại, tạo cảm giác "nhấn được" */
.task-card:active,
.member-card:active {
  transform: translateY(-1px);
  transition-duration: 0.05s;
}

/* Tôn trọng người dùng tắt hiệu ứng chuyển động (đã có khai báo chung
   ở mục 2, nhưng khai báo lại rõ ràng ở đây cho hai thẻ này) */
@media (prefers-reduced-motion: reduce) {
  .task-card,
  .member-card {
    transition: none;
  }
  .task-card:hover,
  .member-card:hover {
    transform: none;
  }
}
.detail-body .avatar-upload-row .avatar-lg {
  transition: opacity 0.15s ease;
}
.detail-body .avatar-upload-row .avatar-lg:hover {
  opacity: 0.85;
}
.member-card-info {
  min-width: 0;
}
.member-card-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--ink-soft);
  margin-top: 5px;
}
.avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------- 13. FORM DÙNG TRONG MODAL ---------- */
.form-field {
  margin-bottom: 16px;
}
.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
.form-control:focus {
  border-color: var(--primary);
}
textarea.form-control {
  resize: vertical;
  min-height: 78px;
}
.form-field.has-error .form-control {
  border-color: var(--danger);
  background: var(--danger-50);
}
.form-error-text {
  display: none;
  font-size: 12px;
  color: var(--danger-600);
  margin-top: 6px;
  align-items: center;
  gap: 5px;
}
.form-field.has-error .form-error-text {
  display: flex;
}

.priority-choice {
  display: flex;
  gap: 8px;
}
.priority-choice label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.priority-choice label:has(input:checked) {
  border-color: currentColor;
}
.priority-choice label.opt-low:has(input:checked) {
  background: var(--primary-50);
  color: var(--primary-600);
}
.priority-choice label.opt-medium:has(input:checked) {
  background: var(--warning-50);
  color: #b45309;
}
.priority-choice label.opt-high:has(input:checked) {
  background: var(--danger-50);
  color: var(--danger-600);
}

.color-choice {
  display: flex;
  gap: 8px;
}
.color-choice label {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  position: relative;
}
.color-choice label:has(input:checked)::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.checklist-editor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.checklist-editor-row input[type="text"] {
  flex: 1;
}

/* ---------- 14. MODAL (mở/đóng bằng checkbox ẩn) ---------- */
.modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
body:has(#modal-add-task-toggle:checked) #modal-add-task,
body:has(#modal-edit-task-toggle:checked) #modal-edit-task,
body:has(#modal-add-project-toggle:checked) #modal-add-project,
body:has(#modal-edit-project-toggle:checked) #modal-edit-project,
body:has(#modal-add-member-toggle:checked) #modal-add-member,
body:has(#modal-project-links-toggle:checked) #modal-project-links,
body:has(#modal-project-members-toggle:checked) #modal-project-members,
body:has(#modal-archived-toggle:checked) #modal-archived,
body:has(#modal-labels-toggle:checked) #modal-labels,
body:has(#modal-team-toggle:checked) #modal-team,
body:has(#modal-role-toggle:checked) #modal-role,
body:has(#modal-csv-toggle:checked) #modal-csv,
body:has(#modal-recurring-toggle:checked) #modal-recurring,
body:has(#modal-meeting-toggle:checked) #modal-meeting,
body:has(#modal-auto-rule-toggle:checked) #modal-auto-rule,
body:has(#modal-auto-logs-toggle:checked) #modal-auto-logs,
body:has(#modal-agent-toggle:checked) #modal-agent,
body:has(#modal-ov-cards-toggle:checked) #modal-ov-cards,
body:has(#modal-ovx-toggle:checked) #modal-ovx,
body:has(#modal-ov-chart-toggle:checked) #modal-ov-chart,
body:has(#modal-ov-digest-toggle:checked) #modal-ov-digest,
body:has(#modal-rsched-toggle:checked) #modal-rsched,
body:has(#modal-tgai-toggle:checked) #modal-tgai,
body:has(#modal-dep-toggle:checked) #modal-dep,
body:has(#modal-pay-toggle:checked) #modal-pay,
body:has(#modal-plan-drawer-toggle:checked) #modal-plan-buy,
body:has(#modal-pay-admin-toggle:checked) #modal-pay-admin,
body:has(#modal-topup-toggle:checked) #modal-topup,
body:has(#modal-ws-delete-toggle:checked) #modal-ws-delete,
body:has(#modal-agent-view-toggle:checked) #modal-agent-view,
body:has(#modal-copy-task-toggle:checked) #modal-copy-task,
body:has(#modal-trash-toggle:checked) #modal-trash,
body:has(#modal-workload-toggle:checked) #modal-workload,
body:has(#modal-template-toggle:checked) #modal-template,
body:has(#modal-ptpl-toggle:checked) #modal-ptpl,
body:has(#modal-leave-toggle:checked) #modal-leave,
body:has(#modal-planner-cover-toggle:checked) #modal-planner-cover,
body:has(#modal-aiw-toggle:checked) #modal-aiw,
body:has(#modal-aid-toggle:checked) #modal-aid,
body:has(#modal-workflow-toggle:checked) #modal-workflow {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.modal-box {
  width: 100%;
  max-width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  transform: scale(0.5);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
body:has(#modal-add-task-toggle:checked) #modal-add-task .modal-box,
body:has(#modal-edit-task-toggle:checked) #modal-edit-task .modal-box,
body:has(#modal-add-project-toggle:checked) #modal-add-project .modal-box,
body:has(#modal-edit-project-toggle:checked) #modal-edit-project .modal-box,
body:has(#modal-add-member-toggle:checked) #modal-add-member .modal-box,
body:has(#modal-project-links-toggle:checked) #modal-project-links .modal-box,
body:has(#modal-project-members-toggle:checked) #modal-project-members .modal-box,
body:has(#modal-archived-toggle:checked) #modal-archived .modal-box,
body:has(#modal-labels-toggle:checked) #modal-labels .modal-box,
body:has(#modal-team-toggle:checked) #modal-team .modal-box,
body:has(#modal-role-toggle:checked) #modal-role .modal-box,
body:has(#modal-csv-toggle:checked) #modal-csv .modal-box,
body:has(#modal-recurring-toggle:checked) #modal-recurring .modal-box,
body:has(#modal-meeting-toggle:checked) #modal-meeting .modal-box,
body:has(#modal-auto-rule-toggle:checked) #modal-auto-rule .modal-box,
body:has(#modal-auto-logs-toggle:checked) #modal-auto-logs .modal-box,
body:has(#modal-agent-toggle:checked) #modal-agent .modal-box,
body:has(#modal-ovx-toggle:checked) #modal-ovx .modal-box,
body:has(#modal-ov-cards-toggle:checked) #modal-ov-cards .modal-box,
body:has(#modal-ov-chart-toggle:checked) #modal-ov-chart .modal-box,
body:has(#modal-ov-digest-toggle:checked) #modal-ov-digest .modal-box,
body:has(#modal-rsched-toggle:checked) #modal-rsched .modal-box,
body:has(#modal-tgai-toggle:checked) #modal-tgai .modal-box,
body:has(#modal-dep-toggle:checked) #modal-dep .modal-box,
body:has(#modal-pay-toggle:checked) #modal-pay .modal-box,
body:has(#modal-plan-drawer-toggle:checked) #modal-plan-buy .modal-box,
body:has(#modal-pay-admin-toggle:checked) #modal-pay-admin .modal-box,
body:has(#modal-topup-toggle:checked) #modal-topup .modal-box,
body:has(#modal-ws-delete-toggle:checked) #modal-ws-delete .modal-box,
body:has(#modal-agent-view-toggle:checked) #modal-agent-view .modal-box,
body:has(#modal-copy-task-toggle:checked) #modal-copy-task .modal-box,
body:has(#modal-trash-toggle:checked) #modal-trash .modal-box,
body:has(#modal-workload-toggle:checked) #modal-workload .modal-box,
body:has(#modal-template-toggle:checked) #modal-template .modal-box,
body:has(#modal-ptpl-toggle:checked) #modal-ptpl .modal-box,
body:has(#modal-leave-toggle:checked) #modal-leave .modal-box,
body:has(#modal-planner-cover-toggle:checked) #modal-planner-cover .modal-box,
body:has(#modal-aiw-toggle:checked) #modal-aiw .modal-box,
body:has(#modal-aid-toggle:checked) #modal-aid .modal-box,
body:has(#modal-workflow-toggle:checked) #modal-workflow .modal-box {
  transform: scale(1);
  opacity: 1;
}
.modal-box {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-head h2 {
  font-size: 16px;
  font-weight: 700;
}
.modal-head .icon-btn {
  margin-left: auto;
  border: 0;
}
.modal-body {
  padding: 15px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-soft);
}

/* ---------- 15. BẢNG CHI TIẾT TRƯỢT BÊN PHẢI ---------- */
.detail-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  justify-content: flex-end;
  z-index: 55;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  /* Panel lúc đóng trượt ra ngoài mép phải: cắt phần thừa, nếu không trình duyệt di động tính nó vào bề ngang trang
     -> trang bị nới rộng, mọi hộp thoại lệch phải sau khi đã mở / đóng chi tiết 1 lần */
  overflow: hidden;
}
body:has(#task-detail-toggle:checked) #task-detail-overlay,
body:has(#member-detail-toggle:checked) #member-detail-overlay {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease, visibility 0s linear 0s;
}
.detail-panel {
  width: 100%;
  max-width: 500px;
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
body:has(#task-detail-toggle:checked) #task-detail-overlay .detail-panel,
body:has(#member-detail-toggle:checked) #member-detail-overlay .detail-panel {
  transform: translateX(0);
}
.detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.detail-head .icon-btn {
}
.detail-head .header-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.detail-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}
.detail-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}
.detail-section {
  margin-top: 20px;
}
.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}
.detail-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Sửa tên / mô tả ngay tại chỗ (inline edit): trông như văn bản thường,
   chỉ hiện viền + nền khi hover hoặc đang focus để gõ. */
.detail-title-input {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  padding: 5px 7px;
  margin: -5px -7px 6px;
  border-radius: var(--radius-sm);
}
.detail-title-input:hover {
  background: var(--bg);
}
.detail-title-input:focus {
  background: var(--surface);
  border-color: var(--primary);
  outline: none;
}

.detail-desc-input {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  padding: 5px 7px;
  margin: -5px -7px;
  border-radius: var(--radius-sm);
  resize: none;
  overflow: hidden;
}
.detail-desc-input:hover {
  background: var(--bg);
}
.detail-desc-input:focus {
  background: var(--surface);
  border-color: var(--primary);
  outline: none;
}

/* Tệp đính kèm trong bảng chi tiết — chỉ hiển thị tên tệp, chưa có lưu trữ thật. */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attachment-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.attachment-icon {
  flex-shrink: 0;
  width: 30px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary-50);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
}
.attachment-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-item .icon-btn {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
}
.attachment-item .icon-btn:hover {
  background: var(--danger-50);
  color: var(--danger-600);
}
.attachment-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin-top: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.attachment-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary-600);
  background: var(--primary-50);
}

.checklist-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.checklist-item:last-child {
  border-bottom: 0;
}
.checklist-item input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.checklist-item span {
  font-size: 13.5px;
}
.checklist-item.is-done span {
  color: var(--muted);
  text-decoration: line-through;
}
/* Tên bước nhỏ sửa tại chỗ: nhìn như chữ thường, chỉ hiện khung khi di chuột/đang sửa */
.checklist-name-input {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 1px 6px;
  margin: -2px 0;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
}
.checklist-name-input:hover {
  border-color: var(--border);
}
.checklist-name-input:focus {
  border-color: var(--primary);
  background: var(--surface);
  outline: none;
}
.checklist-item.is-done .checklist-name-input:not(:focus) {
  color: var(--muted);
  text-decoration: line-through;
}
.checklist-assignee-select {
  flex-shrink: 0;
  max-width: 120px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-soft);
}
.checklist-item .avatar.checklist-avatar {
  width: 22px;
  height: 22px;
  font-size: 9.5px;
}
/* ---------- 15b. LỊCH (CALENDAR VIEW) ----------
   Đầu lịch: "Tháng 10, 2026" ‹ › Hôm nay | Tháng / Tuần · Người. Lưới T2..CN trong 1 khung bo góc, mỗi việc 1 dòng
   có thanh màu trái theo trạng thái (quá hạn = đỏ), tối đa 3 việc / ô rồi "+N nữa" (popover). Điện thoại: danh sách theo ngày.
   Màu lấy theo biến chủ đề; thanh màu đổi bằng --tone.
------------------------------------------------------------ */
.calendar-view { --cal-todo: var(--muted); --cal-doing: var(--primary-600); --cal-review: var(--warning-600); --cal-overdue: var(--danger-600); --cal-done: var(--success-600); }
.calendar-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; margin-bottom: 14px; flex-wrap: wrap; }
.calendar-nav-left, .calendar-nav-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-step { width: 32px; height: 32px; }
.cal-today-btn { padding: 6px 14px; border-radius: var(--radius-sm); }
.calendar-picker { position: relative; }
.calendar-month-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; padding: 5px 8px; border-radius: var(--radius-sm); font-size: 18px; font-weight: 700; color: var(--ink); cursor: pointer; white-space: nowrap; }
.calendar-month-label:hover { background: var(--bg); }
.calendar-picker-panel { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.calendar-picker-panel select { min-width: 108px; padding: 8px 9px; }
.calendar-picker:has(.cal-picker-toggle:checked) .calendar-picker-panel { display: flex; }
/* Tháng / Tuần: nút chuyển dạng viên thuốc */
.cal-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--border); }
.cal-seg button { padding: 4px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cal-seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.cal-seg button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.cal-person { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.cal-person:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.cal-person select { max-width: 150px; height: 30px; padding: 0 4px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }

/* Khung lịch: thứ + lưới + chú thích trong 1 khung bo góc */
.cal-board { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.calendar-weekday { padding: 9px 10px; font-size: 12px; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.02em; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(112px, auto); }
.calendar-grid.is-week { grid-auto-rows: minmax(360px, auto); }
.calendar-cell { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 6px; border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); background: var(--surface); cursor: default; }
.calendar-cell:nth-child(7n) { border-right: 0; }
.calendar-grid > .calendar-cell:nth-last-child(-n + 7) { border-bottom: 0; }
.calendar-cell[title] { cursor: copy; }
.calendar-cell:hover { background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.calendar-cell.is-outside { background: var(--bg); }
.calendar-cell.is-outside .calendar-cell-daynum { color: var(--muted); }
.calendar-cell.is-drop { background: var(--primary-50); box-shadow: inset 0 0 0 2px var(--primary); }
.calendar-cell.has-pop { z-index: 6; }
.calendar-cell-top { display: flex; align-items: center; gap: 4px; }
.calendar-cell-daynum { min-width: 26px; height: 26px; padding: 0 4px; box-sizing: border-box; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.calendar-grid.is-week .calendar-cell-daynum { font-size: 13px; }
/* Hôm nay: số trong vòng tròn màu chủ đạo */
.calendar-cell.is-today .calendar-cell-daynum { background: var(--primary-600); color: #fff; font-weight: 700; }
.calendar-cell-tasks { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
/* 1 việc = 1 dòng, thanh màu trái theo trạng thái */
.calendar-task-line { --tone: var(--cal-todo); display: flex; align-items: center; gap: 4px; min-width: 0; padding: 3px 7px 3px 8px; border-radius: 6px; border-left: 3px solid var(--tone); background: color-mix(in srgb, var(--tone) 12%, var(--surface)); cursor: pointer; }
.calendar-task-line:hover { background: color-mix(in srgb, var(--tone) 20%, var(--surface)); }
.calendar-task-line:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.calendar-task-line[draggable="true"] { cursor: grab; }
.calendar-task-line.is-dragging { opacity: 0.45; }
.calendar-task-line.is-doing { --tone: var(--cal-doing); }
.calendar-task-line.is-review { --tone: var(--cal-review); }
.calendar-task-line.is-overdue { --tone: var(--cal-overdue); }
.calendar-task-line.is-done { --tone: var(--cal-done); }
.calendar-task-line-label { min-width: 0; font-size: 12px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Việc xong: chữ mờ + ✓, không gạch ngang */
.calendar-task-line.is-done .calendar-task-line-label { color: var(--muted); font-weight: 500; }
.calendar-task-check { flex: none; font-size: 11px; font-weight: 700; color: var(--cal-done); }
.calendar-more-btn { align-self: flex-start; padding: 1px 6px; border: 0; border-radius: 4px; background: transparent; color: var(--primary-600); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.calendar-more-btn:hover, .calendar-more-btn[aria-expanded="true"] { background: var(--primary-50); }
/* Popover "+N nữa" */
.cal-pop { position: absolute; top: 4px; left: -4px; z-index: 20; width: max(100% + 8px, 230px); max-height: 300px; display: flex; flex-direction: column; padding: 8px; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-lg); cursor: default; }
.calendar-cell:nth-child(7n) .cal-pop, .calendar-cell:nth-child(7n - 1) .cal-pop { left: auto; right: -4px; }
.cal-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.cal-pop-x { width: 24px; height: 24px; border: 0; border-radius: 6px; background: var(--bg); color: var(--ink-soft); cursor: pointer; }
.cal-pop-x:hover { background: var(--border); color: var(--ink); }
.cal-pop-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
/* Chú thích màu ở chân lịch */
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-soft); }
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend-item i { width: 9px; height: 9px; border-radius: 50%; background: var(--tone); }
.cal-legend-item.is-todo { --tone: var(--cal-todo); }
.cal-legend-item.is-doing { --tone: var(--cal-doing); }
.cal-legend-item.is-review { --tone: var(--cal-review); }
.cal-legend-item.is-overdue { --tone: var(--cal-overdue); }
.cal-legend-item.is-done { --tone: var(--cal-done); }
.cal-legend-note { margin-left: auto; color: var(--muted); }
/* Danh sách theo ngày (chỉ hiện trên điện thoại) */
.cal-mlist { display: none; }
.cal-mday { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 5px; }
.cal-mday-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); }
.cal-mday-num { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--bg); font-size: 13.5px; font-weight: 700; color: var(--ink); }
.cal-mday.is-today .cal-mday-num { background: var(--primary-600); color: #fff; }
.cal-mday .calendar-task-line { padding: 7px 10px; }
.cal-mday .calendar-task-line-label { font-size: 13.5px; }
.cal-mlist-empty { margin: 0; padding: 24px 14px; text-align: center; font-size: 13.5px; color: var(--muted); }
@media (max-width: 760px) {
  .calendar-weekdays, .calendar-grid { display: none; }
  .cal-mlist { display: block; }
  .cal-legend-note { display: none; }
  .calendar-nav-right { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .calendar-task-line { transition: none; }
}

.calendar-unscheduled { margin-top: 18px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); overflow: hidden; }
.calendar-unscheduled-head { padding: 12px 14px; background: var(--surface); font-size: 13.5px; font-weight: 700; cursor: pointer; list-style: none; }
.calendar-unscheduled-head::-webkit-details-marker { display: none; }
.calendar-unscheduled-body { padding: 10px 14px 14px; background: var(--bg); }
@media (max-width: 620px) {
  .page-content {
    padding: 16px;
  }
  
  .project-header-top {
    flex-wrap: wrap;
  }
  .project-header-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .toolbar {
    gap: 8px;
  }
  .view-tabs {
    order: 1;
  }
  .search-field {
    order: 3;
    min-width: 0;
    flex: 1 1 100%;
  }
  .filter-btn {
    order: 4;
  }
  .toolbar-spacer {
    order: 5;
    flex-basis: 0;
  }
  .btn-primary {
    order: 2;
    margin-left: auto;
  }
  .modal-box {
    max-height: 92vh;
  }
}
/* ---------- Popup "Lọc theo vai trò" (trang Thành viên) ----------
   Cùng kỹ thuật checkbox ẩn + :has() với assignee-picker/calendar-picker
   để dropdown tự vẽ bằng CSS, bo góc/viền/font đồng bộ toàn bộ app. */
.role-filter {
  position: relative;
  display: inline-block;
}
.role-filter .filter-btn {
  position: relative;
}
.role-filter .filter-btn.is-active {
  border-color: var(--primary);
  color: var(--primary-600);
  background: var(--primary-50);
}
.role-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.role-filter-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 10px;
}
.role-filter:has(.role-filter-toggle:checked) .role-filter-panel {
  display: block;
}
.role-filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.role-filter-clear-btn {
  border: 0;
  background: transparent;
  color: var(--primary-600);
  font-size: 11.5px;
  font-weight: 700;
  padding: 0;
}
.role-filter-clear-btn:hover {
  text-decoration: underline;
}
.role-filter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.role-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 6px 4px;
  border-radius: 6px;
}
.role-filter-item:hover {
  background: var(--bg);
}
.role-filter-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.role-filter-item span:first-of-type {
  flex: 1;
}
.role-filter-item-count {
  font-size: 11.5px;
  color: var(--muted);
}
/* ---------- 15c. GIAO DIỆN CHI TIẾT KIỂU MỚI (theo ảnh mẫu) ---------- */
.btn-edit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.btn-edit-pill:hover { background: var(--bg); }

.detail-title-input { font-size: 19px !important; }
.info-row-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
  display: inline-flex;
}

.section-title-v2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 20px 0 8px;
}

.milestone-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.milestone-head h3 { font-size: 14px; font-weight: 700; flex: 1; }
.milestone-count { font-size: 12.5px; font-weight: 700; color: var(--muted); }

.checklist-item {
  background: var(--bg);
  border-radius: var(--radius-md);
  border-bottom: 0;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.checklist-item input[type="checkbox"] { width: 18px; height: 18px; border-radius: 5px; }
.checklist-item.is-done { background: transparent; }

.attachment-item { border-radius: var(--radius-md); padding: 10px; }
.attachment-icon { width: 34px; height: 34px; border-radius: 8px; font-size: 10px; }
/* ---------- KHUNG POPUP "CHỌN NGƯỜI PHỤ TRÁCH" (cùng kỹ thuật
   checkbox ẩn + :has() với calendar-picker/role-filter) ---------- */
.assignee-picker {
  position: relative;
  display: inline-block;
}
.assignee-picker-avatars {
  display: flex;
  align-items: center;
}
.assignee-add-btn {
  cursor: pointer;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--muted);
}
/* Avatar đầu đứng yên, từ avatar thứ 2 lùi -8px đè lên avatar trước.
   Loại trừ nút "+" ra khỏi hiệu ứng đè, để nó tách riêng +5px. */
.assignee-picker-avatars .avatar:not(:first-child):not(.assignee-add-btn) {
  margin-left: -8px;
}
.assignee-picker-avatars .assignee-add-btn {
  margin-left: 5px;
}
.assignee-picker .assignee-picker-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: 272px;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 9%;
}
.assignee-picker:has(.assignee-picker-toggle:checked) .assignee-picker-panel {
  display: block;
}
.assignee-picker .assignee-picker-panel .assignee-picker-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.assignee-picker .assignee-picker-panel .assignee-picker-panel-head span {
  flex: 1;
  white-space: nowrap;
}
.assignee-picker .assignee-picker-panel .assignee-picker-panel-head .icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  flex-shrink: 0;
  margin-left: auto;
}
.assignee-check-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.assignee-check-item {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: auto;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.assignee-check-item:hover {
  background: var(--bg);
}
.assignee-check-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}
.assignee-check-item .avatar {
  flex-shrink: 0;
}
.assignee-check-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.column-add-btn {
  background: transparent !important;
  width: 26px !important;
  height: 26px !important;
  transition: all 0.2s;
}
.column-add-btn:not(:hover) {
  color: var(--ink-soft) !important;
}
.column-add-btn:hover {
  background: rgba(255, 255, 255, 0.734) !important;
}
/* ---------- 9b. HIỆU ỨNG "POP IN" CHO THẺ VỪA TẠO / VỪA CHUYỂN CỘT ---------- */
@keyframes card-pop-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.task-card.is-pop-in {
  animation: card-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .task-card.is-pop-in {
    animation: none;
  }
}
/* ---------- 10b. HIỆU ỨNG "ĐỔ VÀO" CHO TỪNG DÒNG TRONG LIST VIEW ---------- */
body.is-first-load .task-table tbody tr {
  animation: row-fade-in 0.3s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  body.is-first-load .task-table tbody tr {
    animation: none;
  }
}
/* ---------- 10d. LIST VIEW: DÙNG DIV/GRID THAY <table>/<tr>
   để animation không đụng vào thuật toán layout bảng nữa ---------- */
/* .task-table-scroll {
  overflow-x: hidden;
} */
.task-table-v2 {
  width: 100%;
}
.task-table-row-v2 {
  display: grid;
  grid-template-columns:
    minmax(0, 1.6fr) minmax(0, 1.8fr) minmax(0, 0.9fr)
    minmax(0, 0.85fr) minmax(0, 0.95fr) minmax(0, 0.8fr)
    minmax(0, 0.7fr);
  align-items: center;
  gap: 6px;
}
.task-table-head-v2 {
  border-bottom: 1px solid var(--border-soft);
      background-color: #c9c9c92b;
}
.task-table-head-v2 .task-cell {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 7px 8px 7px 0px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-table-head-v2 .task-cell svg {
  display: inline-block;
  margin-right: 4px;
  vertical-align: -2px;
  color: var(--muted);
  flex-shrink: 0;
}
.task-table-body-row-v2 {
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}
.task-table-body-row-v2:last-child {
  border-bottom: 0;
}
.task-table-body-row-v2 .task-cell {
  padding: 11px 10px;
  font-size: 12.5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-table-row-v2 .task-cell {
  min-width: 0;
}
.task-table-body-row-v2 .task-cell:nth-child(1),
.task-table-body-row-v2 .task-cell:nth-child(2) {
  white-space: normal;
}
.task-row-name {
  white-space: normal;
}
.task-row-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: none;
}
.task-table-empty-row-v2 {
  text-align: center;
  color: var(--muted);
  padding: 20px 0;
  font-size: 13px;
}
.task-table-v2 .avatar {
  width: 24px;
  height: 24px;
  font-size: 10.5px;
  border-width: 0;
}
.task-table-v2 .icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  flex-shrink: 0;
}
.task-table-v2 .icon-btn:hover {
  background: var(--bg);
}
.task-table-v2 .due-chip,
.task-table-v2 .priority-pill {
  font-size: 11px;
  white-space: nowrap;
}

body.is-first-load .task-table-body-row-v2 {
  animation: row-fade-in 0.3s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  body.is-first-load .task-table-body-row-v2 {
    animation: none;
  }
}
/* ---------- 10e. Hiệu ứng "đổ vào" cho từng dòng List View (khôi phục) ---------- */
body.is-first-load .task-table-body-row-v2 {
  animation: row-fade-in 0.3s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  body.is-first-load .task-table-body-row-v2 {
    animation: none;
  }
}
/* ---------- 10f. HIỆU ỨNG "ĐẨY LÊN + LÀM RÕ DẦN" KHI MỞ RỘNG NHÓM DANH SÁCH ---------- */
@keyframes row-reveal-push-up {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}
.task-table-body-row-v2.is-revealing {
  animation: row-reveal-push-up 0.3s ease-out both;
}
/* Xổ / thu task con (projects.js pl-toggle-task): dòng con hiện dần 0.2s; thu thì mờ + co chiều cao 0.2s rồi mới gỡ */
@keyframes row-sub-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes row-sub-out { from { opacity: 1; max-height: 80px; } to { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; } }
.task-table-body-row-v2.is-sub-in, .pl-row.is-sub-in { animation: row-sub-in 0.2s ease-out both; }
.task-table-body-row-v2.is-sub-out, .pl-row.is-sub-out { animation: row-sub-out 0.2s ease-in both; overflow: hidden; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .task-table-body-row-v2.is-sub-in, .pl-row.is-sub-in, .task-table-body-row-v2.is-sub-out, .pl-row.is-sub-out { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .task-table-body-row-v2.is-revealing {
    animation: none;
  }
}
.assignee-check-item{
  width: auto !important;
  display: flex !important;
}
/* Nút xóa từng bước nhỏ trong checklist (chỉ Quản trị viên / Trưởng nhóm thấy) */
.checklist-delete-btn {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--danger-600);
  border-radius: 6px;
  background: var(--danger-50);
  color: var(--danger-600);
  opacity: 0.8;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.checklist-item:hover .checklist-delete-btn,
.checklist-delete-btn:focus-visible {
  opacity: 1;
}
.checklist-delete-btn:hover {
  background: var(--danger-600);
  color: var(--danger-50);
  opacity: 1;
}
@media (hover: none) {
  .checklist-delete-btn { opacity: 1; } /* điện thoại không có hover nên luôn hiện rõ */
}
/* ---------- CHECK LOG ---------- */
/* Bảng dùng khung .ml-* (cột kéo được độ rộng, xem assignee.js ML_COLS.logs) */
.log-row .log-msg-cell {
  color: var(--ink-soft);
}
.log-time {
  color: var(--ink-soft);
  font-weight: 600;
}
.log-member {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}
.log-member span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Tên dự án đứng trước nội dung log khi xem "Tất cả dự án" */
.log-project-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--border-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 1px;
}
.logs-project-select {
  width: auto;
  max-width: 240px;
}
.logs-filter .role-filter-panel {
  width: 260px;
  max-height: 340px;
  overflow-y: auto;
}
.role-filter-item input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
a.attachment-name { color: inherit; }
a.attachment-name:hover { color: var(--primary-600); text-decoration: underline; }
/* ---------- Bình luận + @mention ---------- */
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; min-height: 40px; }
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-main { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.comment-meta strong { font-size: 13px; color: var(--ink-soft); }
/* Nút ⋮ (dấu 3 chấm dọc) ngoài cùng bên phải bình luận + menu Sửa / Xóa */
.comment-menu { position: relative; margin-left: auto; flex-shrink: 0; }
.comment-menu-btn { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); }
.comment-menu-btn svg { transform: rotate(90deg); }
.comment-menu-btn:hover, .comment-menu-btn.is-open { background: var(--bg); color: var(--ink); }
.comment-menu-panel {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 25; min-width: 140px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.comment-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 0; border-radius: 6px;
  background: transparent; font: inherit; font-size: 13.5px; color: var(--ink-soft); text-align: left; cursor: pointer;
}
.comment-menu-item:hover, .comment-menu-item:focus-visible { background: var(--primary-50); color: var(--ink); outline: none; }
.comment-menu-item.is-danger { color: var(--danger-600); }
.comment-menu-item.is-danger:hover, .comment-menu-item.is-danger:focus-visible { background: var(--danger-50); color: var(--danger-600); }
.comment-text { margin-top: 2px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); word-break: break-word; }
.comment-empty { font-size: 12.5px; color: var(--muted); }
.comment-composer { position: relative; display: flex; flex-direction: column; gap: 8px; }
.comment-composer textarea { resize: vertical; min-height: 60px; }
.comment-send-btn { align-self: flex-end; }
.mention { color: var(--primary-600); font-weight: 600; background: var(--primary-50); border-radius: 4px; padding: 0 3px; }
.mention-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% - 4px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 6px 20px rgba(15, 23, 42, .12);
  z-index: 20; overflow: hidden;
}
.mention-option {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; background: transparent; cursor: pointer; text-align: left;
}
.mention-option:hover { background: var(--primary-50); }
.member-card-email {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ===== Bấm giờ & Tự động hóa ===== */
.topbar-timer { display: flex; align-items: center; gap: 6px; }
.topbar-timer[hidden] { display: none; }
.timer-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; padding: 6px 12px; border: 1px solid var(--danger-100); border-radius: var(--radius-pill); background: var(--danger-50); color: var(--danger-600); font: 600 13px var(--font-ui); cursor: pointer; }
.timer-task { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink-soft); }
.timer-clock { font-variant-numeric: tabular-nums; }
.timer-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: timer-blink 1.2s infinite; }
@keyframes timer-blink { 50% { opacity: .25; } }
.timer-stop-mini { padding: 6px 10px; }
.time-bar { height: 8px; margin: 6px 0; border-radius: var(--radius-pill); background: var(--border-soft); overflow: hidden; }
.time-bar span { display: block; height: 100%; background: var(--primary); }
.time-bar.is-over span { background: var(--danger); }
.time-summary { margin: 0 0 10px; font-size: 13px; color: var(--ink-soft); }
.time-over { color: var(--danger-600); font-weight: 600; }
.time-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.timer-btn { display: inline-flex; align-items: center; gap: 8px; }
.timer-btn.is-running { background: var(--danger); border-color: var(--danger); }
.timer-btn.is-running .timer-dot { background: #fff; }
.time-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.time-form #time-form-note { grid-column: 1 / -1; }
.time-entry { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border-soft); font-size: 13px; }
.time-entry-min { min-width: 48px; font-weight: 600; }
.time-entry-meta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.time-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--primary-50); color: var(--primary-600); font-size: 11.5px; font-weight: 600; }
.time-badge.is-over { background: var(--danger-50); color: var(--danger-600); }

.auto-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.auto-form .form-control { flex: 1 1 180px; width: auto; }
.auto-rule-list { display: flex; flex-direction: column; gap: 8px; }
.auto-rule { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.auto-rule.is-off { opacity: .55; }
.auto-rule-main { flex: 1; min-width: 0; }
.auto-rule-text { font-size: 14px; font-weight: 600; }
.auto-rule-scope { margin-top: 2px; font-size: 12px; color: var(--muted); }
.auto-switch { position: relative; flex: none; width: 36px; height: 20px; }
.auto-switch input { width: 0; height: 0; opacity: 0; }
.auto-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); cursor: pointer; transition: .2s; }
.auto-switch span::before { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.auto-switch input:checked + span { background: var(--success); }
.auto-switch input:checked + span::before { transform: translateX(16px); }
@media (max-width: 640px) { .timer-task { display: none; } .time-form { grid-template-columns: 1fr; } }

/* ---------- BÁO CÁO (reports.js) ---------- */
.report-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.report-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  }
.report-tile-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  justify-content: center;
}
.report-tile-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.report-tile-hint {
  font-size: 12px;
  color: var(--muted);
}
.report-tile.is-alert {
  border-color: var(--danger-100);
  background: var(--danger-50);
}
.report-tile.is-alert .report-tile-label {
  color: var(--danger-600);
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.report-card {
  padding: 13px 13px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;}
.modal-box.ovch-box .ovtr-body{
  display: block;
}
.report-card h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}
/* ===== Báo cáo tổng quát — theme pastel (reports.js rep*, 10/2026) ===== */
.rep-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rep-title h1 { margin: 0 0 4px; font-size: 24px; font-weight: 800; }
.rep-title p { margin: 0; font-size: 13.5px; color: var(--ink-soft); max-width: 560px; }
.rep-top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Lên lịch gửi báo cáo (#modal-rsched, reports.js rs*) */
.rs-box { width: 640px; max-width: calc(100vw - 24px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; padding: 0; border-radius: 22px; overflow: hidden; }
.rs-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 10px; }
.rs-head > div { flex: 1; }
.rs-head h2 { margin: 0; font-size: 18px; }
.rs-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.rs-head-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: #2563eb; font-size: 17px; }
#rsched-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.rs-tabs { margin: 0 20px 8px; align-self: flex-start; }
.rs-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 16px; }
.rs-form { display: flex; flex-direction: column; gap: 8px; }
.rs-label { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
.rs-when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rs-days { display: flex; gap: 6px; flex-wrap: wrap; }
.rs-day { min-width: 38px; height: 32px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.rs-day.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.rs-time-wrap { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.rs-time-wrap .form-control, .rs-inline .form-control { width: auto; height: 34px; }
.rs-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.rs-tz { font-size: 12px; color: var(--muted); }
.rs-recipients { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; }
.rs-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 4px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); font-size: 12.5px; font-weight: 600; }
.rs-chip .avatar, .rs-chip .team-avatar { width: 20px; height: 20px; font-size: 9px; }
.rs-chip button { border: 0; background: none; font-size: 15px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.rs-chip button:hover { color: var(--danger-600); }
.rs-add { border: 1px dashed var(--border); border-radius: var(--radius-pill); background: var(--surface); color: #2563eb; font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 8px; cursor: pointer; max-width: 190px; }
.rs-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; cursor: pointer; }
.rs-switch-row b { display: block; font-size: 13px; font-weight: 600; }
.rs-switch-row small { display: block; font-size: 12px; color: var(--muted); }
.rs-panel { padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.rs-note { margin: 0; font-size: 12px; color: var(--muted); }
.rs-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rs-card { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.rs-card b { font-size: 13.5px; }
.rs-card small { font-size: 12px; color: var(--muted); }
.rs-card.is-on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.rs-scope { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-pill { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--bg); font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.rs-pill.is-period { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: #2563eb; }
.rs-preview { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--bg); }
.rs-preview b { font-size: 13px; }
.rs-preview small { font-size: 12px; color: var(--ink-soft); }
.rs-preview-btn { align-self: flex-start; margin-top: 4px; padding: 3px 10px; border-radius: 8px; background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: #2563eb; font-size: 12px; font-weight: 700; }
.rs-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--border-soft); background: var(--surface); }
.rs-foot small { margin-right: auto; font-size: 12px; color: var(--muted); }
.rs-list { display: flex; flex-direction: column; }
.rs-item { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--border-soft); }
.rs-item-main { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.rs-item-main b { font-size: 14px; }
.rs-item-main small { font-size: 12px; color: var(--muted); }
.rs-item-main .rs-err { color: var(--danger-600); }
.rs-status { padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.rs-status.is-ok { background: var(--success-50); color: var(--success-700); }
.rs-status.is-next { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: #2563eb; }
.rs-status.is-paused { background: var(--bg); color: var(--ink-soft); }
.rs-status.is-error { background: var(--danger-50); color: var(--danger-600); }
.rs-more { position: relative; }
.rs-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 170px; padding: 6px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.rs-menu button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.rs-menu button:hover { background: var(--bg); }
.rs-menu button.is-danger { color: var(--danger-600); }
.rs-hist { width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.rs-hist-row { display: flex; gap: 10px; font-size: 12.5px; }
.rs-hist-row b { flex: none; }
.rs-hist-row.is-error { color: var(--danger-600); }
@media (max-width: 560px) {
  .rs-cards { grid-template-columns: 1fr; }
  .rs-time-wrap { margin-left: 0; }
}
/* Xuất báo cáo: nút chính + bảng xổ (theo mẫu: ô icon pastel, tên đậm, mô tả 1 dòng, Bao gồm, dòng bộ lọc) */
.rep-export { position: relative; }
.rep-export-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 320px; max-width: calc(100vw - 32px); padding: 12px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); }
.rep-export-title { margin: 2px 4px 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.rep-export-item { width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 9px 10px; border: 0; border-radius: 12px; background: none; font: inherit; text-align: left; cursor: pointer; }
.rep-export-item:hover:not(:disabled), .rep-export-item:focus-visible { background: var(--bg); outline: none; }
.rep-export-item:disabled { opacity: 0.6; cursor: wait; }
.rep-export-item b { display: block; font-size: 14px; color: var(--ink); }
.rep-export-item small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.rep-export-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-size: 16px; }
.rep-export-item.is-pdf .rep-export-ico { background: var(--danger-50); }
.rep-export-item.is-xlsx .rep-export-ico { background: var(--success-50); }
.rep-export-item.is-csv .rep-export-ico { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.rep-export-item.is-link .rep-export-ico { background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); }
.rep-export-pop .rep-export-title:not(:first-child) { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.rep-export-inc { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 4px; font-size: 13px; }
.rep-export-inc label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.rep-export-inc input { accent-color: var(--primary-600); }
.rep-export-filter { margin: 10px 4px 0; font-size: 12px; color: var(--muted); }
.rep-views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rep-view { display: inline-flex; align-items: center; border-radius: var(--radius-pill); background: var(--bg); border: 1px solid var(--border); overflow: hidden; }
.rep-view button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding: 4px 4px 4px 12px; cursor: pointer; }
.rep-view .rep-view-x { padding: 4px 10px 4px 4px; color: var(--muted); }
.rep-view .rep-view-x:hover { color: var(--danger-600); }
.rep-view.is-on { background: var(--primary-50); border-color: var(--primary); }
.rep-view.is-on button { color: var(--primary-600); }
.rep-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.rep-pill { height: 34px; max-width: 260px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.rep-pill.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.rep-pill-btn { color: var(--primary-600); border-style: dashed; }
.rep-view-form { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rep-view-form .form-control { height: 34px; width: 180px; }
.rep-compare { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.rep-switch { appearance: none; width: 34px; height: 20px; border-radius: var(--radius-pill); background: var(--border); position: relative; cursor: pointer; transition: background 0.2s; }
.rep-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left 0.2s; }
.rep-switch:checked { background: var(--primary); }
.rep-switch:checked::after { left: 16px; }
/* KPI */
.rep-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.rep-kpi { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 104px; padding: 14px 16px; border: 0; border-radius: 16px; font: inherit; text-align: left; cursor: pointer; overflow: hidden; }
.rep-kpi:hover, .rep-kpi:focus-visible { box-shadow: inset 0 0 0 1.5px currentColor; outline: none; }
.rep-kpi.is-blue { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: #2563eb; }
.rep-kpi.is-red { background: var(--danger-50); color: var(--danger-600); }
.rep-kpi.is-orange { background: var(--warning-50); color: var(--warning-600); }
.rep-kpi.is-green { background: var(--success-50); color: var(--success-700); }
.rep-kpi-label { font-size: 13px; font-weight: 700; }
.rep-kpi-row { display: flex; align-items: center; gap: 8px; }
.rep-kpi-value { font-size: 32px; font-weight: 800; line-height: 1.1; }
.rep-kpi-hint { font-size: 12px; opacity: 0.85; }
.rep-spark { position: absolute; right: 12px; bottom: 16px; width: 90px; height: 30px; opacity: 0.8; }
.rep-delta { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; background: var(--surface); }
.rep-delta.is-bad { color: var(--danger-600); }
.rep-delta.is-good { color: var(--success-700); }
/* Điểm cần chú ý */
.rep-insight { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, #8b5cf6 18%, var(--surface));
  background: linear-gradient(100deg, color-mix(in srgb, #8b5cf6 10%, var(--surface)), color-mix(in srgb, var(--primary) 10%, var(--surface))); }
.rep-insight-icon { font-size: 22px; }
.rep-insight-text { flex: 1; min-width: 240px; }
.rep-insight-text > b { color: #7c3aed; font-size: 14px; }
.rep-insight-text p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink); line-height: 1.55; }
.rep-insight-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Card chung */
.rep-card { border: 1px solid var(--border-soft); border-radius: 16px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04); }
.rep-card h2 { margin: 0; display: flex; align-items: center; gap: 4px; }
.rep-sub { margin: 2px 0 12px; font-size: 12.5px; color: var(--muted); }
.rep-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rep-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--bg); }
.rep-seg-btn { border: 0; border-radius: 9px; padding: 5px 12px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.rep-seg-btn.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.rep-zero { color: var(--muted); }
/* Theo dự án */
.rep-ptable td { vertical-align: middle; }
.rep-prow { cursor: pointer; }
.rep-prow:hover td { background: var(--bg); }
.rep-health { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.rep-health.is-ok { background: var(--success-50); color: var(--success-700); }
.rep-health.is-risk { background: var(--warning-50); color: var(--warning-600); }
.rep-health.is-late { background: var(--danger-50); color: var(--danger-600); }
.rep-health.is-none, .rep-health.is-empty { background: var(--bg); color: var(--ink-soft); }
.rep-pbar { display: inline-flex; align-items: center; gap: 10px; min-width: 180px; }
.rep-pbar-track { position: relative; flex: 1; height: 8px; border-radius: var(--radius-pill); background: var(--bg); }
.rep-pbar-track i { display: block; height: 100%; border-radius: inherit; min-width: 4px; }
.rep-pbar-track i.is-ok { background: var(--success); }
.rep-pbar-track i.is-risk { background: var(--warning); }
.rep-pbar-track i.is-late { background: var(--danger); }
.rep-pbar-track i.is-none { background: var(--primary); }
.rep-np { min-width: 28px; padding: 2px 9px; border: 0; border-radius: var(--radius-pill); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.rep-np.is-blue { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: #2563eb; }
.rep-np.is-red { background: var(--danger-50); color: var(--danger-600); }
.rep-np.is-violet { background: color-mix(in srgb, #8b5cf6 14%, var(--surface)); color: #7c3aed; }
/* Thanh ngang theo người */
.rep-pbars { display: flex; flex-direction: column; gap: 4px; }
.rep-pbar-row { display: grid; grid-template-columns: auto minmax(80px, 140px) minmax(0, 1fr) 28px; align-items: center; gap: 10px; padding: 5px 6px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; }
.rep-pbar-row:hover { background: var(--bg); }
.rep-pbar-row b { text-align: right; }
.rep-pbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-av-none { background: var(--muted); color: #fff; }
.rep-hbar { height: 10px; border-radius: var(--radius-pill); background: var(--bg); overflow: hidden; }
.rep-hbar i { display: block; height: 100%; border-radius: inherit; }
.rep-hbar i.is-red { background: linear-gradient(90deg, #fb7185, #e11d48); }
.rep-hbar i.is-orange { background: linear-gradient(90deg, #fdba74, #f97316); }
.rep-hbar i.is-yellow { background: linear-gradient(90deg, #fde68a, #f59e0b); }
.rep-hbar i.is-gray { background: #cbd5e1; }
.rep-hbar i.is-cool { background: linear-gradient(90deg, #6ee7b7, #38bdf8); }
/* Tuổi việc quá hạn */
.rep-age { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; height: 190px; align-items: end; }
.rep-age-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px; border: 0; background: none; font: inherit; cursor: pointer; padding: 0; }
.rep-age-col b { text-align: center; font-size: 15px; }
.rep-age-col small { text-align: center; font-size: 12px; color: var(--muted); }
.rep-age-bar { display: block; max-height: calc(100% - 44px); border-radius: 10px; }
.rep-age-col.is-a0 .rep-age-bar { background: #fde68a; }
.rep-age-col.is-a1 .rep-age-bar { background: #fdba74; }
.rep-age-col.is-a2 .rep-age-bar { background: #fb7185; }
.rep-age-col.is-a3 .rep-age-bar { background: #e11d48; }
.rep-age-col:hover .rep-age-bar { filter: brightness(0.95); }
/* Theo trạng thái */
.rep-stack { display: flex; height: 14px; border-radius: var(--radius-pill); overflow: hidden; gap: 2px; margin-bottom: 14px; }
.rep-stack button { border: 0; padding: 0; cursor: pointer; min-width: 4px; }
.rep-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.rep-legend-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 0; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: color-mix(in srgb, var(--c) 75%, #0f172a); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.rep-legend-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
/* Hoàn thành theo tuần */
.rep-weeks { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; height: 190px; align-items: end; }
.rep-week { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.rep-week b { text-align: center; font-size: 13px; }
.rep-week small { text-align: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rep-week-bar { display: block; border-radius: 10px 10px 6px 6px; background: linear-gradient(180deg, #60a5fa, #38bdf8); }
.rep-week-bar.is-zero { height: 3px !important; border-radius: 2px; background: var(--border); }
.rep-week:hover .rep-week-bar:not(.is-zero) { filter: brightness(0.95); }
.rep-avg-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed color-mix(in srgb, #8b5cf6 55%, transparent); pointer-events: none; }
/* Cần xử lý */
.rep-att-groupby { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.rep-att-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 4px 0 12px; border-radius: 14px; background: var(--bg); }
.rep-att-tab { border: 0; border-radius: 10px; padding: 6px 12px; background: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.rep-att-tab.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.rep-att-tab.is-empty:not(.is-on) { opacity: 0.6; }
.rep-att-badge { display: inline-block; min-width: 22px; margin-left: 4px; padding: 0 7px; border-radius: var(--radius-pill); font-size: 12px; background: var(--surface); }
.rep-att-badge.is-overdue { color: var(--danger-600); }
.rep-att-badge.is-blocked { color: var(--ink-soft); }
.rep-att-badge.is-reviewLong { color: #7c3aed; }
.rep-att-badge.is-unassigned { color: var(--warning-600); }
.rep-att-tab.is-on .rep-att-badge.is-overdue { background: var(--danger-600); color: #fff; }
.rep-att-group { border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.rep-att-ghead { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.rep-att-group.is-overdue .rep-att-ghead { background: var(--danger-50); color: var(--danger-600); }
.rep-att-group.is-blocked .rep-att-ghead { background: color-mix(in srgb, #eab308 12%, var(--surface)); color: #a16207; }
.rep-att-group.is-reviewLong .rep-att-ghead { background: color-mix(in srgb, #8b5cf6 10%, var(--surface)); color: #7c3aed; }
.rep-att-group.is-unassigned .rep-att-ghead { background: color-mix(in srgb, #3b82f6 10%, var(--surface)); color: #1d4ed8; }
.rep-att-ghead .avatar { width: 22px; height: 22px; font-size: 10px; }
/* Mũi tên thu / mở nhóm: ô tròn nhỏ nền trắng mờ, chevron xoay phải (đóng) → xuống (mở) */
.rep-caret { flex: none; width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 7px; background: color-mix(in srgb, var(--surface) 70%, transparent); transition: transform 0.18s ease, background 0.15s; }
.rep-caret svg { display: block; }
.rep-caret.is-open { transform: rotate(90deg); }
.rep-att-ghead:hover .rep-caret { background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .rep-caret { transition: none; } }
.rep-att-gcount { padding: 0 8px; border-radius: var(--radius-pill); background: var(--surface); font-size: 12px; font-weight: 700; }
.rep-att-list { display: flex; flex-direction: column; }
/* Lớp DÙNG CHUNG thu lên / mở xuống mượt cho khối cao tùy ý: <div class="tm-collapse [is-closed]"><div>nội dung</div></div>.
   Hàng lưới co 1fr ↔ 0fr (không cần biết chiều cao thật như max-height); bật / tắt lớp is-closed trên phần tử đang hiện
   (không vẽ lại) thì hiệu ứng mới chạy. Thêm inert khi đóng để không Tab vào nội dung ẩn. */
.tm-collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.28s ease; }
.tm-collapse > * { min-height: 0; overflow: hidden; transition: opacity 0.22s ease; }
.tm-collapse.is-closed { grid-template-rows: 0fr; }
.tm-collapse.is-closed > * { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .tm-collapse, .tm-collapse > * { transition: none; } }
.rep-att-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border-soft); cursor: pointer; }
.rep-att-list > .rep-att-row:first-child { border-top: 0; }
.rep-att-row:hover { background: var(--bg); }
.rep-sel { flex: none; width: 18px; display: inline-flex; }
.rep-sel input { width: 17px; height: 17px; cursor: pointer; }
.rep-att-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rep-att-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-att-main small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-att-main small .project-dot { margin-right: 4px; }
.rep-att-end { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* Nút nhắc chỉ hiện khi rê / focus dòng: mở rộng + hiện dần 0.2s (display không chuyển động được); lề âm bù khoảng gap khi ẩn */
.rep-att-hover { display: inline-flex; gap: 4px; max-width: 0; margin-right: -8px; overflow: hidden; opacity: 0; visibility: hidden; transition: max-width .2s ease, margin-right .2s ease, opacity .2s ease, visibility .2s; }
.rep-att-row:hover .rep-att-hover, .rep-att-row:focus-within .rep-att-hover { max-width: 260px; margin-right: 0; opacity: 1; visibility: visible; }
.rep-att-hover .rep-mini { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .rep-att-hover { transition: none; } }
.rep-mini { border: 1px solid var(--border); border-radius: 8px; padding: 3px 9px; background: var(--surface); font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.rep-mini:hover { border-color: var(--primary); color: var(--primary-600); }
.rep-mini.is-add { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-color: transparent; color: #2563eb; }
.rep-due-pill { padding: 2px 10px; border-radius: var(--radius-pill); background: var(--danger-50); color: var(--danger-600); font-size: 12px; font-weight: 700; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.rep-due-pill.is-orange { background: var(--warning-50); color: var(--warning-700); }
.rep-due-pill.is-yellow { background: color-mix(in srgb, #eab308 14%, var(--surface)); color: #a16207; }
.rep-more { margin: 4px 0 0; text-align: center; }
@media (max-width: 1100px) { .rep-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .rep-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .rep-kpi-value { font-size: 26px; }
  .rep-spark { display: none; }
  .rep-compare { margin-left: 0; }
  .rep-att-row { flex-wrap: wrap; }
  .rep-att-end { width: 100%; justify-content: flex-start; padding-left: 30px; }
  .rep-pbar-row { grid-template-columns: auto minmax(60px, 100px) minmax(0, 1fr) 24px; }
}
/* Thanh ngang: nhãn chữ | thanh | số (màu thanh không bao giờ là kênh nhận diện duy nhất) */
.report-bar-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}
.report-bar-label {
  color: var(--ink-soft);
  font-weight: 600;
}
.report-bar-track {
  display: block;
  flex: 1;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--border-soft);
  overflow: hidden;
}
.report-bar-fill {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
}
.report-bar-value {
  text-align: right;
  font-weight: 700;
  color: var(--ink);
}
.report-bar-value small {
  font-weight: 500;
  color: var(--muted);
}
/* Biểu đồ cột theo tuần: 1 chuỗi, cột mảnh, bo 4px ở đầu, mọc từ 1 đường đáy */
.report-week-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 170px;
  padding-top: 18px;
  border-bottom: 1px solid var(--border);
}
.report-week-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  cursor: default;
}
.report-week-bar {
  width: 100%;
  max-width: 24px;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--primary);
}
.report-week-col:hover .report-week-bar {
  background: var(--primary-600);
}
.report-week-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.report-week-label {
  position: absolute;
  bottom: -22px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.report-card .report-week-chart {
  margin-bottom: 26px;
}
.report-table-scroll {
      scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
  overflow-x: auto; /* màn hẹp: bảng cuộn ngang thay vì cắt mất cột */
  overflow-y: auto;
  height: 300px;
}
.report-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}
.report-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.report-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink);
}
.report-table tr:last-child td {
  border-bottom: 0;
}
.report-load {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}
.report-overdue-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--danger-50);
  color: var(--danger-600);
  font-weight: 700;
}
/* Báo cáo tổng quát: Hiệu suất tiến độ dự án + Kế hoạch và thực tế (reports.js reportPlan*) */
.rp-card { --rp-plan: #2563eb; --rp-real: var(--danger-600); display: flex; flex-direction: column; }
.rp-card h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-hint { margin: -4px 0 8px; }
.rp-table { min-width: 560px; }
.rp-table td { padding: 8px 8px; white-space: nowrap; }
.rp-table .report-proj { white-space: normal; }
.rp-alert { flex-shrink: 0; color: var(--danger-600); }
.rp-cell { display: flex; align-items: center; gap: 6px; min-width: 110px; font-size: 12.5px; }
.rp-bar { flex: 1; height: 9px; border-radius: 3px; background: var(--border-soft); overflow: hidden; }
.rp-bar-fill { display: block; height: 100%; border-radius: 3px; }
.rp-bar-fill.is-plan, .rp-legend i.is-plan, .rp-col.is-plan { background: var(--rp-plan); }
.rp-bar-fill.is-real, .rp-legend i.is-real, .rp-col.is-real { background: var(--rp-real); }
.rp-diff { font-size: 12.5px; }
.rp-diff.is-late { color: var(--danger-600); }
.rp-diff.is-ahead { color: var(--success-700); }
.rp-diff.is-ok, .rp-diff.is-none { color: var(--muted); }
.rp-state { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); }
.rp-state.is-late { background: var(--danger-50); color: var(--danger-600); }
.rp-state.is-ok { background: var(--primary-50); color: var(--primary-600); }
.rp-state.is-ahead { background: var(--success-50); color: var(--success-700); }
.rp-legend { margin-left: auto; display: inline-flex; gap: 14px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.rp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rp-legend i { width: 12px; height: 12px; border-radius: 3px; }
/* Biểu đồ tự giãn theo chiều cao thẻ (thẻ cao bằng thẻ bảng bên cạnh trong .report-grid); trục chừa đúng 18px số trên cột + 24px tên dự án */
.rp-chart { display: flex; gap: 8px; flex: 1 1 auto; min-height: 240px; margin-top: 4px; }
.rp-axis { position: relative; flex: 0 0 34px; margin: 18px 0 24px; font-size: 11px; color: var(--muted); text-align: right; }
.rp-axis span { position: absolute; right: 0; transform: translateY(-50%); }
.rp-axis span:nth-child(1) { top: 0; }
.rp-axis span:nth-child(2) { top: 20%; }
.rp-axis span:nth-child(3) { top: 40%; }
.rp-axis span:nth-child(4) { top: 60%; }
.rp-axis span:nth-child(5) { top: 80%; }
.rp-axis span:nth-child(6) { top: 100%; }
.rp-plot { flex: 1; min-width: 0; display: flex; padding-top: 18px; }
.rp-groups { flex: 1; min-width: 0; display: flex; }
.rp-group { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.rp-cols { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(to bottom, var(--border-soft) 0 1px, transparent 1px 20%); }
.rp-col { position: relative; width: min(22px, 38%); min-height: 2px; border-radius: 3px 3px 0 0; }
.rp-col-val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 2px; font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.rp-group-label { max-width: 100%; height: 24px; line-height: 24px; padding: 0 4px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-note { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.rp-note.is-late { background: var(--danger-50); color: var(--danger-600); }
.rp-note.is-ok { background: var(--success-50); color: var(--success-700); }
.rp-note svg { flex-shrink: 0; }

@media (max-width: 900px) {
  .report-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .report-bar-row { grid-template-columns: 84px minmax(0, 1fr) 64px; }
  .report-week-label { font-size: 10px; }
}

/* ---------- LỌC THEO NGƯỜI PHỤ TRÁCH (trang dự án) ---------- */
.assignee-filter-panel {
  width: 250px;
  max-height: 340px;
  overflow-y: auto;
}
/* Avatar + tên nằm sát trái; khối này chiếm phần giữa, số đếm dạt về bên phải */
.role-filter-item .filter-person {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding-left: 5px;
}
/* Gỡ flex:1 của rule dùng chung ".role-filter-item span:first-of-type" (nguyên nhân avatar bị kéo dài) */
.role-filter-item .filter-person span,
.role-filter-item .role-filter-item-count {
  flex: none;
}
.role-filter-item .filter-person > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-filter-item .avatar.filter-avatar {
  width: 22px;
  height: 22px;
  font-size: 9.5px;
  border-width: 0;
}
.assignee-filter-none {
  color: var(--ink-soft);
  font-style: italic;
}

/* ---------- AVATAR NGƯỜI PHỤ TRÁCH XẾP CHỒNG + SỐ TỆP/BÌNH LUẬN TRÊN THẺ ---------- */
.avatar-group {
  display: inline-flex;
  align-items: center;
}
/* Người đầu tiên giữ nguyên, những người sau lùi 5px để xếp chồng gọn lại */
.avatar-group > .avatar + .avatar {
  margin-left: -5px;
}
.avatar.avatar-more {
  background: var(--border-soft);
  color: var(--ink-soft);
  font-weight: 700;
  cursor: default;
}
.card-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.task-card-actions {
  align-items: center;
}
/* ---------- LỊCH SỬ THAY ĐỔI TRONG BẢNG CHI TIẾT TASK ---------- */
.history-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--border-soft);
}
.history-item {
  position: relative;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.history-item::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--surface);
}
.history-who {
  font-weight: 700;
  color: var(--ink);
}
.history-when {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- TÀI LIỆU & LIÊN KẾT CỦA DỰ ÁN ---------- */
/* Hàng thẻ tag dưới thanh tiến độ của trang dự án */
.plink-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.plink-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 260px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}
.plink-chip svg {
  flex-shrink: 0;
  color: var(--primary-600);
}
.plink-chip:hover {
  border-color: var(--primary);
  background: var(--primary-50);
}
.plink-chip-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.plink-chip-sub {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}
.plink-chip-more {
  font-weight: 700;
  color: var(--ink-soft);
}
.plink-chips-hide {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
}
.plink-chips-hide:hover {
  color: var(--ink-soft);
  text-decoration: underline;
}

/* Popup Tài liệu */
#modal-project-links .modal-box {
  max-width: 540px;
}
#project-links-modal-body {
  overflow-y: auto;
}
.plink-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.plink-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}
.plink-item:last-child {
  border-bottom: 0;
}
.plink-icon {
  display: inline-flex;
  color: var(--primary-600);
  flex-shrink: 0;
}
.plink-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.plink-title:hover {
  color: var(--primary-600);
  text-decoration: underline;
}
.plink-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.plink-delete {
  margin-left: auto;
  flex-shrink: 0;
}
.plink-form {
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
/* Khung thả tệp: viền đứt nét, bo góc nhẹ; sáng lên khi kéo tệp vào */
.plink-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  padding: 18px 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 13.5px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.plink-dropzone svg {
  color: var(--primary-600);
}
.plink-dropzone small {
  font-size: 11.5px;
  color: var(--muted);
}
.plink-dropzone:hover,
.plink-dropzone.is-drag-over {
  border-color: var(--primary);
  background: var(--primary-50);
}
.plink-dropzone.is-busy {
  opacity: 0.6;
  pointer-events: none;
}
.plink-show-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}
.plink-show-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
@media (max-width: 620px) {
  .plink-sub, .plink-chip-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .plink-dropzone { transition: none; }
}

/* ---------- THÀNH VIÊN DỰ ÁN (hàng avatar + Mời) ---------- */
.pm-avatars {
  cursor: pointer;
  margin-right: 4px;
}
.pm-avatars .avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
}
#modal-project-members .modal-box,
#modal-archived .modal-box {
  max-width: 540px;
}
#project-members-modal-body,
#archived-modal-body {
  overflow-y: auto;
}
.pm-list,
.archived-list {
  list-style: none;
  margin: 12px 0 16px;
  padding: 0;
}
.pm-item,
.archived-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}
.pm-item:last-child,
.archived-item:last-child {
  border-bottom: 0;
}
.pm-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.pm-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--border-soft);
  color: var(--ink-soft);
  white-space: nowrap;
}
.pm-badge.is-manager {
  background: var(--warning-50);
  color: var(--ink);
  border: 1px solid var(--warning);
}
.pm-invite {
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
.pm-invite-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.pm-invite-row .form-field {
  flex: 1 1 160px;
  margin-bottom: 0;
}

/* ---------- VIỆC ĐÃ LƯU TRỮ + VIỆC LẶP LẠI ---------- */
.archived-link {
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.archived-link::before {
  content: "· ";
}
.archived-link:hover {
  color: var(--primary-600);
  text-decoration: underline;
}
.archived-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archived-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.repeat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: 11.5px;
  font-weight: 600;
}

/* ---------- Ô CHỌN KIỂU THẺ (shared.js: enhanceSelect) ---------- */
/* <select> gốc vẫn còn (giữ giá trị + sự kiện) nhưng ẩn hẳn, không chiếm chỗ */
.cselect-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.cselect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.cselect-btn.form-control {
  display: flex;
}
.cselect-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.cselect-btn.is-placeholder .cselect-value {
  color: var(--muted);
}
.cselect-caret {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.cselect-btn.is-open {
  border-color: var(--primary);
}
.cselect-btn.is-open .cselect-caret {
  transform: rotate(180deg);
}
.cselect-btn:disabled {
  cursor: default;
  opacity: 0.65;
}
.cselect-btn:disabled .cselect-caret {
  display: none;
}
.calendar-picker-panel .cselect-btn {
  min-width: 108px;
  padding: 8px 9px;
}

/* Danh sách popup: cùng kiểu bảng lọc (bo góc, bóng nhẹ, dòng hover nền xám) */
.cselect-menu {
  position: fixed;
  z-index: 300;
  max-width: min(340px, calc(100vw - 16px));
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
}
.cselect-menu li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cselect-menu li.is-active {
  background: var(--bg);
}
.cselect-menu li.is-selected {
  color: var(--primary-600);
  font-weight: 700;
}
.cselect-menu li.is-selected::after {
  content: "✓";
  margin-left: auto;
  padding-left: 12px;
}
.cselect-menu li.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}
@media (prefers-reduced-motion: reduce) {
  .cselect-caret { transition: none; }
}
/* ---------- THẺ KANBAN THEO MẪU THIẾT KẾ ---------- */
/* Ô hạn trên cùng: nền xám mờ bo tròn, chữ đậm hơn một chút */
.task-card-due-top .due-chip {
  padding: 4px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  background: #f2f2f2;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}
.task-card-due-top .due-chip.is-overdue {
  border-color: var(--danger-100);
  background: var(--danger-50);
  color: var(--danger-600);
}
.task-card-meta:empty {
  display: none;
}
/* "Phụ trách" bên trái, avatar bên phải */
.task-card-assignee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
.task-card-assignee-label {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: capitalize;
}
.task-card-assignee .avatar {
  width: 26px;
  height: 26px;
  font-size: 11px;
  border-width: 0;
  box-shadow: 0 0 0 2px var(--surface);
}
/* Hàng dưới cùng: ngăn bằng gạch mảnh; độ ưu tiên bên trái, các nút bên phải */
.task-card .task-card-bottom {
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}
.task-card-actions .card-count {
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--ink-soft);
}
/* Ô hạn bên trái, ngôi sao đánh dấu (riêng từng người) sát mép phải cùng hàng */
.task-card .task-card-due-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.task-card-due-top .star-btn {
  width: 28px;
  height: 28px;
  margin: -4px -4px -4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
}
.task-card-due-top .star-btn:hover {
  background: var(--bg);
  color: var(--warning);
}
.task-card-due-top .star-btn.is-favorite {
  color: var(--warning);
}

/* ---------- TAB QUY TRÌNH (workflow.js) ---------- */
.workflow-view {
  display: none;
}
.page-view:has(input[id$="-workflow"]:checked) .kanban-board,
.page-view:has(input[id$="-workflow"]:checked) .task-list-view,
.page-view:has(input[id$="-workflow"]:checked) .calendar-view,
.page-view:has(input[id$="-workflow"]:checked) .empty-state.is-no-results {
  display: none;
}
.page-view:has(input[id$="-workflow"]:checked) .workflow-view {
  display: block;
}
/* Quy trình theo theme pastel: thẻ bo 16px, pill bo tròn, bóng nhẹ, ít viền */
.wf-row {
  margin-bottom: 20px;
  padding: 16px 18px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
.wf-row-head {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.wf-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.wf-pill,
.wf-progress {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--ink-soft);
  white-space: nowrap;
}
.wf-pill.is-auto {
  background: color-mix(in srgb, #8b5cf6 12%, var(--surface));
  color: #6d28d9;
  cursor: help;
}
.wf-progress.is-some,
.wf-row.is-finished .wf-progress {
  background: var(--success-50);
  color: var(--success-700);
}
.wf-row-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
/* Nút công cụ vuông bo 11px ở đầu thẻ quy trình */
.wf-tool {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.wf-tool:hover,
.wf-tool:focus-visible {
  background: var(--primary-50);
  border-color: var(--primary-100);
  color: var(--primary-600);
}
.wf-tool.is-danger {
  color: var(--danger-600);
}
.wf-tool.is-danger:hover,
.wf-tool.is-danger:focus-visible {
  background: var(--danger-50);
  border-color: var(--danger-100);
  color: var(--danger-600);
}
.wf-link-btn {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 2px;
  text-align: center;
}
.wf-link-btn:hover {
  color: var(--danger-600);
  text-decoration: underline;
}
/* Thẻ bước */
.wf-card {
  display: flex;
  flex-direction: column;
  padding: 14px 15px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.wf-card[data-id] {
  cursor: pointer;
}
.wf-card[data-id]:hover {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}
/* Đã duyệt: viền xanh lá nhạt, nền chuyển nhẹ sang xanh */
.wf-card.is-done {
  border-color: color-mix(in srgb, var(--success) 45%, var(--surface));
  background: linear-gradient(180deg, var(--surface) 0%, #f3fbf6 100%);
}
/* Đang mở: viền cam + bóng cam nhẹ để nổi lên */
.wf-card.is-current {
  border-color: #fbd38d;
  box-shadow: 0 0 0 4px color-mix(in srgb, #fbd38d 28%, transparent), 0 8px 22px rgba(251, 146, 60, 0.14);
}
/* Chưa tới lượt: nền trắng viền xám, hơi nhạt */
.wf-card.is-locked {
  opacity: 0.82;
}
.wf-card.is-locked:hover {
  opacity: 1;
}
.wf-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.wf-step-no {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.wf-badge.is-done {
  background: var(--success-50);
  color: var(--success-700);
}
.wf-badge.is-current {
  background: var(--primary-50);
  color: var(--primary-600);
}
.wf-badge.is-review {
  background: #fff4e5;
  color: #c05621;
}
.wf-badge.is-locked {
  background: var(--bg);
  color: var(--ink-soft);
}
/* Tên việc tối đa 2 dòng, dài hơn thì cắt "…" (rê chuột xem đủ) */
.wf-card-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.wf-due {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-soft);
}
.wf-due.is-late {
  color: var(--danger-600);
  font-weight: 700;
}
.wf-due.is-none {
  color: var(--muted);
}
/* Thanh milestone chia đoạn */
.wf-ms {
  margin-top: 10px;
}
.wf-ms-bar {
  display: flex;
  gap: 4px;
}
.wf-ms-bar i {
  flex: 1;
  height: 5px;
  border-radius: var(--radius-pill);
  background: var(--border-soft);
}
.wf-ms-bar i.is-on {
  background: var(--success);
}
.wf-ms-label {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.wf-ms-label b {
  color: var(--ink);
}
.wf-card .task-card-assignee {
  margin-top: 8px;
}
.wf-archived {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.wf-card-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.wf-card-actions .btn-primary {
  justify-content: center;
  border-radius: 11px;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--primary-600) 30%, transparent);
}
/* Dòng hướng dẫn: chỉ hiện tới khi bấm ẩn */
.wf-edit-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.wf-hint-x {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.wf-hint-x:hover {
  background: var(--bg);
  color: var(--ink);
}
/* Bảng vẽ: nền xám xanh có lưới chấm, cuộn cả 2 chiều, kéo mép dưới để cao thêm */
.wf-board {
  position: relative;
  overflow: auto;
  min-height: 260px;
  margin-top: 8px;
  border-radius: 16px;
  background-color: #f6f7fc;
  background-image: radial-gradient(circle, #d9deec 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  overscroll-behavior: contain;
}
.wf-canvas {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}
.wf-links {
  position: absolute;
  inset: 0 auto auto 0;
  overflow: visible;
  pointer-events: none;
}
.wf-node {
  position: absolute;
  width: 260px;
  user-select: none;
}
.wf-board.is-editable .wf-node {
  cursor: grab;
  touch-action: none; /* cảm ứng: kéo thẻ thay vì cuộn bảng */
}
/* Ảnh đại diện trong thẻ không bị trình duyệt kéo đi riêng (làm hỏng thao tác kéo thẻ) */
.wf-node img {
  -webkit-user-drag: none;
  pointer-events: none;
}
.wf-node.is-dragging {
  cursor: grabbing;
  z-index: 5;
  opacity: 1;
  transform: scale(1.02);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.2);
  transition: none;
}
.wf-node.is-link-target {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.wf-node:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
/* Chấm tròn bên phải thẻ: kéo ra để nối mũi tên */
.wf-port {
  position: absolute;
  right: -8px;
  top: 23px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--success);
  cursor: crosshair;
  touch-action: none;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.wf-card.is-current .wf-port {
  border-color: #f6ad55;
}
.wf-card.is-locked .wf-port {
  border-color: var(--muted);
}
.wf-port:hover {
  background: var(--primary);
  border-color: var(--primary-600);
  transform: scale(1.35);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 25%, transparent);
}
.wf-link-line {
  fill: none;
  stroke: #b8c0d4;
  stroke-width: 2;
  stroke-dasharray: 6 5;
  stroke-linecap: round;
}
.wf-link.is-done .wf-link-line {
  stroke: var(--success);
  stroke-width: 2.5;
  stroke-dasharray: none;
}
.wf-arrow-head {
  fill: #b8c0d4;
}
.wf-arrow-head.is-done {
  fill: var(--success);
}
/* Đường trong suốt dày dưới mũi tên cho dễ bấm (chỉ Trưởng nhóm/QTV mới bấm được) */
.wf-link-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
}
.wf-link[data-action] {
  pointer-events: auto;
  cursor: pointer;
}
.wf-link[data-action]:hover .wf-link-line {
  stroke: var(--danger-600);
  stroke-dasharray: none;
  stroke-width: 2.5;
}
/* Nút ✕ nhỏ giữa mũi tên: chỉ hiện khi rê chuột vào đường nối */
.wf-link-x {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.wf-link-x circle {
  fill: var(--surface);
  stroke: var(--danger-600);
  stroke-width: 1.5;
}
.wf-link-x path {
  stroke: var(--danger-600);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.wf-link[data-action]:hover .wf-link-x {
  opacity: 1;
}
.wf-link-temp {
  fill: none;
  stroke: var(--primary-600);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}
/* Trạng thái trống: minh họa nhẹ phía trên lời nhắn */
.workflow-view.is-empty {
  text-align: center;
}
.wf-empty-art {
  display: block;
  margin: 24px auto -4px;
}
.wf-empty-art rect {
  fill: var(--primary-50);
  stroke: var(--primary-100);
  stroke-width: 1.5;
}
.wf-empty-art path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-dasharray: 4 4;
}
/* Nút "＋ Tạo quy trình" nổi hơn một chút */
.tb-wf-only.btn-primary {
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary-600) 32%, transparent);
}
/* Tay nắm đổi chiều cao bảng */
.wf-resize {
  height: 14px;
  margin: 2px auto -8px;
  width: 80px;
  cursor: ns-resize;
  touch-action: none;
  position: relative;
}
.wf-resize::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 5px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border);
}
.wf-resize:hover::before {
  background: var(--primary);
}
/* Phóng to toàn màn hình: nằm dưới bảng chi tiết và popup để vẫn mở được việc */
.wf-row.is-full {
  position: fixed;
  inset: 0;
  z-index: 50;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.wf-row.is-full .wf-board {
  flex: 1;
  height: auto;
}
body.wf-fullscreen-open {
  overflow: hidden;
}
/* Popup trả lại bước trước */
.wf-reject-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wf-reject-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.wf-reject-list.is-single input {
  display: none;
}
/* Nhãn trên thẻ Kanban */
.wf-lock-chip,
.wf-step-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
}
.wf-lock-chip {
  background: var(--bg);
  color: var(--ink-soft);
  border: 1px dashed var(--border);
}
.wf-step-chip {
  background: var(--warning-50);
  color: #92400e;
}
/* Popup tạo/sửa quy trình */
#modal-workflow .modal-box {
  max-width: 560px;
}
#workflow-modal-body {
  overflow-y: auto;
}
.wf-edit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}
.wf-edit-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.wf-edit-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wf-edit-step .icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.wf-edit-add {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
/* 2 cột chia đều; hẹp quá 260px thì cột sau tự xuống dòng */
.wf-edit-add > .form-field {
  flex: 1 1 260px;
  min-width: 0;
}
.wf-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Ô chọn/ô nhập giãn hết phần còn lại, nút giữ nguyên cỡ */
.wf-edit-row > .form-control {
  flex: 1 1 auto;
  min-width: 0;
}
.wf-edit-row > .btn-secondary {
  flex: 0 0 auto;
  white-space: nowrap;
}
.wf-edit-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .wf-card { transition: none; }
}
/* Dòng nhắc trên Kanban/Danh sách/Lịch: việc dây chuyền nằm ở tab Quy trình */
.wf-board-note {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: -6px 0 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.wf-board-note svg {
  color: var(--primary-600);
}
.page-view:has(input[id$="-workflow"]:checked) .wf-board-note {
  display: none;
}
/* Dòng phân biệt Quy trình / Phụ thuộc: chỉ nằm trong tab Quy trình */
.page-view:has(input[id$="-workflow"]:checked) .wf-board-note.wf-kind-note { display: flex; flex-wrap: nowrap; align-items: flex-start; margin: 0 0 12px; line-height: 1.5; }
.wf-kind-note svg { flex: none; margin-top: 2px; }
.btn-thembuoc{
  padding: 13px 15px;
}/* Chuông thông báo: chấm đỏ thành số thông báo chưa xem */
#notif-badge-dot {
  top: -6px;
  right: -7px;
  width: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  color: #fff;
  background: var(--danger-600);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

/* ---------- SIDEBAR THU GỌN (nút ☰ cạnh logo, chỉ máy tính) ----------
   Checkbox ẩn #sidebar-collapse-toggle + :has(). Thu gọn = chỉ còn cột biểu tượng,
   mục đang chọn thành hình tròn xanh; danh sách dự án ẩn, còn 1 biểu tượng "Dự án"
   bấm vào thì mở rộng ra để chọn. Trượt cùng nhịp với bảng chi tiết công việc. */
.sidebar-collapse-btn {
  margin-left: auto;
  flex-shrink: 0;
  border-color: transparent;
  cursor: pointer;
}
.sidebar-collapse-btn:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

@media (min-width: 901px) {
  .sidebar {
    overflow-x: hidden;
    transition: width 0.3s cubic-bezier(0.32, 0.72, 0, 1), padding 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
  /* Chữ không xuống dòng để khi thu hẹp thì bị che dần như trượt vào, không nhảy dòng */
  .sidebar .nav-item,
  .sidebar-brand {
    white-space: nowrap;
  }
  .sidebar .nav-item > span,
  .sidebar-brand-text {
    transition: opacity 0.2s ease;
  }

  body:has(#sidebar-collapse-toggle:checked) .sidebar {
    width: 76px;
  }
  body:has(#sidebar-collapse-toggle:checked) .sidebar-nav-box,
  body:has(#sidebar-collapse-toggle:checked) .sidebar-bottom {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  /* Logo nhường chỗ cho nút ☰ nằm giữa cột */
  body:has(#sidebar-collapse-toggle:checked) .sidebar-brand {
    justify-content: center;
    padding: 20px 20px 12px;
  }
  /* Ẩn cả khung tên ứng dụng (flex: 1), không chỉ logo + chữ: khung rỗng vẫn chiếm chỗ làm nút ☰ lệch khỏi giữa cột */
  body:has(#sidebar-collapse-toggle:checked) .sidebar .sidebar-app-brand,
  body:has(#sidebar-collapse-toggle:checked) .sidebar .sidebar-brand-mark,
  body:has(#sidebar-collapse-toggle:checked) .sidebar .sidebar-brand-text {
    display: none;
  }
  /* Cài đặt: thanh bên luôn thu, ẩn nút ☰ (muốn mở thì sang mục khác ở thanh bên) */
  body:has(#view-settings.is-active) .sidebar-collapse-btn { display: none; }
  body:has(#sidebar-collapse-toggle:checked) .sidebar-collapse-btn {
    margin-left: 0;
  }
  body:has(#sidebar-collapse-toggle:checked) .sidebar .nav-item > span {
    opacity: 0;
    pointer-events: none;
  }
  /* Mục điều hướng thành nút tròn 44px, biểu tượng nằm giữa */
  body:has(#sidebar-collapse-toggle:checked) .sidebar .nav-item {
    width: 44px;
    height: 44px;
    padding: 0 13px;
    gap: 0;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
  }
  /* Nền tròn loang từ tâm ra ngoài trong 0.3s: xanh trong suốt khi rê chuột, xanh đậm khi đang chọn */
  body:has(#sidebar-collapse-toggle:checked) .sidebar .nav-item::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--primary-50);
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), background-color 0.3s ease;
  }
  body:has(#sidebar-collapse-toggle:checked) .sidebar .nav-item:hover::before {
    transform: scale(1);
  }
  body:has(#sidebar-collapse-toggle:checked) .sidebar .nav-item:has(.nav-radio:checked)::before,
  body:has(#sidebar-collapse-toggle:checked) .sidebar:has(#sidebar-projects-list .nav-radio:checked) .nav-projects-item[for="nav-projects"]::before {
    background: var(--primary-600);
    transform: scale(1);
  }
  body:has(#sidebar-collapse-toggle:checked) .sidebar .nav-item .nav-icon {
    position: relative; /* nằm trên lớp nền tròn */
    transition: color 0.3s ease;
  }
  body:has(#sidebar-collapse-toggle:checked) .sidebar .nav-item:hover .nav-icon {
    color: var(--primary-600);
  }
  body:has(#sidebar-collapse-toggle:checked) .sidebar .nav-item:has(.nav-radio:checked) .nav-icon,
  body:has(#sidebar-collapse-toggle:checked) .sidebar:has(#sidebar-projects-list .nav-radio:checked) .nav-projects-item[for="nav-projects"] .nav-icon {
    color: #fff;
  }
  /* Dự án: ẩn cả danh sách, chỉ còn biểu tượng "Dự án" (bấm vào là sang trang Dự án) */
  /* Thu gọn thì ẩn mục con kể cả khi mục cha đang mở: kèm class nhóm để mạnh hơn quy tắc
     ".nav-...-group:has(#...-open:checked) .sidebar-...-body" (nếu không, mục con vẫn hiện dưới icon) */
  body:has(#sidebar-collapse-toggle:checked) .nav-projects-caret,
  body:has(#sidebar-collapse-toggle:checked) .nav-members-group .sidebar-members-body,
  body:has(#sidebar-collapse-toggle:checked) .nav-reports-group .sidebar-reports-body,
  body:has(#sidebar-collapse-toggle:checked) .nav-chat-group .sidebar-chat-body,
  body:has(#sidebar-collapse-toggle:checked) .sidebar-projects .sidebar-projects-body {
    display: none;
  }
}
/* Điện thoại: đã có ngăn kéo trượt + nút ☰ trên thanh đầu trang (responsive-zoom.css) */
@media (max-width: 900px) {
  .sidebar-collapse-btn {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar .nav-item::before { transition: none; }
}

/* ---------- PHỐI HỢP (teamwork.js): vướng mắc, duyệt, kết quả, Hôm nay ---------- */
/* Badge trên thẻ: luôn có chữ bên cạnh màu */
.tw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
/* Vướng = vàng cam, chờ duyệt = xanh lá, cần sửa = hồng — cùng màu với khối trong bảng chi tiết */
.tw-chip.is-blocked { background: var(--warning-50); color: var(--warning-700); border: 1px solid var(--warning); }
.tw-chip.is-review { background: var(--success-50); color: var(--success-700); border: 1px solid var(--success); }
.tw-chip.is-changes { background: var(--danger-50); color: var(--danger-600); border: 1px solid var(--danger); }

/* Khối trên đầu bảng chi tiết */
.tw-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}
.tw-box {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.tw-box.is-blocked { background: var(--warning-50); border-color: var(--warning); }
.tw-box.is-blocked .tw-box-head strong { color: var(--warning-700); }
.tw-box.is-review { background: var(--success-50); border-color: var(--success); }
.tw-box.is-review .tw-box-head strong { color: var(--success-700); }
.tw-box.is-changes { background: var(--danger-50); border-color: var(--danger); }
.tw-box.is-changes .tw-box-head strong { color: var(--danger-600); }
.tw-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}
.tw-box-time,
.tw-box-meta,
.tw-form-sub {
  font-size: 12px;
  color: var(--ink-soft);
}
.tw-box-text {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink);
  white-space: pre-wrap;
}
.tw-box-meta { margin-top: 2px; }
.tw-box-warn {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #92400e;
}
.tw-actions,
.tw-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tw-form-actions { justify-content: flex-end; }
/* Nút theo nghĩa: nền nhạt + viền + chữ đậm cùng màu, nhìn là biết tác vụ gì */
.tw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}
.tw-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tw-btn-yellow { background: var(--warning-50); border-color: var(--warning); color: var(--warning-700); }
.tw-btn-green { background: var(--success-50); border-color: var(--success); color: var(--success-700); }
.tw-btn-pink { background: var(--danger-50); border-color: var(--danger); color: var(--danger-600); }
.tw-btn-green-solid { background: var(--success); border-color: var(--success); color: var(--ink); }
.tw-btn:not(:disabled):hover { box-shadow: 0 0 0 1px currentColor; }
.tw-btn-green-solid:not(:disabled):hover { box-shadow: 0 0 0 1px var(--success-700); }
.tw-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.tw-form label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.tw-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.tw-form-row > div { display: flex; flex-direction: column; gap: 4px; }
.tw-req { color: var(--danger-600); }
.tw-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500 !important;
  color: var(--ink) !important;
}
.tw-approved {
  margin: 8px 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #047857;
}

/* Kết quả theo bước nhỏ + phiên bản tệp */
.tw-src-btn,
.tw-result-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 3px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}
.tw-src-btn:hover,
.tw-result-btn:hover { background: var(--bg); }
.tw-result-btn.is-missing { color: #92400e; border-color: var(--warning); background: var(--warning-50); }
.tw-results {
  margin: 0 0 8px 28px;
  padding: 8px 10px;
  border-left: 2px solid var(--primary-100);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tw-file { align-items: flex-start; }
.tw-file-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tw-file-meta,
.tw-file-older { font-size: 11.5px; color: var(--muted); }
.tw-file-older a { color: var(--primary-600); }
.tw-file-approved { font-size: 11.5px; font-weight: 700; color: #047857; }

/* Bình luận -> việc cần làm */
.tw-comment-task {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-600);
  cursor: pointer;
  text-align: left;
}
.tw-comment-task.is-done { color: #047857; }
.tw-comment-form {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.tw-flash { animation: twFlash 1.6s ease-out; }
@keyframes twFlash {
  0%, 40% { background: var(--warning-50); box-shadow: 0 0 0 3px var(--warning); }
  100% { box-shadow: none; }
}

/* Trang Hôm nay: 2 tab */
.tw-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.tw-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.tw-tab.is-active { color: var(--primary-600); border-bottom-color: var(--primary-600); }
.tw-tab-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  font-size: 12px;
  text-align: center;
}
.tw-tab-count.is-hot { background: var(--danger-600); color: #fff; }
.tw-scope { width: auto; min-width: 180px; }
.tw-blocked-filter.is-active { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-100); }
.tw-reason {
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}
.tw-reason.is-review { background: var(--surface); color: var(--success-700); }
.tw-reason.is-blocker { background: var(--surface); color: var(--warning-700); }
.tw-reason.is-changes { background: var(--surface); color: var(--danger-600); }
.tw-reason.is-comment { background: var(--surface); color: var(--primary-600); }
/* Dòng "Cần tôi xử lý": màu theo lý do; rê chuột thì viền dày thêm 1px, chuyển động đều 0.2s */
.tw-action-row {
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}
.tw-action-row.is-review { background: var(--success-50); border-color: var(--success); --tw-row: var(--success); }
.tw-action-row.is-blocker { background: var(--warning-50); border-color: var(--warning); --tw-row: var(--warning); }
.tw-action-row.is-changes { background: var(--danger-50); border-color: var(--danger); --tw-row: var(--danger); }
.tw-action-row.is-comment { background: var(--primary-50); border-color: var(--primary); --tw-row: var(--primary); }
.tw-action-row:hover { box-shadow: 0 0 0 1px var(--tw-row, var(--border)); }
.tw-wait { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tw-open { padding: 5px 12px; font-size: 12.5px; }
.wf-affected {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--danger-600);
}
@media (max-width: 620px) {
  .tw-action-row .flat-task-end { width: 100%; justify-content: space-between; }
  .tw-results { margin-left: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .tw-flash { animation: none; }
}

/* ---------- Chuông: số chưa đọc gây chú ý ---------- */
/* Vòng sáng lan ra liên tục khi còn thông báo chưa đọc; chuông lắc 1 nhịp khi có thông báo mới */
#notif-badge-dot {
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger-600) 55%, transparent);
  animation: notifBadgePulse 1.8s ease-out infinite;
}
@keyframes notifBadgePulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger-600) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
#notif-bell-btn.is-ringing svg {
  transform-origin: 50% 10%;
  animation: notifBellRing 0.9s ease-in-out;
}
@keyframes notifBellRing {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(9deg); }
  60% { transform: rotate(-6deg); }
  75% { transform: rotate(3deg); }
}

/* ---------- Bảng chi tiết: mỗi phần 1 màu nền trong suốt để tìm nhanh ---------- */
.detail-section.is-checklist,
.detail-section.is-time,
.detail-section.is-files,
.detail-section.is-comments {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}
.detail-section:empty { display: none; }
/* Việc cần làm: xanh dương */
.detail-section.is-checklist {
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}
.detail-section.is-checklist .milestone-head h3 { color: var(--primary-600); }
/* Bấm giờ: vàng */
.detail-section.is-time {
  background: color-mix(in srgb, var(--warning) 8%, transparent);
  border-color: color-mix(in srgb, var(--warning) 35%, transparent);
}
/* Tài liệu chung: xanh lá */
.detail-section.is-files {
  background: color-mix(in srgb, var(--success) 8%, transparent);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
}
.detail-section.is-files .section-title-v2 { color: var(--success-700); }
/* Bình luận: hồng */
.detail-section.is-comments {
border-color: 
color-mix(in srgb, #8a8183 28%, transparent);
box-shadow: inset 0 3px 8px rgba(15, 23, 42, 0.10), inset 0 1px 2px rgba(15, 23, 42, 0.08), inset 0 -1px 0 rgba(255, 255, 255, 0.9);
}
.detail-section.is-comments .section-title-v2 { color: var(--ink);text-transform: capitalize; }
@media (prefers-reduced-motion: reduce) {
  #notif-badge-dot,
  #notif-bell-btn.is-ringing svg { animation: none; }
  .tw-btn,
  .tw-action-row { transition: none; }
}
/* ---------- NHÃN CHUYÊN MÔN ---------- */
.skill-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 2px 9px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink-soft);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.skill-chip-more { background: var(--bg); cursor: default; }
.skill-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.member-card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* Ô lọc theo nhãn trong bộ chọn người phụ trách */
.assignee-label-select {
  width: 100%; margin-bottom: 8px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500;
}
.assignee-label-empty { margin: 0 0 8px; }

/* Popup quản lý nhãn */
#modal-labels .modal-box { max-width: 540px; }
/* ---------- Hộp thoại Quản lý nhãn chuyên môn (ảnh mẫu 11/2026, assignee.js renderLabelsModal / lm*) ---------- */
/* Không bao giờ có thanh cuộn ngoài cùng của hộp thoại (chủ dự án chốt): danh sách trái tự cuộn bên trong */
#modal-labels .modal-box.lm-box { max-width: 1120px; width: calc(100% - 32px); max-height: none; overflow: visible; padding: 0; border-radius: 20px; }
.lm-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.lm-head-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); }
.lm-head-text { flex: 1; min-width: 0; }
.lm-head-text h2 { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.3; }
.lm-head-text p { margin: 0; font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
#modal-labels .modal-head .lm-x.icon-btn { flex: none; width: 36px; height: 36px; transition: background-color 0.2s, border-color 0.2s, color 0.2s; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink-soft); }
#modal-labels .modal-head .lm-x.icon-btn:hover { border-color: var(--danger); background: var(--danger); color: #fff; box-shadow: none; } /* rê nút × = đỏ (chủ dự án chốt) */
#modal-labels .modal-head .lm-x.icon-btn:focus-visible { box-shadow: 0 0 0 3px var(--primary-100); }
#modal-labels .lm-box #labels-modal-body { padding: 0; overflow: visible; }
.lm-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.lm-grid.is-readonly { grid-template-columns: minmax(0, 1fr); min-height: 0; }
.lm-left { min-width: 0; padding: 12px; border-right: 1px solid var(--border-soft); }
.lm-grid.is-readonly .lm-left { border-right: 0; }
.lm-tools { display: flex; gap: 10px; margin-bottom: 12px; }
.lm-tools .search-field { flex: 1 1 auto; width: auto; max-width: none; height: 38px; border-radius: 11px; } /* kéo dài: ô tìm + nút thêm lấp đủ cột */
.lm-tools .search-field input { font-size: 13.5px; }
.lm-add { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 38px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); border-radius: 11px; background: var(--primary-50); color: var(--primary-600); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background-color 0.2s, border-color 0.2s; }
.lm-add:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }
/* Khung cuộn cắt mọi thứ tràn ra ngoài: nhãn gợi ý của dòng ĐẦU hiện bên dưới nút (bên trên bị cắt), không cuộn ngang */
.lm-row:first-child .lm-icon[data-tip]::after { top: calc(100% + 8px); bottom: auto; transform: translate(-50%, -4px); }
.lm-row:first-child .lm-icon[data-tip]:hover::after, .lm-row:first-child .lm-icon[data-tip]:focus-visible::after { transform: translate(-50%, 0); }
/* Tối đa 6 dòng (6 × 60px + 5 khe 8px + đệm), dài hơn cuộn bằng thanh mảnh, mờ */
.lm-list { display: flex; flex-direction: column; gap: 8px; max-height: 404px; overflow-x: hidden; overflow-y: auto; padding: 2px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
/* Mục 1: rê dòng = nền xanh nhạt + viền xanh nhạt, mô tả + 2 nút ngả xanh; dòng đang sửa = viền xanh đậm hơn */
.lm-row { flex: none; display: flex; align-items: center; gap: 12px; min-height: 60px; box-sizing: border-box; padding: 8px 12px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s; }
.lm-row[data-action] { cursor: pointer; }
.lm-row:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border-soft)); background: #f4f9ff; }
.lm-row:hover .lm-row-text small { color: color-mix(in srgb, var(--primary) 70%, var(--ink-soft)); }
.lm-row:hover .lm-icon { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); color: var(--primary-600); }
.lm-row.is-on { border-color: color-mix(in srgb, var(--primary) 70%, var(--surface)); background: #eef6ff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent); }
.lm-row.is-new { border-style: dashed; }
/* Bấm Thêm nhãn mới: dòng mới trồi lên (0.2s), chỉ chạy đúng lần tạo */
.lm-row.is-enter { animation: lm-row-in 0.2s ease; }
@keyframes lm-row-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.lm-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.lm-chip { --c: #94a3b8; display: inline-flex; align-items: center; gap: 8px; flex: none; max-width: 150px; padding: 5px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; }
.lm-chip i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.lm-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-chip.is-big { max-width: 100%; margin-bottom: 10px; padding: 5px 14px; font-size: 14px; }
.lm-row-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lm-row-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; color: var(--ink); }
.lm-row-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--ink-soft); transition: color 0.2s; }
.lm-row-count { flex: none; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
/* Mục 2–3: rê nút sửa = nền xanh + nhãn "Sửa nhãn"; rê nút xóa = nền đỏ nhạt + nhãn "Xóa nhãn" (nhãn tối phía trên nút) */
.lm-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.lm-icon:hover, .lm-icon:focus-visible { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--primary-50); color: var(--primary-600); }
.lm-icon.is-danger:hover, .lm-icon.is-danger:focus-visible { border-color: #fecdd3; background: #ffe4e6; color: #e11d48; }
.lm-icon[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 5; padding: 4px 9px; border-radius: 8px; background: #1e293b; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.lm-icon[data-tip]:hover::after, .lm-icon[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.lm-empty { margin: 8px 2px; font-size: 13.5px; color: var(--ink-soft); }
/* Cột phải: thẻ Chỉnh sửa / Thêm nhãn */
.lm-right { display: flex; flex-direction: column; min-width: 0; padding: 12px; }
.lm-card { flex: 1; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 16px; background: #fbfdff; }
.lm-card-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #eef5ff; color: var(--primary-600); }
.lm-card-head b { font-size: 14.5px; color: var(--ink); }
.lm-card-body { padding: 12px 14px; }
.lm-card-body .form-field { margin-bottom: 10px; }
.lm-card-body .form-control { font-size: 13.5px; }
.lm-card-body input.form-control { height: 38px; }
.lm-field-label { margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.lm-card-body .form-field label { font-size: 13px; font-weight: 700; color: var(--ink); }
.lm-req { color: #e11d48; }
.lm-card-body textarea.form-control { min-height: 60px; resize: vertical; }
.lm-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.lm-swatch { width: 28px; height: 28px; padding: 0; border: 3px solid var(--surface); border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.lm-swatch:hover { transform: scale(1.1); }
.lm-swatch.is-on { box-shadow: 0 0 0 2px var(--c); }
.lm-custom.btn-secondary { display: inline-flex; align-items: center; gap: 6px; height: 36px; margin-left: auto; padding: 0 14px; border-radius: 10px; }
.lm-custom.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.lm-hex { display: inline-flex; align-items: center; gap: 10px; width: 190px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.lm-hex-dot { flex: none; width: 18px; height: 18px; border-radius: 5px; }
.lm-hex input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-transform: uppercase; outline: none; }
.lm-hex:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.lm-hue-row { display: flex; align-items: center; gap: 12px; height: 40px; }
.lm-hue-preview { flex: none; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 1px var(--border); }
.lm-hue.sk-hue { height: 14px; }
.lm-hue-hex { flex: none; width: 70px; font-size: 13px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.lm-hint { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 12px; color: var(--ink-soft); }
.lm-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.lm-foot .btn-secondary, .lm-foot .btn-primary { height: 40px; min-width: 100px; justify-content: center; border-radius: 11px; font-size: 14px; }
.lm-foot .btn-primary { min-width: 150px; }
@media (max-width: 900px) { .lm-grid { grid-template-columns: minmax(0, 1fr); } .lm-left { border-right: 0; border-bottom: 1px solid var(--border-soft); } .lm-list { max-height: 300px; } }
@media (max-width: 560px) { .lm-head { padding: 16px; } .lm-left, .lm-right { padding: 14px; } .lm-tools { flex-wrap: wrap; } .lm-add { flex: 1 1 100%; justify-content: center; } .lm-row-text small { display: none; } }
@media (prefers-reduced-motion: reduce) { .lm-row, .lm-icon, .lm-icon[data-tip]::after, .lm-swatch, .lm-add, #modal-labels .modal-head .lm-x.icon-btn { transition: none; } .lm-row.is-enter { animation: none; } }
#labels-modal-body { overflow-y: auto; }
.label-list { list-style: none; margin: 0 0 16px; padding: 0; }
.label-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.label-item:last-child { border-bottom: 0; }
.label-item-desc { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-item-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.label-form { padding-top: 14px; border-top: 1px solid var(--border-soft); }
.label-check-list { display: flex; flex-direction: column; gap: 2px; }
.label-check-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.label-check-item:hover { background: var(--bg); }
.label-check-item input { width: 15px; height: 15px; accent-color: var(--primary); flex-shrink: 0; }

/* Menu @ trong bình luận: mục nhóm chuyên môn */
.mention-label-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.mention-team-icon { display: inline-flex; flex-shrink: 0; } /* Nhóm: biểu tượng lưới màu nhóm, phân biệt với chấm màu của nhãn */
.mention-option-hint { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.comment-label-note { margin-top: 2px; font-size: 12px; color: var(--muted); }
/* ---------- Nhãn chuyên môn trong chi tiết thành viên: kiểu thẻ hashtag ---------- */
.label-picker { position: relative; }
.label-picker-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.label-tag {
  padding: 4px 6px 4px 10px;
  font-size: 12.5px;
}
.label-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.label-tag-remove:hover { background: var(--danger-50); color: var(--danger-600); }
/* Nút "+" tròn viền đứt, giống nút thêm người phụ trách */
.label-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px dashed var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.label-add-btn:hover,
.label-add-btn[aria-expanded="true"] { border-color: var(--primary); color: var(--primary-600); }
.label-picker-panel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.label-picker-panel .assignee-picker-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.label-picker-options { display: flex; flex-wrap: wrap; gap: 6px; }
.label-option {
  padding: 4px 10px;
  font-size: 12.5px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.label-option:hover { border-color: var(--primary); background: var(--primary-50); }
/* ---------- CHIP ĐIỀU KIỆN LỌC ĐANG ÁP DỤNG ---------- */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -8px 0 16px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 2px 2px 10px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-pill);
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: 12.5px;
  font-weight: 600;
}
/* Tên dài thì cắt "…" để nút bỏ luôn nằm trong màn hình */
.filter-chip-text {
  min-width: 0;
  max-width: min(260px, 68vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-chip-label {
  color: var(--ink-soft);
  font-weight: 500;
}
.filter-chip-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
}
.filter-chip-remove:hover {
  background: var(--primary-100);
}
/* Hành động phụ: dạng chữ gạch chân, không dùng màu cảnh báo */
.filter-clear-all {
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: underline;
}
.filter-clear-all:hover {
  background: var(--bg);
  color: var(--primary-600);
}
/* Tab Quy trình luôn hiện đủ dây chuyền, không chịu tác động của bộ lọc nên ẩn hàng chip */
.page-view:has(input[id$="-workflow"]:checked) .active-filters {
  display: none;
}
@media (max-width: 620px) {
  .filter-chip-remove { width: 28px; height: 28px; } /* vùng chạm lớn hơn cho điện thoại */
  .filter-clear-all { padding: 7px 8px; }
}
/* ---------- NÚT "LỌC" GỘP: popover chọn trường + dòng sửa điều kiện ---------- */
.tf-wrap { position: relative; }
/* Popover dùng lại khung .role-filter-panel, mở dưới nút, neo mép phải để không tràn màn hình */
.tf-popover {
  display: block;
  max-width: calc(100vw - 32px);
}
.tf-field-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.tf-field-item:hover,
.tf-field-item:focus-visible { background: var(--primary-100); }
.tf-field-on {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-600);
}
/* Dòng sửa điều kiện: nền nhẹ, thoáng. 2 khối cùng hàng: trái = bộ lọc, phải = Hủy / Áp dụng */
.tf-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: -6px 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
}
.tf-editor-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.tf-editor-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tf-editor-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.tf-editor-main > .tf-select,
.tf-editor-main > .cselect-btn { width: auto; min-width: 170px; }
.tf-op {
  font-size: 13px;
  color: var(--muted);
}
/* Nút xổ danh sách giá trị + danh sách dọc có ô tick (dùng lại khung popup lọc cũ) */
.tf-value-btn {
  min-width: 190px;
  justify-content: space-between;
  background: var(--surface);
}
.tf-value-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tf-value-caret { flex-shrink: 0; color: var(--muted); }
.tf-value-panel {
  display: block;
  left: 0;
  right: auto;
  width: 260px;
  max-width: calc(100vw - 32px);
}
.tf-value-panel .role-filter-list {
  max-height: 260px;
  overflow-y: auto;
}
.tf-value-panel .tf-search { margin-bottom: 8px; width: 100%; }
.tf-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}
.tf-empty { font-size: 12.5px; color: var(--muted); }
.tf-error {
  flex-basis: 100%;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger-600);
}
/* Phần chữ của chip giờ là nút: bấm để mở lại dòng sửa điều kiện đó */
button.filter-chip-text {
  padding: 2px 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button.filter-chip-text:hover { text-decoration: underline; }
.filter-chip.is-editing { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
@media (max-width: 620px) {
  .tf-editor-main > .tf-select,
  .tf-editor-main > .cselect-btn,
  .tf-value-pick,
  .tf-value-btn,
  .tf-date { width: 100%; flex-basis: 100%; }
  .tf-editor-actions { width: 100%; justify-content: flex-end; }
  .tf-op { display: none; }
}
.filter-btn:hover { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-100); transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; }

/* ---------- TASK CON + CHI TIẾT RỘNG (subtasks.js) ---------- */
/* Nút tròn mũi tên giữa mép trái bảng nhỏ: nằm lòi ra ngoài panel nên không bị cắt bởi vùng cuộn bên trong */
.detail-expand-btn {
  position: absolute;
  left: -17px;
  top: 50%;
  z-index: 3;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary-600);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.detail-expand-btn:hover,
.detail-expand-btn:focus-visible { box-shadow: 0 0 0 3px var(--primary-100), var(--shadow-md); }
.detail-expand-tip {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.detail-expand-btn:hover .detail-expand-tip,
.detail-expand-btn:focus-visible .detail-expand-tip { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .detail-expand-btn { transition: none; } }
/* Danh sách task con */
.subtask-list { display: flex; flex-direction: column; gap: 2px; }
.subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
  border-radius: var(--radius-sm);
}
.subtask-row:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.subtask-check { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; accent-color: var(--primary-600); }
.subtask-check:disabled { cursor: not-allowed; }
.subtask-name {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.subtask-name:hover { color: var(--primary-600); text-decoration: underline; }
/* Task con đã tích: tên giữ chữ đen (không gạch ngang), chỉ ô tích xanh lá báo đã xong */
.subtask-row.is-done .subtask-name { color: var(--ink); }
.subtask-meta { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
/* Avatar người phụ trách trong hàng task con: nhỏ theo cỡ chữ của hàng (34px mặc định làm thẻ cao lên) */
.subtask-meta .avatar { width: 22px; height: 22px; font-size: 9px; border-width: 1.5px; }
.subtask-meta .avatar-group > .avatar + .avatar { margin-left: -6px; }
.subtask-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0 7px;
}
.subtask-flag { display: inline-flex; align-items: center; font-size: 12px; color: var(--success-700); }
.subtask-flag.is-missing { color: var(--warning-700); }
.subtask-empty { font-size: 13px; color: var(--muted); margin: 4px 0; }
.subtask-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}
.subtask-progress .progress-track { flex: 1; }
.subtask-parent-tag {
  font-size: 11.5px;
  color: var(--ink-soft);
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}
.assignee-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;
  background: var(--border-soft);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  border: 2px solid var(--surface);
}

/* Popup chi tiết rộng */
.wide-overlay {
  position: fixed;
  inset: 0;
  z-index: 56;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
body:has(#task-wide-toggle:checked) .wide-overlay {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.wide-box {
  width: min(1240px, 100%);
  height: min(860px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.98);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
body:has(#task-wide-toggle:checked) .wide-box { transform: scale(1); }
/* Thanh trên: breadcrumb trái, thông tin phải, nút thu gọn/đóng ngoài cùng. Chữ co đều theo bề ngang, không rớt dòng */
.wide-head {
  display: flex;
  text-transform: capitalize;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: clamp(11px, 0.95vw, 13px);
}
/* Dòng nhỏ trên cùng: nền xám, chữ nhỏ xám đậm, dồn trái */
.wide-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
}
.wide-topline .wide-crumbs { flex: 0 1 auto; font-size: inherit; }
.wide-topline .wide-crumb { color: var(--ink-soft); font-weight: 600; }
.wide-topline .wide-crumb:hover { color: var(--primary-600); background: var(--surface); }
.wide-topline .wide-crumb.is-current { color: var(--ink); }
.wt-sep { color: var(--muted); flex-shrink: 0; }
.wt-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  color: var(--muted);
}
.wt-date {
    font: inherit;
    font-size: 12px;
    padding: 3px 5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
}
.wt-date:hover:not(:disabled),
.wt-date:focus { border-color: var(--border); background: var(--surface); }
.wide-crumbs {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
}
.wide-crumb-project { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); flex-shrink: 0; }
.wide-crumb {
  min-width: 0;
  max-width: 180px;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  color: var(--primary-600);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wide-crumb:hover { background: var(--primary-50); }
.wide-crumb.is-current { color: var(--ink); font-weight: 700; cursor: default; max-width: 260px; }
.wide-crumb.is-current:hover { background: transparent; }
.wide-crumb-sep { color: var(--muted); flex-shrink: 0; }
.wide-meta {
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.6vw, 10px);
  flex-wrap: nowrap;
}
.wm-item,
.wm-field,
.wm-people {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
  color: var(--ink-soft);
  white-space: nowrap;
}
.wm-label,
.wm-field > span { font-size: 0.9em; color: var(--muted); }
.wm-date,
.wm-select {
  font: inherit;
  font-size: 1em;
  padding: 3px 5px;
  border: 0px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
.wm-date{
  border: 1px solid var(--border);
}
.wm-empty { color: var(--muted); }
.wide-meta .avatar { width: 24px; height: 24px; font-size: 10px; }
.wide-meta .assignee-picker .assignee-picker-panel { left: auto; right: 0; }
.wide-head-actions { display: flex; gap: 4px; width: auto; flex-shrink: 0; margin-left: auto; }
.wide-tabs { display: none; }
/* Nội dung 2 cột: trái ~60% (tên → mô tả → task con → tệp), phải ~40% (hoạt động + ô bình luận) */
.wide-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}
.wide-main {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 28px;
  scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}
.wide-main .detail-title-input { font-size: 20px; }
.wide-side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--danger) 3%, var(--surface));
}
.wide-side-head {
  padding: 14px 16px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--danger-600);
}
.wide-activity-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wide-side .comment-composer { padding: 10px 16px 14px; border-top: 1px solid var(--border-soft); }
.act-more { align-self: center; margin-bottom: 6px; font-size: 12.5px; }
.act-log {
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 2px 0 2px 10px;
  border-left: 2px solid var(--border);
}
.act-who { font-weight: 700; color: var(--ink); }
.act-time { margin-left: 6px; font-size: 11.5px; color: var(--muted); }
.act-source {
  margin-left: 4px;
  padding: 0 6px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-pill);
  background: var(--primary-50);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-600);
  cursor: pointer;
}
/* Kéo tệp vào vùng nhận: viền đứt nổi lên để biết thả được ở đây */
[data-dropzone].is-drag-over {
  outline: 2px dashed var(--primary);
  outline-offset: 2px;
  background: var(--primary-50);
}
/* Màn hẹp: thông tin xuống hàng 2 (không đè chữ / nút đóng) */
@media (max-width: 1100px) {
  .wide-head { flex-wrap: wrap; align-items: flex-start; }
  .wide-meta { flex: 1 1 0; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .wide-topline { flex-wrap: wrap; white-space: normal; }
}
/* Điện thoại: toàn màn hình, 2 cột thành tab Nội dung / Hoạt động */
@media (max-width: 760px) {
  .wide-overlay { padding: 0; }
  .wide-box { width: 100%; max-width: 100vw; min-width: 0; height: 100%; border-radius: 0; }
  .wide-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-soft);
  }
  .wide-tab {
    flex: 1;
    padding: 10px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    font: inherit;
    font-weight: 600;
    color: var(--ink-soft);
  }
  .wide-tab.is-active { color: var(--primary-600); border-bottom-color: var(--primary-600); }
  .wide-body { grid-template-columns: minmax(0, 1fr); }
  .wide-body.is-tab-content .wide-side,
  .wide-body.is-tab-activity .wide-main { display: none; }
  .wide-side { border-left: 0; }
  .detail-expand-btn { left: 8px; top: auto; bottom: 16px; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wide-overlay, .wide-box{ transition: none; }
}

/* ---------- Tệp kèm bình luận + kéo thả sắp xếp task con ---------- */
.comment-composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.comment-composer-actions .comment-send-btn { align-self: auto; }
/* Khung bình luận công việc: đính kèm | ô nhập | Gửi trên 1 hàng. Ô nhập mặc định 1 dòng, cao bằng 2 nút;
   gõ dài thì tự cao lên tối đa 2 dòng rồi cuộn (tuCaoBinhLuan, comments.js); 2 nút giữ nguyên cỡ, nằm sát đáy */
.comment-composer-row { display: flex; align-items: flex-end; gap: 6px; }
.comment-composer-row textarea.form-control {
  flex: 1; min-width: 0; resize: none; overflow-y: auto;
  height: 36px; min-height: 36px; max-height: 56px; padding: 7px 10px; line-height: 20px;
}
.comment-composer-row textarea.form-control:placeholder-shown { overflow: hidden; } /* câu gợi ý dài không làm hiện thanh cuộn */
.comment-composer-row textarea.form-control::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comment-composer-row .icon-btn { flex-shrink: 0; cursor: pointer; }
.comment-composer-row .comment-send-btn { align-self: auto; flex-shrink: 0; height: 36px; justify-content: center; }
.comment-draft-files,
.comment-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.comment-files { margin-top: 6px; }
.comment-draft-file,
.comment-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-pill);
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comment-file:hover { text-decoration: underline; }
.comment-draft-file button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.comment-draft-file button:hover { background: var(--danger-50); color: var(--danger-600); }
/* Tay nắm kéo: chỉ hiện rõ khi rê chuột vào dòng để danh sách vẫn gọn */
.subtask-drag {
  flex-shrink: 0;
  width: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  letter-spacing: -2px;
  cursor: grab;
  opacity: 0.35;
  user-select: none;
  transition: opacity 0.15s ease;
}
.subtask-row:hover .subtask-drag { opacity: 1; }
.subtask-row.is-dragging { opacity: 0.5; }
/* Vạch xanh báo chỗ sẽ thả: phía trên hoặc phía dưới dòng */
.subtask-row.is-drop-before { box-shadow: inset 0 2px 0 var(--primary-600); }
.subtask-row.is-drop-after { box-shadow: inset 0 -2px 0 var(--primary-600); }
@media (hover: none) {
  .subtask-drag { opacity: 1; } /* màn cảm ứng không có rê chuột */
}

/* ---------- Mô tả có định dạng (Jodit + chế độ chỉ xem) ---------- */
/* Jodit theo màu / bo góc của app */
.desc-editor-wrap .jodit-container:not(.jodit_inline) {
  border-color: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.desc-editor-wrap .jodit-container:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.desc-editor-wrap .jodit-toolbar__box:not(:empty) { background: var(--bg); border-bottom-color: var(--border-soft); }
.desc-editor-wrap .jodit-wysiwyg { font-family: var(--font-ui); font-size: 14px; line-height: 1.6; color: var(--ink); padding: 10px 12px !important; }
.desc-editor-wrap .jodit-placeholder { font-family: var(--font-ui); color: var(--muted); padding: 10px 12px !important; }
.desc-editor-wrap .jodit-status-bar { display: none; }
/* Toàn màn hình của Jodit nằm trên popup chi tiết rộng */
.jodit_fullsize { z-index: 70 !important; }
.jodit-popup, .jodit-dialog { z-index: 75 !important; }

/* Người chỉ xem: hiện nội dung đã định dạng, không có thanh công cụ */
.rte-view {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  word-break: break-word;
}
.rte-empty { color: var(--muted); }
.rte-view p,
.rte-view div,
.jodit-wysiwyg p { margin: 0 0 6px; }
.rte-view h1, .rte-view h2, .rte-view h3, .rte-view h4 { font-weight: 700; margin: 10px 0 4px; line-height: 1.3; }
.rte-view h1 { font-size: 20px; } .rte-view h2 { font-size: 18px; } .rte-view h3 { font-size: 16px; } .rte-view h4 { font-size: 15px; }
.rte-view ul,
.rte-view ol,
.jodit-wysiwyg ul,
.jodit-wysiwyg ol { margin: 4px 0 6px; padding-left: 22px; }
/* Bộ reset đầu file bỏ dấu đầu dòng toàn trang: nội dung người dùng soạn phải có lại */
.rte-view ul, .jodit-wysiwyg ul { list-style: disc; }
.rte-view ol, .jodit-wysiwyg ol { list-style: decimal; }
.rte-view blockquote {
  margin: 6px 0;
  padding: 4px 10px;
  border-left: 3px solid var(--primary-100);
  color: var(--ink-soft);
}
.rte-view a { color: var(--primary-600); text-decoration: underline; }
.rte-view img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.rte-view table { border-collapse: collapse; margin: 6px 0; max-width: 100%; }
.rte-view th,
.rte-view td { border: 1px solid var(--border); padding: 5px 8px; vertical-align: top; }
.rte-view th { background: var(--bg); font-weight: 700; }
.rte-view pre,
.rte-view code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--bg); border-radius: 4px; }
.rte-view pre { padding: 8px 10px; overflow-x: auto; }
.rte-view hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }

/* ---------- Cột phải chi tiết rộng: 3 tab Bình luận / Nhật ký / Thời gian làm việc (subtasks.js wideActivityHTML) ---------- */
.wide-side-tabs { flex: none; display: flex; align-items: center; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--border-soft); overflow-x: auto; }
.wide-side-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 0; border-bottom: 2px solid transparent; background: transparent;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; cursor: pointer; margin-bottom: -1px; }
.wide-side-tab:hover { color: var(--ink); }
.wide-side-tab.is-active { color: var(--primary-600); border-bottom-color: var(--primary); }
.wide-side-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px; }
.wide-side-tabs { scrollbar-width: none; } /* hẹp quá thì vẫn vuốt ngang được, không hiện thanh cuộn */
.wide-side-tabs::-webkit-scrollbar { display: none; }
.wide-side-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wide-side-pane[hidden] { display: none; }
.wide-side-pane.is-comments .wide-activity-list { padding-top: 12px; }
.wide-log-list, .wide-side-pane.is-time { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; }
.wide-side-pane.is-time .detail-section { margin: 0; }
/* flex-shrink: 0 — không cho flex co từng bình luận để nhét vừa khung; giữ đúng chiều cao thật, khung tự hiện thanh cuộn */
.wide-activity-list > * { margin-bottom: 8px; flex-shrink: 0; }

/* ---------- Nhật ký dạng dòng thời gian (logs.js logTimelineHTML): bảng nhỏ + chi tiết rộng ---------- */
.ltl { position: relative; margin: 0; padding: 0 0 0 20px; list-style: none; }
.ltl::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--border-soft); }
.ltl-day { position: relative; margin: 4px 0 8px -20px; padding-left: 20px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ltl-item { --tc: var(--primary); --tb: var(--primary-50); --tt: var(--primary-600); position: relative; margin-bottom: 10px; }
.ltl-item.is-green { --tc: var(--success); --tb: var(--success-50); --tt: var(--success-700); }
.ltl-item.is-violet { --tc: #8b5cf6; --tb: color-mix(in srgb, #8b5cf6 12%, var(--surface)); --tt: #7c3aed; }
.ltl-item.is-amber { --tc: var(--warning); --tb: var(--warning-50); --tt: var(--warning-700); }
.ltl-item.is-red { --tc: var(--danger); --tb: var(--danger-50); --tt: var(--danger-600); }
.ltl-item.is-teal { --tc: #14b8a6; --tb: color-mix(in srgb, #14b8a6 12%, var(--surface)); --tt: #0f766e; }
.ltl-item.is-slate { --tc: #94a3b8; --tb: var(--bg); --tt: var(--ink-soft); }
.ltl-dot { position: absolute; left: -19px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 0 3px var(--surface); }
.ltl-card { padding: 9px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.ltl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ltl-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--tb); color: var(--tt); font-size: 11.5px; font-weight: 700; }
.ltl-top time { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ltl-who { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ltl-who .avatar, .ltl-who .log-sys-ico { width: 24px; height: 24px; font-size: 10px; }
.ltl-who strong { font-size: 13px; color: var(--ink); }
.ltl-who .act-source { margin-left: 0; }
.ltl-msg { margin: 4px 0 0 30px; font-size: 13px; line-height: 1.5; color: var(--ink-soft); overflow-wrap: anywhere; }
.dq-pane .ltl { margin-top: 4px; }

/* ---------- Ô chọn Trạng thái / Độ ưu tiên hiện dạng thẻ màu (data-pill) ---------- */
/* Trạng thái: cùng màu tiêu đề cột Kanban; Ưu tiên: cùng thẻ của bộ lọc ưu tiên. Có khung để dễ phân biệt */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.cselect-value .priority-pill,
.cselect-menu .priority-pill {
  border: 1px solid currentColor;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
}
.cselect-value .status-pill,
.cselect-value .priority-pill { vertical-align: middle; }
/* Danh sách: mỗi dòng 1 thẻ, dòng đang chọn có viền ngoài để nhận ra */
.cselect-menu li.has-pill { padding: 5px 8px; }
.cselect-menu li.has-pill.is-selected .status-pill,
.cselect-menu li.has-pill.is-selected .priority-pill { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; }

/* ---------- Đợt 5: menu ⋯, toast Hoàn tác, thùng rác, sao chép ---------- */
/* Menu ⋯ của công việc */
.task-menu { position: relative; display: inline-flex; }
.task-menu-btn.is-open,
.task-menu-btn:hover { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-100); }
.task-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 210px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  animation: taskMenuIn 0.15s ease-out;
}
@keyframes taskMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.task-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.task-menu-item svg { color: var(--primary-600); flex-shrink: 0; }
.task-menu-item:hover,
.task-menu-item:focus-visible { background: var(--primary-50); color: var(--primary-600); }
.task-menu-item.is-danger svg { color: var(--danger-600); }
.task-menu-item.is-danger:hover,
.task-menu-item.is-danger:focus-visible { background: var(--danger-50); color: var(--danger-600); }
/* Báo vướng (menu ⋯): icon vàng, rê vào chữ vàng + nền vàng trong suốt */
.task-menu-item.is-warning svg { color: var(--warning-600); }
.task-menu-item.is-warning:hover,
.task-menu-item.is-warning:focus-visible { background: rgba(251, 191, 36, 0.14); color: var(--warning-600); }

/* Toast có nút Hoàn tác: nền tối nổi bật ở đáy màn hình, nút xanh sáng */
.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 210;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.undo-toast.is-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.undo-toast-text { min-width: 0; }
.undo-toast-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.undo-toast-btn:hover:not(:disabled) { background: #7dd3fc; }
.undo-toast-btn:disabled { opacity: 0.7; cursor: wait; }
.undo-toast-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.undo-toast-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
/* Kiểu báo thành công (showUndoToast opts.tone = "success"): nền xanh lá nhạt, dấu ✓ tròn, Hoàn tác dạng chữ xanh */
.undo-toast.is-success { padding: 10px 10px 10px 14px; border: 1px solid #bbf7d0; background: #f0fdf4; color: var(--ink); box-shadow: var(--shadow-md, var(--shadow-lg)); }
.undo-toast-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: #22c55e; color: #fff; }
.undo-toast.is-success .undo-toast-ico svg { stroke-width: 3; }
.undo-toast.is-success .undo-toast-btn { padding: 6px 8px; background: transparent; color: var(--primary-600); }
.undo-toast.is-success .undo-toast-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.undo-toast.is-success .undo-toast-close { color: var(--ink-soft); }
.undo-toast.is-success .undo-toast-close:hover { background: rgba(15, 23, 42, .06); color: var(--ink); }

/* Nút Thùng rác đầu trang dự án: có việc trong thùng rác thì hiện số màu hồng */
.trash-btn { position: relative; cursor: pointer; }
.trash-btn:hover { background: var(--danger-50); color: var(--danger-600); border-color: var(--danger-100); }
.trash-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger-600);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
/* Thùng rác dạng bảng nhiều cột: rộng gần hết màn hình để thấy đủ mọi cột */
#modal-trash .modal-box { width: min(1280px, calc(100vw - 48px)); max-width: none; }
.trash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trash-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.trash-item:hover { box-shadow: var(--shadow-md); border-color: var(--danger-100); border-left-color: var(--danger-600); }
.trash-main { flex: 1; min-width: 0; }
.trash-name { font-size: 14px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trash-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--danger-600);
  background: var(--danger-50);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
}
.trash-meta { margin-top: 2px; font-size: 12px; color: var(--ink-soft); }
.trash-warn { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--warning-700); }

/* Form sao chép */
#modal-copy-task .modal-box { max-width: 560px; }
.copy-check { margin: 6px 0; }
.copy-dates { margin-top: 10px; }
.copy-dates label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.copy-summary {
  margin: 14px 0 6px;
  padding: 10px 12px;
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  background: var(--success-50);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}
.copy-summary strong { color: var(--success-700); }
.copy-skip { font-size: 12px; color: var(--ink-soft); }
@media (max-width: 620px) {
  .trash-item { flex-wrap: wrap; }
  .trash-item .tw-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .task-menu-panel { animation: none; }
  .undo-toast { transition: none; }
}
.project-title-group{
      width: auto;
    max-width: 50%;
}

/* =====================================================
   DANH SÁCH: TASK CON DẠNG CÂY + HÀNG TIẾN ĐỘ
   ===================================================== */
/* Hàng tiến độ tách khỏi header: trái = tiến độ, phải ngoài cùng = nút "Task con" */
.project-progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: -6px 0 16px;
}
.project-progress-bar .project-progress {
  margin-top: 0;
  flex: 1 1 260px;
  flex-wrap: wrap; /* màn hẹp: nút Tài liệu / Ghi chú xuống dòng thay vì đẩy cả trang lố ngang */
  min-width: 0;
}
/* Nút chỉ có tác dụng ở tab Danh sách nên chỉ hiện ở đó */

/* Dòng trong cây */
.list-tree-name {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: calc(var(--lv, 0) * 22px);
}
.list-tree-text { min-width: 0; overflow-wrap: anywhere; }
/* Task con: dải màu nhạt theo màu nhóm trạng thái (--gc đặt ở .task-list-group), không cố định xanh dương */
.task-table-body-row-v2.is-sub { background: linear-gradient(90deg, color-mix(in srgb, var(--gc, var(--primary)) 12%, transparent), transparent 45%); }
.task-table-body-row-v2.is-sub .task-row-name { font-weight: 500; }
/* Cha chỉ hiện để dẫn đường (không khớp bộ lọc): mờ, chữ nghiêng, nền gạch chéo */
.task-table-body-row-v2.is-guide { background: repeating-linear-gradient(135deg, var(--bg) 0 6px, var(--surface) 6px 12px); }
.task-table-body-row-v2.is-guide .task-cell { opacity: 0.6; }
.task-table-body-row-v2.is-guide .task-cell:last-child { opacity: 1; }
.task-table-body-row-v2.is-guide .list-tree-text { font-style: italic; color: var(--ink-soft); font-weight: 500; }
.list-guide-tag {
  flex: none;
  padding: 0 7px;
  border: 1px dashed var(--muted);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

/* =====================================================
   Ô TÌM VIỆC TRÊN THANH TRÊN CÙNG
   ===================================================== */
.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 300px;
  min-width: 0;
  padding: 0 12px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s, width 0.3s ease, box-shadow 0.2s;
}
.global-search:hover { border-color: var(--primary-100); background: var(--primary-50); }
.global-search:focus-within { width: 380px; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-100); color: var(--primary-600); }
.global-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
}
.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: min(460px, calc(100vw - 32px));
  max-height: min(440px, 70vh);
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: gsDrop 0.2s ease;
}
@keyframes gsDrop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.gs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.gs-item:hover,
.gs-item.is-active { background: var(--primary-50); border-color: var(--primary-100); }
.gs-status { flex: none; }
.gs-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gs-name { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.gs-name mark { padding: 0 1px; border-radius: 3px; background: #fde68a; color: inherit; }
.gs-path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink-soft);
  min-width: 0;
}
.gs-path .project-dot { width: 8px; height: 8px; flex: none; }
.gs-sep { color: var(--muted); }
.gs-empty, .gs-more { padding: 12px; font-size: 13px; color: var(--ink-soft); text-align: center; line-height: 1.5; }
.gs-empty small { color: var(--muted); }
.gs-more { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .global-search, .global-search:focus-within { width: auto; flex: 1 1 160px; }
}
@media (max-width: 620px) {
  .global-search { height: 34px; padding: 0 10px; }
  .global-search-results { position: fixed; top: calc(var(--topbar-h) + 4px); left: 16px; right: 16px; width: auto; }
}

/* =====================================================
   TRANG HÔM NAY: TAB "ĐƯỢC NHẮC ĐẾN"
   ===================================================== */
.mention-list { display: flex; flex-direction: column; gap: 8px; }
.mention-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.mention-item:hover,
.mention-item:focus-visible { border-color: var(--primary-100); border-left-color: var(--primary); background: var(--primary-50); box-shadow: var(--shadow-sm); outline: none; }
/* Chưa xem: nền xanh nhạt + vạch trái xanh đậm để nổi giữa các mục cũ */
.mention-item.is-new { border-left-color: var(--primary-600); background: linear-gradient(90deg, var(--primary-50), var(--surface) 60%); }
.mention-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mention-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.mention-who { font-size: 13.5px; color: var(--ink); }
.mention-new {
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-600);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.mention-time { margin-left: auto; font-size: 12px; color: var(--muted); }
.mention-quote {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}
/* Bình luận được mở từ "Được nhắc đến": nháy nền vàng vài giây để mắt bắt ngay */
.comment-item.is-jump { animation: commentJump 2s ease; border-radius: var(--radius-sm); }
@keyframes commentJump {
  0%, 60% { background: #fef3c7; box-shadow: 0 0 0 2px #fbbf24; }
  100% { background: transparent; box-shadow: 0 0 0 2px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .global-search, .gs-item, .mention-item { transition: none; }
  .global-search-results, .comment-item.is-jump { animation: none; }
  .comment-item.is-jump { background: #fef3c7; }
}

/* =====================================================
   DANH SÁCH: KÉO ĐỔI ĐỘ RỘNG CỘT + TÊN / MÔ TẢ 1 DÒNG
   ===================================================== */
/* Độ rộng dạng tỉ lệ: tổng luôn vừa khung bảng, không thừa khoảng trống bên phải */
.task-list-view.has-col-widths .task-table-row-v2 { grid-template-columns: var(--list-cols); }
.task-list-view .task-table-head-v2 .task-cell { position: relative; padding-right: 10px;padding-left: 10px; }
.task-list-view .task-table-head-v2 .task-cell:last-child { padding-right: 10px; padding-left: 10px; }
.task-list-view .task-table-head-v2 .task-cell:first-child { padding-left: 10px; }
/* Tay nắm ở mép phải tiêu đề = ranh giới 2 cột: vùng bấm 8px, chỉ hiện vạch mảnh 1px đúng ranh giới (kiểu ClickUp) */
.col-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 8px;
  cursor: col-resize;
  touch-action: none;
  z-index: 1;
}
.col-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 1px;
  background: transparent;
  transition: background 0.15s;
}
.col-resizer:hover::after,
.col-resizer:focus-visible::after,
.col-resizer.is-dragging::after { background: var(--ink-soft); }
.col-resizer:focus-visible { outline: none; }
/* Rê tiêu đề cột: nền cả ô đậm lên + hiện vạch ranh giới để thấy độ rộng cột và chỗ kéo. Tab Danh sách / Việc của tôi = xám */
.task-list-view .task-table-head-v2 .task-cell:not(.task-cell-sel):not(.task-cell-menu) { transition: background 0.15s; }
.task-list-view .task-table-head-v2 .task-cell:not(.task-cell-sel):not(.task-cell-menu):hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.task-list-view .task-table-head-v2 .task-cell:hover > .col-resizer::after { background: color-mix(in srgb, var(--ink) 30%, transparent); }
/* Ô tiêu đề cao bằng cả hàng tiêu đề (hàng thường căn giữa nên ô tiêu đề thấp hơn khung) -> nền phủ kín đúng ô */
.task-list-view .task-table-head-v2 { align-items: stretch; }
.task-list-view .task-table-head-v2 .task-cell { align-self: stretch; }
/* Trang Dự án: độ rộng cột kéo được (assignee.js ML_COLS.projects); rê tiêu đề = nền đậm hơn theo màu trạng thái của nhóm */
.pl-table[data-table] .pl-row { grid-template-columns: var(--ml-cols); }
.pl-row-head > .pl-cell:not(.pl-cell-menu) { transition: background 0.15s; }
.pl-group .pl-row-head > .pl-cell:not(.pl-cell-menu):hover { background: color-mix(in srgb, var(--pl-gc, var(--ink)) 16%, transparent); }
.pl-row-head > .pl-cell:hover > .col-resizer::after { background: color-mix(in srgb, var(--pl-gc, var(--ink)) 55%, transparent); }
.pl-row-head .col-resizer:hover::after, .pl-row-head .col-resizer.is-dragging::after { background: var(--pl-gc, var(--ink-soft)); }
/* Đang kéo: cả trang giữ con trỏ kéo, không bôi đen chữ */
body.is-col-resizing,
body.is-col-resizing * { cursor: col-resize !important; user-select: none; }

/* Tên và mô tả chỉ 1 dòng, dài quá thì "…" (kéo rộng cột hoặc rê chuột để xem đủ) */
.task-list-view .task-table-body-row-v2 .task-cell:nth-child(1),
.task-list-view .task-table-body-row-v2 .task-cell:nth-child(2) { white-space: nowrap; }
.task-list-view .task-row-name { white-space: nowrap; overflow: hidden; min-width: 0; }
.task-list-view .list-tree-name { min-width: 0; }
.task-list-view .list-tree-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
}
.task-list-view .task-row-desc { max-width: none; }

/* =====================================================
   ĐỢT 7: CÀI ĐẶT TÀI KHOẢN (settings.js)
   ===================================================== */
/* Thanh bên đi theo màn hình: cao đúng 1 màn hình, dính ở mép trên khi cuộn trang.
   Nội dung dài (nhiều dự án) thì cuộn bên trong thanh bên, còn mục Cài đặt luôn ghim ở đáy.
   (Điện thoại: responsive-zoom.css đổi thanh bên thành ngăn kéo position: fixed, quy tắc ghim đáy vẫn dùng được.) */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.sidebar-nav-box { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
/* Thanh cuộn thanh bên mảnh 4px, màu viền (--border). Chrome / Edge / Safari dùng ::-webkit-scrollbar
   (đặt scrollbar-width cho chúng sẽ làm Chrome bỏ qua kiểu này nên chỉ dùng cho trình duyệt không hỗ trợ, vd Firefox: "thin" là mảnh nhất) */

/* 2 mũi tên trên / dưới: đã tự tạo kiểu thanh cuộn thì trình duyệt bỏ mũi tên mặc định nên vẽ lại bằng SVG.
   Ảnh SVG không đọc được biến CSS nên màu ghi thẳng = --border (#e2e8f0); đổi --border thì đổi cả 2 chỗ fill bên dưới. */
.sidebar-nav-box::-webkit-scrollbar-button:single-button:vertical { display: block; height: 8px; background-color: transparent; background-repeat: no-repeat; background-position: center; background-size: 4px 3px; }
.sidebar-nav-box::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 6'%3E%3Cpath d='M4 0 8 6H0z' fill='%23e2e8f0'/%3E%3C/svg%3E"); }
.sidebar-nav-box::-webkit-scrollbar-button:single-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 6'%3E%3Cpath d='M0 0h8L4 6z' fill='%23e2e8f0'/%3E%3C/svg%3E"); }
@supports not selector(::-webkit-scrollbar) {
  .sidebar-nav-box { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
}
.sidebar-bottom {
  flex: none;
  z-index: 2;
  margin-top: auto !important;
  padding: 10px 14px 14px !important;
  border-top: 1px solid var(--border-soft) !important;
  background: var(--surface);
  box-shadow: 0 -8px 12px -10px rgba(15, 23, 42, 0.18);
}

.set-tabs .tw-tab svg { flex: none; }
/* Nhiều tab (Hồ sơ … Ngày nghỉ … Tính năng): màn hình hẹp thì cuộn ngang trong hàng tab, không làm tràn trang */
.set-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.set-tabs .tw-tab { flex: none; white-space: nowrap; }
.set-body { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.set-card {
  padding: 20px 22px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--surface);
      box-shadow: inset 0 3px 8px rgba(15, 23, 42, 0.10), inset 0 1px 2px rgba(15, 23, 42, 0.08), inset 0 -1px 0 rgba(255, 255, 255, 0.9);
}
.set-card-flush { padding: 6px; }
.set-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; color: var(--ink); }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; margin-top: 16px; }
.set-grid-narrow { grid-template-columns: minmax(0, 420px); margin-top: 0; }
.set-readonly { background: var(--bg); color: var(--ink-soft); cursor: not-allowed; }
.set-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.set-footer > .btn-secondary:first-child { margin-right: auto; }
.set-msg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.set-msg:empty { display: none; }
.set-msg.is-ok { color: var(--success-700); }
.set-msg.is-bad { color: var(--danger-600); }
.set-save { min-width: 140px; justify-content: center; }
.set-save:disabled { opacity: 0.7; cursor: wait; }
.set-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: setSpin 0.8s linear infinite;
}
@keyframes setSpin { to { transform: rotate(360deg); } }

/* Hồ sơ: avatar xem trước */
.set-avatar-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.set-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 0 0 4px var(--primary-50);
  transition: box-shadow 0.3s;
}
.set-avatar.is-new { box-shadow: 0 0 0 4px #fde68a; }
.set-avatar img { width: 100%; height: 100%; object-fit: cover; }
.set-avatar-side { flex: 1; min-width: 220px; }
.set-avatar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.set-btn-blue { color: var(--primary-600); border-color: var(--primary-100); background: var(--primary-50); transition: background 0.2s, border-color 0.2s; cursor: pointer; }
.set-btn-blue:hover { background: var(--primary-100); border-color: var(--primary); }
.set-btn-danger { color: var(--danger-600); border-color: var(--danger-100); background: var(--danger-50); transition: background 0.2s, border-color 0.2s; }
.set-btn-danger:hover { background: var(--danger-100); border-color: var(--danger); }
.set-pending { padding: 2px 9px; border-radius: var(--radius-pill); background: #fef3c7; color: var(--warning-700); font-size: 12px; font-weight: 700; }
.set-pending.is-remove { background: var(--danger-50); color: var(--danger-600); }

/* Bảo mật */
.set-methods { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.set-methods li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg); font-size: 13.5px; color: var(--ink); }
.set-methods code { padding: 1px 6px; border-radius: 6px; background: var(--surface); font-size: 12.5px; }
.set-method-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; }
.set-method-icon.is-pw { background: var(--primary-100); color: var(--primary-600); }
.set-method-icon.is-google { background: #fff; color: #ea4335; border: 1px solid var(--border); }
.set-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.set-check.is-locked { color: var(--ink-soft); cursor: default; }
.set-note { display: flex; align-items: flex-start; gap: 6px; margin: 12px 0 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.set-note svg { flex: none; margin-top: 2px; color: var(--muted); }
.set-info { padding: 14px 16px; border-radius: var(--radius-md); background: var(--primary-50); border: 1px solid var(--primary-100); font-size: 13.5px; color: var(--ink); line-height: 1.55; }
.set-info.is-warn { background: var(--warning-50); border-color: #fde68a; color: var(--warning-700); }

/* Thông báo: nhóm thu gọn được + bảng Sự kiện / Trong ứng dụng / Email */
.set-group + .set-group { border-top: 1px solid var(--border-soft); }
.set-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}
.set-group-head:hover { background: var(--bg); }
.set-group-caret { transform: rotate(180deg); transition: transform 0.3s ease; color: var(--muted); }
.set-group.is-open .set-group-caret { transform: rotate(-90deg); }
.set-group-count { margin-left: auto; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--primary-50); color: var(--primary-600); font-size: 11.5px; font-weight: 700; }
.set-group-binh_luan .set-group-count { background: #f3e8ff; color: #7c3aed; }
.set-group-lich_nhac .set-group-count { background: var(--warning-50); color: var(--warning-700); }
.set-group-body { display: none; padding: 0 8px 12px; }
.set-group.is-open .set-group-body { display: block; animation: setOpen 0.3s ease; }
@keyframes setOpen { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.set-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 90px;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.set-row:not(.set-row-head):hover { background: var(--bg); }
.set-row-head { padding-top: 4px; padding-bottom: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.set-row > span:not(.set-event) { justify-self: center; }
.set-event { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-event strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.set-event small { font-size: 12px; color: var(--muted); }
/* Công tắc giống hệt công tắc "Nhật ký" ở mục Hoạt động (.auto-switch). Ở đây nó là <label> đứng riêng
   trong ô bảng nên phải tự là khối inline-block, không thì trình duyệt bỏ qua kích thước 36×20 và công tắc bị méo. */
.set-switch { display: inline-block; vertical-align: middle; cursor: pointer; }
.set-switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-100); }
.set-switch input:disabled + span { opacity: 0.45; cursor: not-allowed; }

/* Lịch nhắc */
.set-reminders { margin: 8px 2px 0; padding: 14px 14px 4px; border-radius: var(--radius-md); background: var(--warning-50); border: 1px solid #fde68a; }
.set-rem-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 14px; padding-bottom: 12px; }
.set-rem-label { font-size: 13px; font-weight: 700; color: var(--warning-700); padding-top: 6px; }
.set-rem-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.set-rem-opts .form-hint { flex-basis: 100%; margin: 0; }
.set-seg { gap: 0; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); padding: 3px; flex-wrap: nowrap; width: max-content; max-width: 100%; }
.set-seg-item { padding: 6px 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; transition: background 0.2s, color 0.2s; }
.set-seg-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.set-seg-item:hover { background: var(--bg); color: var(--ink); }
.set-seg-item.is-on { background: var(--warning); color: #fff; }
.set-seg-item:focus-within { box-shadow: 0 0 0 3px #fde68a; }
.set-time-field { margin: 0; }
.set-time-field .form-control { width: 130px; }

.set-digest { display: flex; align-items: center; gap: 18px; }
.set-digest-text { flex: 1; }
.set-digest-text p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.set-digest .set-title { margin-bottom: 4px; }
.set-shortcut { cursor: pointer; }

/* Menu @: tiêu đề 2 nhóm Thành viên / Nhóm chuyên môn */
.mention-group-title { padding: 6px 10px 3px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.mention-group-title:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--border-soft); padding-top: 8px; }

/* Điện thoại: mỗi sự kiện là 1 thẻ với 2 công tắc có nhãn */
@media (max-width: 640px) {
  .set-card { padding: 16px; }
  .set-card-flush { padding: 4px; }
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .set-row-head { display: none; }
  .set-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-soft);
    background: var(--surface);
  }
  .set-event { grid-column: 1 / -1; }
  .set-row > span:not(.set-event) {
    justify-self: stretch;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg);
  }
  .set-row > span:not(.set-event)::before { content: attr(data-label); font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
  .set-rem-row { grid-template-columns: 1fr; }
  .set-rem-label { padding-top: 0; }
  .set-seg { width: 100%; }
  .set-seg-item { flex: 1; text-align: center; padding: 7px 6px; }
  .set-footer { justify-content: stretch; }
  .set-footer .btn-primary, .set-footer .btn-secondary { flex: 1 1 auto; justify-content: center; }
  .set-digest { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .set-group-caret, .set-group.is-open .set-group-body, .set-spinner { transition: none; animation: none; }
}

/* =====================================================
   DANH SÁCH: NÚT ĐẦU NHÓM (con mắt ẩn / hiện cột + thêm việc)
   ===================================================== */
.list-head-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
/* Mặc định nền trắng, icon màu đặc trưng của nhóm (--c). Rê vào: đảo màu + bóng nhẹ cùng màu */
.task-list-group-head .list-head-btn {
  position: relative;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.task-list-group-head .list-head-btn:hover,
.task-list-group-head .list-head-btn:focus-visible,
.task-list-group-head .list-head-btn[aria-expanded="true"] {
  background: var(--c);
  color: #fff;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--c) 40%, transparent);
  outline: none;
}
.task-list-group-head .list-head-btn:active { transform: scale(0.94); }
/* Số cột đang ẩn: chấm nhỏ trên góc con mắt để nhớ là có cột bị ẩn */
.list-col-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: var(--radius-pill);
  background: var(--c);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
}
.list-col-picker { position: relative; }
.list-col-panel {
  display: block;
  right: 0;
  left: auto;
  width: 230px;
  max-width: calc(100vw - 32px);
  z-index: 30;
}
.list-col-panel .role-filter-panel-head { display: flex; align-items: center; justify-content: space-between; }
.list-col-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.list-col-item:hover,
.list-col-item:focus-visible { background: var(--bg); color: var(--ink); outline: none; }
.list-col-item.is-on { color: var(--ink); font-weight: 600; }
/* Ô tích: tắt = viền xám trống, bật = nền xanh lá + dấu tích trắng */
.list-col-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.list-col-item.is-on .list-col-check { background: var(--success); border-color: var(--success); color: #fff; }
.list-col-item:hover .list-col-check { border-color: var(--success); }
.list-col-icon { flex: none; color: var(--muted); }
.list-col-item.is-on .list-col-icon { color: var(--primary-600); }
@media (prefers-reduced-motion: reduce) {
  .task-list-group-head .list-head-btn, .list-col-item, .list-col-check { transition: none; }
}

/* =====================================================
   ĐỢT 8: CÔNG VIỆC LẶP LẠI (recurring.js)
   ===================================================== */
/* Dòng "↻ Mỗi thứ Sáu · Lượt tiếp theo: ..." gần hạn hoàn thành */
.rec-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin: 2px 0 6px;
  padding: 3px 10px;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-pill);
  background: #f5f3ff;
  color: #6d28d9;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: normal;
  cursor: default;
}
button.rec-line { cursor: pointer; transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; }
button.rec-line:hover, button.rec-line:focus-visible { background: #ede9fe; border-color: #a78bfa; box-shadow: 0 3px 8px rgba(124, 58, 237, 0.18); outline: none; }
.rec-line.is-paused { background: var(--bg); border-color: var(--border); color: var(--ink-soft); }
.rec-line.is-attention { background: var(--warning-50); border-color: #fde68a; color: var(--warning-700); }
/* Bảng nhỏ: bong bóng chat dính ngoài mép trái, ngang tên việc. Rộng hơn cao ~20%, nền tím trong suốt, chữ tím,
   đuôi nhọn chỉ vào bảng. Hiện chữ luôn, không cần rê chuột. */
.rec-badge {
  position: absolute;
  left: -208px;
  top: 66px; /* JS căn lại theo ô tên việc */
  z-index: 3;
  box-sizing: border-box;
  width: 200px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #ddd6fe;
  border-radius: 14px;
  background: rgba(66, 47, 161, 0.147);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #6d28d9;
  font: inherit;
  text-align: left;
  box-shadow: 0 6px 18px rgba(76, 29, 149, 0.18);
  cursor: default;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
/* Đuôi bong bóng: tam giác viền tím + lõi cùng màu nền, chỉ sang phải (vào tên việc) */
.rec-badge::before,
.rec-badge::after {
  content: "";
  position: absolute;
  top: 50%;
  border-style: solid;
  transform: translateY(-50%);
}
.rec-badge::before { right: -9px; border-width: 9px 0 9px 9px; border-color: transparent transparent transparent #ddd6fe; }
.rec-badge::after { right: -7px; border-width: 8px 0 8px 8px; border-color: transparent transparent transparent rgba(66, 47, 161, 0.147); }
button.rec-badge { cursor: pointer; }
button.rec-badge:hover, button.rec-badge:focus-visible {border-color: #a78bfa; box-shadow: 0 8px 22px rgba(124, 58, 237, 0.28); outline: none; transform: translateX(-2px); }
button.rec-badge:hover::before, button.rec-badge:focus-visible::before { border-left-color: #a78bfa; }
.rec-badge-rule { display: flex; align-items: flex-start; gap: 5px; font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.rec-badge-rule svg { flex: none; margin-top: 1px; }
.rec-badge-next { font-size: 12px; font-weight: 600; line-height: 1.35; opacity: 0.85; }
.rec-badge.is-paused { background: rgba(246, 248, 251, 0.95); border-color: var(--border); color: var(--ink-soft); }
.rec-badge.is-paused::before { border-left-color: var(--border); }
.rec-badge.is-attention { background: rgba(255, 251, 234, 0.95); border-color: #fde68a; color: var(--warning-700); }
.rec-badge.is-attention::before { border-left-color: #fde68a; }
.rec-line-mobile { display: none; }
/* Chi tiết rộng: dòng bo tròn dưới Mô tả, trên Task con */
.wide-rec { margin: 2px 0 14px; }
.wide-rec .rec-line { margin: 0; }

/* Hộp thoại: thân cuộn, nút Lưu dính đáy */
.rec-modal-box { width: 55vw; max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.rec-modal-body { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 0 !important; }
.rec-form { display: flex; flex-direction: column; gap: 14px; padding-bottom: 14px; }
.rec-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rec-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.rec-mode input { position: absolute; opacity: 0; pointer-events: none; }
.rec-mode:hover { border-color: #c4b5fd; background: #faf5ff; }
.rec-mode.is-on { border-color: #8b5cf6; background: #f5f3ff; box-shadow: 0 0 0 3px #ede9fe; }
.rec-mode:focus-within { box-shadow: 0 0 0 3px #ddd6fe; }
.rec-mode-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.rec-mode.is-on .rec-mode-title { color: #6d28d9; }
.rec-mode-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.rec-section { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg); }
.rec-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 6px 12px; }
.rec-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.rec-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rec-inline .form-hint { margin: 0; }
.rec-stack { display: flex; flex-direction: column; gap: 6px; }
.rec-num .form-control { width: 84px; }
.rec-unit, .rec-mday { width: auto; min-width: 90px; }
.rec-row .form-field, .rec-inline-field { margin: 0; }
.rec-inline-field { display: inline-block; }
.rec-inline-field .form-control { display: inline-block; width: auto; }
.rec-radio { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.rec-radio input[type="radio"] { accent-color: #7c3aed; }
.rec-days { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-day {
  min-width: 40px;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.rec-day:hover { border-color: #a78bfa; color: #6d28d9; }
.rec-day.is-on { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.rec-grid { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 4px 12px; }
.rec-grid .form-field { margin: 0; }
.rec-hint-time { margin: 0; }
.rec-content { border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--surface); }
.rec-content > summary {
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition: background 0.2s;
}
.rec-content > summary::-webkit-details-marker { display: none; }
.rec-content > summary::before { content: "▸ "; color: #7c3aed; display: inline-block; transition: transform 0.3s; }
.rec-content[open] > summary::before { transform: rotate(90deg); }
.rec-content > summary:hover { background: var(--bg); }
.rec-content > summary small { font-weight: 500; color: var(--muted); }
.rec-content-body { padding: 4px 14px 14px; }
.rec-people { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.rec-person input { position: absolute; opacity: 0; width: 0; height: 0; }
.rec-person .avatar { width: 22px; height: 22px; font-size: 10px; }
.rec-person:hover { border-color: var(--primary); }
.rec-person.is-on { background: var(--primary-50); border-color: var(--primary); color: var(--primary-600); font-weight: 600; }
.rec-person:focus-within { box-shadow: 0 0 0 3px var(--primary-100); }
.rec-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* Xem trước */
.rec-preview { padding: 12px 14px; border: 1px dashed #c4b5fd; border-radius: var(--radius-md); background: #faf5ff; font-size: 13px; color: var(--ink); }
.rec-preview-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #6d28d9; margin-bottom: 6px; }
.rec-preview-next { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.rec-preview-next b { padding: 1px 8px; border-radius: var(--radius-pill); background: #fff; border: 1px solid #ddd6fe; font-weight: 700; }
.rec-preview-due { color: var(--ink-soft); }
.rec-preview-kids { margin-top: 6px; }
.rec-preview-kids ul { margin: 4px 0 0; padding: 0; list-style: none; }
.rec-preview-kids li { padding-left: calc(var(--lv) * 14px); color: var(--ink-soft); }
.rec-preview-notes { margin: 8px 0 0; padding-left: 18px; color: var(--warning-700); }
.rec-preview-err { margin: 0; color: var(--danger-600); font-weight: 600; }
.rec-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 -20px; /* bù padding 20px của .modal-body để thanh nút tràn hết bề ngang */
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  box-shadow: 0 -8px 14px -12px rgba(15, 23, 42, 0.25);
}
.rec-footer .set-msg { margin-right: auto; }
.rec-footer .btn-primary { min-width: 130px; justify-content: center; background: #7c3aed; border-color: #7c3aed; }
.rec-footer .btn-primary:hover:not(:disabled) { background: #6d28d9; box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); }
.rec-footer .btn-primary:disabled { opacity: 0.7; cursor: wait; }
.rec-footer .btn-primary { display: inline-flex; align-items: center; gap: 6px; }
/* Hộp Thêm / Sao chép vai trò: nút Tạo vai trò xanh chủ đạo (chân hộp dùng chung .rec-footer tím của Việc lặp lại) */
#modal-role .rec-footer .btn-primary { background: var(--primary); border-color: var(--primary); }
#modal-role .rec-footer .btn-primary:hover:not(:disabled) { background: var(--primary-600); border-color: var(--primary-600); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent); }

/* Thiết lập lặp lại — giao diện thẻ (10/2026): đầu có icon + mô tả, mỗi nhóm 1 thẻ có icon tiêu đề, thẻ kiểu lặp có dấu tick */
/* Khung: đủ chỗ cho thẻ 2 cột (.modal-box chung giới hạn 480px), bo đủ 4 góc (overflow cắt cả thanh nút đáy + thanh cuộn theo góc bo) */
.rec-modal-box { width: 100%; max-width: 680px; border-radius: 20px; overflow: hidden; }
/* Lề đều 24px cho đầu / thân / chân (thanh nút đáy dùng lề âm đúng bằng lề thân để tràn hết bề ngang) */
#modal-recurring .rec-modal-head { padding: 20px 24px 16px; }
.rec-modal-body { overflow-x: hidden; padding: 18px 24px 0 !important; }
/* Thanh cuộn mảnh màu xám (không mũi tên): hộp thoại lặp lại + cột Bình luận / Nhật ký / Thời gian của chi tiết việc + bảng chi tiết nhỏ */
.rec-modal-body, .wide-activity-list, .wide-log-list, .wide-side-pane.is-time, #task-detail-overlay .dq-body {
  scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
:is(.rec-modal-body, .wide-activity-list, .wide-log-list, .wide-side-pane.is-time, #task-detail-overlay .dq-body)::-webkit-scrollbar { width: 6px; height: 6px; }
:is(.rec-modal-body, .wide-activity-list, .wide-log-list, .wide-side-pane.is-time, #task-detail-overlay .dq-body)::-webkit-scrollbar-track { background: transparent; }
:is(.rec-modal-body, .wide-activity-list, .wide-log-list, .wide-side-pane.is-time, #task-detail-overlay .dq-body)::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; }
:is(.rec-modal-body, .wide-activity-list, .wide-log-list, .wide-side-pane.is-time, #task-detail-overlay .dq-body)::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
:is(.rec-modal-body, .wide-activity-list, .wide-log-list, .wide-side-pane.is-time, #task-detail-overlay .dq-body)::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
#modal-recurring .rec-footer { margin: 0 -24px; padding: 14px 24px 18px; }
#modal-recurring .rec-form { gap: 16px; padding-bottom: 18px; }
.rec-footer .btn-secondary { min-width: 96px; justify-content: center; }
.rec-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); }
.rec-grid .form-control { width: 100%; min-width: 0; }
.rec-modal-head { align-items: flex-start; gap: 12px; }
.rec-head-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe); color: #7c3aed; }
.rec-head-text { flex: 1; min-width: 0; }
.rec-head-text h2 { margin: 0; }
.rec-head-text p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.rec-mode { flex-direction: row; align-items: flex-start; gap: 12px; padding: 14px 40px 14px 14px; }
.rec-mode-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg); color: var(--ink-soft); }
.rec-mode.is-on .rec-mode-ico { background: #ede9fe; color: #7c3aed; }
.rec-mode-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rec-mode-check { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border); color: transparent; }
.rec-mode.is-on .rec-mode-check { border-color: #7c3aed; background: #7c3aed; color: #fff; }
.rec-card { padding: 14px 16px; border: 1px solid var(--border-soft); background: color-mix(in srgb, #8b5cf6 3%, var(--surface)); }
.rec-card.is-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; align-items: start; }
.rec-card .rec-row { grid-template-columns: 1fr; gap: 8px; }
.rec-card-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.rec-card-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: #ede9fe; color: #7c3aed; }
.rec-day { min-width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 12.5px; }
.rec-days { gap: 5px; }
#modal-recurring .rec-flabel { display: flex; flex-direction: row; align-items: center; gap: 6px; }
#modal-recurring .rec-flabel svg { flex: none; }
.rec-flabel svg { color: #7c3aed; }
.rec-hint-time { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--primary-50); color: var(--ink-soft); font-size: 12.5px; }
.rec-hint-time svg { flex: none; color: var(--primary-600); }
.rec-content > summary { display: flex; align-items: center; gap: 8px; }
.rec-content > summary::before { order: 3; margin-left: auto; content: "▸"; }
.rec-preview { border-style: solid; border-color: #ddd6fe; }
@media (max-width: 640px) {
  .rec-card.is-split { grid-template-columns: 1fr; }
  .rec-modes { grid-template-columns: 1fr; }
  #modal-recurring .rec-modal-head { padding: 16px 18px 12px; }
  .rec-modal-body { padding: 14px 16px 0 !important; }
  #modal-recurring .rec-footer { margin: 0 -16px; padding: 12px 16px 14px; }
}

/* Tự động hóa › Công việc lặp lại */
.rec-manage { margin: 4px 0 22px; }
.rec-manage-head h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 16px; color: #6d28d9; }
.rec-manage-head p { margin: 0 0 12px; font-size: 13px; color: var(--ink-soft); }
.auto-rules-title { margin: 6px 0 10px; font-size: 16px; color: var(--ink); }
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-left: 4px solid #8b5cf6;
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.rec-item:hover { box-shadow: var(--shadow-sm); border-color: #ddd6fe; border-left-color: #7c3aed; }
.rec-item.is-paused { border-left-color: var(--muted); }
.rec-item.is-ended { border-left-color: var(--border); opacity: 0.75; }
.rec-item.is-attention { border-left-color: var(--warning); background: linear-gradient(90deg, var(--warning-50), var(--surface) 50%); }
.rec-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rec-item-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.rec-item-name { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); text-align: left; }
button.rec-item-name { cursor: pointer; }
button.rec-item-name:hover { color: #6d28d9; text-decoration: underline; }
.rec-status { padding: 1px 9px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; }
.rec-status.is-active { background: var(--success-50); color: var(--success-700); }
.rec-status.is-paused { background: var(--bg); color: var(--ink-soft); }
.rec-status.is-ended { background: var(--bg); color: var(--muted); }
.rec-status.is-attention { background: #fef3c7; color: var(--warning-700); }
.rec-legacy { padding: 1px 8px; border: 1px dashed var(--muted); border-radius: var(--radius-pill); font-size: 11px; color: var(--muted); }
.rec-item-rule { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.rec-item-rule .project-dot { width: 8px; height: 8px; }
.rec-item-next { font-size: 12.5px; font-weight: 600; color: #6d28d9; }
.rec-item.is-paused .rec-item-next, .rec-item.is-ended .rec-item-next { color: var(--muted); }
.rec-missed { color: var(--warning-700); }
.rec-item-note { font-size: 12.5px; color: var(--warning-700); }
.rec-runs-btn { align-self: flex-start; font-size: 12.5px; }
.rec-runs { margin: 4px 0 0; padding: 8px 10px; list-style: none; border-radius: var(--radius-sm); background: var(--bg); font-size: 12.5px; }
.rec-runs li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 0; }
.rec-runs li > span:first-child { min-width: 112px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec-runs li.is-missed { color: var(--warning-700); }
.rec-runs em { font-style: normal; font-weight: 700; font-size: 11.5px; }
.rec-item-side { display: flex; align-items: center; gap: 10px; }
.rec-noone { font-size: 12px; color: var(--warning-700); }

@media (max-width: 640px) {
  /* Điện thoại: form gần toàn màn hình, nội dung cuộn, nút Lưu luôn thấy ở đáy */
  .rec-modal-box { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .rec-modes { grid-template-columns: 1fr; }
  .rec-row { grid-template-columns: 1fr; }
  .rec-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; } /* ô ngày / giờ của trình duyệt có bề rộng tối thiểu riêng -> mỗi ô 1 dòng */
  .rec-footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .rec-footer .btn-primary, .rec-footer .btn-secondary { flex: 1 1 auto; justify-content: center; }
  .rec-footer .set-msg { flex-basis: 100%; }
  .rec-item { flex-direction: column; }
  .rec-item-side { align-self: stretch; justify-content: space-between; }
  .rec-badge { display: none; } /* điện thoại: bảng chiếm hết bề ngang, không có chỗ bên ngoài */
  .rec-line-mobile { display: block; margin-bottom: 8px; }
  .rec-line-mobile .rec-line { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rec-mode, .rec-day, .rec-person, .rec-item, button.rec-line, .rec-content > summary::before { transition: none; }
}

/* =====================================================
   ĐỢT 9: CHỌN NHIỀU + THAO TÁC HÀNG LOẠT + CSV (bulk.js)
   ===================================================== */
.list-more .task-menu-panel { right: 0; left: auto; min-width: 170px; }

/* Ô chọn đầu dòng */
.task-list-view .task-cell-sel { display: flex; align-items: center; justify-content: center; padding-left: 0 !important; padding-right: 6px !important; cursor: pointer; }
.task-cell-sel input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary-600); cursor: pointer; }
.task-cell-sel input:disabled { cursor: not-allowed; opacity: 0.4; }
.task-table-body-row-v2.is-selected { background: var(--primary-50) !important; box-shadow: inset 3px 0 0 var(--primary); }
.task-table-body-row-v2.is-selected:hover { background: var(--primary-100) !important; }

/* Thanh thao tác: chỉ hiện khi có lựa chọn; trang chừa chỗ để không che hàng cuối */
body.has-bulk-bar .page-content { padding-bottom: 120px; }
.bulk-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 70;
  transform: translateX(-50%);
  width: min(960px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: bulkIn 0.25s ease;
}
@keyframes bulkIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* Tông xanh nhạt (nền xanh nhạt, chữ xanh đậm, nút trắng) dùng chung cho chọn nhiều việc và chọn nhiều người */
.bulk-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-lg);
  background: var(--primary-50);
  color: #0369a1;
  box-shadow: var(--shadow-lg);
}
.bulk-count { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; white-space: nowrap; }
.bulk-count b { color: #0369a1; font-size: 15px; }
.bulk-count .set-spinner { border-color: var(--primary-100); border-top-color: #0369a1; } /* nền sáng: vòng xoay trắng mặc định sẽ không thấy */
.bulk-actions { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.bulk-actions::-webkit-scrollbar { display: none; }
.bulk-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.bulk-btn:hover:not(:disabled), .bulk-btn.is-open { border-color: var(--primary); background: var(--primary); color: #fff; }
.bulk-btn.is-danger { border-color: var(--danger-100); background: var(--danger-50); color: var(--danger-600); }
.bulk-btn.is-danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger); color: #fff; }
.bulk-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Ô chọn trong thanh (vd Thêm vào nhóm / Thêm vai trò): cùng dáng nút */
.bulk-select { flex: none; padding: 7px 11px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.bulk-select:hover:not(:disabled) { border-color: var(--primary); }
.bulk-select:disabled { opacity: 0.45; cursor: not-allowed; }
.bulk-clear { flex: none; padding: 7px 10px; border: 0; border-radius: var(--radius-pill); background: transparent; color: #0369a1; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.bulk-clear:hover:not(:disabled) { background: var(--surface); }
/* Ô bật lên phía trên thanh */
.bulk-pop, .bulk-result {
  align-self: center;
  width: min(520px, 100%);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.bulk-note { margin: 6px 0 0; font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
.bulk-seg { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); background: var(--bg); }
.bulk-seg button { padding: 5px 14px; border: 0; border-radius: var(--radius-pill); background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.bulk-seg button.is-on { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }
.bulk-people { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto; margin-top: 8px; }
.bulk-pop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.bulk-options { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-opt { padding: 4px; border: 1px solid transparent; border-radius: var(--radius-pill); background: transparent; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.bulk-opt:hover { border-color: var(--border); background: var(--bg); }
.bulk-due .form-control { max-width: 200px; }
.bulk-result.is-ok { border-color: var(--success); background: var(--success-50); }
.bulk-result.is-partial { border-color: #fde68a; background: var(--warning-50); }
.bulk-result.is-bad { border-color: var(--danger-100); background: var(--danger-50); }
.bulk-result-head { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.5; }
.bulk-result-close { margin-left: auto; width: 24px; height: 24px; border: 0; flex: none; }
.bulk-fails { margin: 6px 0 0; padding-left: 18px; max-height: 160px; overflow-y: auto; font-size: 12.5px; color: var(--ink-soft); }
.bulk-fails li { margin: 2px 0; }

/* Hộp thoại CSV */
.csv-modal-box { width: min(760px, calc(100vw - 32px)); }
.csv-steps { display: flex; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: s; }
.csv-steps li { flex: 1; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--bg); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.csv-steps li span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--border); color: #fff; font-size: 11px; }
.csv-steps li.is-now { background: var(--primary-50); color: var(--primary-600); }
.csv-steps li.is-now span { background: var(--primary-600); }
.csv-steps li.is-done { color: var(--success-700); }
.csv-steps li.is-done span { background: var(--success); }
.csv-body { display: flex; flex-direction: column; gap: 12px; padding-bottom: 14px; }
.csv-rules { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.csv-file-row { display: flex; flex-wrap: wrap; gap: 10px; }
.csv-pick { cursor: pointer; }
.csv-scope { display: grid; gap: 10px; margin-bottom: 12px; }
.csv-format { margin-bottom: 12px; }
.rec-mode.is-disabled { opacity: 0.55; cursor: not-allowed; }
.csv-map { display: flex; flex-direction: column; gap: 8px; }
.csv-map-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 4px 12px; font-size: 13.5px; font-weight: 600; }
.csv-req { color: var(--danger-600); }
.csv-sample { grid-column: 2; font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csv-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.csv-stat { padding: 4px 12px; border-radius: var(--radius-pill); background: var(--bg); font-size: 13px; color: var(--ink-soft); }
.csv-stat.is-ok { background: var(--success-50); color: var(--success-700); }
.csv-stat.is-bad { background: var(--danger-50); color: var(--danger-600); }
.csv-stat.is-warn { background: var(--warning-50); color: var(--warning-700); }
.csv-h { margin: 4px 0 0; font-size: 13.5px; color: var(--ink); }
.csv-table { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); max-height: 260px; overflow: auto; font-size: 12.5px; }
.csv-tr { display: grid; grid-template-columns: 56px 150px minmax(0, 1fr); gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border-soft); }
.csv-tr-ok { grid-template-columns: 56px minmax(0, 1.6fr) 90px 170px minmax(0, 1fr); align-items: center; }
.csv-th { position: sticky; top: 0; background: var(--bg); font-weight: 700; color: var(--muted); }
.csv-tr.is-bad span:first-child { font-weight: 700; color: var(--danger-600); }
.csv-warns { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--warning-700); max-height: 120px; overflow-y: auto; }
.csv-only { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-50); }
.csv-created { margin: 0; padding-left: 18px; max-height: 260px; overflow-y: auto; font-size: 13px; }

@media (max-width: 640px) {
  /* Điện thoại: thanh gọn sát đáy, chỉ còn icon, cuộn ngang; trang chừa chỗ để không che hàng cuối */
  .bulk-bar { bottom: 8px; width: calc(100vw - 16px); }
  .bulk-main { padding: 6px 6px 6px 12px; gap: 6px; }
  .bulk-btn span { display: none; }
  .bulk-btn { padding: 8px; }
  .bulk-count { font-size: 12.5px; }
  body.has-bulk-bar .page-content,
  body.has-ml-bulk-bar .page-content { padding-bottom: 96px; }
  .csv-map-row { grid-template-columns: 1fr; }
  .csv-sample { grid-column: 1; }
  .csv-tr-ok { grid-template-columns: 44px minmax(0, 1fr) 80px; }
  .csv-tr-ok span:nth-child(4), .csv-tr-ok span:nth-child(5) { display: none; }
  .csv-steps li { font-size: 0; justify-content: center; }
  .csv-steps li span { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .bulk-bar { animation: none; }
  .bulk-btn, .bulk-opt { transition: none; }
}

/* =====================================================
   ĐỢT 10: BÁO CÁO — TAB, PHẠM VI, KỲ, BẤM SỐ ĐỂ XEM DANH SÁCH (reports.js)
   Giữ thẻ / biểu đồ / bảng cũ, chỉ thêm khả năng bấm và các khối mới.
   ===================================================== */
.report-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 6px; }
.report-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-filters .form-control { width: auto; }
/* Chiều cao ô chọn / nút: xem --toolbar-h (khối "Chiều cao chung của mọi thanh công cụ") */
.report-filters .form-control { font-size: 13px; }
.report-custom { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.report-custom.has-error .form-control { border-color: var(--danger); }
.report-spin { border-color: rgba(14, 165, 233, 0.3); border-top-color: var(--primary-600); }
.report-rules { margin: 0 0 16px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.report-warn { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warning-50); font-size: 12.5px; color: var(--warning-700); }
.report-body.is-stale { opacity: 0.6; transition: opacity 0.2s; }
.report-empty { margin: 4px 0; font-size: 13px; color: var(--muted); }
.report-muted { font-size: 12.5px; color: var(--muted); }

/* Thẻ / dòng trạng thái / cột tuần: bấm được, giữ nguyên hình cũ */
button.report-tile { font: inherit; text-align: left; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
button.report-tile:hover, button.report-tile:focus-visible { border-color: var(--primary); box-shadow: 0 6px 16px rgba(14, 165, 233, 0.15); transform: translateY(-1px); outline: none; }
button.report-tile.is-alert:hover { border-color: var(--danger); box-shadow: 0 6px 16px rgba(225, 29, 72, 0.15); }
button.report-bar-row { width: calc(100% + 12px); padding: 4px 6px; margin: 0 -6px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; text-align: left; cursor: pointer; transition: background 0.2s; box-sizing: border-box; }
button.report-bar-row:hover, button.report-bar-row:focus-visible { background: var(--bg); outline: none; }
button.report-week-col { padding: 0; border: 0; background: transparent; font: inherit; cursor: pointer; }
button.report-week-col:focus-visible .report-week-bar { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Số bấm được trong bảng */
.report-num { min-width: 30px; padding: 2px 8px; border: 1px solid transparent; border-radius: var(--radius-pill); background: var(--primary-50); color: var(--primary-600); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.report-num:hover, .report-num:focus-visible { border-color: var(--primary); background: var(--primary-100); outline: none; }
.report-num.is-alert { background: var(--danger-50); color: var(--danger-600); }
.report-num.is-alert:hover { border-color: var(--danger); background: var(--danger-100); }
.report-num.is-zero { background: none; color: var(--muted); font-weight: 500; cursor: default; }
.report-proj { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.report-proj .project-dot { width: 10px; height: 10px; }
.report-unassigned td { background: var(--warning-50); }
.report-sort { padding: 0; border: 0; background: none; font: inherit; font-weight: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.report-sort:hover, .report-sort.is-on { color: var(--primary-600); }

/* Cần xử lý: 4 nhóm, mỗi nhóm 5 việc */
.report-attention { display: flex; flex-direction: column; gap: 12px; } /* mỗi nhóm 1 hàng dài hết bề ngang */
.report-att-title { display: flex; align-items: center; gap: 8px; }
.report-att-card.is-closed .report-att-title { margin-bottom: 0; }
/* Mỗi nhóm: nền mờ + viền theo màu đặc trưng (--c), rê vào thì nổi lên */
.report-att-group {
  --c: var(--muted);
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-left: 4px solid var(--c);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--c) 8%, transparent);
  min-width: 0;
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.report-att-group:hover { background: color-mix(in srgb, var(--c) 13%, transparent); border-color: var(--c); box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 22%, transparent); transform: translateY(-1px); }
.report-att-group.is-overdue { --c: var(--danger); }
.report-att-group.is-review, .report-att-group.is-reviewLong { --c: #7c3aed; }
.report-att-group.is-blocked { --c: var(--warning); }
.report-att-group.is-unassigned { --c: var(--primary); }
.report-att-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13.5px; font-weight: 700; }
.report-att-group.is-closed .report-att-head { margin-bottom: 0; }
.report-att-name { color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.report-att-count { padding: 0 9px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--ink)); font-size: 12.5px; }
/* Nút mũi tên thu / mở */
.report-caret {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.report-caret svg { transform: rotate(180deg); transition: transform 0.3s ease; }
.report-caret.is-open svg { transform: rotate(-90deg); }
.report-caret:hover, .report-caret:focus-visible { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); outline: none; }
.report-att-group .report-caret:hover { border-color: var(--c); color: var(--c); background: var(--surface); }
/* 2 nút bố cục ngay cạnh tên nhóm */
.report-att-views { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border-soft); }
.report-att-view { display: inline-grid; place-items: center; width: 24px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; transition: background 0.2s, color 0.2s; }
.report-att-view:hover { color: var(--ink); background: var(--bg); }
.report-att-view.is-on { background: var(--c); color: #fff; }
.report-att-items { display: flex; flex-direction: column; gap: 5px; }
.report-att-items .report-task { background: var(--surface); }
.report-att-items .report-task:hover { background: var(--surface); border-color: color-mix(in srgb, var(--c) 50%, transparent); box-shadow: var(--shadow-sm); }
/* Bố cục 2 thẻ 1 hàng */
.report-att-items.is-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.report-att-items.is-grid .report-task { flex-direction: column; align-items: stretch; border-color: color-mix(in srgb, var(--c) 25%, transparent); }
.report-att-items.is-grid .report-task-end { justify-content: flex-start; flex-wrap: wrap; }
@media (max-width: 640px) { .report-att-items.is-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .report-att-group, .report-caret svg { transition: none; } .report-att-group:hover { transform: none; } }
.report-see-all { margin-top: 4px; font-size: 12.5px; }
.report-task {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.report-task:hover, .report-task:focus-visible { background: var(--primary-50); border-color: var(--primary-100); outline: none; }
.report-task.is-compact { padding: 6px 6px; }
.report-task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.report-task-name { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-task-sub { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-task-sub .project-dot { width: 7px; height: 7px; flex: none; }
.report-reason { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.report-reason.is-overdue { color: var(--danger-600); }
.report-reason.is-review, .report-reason.is-reviewLong { color: #7c3aed; }
.report-reason.is-blocked { color: var(--warning-700); }
.report-task-end { flex: none; display: flex; align-items: center; gap: 8px; }

/* Danh sách chi tiết khi bấm số */
.report-drill { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.report-drill-title { margin: 14px 0 2px; font-size: 17px; }
.report-drill-title span { color: var(--muted); font-weight: 600; }
.report-drill-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }

@media (max-width: 640px) {
  .report-toolbar { align-items: stretch; }
  .report-filters { width: 100%; }
  .report-filters .form-control { flex: 1 1 140px; }
  .report-task-end .avatar-stack, .report-task-end .avatars { display: none; }
  .report-task { flex-wrap: wrap; }
  .report-task-end { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  button.report-tile, .report-task, .report-num { transition: none; }
}
/* Biểu đồ tròn theo thành viên (Báo cáo › Tổng quan) */
.report-pie { display: block; width: 100%; height: auto; max-height: 320px; overflow: visible; font-family: inherit; }
.report-pie text { font-size: 12.5px; fill: var(--ink-soft); font-weight: 600; }
.report-pie .report-pie-pct { fill: var(--muted); font-weight: 500; }
.report-pie-slice, .report-pie-label { cursor: pointer; outline: none; }
.report-pie-slice path, .report-pie-slice circle { transition: opacity 0.2s, transform 0.2s; transform-origin: center; transform-box: view-box; }
.report-pie:hover .report-pie-slice path, .report-pie:hover .report-pie-slice circle { opacity: 0.55; }
.report-pie .report-pie-slice:hover path, .report-pie .report-pie-slice:hover circle,
.report-pie .report-pie-slice:focus-visible path, .report-pie .report-pie-slice:focus-visible circle { opacity: 1; }
.report-pie-label:hover text, .report-pie-label:focus-visible text { fill: var(--ink); text-decoration: underline; }
.report-pie-note { margin: 6px 0 0; text-align: center; }
button.report-att-count { cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; transition: background 0.2s, color 0.2s; }
button.report-att-count:hover, button.report-att-count:focus-visible { background: var(--c); color: #fff; outline: none; }
@media (prefers-reduced-motion: reduce) { .report-pie-slice path, .report-pie-slice circle { transition: none; } }
/* Bộ chọn màu kiểu DevTools (màu đại diện thành viên) */
.cpick { --cp-h: 199; display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.cpick-sv {
  position: relative;
  height: 150px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  /* trên: trắng → màu thuần (trái → phải); phủ dưới: trong suốt → đen (trên → dưới) */
  background:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, hsl(var(--cp-h), 100%, 50%));
  cursor: crosshair;
  touch-action: none;
}
.cpick-sv:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.cpick-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.5), 0 2px 6px rgba(15, 23, 42, 0.35);
  pointer-events: none;
}
.cpick-row { display: flex; align-items: center; gap: 10px; }
.cpick-preview { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); box-shadow: inset 0 0 0 2px #fff; }
.cpick-hue {
  flex: 1;
  min-width: 0;
  height: 12px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
  cursor: pointer;
}
.cpick-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; background: hsl(var(--cp-h), 100%, 50%); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.45); }
.cpick-hue::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: hsl(var(--cp-h), 100%, 50%); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.45); }
.cpick-hex { flex: none; width: 92px; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.cpick-hex.is-bad { border-color: var(--danger); }
.cpick.is-disabled { opacity: 0.55; pointer-events: none; }
/* =====================================================
   VAI TRÒ & PHÂN QUYỀN (roles.js)
   Mỗi vai trò 1 thẻ; nhóm quyền = thẻ con màu riêng (--c); quyền = thẻ nhỏ dạng tag có công tắc.
   ===================================================== */
.roles-section { margin-top: 28px; padding: 18px 20px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.roles-section h2 { margin: 0 0 4px; font-size: 16px; }
.roles-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.roles-head .form-hint { margin: 0; }
.roles-head .form-hint.is-warn { margin-top: 6px; color: var(--warning-700); }
.roles-list { display: flex; flex-direction: column; gap: 14px; }

.role-card { padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-md); background: var(--surface); transition: box-shadow 0.2s, border-color 0.2s; }
.role-card:hover { box-shadow: var(--shadow-sm); }
.role-card.is-admin { border-left-color: var(--danger); }
.role-card.is-editing { border-color: var(--success); border-left-color: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); }
/* Hàng trên: 2 vế */
.role-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.role-card-left { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.role-card-right { display: flex; align-items: center; gap: 6px; }
.role-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.role-name-input { width: auto; min-width: 200px; font-weight: 700; }
.role-badge { padding: 1px 8px; border-radius: var(--radius-pill); background: var(--bg); color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.role-badge.is-me { background: var(--primary-100); color: var(--primary-600); }
.role-views { --c: var(--primary); }
.role-count { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--bg); font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.role-act {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
/* Bút: xanh lá; sao chép: xanh dương; thùng rác: hồng đỏ */
.role-act.is-edit { color: var(--success-700); border-color: color-mix(in srgb, var(--success) 45%, transparent); background: var(--success-50); }
.role-act.is-edit:hover, .role-act.is-edit:focus-visible { background: var(--success); border-color: var(--success); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--success) 40%, transparent); outline: none; }
.role-act.is-copy:hover, .role-act.is-copy:focus-visible { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--primary) 40%, transparent); outline: none; }
.role-act.is-delete { color: var(--danger-600); background: var(--danger-50); }
.role-act.is-delete:hover, .role-act.is-delete:focus-visible { background: var(--danger-600); border-color: var(--danger-600); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--danger-600) 35%, transparent); outline: none; }
.role-card-note { margin: -4px 0 10px; font-size: 12.5px; color: var(--danger-600); }

/* Nhóm quyền: thẻ con nền mờ + viền theo màu nhóm */
.perm-groups { display: flex; flex-direction: column; gap: 10px; }
.perm-groups.is-grid, .perm-groups.is-grid-3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.perm-groups.is-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .perm-groups.is-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.perm-group {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  border-left: 4px solid var(--c);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--c) 7%, transparent);
  min-width: 0;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.perm-group:hover { background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 18%, transparent); transform: translateY(-1px); }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.perm-group-count { padding: 0 8px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); font-size: 11.5px; }
/* Quyền = tag (tên + công tắc), xếp sát nhau, dài thì xuống dòng */
.perm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 6px 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.perm-tag.is-on { border-color: color-mix(in srgb, var(--c) 55%, transparent); color: var(--ink); font-weight: 600; }
.perm-tag:not(.is-readonly):not(.is-locked):hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 6%, var(--surface)); }
.perm-tag-name { min-width: 0; }
.perm-tag .auto-switch { width: 30px; height: 17px; }
.perm-tag .auto-switch span::before { width: 13px; height: 13px; }
.perm-tag .auto-switch input:checked + span::before { transform: translateX(13px); }
/* Chỉ xem: công tắc vẫn rõ màu (không mờ như bị khóa) */
.perm-tag.is-readonly { cursor: default; }
.perm-tag.is-readonly .set-switch input:disabled + span { opacity: 1; cursor: default; }
.perm-tag.is-locked { cursor: not-allowed; border-style: dashed; color: var(--muted); }

.role-card-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.role-card-foot .set-msg { margin-right: auto; font-size: 12.5px; color: var(--ink-soft); }
.role-card-foot .set-msg.is-bad { color: var(--danger-600); }
.role-editor { display: flex; flex-direction: column; gap: 12px; padding-bottom: 14px; }
.role-notice { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warning-50); color: var(--warning-700); font-size: 12.5px; }
.role-danger-btn { background: var(--danger-600); border-color: var(--danger-600); }
.role-danger-btn:hover:not(:disabled) { background: #be123c; }
@media (max-width: 640px) {
  .roles-section { padding: 14px; }
  .perm-groups.is-grid, .perm-groups.is-grid-3 { grid-template-columns: 1fr; }
  .role-card-head { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .perm-group, .role-act, .perm-tag { transition: none; }
  .perm-group:hover { transform: none; }
}
/* Bố cục đề xuất: trái 30% danh sách vai trò, phải là quyền theo danh mục (mỗi quyền 1 dòng) */
.roles-split { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.roles-split.is-collapsed { grid-template-columns: minmax(0, 1fr); }
.roles-split.is-collapsed .roles-side { display: none; }
.roles-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 16px; background: var(--bg); }
.roles-side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 8px; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.roles-side-add { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.roles-side-add:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
/* Mỗi vai trò: chấm màu + tên màu riêng + dòng phụ; đang chọn = nền trắng, viền nhạt, bóng nhẹ, hiện tay cầm kéo */
.roles-side-item { position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: start; column-gap: 10px; width: 100%; padding: 10px 30px 10px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; font: inherit; text-align: left; cursor: pointer; transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; }
.roles-side-item:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.roles-side-item.is-on { background: var(--surface); border-color: #e3e8f7; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06); }
.roles-side-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--rc, var(--primary)); }
.roles-side-item.is-admin:not([style*="--rc"]) .roles-side-dot { background: var(--danger); }
.roles-side-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.roles-side-name { font-size: 14px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roles-side-meta { font-size: 12px; color: var(--muted); }
.roles-main { min-width: 0; }
.role-card.is-split:hover { box-shadow: none; }
.role-card.is-split .role-title { font-size: 18px; font-weight: 800; }
/* Nút ✎ / ⧉ / xóa dạng ô vuông bo 11px */
.role-card.is-split .role-act { width: 34px; height: 34px; border-radius: 11px; border-color: var(--border-soft); }
.role-card.is-split .role-badge { padding: 3px 10px; }
.role-card.is-split .role-count { padding: 5px 11px; }
.roles-main .save-bar { margin-top: 12px; }
    .box-role-perms{
       scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent; height: 80vh; overflow-y: auto;
    }
/* Cột vai trò cao đúng bằng khung quyền bên phải: contain size = cột trái không tự đẩy hàng cao lên,
   hàng lưới kéo giãn theo khung phải; nhiều vai trò thì cột trái tự cuộn, tiêu đề "Vai trò" dính trên */
@media (min-width: 761px) {
  .roles-split:not(.is-collapsed) { align-items: stretch; }
  .roles-split .roles-side { position: static; contain: size; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
  .roles-split .roles-side-head { position: sticky; top: -10px; z-index: 1; margin: -10px -10px 0; padding: 12px 16px 8px; background: var(--bg); }
  .roles-split .roles-side-item { flex: none; }
}
/* Mũi tên: đang hiện cột vai trò = chỉ sang trái (thu lại); đã thu = chỉ sang phải (hiện ra) */
.role-side-caret svg, .role-side-caret.is-open svg { transform: rotate(0deg); }
.roles-split.is-collapsed .role-side-caret svg { transform: rotate(180deg); }
.perm-lines { display: flex; flex-direction: column; gap: 14px; }
/* Nhóm quyền = thẻ riêng; đầu thẻ có icon vuông pastel theo màu nhóm (--c) thay cho thanh màu dọc */
.perm-sec { padding: 12px 14px 6px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04); }
.perm-sec.is-closed { padding-bottom: 12px; }
.perm-sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 15px; font-weight: 800; color: var(--ink); }
.perm-sec.is-closed .perm-sec-title { margin-bottom: 0; }
.perm-sec-icon { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: color-mix(in srgb, var(--c) 85%, var(--ink)); }
.perm-sec-name { flex: 1; min-width: 0; }
.perm-sec-count { padding: 1px 8px; border-radius: var(--radius-pill); background: var(--bg); font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.perm-sec-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.perm-sec-caret { flex: none; color: var(--muted); transition: transform 0.2s; }
.perm-sec-toggle[aria-expanded="true"] .perm-sec-caret { transform: rotate(90deg); }
.perm-tools { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.perm-search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--muted) 60%, var(--border)); border-radius: 12px; background: var(--surface); color: var(--ink-soft); }
.perm-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.perm-search input { flex: 1; min-width: 0; height: 38px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); outline: none; }
.perm-fold-all { flex: none; border-radius: var(--radius-pill); }
.perm-empty { margin: 8px 0; color: var(--muted); font-size: 13.5px; }
/* Banner chú thích của vai trò: khối bo 14px có icon (cam nhạt khi là Quản trị viên) */
.role-card-note.role-banner { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--bg); color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.role-card-note.role-banner.is-warn { background: #fff4e5; color: #9c4221; }
.role-banner > svg { flex: none; margin-top: 2px; }
.perm-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--border-soft); border-radius: var(--radius-sm); cursor: pointer; transition: background 0.2s; }
.perm-line:last-child { border-bottom: 0; }
.perm-line:not(.is-readonly):not(.is-locked):hover { background: color-mix(in srgb, var(--c) 7%, transparent); }
.perm-line-text { flex: 1; min-width: 0; max-width: 560px; display: flex; flex-direction: column; gap: 3px; }
.perm-line-text b { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.perm-line.is-on .perm-line-text b { color: var(--ink); }
.perm-line-text small { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.perm-line-text .perm-why { color: var(--warning-700); font-weight: 600; }
.perm-line.is-readonly { cursor: default; }
.perm-line.is-readonly .set-switch input:disabled + span { opacity: 0.55; cursor: not-allowed; }
.perm-line.is-locked { cursor: not-allowed; }
.perm-line.is-locked .perm-line-text b { color: var(--muted); }
@media (max-width: 760px) {
  .roles-split { grid-template-columns: 1fr; }
  .roles-side { position: static; flex-direction: row; overflow-x: auto; }
  .roles-side-head { display: none; }
  .roles-side-item { flex: none; width: auto; min-width: 140px; }
  .roles-split .role-card.is-split { padding: 12px; }
  .perm-tools { gap: 6px; }
  .perm-fold-all { padding: 0 10px; font-size: 12.5px; }
}
/* Vai trò: màu riêng (--rc), kéo thả thứ tự, ô đổi màu dưới nút bút */
.role-card[style*="--rc"] { border-left-color: var(--rc); }
.role-card.is-split[style*="--rc"] { border-left-width: 0; }
.role-card-right { position: relative; }
.role-act.is-edit.is-open { background: var(--success); border-color: var(--success); color: #fff; }
.role-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.role-pop .form-field { margin-bottom: 10px; }
.role-pop-foot { display: flex; justify-content: flex-end; gap: 8px; }
.role-card-note.is-muted { color: var(--muted); }
.roles-side-item { flex-direction: row; align-items: center; gap: 8px; }
.roles-side-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* Tay cầm ⋮⋮ ở mép phải: hiện rõ ở vai trò đang chọn, mờ khi rê các vai trò khác */
.roles-side-grip { position: absolute; right: 10px; top: 11px; color: var(--muted); font-size: 12px; letter-spacing: -2px; cursor: grab; opacity: 0; transition: opacity 0.2s; }
.roles-side-item:hover .roles-side-grip { opacity: 0.55; }
.roles-side-item.is-on .roles-side-grip { opacity: 1; }
.roles-side-item.is-dragging { opacity: 0.45; }
.roles-side-item.drop-before { box-shadow: inset 0 3px 0 var(--primary); }
.roles-side-item.drop-after { box-shadow: inset 0 -3px 0 var(--primary); }
/* Bố cục đề xuất theo theme pastel: 2 khung nền xám nhạt bo 16px, ít viền, không bóng chìm;
   nhóm quyền + vai trò đang chọn là thẻ trắng nổi nhẹ */
.roles-split .role-card.is-split,
.roles-split .roles-side {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: none;
}
.roles-split .role-card.is-split { padding: 16px 18px; }
.roles-split .role-card.is-split:hover { box-shadow: none; }

/* Thuộc tính hidden luôn ẩn thật, kể cả khi class của phần tử có đặt display (vd thanh thao tác hàng loạt display:flex) */
[hidden] { display: none !important; }

/* =====================================================
   BỘ CHỌN KHÔNG GIAN LÀM VIỆC (đầu thanh bên, projects.js)
   Checkbox ẩn + :has() như các popup khác; bấm ra ngoài thì app.js tự đóng.
   ===================================================== */
.ws-switcher { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.ws-switcher-btn {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  padding: 4px; margin: -4px; border-radius: var(--radius-sm); cursor: pointer;
}
.ws-switcher-btn:hover { background: var(--primary-50); }
.ws-switcher:has(#ws-switcher-toggle:focus-visible) .ws-switcher-btn { outline: 2px solid var(--primary); outline-offset: 2px; }
.ws-switcher-btn .sidebar-brand-text { min-width: 0; }
.ws-switcher-btn .sidebar-brand-text strong,
.ws-switcher-btn .sidebar-brand-text span { overflow: hidden; text-overflow: ellipsis; }
.ws-switcher-mark { font-size: 13px; font-weight: 700; overflow: hidden; }
.ws-switcher-mark img,
.ws-switcher-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ws-switcher-panel {
  display: none; position: absolute; top: calc(100% + 8px); left: -4px; right: -4px; z-index: 60;
  padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); max-height: 60vh; overflow-y: auto;
}
.ws-switcher:has(#ws-switcher-toggle:checked) .ws-switcher-panel { display: block; }
.ws-switcher-head { padding: 6px 8px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ws-switcher-item {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.ws-switcher-item:hover, .ws-switcher-item:focus-visible { background: var(--primary-50); outline: none; }
.ws-switcher-item.is-current { background: var(--primary-50); }
.ws-switcher-avatar {
  width: 28px; height: 28px; flex: none; border-radius: var(--radius-sm); overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: #fff;
}
.ws-switcher-new .ws-switcher-avatar { background: var(--primary-50); color: var(--primary-600); border: 1px dashed var(--primary); }
.ws-switcher-item-text { min-width: 0; flex: 1; }
.ws-switcher-item-text strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.ws-switcher-item-text span { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.ws-switcher-check { flex: none; color: var(--primary-600); }
.ws-switcher-new { border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
/* Bộ chọn nằm ở thanh trên cùng (bên trái, thay chỗ lời chào cũ) */
.sidebar-app-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sidebar-app-brand:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.topbar .breadcrumb { min-width: 0; flex: 0 1 auto; }
.topbar-ws { flex: 0 1 auto; max-width: 320px; }
.topbar-ws .ws-switcher-btn { padding: 4px 10px 4px 4px; }
.topbar-ws .sidebar-brand-text strong { color: var(--ink); white-space: nowrap; }
.topbar-ws .sidebar-brand-text span { white-space: nowrap; }
.topbar-ws .ws-switcher-panel { right: auto; min-width: 280px; }

/* Không gian làm việc mới, chưa có dự án: hành động chính là tạo dự án đầu tiên */
/* Thẻ "Bắt đầu" ở Tổng quan (tasks.js workspaceOnboardHTML; chi tiết các bước ở khối "Bắt đầu sử dụng" cuối file) */
.ws-onboard {
  margin: 8px 0 20px; padding: 18px 20px; border: 1px dashed var(--primary); border-radius: var(--radius-lg);
  background: var(--primary-50);
}
.ws-onboard h2 { margin: 0; font-size: 18px; }
.ws-onboard p { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; }

/* =====================================================
   TRANG SAU ĐĂNG NHẬP: chọn / tạo không gian làm việc (start.html)
   ===================================================== */
/* Theo ảnh mẫu (07/11/2026): nền choose_ws_bg, logo ở giữa đầu trang, ngôn ngữ + ảnh đại diện góc phải,
   thẻ trắng ở giữa; mỗi workspace là 1 ô lớn (ảnh / chữ cái, tên, vai trò · số thành viên, mũi tên).
   Lưới 3 hàng: trên (logo) = dưới (trống) cùng 1fr => thẻ luôn cách mép trên và mép dưới bằng nhau;
   logo cao 75px nằm giữa khoảng trên (hàng trên tối thiểu 75 + 10px mỗi phía) */
body.start-page {
  height: auto; min-height: 100vh; display: grid; grid-template-rows: minmax(95px, 1fr) auto minmax(95px, 1fr); justify-items: center;
  padding: 0 16px;
  /* Ảnh nền lệch sẵn: thẻ mờ bên phải gần giữa hơn bên trái 26px (theo ảnh 1824px). Phóng ảnh dư ra một chút rồi dời
     sang phải nửa độ lệch (13/1824 bề rộng ảnh) để 2 thẻ mờ cách form ở giữa đều nhau; max() = luôn phủ kín cả màn cao */
  background: #eef2fb url("../img/choose_ws_bg.png") no-repeat fixed;
  background-size: max(101.6vw, 214.9vh) auto;
  background-position: calc(50% + max(0.725vw, 1.533vh)) 50%;
}
/* Đổi màn (chọn <-> tạo, lời mời...): 2 cột mờ dần hiện ra 0.2s (start.js thêm lớp khi mode đổi) */
.start-split.is-enter .start-side, .start-split.is-enter .start-main { animation: startEnter 0.2s ease; }
@keyframes startEnter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .start-split.is-enter .start-side, .start-split.is-enter .start-main { animation: none; } }
.start-top { position: relative; grid-row: 1; width: 100%; min-height: 0; display: flex; justify-content: center; padding: 10px 0; }
.start-brand { position: relative; height: 75px; width: min(56vw, 300px); align-self: center; }
/* Ảnh đặt tuyệt đối trong ô cố định để chiều cao gốc của ảnh không đẩy hàng trên cao hơn hàng dưới */
.start-brand img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.start-tools { position: absolute; top: 14px; right: 8px; display: flex; align-items: center; gap: 10px; }
.start-page > .start-card { grid-row: 2; align-self: center; }

/* Chọn ngôn ngữ: nút viên thuốc trắng + menu nổi (mở / đóng mờ dần 0.2s) */
.start-lang { position: relative; }
.start-lang svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.start-lang-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px 0 12px;
  border: 1px solid transparent; border-radius: 12px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.07); transition: border-color 0.2s, background-color 0.2s;
}
.start-lang-btn svg { width: 16px; height: 16px; }
.start-lang-btn .start-lang-caret { width: 14px; height: 14px; color: var(--ink-soft); transition: transform 0.2s; }
.start-lang-btn:hover { background: #f8fbff; border-color: #dbe7f5; }
.start-lang-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.start-lang.is-open .start-lang-btn { border-color: #a9d6fb; }
.start-lang.is-open .start-lang-caret { transform: rotate(180deg); }
.start-lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 190px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s;
}
.start-lang-menu:focus { outline: none; }
.start-lang.is-open .start-lang-menu { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s, transform 0.2s, visibility 0s; }
.start-lang-menu li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  font-size: 13.5px; color: var(--ink); cursor: pointer; outline: none; transition: background-color 0.2s;
}
.start-lang-menu li:hover, .start-lang-menu li:focus-visible { background: #f1f6fd; }
.start-lang-menu li:focus-visible { box-shadow: inset 0 0 0 2px #a9d6fb; }
.start-lang-code {
  flex: none; width: 28px; height: 22px; display: grid; place-items: center; border-radius: 6px;
  background: #eef2f7; color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
}
.start-lang-name { flex: 1; }
.start-lang-tick { width: 16px; height: 16px; color: var(--primary-600); visibility: hidden; }
.start-lang-menu li.is-on { font-weight: 600; }
.start-lang-menu li.is-on .start-lang-code { background: #e0f2fe; color: var(--primary-600); }
.start-lang-menu li.is-on .start-lang-tick { visibility: visible; }
@media (prefers-reduced-motion: reduce) { .start-lang-menu, .start-lang-caret { transition: none; } }

.start-me {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: #fff; font-size: 12.5px; font-weight: 700;
  border: 2px solid #fff; box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}
.start-me img { width: 100%; height: 100%; object-fit: cover; }

.start-card {
  width: 100%; max-width: 600px; padding: 24px 26px 20px; background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 18px;
  box-shadow: 0 18px 44px rgba(30, 64, 175, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
}
.start-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.2px; }

/* Bố cục 2 cột (ảnh mẫu 07/11/2026): cột trái pastel = lời chào + tiêu đề + mô tả + hình người (ws_img1),
   cột phải = danh sách / form của màn đang mở. Tiêu đề lấy từ h1 của màn (start.js dungTieuDeBenTrai) */
/* Cột trái nằm thẳng trên nền thẻ (không khung riêng); chỉ khung phải là ô trắng nổi */
.start-card.start-split {
  max-width: 940px; padding: 14px; display: grid; grid-template-columns: minmax(250px, 32%) minmax(0, 1fr); gap: 6px;
  border: 0; border-radius: 26px; overflow: hidden;
  background: linear-gradient(160deg, rgba(248, 251, 255, 0.96) 0%, rgba(240, 246, 255, 0.94) 55%, rgba(243, 240, 255, 0.92) 100%);
  backdrop-filter: blur(6px);
  box-shadow: 0 22px 54px rgba(30, 64, 175, 0.09), 0 2px 6px rgba(15, 23, 42, 0.04);
}
.start-side {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  padding: 26px 18px 0 22px; background: none;
}
.start-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; margin-bottom: 18px;
  border: 1px solid #bfdcfb; border-radius: 999px; background: #eaf5ff; color: #1e3a8a; font-size: 12.5px; font-weight: 600;
}
.start-chip svg { width: 15px; height: 15px; fill: #fcd34d; stroke: #f59e0b; stroke-width: 1.4; stroke-linejoin: round; }
.start-side h1 { margin: 0; font-size: clamp(23px, 2vw, 28px); line-height: 1.22; font-weight: 800; color: #0f1f4b; letter-spacing: -0.4px; }
.start-hl { position: relative; display: table; color: #1d8cf0; padding-bottom: 6px; }
.start-hl svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 9px; fill: none; stroke: #2f8ff2; stroke-width: 3; stroke-linecap: round; }
.start-side-sub { margin: 12px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.start-side-sub:empty { display: none; }
.start-side-img { width: 128%; max-width: none; margin: auto 0 -14px -19%; padding-top: 12px; display: block; }

/* Màn tạo không gian: cột trái = slide hướng dẫn (ảnh New_WS/slide1-3 + chữ HTML), chồng 3 slide 1 ô lưới, mờ dần 0.2s */
.start-side.is-slides { padding: 18px 14px 16px; justify-content: center; }
.start-side.is-slides > :not(.start-slides) { display: none; }
.start-slides { display: flex; flex-direction: column; align-items: center; width: 100%; flex: 1; justify-content: center; user-select: none; touch-action: pan-y; cursor: grab; outline: none; }
.start-slides:active { cursor: grabbing; }
.start-slides:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 16px; }
.start-slide-track { display: grid; width: 100%; }
.start-slide {
  grid-area: 1 / 1; margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center;
  opacity: 0; visibility: hidden; transform: translateX(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.start-slide.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s; }
.start-slide img { width: 100%; max-width: 290px; aspect-ratio: 1; object-fit: contain; pointer-events: none; }
.start-slide figcaption { padding: 6px 6px 0; }
.start-slide h2 { margin: 0; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.3; font-weight: 800; color: #0f1f4b; }
.start-slide p { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.start-dots { display: flex; gap: 4px; margin-top: 18px; }
.start-dots button { width: 26px; height: 16px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.start-dots button::before { content: ""; width: 18px; height: 5px; border-radius: 3px; background: #d5e1f0; transition: width 0.2s, background-color 0.2s; }
.start-dots button:hover::before { background: #b5cbe6; }
.start-dots button.is-on::before { width: 26px; background: #2f8ff2; }
.start-dots button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .start-slide, .start-slide.is-on, .start-dots button::before { transition: none; } }

/* Form tạo không gian (cột phải) */
.start-back-pill {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; padding: 6px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}
.start-back-pill:hover { background: #f5f9ff; border-color: #cfe3fb; }
.start-back-pill .start-ic { width: 15px; height: 15px; }
.start-main h1 { margin: 0 0 6px; font-size: clamp(22px, 2vw, 26px); font-weight: 800; color: #0f1f4b; letter-spacing: -0.3px; }
.start-main #start-create-form .form-field label { font-size: 14px; font-weight: 700; color: var(--ink); }
.start-main #start-create-form .form-control { height: 44px; border-radius: 12px; font-size: 14.5px; background: var(--surface); transition: border-color 0.2s, box-shadow 0.2s; }
.start-main #start-create-form .form-control:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18); outline: none; }
.start-tz-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.start-tz-line .start-ic { width: 15px; height: 15px; color: var(--muted); }
.start-tz-line .start-link-btn { color: #1d8cf0; }
#start-create-form .start-actions .btn-primary, #start-create-form .start-actions .btn-secondary { min-height: 40px; padding: 0 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; }
#start-create-form .start-actions .btn-primary { background: linear-gradient(90deg, #38bdf8, #2f8ff2); border-color: transparent; transition: filter 0.2s, box-shadow 0.2s; }
#start-create-form .start-actions .btn-primary:hover:not(:disabled) { filter: brightness(0.95); box-shadow: 0 6px 16px rgba(47, 143, 242, 0.3); }
.start-account-ic { width: 18px; height: 18px; color: var(--ink-soft); }
/* Khôi phục xong: dòng chuyển xanh lá trước khi vào không gian */
.start-ws-item.is-restored { background: #f0fdf4; border-color: #86efac; }
.start-ws-item.is-restored .start-ws-avatar { background: linear-gradient(135deg, #38bdf8, #2788f4); color: #fff; border-color: transparent; }
.start-ws-item.is-restored .start-ws-meta { color: #15803d; font-weight: 600; }
.start-ws-item.is-restored .start-ws-meta .start-ic { width: 15px; height: 15px; color: #16a34a; }
/* Khung phải: nền trắng loang nhẹ xanh (góc trên phải) + tím (góc dưới trái) cho sinh động mà vẫn dịu; các ô trắng nổi lên trên */
.start-main {
  min-width: 0; padding: 16px 16px 12px; border-radius: 20px; border: 1px solid rgba(214, 228, 248, 0.9);
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(56, 189, 248, 0.10) 0%, rgba(56, 189, 248, 0) 60%),
    radial-gradient(90% 60% at 0% 100%, rgba(167, 139, 250, 0.09) 0%, rgba(167, 139, 250, 0) 60%),
    linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.06);
}
.start-main > .start-muted:first-child { margin-top: 4px; }
.start-muted { margin: 0 0 16px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }
.start-alert {
  margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--danger-50); color: var(--danger-600); font-size: 13.5px;
}
.start-ws-list { display: flex; flex-direction: column; gap: 8px; }
.start-ws-item {
  width: 100%; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); font: inherit; text-align: left; cursor: pointer; transition: background-color 0.2s, border-color 0.2s;
}
.start-ws-item, .start-ws-item .ws-switcher-item-text strong, .start-ws-item .ws-switcher-item-text span { white-space: normal; overflow-wrap: anywhere; }
.start-ws-item:hover, .start-ws-item:focus-visible { background: #f5f9ff; border-color: #cfe3fb; }
.start-ws-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.start-ws-item.is-recent { background: #eaf5ff; border-color: #a9d6fb; }
.start-ws-item.is-recent:hover { background: #e0f0ff; }
.start-ws-item.ws-switcher-new { margin-top: 0; border-top: 1px solid var(--border); border-radius: 12px; }
/* Chữ cái: nền xanh nhạt; ô dùng gần nhất nền xanh đậm (gradient); đã xóa nền xám */
.start-ws-avatar { width: 46px; height: 46px; font-size: 15px; border-radius: 12px; background: #eaf3fe; color: #1d7fe0; border: 1px solid #d6e7fb; }
.start-ws-item.is-recent .start-ws-avatar { background: linear-gradient(135deg, #38bdf8, #2788f4); color: #fff; border-color: transparent; }
.start-ws-item.is-deleted .start-ws-avatar { background: linear-gradient(135deg, #b8c2d1, #94a3b8); color: #fff; border-color: transparent; }
/* Workspace có ảnh (logo): bỏ nền xanh, để logo hiện nguyên vẹn */
.start-ws-avatar:has(img) { background: none; border-color: transparent; }
.start-ws-avatar img { object-fit: contain; }
.start-ws-avatar.is-new { background: #f5faff; color: var(--primary-600); border: 1.5px dashed #7cc4f8; }
.start-ws-item .ws-switcher-item-text strong { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.start-ws-item .ws-switcher-item-text .start-ws-meta { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 13px; color: var(--ink-soft); }
.start-ws-meta i { font-style: normal; color: var(--muted); padding: 0 2px; }
.start-ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.start-ic.is-crown { width: 14px; height: 14px; color: #f59e0b; fill: #fde68a; }
.start-ws-avatar .start-ic { width: 16px; height: 16px; }
.start-ws-go { width: 16px; height: 16px; color: var(--ink-soft); }
.start-btn-ic { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.start-btn-ic .start-ic { width: 15px; height: 15px; }
.start-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.start-account {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-soft);
}
.start-account strong { color: var(--ink); }
@media (max-width: 640px) {
  body.start-page { grid-template-rows: auto auto 24px; }
  .start-top { flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; }
  .start-tools { position: static; order: -1; align-self: flex-end; }
  .start-brand { height: 56px; flex: none; }
  .start-card { padding: 22px 16px 18px; border-radius: 18px; }
  .start-card h1 { font-size: 22px; }
}
.start-account span { min-width: 0; overflow-wrap: anywhere; }
.start-tz-line { margin: -4px 0 0; }
.start-link-btn { padding: 0; border: 0; background: none; color: var(--primary-600); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.start-link-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.start-ok {
  margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--success-50); color: var(--success-700); font-size: 13.5px;
}
.start-ws-list + .start-ok, .start-ws-list ~ .start-ok { margin-top: 12px; }
.start-ok:has(> .start-ic) { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.start-ok > .start-ic { width: 16px; height: 16px; margin-top: 2px; color: #16a34a; }
.start-invite { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.start-invite p { margin: 0; line-height: 1.5; }
.start-invite-row { cursor: default; }
.start-invite-row .btn-primary { flex: none; padding: 6px 12px; }

/* Lời mời đang chờ ở trang Thành viên (assignee.js) */
.invite-section { margin-top: 26px; }
.invite-list { display: flex; flex-direction: column; gap: 8px; }
.invite-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
}
.invite-row.is-expired { border-style: dashed; }
.invite-row.is-expired .invite-info span { color: var(--danger-600); }
.invite-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.invite-info strong { overflow-wrap: anywhere; }
.invite-info span { font-size: 12.5px; color: var(--ink-soft); }
.invite-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Chấm báo có lời mời đang chờ trên logo workspace */
.ws-switcher-mark { position: relative; overflow: visible; }
.ws-switcher-mark img { border-radius: var(--radius-sm); }
/* Workspace đã chọn ảnh làm logo: bỏ nền xanh phía sau, logo hiện nguyên vẹn (không cắt mép) */
.ws-switcher-mark:has(> img), .ws-switcher-avatar:has(> img) { background: none !important; box-shadow: none; }
.ws-switcher-mark > img, .ws-switcher-avatar > img { object-fit: contain; }
.ws-switcher-dot {
  position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface);
}
.ws-switcher-invite .ws-switcher-avatar { background: var(--danger-50); color: var(--danger-600); }

/* Xóa không gian làm việc (Cài đặt › Không gian làm việc) */
.ws-delete-card { border-color: var(--danger-100); }
.ws-delete-q { margin: 0 0 6px; }
.ws-delete-actions { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ws-delete-btn { background: var(--danger-600); border-color: var(--danger-600); }
.ws-delete-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.start-deleted { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.start-deleted-head {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 10px; padding: 4px 6px 4px 2px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer;
}
.start-deleted-head span { flex: 1; }
.start-deleted-head .start-ic { width: 17px; height: 17px; color: var(--ink-soft); }
.start-deleted-head:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.start-deleted-caret { color: var(--primary-600) !important; transform: rotate(-90deg); transition: transform 0.2s; }
.start-deleted-head[aria-expanded="false"] .start-deleted-caret { transform: rotate(90deg); }
.start-deleted-list { display: flex; flex-direction: column; gap: 8px; }
.start-btn-restore { border-color: #a9d0f8; background: #f5faff; color: var(--primary-600); }
.start-btn-restore:hover { background: #e9f4ff; border-color: #7fbaf5; }
.start-account-who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.start-account-who > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.start-split .start-account { flex-wrap: nowrap; }
.start-account-who i { font-style: normal; color: var(--muted); padding: 0 8px; }
.start-account-av {
  width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, #7cc4f8, #2f8ff2); color: #fff; font-size: 12.5px; font-weight: 700;
}
.start-account-av img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .start-card.start-split { grid-template-columns: 1fr; padding: 10px; }
  .start-side { padding: 20px 18px 18px; }
  .start-side-img { display: none; }
  .start-main { padding: 10px 6px 6px; }
  .start-split .start-account { flex-wrap: wrap; }
  .start-account-who > span:last-child { white-space: normal; overflow-wrap: anywhere; }
}
.start-deleted .start-ws-item { cursor: default; }
.start-deleted .start-ws-item:hover { background: var(--surface); border-color: var(--border); }

/* =====================================================
   NHÓM + HỒ SƠ NHANH THÀNH VIÊN (assignee.js)
   ===================================================== */


#view-members > .roles-section:first-child { margin-top: 0; } /* Vai trò & phân quyền là 1 mục riêng của Thành viên: không cần khoảng cách phía trên */
.tw-tab-count { margin-left: 4px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--bg); font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.role-filter-section { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.team-avatar {
  flex: none; width: 32px; height: 32px; border-radius: var(--radius-sm); color: #fff; font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.team-badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--bg); color: var(--ink-soft); font-size: 11px; font-weight: 600; vertical-align: middle; }
.team-badge.is-leader { background: var(--primary-50); color: var(--primary-600); }
.team-chip { cursor: pointer; border: 1px solid var(--border); background: var(--surface); font: inherit; }
.team-chip:hover { border-color: var(--primary); }

/* ---------- Trang Nhóm theo ảnh mẫu (assignee.js teamsPageHTML): 4 thẻ số + thanh lọc + 2 cột ---------- */
body:has(#view-members.is-active .tmg-page) .page-content { background: linear-gradient(180deg, #eef3f9, #f4f7fb 320px); }
.tmg-page { container-type: inline-size; display: flex; flex-direction: column; gap: 16px; }
.tmg-head { display: flex; align-items: center; gap: 14px; }
.tmg-head-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: var(--primary-50); color: var(--primary-600); }
.tmg-head h1 { margin: 0; font-size: clamp(22px, 1.8vw, 26px); font-weight: 800; color: var(--ink); }
.tmg-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }

.tmg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tmg-kpi {
  --k: #3b82f6; --kd: #1d4ed8;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 14px; min-width: 0; padding: 16px 18px;
  border: 3px solid #fff; border-radius: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--k) 13%, #fff), color-mix(in srgb, var(--k) 7%, #fff)); box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
.tmg-kpi.is-green { --k: #22c55e; --kd: #15803d; }
.tmg-kpi.is-orange { --k: #fb923c; --kd: #c2410c; }
.tmg-kpi.is-pink { --k: #f472b6; --kd: #db2777; }
.tmg-kpi-ic { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; background: color-mix(in srgb, var(--k) 20%, #fff); color: var(--kd); }
/* Nhãn chiếm cả hàng trên; số to bên trái + dòng phụ bên phải ở hàng dưới (nhãn dài không bị cắt) */
.tmg-kpi-main { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "l l" "v s"; align-items: end; column-gap: 10px; row-gap: 2px; min-width: 0; }
.tmg-kpi-main .tmg-kpi-label { grid-area: l; }
.tmg-kpi-main .tmg-kpi-v { grid-area: v; }
.tmg-kpi-main .tmg-kpi-side { grid-area: s; }
.tmg-kpi-label { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-kpi-v { font-size: clamp(26px, 2.2vw, 32px); font-weight: 800; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.tmg-kpi-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; align-self: end; min-width: 0; text-align: right; }
.tmg-kpi-note { font-size: 12px; color: var(--ink-soft); }
.tmg-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap;
  background: color-mix(in srgb, var(--k) 12%, #fff); color: var(--kd); }
.tmg-pill.is-up, .tmg-pill.is-ok { background: var(--success-50, #ecfdf5); color: var(--success-600, #15803d); }
.tmg-pill.is-warn { background: #fff7ed; color: #c2410c; }

.tmg-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tmg-tools .search-field { box-sizing: border-box; flex: 0 0 30%; min-width: 0; max-width: none; height: 40px; border-radius: 13px; box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.08); }
.tmg-tools .search-field input { font-size: 13.5px; }
.tmg-sel { position: relative; display: inline-flex; align-items: center; min-width: 0; }
.tmg-sel > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; z-index: 1; }
.tmg-tools .tmg-sel { flex: 0 1 200px; width: 200px; }
.tmg-tools .tmg-select { box-sizing: border-box; width: 100%; height: 40px; padding-left: 38px; border-radius: 13px; background-color: var(--surface); font-size: 13.5px; color: var(--ink-soft); }
.tmg-tools .tmg-sel .cselect-btn .cselect-value, .tmg-tools .tmg-sel .cselect-btn.is-placeholder .cselect-value { color: var(--ink-soft); }
.tmg-tools .btn-primary { height: 40px; border-radius: 13px; transition: background-color 0.2s, box-shadow 0.2s, filter 0.2s; }
/* Trạng thái tương tác (thiết kế 11/2026): rê chuột viền xanh nhạt + nền xanh rất nhạt; đang gõ / đang mở viền xanh + quầng nhẹ */
.tmg-tools .search-field, .tmg-tools .tmg-sel .cselect-btn { transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s; }
.tmg-tools .search-field:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: #f8fbff; }
.tmg-tools .search-field:focus-within { border-color: var(--primary); background: var(--surface); box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.tmg-tools .search-field:focus-within > svg { color: var(--primary-600); }
.tmg-tools .tmg-sel .cselect-btn:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background-color: var(--primary-50); }
.tmg-tools .tmg-sel .cselect-btn.is-open { border-color: var(--primary); background-color: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.tmg-tools .tmg-sel:has(.cselect-btn.is-open) > svg { color: var(--primary-600); }
/* Tạo nhóm: rê chuột sáng hơn + bóng xanh, nhấn thì đậm hơn */
.tmg-tools .btn-primary:hover { background: var(--primary); filter: brightness(1.06); box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 30%, transparent); }
.tmg-tools .btn-primary:active { background: var(--primary-600); filter: none; box-shadow: var(--shadow-sm); }
/* ---------- Thành viên › Mọi người (ảnh mẫu 11/2026, assignee.js memberKpisHTML / memberPeopleToolbarHTML) ----------
   Dùng lại khung trang Nhóm (.tmg-page, .tmg-head, .tmg-tools: ô tìm, ô chọn, nút Mời cao 40px bo 13px + cách rê / mở) */
/* Họa tiết mờ bên phải đầu trang như ảnh mẫu: quầng xanh nhạt + vài đường cong mảnh, chỉ trang trí (nằm dưới chữ) */
.mp-head { position: relative; isolation: isolate; }
.mp-head::before { content: ""; position: absolute; z-index: -1; top: -18px; right: -8px; bottom: -14px; width: min(560px, 55%); pointer-events: none;
  background:
    radial-gradient(circle at 78% 45%, rgba(56, 189, 248, 0.16), transparent 42%),
    radial-gradient(circle at 40% 80%, rgba(167, 139, 250, 0.10), transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='130' viewBox='0 0 560 130' fill='none' stroke='%2393c5fd' stroke-opacity='.35' stroke-width='1.2'%3E%3Cpath d='M0 100C90 60 170 120 260 80s170-60 300-20'/%3E%3Cpath d='M40 125c90-40 170 10 260-25s160-50 260-15'/%3E%3Cpath d='M120 20c60 25 120 20 180-5s120-25 260 10' stroke-opacity='.22'/%3E%3Ccircle cx='300' cy='34' r='3' fill='%23bae6fd' stroke='none'/%3E%3Ccircle cx='470' cy='110' r='2.5' fill='%23c7d2fe' stroke='none'/%3E%3C/svg%3E") right center / 100% 100% no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%); mask-image: linear-gradient(90deg, transparent, #000 30%); }
.mp-head-art { display: inline-flex; margin-left: auto; margin-right: 12px; }
.mp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
/* Nền pastel nhạt bên trái, đậm dần sát mép phải (chủ dự án: bớt trắng) */
.mp-kpi { --c: #38bdf8; --ink-c: #0284c7; position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow: hidden; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--c) 24%, var(--surface)); border-radius: 16px; background: linear-gradient(100deg, color-mix(in srgb, var(--c) 5%, var(--surface)) 0%, color-mix(in srgb, var(--c) 9%, var(--surface)) 55%, color-mix(in srgb, var(--c) 17%, var(--surface)) 100%); box-shadow: var(--shadow-sm); }
.mp-kpi.is-green { --c: #22c55e; --ink-c: #16a34a; }
.mp-kpi.is-orange { --c: #fb923c; --ink-c: #ea580c; }
.mp-kpi.is-purple { --c: #a78bfa; --ink-c: #7c3aed; }
.mp-kpi-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.mp-kpi-row { display: flex; align-items: center; gap: 10px; }
/* Biểu tượng cạnh tên ô số: ô tròn nền cùng tông, đậm hơn nền thẻ 1 nấc */
.mp-kpi-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--c) 20%, var(--surface)); color: var(--ink-c); }
.mp-kpi-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-c); }
.mp-kpi-v { font-size: 24px; font-weight: 800; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.mp-kpi-side { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 18px; padding-right: 56px; font-size: 12px; color: var(--ink-soft); }
.mp-kpi-side small { font-size: 12px; }
.mp-pill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; background: #dcfce7; color: #16a34a; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mp-kpi-art { position: absolute; right: 18px; top: 50%; color: color-mix(in srgb, var(--c) 55%, var(--surface)); transform: translateY(-50%); pointer-events: none; }
.mp-kpi-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--ink-c); font: inherit; font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* Bảng + hàng công cụ chung 1 thẻ trắng như mẫu */
.mp-card { min-width: 0; padding: 14px 16px 8px; border: 1px solid var(--border-soft); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.mp-card .ml-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.mp-card > .member-grid { margin-bottom: 8px; }
/* Bảng Mọi người (GĐ2): thêm cột Trạng thái + Tải công việc nên bảng rộng hơn, màn hẹp cuộn ngang */
.mp-card .ml-table { min-width: 1080px; }
.mp-card .ml-row-head { border-top: 1px solid var(--border-soft); }
.mp-card .ml-row-head .ml-head-cell { color: var(--ink); font-weight: 600; }
.mp-name-sort { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; margin-left: -4px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; transition: background-color 0.2s; }
.mp-name-sort:hover { background: var(--primary-50); }
.mp-name-sort svg { color: var(--muted); }
.mp-name-sort.is-on svg { color: var(--primary-600); }
.mp-head-info { display: inline-flex; margin-left: 5px; color: var(--primary-600); cursor: help; }
.mp-card .ml-role { gap: 6px; padding: 4px 10px; border-radius: 8px; background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: color-mix(in srgb, var(--c) 82%, #0f172a); }
.mp-card .ml-role svg { flex: none; color: var(--c); }
.mp-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.mp-status i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.mp-status.is-on { color: var(--ink); }
.mp-status.is-on i { background: #22c55e; }
.mp-load { display: flex; flex-direction: column; gap: 5px; width: 100%; max-width: 170px; }
.mp-load b { font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.mp-load-bar { display: block; height: 6px; overflow: hidden; border-radius: 99px; background: var(--border-soft); }
.mp-load-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.mp-load.is-high .mp-load-bar i { background: #f59e0b; }
.mp-load.is-over b { color: #e11d48; }
.mp-load.is-over .mp-load-bar i { background: #f43f5e; }
.mp-load.is-wait, .mp-load.is-none { color: var(--muted); font-size: 13px; }
/* GĐ4a mục 1: rê vào dòng = nền xanh nhạt cả dòng (thao tác dùng menu ⋯, chủ dự án bỏ nút nhanh) */
.mp-card .ml-row[data-id]:hover > .ml-cell, .mp-card .ml-row[data-id]:focus-within > .ml-cell { background: #f1f8fe; }
.mp-card .ml-row.is-selected > .ml-cell { background: var(--primary-50); }
.mp-card .ml-row:hover .pl-menu-dots { border: 1px solid var(--border-soft); background: var(--surface); }
/* Mục 6: ô Tải nhận Tab (khung chi tiết hiện khi rê / Tab) */
.mp-load[tabindex] { cursor: default; border-radius: 6px; }
.mp-load[tabindex]:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.mp-tip { position: fixed; z-index: 80; max-width: 280px; padding: 10px 14px; border-radius: 12px; background: #1e293b; color: #f8fafc; font-size: 12.5px; line-height: 1.5; box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28); pointer-events: none; animation: mp-tip-in 0.2s ease; }
.mp-tip[hidden] { display: none; }
.mp-tip::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.mp-tip.is-below::after { top: -5px; bottom: auto; }
.mp-tip-title { margin-bottom: 4px; font-weight: 700; }
.mp-tip ul { margin: 0; padding-left: 16px; list-style: disc; }
.mp-tip li.is-warn { color: #fcd34d; }
.mp-tip li.is-bad { color: #fda4af; }
.mp-tip-note { margin-top: 4px; font-size: 11.5px; color: #94a3b8; }
/* Mục 4: thẻ tóm tắt vai trò — nền trắng, viền mảnh, bóng mềm (khác khung tối của Tải công việc) */
.mp-tip.is-light { width: 270px; max-width: 270px; padding: 12px 14px; border: 1px solid var(--border-soft); background: var(--surface); color: var(--ink); box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14); }
.mp-tip.is-light::after { border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.mp-tip.is-light.is-below::after { border: 0; border-left: 1px solid var(--border-soft); border-top: 1px solid var(--border-soft); }
.mp-tip-role-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }
.mp-tip-role-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c); }
.mp-tip-label { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--ink); }
.mp-tip-role p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.mp-tip-perms { margin: 4px 0 0; padding: 0; list-style: none; }
.mp-tip-perms li { display: flex; align-items: flex-start; gap: 6px; padding: 2px 0; font-size: 12.5px; color: var(--ink); }
.mp-tip-perms li svg { flex: none; margin-top: 2px; color: #16a34a; }
.mp-tip-perms li.is-more { color: var(--ink-soft); }
.mp-card .ml-role[data-mp-tip] { cursor: help; }
/* Mục 8: menu ⋯ có menu con (Gán vai trò ›, Thêm vào nhóm ›) */
.ml-sub-parent .ml-sub-caret { display: inline-flex; margin-left: auto; color: var(--muted); }
.ml-sub-parent.is-open { background: var(--primary-50); color: var(--primary-600); }
.ml-sub { min-width: 210px; max-width: 260px; }
.ml-sub-item .ml-sub-check { display: inline-flex; flex: none; width: 16px; color: var(--primary-600); }
.ml-sub-item.is-on { font-weight: 600; }
.ml-sub-item[disabled] { opacity: 0.55; cursor: not-allowed; }
@keyframes mp-tip-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mp-tip { transition: none; animation: none; } }
/* GĐ3: Lời mời đang chờ (rộng hơn) + Gợi ý phân nhóm cạnh nhau; chỉ 1 khối thì chiếm cả hàng */
.mp-bottom { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.mp-bottom > .mp-box:only-child { grid-column: 1 / -1; }
.mp-box { min-width: 0; margin: 0; padding: 16px 18px; border: 1px solid var(--border-soft); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.mp-box-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mp-box-head h2 { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.mp-box-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); }
.mp-suggest .mp-box-ic { background: #f3efff; color: #7c3aed; }
.mp-box-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 4px 10px; border-radius: 99px; background: var(--primary-50); color: var(--primary-600); font-size: 12px; font-weight: 600; white-space: nowrap; }
.mp-box-note, .mp-box-lead { margin: 0; font-size: 13px; color: var(--ink-soft); }
.mp-box-lead { margin-bottom: 10px; color: var(--ink); }
.mp-box .invite-list { gap: 10px; }
.mp-box .invite-row { flex-wrap: nowrap; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); }
.mp-box .invite-info { flex: 1; min-width: 0; }
.mp-box .invite-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-inv-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: #eef2f7; color: var(--muted); }
.mp-inv-expired { color: #e11d48; font-style: normal; font-weight: 600; }
/* GĐ5b: khối Lĩnh vực chuyên môn — thẻ nền nhạt theo màu chuyên môn (chấm + tên + số người), nút thêm viền nét đứt */
.mp-skills .mp-box-head { align-items: flex-start; }
.mp-skills-ic { background: #eef4ff; color: #4f7cf7; }
.mp-skills-title { flex: 1; min-width: 0; }
.mp-skills-title p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.mp-skills-manage.btn-secondary { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 14px; border-radius: 10px; cursor: pointer; }
.mp-skill-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mp-skill { --c: #94a3b8; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 500; }
.mp-skill-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.mp-skill-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-skill-count { margin-left: 2px; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-skill-add { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 3px 12px; border: 1px dashed color-mix(in srgb, var(--primary) 45%, var(--border)); border-radius: var(--radius-pill); background: var(--surface); color: var(--primary-600); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background-color 0.2s, border-color 0.2s; }
.mp-skill-add:hover { border-color: var(--primary); background: var(--primary-50); }
/* GĐ5c: thẻ chuyên môn bấm được (người quản lý nhãn) + menu Chỉnh sửa / Đổi màu / Xóa + thanh cầu vồng */
button.mp-skill { font: inherit; font-size: 12.5px; cursor: pointer; transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s; }
button.mp-skill:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--border)); background: color-mix(in srgb, var(--c) 7%, var(--surface)); }
button.mp-skill.is-open { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.sk-pop { min-width: 190px; }
.sk-sub { width: 250px; padding: 12px; }
.sk-swatches { display: flex; gap: 8px; margin-bottom: 12px; }
.sk-swatch { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 2px solid var(--surface); border-radius: 50%; background: var(--c); color: #fff; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent); cursor: pointer; transition: transform 0.2s; }
.sk-swatch:hover { transform: scale(1.1); }
.sk-swatch.is-on { box-shadow: 0 0 0 2px var(--c); }
.sk-hue-row { display: flex; align-items: center; gap: 10px; }
.sk-preview { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 1px var(--border); }
.sk-hue { position: relative; flex: 1; height: 12px; border-radius: 99px; background: linear-gradient(90deg, #ef4444, #f59e0b, #eab308, #22c55e, #14b8a6, #3b82f6, #8b5cf6, #ec4899, #ef4444); cursor: pointer; touch-action: none; }
.sk-hue:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.sk-hue-thumb { position: absolute; top: 50%; width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35); transform: translate(-50%, -50%); pointer-events: none; }
.sk-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { button.mp-skill, .sk-swatch { transition: none; } }
@media (max-width: 560px) { .mp-skills .mp-box-head { flex-wrap: wrap; } }
/* Mục 9: rê / Tab vào lời mời = nền xanh nhạt + viền xanh nhạt, dòng "Hết hạn: … (còn n ngày)" trượt mở (hàng lưới 0fr -> 1fr) */
.mp-box .invite-row { transition: background-color 0.2s, border-color 0.2s; }
.mp-box .invite-row:hover, .mp-box .invite-row:focus-within { border-color: color-mix(in srgb, var(--primary) 30%, var(--border-soft)); background: #f1f8fe; }
.mp-inv-more { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.2s ease, opacity 0.2s ease; }
.mp-inv-more > span { min-height: 0; overflow: hidden; font-size: 12.5px; color: var(--ink-soft); }
.mp-box .invite-row:hover .mp-inv-more, .mp-box .invite-row:focus-within .mp-inv-more { grid-template-rows: 1fr; opacity: 1; }
@media (hover: none) { .mp-inv-more { grid-template-rows: 1fr; opacity: 1; } } /* màn cảm ứng không rê được: luôn hiện hạn */
@media (prefers-reduced-motion: reduce) { .mp-box .invite-row, .mp-inv-more { transition: none; } }
.mp-box .invite-row.is-expired { border-style: solid; }
.mp-box .invite-row.is-expired .invite-info span { color: var(--ink-soft); } /* chỉ phần "Đã hết hạn …" màu đỏ như mẫu */
/* Thẻ chuyên môn / nhóm ở trang này: cùng 1 cỡ (team-chip cũ có font: inherit nên to hơn), chữ đậm vừa, rõ như mẫu */
.mp-card .skill-chip, .mp-suggest .skill-chip { padding: 3px 10px; font-size: 12.5px; font-weight: 500; color: var(--ink); }
.mp-box .invite-actions { flex: none; gap: 8px; }
.mp-box .invite-actions .btn-secondary { display: inline-flex; align-items: center; gap: 6px; height: 36px; border-radius: 10px; }
.mp-btn-danger.btn-secondary { border-color: #fecdd3; background: #fff1f2; color: #e11d48; }
.mp-btn-danger.btn-secondary:hover { border-color: #fda4af; background: #ffe4e6; }
.mp-suggest-list { display: flex; flex-direction: column; gap: 8px; }
.mp-suggest-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 14px; }
.mp-suggest-who { display: inline-flex; align-items: center; gap: 10px; flex: 1 1 0; min-width: 0; }
.mp-suggest-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink); }
.mp-suggest-arrow { display: inline-flex; flex: none; color: var(--muted); }
.mp-suggest-team { display: inline-flex; flex: 1 1 0; min-width: 0; }
.mp-suggest-team .team-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mp-suggest-apply.btn-primary { flex: none; height: 34px; padding: 0 14px; border-radius: 10px; }
@media (max-width: 1100px) { .mp-bottom { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .mp-box .invite-row { flex-wrap: wrap; }
  .mp-box .invite-actions { width: 100%; justify-content: flex-end; }
  .mp-suggest-row { flex-wrap: wrap; }
  .mp-suggest-apply.btn-primary { margin-left: auto; }
}
.mp-tools { margin-bottom: 12px; gap: 10px; }
.mp-card .mp-tools .search-field { flex: 1 1 180px; min-width: 160px; max-width: 290px; } /* .mp-card: thắng container query của trang Nhóm (.tmg-tools) nằm sau trong file */
.mp-tools .search-field > svg { flex: none; }
.mp-tools .search-field { overflow: hidden; }
.mp-tools .search-field input { min-width: 0; text-overflow: ellipsis; } /* ô hẹp khi zoom: chữ gợi ý cắt bằng …, không đè sang nút bên cạnh */
.mp-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-tab { box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--border-soft); border-radius: 13px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.mp-tab:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--primary-50); }
.mp-tab.is-on { border-color: color-mix(in srgb, var(--primary) 35%, var(--surface)); background: var(--primary-50); color: var(--primary-600); }
.mp-tab span { font-variant-numeric: tabular-nums; }
.mp-tab-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.mp-tools .mp-filter-btn .role-filter-badge { position: absolute; top: -6px; right: -6px; }
.mp-tools .mp-filter-btn { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600; transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s; }
.mp-tools .mp-filter-btn svg { color: var(--ink-soft); }
.mp-tools .mp-filter-btn:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background-color: var(--primary-50); }
.mp-tools .mp-filter-btn.is-open { border-color: var(--primary); background-color: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.mp-tools .mp-filter-btn.is-open svg, .mp-tools .mp-filter-btn.is-active svg { color: var(--primary-600); }
/* GĐ5a: Bộ lọc nâng cao (ảnh mẫu mục 10) — khung nổi dưới nút lọc, mép phải thẳng nút */
.mf-wrap { position: relative; }
.mf-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 45; width: 340px; max-width: calc(100vw - 24px); padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14); }
.mf-panel.is-anim { animation: mp-tip-in 0.2s ease; } /* chỉ lúc vừa mở, vẽ lại khi tích chọn không chạy lại */
.mf-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--primary-600); }
.mf-head b { flex: 1; font-size: 14.5px; color: var(--ink); }
.mf-close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.mf-close:hover { background: var(--bg); color: var(--ink); }
.mf-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: start; gap: 10px; margin-bottom: 10px; }
.mf-label { padding-top: 9px; font-size: 13px; font-weight: 600; color: var(--ink); }
.mf-field-wrap { min-width: 0; }
.mf-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s; }
.mf-field span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-field.has-value { color: var(--ink); font-weight: 600; }
.mf-field svg { flex: none; color: var(--ink-soft); transition: transform 0.2s; }
.mf-field:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--primary-50); }
.mf-field.is-open { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.mf-field.is-open svg { transform: rotate(180deg); }
/* Tối đa 4 mục (4 × 34px + đệm), dài hơn cuộn bằng thanh mỏng, mờ (chủ dự án chốt) */
.mf-list { max-height: 146px; margin-top: 6px; padding: 4px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 10px; background: #fbfcfe; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.mf-list::-webkit-scrollbar { width: 5px; }
.mf-list::-webkit-scrollbar-track { background: transparent; }
.mf-list::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--scroll-thumb); }
.mf-opt .ml-role { max-width: 100%; padding: 2px 9px; font-size: 12.5px; }
.mf-opt { display: flex; align-items: center; gap: 8px; min-height: 34px; box-sizing: border-box; padding: 4px 8px; border-radius: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.mf-opt:hover { background: var(--primary-50); }
.mf-opt input, .mf-check input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.mf-opt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-opt-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mf-status { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.mf-status .mf-label { padding-top: 0; }
.mf-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.mf-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.mf-foot .btn-secondary, .mf-foot .btn-primary { height: 36px; padding: 0 16px; border-radius: 10px; }
.mf-foot .btn-primary { min-width: 120px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .mf-panel { animation: none; } .mf-field, .mf-field svg { transition: none; } }
.mp-card .mp-tools .mp-sort { flex: 0 1 178px; width: 178px; }
.mp-tools .mp-sort .cselect-btn .cselect-value { color: var(--ink); font-weight: 600; }
.mp-tools .member-layout-toggle { box-sizing: border-box; align-items: center; height: 40px; padding: 4px; border-color: var(--border-soft); border-radius: 13px; }
.mp-tools .member-layout-btn { width: 32px; height: 30px; border-radius: 9px; }
/* Co giãn / zoom (chủ dự án: hàng tab · tìm · lọc · sắp xếp · Mời không được rớt dòng khi zoom):
   1) chữ, chiều cao, đệm theo vw (clamp: đúng cỡ gốc ở màn ~1586px, nhỏ nhất 12px / 34px);
   2) container query theo bề rộng thẻ: hẹp dần thì Sắp xếp hẹp lại -> nút Mời chỉ còn dấu + -> Sắp xếp chỉ còn biểu tượng;
   3) thẻ < 760px (máy tính bảng / điện thoại) mới cho ô tìm xuống 1 hàng riêng. */
.mp-card { container: mpcard / inline-size; }
.mp-tools { --mp-h: clamp(34px, 2.53vw, 40px); --mp-fs: clamp(12px, 0.86vw, 13.5px); --mp-px: clamp(10px, 0.9vw, 14px); gap: clamp(6px, 0.63vw, 10px); }
.mp-tools .mp-tab, .mp-tools .search-field, .mp-tools .tmg-select, .mp-tools .btn-primary, .mp-tools .member-layout-toggle { height: var(--mp-h); }
.mp-tools .mp-filter-btn { width: var(--mp-h); height: var(--mp-h); }
.mp-tools .mp-tabs { gap: clamp(4px, 0.5vw, 8px); }
.mp-tools .mp-tab { gap: 6px; padding: 0 var(--mp-px); font-size: var(--mp-fs); }
.mp-tools .search-field input, .mp-tools .tmg-select, .mp-tools .btn-primary { font-size: var(--mp-fs); }
.mp-tools .member-layout-btn { height: calc(var(--mp-h) - 10px); }
.mp-tools .mp-invite-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
@container mpcard (max-width: 1150px) {
  .mp-card .mp-tools .mp-sort { flex-basis: 150px; width: 150px; }
  .mp-card .mp-tools .search-field { min-width: 140px; }
}
@container mpcard (max-width: 1000px) {
  .mp-card .mp-tools .mp-invite-btn { justify-content: center; width: var(--mp-h); padding: 0; }
  .mp-card .mp-invite-btn .mp-btn-text { display: none; }
}
@container mpcard (max-width: 860px) {
  .mp-card .mp-tools .search-field { flex-basis: 130px; min-width: 130px; }
  .mp-card .mp-tools .mp-sort { flex: none; width: var(--mp-h); }
  .mp-card .mp-tools .mp-sort .cselect-btn { padding: 0; }
  .mp-card .mp-tools .mp-sort .cselect-value, .mp-tools .mp-sort .cselect-caret { display: none; }
  .mp-card .mp-tools .mp-sort > svg { left: 50%; transform: translate(-50%, -50%); }
}
@container mpcard (max-width: 760px) {
  .mp-card .mp-tools .toolbar-spacer { display: none; }
  .mp-card .mp-tools .search-field { order: 10; flex: 1 1 100%; max-width: none; }
}
.role-filter-foot { display: flex; align-items: center; gap: 8px; margin: 6px -6px -6px; padding: 10px 14px; white-space: nowrap; border-top: 1px solid var(--border-soft); color: var(--primary-600); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background-color 0.2s; }
.role-filter-foot:hover { background: var(--primary-50); }
.role-filter-foot svg { flex: none; }
@media (max-width: 1200px) { .mp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .mp-kpis { grid-template-columns: minmax(0, 1fr); }
  .mp-head-art { display: none; }
  .mp-card { padding: 12px 10px 6px; }
  .mp-tabs { flex: 1 1 100%; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
}
@media (prefers-reduced-motion: reduce) { .mp-tab, .mp-tools .mp-filter-btn, .role-filter-foot { transition: none; } }
/* Chấm màu trong ô chọn (data-pill="dot"): trạng thái nhóm, chuyên môn */
.cs-dot-pill { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.cs-dot-pill i { flex: none; width: 8px; height: 8px; border-radius: 50%; }

.tmg-split { display: grid; grid-template-columns: 30% minmax(0, 1fr); gap: 12px; align-items: stretch; }
.tmg-list, .tmg-panel { min-width: 0; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 18px; box-shadow: var(--shadow-sm); }
/* Cột trái cao đúng bằng cột phải (contain: size = chiều cao danh sách không đẩy hàng cao thêm), danh sách nhóm cuộn bên trong */
.tmg-list { display: flex; flex-direction: column; padding: 12px; background: #f7f9fc; contain: size; min-height: 420px; }
.tmg-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 12px; }
.tmg-list-head h2 { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.tmg-sort-wrap > svg { left: 8px; }
.tmg-sort { height: 30px; padding: 0 8px 0 28px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; max-width: 170px; }
.tmg-sort.cselect-btn .cselect-value { color: var(--ink-soft); }
.tmg-sort:hover { background: #eef2f7; }
.tmg-sort:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Danh sách nhóm cuộn riêng khi nhiều nhóm; thanh cuộn mảnh, nhạt */
.tmg-list-scroll { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; overflow-y: auto; padding: 2px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
/* Thẻ nhóm (bảng thông số thiết kế tương tác 11/2026): đệm 16px, bo 12px, khe 2 hàng 8px; viền #E5E7EB, nền trắng;
   rê chuột: chỉ đổi nền xanh rất nhạt (chủ dự án chốt 11/11, không tô viền); đang chọn: phần trên tô xanh nhạt, phần dưới nhạt hơn */
.tmg-card {
  display: flex; flex-direction: column; gap: 0; padding: 16px; cursor: pointer;
  background: var(--surface); border: 1px solid #e5e7eb; border-radius: 12px;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tmg-card:hover { background: var(--primary-50); }
.tmg-card:hover .tmg-card-top { background: var(--primary-50); }
.tmg-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tmg-card.is-on { background: color-mix(in srgb, var(--primary) 2.5%, #fff); border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.tmg-card.is-on .tmg-card-top { background: color-mix(in srgb, var(--primary) 7%, #fff); }
.tmg-card.is-archived { border-style: dashed; }
.tmg-card-top { display: flex; align-items: flex-start; gap: 12px; min-width: 0; margin: -16px -16px 0; padding: 16px 16px 8px; border-radius: 11px 11px 0 0; transition: background-color 0.2s; }
.tmg-avatar { width: 44px; height: 44px; border-radius: 11px; font-size: 15px; }
.tmg-card-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.tmg-card-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tmg-card-name strong { min-width: 0; font-size: 14px; font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-card-desc { font-size: 12px; font-weight: 400; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Chuông + chấm xanh: nhóm có lời mời đang chờ trả lời */
.tmg-bell { position: relative; flex: none; display: inline-flex; color: var(--primary-600); }
.tmg-bell i { position: absolute; top: -2px; right: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1.5px #fff; }
.tmg-card .pl-menu-dots { flex: none; margin: -4px -4px 0 0; }
/* Nút … ở trang Nhóm luôn hiện như ảnh mẫu (bảng khác chỉ hiện khi rê chuột) */
.tmg-card .pl-menu-dots, .tmg-table .pl-menu-dots { opacity: 1; }
.tmg-table .pl-menu-dots { margin: 0 auto; }
.tmg-card { --tmg-text-x: 56px; }
.tmg-card-meta { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding-top: 8px; font-size: 12px; font-weight: 500; color: #334155; }
.tmg-card-meta::before { content: ""; position: absolute; top: 0; left: var(--tmg-text-x); right: 0; border-top: 1px solid #eef1f5; }
.tmg-card-count { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tmg-card-count svg { flex: none; color: var(--ink-soft); }
.tmg-card-sep { flex: none; width: 1px; height: 19px; background: #e8ecf1; }
.tmg-load { display: grid; grid-template-columns: 64px; justify-items: end; gap: 4px; margin-left: auto; flex: none; }
.tmg-load b { font-size: 12px; font-weight: 600; color: #0f172a; font-variant-numeric: tabular-nums; }
.tmg-load i { display: block; width: 64px; height: 8px; border-radius: 99px; background: var(--border-soft); overflow: hidden; }
.tmg-load em { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.tmg-card-lead { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: #334155; }
.tmg-card-lead > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-card-lead.is-none { color: #c2410c; }
.tmg-mini-av { width: 22px; height: 22px; font-size: 9.5px; flex: none; }

.tmg-panel { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.tmg-panel > .empty-state { padding: 48px 16px; }
.tmg-panel-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tmg-avatar-xl { width: 56px; height: 56px; border-radius: 14px; font-size: 20px; }
.tmg-panel-title { flex: 1; min-width: 0; }
.tmg-panel-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tmg-panel-name h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-panel-title p { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-status { flex: none; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; background: var(--bg); color: var(--ink-soft); }
.tmg-status.is-on { background: var(--success-50, #ecfdf5); color: var(--success-600, #15803d); }
.tmg-panel-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tmg-panel-actions .btn-secondary { height: 38px; color: var(--ink); font-size: 12.5px; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.tmg-dots { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
/* Nút đầu nhóm (thiết kế tương tác 11/2026): rê chuột nền xanh nhạt + chữ / biểu tượng xanh; nhấn / menu đang mở viền xanh, nền đậm hơn 1 nấc */
.tmg-panel-actions .btn-secondary:hover, .tmg-dots:hover { background: var(--primary-50); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); color: var(--primary-600); }
.tmg-panel-actions .btn-secondary:active, .tmg-dots:active, .tmg-dots.is-open { background: var(--primary-100); border-color: var(--primary); color: var(--primary-600); }
/* Hàng 5 chỉ số: các ô ngăn bằng vạch dọc mờ, không kẻ khung riêng từng ô */
.tmg-stats { display: grid; grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1.4fr) auto auto; padding: 14px 0; border-top: 2px solid var(--border-soft); border-bottom: 2px solid var(--border-soft); }
.tmg-stat { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 0 16px; border-left: 2px solid var(--border-soft); }
.tmg-stat:first-child { padding-left: 0; border-left: 0; }
.tmg-stat[data-action="tmg-pop"] { margin: -6px 0 -6px -8px; padding: 6px 16px 6px 8px; border-radius: 10px; cursor: pointer; transition: background-color 0.2s; }
.tmg-stat[data-action="tmg-pop"]:hover, .tmg-stat.is-open { background: var(--primary-50); }
.tmg-stat[data-action="tmg-pop"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tmg-stat-ic { flex: none; display: inline-flex; color: var(--primary-600); }
.tmg-stat-ic.is-red { align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--danger-50, #fff1f2); color: var(--danger); }
.tmg-stat-ic.is-orange { color: #c2410c; }
.tmg-stat-av { width: 40px; height: 40px; flex: none; }
.tmg-stat-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tmg-stat-txt > span { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-stat-txt b { font-size: 18px; font-weight: 800; color: var(--ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.tmg-stat-txt b.tmg-stat-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-stat-txt b.tmg-stat-none { color: var(--muted); }
.tmg-stat-txt b.is-green { color: var(--success-600); }
.tmg-stat-txt b.is-red { color: var(--danger); }
.tmg-stat-load { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tmg-bar { display: block; flex: 1; min-width: 40px; max-width: 120px; height: 8px; border-radius: 99px; background: var(--border-soft); overflow: hidden; }
.tmg-bar em { display: block; height: 100%; border-radius: inherit; background: var(--primary); }

/* Bảng "Thành viên trong nhóm": dòng cao cố định, chữ dài cắt bằng …, điện thoại cuộn ngang trong khung */
.tmg-sub { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.tmg-table-wrap { overflow: auto; max-height: 236px; border: 1px solid var(--border-soft); border-radius: 10px; scrollbar-width: none; }
.tmg-table-wrap::-webkit-scrollbar { display: none; }
.tmg-table { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.tmg-table th { position: sticky; top: 0; z-index: 1; height: 34px; padding: 0 10px; background: #f1f5f9; color: var(--ink-soft); font-size: 12.5px; font-weight: 600; text-align: left; white-space: nowrap; }
.tmg-table th:nth-child(1) { width: 22%; }
.tmg-table th:nth-child(2) { width: calc(14% + 10px); }
.tmg-table th:nth-child(3) { width: 22%; }
.tmg-table th:nth-child(4) { width: 15%; }
.tmg-table th:nth-child(5) { width: 17%; }
.tmg-table td { height: 40px; padding: 0 10px; border-top: 1px solid var(--border-soft); color: var(--ink); vertical-align: middle; }
/* Ô đầu (ảnh đại diện) lề trái 15px; các ô khác 5px đệm + 5px lề = 10px mỗi bên */
.tmg-table th:first-child, .tmg-table td:first-child { padding-left: 15px; }
.tmg-table tbody tr { transition: background-color 0.2s; }
.tmg-table tbody tr:hover { background: #f5f9ff; }
/* Ô tích chọn người (thử nghiệm 11/2026): ẩn = rộng 0; rê chuột vào dòng / đã có người được chọn thì mở ra, đẩy ảnh + tên sang phải */
.tmg-first { display: flex; align-items: center; min-width: 0; }
.tmg-first .tmg-person { min-width: 0; }
.tmg-pick { flex: none; display: inline-flex; align-items: center; width: 0; margin-right: 0; opacity: 0; overflow: hidden; cursor: pointer; transition: width 0.2s, margin 0.2s, opacity 0.2s; }
.tmg-pick input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.tmg-table tbody tr:hover .tmg-pick, .tmg-table.has-picks .tmg-pick, .tmg-table tr.is-picked .tmg-pick, .tmg-pick:focus-within { width: 16px; margin-right: 8px; opacity: 1; }
/* Dòng đã tích: chỉ tô nền giống lúc rê chuột, không viền (chủ dự án chốt 11/11) */
.tmg-table tbody tr.is-picked { background: #f5f9ff; }
/* Tiêu đề bảng + thanh thao tác khi đã chọn người */
.tmg-sub-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; flex-wrap: wrap; }
.tmg-pickbar { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); }
.tmg-pickbar b { color: var(--ink); }
.tmg-pick-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.tmg-pick-btn:hover { background: var(--primary-50); color: var(--primary-600); }
.tmg-pick-btn.is-danger { color: var(--danger); }
.tmg-pick-btn.is-danger:hover { background: var(--danger-50); color: var(--danger); }
/* Nút ⋯ từng dòng: rê chuột nền xanh nhạt, đang mở menu nền đậm hơn + viền xanh */
.tmg-table .pl-menu-dots:hover { background: var(--primary-50); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); color: var(--primary-600); }
.tmg-table .pl-menu-dots.is-open { background: var(--primary-100); border-color: var(--primary); color: var(--primary-600); }
/* Thanh tải: rê chuột đậm hơn (quá tải giữ màu đỏ) */
.tmg-bar em, .tmg-load em { transition: background-color 0.2s; }
.tmg-mload:not(.is-over):not(.is-high):hover .tmg-bar em, .tmg-stat-load:hover .tmg-bar em, .tmg-load:hover em { background: var(--primary-600); }
.tmg-table tr.is-pending td { color: var(--ink-soft); }
.tmg-td-menu { width: 76px; text-align: center; }
th.tmg-td-menu { text-align: center; }
.tmg-person { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.tmg-person > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-person:hover > span { text-decoration: underline; }
.tmg-row-av { width: 26px; height: 26px; flex: none; font-size: 10px; }
.tmg-role { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-pill); background: #f1f5f9; color: var(--ink-soft); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tmg-role.is-lead { background: #fff4dc; color: #ea8a00; }
.tmg-tags { display: flex; align-items: center; gap: 1px; min-width: 0; overflow: hidden; }
.tmg-tag { flex: 0 1 auto; display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 120px; padding: 2px 8px; border: 1px solid var(--border-soft); border-radius: 8px; background: #fff; color: var(--ink);
  font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-tag i { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.tmg-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tmg-tags .ml-more { flex: none; }
/* Trạng thái hiện diện */
.tmg-pres { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tmg-pres i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tmg-pres.is-online { background: var(--success-50); color: var(--success-600); }
.tmg-pres.is-away { background: #fff7ed; color: #c2410c; }
.tmg-pres.is-hidden { background: #fef9c3; color: #a16207; }
.tmg-pres.is-offline { border: 1px solid #d5dbe3; color: var(--ink-soft); padding: 2px 9px; }
.tmg-pres.is-offline i { background: #cbd5e1; }
.tmg-pres.is-pending { background: #f1f5f9; color: var(--ink-soft); }
.tmg-mload { display: flex; align-items: center; gap: 10px; }
.tmg-mload b { min-width: 36px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tmg-mload.is-high .tmg-bar em { background: #f59e0b; }
.tmg-mload.is-over .tmg-bar em { background: var(--danger); }
.tmg-none { color: var(--muted); }
.tmg-link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--danger); cursor: pointer; }
.tmg-link-btn:hover { text-decoration: underline; }

/* Trạng thái rỗng / lỗi của cả trang Nhóm: chữ + nút ở giữa */
.tmg-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 24px; }

/* 2 khối dưới: Phân bố chuyên môn | Cần chú ý */
.tmg-bottom { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.tmg-box { min-width: 0; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); }
.tmg-box-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tmg-box-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
/* Link "Xem tất cả →": chữ xanh; rê chuột viên nền xanh nhạt; nhấn tô xanh đầy chữ trắng */
.tmg-all-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--primary-600); cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.tmg-all-link:hover { background: var(--primary-50); }
.tmg-all-link:active { background: var(--primary); color: #fff; }
.tmg-box-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-50); color: var(--primary-600); }
.tmg-box-ic.is-red { background: var(--danger-50); color: var(--danger); }
.tmg-box.is-attn { background: #fffafb; border-color: #fdeef1; }
.tmg-box-empty { margin: 8px 0 4px; font-size: 13px; color: var(--ink-soft); }
.tmg-box-ok { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 13px; font-weight: 600; color: var(--success-600); }
.tmg-skill { display: flex; align-items: center; gap: 20px; min-width: 0; }
.tmg-donut { position: relative; flex: none; width: 124px; height: 124px; }
.tmg-donut svg { display: block; width: 100%; height: 100%; }
.tmg-donut-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.tmg-donut-txt b { font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.tmg-donut-txt small { font-size: 11.5px; color: var(--ink-soft); }
/* Chú giải tối đa 4 dòng, dư thì cuộn bằng thanh mảnh mờ */
.tmg-legend { flex: 1; min-width: 0; margin: 0; padding: 0 4px 0 0; list-style: none; max-height: 123px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tmg-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 34px; align-items: center; gap: 8px; height: 30px; padding: 0 6px; border-radius: 8px; font-size: 13px; color: var(--ink); cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.tmg-legend li.is-hl, .tmg-legend li.is-on { background: color-mix(in srgb, var(--c) 12%, #fff); }
.tmg-legend li.is-hl span, .tmg-legend li.is-on span { color: color-mix(in srgb, var(--c) 80%, #0f172a); font-weight: 600; }
.tmg-arc { cursor: pointer; transition: stroke-width 0.2s; }
.tmg-arc.is-hl, .tmg-arc.is-on { stroke-width: 15; }
.tmg-legend li + li { border-top: 1px solid #eef1f5; }
.tmg-legend li.is-hl, .tmg-legend li.is-on, .tmg-legend li.is-hl + li, .tmg-legend li.is-on + li { border-top-color: transparent; }
.tmg-legend i { width: 10px; height: 10px; border-radius: 50%; }
.tmg-legend span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-legend b { font-weight: 700; font-variant-numeric: tabular-nums; }
.tmg-legend small { font-size: 12px; color: var(--ink-soft); }
.tmg-attn { margin: 0; padding: 0; list-style: none; }
.tmg-attn li { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0 -8px; padding: 0 8px; border-radius: 10px; font-size: 13px; color: var(--ink); cursor: pointer; transition: background-color 0.2s; }
.tmg-attn li:hover, .tmg-attn li.is-on { background: #fdeef1; }
.tmg-attn li:hover + li, .tmg-attn li.is-on + li { border-top-color: transparent; }
.tmg-attn li + li { border-top: 1px solid var(--border-soft); }
.tmg-attn li > span:nth-child(2) { flex: 1; min-width: 0; }
.tmg-attn-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--danger-50); color: var(--danger); }
.tmg-attn-ic.is-violet { background: #f5f3ff; color: #7c3aed; }
.tmg-attn b { flex: none; min-width: 26px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--danger-50); color: var(--danger); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }

/* Khung nổi trang Nhóm (#tmg-pop) + ô tóm tắt khi rê chuột (#tmg-tip): trắng, bo 14px, bóng mềm, hiện dần 0.2 giây */
.tmg-pop { position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 16px); padding: 14px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12); }
.tmg-pop.is-enter { animation: tmgPopIn 0.2s ease; }
.tmg-pop.is-lead { width: 320px; }
.tmg-pop.is-skill, .tmg-pop.is-attn { width: 360px; }
.tmg-pop.is-wide { width: 470px; }
@keyframes tmgPopIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tmg-pop-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tmg-pop-head > b { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-pop-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; }
.tmg-pop-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background-color 0.2s; }
.tmg-pop-x:hover { background: var(--bg); color: var(--ink); }
.tmg-pop-sub { margin: 2px 0 10px; font-size: 12.5px; color: var(--ink-soft); }
.tmg-pop-sub.is-tight { margin-top: -5px; }
.tmg-pop-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tmg-pop-av { width: 46px; height: 46px; flex: none; font-size: 15px; }
.tmg-pop-av-sm { width: 34px; height: 34px; flex: none; font-size: 12px; }
.tmg-pop-av-xs { width: 22px; height: 22px; flex: none; font-size: 9px; }
.tmg-pop-person-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tmg-pop-person-txt b { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-pop-person-txt > span { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-pop-pres { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.tmg-pop-pres i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tmg-pop-person-txt .tmg-pop-pres.is-online { color: var(--success-600); }
.tmg-pop-person-txt .tmg-pop-pres.is-away { color: #c2410c; }
.tmg-pop-person-txt .tmg-pop-pres.is-hidden { color: #a16207; }
.tmg-pop-person-txt .tmg-pop-pres.is-offline { color: var(--ink-soft); }
.tmg-pop-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.tmg-pop-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border: 1px solid var(--border-soft); border-radius: 12px; background: #f8fafc; color: var(--primary-600); text-align: center; transition: background-color 0.2s, border-color 0.2s; }
.tmg-pop-tile:hover { background: var(--primary-50); border-color: color-mix(in srgb, var(--primary) 30%, var(--border-soft)); }
.tmg-pop-tile.is-red:hover { background: var(--danger-50); border-color: color-mix(in srgb, var(--danger) 25%, var(--border-soft)); }
.tmg-pop-tile.is-red { color: var(--danger); }
.tmg-pop-tile b { font-size: 17px; font-weight: 800; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.tmg-pop-tile span { font-size: 11px; line-height: 1.2; color: var(--ink-soft); white-space: nowrap; }
.tmg-pop-acts { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.tmg-pop-act { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; text-align: left; transition: background-color 0.2s, color 0.2s; }
.tmg-pop-act svg { color: var(--ink-soft); transition: color 0.2s; }
.tmg-pop-act:hover { background: var(--primary-50); color: var(--primary-600); }
.tmg-pop-act:hover svg { color: var(--primary-600); }
/* Danh sách trong khung: tối đa 2 dòng (chuyên môn) / 5 dòng, dư thì cuộn bằng thanh mảnh mờ */
.tmg-pop-list { display: flex; flex-direction: column; max-height: 290px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tmg-pop-list.is-2 { gap: 0; max-height: 179px; } /* 2 thẻ × 90px, đường kẻ giữa chồng lên nhau còn 1 */
.tmg-pop-card + .tmg-pop-card { margin-top: -1px; }
.tmg-pop-card { flex: none; box-sizing: border-box; height: 90px; padding: 10px 2px; border-top: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; }
.tmg-pop-card-top { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.tmg-pop-tags { gap: 4px; margin-top: 8px; }
.tmg-pop-row { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; font: inherit; color: var(--ink); text-align: left; }
.tmg-pop-row:last-child { border-bottom: 0; }
.tmg-pop-row.is-compact { min-height: 40px; padding: 6px 4px; gap: 8px; }
.tmg-pop-row.is-compact .tmg-pop-row-txt b { font-size: 13px; }
.tmg-pop-row.is-pick { min-height: 48px; border-radius: 9px; cursor: pointer; transition: background-color 0.2s; }
.tmg-pop-row.is-pick:hover { background: var(--primary-50); }
.tmg-pop-row-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tmg-pop-row-txt b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-pop-row-txt small { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-pop-badge { flex: none; align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); background: #f1f5f9; color: var(--ink-soft); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tmg-pop-badge.is-ok { background: var(--success-50); color: var(--success-600); }
.tmg-pop-due { flex: none; font-size: 12px; font-weight: 600; color: var(--danger); white-space: nowrap; }
.tmg-pop-pill { flex: none; height: 28px; padding: 0 10px; border: 0; border-radius: var(--radius-pill); background: var(--primary-50); font: inherit; font-size: 12px; font-weight: 600; color: var(--primary-600); cursor: pointer; white-space: nowrap; transition: background-color 0.2s; }
.tmg-pop-pill:hover { background: var(--primary-100); }
.tmg-pop-pill:disabled { opacity: 0.6; cursor: default; }
.tmg-pop-tablewrap { max-height: 250px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tmg-pop-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tmg-pop-table th { position: sticky; top: 0; height: 34px; padding: 0 8px; background: #f1f5f9; color: var(--ink-soft); font-weight: 600; text-align: left; white-space: nowrap; }
.tmg-pop-table td { height: 40px; padding: 4px 8px; border-top: 1px solid var(--border-soft); color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.tmg-pop-table td.is-red { color: var(--danger); font-weight: 700; }
.tmg-pop-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tmg-pop-who > span { display: flex; flex-direction: column; min-width: 0; }
.tmg-pop-who b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-pop-who small { color: var(--ink-soft); }
.tmg-pop-pct { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--danger-50); color: var(--danger); font-weight: 700; }
.tmg-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.tmg-pop-foot .tmg-pop-cta { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; }
.tmg-pop-foot .tmg-all-link { height: 32px; margin-left: auto; padding: 0 14px; }
.tmg-tip { position: fixed; z-index: 61; min-width: 170px; max-width: 280px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12); pointer-events: none; animation: tmgPopIn 0.2s ease; font-size: 12.5px; color: var(--ink); }
.tmg-tip-title { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; }
.tmg-tip-title i { width: 9px; height: 9px; border-radius: 50%; }
.tmg-tip-line { display: block; margin-top: 4px; color: var(--ink-soft); }
.tmg-tip-line em { margin: 0 4px; font-style: normal; color: var(--border); }
.tmg-tip-line b { color: var(--ink); }
.tmg-tip-row { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.tmg-tip-row .tmg-tip-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmg-tip-row b.is-red { color: var(--danger); font-weight: 700; }
.tmg-tip-more { display: block; margin-top: 4px; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) {
  .tmg-pop.is-enter, .tmg-tip { animation: none; }
  .tmg-legend li, .tmg-arc, .tmg-attn li, .tmg-stat[data-action="tmg-pop"], .tmg-pop-act, .tmg-pop-row.is-pick, .tmg-pop-tile { transition: none; }
}

@container (max-width: 1100px) {
  .tmg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 1100px) {
  .tmg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .tmg-stat:nth-child(4) { padding-left: 0; border-left: 0; }
}
@container (max-width: 820px) {
  .tmg-split { grid-template-columns: minmax(0, 1fr); }
  .tmg-bottom { grid-template-columns: minmax(0, 1fr); }
  .tmg-tools .search-field { flex: 1 1 100%; }
  .tmg-list { contain: none; min-height: 0; }
  .tmg-list-scroll { flex: none; max-height: 360px; }
  .tmg-panel-head { flex-wrap: wrap; }
  .tmg-panel-actions { width: 100%; flex-wrap: wrap; }
}
@container (max-width: 520px) {
  .tmg-kpis { grid-template-columns: minmax(0, 1fr); }
  .tmg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tmg-stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .tmg-stat:nth-child(4) { padding-left: 16px; border-left: 2px solid var(--border-soft); }
  .tmg-tools .tmg-sel { flex: 1 1 100%; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .tmg-card, .tmg-card-top, .tmg-table tbody tr, .tmg-pick, .tmg-pick-btn, .tmg-all-link, .tmg-bar em, .tmg-load em { transition: none; }
}
/* Nhóm phụ trách cạnh avatar người phụ trách (chi tiết việc): chỉ xem, đổi trong ô chọn người */
.task-team-chips { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: 8px; min-width: 0; }
.task-team-chips .team-chip { cursor: default; font-size: 11.5px; max-width: 140px; }
.task-team-chips .team-chip:hover { border-color: var(--border); }

.team-detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.team-detail-title { flex: 1; min-width: 160px; }
.team-detail-title h2 { margin: 0; font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.team-detail-title h2.project-inline-text { margin-left: -6px; padding: 0 6px; }
.team-title-input { font-size: 20px; font-weight: 800; }
.wf-name.project-inline-text { margin-left: -6px; padding: 1px 6px; }
.team-detail-sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Ô icon nhóm: nền pastel theo màu nhóm, chữ đậm cùng màu */
.team-head-icon {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--tc) 16%, var(--surface)); color: color-mix(in srgb, var(--tc) 80%, var(--ink)); font-weight: 800; font-size: 15px;
}
.team-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.team-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.team-overview .team-card-soft { border: 1px solid var(--border-soft); border-radius: 16px; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05); }
.team-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.team-card-head .set-title { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.team-card-head .team-scope-note { margin: 0; flex: 1; font-weight: 500; color: var(--muted); }
.team-desc-input { resize: vertical; }
.team-desc.project-inline-text { padding: 2px 6px; }
/* Trưởng nhóm: ảnh lớn + tên + chức danh, nút "Đổi ▾" bên phải */
.team-leader-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-leader-person strong { font-size: 15px; }
.team-leader-wrap { position: relative; flex: none; }
.team-leader-btn { border-radius: var(--radius-pill); padding: 6px 14px; }
.team-leader-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 290px; padding: 10px;
  border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md);
}
.team-leader-pop-title { display: block; padding: 4px 4px 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.team-leader-search { display: flex; align-items: center; gap: 6px; height: 34px; margin-bottom: 6px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); }
.team-leader-search:focus-within { border-color: var(--primary); }
.team-leader-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ink); }
.team-leader-list { max-height: 200px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.team-leader-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px; background: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink); transition: background-color 0.2s; }
.team-leader-opt:hover { background: var(--primary-50); }
.team-leader-opt.is-on { background: var(--primary-50); }
.team-leader-opt input { flex: none; appearance: none; width: 16px; height: 16px; margin: 0; border: 1.5px solid #cbd5e1; border-radius: 50%; background: transparent; cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.team-leader-opt input:checked { border: 1.5px solid var(--primary-600); background: radial-gradient(circle, var(--primary-600) 0 4px, transparent 4.5px); }
.team-leader-opt input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.team-leader-opt[hidden] { display: none; }
.team-leader-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.team-leader-foot .btn-secondary, .team-leader-foot .btn-primary { height: 32px; padding: 0 14px; border-radius: 9px; font-size: 13px; }
.team-leader-foot .btn-primary:disabled { opacity: 0.5; cursor: default; }
.team-leader-opt > .avatar { flex: none; }
.team-leader-opt > span:not(.avatar) { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; font-weight: 600; }
.team-leader-opt small { font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.team-leader-opt b { color: var(--success-700); }
.team-overview .team-wide { grid-column: 1 / -1; }
/* Dashboard nhóm (assignee.js teamDashHTML): thẻ số, bản đồ hoạt động, thành viên, dự án, năng suất */
.tdb-head, .tdb-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tdb-head .set-title, .tdb-card-head .set-title { margin: 0; flex: 1; min-width: 140px; }
.tdb-online { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); }
.tdb-online .presence-dot { position: static; border: 0; width: 8px; height: 8px; }
.tdb-period { width: auto; height: 34px; padding: 0 8px; font-size: 13px; }
.tdb-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tdb-kpi { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); font: inherit; color: var(--ink); min-width: 0; }
button.tdb-kpi { cursor: pointer; }
button.tdb-kpi:hover { border-color: var(--primary); }
.tdb-kpi-label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.tdb-kpi-value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.tdb-kpi-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }
.tdb-kpi.is-alert .tdb-kpi-value { color: var(--danger); }
.tdb-kpi.is-ok .tdb-kpi-value { color: var(--success-600); }
.tdb-trend { display: inline-block; padding: 1px 6px; border-radius: var(--radius-pill); font-weight: 700; font-size: 11.5px; }
.tdb-trend.is-up { background: var(--success-50); color: var(--success-700); }
.tdb-trend.is-down { background: var(--danger-50); color: var(--danger); }
.team-overview .tdb-grid { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.tdb-people { display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.tdb-person { display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.tdb-person:hover { background: var(--primary-50); }
.tdb-person-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tdb-person-txt strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdb-person-txt small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdb-person-n { min-width: 26px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--bg); font-size: 12px; font-weight: 700; text-align: center; }
.tdb-projects { display: flex; flex-direction: column; gap: 10px; }
.tdb-project { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; }
.tdb-project-icon { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; font-size: 12px; font-weight: 800; color: var(--pc); background: color-mix(in srgb, var(--pc) 15%, var(--surface)); }
.tdb-project-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tdb-project-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.tdb-project-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdb-project-main small { font-size: 12px; color: var(--muted); }
.tdb-progress { height: 7px; border-radius: var(--radius-pill); background: var(--bg); overflow: hidden; }
.tdb-progress i { display: block; height: 100%; border-radius: inherit; }
.tdb-state { flex-shrink: 0; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; border: 1px solid; }
.tdb-state.is-ok { color: var(--primary-600); border-color: var(--primary); background: var(--primary-50); }
.tdb-state.is-risk { color: var(--danger); border-color: var(--danger); background: var(--danger-50); }
.tdb-state.is-done { color: var(--success-700); border-color: var(--success); background: var(--success-50); }
.tdb-table tbody tr { cursor: pointer; }
@media (max-width: 900px) {
  .tdb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-overview .tdb-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .tdb-kpi-value { font-size: 22px; }
  .tdb-state { display: none; }
}
.team-desc { margin: 0; white-space: pre-wrap; line-height: 1.55; overflow-wrap: anywhere; }
.team-warn { margin: 0 0 8px; color: var(--danger-600); font-size: 13px; }
.team-person {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px; margin: -4px;
  background: none; border: 0; border-radius: var(--radius-sm); font: inherit; color: inherit; text-align: left; cursor: pointer;
}
button.team-person:hover { background: var(--primary-50); }
.team-person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.team-person > span:last-child > span { font-size: 12px; color: var(--ink-soft); }
.team-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
/* Ô thống kê pastel lớn: bấm để mở danh sách việc tương ứng */
.team-stat { --sc: var(--primary-600); padding: 14px 16px; border: 1px solid transparent; border-radius: 14px; background: color-mix(in srgb, var(--sc) 9%, var(--surface)); font: inherit; text-align: left; color: inherit; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
.team-stat:hover, .team-stat:focus-visible { border-color: color-mix(in srgb, var(--sc) 35%, transparent); box-shadow: 0 6px 16px color-mix(in srgb, var(--sc) 16%, transparent); transform: translateY(-1px); outline: none; }
.team-stat.is-blue { --sc: #2563eb; }
.team-stat.is-pink { --sc: var(--danger-600); }
.team-stat.is-violet { --sc: #7c3aed; }
.team-stat.is-blue strong, .team-stat.is-pink strong, .team-stat.is-violet strong { color: var(--sc); }
.team-stat.is-blue span, .team-stat.is-pink span, .team-stat.is-violet span { color: color-mix(in srgb, var(--sc) 75%, var(--ink)); }
.team-stat.is-warn strong { color: var(--warning-700); }
.team-scope-note { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.team-stat strong { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; }
.team-stat span { font-size: 12px; color: var(--ink-soft); }
.team-stat.is-bad strong { color: var(--danger-600); }
.team-stat.is-ok strong { color: var(--success-700); }
.team-load-title { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.team-load { display: flex; flex-direction: column; gap: 6px; }
.team-load-row {
  display: grid; grid-template-columns: auto minmax(0, 160px) 1fr auto; align-items: center; gap: 10px;
  padding: 4px 6px; background: none; border: 0; border-radius: var(--radius-sm); font: inherit; color: inherit; cursor: pointer; text-align: left;
}
.team-load-row:hover { background: var(--primary-50); }
.team-load-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.team-load-bar { height: 9px; border-radius: var(--radius-pill); background: var(--bg); overflow: hidden; }
/* Thanh mỗi người theo màu riêng của người đó, nhạt dần về bên trái */
.team-load-bar i { display: block; height: 100%; min-width: 9px; background: linear-gradient(90deg, color-mix(in srgb, var(--mc, var(--primary)) 45%, var(--surface)), var(--mc, var(--primary))); border-radius: inherit; }
.team-load-bar i[style="width:0%"] { min-width: 0; }
.team-load-n { font-size: 13px; font-weight: 800; min-width: 24px; text-align: right; }
.team-calc-note { display: flex; align-items: center; gap: 2px; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.team-member-list { display: flex; flex-direction: column; }
.team-member-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.team-member-row:last-child { border-bottom: 0; }
.team-member-row.is-pending { opacity: 0.75; }
.team-add-list { max-height: 46vh; overflow-y: auto; }

/* Hồ sơ nhanh thành viên (panel trượt phải) */
/* ===== Hồ sơ thành viên (assignee.js: mqv*) =====
   Đầu bảng tô màu đại diện (--mc, chữ --mc-ink tự chọn sáng / tối), đứng yên; phần dưới cuộn được và trượt sang khi mở chi tiết */
#member-detail-overlay .detail-panel { overflow: hidden; }
.mqv-hero { position: relative; flex: none; padding: 22px 20px 16px; background: var(--mc); color: var(--mc-ink); }
.mqv-close {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  color: var(--mc-ink); background: rgba(0, 0, 0, 0.14); cursor: pointer; transition: background 0.2s;
}
.mqv-close:hover { background: rgba(0, 0, 0, 0.26); }
.mqv-top { display: flex; gap: 14px; align-items: center; padding-right: 30px; }
.mqv-avatar {
  flex: none; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; color: #fff; font-size: 26px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; background: var(--muted);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85);
}
label.mqv-avatar { cursor: pointer; }
.mqv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mqv-head { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mqv-name { margin: 0; font-size: 21px; font-weight: 800; overflow-wrap: anywhere; color: inherit; }
input.mqv-name { width: 100%; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 2px 6px; margin-left: -6px; }
input.mqv-name:hover, input.mqv-name:focus { border-color: currentColor; outline: none; }
.mqv-title { margin: 0; font-size: 13.5px; opacity: 0.9; }
.mqv-title-input { width: 100%; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 3px 6px; margin-left: -6px; font: inherit; font-size: 13.5px; color: inherit; background: transparent; opacity: 0.92; }
.mqv-title-input::placeholder { color: inherit; opacity: 0.7; }
.mqv-title-input:hover, .mqv-title-input:focus { border-color: currentColor; outline: none; }
.mqv-email { margin: 0; font-size: 12.5px; opacity: 0.85; overflow-wrap: anywhere; }
/* Nhãn chuyên môn: hộp nền tối mờ trên màu đại diện (như hàng huy hiệu trong ảnh mẫu), không có tiêu đề */
.mqv-labels { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; padding: 5px; border-radius: 10px; background: rgba(0, 0, 0, 0.16); }
.mqv-label { background: var(--surface); }
.mqv-label-add { width: 24px; height: 24px; display: grid; place-items: center; border: 1px dashed currentColor; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.mqv-label-panel { margin-top: 8px; color: var(--ink); }
.mqv-body { padding: 16px 18px 24px; overflow-x: hidden; }
/* 4 ô thao tác */
.mqv-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mqv-act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); color: var(--ink-soft); font: inherit; cursor: pointer;
  text-decoration: none; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.mqv-act:hover:not(:disabled):not(.mqv-act-time) { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.mqv-act.is-danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-50); color: var(--danger-600); }
.mqv-act:disabled { opacity: 0.4; cursor: not-allowed; }
.mqv-act-time { cursor: default; }
.mqv-act-time small { font-size: 12px; font-weight: 700; color: var(--ink); }
/* Các mục: tiêu đề + hộp bo góc */
.mqv-sec { margin-top: 18px; }
.mqv-sec-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
.mqv-box { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); overflow: hidden; }
.mqv-line {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer;
}
.mqv-line:last-child { border-bottom: 0; }
.mqv-line > svg:first-child { flex: none; color: var(--ink-soft); }
.mqv-line > span { flex: 1; min-width: 0; }
.mqv-line:hover:not(.is-static) { background: var(--surface); }
.mqv-line.is-static { cursor: default; }
.mqv-num { font-weight: 700; color: var(--ink-soft); }
.mqv-sub-num { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.mqv-chev { flex: none; transform: rotate(180deg); color: var(--muted); }
.mqv-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
.mqv-role { max-width: none; }
.mqv-role .label-tag-remove { margin-left: 2px; }
.mqv-role-add { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--ink-soft); cursor: pointer; }
.mqv-role-add:hover, .mqv-role-add[aria-expanded="true"] { border-color: var(--primary); color: var(--primary-600); }
.mqv-perm { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border-soft); font-size: 12.5px; color: var(--ink-soft); }
.mqv-perm.is-strong { color: var(--ink); font-weight: 600; }
.mqv-perm.is-strong svg { color: var(--primary-600); }
.mqv-perm.is-more { font-weight: 700; }
.mqv-all { display: inline-flex; align-items: center; gap: 3px; padding: 2px 4px; border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; cursor: pointer; }
.mqv-all:hover { color: var(--primary-600); }
.mqv-all svg { transform: rotate(180deg); }

/* ===== Hồ sơ thành viên — giao diện pastel (10/2026): panel 480px bo 20px, banner màu đại diện cuộn cùng nội dung ===== */
#member-detail-overlay .detail-panel { max-width: 480px; border-radius: 0; }
#member-detail-overlay .mqv-body { flex: 1; overflow-y: auto; padding: 0 20px 24px; }
#member-detail-overlay .mqv-hero { margin: 0 -20px; padding: 0 20px 4px; background: var(--surface); color: var(--ink); }
#member-detail-overlay .mqv-banner {
  position: relative; height: 150px; margin: 0 -20px;
  /* Lớp trên: phần dưới banner nhạt dần về nền trắng để tên / chức danh nằm ngang avatar vẫn dễ đọc */
  background: linear-gradient(to bottom, transparent 35%, color-mix(in srgb, var(--surface) 60%, transparent) 72%, var(--surface) 100%),
    linear-gradient(120deg, color-mix(in srgb, var(--mc) 80%, #0b1530) 0%, var(--mc) 55%, color-mix(in srgb, var(--mc) 85%, #fff) 100%);
}
#member-detail-overlay .mqv-close {
  top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: rgba(255, 255, 255, 0.18); color: #fff; box-shadow: none;
}
#member-detail-overlay .mqv-close:hover, #member-detail-overlay .mqv-close:focus-visible { background: rgba(255, 255, 255, 0.32); color: #fff; box-shadow: none; }
#member-detail-overlay .mqv-avatar-wrap { position: relative; width: 84px; height: 84px; }
#member-detail-overlay .mqv-avatar {
  width: 84px; height: 84px; font-size: 30px; font-weight: 800; color: color-mix(in srgb, var(--mc) 70%, #0b1530);
  background: linear-gradient(135deg, color-mix(in srgb, var(--mc) 30%, #fff), color-mix(in srgb, var(--mc) 55%, #fff));
  box-shadow: 0 0 0 4px var(--surface), 0 4px 14px rgba(15, 23, 42, 0.12);
}
#member-detail-overlay .mqv-avatar:has(img) { background: var(--surface); }
#member-detail-overlay .mqv-avatar-wrap .presence-dot { right: 2px; bottom: 4px; width: 14px; height: 14px; border-width: 3px; }
/* Avatar trái, thông tin phải, cùng hàng: cả hàng kéo lên đè phần dưới banner (đã nhạt về trắng), chữ căn giữa theo avatar */
#member-detail-overlay .mqv-top { position: relative; display: flex; align-items: center; gap: 14px; padding-right: 0; margin-top: -94px; }
#member-detail-overlay .mqv-avatar-wrap { flex: none; }
#member-detail-overlay .mqv-head { flex: 1; min-width: 0; gap: 1px; padding-top: 0; }
.mqv-seen { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.mqv-seen.is-online { color: var(--success-700); font-weight: 600; }
.mqv-seen.is-away { color: var(--warning-700); }
.mqv-name-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
#member-detail-overlay .mqv-name { font-size: 22px; color: var(--ink); }
#member-detail-overlay input.mqv-name { flex: 1; min-width: 120px; }
#member-detail-overlay input.mqv-name:hover, #member-detail-overlay input.mqv-name:focus { border-color: var(--border); }
.mqv-owner { padding: 2px 10px; border-radius: var(--radius-pill); background: var(--success-50); color: var(--success-700); font-size: 12px; font-weight: 700; white-space: nowrap; }
#member-detail-overlay .mqv-title, #member-detail-overlay .mqv-title-input { color: var(--ink-soft); opacity: 1; font-size: 14px; }
#member-detail-overlay .mqv-title-input::placeholder { color: var(--muted); font-style: italic; opacity: 1; }
#member-detail-overlay .mqv-title-input:hover, #member-detail-overlay .mqv-title-input:focus { border-color: var(--border); }
#member-detail-overlay .mqv-email { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); opacity: 1; }
.mqv-email-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mqv-copy { flex: none; display: inline-flex; align-items: center; padding: 2px 4px; border: 0; border-radius: 5px; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.mqv-copy:hover { color: var(--primary-600); background: var(--primary-50); }
#member-detail-overlay .mqv-labels { display: flex; padding: 0; background: none; gap: 8px; margin-top: 12px; }
#member-detail-overlay .mqv-label { padding: 5px 12px; background: var(--bg); border: 0; font-size: 13px; }
#member-detail-overlay .mqv-label-add, .mqv-dash-add {
  width: auto; height: auto; padding: 5px 12px; border: 1.5px dashed var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--primary-600); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
#member-detail-overlay .mqv-label-add:hover, .mqv-dash-add:hover, .mqv-dash-add[aria-expanded="true"] { border-color: var(--primary); background: var(--primary-50); }
/* 4 thẻ thao tác: icon lớn + nhãn */
#member-detail-overlay .mqv-actions { margin-top: 18px; gap: 10px; }
#member-detail-overlay .mqv-act { min-height: 78px; gap: 6px; border-radius: 14px; background: var(--bg); border: 1px solid var(--border-soft); color: var(--ink-soft); font-size: 13px; font-weight: 700; }
#member-detail-overlay .mqv-act.is-danger { color: var(--danger-600); }
#member-detail-overlay .mqv-act-time { background: var(--surface); }
#member-detail-overlay .mqv-act-time b { font-size: 16px; color: var(--ink); }
#member-detail-overlay .mqv-act-time svg { color: var(--primary-600); }
/* Khối lượng công việc */
.mqv-wls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mqv-wl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 0; border-radius: 14px; font: inherit; text-align: left; cursor: pointer; }
.mqv-wl b { font-size: 26px; line-height: 1.1; }
.mqv-wl span { font-size: 13px; }
.mqv-wl.is-open { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary-600); }
.mqv-wl.is-overdue { background: var(--danger-50); color: var(--danger-600); }
.mqv-wl.is-done { background: var(--success-50); color: var(--success-700); }
.mqv-wl:hover, .mqv-wl:focus-visible { box-shadow: inset 0 0 0 1.5px currentColor; outline: none; }
.mqv-load { margin-top: 12px; }
.mqv-load-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; color: var(--ink-soft); }
.mqv-load-top b { color: var(--ink); }
.mqv-load-bar { display: block; height: 8px; border-radius: var(--radius-pill); background: var(--bg); overflow: hidden; }
.mqv-load-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38bdf8, #3b5bdb); }
.mqv-load.is-over .mqv-load-top b { color: var(--danger-600); }
.ovc-track { display: flex; }
.ovc-track i.is-other { opacity: 0.35; border-radius: 0 999px 999px 0; }
.ovc-proj-h { color: #475569; }
.mqv-load.is-over .mqv-load-bar i { background: var(--danger); }
/* Hoạt động: card trắng, icon vuông pastel */
#member-detail-overlay .mqv-box { background: var(--surface); border-radius: 16px; }
#member-detail-overlay .mqv-line { padding: 12px 14px; gap: 12px; }
#member-detail-overlay .mqv-line:hover:not(.is-static) { background: var(--bg); }
#member-detail-overlay .mqv-line > .mqv-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; }
.mqv-ico.is-comments { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary-600); }
.mqv-ico.is-images { background: color-mix(in srgb, #8b5cf6 14%, var(--surface)); color: #7c3aed; }
.mqv-ico.is-files { background: var(--success-50); color: var(--success-700); }
.mqv-ico.is-tasks { background: var(--warning-50); color: var(--warning-600); }
.mqv-ico.is-logs { background: var(--bg); color: var(--ink-soft); }
#member-detail-overlay .mqv-line .mqv-sub-num { display: block; margin: 1px 0 0; }
#member-detail-overlay .mqv-num { color: var(--ink); }
#member-detail-overlay .mqv-num.is-zero { color: var(--muted); font-weight: 600; }
/* Vai trò / Nhóm: pill + nút thêm nét đứt */
#member-detail-overlay .mqv-role { padding: 5px 12px; border-radius: var(--radius-pill); }
#member-detail-overlay .mqv-role-add { width: 34px; height: 30px; border: 1.5px dashed var(--border); border-radius: var(--radius-pill); color: var(--primary-600); font-size: 15px; font-weight: 700; }
#member-detail-overlay .mqv-chips:not(.mqv-chips-plain) { border: 0; background: none; padding: 0; }
.mqv-chips-plain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mqv-none { font-size: 13.5px; color: var(--muted); }
/* Quyền hạn: chip theo nhóm chức năng */
/* Chip nhóm quyền: tối đa 2 hàng (mỗi chip cao 30px, cách 8px), phần dư xem ở "Tất cả (N)" */
.mqv-pgroups { display: flex; flex-wrap: wrap; gap: 8px; max-height: 68px; overflow: hidden; }
.mqv-pgroup { height: 30px; padding: 0 12px; line-height: 30px; white-space: nowrap; border: 0; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--c, var(--primary)) 14%, var(--surface)); color: color-mix(in srgb, var(--c, var(--primary)) 80%, #0f172a); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.mqv-pgroup:hover { box-shadow: inset 0 0 0 1.5px var(--c, var(--primary)); }
.mqv-pgroup.is-all { --c: #2563eb; }
#member-detail-overlay .mqv-all { text-transform: none; font-size: 13px; color: var(--primary-600); }
@media (max-width: 520px) {
  #member-detail-overlay .detail-panel { border-radius: 0; }
  #member-detail-overlay .mqv-actions { grid-template-columns: repeat(2, 1fr); }
  .mqv-wl b { font-size: 22px; }
}
#member-detail-overlay .mqv-sub-head { top: 0; margin: 14px -20px 12px; padding: 12px 20px; }
/* Danh sách chi tiết trượt từ phải sang (đầu bảng giữ nguyên) */
.mqv-sub.is-entering { animation: mqvIn 0.24s ease-out; }
.mqv-main.is-returning { animation: mqvBackIn 0.24s ease-out; }
@keyframes mqvIn { from { transform: translateX(40%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mqvBackIn { from { transform: translateX(-30%); opacity: 0; } to { transform: none; opacity: 1; } }
.mqv-sub-head { position: sticky; top: -16px; z-index: 2; display: flex; align-items: center; gap: 10px; margin: -16px -18px 12px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--border-soft); }
.mqv-back { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; }
.mqv-back:hover { background: var(--bg); }
.mqv-sub-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mqv-esc { padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg); font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.mqv-list { display: flex; flex-direction: column; gap: 10px; }
.mqv-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.mqv-card-where { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-width: 0; }
.mqv-where { min-width: 0; padding: 0; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.mqv-where:hover { color: var(--primary-600); text-decoration: underline; }
.mqv-where.is-static { cursor: default; text-decoration: none; }
.mqv-proj { flex: none; margin-left: auto; padding: 1px 7px; border-radius: 6px; background: var(--surface); font-size: 11.5px; color: var(--ink-soft); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mqv-card-main { display: flex; gap: 10px; }
.mqv-card-avatar { width: 34px; height: 34px; flex: none; font-size: 12px; }
.mqv-card-body { flex: 1; min-width: 0; }
.mqv-card-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mqv-card-meta b { font-size: 14px; }
.mqv-card-meta small { font-size: 11.5px; color: var(--muted); }
.mqv-text { margin-top: 2px; font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.mqv-text small { display: block; font-size: 11.5px; color: var(--muted); }

.mqv-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mqv-img { display: block; max-width: 100%; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border-soft); }
.mqv-img img { display: block; max-width: 100%; max-height: 260px; object-fit: contain; background: var(--surface); }
.mqv-log { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--bg); font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.mqv-log small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.mqv-list.is-logs { gap: 6px; }
.mqv-more { align-self: center; margin-top: 4px; }
@media (prefers-reduced-motion: reduce) {
  .mqv-sub.is-entering, .mqv-main.is-returning { animation: none; }
}
@media (max-width: 420px) {
  .mqv-avatar { width: 60px; height: 60px; font-size: 20px; }
  .mqv-name { font-size: 18px; }
}
.mqv-tasks { display: flex; flex-direction: column; gap: 4px; }
.mqv-task {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; text-align: left; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.mqv-task:hover { border-color: var(--primary); }
.mqv-task-name { flex: 1; min-width: 120px; font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.mqv-task-meta { font-size: 12px; color: var(--muted); }

/* Lời mời vào nhóm trong chuông thông báo */
.notif-invite-actions { display: flex; gap: 8px; margin-top: 8px; }
.notif-invite-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: var(--radius-pill); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
}
.notif-invite-btn.is-yes { background: var(--success); border-color: var(--success); color: #fff; }
.notif-invite-btn.is-yes:hover { background: var(--success-700); }
.notif-invite-btn.is-no:hover { border-color: var(--danger); color: var(--danger-600); }
.notif-invite-done { margin-top: 6px; font-size: 12px; color: var(--ink-soft); }

@media (max-width: 720px) {
  .team-overview { grid-template-columns: 1fr; }
  .team-load-row { grid-template-columns: auto minmax(0, 1fr) 70px auto; }
  .team-stats { gap: 8px; }
  .team-stat { padding: 10px 11px; }
  .team-stat strong { font-size: 24px; }
  .team-leader-pop { width: min(260px, calc(100vw - 48px)); }
  .mqv-avatar { width: 64px; height: 64px; font-size: 20px; }
}

/* =====================================================
   TRANG "DỰ ÁN": MỌI DỰ ÁN DẠNG DANH SÁCH (projects.js)
   Bố cục theo mẫu: khung bo góc mỗi dự án → nhóm trạng thái → bảng việc
   ===================================================== */
.pl-page-head {
  display: flex;
  align-items: center; /* tìm kiếm / Lọc / Thêm dự án cùng 1 đường giữa, không lệch theo khối tiêu đề 2 dòng */
  gap: 12px;
  flex-wrap: wrap;
}
/* Ô tìm / Lọc / nút cùng chiều cao chung --toolbar-h (khối "Chiều cao chung của mọi thanh công cụ") */
.pl-page-head .search-field:not(.ts-box),
.pl-page-head .filter-btn,
.pl-page-head > .btn-primary {
  height: var(--toolbar-h);
  box-sizing: border-box;
}
.pl-page-title {
  flex: 1;
  min-width: 220px;
}
.pl-page-head .search-field {
  min-width: 160px;
}

.pl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 22px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.pl-crumb {
  padding-left: 54px; /* thẳng hàng với tên dự án (sau mũi tên + chấm màu) */
  font-size: 12.5px;
  color: var(--muted);
}
.pl-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 6px;
}
.pl-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-card-title:hover {
  color: var(--primary-600);
}

/* Mũi tên tam giác: chỉ xuống = đang mở, chỉ sang phải = thu gọn */
.pl-caret {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
}
.pl-caret::before {
  content: "";
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}
.pl-caret.is-open::before {
  transform: none;
}
.pl-caret:hover {
  background: var(--bg);
  color: var(--ink);
}
.pl-caret-space {
  flex-shrink: 0;
  width: 22px;
}

/* Menu ⋯ của dự án: checkbox ẩn + :has() */
.pl-menu {
  position: relative;
}
.pl-menu-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--ink-soft);
  cursor: pointer;
}
.pl-menu-btn:hover,
.pl-menu:has(.pl-menu-toggle:checked) .pl-menu-btn {
  background: var(--bg);
  color: var(--ink);
}
.pl-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.pl-menu:has(.pl-menu-toggle:checked) .pl-menu-panel {
  display: block;
}
.pl-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.pl-menu-item:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

/* Nhóm trạng thái */
.pl-group {
  margin-top: 14px;
}
.pl-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.pl-group-count {
  font-size: 13px;
  color: var(--muted);
}
.pl-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Bảng việc: cột đầu (44px) là ⋮⋮ + ô chọn, nằm lấn sang trái để tên việc vẫn thẳng hàng với thẻ trạng thái.
   Cuộn ngang trên màn hẹp. Đường kẻ nằm trên từng ô (không kẻ dưới cột ⋮⋮ để cột đó như nằm ngoài bảng). */
.pl-table-scroll {
  margin-left: -12px;
  overflow-x: auto;
}
.pl-table {
  min-width: 900px;
}
.pl-row {
  display: grid;
  grid-template-columns: 44px minmax(300px, 2.4fr) repeat(3, minmax(130px, 1fr)) minmax(100px, 0.7fr) minmax(100px, 0.7fr) 48px;
  min-height: 44px;
  cursor: pointer;
}
.pl-row > .pl-cell {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}
.pl-row[data-id]:hover > .pl-cell {
  background: #edf2f8;
}
.pl-row.is-selected > .pl-cell {
  background: var(--primary-50);
}
.pl-row-head {
  min-height: 38px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: default;
}
.pl-row-head > .pl-cell {
  border-bottom-color: #cfd8e3;
}
.pl-cell {
  min-width: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pl-cell-name {
  padding-left: calc(6px + var(--depth, 0) * 28px); /* task con lùi vào theo cấp */
}
.pl-row-head .pl-cell-name {
  padding-left: 6px;
}

/* Cột trái ngoài cùng: ⋮⋮ kéo thả + ô chọn, chỉ hiện khi rê vào dòng (hoặc khi đang được chọn) */
.pl-gutter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding-right: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.pl-row:hover .pl-gutter,
.pl-gutter:focus-within,
.pl-gutter:has(input:checked) {
  opacity: 1;
}
.pl-drag {
  padding: 2px 3px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--muted);
  cursor: grab;
  user-select: none;
}
.pl-drag:hover {
  background: var(--bg);
  color: var(--ink);
}
.pl-drag-space {
  width: 16px;
}
.pl-sel {
  display: inline-flex;
  cursor: pointer;
}
/* Kéo thả: dòng đang kéo mờ đi; vạch xanh = chèn trên / dưới; nền xanh = thả vào làm task con; nhóm đích viền nét đứt */
.pl-row.is-dragging > .pl-cell {
  opacity: 0.45;
}
.pl-row.is-drop-before > .pl-cell {
  box-shadow: inset 0 2px 0 var(--primary-600);
}
.pl-row.is-drop-after > .pl-cell {
  box-shadow: inset 0 -2px 0 var(--primary-600);
}
.pl-row.is-drop-into > .pl-cell {
  background: var(--primary-50);
}
.pl-row.is-drop-into > .pl-cell-name {
  box-shadow: inset 3px 0 0 var(--primary-600);
}
.pl-group.is-drop-target,
.task-list-group.is-drop-target {
  border-radius: var(--radius-sm);
  outline: 2px dashed var(--primary);
  outline-offset: 4px;
  background: rgba(56, 189, 248, 0.05);
}
.pl-status-icon {
  flex-shrink: 0;
  display: inline-flex;
}
/* Biểu tượng trạng thái bấm được (người có quyền đổi trạng thái): có viền khi rê / đang mở */
button.pl-status-icon {
  padding: 2px;
  margin: -2px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
button.pl-status-icon:hover,
button.pl-status-icon.is-open {
  background: var(--primary-50);
  box-shadow: 0 0 0 1px var(--primary-100);
}

/* Ô tên: nút "Thêm task con" + "Đổi tên" hiện ở góc phải khi rê vào */
.pl-name-actions {
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
  padding-left: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pl-cell-name:hover .pl-name-actions,
.task-cell-name:hover .pl-name-actions,
.pl-name-actions:focus-within {
  opacity: 1;
}
.pl-name-btn {
  position: relative;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pl-name-btn:hover {
  border-color: var(--primary-100);
  background: var(--primary-50);
  color: var(--primary-600);
}
/* Chú thích kiểu title: khung trắng có viền theo chủ đề, hiện phía trên nút */
.pl-name-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}
.pl-name-btn:hover::after,
.pl-name-btn:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
/* Hàng đầu nhóm: chú thích hiện phía dưới để không bị khung cuộn che */
.pl-row-head + .pl-row .pl-name-btn::after,
.task-table-head-v2 + .task-table-body-row-v2 .pl-name-btn::after {
  bottom: auto;
  top: calc(100% + 6px);
}

/* Đổi tên / thêm task con tại chỗ */
.pl-rename-input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-50);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  outline: none;
}
.pl-rename-input::placeholder {
  font-weight: 400;
  color: var(--muted);
}
.pl-row.is-renaming,
.pl-row-new {
  cursor: default;
}
.pl-row-new .pl-cell-name {
  grid-column: 2 / -1;
}
/* Cột ⋯ ngoài cùng bên phải: nút hiện khi rê vào dòng (hoặc khi menu đang mở) */
.pl-cell-menu {
  justify-content: center;
  padding: 0 4px;
}
.pl-menu-dots {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.pl-row:hover .pl-menu-dots,
.task-table-body-row-v2:hover .pl-menu-dots,
.pl-menu-dots:focus-visible,
.pl-menu-dots.is-open {
  opacity: 1;
}
.pl-menu-dots:hover,
.pl-menu-dots.is-open {
  border-color: var(--border);
  background: var(--surface);
  color: var(--ink);
}
/* Menu thao tác xòe từ phải sang trái */
.pl-row-menu {
  min-width: 220px;
  transform-origin: top right;
  animation: plMenuIn 0.18s ease-out;
}
@keyframes plMenuIn {
  from { opacity: 0; transform: translateX(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.pl-pop-sep {
  height: 1px;
  margin: 5px 4px;
  background: var(--border-soft);
}
.pl-pop-option.is-danger,
.pl-pop-option.is-danger .pl-pop-icon {
  color: var(--danger-600);
}
.pl-pop-option.is-danger:hover {
  background: var(--danger-50);
  color: var(--danger-600);
}
@media (hover: none) {
  .pl-menu-dots { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-row-menu { animation: none; }
}
.pl-new-error {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--danger-600);
}

/* Các trường còn lại: khung bo tròn nhẹ hiện dần trong 0.2s khi rê vào, bấm để đổi */
.pl-field {
  display: flex;
  align-items: center;
  gap: 6px;
  width: calc(100% + 16px); /* lấn ra 2 bên đúng phần lề âm để khung ôm trọn ô */
  min-height: 34px;
  padding: 0 8px;
  margin: 0 -8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.pl-row:hover .pl-field:hover,
.task-table-body-row-v2:hover .pl-field:hover,
.pl-field:focus-visible,
.pl-field.is-open {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.pl-field.is-open {
  border-color: var(--primary);
}
.pl-field.is-readonly {
  cursor: inherit;
}

/* Ô chọn nổi: trạng thái, ưu tiên, người phụ trách, hạn chót */
.pl-pop {
  position: fixed;
  z-index: 60;
  min-width: 220px;
  max-width: 280px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  animation: plPopIn 0.15s ease-out;
}
@keyframes plPopIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.pl-pop-title {
  padding: 4px 8px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pl-pop-scroll {
  max-height: 260px;
  overflow-y: auto;
}
.pl-pop-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}
.pl-pop-icon {
  display: inline-flex;
}
.pl-pop-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-pop-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
  flex-shrink: 0;
}
.pl-pop-option:hover:not(:disabled),
.pl-pop-option:focus-visible {
  background: var(--primary-50);
  color: var(--ink);
}
.pl-pop-option.is-current {
  font-weight: 600;
  color: var(--ink);
}
.pl-pop-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.pl-pop-check {
  margin-left: auto;
  display: inline-flex;
  color: var(--primary-600);
}
.pl-pop-due {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 4px 4px;
}
.pl-pop-clear {
  align-self: flex-start;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--danger-600);
  cursor: pointer;
}
.pl-pop-clear:hover {
  text-decoration: underline;
}
.pl-pop-hint {
  margin: 0;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .pl-name-actions, .pl-name-btn, .pl-name-btn::after, .pl-field { transition: none; }
  .pl-pop { animation: none; }
}
/* Màn cảm ứng không có rê chuột: luôn hiện nút ở ô tên */
@media (hover: none) {
  .pl-name-actions, .pl-gutter { opacity: 1; }
}
.pl-task-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.pl-meta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}
.pl-empty {
  display: inline-flex;
  color: var(--muted);
  opacity: 0.8;
}
.pl-due {
  font-size: 13px;
  color: var(--ink-soft);
}
.pl-due.is-overdue {
  color: var(--danger-600);
  font-weight: 600;
}
.pl-priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-soft);
}
.pl-priority.is-high svg { color: var(--danger); }
.pl-priority.is-medium svg { color: var(--warning); }
.pl-priority.is-low svg { color: var(--primary); }
/* Số tệp / số bình luận */
.pl-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.pl-count.has-count {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Hàng cuối nhóm: thêm việc nhanh + ô tính toán theo cột */
.pl-row-foot {
  cursor: default;
}
.pl-row-foot > .pl-cell {
  border-bottom: 0;
  min-height: 44px;
}
.pl-quick {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.pl-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 0;
  border-radius: 7px 0 0 7px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.pl-quick-btn:hover {
  color: var(--primary-600);
}
.pl-quick-more {
  display: grid;
  place-items: center;
  width: 28px;
  border-left: 1px solid transparent;
  border-radius: 0 7px 7px 0;
  color: var(--muted);
  cursor: pointer;
}
.pl-quick-more svg {
  transform: rotate(-90deg);
}
.pl-quick:hover .pl-quick-more {
  border-left-color: var(--border);
}
.pl-quick-more:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}
/* Hàng thêm việc nhanh: mỗi trường là 1 khung luôn hiện (giống khung khi rê vào trường ở dòng việc), trống thì chỉ có biểu tượng */
.pl-field.is-box {
  border-color: var(--border);
  background: var(--surface);
}
.pl-field.is-box:hover,
.pl-field.is-box:focus-visible {
  border-color: var(--primary-100);
  box-shadow: var(--shadow-sm);
}
.pl-field.is-box.is-open {
  border-color: var(--primary);
}
.pl-field.is-box.is-readonly {
  background: var(--bg);
  opacity: 0.75;
  cursor: not-allowed;
}

/* Ô bình luận nhanh + danh sách tệp trong ô chọn */
.pl-pop.is-wide {
  min-width: 300px;
  max-width: 340px;
}
.pl-comment-box {
  padding: 0 4px 4px;
}
.pl-comment-input {
  width: 100%;
  min-height: 74px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  resize: vertical;
}
.pl-comment-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
.pl-comment-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.pl-comment-send {
  padding: 6px 14px;
  font-size: 13px;
}
.pl-comment-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pl-link-btn {
  padding: 0 2px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--primary-600);
  cursor: pointer;
}
.pl-link-btn:hover {
  text-decoration: underline;
}
a.pl-file {
  text-decoration: none;
}
.pl-file-ver {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}
.pl-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 8px;
  border-top: 1px solid var(--border-soft);
  font-size: 13.5px;
  color: var(--primary-600);
  cursor: pointer;
}
.pl-upload:hover {
  background: var(--primary-50);
  border-radius: 6px;
}
.pl-empty-project {
  padding: 10px 0 2px 54px;
  font-size: 13.5px;
  color: var(--muted);
}
.pl-link {
  color: var(--primary-600);
  font-weight: 600;
  cursor: pointer;
}
.pl-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .pl-card { padding: 12px 12px 14px; }
  .pl-crumb, .pl-empty-project { padding-left: 0; }
  .pl-table-scroll { margin-left: 0; }
  .pl-page-head .search-field { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-caret::before { transition: none; }
}

/* =====================================================
   TAB DANH SÁCH TRONG DỰ ÁN: BỐ CỤC GIỐNG TRANG "DỰ ÁN"
   Chỉ đổi cách hiển thị (khung, đầu nhóm, đường kẻ, rê chuột, ô chọn bên trái);
   giữ nguyên các cột, kéo đổi độ rộng, ẩn / hiện cột, ô tích tròn, task con, chọn hàng loạt.
   ===================================================== */
/* Cả danh sách nằm trong 1 khung bo góc như mỗi dự án ở trang Dự án */
.task-list-view {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 15px 15px;
  box-shadow: var(--shadow-sm);
}
.task-list-view .task-list-group {
  margin: 14px 0 0;
  border: 0;
  border-radius: 0;
  overflow: visible; /* menu ẩn / hiện cột không bị cắt */
}
.task-list-view .task-list-group-head {
  padding: 0 0 6px;
  background: transparent;
  border-bottom: 0;
  font-size: 13px;
}
/* Mũi tên tam giác: chỉ xuống = đang mở, chỉ sang phải = thu gọn */
.task-list-view .list-group-chevron {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  cursor: pointer;
}
.task-list-view .list-group-chevron::before {
  content: "";
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.15s ease;
}
.task-list-view .list-group-toggle:checked + .task-list-group-head .list-group-chevron::before {
  transform: rotate(-90deg);
}
.task-list-view .list-group-chevron:hover {
  background: var(--bg);
  color: var(--ink);
}

/* Bảng: cột ô chọn lấn sang trái để tên việc thẳng hàng với thẻ trạng thái */
.task-list-view .task-table-scroll {
  margin-left: -2px;
}
.task-list-view .task-table-row-v2 {
  gap: 0;
}
.task-list-view .task-cell-sel {
  order: -1;
}
.task-list-view .task-table-head-v2 {
  min-height: 38px;
  background: transparent;
  border-bottom: 1px solid #cfd8e3;
}
.task-list-view .task-table-head-v2 .task-cell {
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding-top: 9px;
  padding-bottom: 9px;
}
.task-list-view .task-table-head-v2 .task-cell svg {
  display: none;
}
.task-list-view .task-table-body-row-v2 {
  min-height: 44px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}
.task-list-view .task-table-body-row-v2:last-child {
  border-bottom: 1px solid var(--border);
}
.task-list-view .task-table-body-row-v2:hover {
  background: #edf2f8;
}
.task-list-view .task-table-body-row-v2.is-selected {
  background: var(--primary-50) !important;
  box-shadow: none;
}
.task-list-view .task-table-body-row-v2 .task-cell {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 13px;
}
.task-list-view .list-tree-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.task-list-view .task-table-body-row-v2.is-sub .list-tree-text {
  font-weight: 500;
}
/* Ô chọn chỉ hiện khi rê vào dòng (hoặc khi đã chọn) như trang Dự án */
.task-list-view .task-table-body-row-v2 .task-cell-sel input {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.task-list-view .task-table-body-row-v2:hover .task-cell-sel input,
.task-list-view .task-cell-sel input:checked,
.task-list-view .task-cell-sel input:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .task-list-view .task-table-body-row-v2 .task-cell-sel input { opacity: 1; }
}
@media (max-width: 640px) {
  .task-list-view { padding: 4px 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .task-list-view .list-group-chevron::before,
  .task-list-view .task-table-body-row-v2,
  .task-list-view .task-cell-sel input { transition: none; }
}
/* Task con: chỉ lùi vào theo cấp như trang Dự án, không tô dải màu (dòng "dẫn đường" khi lọc vẫn giữ nền sọc) */
.task-list-view .task-table-body-row-v2.is-sub:not(.is-guide) {
  background: transparent;
}
.task-list-view .task-table-body-row-v2.is-sub:not(.is-guide):hover {
  background: #edf2f8;
}

/* ---------- Tab Danh sách: sửa nhanh trên dòng giống trang Dự án ---------- */
/* Cột trái ngoài cùng: ⋮⋮ kéo thả + ô chọn; cột phải ngoài cùng: ⋯ thao tác */
.task-list-view .task-cell-gutter {
  order: -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  padding: 0 4px 0 0 !important;
  overflow: visible !important;
}
.task-list-view .task-cell-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  overflow: visible !important;
}
.task-list-view .task-table-body-row-v2 .pl-drag {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.task-list-view .task-table-body-row-v2:hover .pl-drag {
  opacity: 1;
}
/* Ô tên: chừa chỗ cho nút + / bút ở góc phải; chú thích của nút không bị cắt */
.task-list-view .task-row-name,
.task-list-view .task-table-body-row-v2 .task-cell-name {
  overflow: visible;
}
.task-list-view .list-tree-name {
  width: 100%;
}
.task-list-view .list-tree-name .pl-rename-input {
  height: 28px;
}
/* Kéo thả trong Danh sách */
.task-table-body-row-v2.is-dragging {
  opacity: 0.45;
}
.task-table-body-row-v2.is-drop-before {
  box-shadow: inset 0 2px 0 var(--primary-600);
}
.task-table-body-row-v2.is-drop-after {
  box-shadow: inset 0 -2px 0 var(--primary-600);
}
.task-table-body-row-v2.is-drop-into {
  background: var(--primary-50) !important;
  box-shadow: inset 3px 0 0 var(--primary-600);
}
/* Dòng nhập task con tại chỗ + hàng thêm việc nhanh cuối nhóm */
.task-list-view .list-new-row .list-new-cell {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px calc(54px + var(--lv, 0) * 22px);
  border-bottom: 1px solid var(--border);
  overflow: visible;
}
.task-list-view .list-foot-row {
  min-height: 44px;
  cursor: default;
}
.task-list-view .list-foot-row .task-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  overflow: visible;
}
.task-list-view .list-foot-row .task-cell-name .pl-caret-space {
  display: none;
}
@media (hover: none) {
  .task-list-view .task-table-body-row-v2 .pl-drag { opacity: 1; }
}

/* Sửa bình luận tại chỗ */
.comment-edit { position: relative; margin-top: 4px; }
.comment-edit textarea { width: 100%; resize: vertical; }
.comment-edit-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.comment-edit-actions .form-hint { margin: 0 auto 0 0; font-size: 12px; }
.comment-edit-error { margin: 4px 0 0; font-size: 12.5px; color: var(--danger-600); }

/* Trang Dự án đang tìm / lọc: việc cha chỉ "dẫn đường" tới việc khớp thì vẽ mờ */
.pl-row.is-guide > .pl-cell { opacity: 0.6; }
.pl-row.is-guide .pl-task-name { font-style: italic; font-weight: 500; }
.pl-page-head .tf-wrap { align-self: center; }

/* =====================================================
   SƠ ĐỒ TỔ CHỨC (assignee.js) — khung chấm kéo được, thẻ người, đường nối tự vẽ bằng CSS
   ===================================================== */
/* Thanh công cụ nổi ở trên khung sơ đồ: tìm, công tắc kéo vị trí, phóng to / thu nhỏ, về vị trí đầu */
.org-bar {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 6;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.94); box-shadow: var(--shadow-sm);
}
.org-bar.has-panel-btn { right: 60px; }
.org-bar .search-field { padding: 5px 10px; min-width: 200px; }
.org-found { font-size: 13px; color: var(--ink-soft); }
.org-zoom { display: inline-flex; align-items: center; gap: 6px; }
.org-zoom-level { min-width: 44px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.org-icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  font: inherit; font-size: 16px; color: var(--ink-soft); cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.org-icon-btn:hover, .org-icon-btn.is-open { border-color: var(--primary-100); background: var(--primary-50); color: var(--primary-600); }
.org-reset { padding: 6px 12px; font-size: 13px; }

.org-body { position: relative; }
/* Thêm thành viên vào nhóm: ô tìm tên + lọc theo nhãn chuyên môn cùng 1 hàng */
.team-add-filters { display: flex; gap: 8px; }
.team-add-filters #team-add-search { flex: 1; min-width: 0; }
.team-add-filters select { width: auto; max-width: 45%; }
/* Trưởng nhóm đứng đầu sơ đồ nhóm; nhánh "theo trưởng nhóm" (chưa có quản lý trong nhóm) vẽ nét đứt */
.org-card.is-head { border-color: var(--primary-100); background: var(--primary-50); }

.org-canvas {
  /* Cao gần hết màn hình; kéo góc dưới bên phải để đổi chiều cao */
  position: relative; overflow: hidden; height: calc(100vh - 200px); min-height: 520px; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background-color: #fbfcfe;
  background-image: radial-gradient(#d3dbe6 1px, transparent 1px);
  background-size: 18px 18px;
  cursor: grab; touch-action: none;
}
.org-canvas.is-panning { cursor: grabbing; }
.org-stage { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; }
.org-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; cursor: default; }
.org-empty .empty-state { max-width: 460px; }

/* Thẻ người: ảnh, tên, chức danh, số cấp dưới; bấm thẻ mở hồ sơ, … mở thao tác */
.org-abs { position: absolute; width: 260px; }
.org-card {
  position: relative; display: flex; align-items: center; width: 260px; height: 66px; padding: 0 6px 0 10px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.org-card:hover { border-color: var(--primary-100); box-shadow: var(--shadow-md); }
.org-card.is-match { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.org-card-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 100%; padding: 0;
  border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.org-avatar { width: 40px; height: 40px; font-size: 14px; flex-shrink: 0; }
.org-card-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.org-card-text strong, .org-card-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-card-text strong { font-size: 13.5px; color: var(--ink); }
.org-card-text span { font-size: 12px; color: var(--ink-soft); }
.org-card-text small { font-size: 11.5px; color: var(--muted); }
.org-menu { position: relative; flex-shrink: 0; }
.org-card .org-menu .org-icon-btn { border-color: transparent; background: transparent; opacity: 0; }
.org-card:hover .org-menu .org-icon-btn, .org-card .org-menu .org-icon-btn:focus-visible, .org-card .org-menu .org-icon-btn.is-open { opacity: 1; }
.org-card .org-menu .org-icon-btn:hover, .org-card .org-menu .org-icon-btn.is-open { border-color: var(--border); background: var(--bg); }
.org-menu-panel {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 20; min-width: 170px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.org-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 0; border-radius: 6px;
  background: transparent; font: inherit; font-size: 13.5px; color: var(--ink-soft); text-align: left; cursor: pointer;
}
.org-menu-item:hover, .org-menu-item:focus-visible { background: var(--primary-50); color: var(--ink); outline: none; }
.org-menu-item.is-danger { color: var(--danger-600); }
.org-menu-item.is-danger:hover { background: var(--danger-50); }

/* Nút mở / thu gọn cấp dưới: nằm dưới ảnh, thao tác riêng (không mở hồ sơ) */
.org-toggle {
  position: absolute; left: 30px; top: 74px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid #c3ccd8; border-radius: 999px; background: var(--surface);
  font: inherit; font-size: 11.5px; font-weight: 700; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.org-toggle:hover { border-color: var(--primary); color: var(--primary-600); }
/* Đường nối (SVG): gấp khúc từ nút dưới thẻ cấp trên, mũi tên vào thẻ cấp dưới; nét đứt = hiện dưới trưởng nhóm */
.org-links { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.org-link { fill: none; stroke: #c3ccd8; stroke-width: 1.5; }
.org-link.is-implicit { stroke-dasharray: 5 4; }
.org-links marker path { fill: #c3ccd8; }
.org-wire { fill: none; stroke: var(--primary); stroke-width: 2; stroke-dasharray: 6 4; }

/* Kéo dây: nút tròn dưới thẻ (hiện khi rê vào), kéo tới thẻ người sẽ là cấp dưới */
.org-handle {
  position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; margin-left: -7px;
  border: 2px solid var(--primary); border-radius: 50%; background: var(--surface);
  cursor: crosshair; opacity: 0; transition: opacity 0.15s, transform 0.15s; touch-action: none;
}
.org-card:hover .org-handle { opacity: 1; }
.org-handle:hover { transform: scale(1.2); background: var(--primary-50); }
.org-canvas.is-move-on .org-card, .org-canvas.is-move-on .org-card-main { cursor: move; }
/* Đang kéo người / nhóm gần 1 thẻ: thẻ đó sáng lên + khung nét đứt xem trước vị trí sẽ nằm */
.org-card.is-drop-target { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-100), var(--shadow-md); }
.org-preview {
  position: absolute; width: 260px; padding: 10px 12px; pointer-events: none;
  border: 2px dashed var(--primary); border-radius: 12px; background: rgba(234, 247, 255, 0.92);
  display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--ink-soft);
  animation: orgPreviewIn 0.15s ease-out;
}
.org-preview strong { font-size: 13.5px; color: var(--ink); }
.org-preview small { color: var(--primary-600); font-weight: 600; }
.org-preview-sub { padding-left: 14px; color: var(--ink-soft); }
@keyframes orgPreviewIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.org-ghost {
  position: fixed; z-index: 2000; padding: 6px 12px; pointer-events: none;
  border: 1px solid var(--primary); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-md);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
/* Công tắc "Cho phép kéo vị trí" bên trái nút phóng to / thu nhỏ */
.org-move-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }

/* Nút ☰ góc phải trên khung: mở bảng "Chưa có quản lý" + Nhóm đè lên sơ đồ */
.org-panel-btn {
  position: absolute; top: 10px; right: 10px; z-index: 7; width: 42px; height: 42px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm);
  color: var(--ink-soft); cursor: pointer; transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.org-panel-btn:hover, .org-panel-btn.is-open { border-color: var(--primary-100); background: var(--primary-50); color: var(--primary-600); }
.org-panel-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.org-panel {
  position: absolute; top: 60px; right: 10px; z-index: 7; width: 300px; max-height: calc(100% - 72px);
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md);
  animation: orgPreviewIn 0.15s ease-out;
}
.org-panel-title { display: flex; align-items: center; gap: 8px; padding: 11px 12px; font-size: 13.5px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--border-soft); }
.org-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; }
.org-loose-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 6px; border-bottom: 1px solid var(--border-soft); }
.org-loose-item:last-child { border-bottom: 0; }
.org-loose-item.is-match { background: var(--primary-50); border-radius: 8px; }
.org-loose-pick { align-self: flex-start; padding: 4px 10px; font-size: 12.5px; }
.org-loose-item.is-draggable { cursor: grab; user-select: none; touch-action: none; }
.org-loose-item.is-draggable:hover { background: var(--bg); border-radius: 8px; }
.org-panel-hint { margin: 8px 6px 4px; font-size: 12px; color: var(--muted); }
.org-panel-sub { display: flex; align-items: center; gap: 6px; margin: 12px 6px 2px; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.org-team-item .org-li-person { cursor: inherit; }
.org-li-person {
  display: flex; align-items: center; gap: 9px; min-width: 0; padding: 0; border: 0; background: transparent;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.org-li-person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.org-li-person strong { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-li-person > span:last-child > span { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-li-person:hover strong { color: var(--primary-600); }

/* Ô chọn quản lý trực tiếp */
.org-pick { min-width: 300px; max-width: 320px; }
.org-pick-input { margin: 0 4px 6px; width: calc(100% - 8px); }
.org-pick-title { color: var(--muted); font-weight: 400; }

/* Hồ sơ thành viên: quản lý trực tiếp + cấp dưới */
.org-detail-actions { display: flex; gap: 8px; margin-top: 8px; }
.org-detail-reports { display: flex; flex-direction: column; gap: 6px; }
/* Mục "Tổ chức" trong hồ sơ: 2 phần (quản lý / cấp dưới) ngăn bằng đường kẻ trong cùng 1 hộp */
.mqv-org-part { padding: 12px 14px; }
.mqv-org-part + .mqv-org-part { border-top: 1px solid var(--border); }
.mqv-org-label { margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

/* Điện thoại: danh sách phân cấp thu gọn được thay cho khung kéo thả */
.org-list { display: none; }
.org-ul { list-style: none; margin: 0; padding: 0; }
.org-ul .org-ul { margin-left: 16px; padding-left: 10px; border-left: 1.5px solid #dbe2ea; }
.org-li-row { display: flex; align-items: center; gap: 6px; padding: 7px 4px; border-radius: 8px; }
.org-li-row.is-match { background: var(--primary-50); }
.org-li-row .org-menu { margin-left: auto; }
.org-li-toggle, .org-li-space { flex-shrink: 0; width: 24px; height: 24px; }
.org-li-toggle { display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.org-li-toggle::before { content: ""; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; transform: rotate(-90deg); transition: transform 0.15s; }
.org-li-toggle.is-open::before { transform: none; }
@media (max-width: 760px) {
  .org-canvas, .org-zoom, .org-move-switch { display: none; }
  /* Điện thoại: thanh tìm nằm trên danh sách phân cấp, bảng ☰ mở ngay dưới */
  .org-bar { position: static; margin-bottom: 8px; }
  .org-bar.has-panel-btn { margin-right: 52px; }
  .org-bar .search-field { min-width: 0; flex: 1; }
  .org-panel { left: 0; right: 0; width: auto; max-height: 70vh; }
  .org-list { display: block; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
}
@media (hover: none) {
  .org-card .org-menu .org-icon-btn, .org-handle { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .org-card, .org-icon-btn, .org-panel-btn, .org-panel, .org-li-toggle::before, .org-handle { transition: none; }
  .org-preview, .org-panel { animation: none; }
}

/* =====================================================
   TIN NHẮN (chat.js) — danh sách hội thoại trái, nội dung giữa, kết quả tìm phải; điện thoại mở từng màn
   Màu lấy theo biến chủ đề (--primary*, --border, --radius-*) để đổi theo thương hiệu workspace
   ===================================================== */
.chat-nav-count[hidden] { display: none; }
.nav-item .chat-nav-count { background: var(--danger); color: #fff; font-weight: 700; }
.chat-layout {
  display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 120px); min-height: 480px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden;
}

/* ----- Cột trái: danh sách hội thoại ----- */
.chat-side { position: relative; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.chat-side-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 10px; }
.chat-side-head h2 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
.chat-new-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }
/* Ô tìm hội thoại: class riêng (không dùng .search-field chung vì quy tắc flex của thanh công cụ làm ô cao ra trong cột dọc) */
.chat-search-box { display: flex; align-items: center; gap: 8px; margin: 0 16px 10px; padding: 0 12px; height: 36px; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); flex: 0 0 auto; }
.chat-search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.chat-search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; }
/* Tab lọc dạng pill: Tất cả / Chưa đọc / Nhóm */
.chat-tabs { display: flex; gap: 6px; padding: 0 16px 10px; flex: none; }
.chat-tab { padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chat-tab:hover { background: var(--bg); color: var(--ink); }
.chat-tab.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.chat-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 10px; }
.chat-hint { margin: 10px 8px; font-size: 13px; color: var(--muted); }
.chat-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-md);
  background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.chat-item:hover { background: var(--bg); }
.chat-item.is-active { background: var(--primary-50); }
.chat-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.chat-item-avatar { width: 38px; height: 38px; flex-shrink: 0; font-size: 13px; }
/* Danh sách / đầu hội thoại chỉ hiện chấm xanh khi đang hoạt động (vắng / ngoại tuyến thì không chấm) */
.chat-item .presence-dot:not(.is-online), .chat-head .presence-dot:not(.is-online) { display: none; }
.chat-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-item-top, .chat-item-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-item-text strong { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-time { flex: none; font-size: 11.5px; color: var(--muted); }
.chat-item-preview { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.is-unread .chat-item-text strong { font-weight: 800; }
.chat-item.is-unread .chat-item-preview { color: var(--ink); font-weight: 600; }
.chat-item.is-unread .chat-item-time { color: var(--primary-600); font-weight: 600; }
.chat-item-flag { flex: none; display: inline-flex; font-size: 11px; color: #e11d48; }
.chat-unread-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--primary-600); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.chat-unread-badge.is-quiet { background: var(--border); color: var(--ink-soft); }
/* Bảng chọn người cho "Tin nhắn mới" */
.chat-new { margin: 0 14px 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
.chat-new-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13.5px; }
.chat-new-list { max-height: 260px; overflow-y: auto; margin-top: 6px; }
/* Bảng "Tin nhắn mới" thay chỗ danh sách hội thoại: co theo chiều cao cột, danh sách người cuộn bên trong,
   để nút "Tạo nhóm" ở cuối luôn thấy được */
.chat-side:has(.chat-new) .chat-list, .chat-side:has(.chat-new) .chat-tabs { display: none; }
.chat-new { display: flex; flex-direction: column; min-height: 0; flex: 0 1 auto; overflow: hidden; }
.chat-new .chat-new-list { flex: 1 1 auto; min-height: 80px; }
.chat-new > .form-hint, .chat-new > .chat-error, .chat-new > .chat-group-create { flex: none; }

/* ----- Khung giữa: đầu hội thoại ----- */
.chat-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-empty { flex: 1; display: grid; place-items: center; padding: 24px; }
.chat-head { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 14px; box-sizing: border-box; border-bottom: 1px solid var(--border); }
.chat-head-person { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.chat-head-person strong { font-size: 15px; }
.chat-head-status { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-status.is-online { color: var(--success-600); font-weight: 600; }
.chat-head-status.is-away { color: var(--warning-600); }
/* Đang tìm: đầu hội thoại chỉ giữ ảnh, nhường chỗ cho ô tìm */
.chat-head.is-searching .chat-head-person { flex: none; }
.chat-head.is-searching .chat-head-person .chat-item-text { display: none; }
.chat-head-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.chat-head-btn { width: 34px; height: 34px; border-color: transparent; background: transparent; }
.chat-head-btn:hover, .chat-head-btn.is-on { border-color: var(--border); background: var(--bg); color: var(--ink); }
.chat-head-btn.is-on { color: var(--primary-600); }
/* Chuông tắt: gạch chéo */
.chat-mute.is-muted { color: var(--muted); }
.chat-mute.is-muted::after { content: ""; position: absolute; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); box-shadow: 0 0 0 1.5px var(--surface); }
.chat-head-menu { position: relative; }
.chat-head-menu .comment-menu-panel { min-width: 220px; }
.chat-back { display: none; }

/* Ô tìm trong hội thoại: trượt ra ở đầu hội thoại khi bấm kính lúp */
.chat-sbox-slot { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 4px; animation: chatSlideIn 0.18s ease-out; }
.chat-sbox-slot[hidden] { display: none; }
@keyframes chatSlideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.chat-sbox { flex: 1; min-width: 0; height: 34px; }
.chat-sbox:is(.is-open, :focus-within) { position: relative; z-index: 7; }
.chat-sbox .ts-drop { width: 380px; }
.chat-snav { display: flex; align-items: center; gap: 2px; flex: none; }
.chat-snav-count { min-width: 38px; padding: 0 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-align: center; font-variant-numeric: tabular-nums; }
.chat-snav-btn { width: 28px; height: 28px; border-color: transparent; background: transparent; }
.chat-snav-btn:hover:not(:disabled) { background: var(--bg); border-color: var(--border); }
.chat-snav-btn:disabled { opacity: 0.35; cursor: default; }
.chat-snav-up svg { transform: rotate(90deg); }
.chat-snav-down svg { transform: rotate(-90deg); }

/* ----- Tin nhắn kiểu Discord: mọi tin bên trái, mỗi tin 1 thẻ nền xám nhạt, rê chuột viền xanh nhẹ ----- */
.chat-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 18px 16px; display: flex; flex-direction: column; gap: 6px; }
.chat-older { text-align: center; }
.chat-day { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.chat-day span { padding: 2px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); }
.chat-msg { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 8px 14px 8px 10px; border: 1px solid transparent; border-radius: var(--radius-md); background: var(--bg); transition: border-color 0.15s, background-color 0.3s; }
.chat-msg.is-first { margin-top: 10px; }
.chat-msg:hover, .chat-msg:focus-within { border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
.chat-msg-avatar-btn { align-self: flex-start; flex: none; margin-top: 1px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.chat-msg-avatar { width: 36px; height: 36px; flex-shrink: 0; font-size: 12px; }
/* Tin sau trong cụm: cột ảnh trống, rê chuột hiện giờ gửi (như Discord) */
.chat-msg-avatar-gap { width: 36px; flex: none; text-align: center; }
.chat-msg-hm { display: block; font-size: 10.5px; line-height: 21px; color: var(--muted); font-variant-numeric: tabular-nums; visibility: hidden; }
.chat-msg:hover .chat-msg-hm, .chat-msg:focus-within .chat-msg-hm { visibility: visible; }
.chat-msg-main { display: flex; flex-direction: column; align-items: flex-start; flex: 1; min-width: 0; }
.chat-msg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 1px; }
.chat-msg-author { font-size: 14px; font-weight: 700; color: var(--ink); }
.chat-msg-time { font-size: 11.5px; color: var(--muted); }
.chat-bubble { max-width: 100%; font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; box-sizing: border-box; }
.chat-bubble.is-deleted { padding: 3px 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; font-style: italic; }
.chat-msg-foot { display: flex; gap: 4px; margin-top: 2px; font-size: 11px; color: var(--muted); }
.chat-msg-status.is-seen { color: var(--primary-600); font-weight: 600; }
.chat-msg.is-pending .chat-bubble { opacity: 0.65; }
.chat-msg.is-failed { border-color: var(--danger); background: var(--danger-50); }
.chat-failed { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; font-size: 12.5px; color: var(--danger-600); }
.chat-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chat-file-img img { display: block; max-width: 240px; max-height: 200px; border: 1px solid var(--border); border-radius: var(--radius-md); object-fit: cover; }
/* Tin được tìm thấy / được nhảy tới / đang trả lời / có tag mình */
.chat-msg.is-hit { background: color-mix(in srgb, var(--warning) 22%, transparent); }
.chat-msg.is-flash, .chat-msg.is-replying { background: var(--primary-50); }
.chat-msg.is-mention:not(.is-mine) { background: var(--warning-50); box-shadow: inset 3px 0 0 var(--warning); }
/* Thanh nổi khi rê vào tin: góc phải trên, nửa trong nửa ngoài thẻ (Discord); nằm đè lên, không đẩy chữ, không làm tràn ngang.
   Tin sát mép trên khung cuộn (.is-tools-in, chat.js) thì thụt hẳn vào trong thẻ */
.chat-msg-tools { position: absolute; top: -15px; right: 14px; z-index: 4; display: flex; align-items: center; gap: 1px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); visibility: hidden; }
.chat-msg.is-tools-in .chat-msg-tools { top: 4px; }
.chat-tool-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--border); }
.chat-quick-react { font-size: 16px; }
.chat-react-pick { display: none; }
.chat-msg:hover .chat-msg-tools, .chat-msg:focus-within .chat-msg-tools, .chat-msg-tools.is-open { visibility: visible; }
.chat-tool-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); font-size: 15px; line-height: 1; cursor: pointer; }
.chat-tool-btn:hover, .chat-tool-btn:focus-visible, .chat-tool-btn.is-open { background: var(--bg); color: var(--ink); outline: none; }
.chat-menu-btn svg { transform: rotate(90deg); }
.chat-msg-menu, .chat-react-pick { position: relative; }
.chat-msg-tools .comment-menu-panel { top: calc(100% + 4px); bottom: auto; right: 0; left: auto; min-width: 160px; }
.chat-msg-tools.is-up .comment-menu-panel { top: auto; bottom: calc(100% + 4px); }
.chat-msg-tools.is-up .chat-react-panel { top: auto; bottom: calc(100% + 6px); }
.chat-react-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 25; display: flex; gap: 2px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-md); }
.chat-react-panel button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 19px; cursor: pointer; transition: transform 0.12s; }
.chat-react-panel button:hover, .chat-react-panel button:focus-visible { background: var(--bg); transform: scale(1.15); outline: none; }
/* Màn hình cảm ứng không có rê chuột: thanh luôn hiện, gọn lại */
@media (hover: none) {
  .chat-msg-tools { position: static; align-self: flex-end; visibility: visible; border-color: transparent; background: transparent; box-shadow: none; }
  .chat-quick-react, .chat-tool-sep { display: none; }
  .chat-react-pick { display: block; }
  .chat-tool-btn { width: 26px; font-size: 14px; }
}
/* Biểu cảm dưới tin */
.chat-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.chat-react-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-soft); font-size: 13px; line-height: 1.6; cursor: pointer; }
.chat-react-chip span { font-size: 12px; font-weight: 600; }
.chat-react-chip.is-mine { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.chat-react-chip:hover, .chat-react-chip:focus-visible { border-color: var(--primary); outline: none; }
/* Trích đoạn tin được trả lời (trên nội dung tin) + thanh "Đang trả lời" trên ô soạn */
.chat-reply-quote { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 0 3px; padding: 3px 10px 3px 8px; border: 0; border-left: 3px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink-soft); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.chat-reply-quote span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-quote strong { color: var(--ink); font-weight: 600; }
.chat-reply-quote:hover:not(:disabled) { border-left-color: var(--primary); background: var(--primary-50); }
.chat-reply-quote:disabled { cursor: default; }
.chat-reply-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 6px 8px 6px 10px; border-left: 3px solid var(--primary); border-radius: var(--radius-sm); background: var(--bg); font-size: 13px; color: var(--ink-soft); }
.chat-reply-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-bar strong { color: var(--ink); }
.chat-reply-bar .icon-btn { width: 24px; height: 24px; flex: none; }
/* Tag người (@) + gắn công việc (#): bảng gợi ý nổi ngay trên ô soạn */
.chat-ac { position: absolute; left: 14px; right: 14px; bottom: calc(100% - 4px); z-index: 6; max-height: 300px; overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
.chat-ac[hidden] { display: none; }
.chat-ac-head { margin: 2px 6px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.chat-ac-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.chat-ac-item.is-on, .chat-ac-item:hover { background: var(--primary-50); }
.chat-ac-item small { margin-left: auto; padding-left: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.chat-ac-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ac-avatar { width: 24px; height: 24px; flex: none; font-size: 10px; }
.chat-mention { padding: 0 3px; border: 0; border-radius: 4px; background: var(--primary-50); color: var(--primary-600); font: inherit; font-weight: 600; cursor: pointer; }
.chat-mention.is-me { background: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--ink); }
.chat-mention:hover, .chat-mention:focus-visible { text-decoration: underline; outline: none; }
.chat-mention-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px; box-sizing: border-box; border-radius: var(--radius-pill); background: var(--warning-100); color: var(--warning-700); font-size: 11px; font-weight: 700; }
.chat-edit { min-width: min(420px, 70vw); }
.chat-edit textarea { width: 100%; resize: vertical; }
.chat-edit-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.chat-edit-actions .form-hint { margin: 0 auto 0 0; font-size: 12px; }
.chat-error { color: var(--danger-600); font-size: 12.5px; margin: 4px 0 0; }
.chat-new-pill {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 3; padding: 6px 14px;
  border: 0; border-radius: var(--radius-pill); background: var(--primary-600); box-shadow: var(--shadow-md);
  font: inherit; font-size: 12.5px; font-weight: 600; color: #fff; cursor: pointer;
}
.chat-new-pill[hidden] { display: none; }

/* ----- Ô soạn tin ----- */
.chat-composer { position: relative; margin: 0; padding: 10px 14px 14px; border-top: 1px solid var(--border); }
.chat-cbox { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 6px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s; }
.chat-cbox:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.chat-cbox textarea { display: block; width: 100%; min-height: 24px; max-height: 120px; padding: 2px 2px; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); font: inherit; font-size: 14px; line-height: 1.45; overflow-y: hidden; box-sizing: border-box; }
.chat-cbox .comment-draft-files { margin: 0; }
.chat-cbar { display: flex; align-items: center; gap: 2px; }
.chat-cbtn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 30px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-soft); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.chat-cbtn:hover, .chat-cbtn:focus-visible, .chat-cbtn[aria-expanded="true"] { background: var(--bg); color: var(--ink); outline: none; }
.chat-send-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13.5px; }
.chat-send-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.chat-readonly { padding: 14px; border-top: 1px solid var(--border); background: var(--bg); font-size: 13.5px; color: var(--ink-soft); text-align: center; }
.chat-emoji { position: relative; }
.chat-emoji-panel {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5; display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md);
}
.chat-emoji-panel button { width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; font-size: 18px; cursor: pointer; }
.chat-emoji-panel button:hover { background: var(--bg); }
.chat-with-btn { padding: 5px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

/* ----- Cột phải: kết quả tìm kiếm ----- */
.chat-layout.has-search { grid-template-columns: 320px minmax(0, 1fr) 320px; }
.chat-spanel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); background: var(--surface); }
.chat-spanel[hidden] { display: none; }
.chat-spanel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; padding: 0 14px; box-sizing: border-box; border-bottom: 1px solid var(--border); font-size: 14px; }
/* Nút đóng ô tìm / bảng kết quả: nền xám trung tính, thắng quy tắc nút X đỏ chung (.icon-btn:has(icon-close)) */
.chat-main .icon-btn.chat-snav-close, .chat-spanel .icon-btn.chat-spanel-close { width: 28px; height: 28px; border-color: transparent; background: var(--bg); color: var(--ink-soft); box-shadow: none; }
.chat-main .icon-btn.chat-snav-close:hover, .chat-spanel .icon-btn.chat-spanel-close:hover { border-color: var(--border); background: var(--border); color: var(--ink); box-shadow: none; }
.chat-main .icon-btn.chat-snav-close:focus-visible, .chat-spanel .icon-btn.chat-spanel-close:focus-visible { box-shadow: 0 0 0 3px var(--primary-100); }
.chat-spanel-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.chat-spanel-list.is-loading { opacity: 0.55; }
.chat-sres { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; }
.chat-sres:hover, .chat-sres:focus-visible { border-color: var(--primary); background: var(--bg); outline: none; }
.chat-sres.is-cur { border-color: var(--primary); background: var(--primary-50); }
.chat-sres-main { flex: 1; min-width: 0; }
.chat-sres .chat-msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; font-size: 11.5px; color: var(--muted); }
.chat-sres .chat-msg-meta strong { font-size: 13px; color: var(--ink); }
.chat-sres-body { font-size: 13.5px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.chat-sres-body mark { padding: 0 1px; border-radius: 3px; background: color-mix(in srgb, var(--warning) 45%, transparent); color: inherit; }
.chat-sres-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chat-sres-img { max-width: 100%; max-height: 160px; border-radius: var(--radius-sm); border: 1px solid var(--border); object-fit: cover; }
.chat-snone { text-align: center; padding: 24px 8px; line-height: 1.6; }
.chat-snone strong { color: var(--ink-soft); }
.chat-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; padding: 10px; border-top: 1px solid var(--border); }
.chat-pg { min-width: 32px; height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chat-pg:hover:not(:disabled), .chat-pg:focus-visible { background: var(--bg); outline: none; }
.chat-pg.is-on { background: var(--primary); color: #fff; }
.chat-pg.is-step { color: var(--ink-soft); font-weight: 500; }
.chat-pg:disabled { opacity: 0.4; cursor: default; }
.chat-pg-gap { padding: 0 2px; color: var(--muted); }
@media (max-width: 1100px) {
  /* Màn hình vừa: bảng kết quả đè lên phần tin nhắn thay vì bóp hẹp hội thoại */
  .chat-layout.has-search { grid-template-columns: 320px minmax(0, 1fr); position: relative; }
  .chat-spanel { position: absolute; top: 0; right: 0; bottom: 0; width: 320px; z-index: 8; box-shadow: var(--shadow-lg); }
}
@media (max-width: 760px) {
  /* Điện thoại: danh sách → hội thoại → quay lại; bảng kết quả thành danh sách toàn màn hình */
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 110px); border-radius: var(--radius-md); }
  .chat-layout.has-open .chat-side { display: none; }
  .chat-layout:not(.has-open) .chat-main { display: none; }
  .chat-layout.has-search { grid-template-columns: 1fr; }
  .chat-spanel { width: auto; left: 0; }
  .chat-side { border-right: 0; }
  .chat-back { display: inline-flex; border-color: transparent; background: transparent; width: 32px; }
  .chat-head { flex-wrap: wrap; padding: 8px 10px; gap: 6px; }
  .chat-head.is-searching .chat-head-person { flex: 1 1 auto; }
  .chat-head.is-searching .chat-head-person .chat-item-text { display: flex; }
  .chat-sbox-slot { flex-basis: 100%; order: 10; }
  .chat-sbox .ts-drop { width: auto; left: -1px; right: -1px; }
  .chat-msgs { padding: 8px 10px 12px; }
  .chat-msg { gap: 8px; padding: 6px 8px; }
  .chat-composer { padding: 8px 10px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-sbox-slot { animation: none; }
  .chat-msg, .chat-react-panel button { transition: none; }
}

/* ===== Thành viên (Mọi người / Nhóm): nút đổi dạng xem + dạng khối 4 cột / dạng danh sách ===== */
.member-layout-toggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); flex-shrink: 0; }
.member-layout-btn { display: inline-grid; place-items: center; width: 30px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; transition: background 0.2s, color 0.2s; }
.member-layout-btn:hover { color: var(--ink); background: var(--bg); }
.member-layout-btn.is-on { background: var(--primary-50); color: #0369a1; }
/* Dạng khối: 4 thẻ 1 hàng trên màn rộng, màn hẹp tự giảm cột để thẻ không bị bóp */
.member-grid.is-cols4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1280px) { .member-grid.is-cols4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .member-grid.is-cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .member-grid.is-cols4, .team-grid.is-cols4 { grid-template-columns: 1fr; } }

/* ===== Mọi người dạng danh sách: bảng như Danh sách việc (pl-*): cùng nền, viền, màu chữ ===== */
.ml-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px 18px 12px; box-shadow: var(--shadow-sm); }
.ml-scroll { overflow-x: auto; }
.ml-table { min-width: 760px; }
/* Độ rộng cột lấy từ --ml-cols (đặt trên .ml-table, đổi khi kéo tay nắm ở tiêu đề) */
.ml-row { display: grid; grid-template-columns: var(--ml-cols, 40px minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 48px); min-height: 52px; cursor: pointer; }
.ml-head-cell { position: relative; overflow: visible; }
.ml-row.is-archived .ml-name-text strong { color: var(--ink-soft); }
.ml-row.is-archived .ml-avatar { opacity: 0.6; }
.ml-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-avatar-sm { width: 34px; height: 34px; flex-shrink: 0; font-size: 9px; }
.ml-pop-avatar { width: 20px; height: 20px; flex-shrink: 0; font-size: 9px; }
.ml-pop-text { margin: 0; padding: 4px 8px 8px; font-size: 13.5px; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; }
.ml-pop-desc { display: flex; flex-direction: column; gap: 8px; padding: 2px 4px 4px; }
.ml-pop-desc textarea { resize: vertical; min-height: 90px; }
.ml-pop-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.ml-pop-foot .form-hint { margin: 0 auto 0 0; }
.ml-row > .ml-cell { border-bottom: 1px solid var(--border); transition: background-color 0.15s ease; }
.ml-row:last-child > .ml-cell { border-bottom: 0; }
.ml-row[data-id]:hover > .ml-cell { background: #edf2f8; }
.ml-row.is-selected > .ml-cell { background: var(--primary-50); }
.ml-row-head { min-height: 40px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: default; }
.ml-row-head > .ml-cell { border-bottom-color: #cfd8e3; }
.ml-cell { min-width: 0; padding: 0 10px; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
.ml-gutter { justify-content: center; padding: 0; }
.ml-sel { display: inline-flex; padding: 6px; cursor: pointer; }
.ml-sel input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--primary); }
.ml-cell-name { gap: 10px; }
/* Ảnh đại diện nhỏ lại (~70% thẻ thường) */
.ml-avatar { width: 28px; height: 28px; flex-shrink: 0; font-size: 11px; }
.ml-name-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ml-name-text strong { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-name-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-role { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px; border-radius: 6px; background: color-mix(in srgb, var(--c, #94a3b8) 14%, transparent); color: var(--ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-role i { width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%; background: var(--c, #94a3b8); }
.ml-more { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.ml-none { color: var(--muted); }
.ml-cell .skill-chip { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-cell-menu { justify-content: center; padding: 0 4px; }
.ml-row:hover .pl-menu-dots { opacity: 1; }
/* Bảng chỉ đọc (Check Log): dòng không bấm được, thao tác dài thì xuống dòng */
.ml-table.is-plain .ml-row { cursor: default; min-height: 46px; }
.ml-table.is-plain .ml-row:not(.ml-row-head) > .ml-cell:first-child { padding-left: 12px; }
.ml-cell-wrap { white-space: normal; overflow-wrap: anywhere; padding-top: 8px; padding-bottom: 8px; line-height: 1.45; }
.ml-card-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
/* Việc của tôi dạng danh sách: tên dự án nhỏ kế tên việc */
.list-proj-tag { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; max-width: 40%; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--bg); color: var(--ink-soft); font-size: 11.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-proj-tag .project-dot { width: 7px; height: 7px; flex-shrink: 0; }
/* Ô Tên: bút sửa tên nằm ngoài cùng bên phải, hiện khi rê vào (chú thích dùng title, không dùng bong bóng của pl vì ô bị cắt) */
.ml-cell-name:hover .pl-name-actions, .ml-cell-name .pl-name-actions:focus-within { opacity: 1; }
.ml-cell-name .pl-name-btn::after { display: none; }
.ml-cell-name .pl-rename-input { height: 32px; }
/* Ô bấm được (Chuyên môn / Vai trò / Nhóm): rê vào hiện khung như ô của Danh sách việc */
.ml-row:hover .pl-field:hover { border-color: var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.ml-field { min-width: 0; overflow: hidden; }
.ml-cell-pop { min-width: 240px; }
.ml-pop-current { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 6px 6px; max-height: 180px; overflow-y: auto; }
.ml-pop-note { font-size: 11px; color: var(--muted); }
/* Thanh chọn nhiều người nằm ở đáy (khung .bulk-bar dùng chung với việc): trang chừa chỗ để không che hàng cuối */
body.has-ml-bulk-bar .page-content { padding-bottom: 120px; }
@media (max-width: 620px) {
  .ml-card { padding: 4px 10px 8px; }
}

/* ===== Nhắn tin: nhóm chat + link công việc (chat.js) ===== */
.chat-group-avatar { display: inline-grid; place-items: center; background: var(--primary-50); color: var(--primary-600); font-weight: 700; border-radius: 10px; }
/* Chuyển "Nhắn riêng" / "Nhóm chat" trong bảng Tin nhắn mới */
.chat-seg { display: flex; gap: 2px; margin: 8px 0; padding: 3px; border-radius: var(--radius-pill); background: var(--bg); }
.chat-seg button { flex: 1; padding: 5px 10px; border: 0; border-radius: var(--radius-pill); background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.chat-seg button.is-on { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }
.chat-new .form-control + .form-control { margin-top: 6px; }
.chat-pick { cursor: pointer; }
.chat-pick input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.chat-pick.is-on { background: var(--primary-50); }
.chat-group-create { width: 100%; margin-top: 8px; justify-content: center; }
.form-control.is-invalid { border-color: var(--danger); }
/* Bảng thành viên nhóm chat: phủ lên khung tin nhắn, bên phải */
.chat-group-panel {
  position: absolute; z-index: 5; top: 58px; right: 0; bottom: 0; width: min(340px, 100%); overflow-y: auto;
  padding: 12px 14px 16px; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 8px; animation: navTeamIn 0.18s ease-out;
}
.chat-group-rename { display: flex; gap: 6px; }
.chat-group-rename .form-control { flex: 1; min-width: 0; }
.chat-group-name { margin: 0; font-size: 15px; font-weight: 700; }
.chat-group-sec { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.chat-group-members { display: flex; flex-direction: column; gap: 2px; }
.chat-group-member { cursor: default; }
.chat-group-member .icon-btn { margin-left: auto; width: 26px; height: 26px; }
.chat-group-note { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warning-50); color: var(--ink); font-size: 12.5px; line-height: 1.45; }
.chat-group-panel .chat-new-list { max-height: 220px; }
.chat-group-leave { margin-top: 10px; }
/* Link + thẻ xem trước công việc trong tin */
.chat-bubble a { color: var(--primary-600); text-decoration: underline; overflow-wrap: anywhere; }
.chat-task-cards { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.chat-task-card {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 420px; padding: 8px 10px; text-align: left; font: inherit;
  border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer;
}
.chat-task-card:hover { border-color: var(--primary); }
.chat-task-card small { color: var(--muted); font-size: 12px; }
.chat-task-card.is-hidden { cursor: default; border-left-color: var(--muted); color: var(--ink-soft); font-size: 13px; }
.chat-task-name { min-width: 0; font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .chat-group-panel { width: 100%; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-group-panel { animation: none; }
}

/* ===== Bắt đầu sử dụng: menu tài khoản, Trợ giúp, thẻ "Bắt đầu", trạng thái lỗi / trống ===== */
/* Menu tài khoản (bấm ảnh đại diện trên thanh trên cùng) */
.account-menu { position: relative; display: inline-flex; }
.account-menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
/* Tên + ảnh đại diện cạnh chuông; bấm cả khối đều mở menu */
.account-menu-btn { display: inline-flex; align-items: center; gap: 8px; padding: 3px 3px 3px 10px; border-radius: var(--radius-pill); cursor: pointer; }
.account-menu-btn:hover { background: var(--primary-50); }
.account-menu-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.account-menu-btn:hover .avatar, .account-menu:has(.account-menu-toggle:checked) .account-menu-btn .avatar { box-shadow: 0 0 0 3px var(--primary-100); }
.account-menu:has(.account-menu-toggle:focus-visible) .account-menu-btn .avatar { box-shadow: 0 0 0 3px var(--primary); }
.account-menu-panel {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.account-menu:has(.account-menu-toggle:checked) .account-menu-panel { display: block; animation: plPopIn 0.15s ease-out; }
.account-menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent;
  font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer;
}
.account-menu-item svg { flex: none; color: var(--ink-soft); }
.account-menu-item:hover, .account-menu-item:focus-visible { background: var(--primary-50); outline: none; }
.account-menu-item.is-danger { color: var(--danger-600); }
.account-menu-item.is-danger svg { color: var(--danger-600); }
.account-menu-sep { height: 1px; margin: 5px 4px; background: var(--border-soft); }
/* Panel Trợ giúp: cùng khung bảng trượt bên phải */
body:has(#help-panel-toggle:checked) #help-overlay { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#help-panel-toggle:checked) #help-overlay .detail-panel { transform: translateX(0); }
.help-title { margin: 0; font-size: 17px; }
.help-sec { margin-bottom: 18px; }
.help-sec h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.help-sec ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.help-sec p { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.help-reopen { margin: -6px 0 18px; }
/* Thẻ "Bắt đầu" */
.onboard-card { margin-bottom: 18px; }
.onboard-head { display: flex; align-items: center; gap: 10px; }
.onboard-head h2 { margin: 0; flex: 1; min-width: 0; }
.onboard-progress { flex: none; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--primary-50); color: var(--primary-600); font-size: 12px; font-weight: 700; }
.onboard-head .icon-btn svg { transform: rotate(-90deg); transition: transform 0.2s; }
.onboard-card.is-collapsed .onboard-head .icon-btn svg { transform: rotate(180deg); }
.onboard-steps { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.onboard-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.onboard-step .btn-secondary { flex: none; }
.onboard-check { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border: 2px solid var(--border); border-radius: 50%; color: #fff; }
.onboard-step.is-done .onboard-check { border-color: var(--success); background: var(--success); }
.onboard-step.is-done strong { color: var(--ink-soft); text-decoration: line-through; }
.onboard-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.onboard-text strong { font-size: 14px; color: var(--ink); }
.onboard-text small { font-size: 12.5px; color: var(--muted); }
/* Một phần dữ liệu tải lỗi */
.data-warning { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px; border: 1px solid #fde68a; border-radius: var(--radius-sm); background: var(--warning-50); font-size: 13.5px; color: var(--ink); }
.data-warning[hidden] { display: none; }
.data-warning span { flex: 1; min-width: 200px; }
/* Mở app mà tải dữ liệu lỗi */
.app-load-error { margin: 60px auto; max-width: 520px; }
.app-load-error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
/* Dự án chưa có việc */
.project-empty-hint { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; padding: 14px 16px; border: 1px dashed var(--primary); border-radius: var(--radius-md); background: var(--primary-50); }
.project-empty-hint > svg { flex: none; color: var(--primary-600); }
.project-empty-hint > div { flex: 1; min-width: 220px; }
.project-empty-hint p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.empty-next { margin: 10px 0 0; text-align: center; }
@media (max-width: 620px) {
  .onboard-step { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .account-menu:has(.account-menu-toggle:checked) .account-menu-panel { animation: none; }
  .onboard-head .icon-btn svg { transition: none; }
}

/* Lối vào của tính năng đang tắt (Cài đặt › Tính năng): thuộc tính hidden phải thắng display của các khối này */
.view-tab[hidden], .nav-chat-group[hidden] { display: none !important; }

/* ===== Bật / tắt tính năng: bảng chọn (popup lần đầu + Cài đặt › Tính năng) ===== */
body:has(#modal-features-toggle:checked) #modal-features { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#modal-features-toggle:checked) #modal-features .modal-box { transform: scale(1); opacity: 1; }
body:has(#modal-plan-start-toggle:checked) #modal-plan-start { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#modal-plan-start-toggle:checked) #modal-plan-start .modal-box { transform: scale(1); opacity: 1; }
/* Chọn gói lần đầu: cao theo nội dung, cuộn khi mở bảng so sánh đầy đủ */
.features-modal-box.plan-start-box { height: auto; max-height: calc(100vh - 48px); overflow-y: auto; padding: 8px; }
.plan-start-box .pl-choose { margin: 0; border: 0; box-shadow: none; }
.plan-start-foot { display: flex; justify-content: center; padding: 4px 0 12px; }
/* Popup lần đầu: rộng gần bằng màn hình (như bước chọn tính năng của các app quản lý việc lớn), nền trên chuyển màu nhẹ */
.features-modal-box {
  width: min(1200px, calc(100vw - 48px));
  height: min(820px, calc(100vh - 48px));
  max-width: none; /* thắng max-width 480px chung của .modal-box */
  max-height: none;
  overflow: hidden;
  background: linear-gradient(180deg, var(--primary-50) 0, var(--surface) 220px);
}
/* Cấp Trợ lý AI + văn phong (Cài đặt › Trợ lý AI, bảng chọn lần đầu) */
.features-ai { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.features-ai h3 { margin: 0 0 8px; font-size: 15px; }
.ai-lv { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ai-lv-group { display: flex; flex-direction: column; gap: 6px; }
.ai-lv-head { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; }
.ai-lv-opt { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.ai-lv-opt.is-on { border-color: var(--primary); background: var(--primary-50); }
.ai-lv-opt input { margin-top: 3px; }
.ai-lv-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-lv-text em { font-style: normal; font-weight: 500; font-size: 12px; color: var(--ink-soft); }
.ai-lv-text small { color: var(--ink-soft); font-size: 12px; line-height: 1.4; }
.set-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ml-row:not(:first-child):hover{
  background: #edf2f8;
}
/* ---------- THANH TAB CHẾ ĐỘ XEM CỦA DỰ ÁN (projects.js, projectViewBarHTML) ----------
   Giữ kiểu "khay lõm" cũ của .view-tabs; mỗi tab là label radio + nút ⋯, nút + đứng ngoài khay
   nên màn hình nhỏ khay cuộn ngang mà nút + vẫn luôn bấm được. */
.pv-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; min-width: 0; }
.pv-bar .view-tabs { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.pv-bar .view-tabs::-webkit-scrollbar { display: none; }
.pv-bar.is-busy .view-tabs { opacity: 0.7; }
.view-tab-wrap { position: relative; display: flex; align-items: center; flex: none; border-radius: 7px; transition: background-color 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease; }
.view-tab-wrap:has(.view-radio:checked) { background: var(--surface); box-shadow: var(--shadow-sm); }
.view-tab-wrap .view-tab { white-space: nowrap; }
.view-tab-wrap .view-tab:has(.view-radio:checked) { background: transparent; box-shadow: none; }
.view-tab-default { width: 6px; height: 6px; margin-left: 2px; border-radius: 50%; background: var(--primary); }
/* Nút ⋯ nằm cuối khay tab (sau tab cuối), cùng cỡ với 1 tab */
.view-tab-add {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.view-tab-add:hover, .view-tab-add[aria-expanded="true"] { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }
.view-tab-add:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.view-tab-add:disabled { opacity: 0.5; cursor: progress; }
.view-tab-wrap.is-dragging { opacity: 0.45; }
.view-tab-wrap.is-drop-before { box-shadow: inset 3px 0 0 var(--primary); }
.view-tab-wrap.is-drop-after { box-shadow: inset -3px 0 0 var(--primary); }

.pv-pop {
  position: fixed; z-index: 60; width: 220px; max-width: calc(100vw - 16px); padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); animation: plPopIn 0.15s ease-out;
}
.pv-pop.is-add { width: 360px; }
/* 1 dòng / chế độ: [icon + tên + mô tả] [★ ↑ ↓] [công tắc xanh .auto-switch dùng chung với Tự động hóa] */
.pv-row { display: flex; align-items: center; gap: 4px; padding-right: 6px; border-radius: 6px; }
.pv-row:hover { background: var(--bg); }
.pv-row .pv-option { flex: 1; min-width: 0; }
.pv-row:not(.is-on) .pv-option-icon { color: var(--muted); }
.pv-row:not(.is-on) .pv-option-text strong { color: var(--ink-soft); }
.pv-row-tools { display: inline-flex; align-items: center; flex: none; }
.pv-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer;
}
.pv-icon-btn:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.pv-icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary); }
.pv-icon-btn:disabled { opacity: 0.35; cursor: default; }
.pv-icon-btn.is-active { color: var(--warning); opacity: 1; }
.pv-icon-btn.is-up svg, .pv-icon-btn.is-down svg { transform: rotate(90deg); } /* danh sách dọc: ‹ › xoay thành ↑ ↓ */
.pv-row .auto-switch { margin-left: 4px; }
.pv-row .auto-switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-100); }
.pv-row .auto-switch input:disabled + span { opacity: 0.6; cursor: not-allowed; }
.pv-option-text strong .pv-option-badge { margin-left: 6px; font-size: 10.5px; vertical-align: 1px; }
@media (max-width: 420px) { .pv-row .pv-option-text small { display: none; } } /* điện thoại hẹp: ẩn mô tả để đủ chỗ công tắc */
.pv-pop .pl-pop-option:disabled { opacity: 0.5; cursor: default; }
.pv-option {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px;
  border: 0; border-radius: 6px; background: transparent; font: inherit; text-align: left; color: var(--ink); cursor: pointer;
}
.pv-option:hover:not(:disabled), .pv-option:focus-visible { background: var(--primary-50); outline: none; }
.pv-option:disabled { opacity: 0.5; cursor: default; }
.pv-option-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 8px; background: var(--bg); color: var(--primary-600);
}
.pv-option.is-plain .pv-option-icon { background: transparent; color: var(--ink-soft); }
.pv-option-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pv-option-text strong { font-size: 13.5px; font-weight: 600; }
.pv-option-text small { font-size: 12px; line-height: 1.4; color: var(--ink-soft); }
.pv-option-badge {
  align-self: center; flex: none; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--primary-100); color: var(--primary-600); font-size: 11px; font-weight: 600;
}
.pv-pop-note { margin: 4px 8px 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* Quy trình không dùng bộ lọc: báo rõ, chỉ hiện khi đang đứng ở tab Quy trình */
.pv-filter-note {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--warning-50); color: var(--warning-700); font-size: 13px;
}
.pv-filter-note span { flex: 1 1 240px; }
.page-view:has(input[id$="-workflow"]:checked) .pv-filter-note { display: flex; }

/* Tab Gantt: ẩn mặc định, chỉ hiện khi chọn tab; khi đó ẩn các chế độ khác */
.gantt-view { display: none; }
.page-view:has(input[id$="-gantt"]:checked) .kanban-board,
.page-view:has(input[id$="-gantt"]:checked) .task-list-view,
.page-view:has(input[id$="-gantt"]:checked) .calendar-view,
.page-view:has(input[id$="-gantt"]:checked) .workflow-view { display: none; }
.page-view:has(input[id$="-gantt"]:checked) .gantt-view { display: block; }
@media (prefers-reduced-motion: reduce) {
  .pv-pop { animation: none; }
  .view-tab-wrap, .view-tab-add { transition: none; }
}

/* ---------- TAB GANTT (calendar.js, ganttViewHTML) ----------
   Bố cục kiểu ClickUp: khung trái = danh sách (cột theo --cols), đường kẻ kéo được, khung phải = thanh thời gian.
   Mỗi khung có thanh cuộn ngang riêng; cao theo nội dung, cuộn dọc bằng trang. Hàng 2 bên cao bằng nhau (--row-h).
   Khoảng vẽ luôn bắt đầu từ thứ Hai nên tô cuối tuần bằng gradient lặp 7 ngày. */
/* Thanh công cụ của trang dự án đổi theo tab (radio tab + :has()):
   Kanban / Danh sách / Lịch = Tìm + Lọc + Thêm Việc; Gantt = Hôm nay + Xuất + Lọc; Quy trình = Tạo quy trình */
.gantt-tools { display: none; align-items: center; gap: 8px; }
.toolbar .tb-wf-only { display: none; }
.page-view:has(input[id$="-gantt"]:checked) .toolbar .gantt-tools { display: flex; }
.page-view:has(input[id$="-workflow"]:checked) .toolbar .tb-wf-only { display: inline-flex; }
.page-view:has(input[id$="-gantt"]:checked) .toolbar .search-field,
.page-view:has(input[id$="-gantt"]:checked) .toolbar .tb-add-task,
.page-view:has(input[id$="-workflow"]:checked) .toolbar .search-field,
.page-view:has(input[id$="-workflow"]:checked) .toolbar .tf-wrap,
.page-view:has(input[id$="-workflow"]:checked) .toolbar .tb-add-task { display: none; }
/* Đầu trang dự án giống nhau ở mọi tab (cần thêm chỗ thì bấm thu gọn); Gantt / Quy trình chỉ ẩn dòng gợi ý của bảng trống */
.page-view:has(input[id$="-gantt"]:checked) .project-empty-hint,
.page-view:has(input[id$="-workflow"]:checked) .project-empty-hint { display: none; }
/* Menu Xuất (Ảnh PNG / PDF / In) cạnh nút Hôm nay */
.gantt-export { position: relative; }
.gantt-export > .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
.gantt-export-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; display: flex; flex-direction: column; min-width: 150px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-md); }
.gantt-export-menu button { padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; }
.gantt-export-menu button:hover, .gantt-export-menu button:focus-visible { background: var(--bg); outline: none; }

.gantt-split {
  --row-h: 40px; --head-h: 62px; position: relative;
  display: grid; grid-template-columns: max(var(--glmin, 290px), min(var(--gl, 520px), calc(100% - 140px))) 2px minmax(0, 1fr); /* trái hẹp nhất = cột Tên hiện tại + nút "+" (ganttLeftMin) */
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden;
}
/* Hàng 1 = tiêu đề cột + thước ngày (không cuộn dọc), hàng 2 = thân cao tối đa 80vh. Thanh cuộn dọc chỉ ở khung phải nên
   bắt đầu ngay dưới thước ngày; khung trái cuộn dọc theo khung phải (calendar.js ganttSyncScroll). Cả 2 khung luôn có
   thanh cuộn ngang để chiều cao vùng nhìn bằng nhau (cuộn tới cuối không lệch dòng). */
.gantt-lheadbox { grid-column: 1; grid-row: 1; min-width: 0; overflow: hidden; }
.gantt-rheadbox { grid-column: 3; grid-row: 1; min-width: 0; overflow: hidden; }
.gantt-rheadbox > .gantt-rhead { box-sizing: content-box; padding-right: 24px; } /* bù chỗ thanh cuộn dọc của khung phải: cuộn ngang hết cỡ thước vẫn khớp */
.gantt-divider { grid-column: 2; grid-row: 1 / 3; }
.gantt-left { grid-column: 1; grid-row: 2; overflow-x: scroll; overflow-y: hidden; }
.gantt-right { grid-column: 3; grid-row: 2; overflow-x: scroll; overflow-y: auto; }
.gantt-left, .gantt-right { min-width: 0; max-height: calc(90vh - var(--head-h)); scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent;}
.gantt-left::-webkit-scrollbar, .gantt-right::-webkit-scrollbar { height: 10px; width: 10px; } /* 2 khung cùng độ dày thanh ngang */
.gantt-left::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; }
.gantt-left::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
.gantt-ltable { min-width: var(--lmin); }
.gantt-lbody, .gantt-rbody { padding-bottom: 8px; }
.gantt-split.has-new-pop .gantt-lbody, .gantt-split.has-new-pop .gantt-rbody { padding-bottom: 130px; } /* chừa chỗ cho khung tạo việc dưới hàng cuối */
.gantt-lrow { display: grid; grid-template-columns: var(--cols); height: var(--row-h); border-bottom: 1px solid var(--border-soft); }
.gantt-lrow.gantt-task { cursor: pointer; }
.gantt-lrow.gantt-task .avatar { width: 29px; height: 29px; }
.gantt-lhead {
  position: sticky; top: 0; z-index: 3; height: var(--head-h); align-items: end;
  background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.gantt-lhead .gantt-lcell { padding-bottom: 8px; align-self: end; }
.gantt-lcell { min-width: 0; display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.gantt-lcell-name { padding-left: calc(8px + var(--depth, 0) * 22px); font-size: 13.5px; color: var(--ink); }
.gantt-lproject .gantt-lcell-name, .gantt-ladd .gantt-lcell-name { grid-column: 1 / -1; }
.gantt-lproject .gantt-lcell-name { font-weight: 600; }
.gantt-lhead .gantt-lplus { padding-bottom: 4px; justify-content: flex-end; padding-right: 7px; }
/* Tiêu đề cột: rê chuột thì sáng lên cả ô (thấy cột phủ tới đâu); mép phải là tay nắm kéo đổi độ rộng */
.gantt-lhead .gantt-lcol { position: relative; align-self: stretch; align-items: flex-end; border-radius: 6px 6px 0 0; transition: background 0.12s ease; }
.gantt-lhead .gantt-lcol:hover, .gantt-lhead .gantt-lcol.is-resizing, .gantt-lhead .gantt-lcol:focus-within { background: #eef2f6; color: var(--ink-soft); }
.gantt-lcol-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-col-resize, .ovpt-name-resize { position: absolute; top: 8px; bottom: 0; right: -4px; z-index: 3; width: 8px; /* trên ô "+" dính mép phải (z 2): cột Tên nới hết cỡ vẫn kéo thu lại được */ cursor: col-resize; touch-action: none; }
.gantt-col-resize::after, .ovpt-name-resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; border-radius: 2px; background: transparent; transition: background 0.12s ease; }
.gantt-lcol:hover .gantt-col-resize::after, .gantt-lcol:hover .ovpt-name-resize::after { background: var(--border); }
.gantt-col-resize:hover::after, .gantt-col-resize:focus-visible::after, .gantt-lcol.is-resizing .gantt-col-resize::after,
.ovpt-name-resize:hover::after, .ovpt-name-resize:focus-visible::after, .gantt-lcol.is-resizing .ovpt-name-resize::after { background: var(--primary); }
.gantt-col-resize:focus-visible, .ovpt-name-resize:focus-visible { outline: none; }
/* Nút "+" luôn nổi ở mép phải khung trái, kể cả khi cuộn ngang / thu hẹp khung */
.gantt-lhead .gantt-lplus { position: sticky; right: 0; z-index: 2; background: var(--surface); }
/* Ô cuối mỗi hàng việc (cột "+") cũng dính mép phải, có nền: thu khung trái hết cỡ thì che hẳn các cột trường như mẫu */
.gantt-lrow.gantt-task > .gantt-lcell:last-child { position: sticky; right: 0; z-index: 1; background: var(--surface); }
.gantt-lrow.gantt-task.is-hover > .gantt-lcell:last-child { background: var(--bg); }
.gantt-plus-btn { width: 30px; height: 30px; }
.gantt-plus-btn.is-open { border-color: var(--primary); color: var(--primary-600); }
.gantt-name-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-lrow.is-hover, .gantt-rrow.is-hover { background: var(--bg); }
.gantt-ladd .pl-rename-input { flex: 1; min-width: 0; }
.gantt-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.gantt-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.gantt-prog { font-size: 12.5px; color: var(--ink-soft); }

/* Đường kẻ giữa: kéo (hoặc phím ← →) để nới / thu danh sách */
.gantt-divider { position: relative; z-index: 5; background: var(--border-soft); cursor: col-resize; touch-action: none; }
.gantt-divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: -6px; right: -6px; } /* đường kẻ 2px, vùng bấm kéo vẫn rộng */
.gantt-divider:hover, .gantt-divider:focus-visible, .gantt-split.is-dragging .gantt-divider:active { background: var(--primary); outline: none; }

/* Khung phải: thước ngày dính phía trên */
.gantt-grid { position: relative; min-height: 100%; }
.gantt-rhead { position: sticky; top: 0; z-index: 4; height: var(--head-h); background: var(--surface); border-bottom: 1px solid var(--border); }
.gantt-months, .gantt-days { display: flex; }
.gantt-months { height: 26px; } /* cao bằng dải tháng của Workload; nút phóng to nằm đè lên dải này */
.gantt-days { height: 35px; }
.gantt-month { flex: none; display: flex; align-items: center; padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: clip; border-left: 1px solid var(--border-soft); }
.gantt-month > span { display: inline-block; position: sticky; left: 8px; }
.gantt-day {
  flex: none; width: var(--day-w); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: 10.5px; line-height: 1.15; color: var(--muted); white-space: nowrap;
}
.gantt-day b { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.gantt-day.is-weekend b { color: var(--muted); }
.gantt-day.is-today b { min-width: 20px; padding: 1px 4px; border-radius: 999px; background: var(--danger); color: #fff; text-align: center; }
.gantt-rbody { position: relative; }
.gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--danger); opacity: 0.6; z-index: 2; pointer-events: none; }
.gantt-rrow { height: var(--row-h); border-bottom: 1px solid var(--border-soft); }
.gantt-track { position: relative; height: 100%; }
.gantt-split.is-day .gantt-track { background: linear-gradient(90deg, var(--border-soft) 1px, transparent 1px) 0 0 / var(--day-w) 100%; }
/* Cuối tuần: dải sọc chéo phía sau mọi hàng (cùng kiểu ngày nghỉ ở Workload), thước ngày phía trên cùng kiểu */
.gantt-weekends { position: absolute; inset: 0; pointer-events: none; }
.gantt-weekend, .gantt-day.is-weekend {
  background: repeating-linear-gradient(135deg, var(--border) 0 1.5px, transparent 1.5px 7px), #f6f8fb;
}
.gantt-weekend { position: absolute; top: 0; bottom: 0; box-shadow: inset 1px 0 0 var(--border), inset -1px 0 0 var(--border); }

/* Thanh công việc: kéo 2 mép (vạch trắng bên trong + chấm tròn bên ngoài hiện khi rê) để đổi ngày */
.gantt-bar {
  position: absolute; top: 7px; height: 26px; padding: 0;
  border: 1px solid var(--bar); border-radius: 6px; background: var(--primary-50); background: color-mix(in srgb, var(--bar) 55%, var(--surface));
  cursor: pointer; z-index: 1; transition: box-shadow 0.15s ease;
}
.gantt-bar:hover { box-shadow: var(--shadow-sm); }
.gantt-bar:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.gantt-bar.is-single { border-style: dashed; }
.gantt-handle { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; opacity: 0; transition: opacity 0.15s ease; touch-action: none; }
.gantt-handle.is-start { left: 0; }
.gantt-handle.is-end { right: 0; }
.gantt-handle::after { content: ""; position: absolute; top: 6px; bottom: 6px; left: 3px; width: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15); }
.gantt-handle::before {
  content: ""; position: absolute; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border: 2px solid var(--muted); border-radius: 50%; background: var(--surface);
}
.gantt-handle.is-start::before { left: -17px; }
.gantt-handle.is-end::before { right: -17px; }
.gantt-bar:hover .gantt-handle, .gantt-bar:focus-visible .gantt-handle, .gantt-split.is-dragging .gantt-handle { opacity: 1; }
.gantt-bar-label { position: absolute; top: 0; height: 100%; max-width: 300px; line-height: var(--row-h); overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; color: var(--ink); white-space: nowrap; pointer-events: none; } /* tên dài cắt "…", rê thanh việc vẫn thấy tên đủ */
/* Chấm tròn đi theo chuột trên hàng kéo được (calendar.js ganttCursorDot), nhãn nhỏ phía trên */
.gantt-cursor-dot {
  position: absolute; top: 50%; z-index: 2; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 1.5px solid var(--primary); border-radius: 50%; background: var(--primary-100);
  pointer-events: none;
}
.gantt-cursor-dot::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap;
}
/* Chấm vàng ở mép khung thời gian: dòng này có thanh việc đang bị cuộn khuất (calendar.js ganttEdgeMarks); rê = tên việc, bấm = cuộn tới */
.gantt-edge-mark {
  position: absolute; top: 50%; z-index: 3; width: 12px; height: 12px; margin-top: -6px; padding: 0;
  border: 2px solid var(--surface); border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 1px var(--warning-700), var(--shadow-sm);
  cursor: pointer;
}
.gantt-edge-mark:hover, .gantt-edge-mark:focus-visible { transform: scale(1.25); outline: none; }
.gantt-edge-mark::after {
  content: attr(data-tip); position: absolute; top: 50%; left: calc(100% + 8px); transform: translateY(-50%);
  padding: 4px 8px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap;
  pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.12s ease;
}
.gantt-edge-mark.is-right::after { left: auto; right: calc(100% + 8px); }
.gantt-edge-mark:hover::after, .gantt-edge-mark:focus-visible::after { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .gantt-edge-mark, .gantt-edge-mark::after { transition: none; } }
/* Thanh tổng của dự án: phần đậm = tỉ lệ việc đã xong */
.gantt-sum { position: absolute; top: 16px; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--success) 35%, var(--surface)); overflow: hidden; }
.gantt-sum > span { display: block; height: 100%; background: var(--success); }

/* Hàng chọn khoảng ngày: tạo việc mới / đặt ngày cho việc chưa có ngày */
.gantt-track[data-draw] { cursor: copy; }
.gantt-track[data-draw="new"] { touch-action: none; }
.gantt-draw-hint {
  position: sticky; left: 10px; display: inline-flex; align-items: center; height: 100%; padding-left: 10px;
  font-size: 12.5px; color: var(--muted); opacity: 0; transition: opacity 0.15s ease; pointer-events: none;
}
.gantt-track[data-draw]:hover .gantt-draw-hint, .gantt-rrow.is-hover .gantt-draw-hint { opacity: 1; }
.gantt-track:has(.gantt-ghost) .gantt-draw-hint { opacity: 0; }
.gantt-ghost { position: absolute; top: 7px; height: 26px; border: 1px dashed var(--primary-600); border-radius: 6px; background: color-mix(in srgb, var(--primary) 30%, transparent); pointer-events: none; }
.gantt-drag-tip {
  position: absolute; top: calc(100% - 4px); z-index: 6; padding: 2px 8px; border-radius: 6px;
  background: var(--ink); color: var(--surface); font-size: 11.5px; white-space: nowrap; pointer-events: none;
}
.gantt-new-pop {
  position: absolute; top: calc(100% + 4px); z-index: 7; width: 320px; max-width: 80vw; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); cursor: default;
}
.gantt-new-title { margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.gantt-new-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gantt-new-line .pl-rename-input { flex: 1; min-width: 0; }
.gantt-new-line .pl-new-error { flex-basis: 100%; order: 3; }

/* Bảng chọn trường của nút "+" */
.gantt-fields-pop {
  position: fixed; z-index: 60; width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.gantt-field-opt { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; font-size: 13.5px; cursor: pointer; }
.gantt-field-opt:hover { background: var(--primary-50); }

@media (max-width: 760px) {
  /* Điện thoại: không ép tối thiểu 290px (màn quá hẹp, phần thời gian sẽ mất); khung trái tối đa 58%, cột tên cuộn ngang */
  .gantt-split { grid-template-columns: min(var(--gl, 520px), 58%) 2px minmax(0, 1fr); }
}
/* Màn cảm ứng: tay kéo luôn hiện và to hơn cho dễ chạm */
@media (pointer: coarse) {
  .gantt-handle { width: 16px; opacity: 1; }
  .gantt-divider::before { left: -10px; right: -10px; }
}
@media (prefers-reduced-motion: reduce) { .gantt-bar, .gantt-handle, .gantt-draw-hint { transition: none; } }

/* Thanh tab nằm cùng hàng tìm kiếm / Lọc / Thêm Việc: tab co lại (cuộn ngang) trước, ô tìm kiếm và nút thu gọn để vừa 1 hàng */
.toolbar .pv-bar { flex: 0 1 auto; margin: 0; }
.toolbar .toolbar-spacer { flex: 1 1 0; min-width: 0; }
.page-view .toolbar .search-field { min-width: 0; width: 266px; flex: 0 1 266px; padding: 7px 10px; }
.page-view .toolbar > .btn-primary { flex: none; white-space: nowrap; }
@media (max-width: 1100px) {
  .toolbar .pv-bar { flex: 1 1 100%; order: 1; } /* màn hình hẹp (kể cả laptop zoom 150%): tab 1 hàng riêng để thấy đủ tab, cuộn ngang, nút + vẫn ở cuối */
}
@media (max-width: 620px) {
  .page-view .toolbar .search-field { width: auto; flex: 1 1 100%; } /* điện thoại: ô tìm kiếm trở lại 1 hàng đầy đủ như cũ */
}
@media (min-width: 1101px) {
  .page-view .toolbar { flex-wrap: nowrap; } /* máy tính: luôn 1 hàng; nhiều tab thì khay tab cuộn ngang thay vì rớt dòng */
}
/* Khay tab cuộn ngang: tối đa 6 mục (kể cả nút ⋯, là 1 mục như tab), dư thì nút < / > hai bên (projects.js pvBarsSync).
   Khay position: relative để đo offsetLeft của từng tab theo khay. */
.pv-bar .view-tabs { position: relative; order: 0; } /* order 0: đè quy tắc màn hẹp cũ ".view-tabs { order: 1 }" (đẩy khay ra sau nút < / >); trượt mượt chỉ khi bấm < / > (scrollBy smooth), khôi phục vị trí lúc vẽ lại thì đặt ngay */
.pv-bar .view-tab-add:hover, .pv-bar .view-tab-add[aria-expanded="true"] { background: var(--surface); }
/* Nút < / > nằm TRONG khung trắng như 1 tab (chủ dự án 16/11/2026): không viền, nền trong, rê chuột tô nền nhạt */
.pv-nav {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 26px; height: calc(var(--toolbar-h, 38px) - 6px); padding: 0;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink-soft);
  cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease;
}
.pv-nav[hidden] { display: none; }
.pv-nav:hover { background: var(--bg); color: var(--primary-600); }
.pv-nav:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
@media (prefers-reduced-motion: reduce) { .pv-nav { transition: none; } }

/* ---------- HỘP THOẠI XÁC NHẬN / THÔNG BÁO (shared.js: xacNhan, thongBao) ----------
   Mở bằng checkbox ẩn #app-dialog-toggle + :has(), nổi trên mọi lớp (kể cả hộp thoại khác đang mở).
   .is-quick: câu hỏi ngắn — canh giữa, icon ô vuông bo góc, nút × góc trên, 2 nút bằng nhau.
   .is-detail: có giải thích dài / ô "Không hỏi lại" — canh trái, icon tròn có quầng, nút về bên phải. */
.app-dialog-overlay {
  position: fixed; inset: 0; z-index: 3000; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 23, 42, 0.35);
}
body:has(#app-dialog-toggle:checked) .app-dialog-overlay { display: flex; }
.app-dialog {
  --dlg: var(--primary-600); --dlg-bg: var(--primary-50); --dlg-ring: var(--primary-100);
  position: relative; width: min(400px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 28px 24px 22px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-lg); animation: appDialogIn 0.18s ease-out;
}
@keyframes appDialogIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.app-dialog.is-danger, .app-dialog.is-error { --dlg: var(--danger-600); --dlg-bg: var(--danger-50); --dlg-ring: var(--danger-100); }
.app-dialog.is-warning { --dlg: var(--warning-600); --dlg-bg: var(--warning-50); --dlg-ring: var(--warning-100); }
.app-dialog.is-success { --dlg: var(--success-600); --dlg-bg: var(--success-50); --dlg-ring: var(--success-100); }

.app-dialog-x {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: var(--ink-soft); color: #fff; cursor: pointer; opacity: 0.75;
}
.app-dialog-x:hover { opacity: 1; }
.app-dialog-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px;
  border-radius: 14px; background: var(--dlg-bg); color: var(--dlg);
}
.app-dialog-title { margin: 14px 0 6px; font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.35; overflow-wrap: anywhere; }
.app-dialog-msg { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-soft); overflow-wrap: anywhere; }
.app-dialog-foot { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.app-dialog-btn {
  min-height: 40px; padding: 0 20px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease;
}
.app-dialog-btn.is-ok { border: 1px solid var(--dlg); background: var(--dlg); color: #fff; }
.app-dialog-btn.is-ok:hover { filter: brightness(0.94); }
.app-dialog-btn.is-cancel { border: 1px solid transparent; background: var(--bg); color: var(--ink); }
.app-dialog-btn.is-cancel:hover { background: var(--border); }
.app-dialog-btn:focus-visible, .app-dialog-x:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--dlg-ring); }

/* Hỏi nhanh: canh giữa, nút chia đều */
.app-dialog.is-quick { text-align: center; }
.app-dialog.is-quick .app-dialog-foot > .app-dialog-btn { flex: 1 1 0; }

/* Chi tiết: canh trái, icon tròn có quầng, nút về bên phải */
.app-dialog.is-detail { width: min(520px, 100%); padding: 26px 26px 24px; }
.app-dialog.is-detail .app-dialog-x { display: none; }
.app-dialog.is-detail .app-dialog-icon { width: 42px; height: 42px; margin: 16px 0 0 16px; border-radius: 50%; background: var(--dlg); color: #fff; box-shadow: 0 0 0 8px var(--dlg-ring), 0 0 0 16px var(--dlg-bg); } /* chấm đậm có 2 vòng quầng */
.app-dialog.is-detail .app-dialog-title { margin-top: 30px; font-size: 18px; }
.app-dialog.is-detail .app-dialog-foot { justify-content: flex-end; flex-wrap: wrap; }
.app-dialog.is-detail .app-dialog-btn.is-cancel { border-color: var(--border); background: var(--surface); }
.app-dialog.is-detail .app-dialog-btn.is-cancel:hover { background: var(--bg); }
.app-dialog-skip { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.app-dialog-skip input { width: 18px; height: 18px; accent-color: var(--primary-600); }

@media (max-width: 480px) {
  .app-dialog-overlay { align-items: flex-end; padding: 12px; } /* điện thoại: hộp nằm sát đáy, ngón cái dễ bấm */
  .app-dialog.is-detail .app-dialog-foot > .app-dialog-btn { flex: 1 1 0; }
  .app-dialog-skip { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { .app-dialog { animation: none; } }

/* ---------- THÙNG RÁC dạng danh sách (subtasks.js, renderTrashModal) ---------- */
/* Độ rộng hộp: xem #modal-trash .modal-box. Chữ dài thì xuống dòng thay vì bị cắt "…" */
.trash-card { padding: 4px 12px 8px; box-shadow: none; }
.trash-table { --ml-cols: 40px minmax(220px, 2.4fr) minmax(180px, 1.8fr) minmax(130px, 1fr) minmax(110px, 0.8fr) 172px; min-width: 900px; }
.trash-table .ml-cell { padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; overflow: visible; }
.trash-table .ml-desc, .trash-table .ml-name-text strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.trash-row { cursor: default; }
.trash-row:hover > .ml-cell { background: #edf2f8; }
.trash-row.is-selected > .ml-cell, .trash-row.is-selected:hover > .ml-cell { background: var(--primary-50); }
.trash-cell-name .ml-name-text small { white-space: normal; }
.trash-cell-name .trash-warn { color: var(--warning-700); }
.trash-table .trash-cell-act { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
/* Nút ✕ Xóa vĩnh viễn: màu theo quy ước chung của nút ✕ (đỏ); cao bằng nút Khôi phục nhờ khung inline-flex */
.trash-acts { display: inline-flex; align-items: stretch; gap: 6px; }
.trash-table .trash-purge { width: 34px; height: auto; flex: 0 0 auto; }
.trash-table .trash-purge:disabled { opacity: 0.5; cursor: not-allowed; }
/* Thanh thao tác hàng loạt: dính đáy vùng cuộn của hộp thoại để luôn thấy khi danh sách dài */
.trash-bulk {
  position: sticky; bottom: -1px; z-index: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 14px; border: 1px solid var(--primary-100); border-radius: var(--radius-md);
  background: var(--primary-50); box-shadow: var(--shadow-md); font-size: 14px; color: var(--ink);
}
.trash-bulk > span { margin-right: auto; }
@media (max-width: 560px) {
  .trash-bulk > span { flex: 1 1 100%; }
  .trash-bulk .btn-primary, .trash-bulk .btn-secondary { flex: 1 1 0; justify-content: center; }
}

/* ---------- NÚT X ĐÓNG (hộp thoại, bảng chi tiết, hồ sơ, danh sách ngày...) ----------
   Mặc định nền đỏ X trắng; rê chuột: đỏ sáng hơn + quầng đỏ. Chỉ áp cho nút ĐÓNG (icon-btn chỉ chứa icon-close,
   .mqv-close, .app-dialog-x); nút × nhỏ gỡ chip (bỏ người, bỏ tệp, xóa từ khóa) giữ nguyên. */
.icon-btn:has(> svg > use[href="#icon-close"]),
.mqv-close,
.app-dialog-x {
  border-color: var(--danger-600);
  background: var(--danger-600);
  color: #fff;
  opacity: 1;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.icon-btn:has(> svg > use[href="#icon-close"]):hover,
.mqv-close:hover,
.app-dialog-x:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 0 4px var(--danger-100), 0 4px 14px rgba(225, 29, 72, 0.35);
}
.icon-btn:has(> svg > use[href="#icon-close"]):focus-visible,
.mqv-close:focus-visible,
.app-dialog-x:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--danger-100);
}
@media (prefers-reduced-motion: reduce) {
  .icon-btn:has(> svg > use[href="#icon-close"]), .mqv-close, .app-dialog-x { transition: none; }
}

/* Form Sửa công việc: lỗi khi lưu + khung xung đột mô tả (tasks.js handleEditTaskSubmit) */
.form-banner { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.45; }
.form-banner.is-error { background: var(--danger-50); border: 1px solid var(--danger-100); color: var(--danger-600); }
.edit-conflict { margin: 0 0 12px; padding: 12px; border: 1px solid var(--warning-100); border-radius: var(--radius-sm); background: var(--warning-50); font-size: 13.5px; color: var(--ink); }
.edit-conflict p { margin: 4px 0 8px; color: var(--ink-soft); }
.edit-conflict-server { max-height: 180px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.edit-conflict-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; }

/* Màn hình hẹp: hàng nút đầu trang dự án (Mời · Tài liệu · Nhật ký · Thùng rác · ⋯) xuống dòng thay vì đẩy trang
   rộng hơn màn hình. Trang rộng hơn màn hình làm trình duyệt di động nới vùng bố cục -> mọi hộp thoại bị lệch phải. */
@media (max-width: 900px) {
  .project-header-actions { flex-wrap: wrap; row-gap: 8px; min-width: 0; max-width: 100%; }
  .project-header-actions > .btn-secondary, .project-header-actions > label.btn-secondary { white-space: nowrap; }
}
/* Khung cuộn ngang của bảng: phần tử absolute bên trong (nhãn .sr-only cho trình đọc màn hình) phải nằm trong khung.
   Không có position, chúng "thoát" ra ngoài vùng cắt và kéo trang rộng hơn màn hình (điện thoại: hộp thoại lệch phải). */
.task-table-scroll, .pl-table-scroll, .ml-scroll { position: relative; }

/* ---------- TRỢ LÝ AI CỦA DỰ ÁN (ai.js) — panel phải, cùng kiểu panel Trợ giúp ---------- */
/* Mở từ nút ✨ của tệp trong chi tiết việc: nổi trên bảng chi tiết (55) và popup rộng (56), dưới hộp thoại (60) */
#ai-overlay { z-index: 57; }
body:has(#ai-panel-toggle:checked) #ai-overlay { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#ai-panel-toggle:checked) #ai-overlay .detail-panel { transform: translateX(0); }
.ai-panel { display: flex; flex-direction: row; width: min(480px, 100vw); }
.ai-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; } /* khung chat (cột phải khi mở to) */
.ai-head { align-items: center; gap: 10px; }
.ai-head-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); }
.ai-head-text { flex: 1; min-width: 0; }
.ai-head-text .help-title { margin: 0; }
.ai-project { flex: none; margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--border-soft); background: var(--primary-50); font-size: 13px; line-height: 1.4; color: var(--ink-soft); overflow-wrap: anywhere; }
.ai-project strong { color: var(--ink); }
.ai-beta { display: inline-block; white-space: nowrap; margin-left: 6px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--warning-50); border: 1px solid var(--warning-100); font-size: 11px; font-weight: 600; color: var(--warning-700); vertical-align: 2px; }
.ai-beta.is-high { background: var(--danger-50); border-color: var(--danger-100); color: var(--danger-600); }
.ai-new-btn { flex: none; padding: 6px 10px; font-size: 12.5px; }
.ai-new-btn .ai-new-ico { display: none; }
.ai-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.ai-intro p, .ai-note { margin: 0 0 6px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.ai-note { font-size: 12.5px; color: var(--muted); }
.ai-msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.ai-msg p { margin: 0 0 6px; }
.ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul { margin: 0 0 6px; padding-left: 20px; list-style: disc; } /* CSS chung bỏ dấu chấm của danh sách: bật lại trong câu trả lời */
.ai-msg li { margin: 2px 0; }
/* Câu trả lời kiểu báo cáo: ý con, dòng ngăn, việc cần làm, bảng (dùng chung cho mọi chỗ gọi aiFormat) */
.ai-msg li.is-sub, .ai-answer li.is-sub { margin-left: 18px; list-style: circle; }
.ai-sep { border: 0; border-top: 1px dashed var(--border); margin: 10px 0; }
.ai-todo { padding-left: 4px; }
.ai-sub { padding-left: 18px; color: var(--ink-soft); }
.ai-table-wrap { max-width: 100%; overflow-x: auto; margin: 4px 0 8px; }
.ai-table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.ai-table th, .ai-table td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; vertical-align: top; }
.ai-table th { background: var(--primary-50); font-weight: 600; white-space: nowrap; }
.ai-msg-tools { display: flex; justify-content: flex-end; margin-top: 6px; }
.ai-copy { border: 1px solid var(--border); background: transparent; color: var(--ink); border-radius: 8px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.ai-copy:hover { background: var(--primary-50); }
/* Trợ lý hiện chữ dần: nút Dừng (cạnh ba chấm hoặc dưới chữ đang viết), dòng báo câu trả lời chưa đầy đủ */
.ai-stop { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 3px 10px; font-size: 12px; cursor: pointer; margin-left: 8px; }
.ai-stop:hover { background: var(--bg); }
.ai-msg.is-typing .ai-stop { width: auto; height: auto; border-radius: 8px; animation: none; }
.ai-msg.is-streaming .ai-msg-tools { justify-content: flex-start; }
.ai-msg.is-streaming .ai-stop { margin-left: 0; }
.ai-partial { color: var(--ink-soft); font-style: italic; }
.ai-msg.is-ai:has(.ai-table) { max-width: 100%; }
.ai-msg.is-user { align-self: flex-end; background: var(--primary-50); border: 1px solid var(--primary-100); }
.ai-msg.is-ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.ai-msg.is-error { align-self: stretch; max-width: none; background: var(--danger-50); border: 1px solid var(--danger-100); color: var(--danger-600); }
.ai-msg.is-info { align-self: stretch; max-width: none; background: var(--warning-50); border: 1px solid var(--warning-100); }
.ai-msg.is-error .btn-secondary { margin-top: 6px; }
.ai-ref { padding: 0 4px; border: 0; border-radius: 4px; background: var(--primary-50); color: var(--primary-600); font: inherit; font-weight: 600; cursor: pointer; }
.ai-ref:hover, .ai-ref:focus-visible { background: var(--primary-100); outline: none; }
/* Việc AI nhắc: chip tên việc tô màu trạng thái + icon trạng thái; tên dài cắt "…", rê xem đủ (title) */
.ai-task-chip { --st: var(--primary); display: inline-flex; align-items: center; gap: 4px; max-width: min(100%, 280px); padding: 1px 8px 1px 6px; margin: 0 1px;
  border: 1px solid color-mix(in srgb, var(--st) 45%, transparent); border-radius: var(--radius-pill); background: var(--st-bg, var(--primary-50));
  background: color-mix(in srgb, var(--st) 14%, transparent); color: var(--ink); font: inherit; font-size: 0.95em; font-weight: 500; line-height: 1.5; vertical-align: baseline; cursor: pointer; }
.ai-task-chip svg { flex: 0 0 auto; color: var(--st); }
.ai-task-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-task-chip:hover, .ai-task-chip:focus-visible { background: color-mix(in srgb, var(--st) 24%, transparent); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--st) 30%, transparent); }
/* @Tên thành viên AI nhắc: bấm mở hồ sơ */
.ai-person { padding: 0 3px; border: 0; border-radius: 4px; background: transparent; color: var(--primary-600); font: inherit; font-weight: 600; cursor: pointer; }
.ai-person:hover, .ai-person:focus-visible { background: var(--primary-50); text-decoration: underline; outline: none; }
.ai-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.ai-ref.is-chip { padding: 3px 8px; border: 1px solid var(--primary-100); border-radius: var(--radius-pill); font-weight: 500; text-align: left; }
.ai-ref.is-chip small { color: var(--muted); font-size: 11.5px; }
.ai-scope { margin: 8px 0 0 !important; font-size: 12px; color: var(--muted); }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ai-chip { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.ai-chip:hover:not(:disabled), .ai-chip:focus-visible { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); outline: none; }
.ai-chip:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-msg.is-typing { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-size: 13px; }
.ai-msg.is-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: aiDot 1s infinite ease-in-out; }
.ai-msg.is-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-msg.is-typing span:nth-child(3) { animation-delay: 0.3s; margin-right: 6px; }
@keyframes aiDot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-composer { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--border-soft); background: var(--surface); }
.ai-composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: vertical; }
.ai-send { flex: none; min-height: 44px; }
.ai-open-btn svg { color: var(--primary-600); }
@media (max-width: 560px) {
  .ai-panel { width: 100vw; }
  /* Điện thoại: nút chỉ còn icon + để huy hiệu token ("16.042 / 150.000 token") không bị cắt / chồng lên nút */
  .ai-new-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .ai-new-btn .ai-new-ico { display: block; }
  .ai-new-btn .ai-new-text { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ai-msg.is-typing span { animation: none; opacity: 0.6; } }

/* ---------- THẺ "ĐỀ XUẤT THAY ĐỔI" CỦA TRỢ LÝ AI (ai.js) ---------- */
.pl-page-head > .ai-open-btn { height: 40px; box-sizing: border-box; }
.ai-prop { align-self: stretch; border: 1px solid var(--primary-100); border-radius: 12px; background: var(--surface); padding: 12px; font-size: 13.5px; }
.ai-prop-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-prop-head strong { font-size: 14px; color: var(--ink); }
.ai-prop-head > span { color: var(--muted); font-size: 12.5px; }
.ai-prop-state { margin-left: auto; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--bg); color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.ai-prop-state.is-done { background: var(--success-50); color: var(--success-700); }
.ai-prop-sum { margin: 6px 0 0; color: var(--ink-soft); }
.ai-prop-group { margin-top: 8px; border: 1px solid var(--border-soft); border-radius: 8px; }
.ai-prop-group > summary { cursor: pointer; padding: 8px 10px; font-weight: 600; color: var(--ink); list-style: revert; overflow-wrap: anywhere; }
.ai-prop-group > summary small { font-weight: 400; color: var(--muted); }
.ai-prop-kind { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--bg); color: var(--ink-soft); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.ai-prop-kind.is-new { background: var(--primary-50); color: var(--primary-600); }
.ai-prop-item { padding: 8px 10px; border-top: 1px solid var(--border-soft); }
.ai-prop-item.is-off { opacity: 0.55; }
.ai-prop-item.is-off .ai-prop-changes { text-decoration: line-through; }
.ai-prop-item.is-err { background: var(--danger-50); }
.ai-prop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-prop-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); cursor: pointer; }
.ai-prop-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.ai-prop-changes { margin: 6px 0 0; padding-left: 18px; list-style: disc; color: var(--ink-soft); }
.ai-prop-changes li { margin: 2px 0; overflow-wrap: anywhere; }
.ai-prop-changes s { color: var(--muted); }
.ai-prop-changes b { color: var(--ink); font-weight: 600; }
.ai-prop-lbl { color: var(--muted); }
.ai-badge-sug { margin-left: 4px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--warning-50); border: 1px solid var(--warning-100); color: var(--warning-700); font-size: 11px; font-style: normal; font-weight: 600; white-space: nowrap; }
.ai-prop-err { margin: 6px 0 0; color: var(--danger-600); font-size: 12.5px; }
.ai-prop-edit { display: grid; gap: 8px; margin-top: 8px; }
.ai-prop-field { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-soft); }
.ai-prop-field .form-control { font-size: 13.5px; }
.ai-prop-note { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--primary-50); color: var(--ink); font-size: 13px; }
.ai-prop-note.is-err { background: var(--danger-50); color: var(--danger-600); }
.ai-prop-done { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--success-50); }
.ai-prop-done p { margin: 0 0 6px; color: var(--success-700); }
.ai-prop-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ai-prop-hint { margin-right: auto; font-size: 12.5px; color: var(--warning-700); }
.ai-msg.is-question { border-color: var(--warning-100); background: var(--warning-50); }
@media (max-width: 480px) {
  .ai-prop-foot > button { flex: 1 1 auto; }
  .ai-prop-hint { flex: 1 1 100%; }
}

/* ===== Trợ lý AI: nhập kế hoạch (📎 CSV / XLSX / dán văn bản) -> đề xuất tạo công việc (ai.js aiImport*) ===== */
/* Ô chat: 📎 + ô nhập + Gửi cùng 1 hàng cao 44px; thẻ tệp đính kèm chiếm hàng riêng phía trên */
.ai-composer { flex-wrap: wrap; }
.ai-composer textarea { min-height: 44px; }
.ai-attach-btn { flex: none; width: 44px; height: 44px; }
.ai-attach-btn[hidden] { display: none; }
.ai-attached { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ai-attached[hidden] { display: none; }
.ai-file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 4px 4px 10px; border: 1px solid var(--primary-100); border-radius: var(--radius-pill); background: var(--primary-50); color: var(--primary-600); font-size: 13px; }
.ai-file-chip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.ai-file-chip small { flex: none; color: var(--muted); font-size: 12px; }
.ai-file-x { flex: none; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font-size: 18px; line-height: 1; cursor: pointer; }
.ai-file-x:hover, .ai-file-x:focus-visible { background: var(--danger-50); color: var(--danger-600); outline: none; }
.ai-file-hint { font-size: 12px; color: var(--muted); }
.ai-msg-file { font-size: 12.5px; color: var(--primary-600); font-weight: 600; overflow-wrap: anywhere; }
.ai-msg.ai-imp { align-self: stretch; max-width: none; }
.ai-imp-stats { margin: 6px 0 0; color: var(--ink-soft); }
.ai-imp-stats b { color: var(--ink); }
.ai-imp-warn-count { color: var(--warning-700); font-weight: 600; }
.ai-imp-err-count { color: var(--danger-600); font-weight: 600; }
.ai-imp-missing { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.ai-imp-list { margin-top: 8px; border: 1px solid var(--border-soft); border-radius: 8px; }
.ai-imp-row { padding: 7px 10px 7px calc(10px + var(--cap, 0) * 18px); border-top: 1px solid var(--border-soft); }
.ai-imp-row:first-child { border-top: 0; }
.ai-imp-row.is-off { opacity: 0.55; }
.ai-imp-row.is-off .ai-imp-name { text-decoration: line-through; }
.ai-imp-row.is-err { background: var(--danger-50); }
.ai-imp-check { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; font-weight: 600; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.ai-imp-check input { flex: none; width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); }
.ai-imp-meta { margin: 2px 0 0 22px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ai-imp-miss { color: var(--ink-soft); font-style: italic; }
.ai-imp-warn { margin: 4px 0 0 22px; padding: 0; list-style: none; font-size: 12px; color: var(--warning-700); }
.ai-imp-warn li { margin: 1px 0; overflow-wrap: anywhere; }
.ai-imp-row .ai-prop-err, .ai-imp-row .ai-prop-edit { margin-left: 22px; }
.ai-imp-expand { width: 100%; margin-top: 8px; }
.ai-imp-modal-box { max-width: 760px; }
#modal-ai-import .modal-body { padding-top: 4px; }
#modal-ai-import .ai-prop { border: 0; padding: 0; }
body:has(#modal-ai-import-toggle:checked) #modal-ai-import { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#modal-ai-import-toggle:checked) #modal-ai-import .modal-box { transform: scale(1); opacity: 1; }
@media (max-width: 480px) {
  .ai-imp-row { padding-left: calc(8px + var(--cap, 0) * 12px); }
}
/* Kéo thả tệp kế hoạch vào khung chat AI */
.ai-panel { position: relative; }
.ai-panel.is-drop::after { content: "Thả tệp CSV / Excel vào đây"; position: absolute; inset: 8px; z-index: 6; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--primary); border-radius: 12px; background: color-mix(in srgb, var(--primary-50) 88%, transparent); color: var(--primary-600); font-weight: 600; font-size: 15px; pointer-events: none; }
.ai-imp-row.is-project { background: var(--primary-50); }
.ai-imp-row.is-dep { background: var(--bg); }
.ai-imp-row.is-dep .ai-prop-kind { background: var(--warning-100); color: var(--warning-700); }
.ai-next { margin-top: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-soft); }
.ai-next p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.ai-next p strong { color: var(--ink); }
/* Sửa trực tiếp tên / mô tả trên đầu trang dự án (projects.js projectInline*) */
.project-inline-text { cursor: text; border-radius: 6px; margin-left: -6px; padding: 0 6px; transition: background 0.15s ease; }
.project-inline-text:hover, .project-inline-text:focus-visible { background: var(--primary-50); outline: none; box-shadow: inset 0 0 0 1px var(--primary-100); }
.project-inline-text.is-empty { color: var(--muted); font-style: italic; }
.project-inline-input { width: min(640px, 100%); font-size: 14px; }
.project-inline-input.is-name { font-size: 21px; font-weight: 700; padding: 4px 8px; }
textarea.project-inline-input { resize: vertical; min-height: 64px; margin-top: 6px; }
.project-inline-input[aria-invalid="true"] { border-color: var(--danger); }
.project-inline-hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.project-inline-hint.is-err { color: var(--danger-600); }
/* Lịch sử trò chuyện AI (ai.js aiHistory*) + Cài đặt › Trợ lý AI */
.ai-history-btn { flex: none; }
.ai-hist { align-self: stretch; display: grid; gap: 8px; }
.ai-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-hist-head strong { font-size: 15px; color: var(--ink); }
.ai-hist-empty { padding: 18px 12px; border: 1px dashed var(--border); border-radius: 10px; text-align: center; color: var(--muted); font-size: 13.5px; }
.ai-hist-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ai-hist-item { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); }
.ai-hist-item.is-on { border-color: var(--primary-100); background: var(--primary-50); }
.ai-hist-open { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 9px 12px; border: 0; background: transparent; font: inherit; text-align: left; color: var(--ink); cursor: pointer; border-radius: 10px; }
.ai-hist-open b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.ai-hist-open small { color: var(--muted); font-size: 12px; }
.ai-hist-open:hover, .ai-hist-open:focus-visible { background: var(--primary-50); outline: none; }
.ai-hist-del { flex: none; margin-right: 4px; color: var(--ink-soft); }
.ai-hist-del:hover, .ai-hist-del:focus-visible { color: var(--danger-600); background: var(--danger-50); }
.ai-hist-del[data-action="ai-history-rename"]:hover, .ai-hist-del[data-action="ai-history-rename"]:focus-visible { color: var(--primary-600); background: var(--primary-50); }
.ai-side-item.is-renaming { flex-direction: column; align-items: stretch; padding: 6px 8px; }
.ai-hist-rename { height: 34px; font-size: 14px; }
.set-ai-custom { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.set-ai-custom input { width: 96px; }
/* Trợ lý AI: nguồn trích dẫn trong tài liệu ([S#] -> nút "Trang 3"), đoạn trích, gợi ý khi đính kèm */
.ai-src { display: inline-block; margin: 0 2px; padding: 0 6px; border: 1px solid var(--primary-100); border-radius: var(--radius-pill); background: var(--primary-50); color: var(--primary-600); font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.6; vertical-align: 1px; cursor: pointer; white-space: nowrap; }
.ai-src:hover, .ai-src:focus-visible { background: var(--primary-100); outline: none; }
.ai-src.is-expired { border-color: var(--border); background: var(--bg); color: var(--muted); cursor: not-allowed; text-decoration: line-through; }
.ai-src-box { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--primary); border-radius: 6px; background: var(--bg); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.ai-src-box-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; font-size: 12px; color: var(--ink-soft); }
.ai-src-box p { margin: 0; }
.ai-imp-src { margin: 3px 0 0 22px; font-size: 12px; color: var(--muted); }
.ai-attach-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chip.is-small { padding: 4px 10px; font-size: 12.5px; }
.ai-file-chip.is-active { border-color: var(--border); background: var(--bg); color: var(--ink-soft); }
.ai-file-chip.is-active span { font-size: 12px; }
/* Trợ lý AI mở to (nút tròn giữa mép trái, ai.js aiToggleWide): popup giữa màn hình như chi tiết công việc rộng,
   cột trái = các cuộc trò chuyện (kiểu trang Tin nhắn), cột phải = khung chat */
.ai-side { display: none; }
.ai-expand-btn svg { transition: transform 0.2s ease; }
body:has(#ai-wide-toggle:checked) #ai-overlay { justify-content: center; align-items: center; padding: 20px; background: rgba(15, 23, 42, 0.45); }
body:has(#ai-wide-toggle:checked) #ai-overlay .ai-panel {
  width: min(1240px, 100%); max-width: none; height: min(860px, 100%);
  border-radius: var(--radius-lg); overflow: visible; transform: none;
}
body:has(#ai-wide-toggle:checked) .ai-main { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; overflow: hidden; }
body:has(#ai-wide-toggle:checked) .ai-side {
  display: flex; flex-direction: column; flex: none; width: 300px; min-height: 0;
  border-right: 1px solid var(--border); border-radius: var(--radius-lg) 0 0 var(--radius-lg); background: var(--surface); overflow: hidden;
}
body:has(#ai-wide-toggle:checked) .ai-expand-btn svg { transform: rotate(180deg); }
.ai-side-note { margin: 0 14px 8px; font-size: 12px; color: var(--muted); }
.ai-side-list { padding-top: 2px; }
.ai-side-item { padding: 0; gap: 2px; }
.ai-side-open { flex: 1; min-width: 0; display: flex; padding: 9px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ai-side-open:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ai-side-item .ai-hist-del { opacity: 0; }
.ai-side-item:hover .ai-hist-del, .ai-side-item.is-active .ai-hist-del, .ai-side-item .ai-hist-del:focus-visible { opacity: 1; }
.ai-side-err { margin: 10px 8px; font-size: 13px; color: var(--danger-600); }
.ai-side-err .btn-secondary { margin-top: 6px; }
@media (max-width: 760px) {
  /* Điện thoại: mở to = toàn màn hình, danh sách trò chuyện ở trên, khung chat bên dưới */
  body:has(#ai-wide-toggle:checked) #ai-overlay { padding: 0; }
  body:has(#ai-wide-toggle:checked) #ai-overlay .ai-panel { width: 100vw; height: 100%; border-radius: 0; flex-direction: column; }
  body:has(#ai-wide-toggle:checked) .ai-side { width: auto; max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
  body:has(#ai-wide-toggle:checked) .ai-main { border-radius: 0; }
  .ai-expand-btn { left: 8px; top: 12px; bottom: auto; margin-top: 0; width: 30px; height: 30px; }
  .ai-head { padding-left: 46px; }
  body:has(#ai-wide-toggle:checked) .ai-expand-btn { top: 8px; }
  body:has(#ai-wide-toggle:checked) .ai-side .chat-side-head { padding-left: 46px; }
}
@media (prefers-reduced-motion: reduce) { .ai-expand-btn svg { transition: none; } }
.ai-side-item.ai-side-new { padding: 9px 8px; }
body:has(#ai-wide-toggle:checked) .ai-head .ai-new-btn { display: none; } /* mở to: đã có "+ Mới" ở cột trò chuyện */
/* Phạm vi của từng cuộc trò chuyện AI trong danh sách chung (dự án / toàn workspace) */
.ai-side-scope { align-self: flex-start; max-width: 100%; margin: 2px 0 1px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--primary-50); color: var(--primary-600); font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-side-scope.is-ws { background: var(--bg); color: var(--ink-soft); }
/* Khung nhập trợ lý AI: ô chữ ở trên, hàng dưới = đính kèm (trái) | mic + gửi (phải); viền chuyển màu xanh -> hồng */
.ai-composer { display: block; padding: 10px 14px 14px; }
.ai-composer .ai-attached { margin-bottom: 8px; }
.ai-input-box {
  border: 1.5px solid transparent; border-radius: 18px;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--primary-100), var(--danger-100)) border-box;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.ai-input-box:focus-within {
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--primary), var(--danger)) border-box;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.ai-composer .ai-input-box textarea {
  display: block; width: 100%; min-height: 44px; max-height: 160px; padding: 12px 14px 4px;
  border: 0; border-radius: 18px 18px 0 0; background: transparent; box-shadow: none; resize: none; font-size: 14px; line-height: 1.5;
}
.ai-composer .ai-input-box textarea:focus { outline: none; box-shadow: none; border: 0; }
.ai-input-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px 8px; }
.ai-input-gap { flex: 1; }
.ai-bar-btn, .ai-input-bar .ai-attach-btn {
  flex: none; width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--bg); color: var(--ink-soft); cursor: pointer;
}
.ai-bar-btn[hidden] { display: none; }
.ai-bar-btn:hover:not(:disabled), .ai-bar-btn:focus-visible { background: var(--primary-50); color: var(--primary-600); outline: none; box-shadow: 0 0 0 2px var(--primary-100); }
.ai-bar-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Chọn cấp Trợ lý AI cạnh nút đính kèm */
.ai-level-select { height: 30px; max-width: 150px; padding: 0 22px 0 8px; border: 1px solid var(--border); border-radius: 8px; background-color: transparent; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.ai-level-select[hidden] { display: none; }
.ai-level-select:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary-100); border-color: var(--primary); }
.ai-level-select:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-mic-btn.is-on { background: var(--danger-50); color: var(--danger-600); animation: aiMicPulse 1.2s ease-in-out infinite; }
@keyframes aiMicPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 45%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 0%, transparent); } }
.ai-composer .ai-send {
  flex: none; width: 36px; height: 36px; min-height: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--primary); color: #fff; cursor: pointer; transition: background 0.15s ease, opacity 0.15s ease;
}
.ai-composer .ai-send:hover:not(:disabled), .ai-composer .ai-send:focus-visible { background: var(--primary-600); outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
/* Nút gửi luôn rõ, đứng yên (không nhấp nháy / mờ): chưa gửi được thì nền xanh nhạt, đang chờ trả lời thì giữ màu chính */
.ai-composer .ai-send:disabled { background: var(--primary-100); color: var(--primary-600); cursor: not-allowed; }
.ai-composer .ai-send.is-busy { background: var(--primary); color: #fff; cursor: wait; }
/* Giờ gửi nhỏ dưới tin của mình */
.ai-msg-time { align-self: flex-end; margin: -6px 4px 0 0; font-size: 11px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ai-mic-btn.is-on { animation: none; } }
/* Trợ lý AI bản giao diện mới (10/2026): màu / icon theo mẫu, giữ bố cục khung nhập cũ */
.ai-head-icon { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, var(--primary-50), var(--primary-100)); box-shadow: inset 0 0 0 1px var(--primary-100); }
.ai-head .help-title { font-size: 17px; font-weight: 700; }
.ai-project { display: flex; align-items: flex-start; gap: 8px; margin: 10px 14px 4px; padding: 9px 12px; border: 1px solid var(--primary-100); border-radius: 12px; }
.ai-project-ico { flex: none; display: inline-flex; margin-top: 1px; color: var(--primary-600); }
/* Đợt 11: chip ngữ cảnh "Đang xem: …" (việc đang mở / Việc của tôi / Báo cáo) — xuống dòng riêng dưới phạm vi, ✕ để bỏ */
.ai-project { flex-wrap: wrap; }
.ai-focus-chip { display: inline-flex; align-items: center; gap: 4px; flex: 0 1 100%; min-width: 0; max-width: 100%; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface, #fff); border: 1px solid var(--primary-100); font-size: 12.5px; color: var(--ink-soft); }
.ai-focus-k { flex: none; }
.ai-focus-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.ai-focus-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: auto; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer; }
.ai-focus-x:hover { background: var(--primary-50); color: var(--ink); }
.ai-focus-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.topbar-ai-btn { color: var(--primary-600); }
/* Màn chào: robot ở giữa + thẻ gợi ý xếp dọc */
.ai-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 8px 6px; text-align: center; }
.ai-robot { width: 120px; height: 120px; }
.ai-hero h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.ai-hero-suggest { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.ai-hero-chip { display: inline-flex; align-items: center; gap: 10px; min-width: min(240px, 100%); max-width: 100%; padding: 8px 18px 8px 8px;
  border: 1px solid var(--primary-100); border-radius: var(--radius-pill); background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.ai-hero-chip:hover:not(:disabled), .ai-hero-chip:focus-visible { border-color: var(--primary); background: var(--primary-50); outline: none; }
.ai-hero-chip:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-hero-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--primary-50); color: var(--primary-600); }
/* Mở to: thẻ gợi ý nằm ngang, dài quá thì xuống dòng, canh giữa */
body:has(#ai-wide-toggle:checked) .ai-hero-suggest { flex-direction: row; flex-wrap: wrap; justify-content: center; }
body:has(#ai-wide-toggle:checked) .ai-hero-chip { min-width: 0; }
body:has(#ai-wide-toggle:checked) .ai-hero { margin: auto 0; }
/* Khung nhập: hàng trên 📎 + ô chữ, hàng dưới cấp AI | mic + gửi (dùng chung khung nhỏ và mở to) */
.ai-input-row { display: flex; align-items: flex-start; gap: 4px; padding: 8px 8px 0; }
.ai-composer .ai-input-box .ai-input-row textarea { flex: 1; width: auto; min-width: 0; min-height: 36px; padding: 7px 6px 4px; border-radius: 0; }
.ai-input-row .ai-attach-btn, .ai-input-bar .ai-mic-btn { background: var(--primary-50); color: var(--primary-600); }
.ai-input-bar { padding: 2px 8px 8px 10px; }
.ai-level-select { height: 32px; max-width: 170px; padding: 0 24px 0 30px; border-radius: var(--radius-pill); border-color: var(--border-soft); background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.5 19 2c1 2 2 4.2 2 8 0 5.5-4.8 10-10 10Z'/%3E%3Cpath d='M2 21c0-3 1.9-5.4 5.2-6.1'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center; background-size: 15px; color: var(--ink); font-size: 12.5px; font-weight: 500; }
.cselect-btn.ai-level-select { padding-right: 10px; gap: 6px; }
/* Tin nhắn: AI có icon sparkle bên trái, thẻ trắng bo tròn; tin của mình nền xanh nhạt */
.ai-msg { border-radius: 14px; }
.ai-msg.is-user { background: var(--primary-50); border-color: var(--primary-100); border-bottom-right-radius: 4px; }
.ai-msg.is-ai { position: relative; margin-left: 38px; max-width: calc(100% - 38px); border-color: var(--border-soft); border-top-left-radius: 4px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05); }
.ai-msg.is-ai::before { content: ""; position: absolute; left: -38px; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230284c7' d='M12 2l2.2 6.3L20.5 10l-6.3 2.2L12 18.5l-2.2-6.3L3.5 10l6.3-1.7zM19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9z'/%3E%3C/svg%3E") center / 16px no-repeat;
  box-shadow: inset 0 0 0 1px var(--primary-100); }
.ai-msg.is-ai.is-typing { margin-left: 38px; }
.ai-chip { border-color: var(--primary-100); }
/* Thẻ / bảng trực quan trong câu trả lời AI (ai.js aiViewHTML): tổng quan, danh sách việc, ưu tiên.
   Tự co theo độ rộng khung chat (container query): khung nhỏ 2 cột số + dòng việc 2 tầng, mở to 4 cột + bảng có tiêu đề */
.ai-msg.is-ai.has-view { width: calc(100% - 38px); }
.ai-view { container-type: inline-size; margin-top: 10px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.ai-v-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-v-hico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: var(--primary-50); color: var(--primary-600); }
.ai-view.is-uu_tien .ai-v-hico { background: var(--warning-50); color: var(--warning-700); }
.ai-v-head h4 { flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.ai-v-at { flex: none; font-size: 11.5px; color: var(--muted); }
/* Tổng quan: 4 ô số + vòng % */
.ai-v-overview { display: flex; align-items: center; gap: 12px; }
.ai-v-tiles { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ai-v-tile { --c: var(--primary-600); --b: var(--primary-50); display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 9px 10px; border-radius: 10px; background: var(--b); }
.ai-v-tile b { font-size: 22px; line-height: 1.15; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; }
.ai-v-tile span { font-size: 12.5px; color: var(--ink-soft); }
.ai-v-tile small { align-self: flex-start; margin-top: 4px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--surface); color: var(--c); font-size: 11px; font-weight: 600; }
.ai-v-tile.is-done { --c: var(--success-700); --b: var(--success-50); }
.ai-v-tile.is-doing { --c: var(--warning-700); --b: var(--warning-50); }
.ai-v-tile.is-late { --c: var(--danger-600); --b: var(--danger-50); }
.ai-v-ring { position: relative; flex: none; width: 96px; height: 96px; }
.ai-v-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ai-v-ring-bg { fill: none; stroke: var(--primary-50); stroke-width: 9; }
.ai-v-ring-fg { fill: none; stroke: var(--primary); stroke-width: 9; stroke-linecap: round; }
.ai-v-ring > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ai-v-ring b { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.ai-v-ring small { font-size: 10.5px; color: var(--muted); }
.ai-v-mini { margin: 8px 0 0 !important; font-size: 12px; color: var(--muted); }
.ai-v-tile.is-review { --c: #7c3aed; --b: #f5f3ff; }
/* Tổng quan trong 1 dự án (ai.js aiHealthBodyHTML): vòng kế hoạch / thực tế của thẻ Đánh giá dự án ở trên, 4 ô số bên dưới */
.ai-v-health { display: flex; flex-direction: column; gap: 12px; }
.ai-v-health .ovh-ring { flex-basis: 104px; width: 104px; height: 104px; }
.ai-v-health .ovh-hero-text .ovh-pill { margin-bottom: 4px; font-size: 12px; padding: 2px 10px; }
.ai-v-health .ovh-plan { font-size: 26px; }
.ai-v-tiles.is-four { flex: none; }
@container (min-width: 600px) { .ai-v-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 330px) { .ai-v-overview { flex-direction: column; align-items: stretch; } .ai-v-ring { align-self: center; } }
/* Toàn workspace: tiến độ từng dự án */
.ai-v-projects { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ai-v-projects li { display: grid; grid-template-columns: minmax(0, 1fr) 34% 40px auto; align-items: center; gap: 8px; font-size: 13px; }
.ai-v-pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.ai-v-bar { height: 7px; border-radius: 999px; background: var(--primary-50); overflow: hidden; }
.ai-v-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.ai-v-projects b { text-align: right; font-variant-numeric: tabular-nums; }
.ai-v-projects small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ai-v-projects small.is-late { color: var(--danger-600); font-weight: 600; }
/* Danh sách việc / ưu tiên: khung nhỏ 2 tầng (tên + ghi chú / người · hạn · trạng thái), mở to thành bảng */
.ai-v-thead { display: none; }
.ai-v-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; }
.ai-v-list li + li { border-top: 1px solid var(--border-soft); }
.ai-v-row { display: grid; grid-template-columns: 26px auto minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 4px;
  width: 100%; padding: 8px 10px; border: 0; background: var(--surface); font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.ai-v-row:hover, .ai-v-row:focus-visible { background: var(--primary-50); outline: none; }
.ai-v-row > .ai-v-rank, .ai-v-row > .ai-v-stico { grid-column: 1; grid-row: 1; }
.ai-v-row > .ai-v-main { grid-column: 2 / -1; grid-row: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ai-v-row > .ai-v-who { grid-column: 2; grid-row: 2; }
.ai-v-row > .ai-v-due { grid-column: 3; grid-row: 2; }
.ai-v-row > .ai-v-st, .ai-v-row > .ai-v-approve { grid-column: 4; grid-row: 2; justify-self: end; }
.ai-v-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.ai-v-name small { font-weight: 500; color: var(--muted); font-size: 11px; }
.ai-v-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-soft); }
.ai-v-rank { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px; color: #fff; font-size: 12px; font-weight: 700; background: var(--success); }
.ai-v-rank.is-r1 { background: var(--danger); }
.ai-v-rank.is-r2 { background: var(--warning); }
.ai-v-rank.is-r3 { background: var(--primary); }
.ai-v-stico { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; color: var(--st);
  background: color-mix(in srgb, var(--st) 14%, transparent); }
.ai-v-who { display: inline-flex; align-items: center; min-width: 0; }
.ai-v-who .avatar { width: 22px; height: 22px; font-size: 10px; }
.ai-v-none { font-size: 12px; color: var(--muted); }
.ai-v-due { font-size: 12px; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ai-v-due.is-late { color: var(--danger-600); font-weight: 600; }
.ai-v-due.is-today { color: var(--warning-700); font-weight: 600; }
.ai-v-due.is-soon { color: var(--primary-600); }
.ai-v-due.is-none { color: var(--muted); }
.ai-v-st { padding: 1px 8px; border-radius: var(--radius-pill); background: var(--stbg, transparent); color: color-mix(in srgb, var(--st, var(--muted)) 72%, #0f172a);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; }
@container (min-width: 560px) {
  .ai-v-thead, .ai-v-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 92px 92px 104px; column-gap: 12px; }
  .ai-v-thead { padding: 0 10px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .ai-v-row > .ai-v-main { grid-column: 2; }
  .ai-v-row > .ai-v-who, .ai-v-row > .ai-v-due, .ai-v-row > .ai-v-st, .ai-v-row > .ai-v-approve { grid-row: 1; grid-column: auto; justify-self: start; }
}
/* Bảng việc (đợt 2): tóm tắt số việc, tiêu đề nhóm, ghi chú 2 dòng, nút Xem thêm */
.ai-v-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.ai-v-chip { padding: 1px 9px; border-radius: var(--radius-pill); background: var(--bg); color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.ai-v-chip.is-late { background: var(--danger-50); color: var(--danger-600); }
.ai-v-chip.is-review { background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); color: #7c3aed; }
.ai-v-chip.is-done { background: var(--success-50); color: var(--success-700); }
/* Bảng chia phần (vướng / quá hạn / chờ duyệt…): mỗi phần 1 khối, tiêu đề có icon màu + câu dẫn */
.ai-v-sec + .ai-v-sec, .ai-v-sec + .ai-v-sec-none, .ai-v-sec-none + .ai-v-sec, .ai-v-sec-none + .ai-v-sec-none { margin-top: 12px; }
.ai-v-sec { --sc: var(--primary-600); --sb: var(--primary-50); }
.ai-v-sec.is-blocked { --sc: var(--danger-600); --sb: var(--danger-50); }
.ai-v-sec.is-overdue { --sc: var(--warning-700); --sb: var(--warning-50); }
.ai-v-sec.is-review { --sc: #7c3aed; --sb: color-mix(in srgb, #8b5cf6 12%, var(--surface)); }
.ai-v-sec-head { display: flex; align-items: center; gap: 8px; }
.ai-v-sec-ico { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; background: var(--sb); color: var(--sc); }
.ai-v-sec-head strong { font-size: 13.5px; color: var(--ink); }
.ai-v-sec-head small { padding: 0 7px; border-radius: var(--radius-pill); background: var(--sb); color: var(--sc); font-size: 11.5px; font-weight: 700; }
.ai-v-sec-lead { margin: 4px 0 8px 32px !important; font-size: 12.5px; color: var(--ink-soft); }
.ai-v-sec-none { display: flex; align-items: center; gap: 8px; margin: 0 !important; padding: 7px 10px; border-radius: 8px; background: var(--success-50); color: var(--success-700); font-size: 12.5px; font-weight: 500; }
.ai-view .ai-v-thead + .ai-v-sec { margin-top: 0; }
/* Nút Duyệt ngay trên dòng việc chờ duyệt */
.ai-v-approve { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 0; border-radius: var(--radius-pill); background: var(--success); color: #fff;
  font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.ai-v-approve:hover:not(:disabled), .ai-v-approve:focus-visible { background: var(--success-700); outline: none; box-shadow: 0 0 0 3px var(--success-50); }
.ai-v-approve:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-v-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ai-v-note { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.4; }
.ai-v-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 4px 10px; border: 1px solid var(--primary-100); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--primary-600); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ai-v-more:hover, .ai-v-more:focus-visible { background: var(--primary-50); outline: none; }
.ai-v-more[aria-expanded="false"] svg { transform: rotate(90deg); }
.ai-v-more[aria-expanded="true"] svg { transform: rotate(-90deg); }
/* Câu dẫn đã bị tách hết thành bảng: không để khung chữ trống */
.ai-msg.has-view > .ai-view:first-child { margin-top: 0; }
/* Điểm cần lưu ý (tổng quan) */
.ai-v-notes { display: flex; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--primary-50); }
.ai-v-notes-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); color: var(--warning-700); }
.ai-v-notes > div { min-width: 0; font-size: 13px; }
.ai-v-notes strong { display: block; margin-bottom: 2px; color: var(--ink); }
.ai-v-notes ul { margin: 0; }
/* Danh sách trò chuyện (mở to): icon ô vuông xanh + phạm vi · giờ */
.ai-side .chat-new-btn { border-radius: var(--radius-pill); padding: 6px 14px; }
.ai-side-item { align-items: center; margin-bottom: 2px; border-radius: 12px; }
.ai-side-open { align-items: center; gap: 10px; }
.ai-side-item.ai-side-new { display: flex; gap: 10px; }
.ai-side-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); }
.ai-side-ico { background: color-mix(in srgb, var(--primary-50) 70%, var(--surface)); box-shadow: inset 0 0 0 1px var(--primary-100); }
.ai-side-item.is-active .ai-side-open::after, .ai-side-item.ai-side-new::after { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.ai-side-meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ai-side-meta .ai-side-scope { flex: 0 1 auto; min-width: 0; margin: 2px 0 1px; }
.ai-side-time { flex: none; font-size: 11.5px; color: var(--muted); }

/* Sửa tên vai trò tại chỗ (roles.js roleTitleHTML): bấm tên -> ô nhập, Enter lưu / Esc hủy */
.role-title.project-inline-text { margin-left: 0; padding: 1px 6px; }
.role-title-edit { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0; }
.role-title-input { width: min(320px, 60vw); font-size: 16px; font-weight: 700; padding: 4px 8px; }
.role-title-input[aria-invalid="true"] { border-color: var(--danger); }

/* Cài đặt › Trợ lý AI: token đã dùng hôm nay / hạn mức */
.ai-usage-row { margin: 10px 0 12px; }
.ai-usage-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-soft); }
.ai-usage-head strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.ai-usage-bar { height: 8px; margin: 6px 0 4px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.ai-usage-bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.ai-usage-bar span.is-high { background: var(--danger); }

/* ---------- TAB TỔNG QUAN của dự án (overview.js) ----------
   Dùng lại thẻ của trang Báo cáo (.report-card, .report-tile, .report-empty). Lưới 12 cột:
   desktop = AI 1/2 | (3 thẻ số + thanh trạng thái) 1/2; 3 thẻ giữa 1/3; Đến hạn 2/3 | Hoạt động 1/3 (thẳng cột với hàng giữa).
   Tablet 2 cột, điện thoại 1 cột. Thẻ cùng hàng cao bằng nhau; ô trống thì chữ nằm giữa thẻ; nội dung dài (tóm tắt AI,
   hoạt động) cuộn trong thẻ, không làm hàng cao lệch (flex-basis 0 -> không tính vào chiều cao tự nhiên của hàng). */
.overview-view { display: none; }
.page-view:has(input[id$="-overview"]:checked) .overview-view { display: block; }
.page-view:has(input[id$="-overview"]:checked) :is(.kanban-board, .task-list-view, .calendar-view, .workflow-view, .gantt-view,
  .empty-state.is-no-results, .active-filters, .pv-filter-note, .wf-board-note, .project-empty-hint) { display: none; }
.page-view:has(input[id$="-overview"]:checked) .toolbar :is(.search-field, .tf-wrap, .tb-add-task) { display: none; }
.ov-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; } /* hàng lọc tab Tổng quan: Số liệu lúc + Cập nhật, sát bên trái Thêm thẻ */
.ov-tools + .ov-add-card { margin-left: 0; }
.ov-updated { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.ov-scope { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
/* Chọn phạm vi (task gốc / lá, loại việc) + câu nói rõ đang đếm gì */
.ov-scopebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 12px; }
.ov-scopebar .report-select { width: auto; min-width: 0; }
.ov-scopebar .ov-scope { flex: 1 1 260px; margin: 0; }
.ov-sub-after { margin: 8px 0 0; }
.ov-add-card { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
/* Thẻ kéo thả: tay nắm 6 chấm cạnh tên thẻ, chỉ hiện khi rê chuột / focus; đang kéo thì thẻ theo con trỏ, thẻ đích có vạch chèn */
.ov-grid > [data-ov-card] { position: relative; }
.ov-drag {
  position: absolute; top: 14px; left: 5px; z-index: 2; display: grid; place-items: center; width: 13px; height: 24px; padding: 0;
  border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: grab; opacity: 0; touch-action: none; transition: opacity 0.15s ease;
}
.ov-right > .ov-drag { top: -2px; left: -2px; width: 16px; background: var(--surface); }
/* Tay nắm nằm trong khối tên thẻ (ovMount), ngoài dòng chảy, ở lề trái cách tên 6px:
   tên là chữ (.ov-h2t) -> cao đúng 1 dòng (1lh) ở dòng đầu; tên là phần tử 1 hàng (tên AI có icon) -> căn giữa phần tử đó */
.ov-grid > [data-ov-card][data-ov-card] h2 { margin-left: 6px; justify-content: flex-start; flex-wrap: nowrap; } /* thẻ hẹp: tên tự xuống dòng bên trong, nút / nhãn vẫn ở cùng hàng bên phải */
.ov-grid > [data-ov-card] h2 > .ov-h2t { min-width: 0; }
.ov-grid > [data-ov-card] h2 > :first-child { position: relative; }
.ov-grid > [data-ov-card] h2 > :first-child > .ov-drag { top: 50%; left: -16px; width: 10px; transform: translateY(-50%); }
.ov-grid > [data-ov-card] h2 > .ov-h2t > .ov-drag { top: 0; height: 1.3em; height: 1lh; font: inherit; line-height: inherit; transform: none; } /* kế thừa chữ của tên -> 1lh đúng bằng 1 dòng tên */
.ov-health > h2 > .ovh-pill, .ov-forecast > h2 > .ovfc-pill { margin-left: auto; }
.ov-grid > [data-ov-card]:hover .ov-drag, .ov-drag:focus-visible { opacity: 1; }
.ov-drag:hover { color: var(--ink); background: var(--bg); }
.ov-drag:focus-visible { outline: 2px solid var(--primary); }
.ov-grid > .is-dragging { z-index: 20; pointer-events: none; opacity: 0.85; box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.18)); cursor: grabbing; }
.ov-grid > .ov-drop-before { box-shadow: -4px 0 0 0 var(--primary); }
.ov-grid > .ov-drop-after { box-shadow: 4px 0 0 0 var(--primary); }
/* Thẻ "Cần xử lý" (overview.js ovAttentionCardHTML): rộng 2/3, 3 tab Quá hạn / Chờ duyệt / Vướng mắc.
   Bảng cao 7 dòng việc + hàng tiêu đề (mỗi dòng 44px như tab Danh sách), dài hơn thì cuộn. 1 khung cuộn DUY NHẤT (dọc + ngang),
   bảng bên trong không tự cuộn riêng nên hàng tiêu đề dính trên được */
.ov-attention { grid-column: span 8; }
/* Chiều cao CỐ ĐỊNH (kể cả tab ít việc / trống) để đổi tab không làm thẻ co giãn, bố cục bên dưới không nhảy */
.ov-attention .ov-due-scroll, .ov-card.ov-attention > .report-empty { height: calc(8 * 44px + 2px); max-height: none; }
.ov-card.ov-attention > .report-empty { display: flex; align-items: center; justify-content: center; margin: 0; }
.ov-attention.ov-tasktable .pl-table-scroll { overflow: visible; } /* thắng .ov-tasktable .pl-table-scroll (overflow-y: hidden sẽ biến visible thành auto) */
.ov-attention .pl-row-head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
/* Tiêu đề + hàng tab cùng 1 dòng (kiểu nút gạt gọn: nền xám, tab đang chọn nền trắng); hẹp thì tab xuống dòng dưới tiêu đề, cuộn ngang */
.ov-att-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ov-att-head h2 { margin: 0; }
.ov-att-tabs { display: inline-flex; gap: 2px; max-width: 100%; padding: 3px; border-radius: 10px; background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.ov-att-tabs::-webkit-scrollbar { display: none; }
.ov-att-tab { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.ov-att-tab:hover { color: var(--ink); }
.ov-att-tab.is-active { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.ov-att-tab:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary-100); }
.ov-att-n { display: inline-block; min-width: 17px; padding: 0 4px; border-radius: 999px; background: rgba(15, 23, 42, 0.06); font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; color: var(--ink-soft); }
/* Nút "+" cuối hàng tab: mở ô bật / tắt nhóm việc (overview.js ovAttPopHTML, dùng lại kiểu .pv-pop của ô chế độ xem) */
.ov-att-add { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.ov-att-add:hover, .ov-att-add[aria-expanded="true"] { background: var(--surface); color: var(--primary-600); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.ov-att-add:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary-100); }
.ov-att-pop { width: 340px; }
.ov-att-pop .pv-option-text strong { display: inline-flex; align-items: center; gap: 6px; }
.ov-att-n.is-zero { color: var(--muted); }
.ov-att-tab.is-overdue .ov-att-n:not(.is-zero) { background: var(--danger-50); color: var(--danger-600); }
.ov-att-tab.is-review .ov-att-n:not(.is-zero) { background: var(--primary-50); color: var(--primary-600); }
.ov-att-tab.is-blocked .ov-att-n:not(.is-zero) { background: var(--warning-50); color: var(--warning-700); }
.ov-att-tab.is-overdue .ov-att-n:not(.is-zero) { background: var(--danger-600); color: #fff; }
.ov-att-tab.is-depBlocked .ov-att-n:not(.is-zero) { background: var(--warning-50); color: var(--warning-700); }
.ov-att-tab.is-stale .ov-att-n:not(.is-zero) { background: #f3e8ff; color: #7c3aed; }
.ov-att-tab.is-unowned .ov-att-n:not(.is-zero) { background: rgba(15, 23, 42, 0.08); color: var(--ink); }
/* Dòng nhắc dưới bảng: Bị chặn = cách mở khóa + link chuỗi phụ thuộc; Đứng yên = cách tính */
.ov-att-note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--bg); font-size: 12.5px; color: var(--ink-soft); }
.ov-att-note > svg { flex: none; color: var(--warning-700); }
.ov-att-note > span { flex: 1; min-width: 0; }
.ov-att-note .pl-link-btn { flex: none; font-size: 12.5px; font-weight: 700; }
.ov-att-note.is-plain { display: block; padding: 0; background: none; font-size: 12px; color: var(--muted); }
.ov-att-note.is-plain b { font-style: italic; color: var(--ink-soft); }
h2 .ov-att-n { margin-left: 4px; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { .ov-att-tab { transition: none; } }
/* Thẻ "Đến hạn tuần này" (ovDueCardHTML): rộng 1/3, mỗi việc 1 thẻ nhỏ; khung cao vừa 3 thẻ việc (+ nhãn nhóm) = bằng khung 7 dòng của Cần xử lý, dài hơn thì cuộn */
.ov-due .ov-due-scroll { max-height: calc(8 * 44px + 2px); padding-right: 2px; }
.ov-dl-head { margin: 2px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ov-dl-head.is-overdue { color: var(--danger-600); }
.ov-dl-head.is-today { color: var(--primary-600); }
.ov-dl { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ov-dl-item { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font: inherit; text-align: left; color: var(--ink); cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.ov-dl-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.ov-dl-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.ov-dl-name { display: flex; align-items: flex-start; gap: 6px; min-width: 0; font-size: 13.5px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.ov-dl-warn { display: inline-flex; flex-shrink: 0; margin-top: 1px; color: var(--danger-600); }
.ov-dl-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); }
.ov-dl-meta svg { flex-shrink: 0; }
.ov-dl-pri { font-weight: 700; }
.ov-dl-pri.is-high { color: var(--danger-600); }
.ov-dl-pri.is-medium { color: var(--warning-700); }
.ov-dl-pri.is-low { color: var(--ink-soft); }
.ov-dl-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ov-dl-who { display: inline-flex; min-width: 0; }
.ov-dl-none { font-size: 12px; color: var(--muted); }
.ov-dl-when { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; background: var(--bg); font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.ov-dl-when.is-today { background: var(--warning-50); color: var(--warning-700); }
.ov-dl-when.is-overdue { background: var(--danger-50); color: var(--danger-600); }
.ov-dl-end { margin: 12px 0 2px; font-size: 12.5px; text-align: center; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ov-dl-item { transition: none; } }
/* Thẻ "Sức khỏe dự án" (overview.js ovHealthCardHTML, rộng 1/3): vòng (nhạt = kế hoạch, đậm = thực tế) · 3 dòng · Lý do chính
   Màu theo mức: .tone-good / .tone-warn / .tone-bad dùng chung cho chữ, nhãn, chấm và ngăn kéo Cách tính */
.ov-health { grid-column: span 4; gap: 10px; --ovh-good: var(--success-600); --ovh-warn: var(--warning-600); --ovh-bad: #dc2626; }
.ov-health > h2, .ovhi-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ov-health > h2 { margin-bottom: 0; }
.ovh-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.ovh-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ovh-pill.is-good { background: var(--success-100); color: var(--success-700); }
.ovh-pill.is-warn { background: var(--warning-100); color: var(--warning-700); }
.ovh-pill.is-bad { background: var(--danger-100); color: #b91c1c; }
.ovh-pill.is-none { background: var(--bg); color: var(--ink-soft); }
.ovh-hero { display: flex; align-items: center; gap: 20px; }
.ovh-ring { flex: 0 0 120px; width: 120px; height: 120px; }
.ovh-ring-track { stroke: var(--border-soft, #eef2f7); }
.ovh-ring.is-good { --ring: var(--ovh-good); --ring-plan: var(--success-100); }
.ovh-ring.is-warn { --ring: #f59e0b; --ring-plan: #fde68a; }
.ovh-ring.is-bad { --ring: var(--ovh-bad); --ring-plan: #fecaca; }
.ovh-ring.is-none { --ring: var(--primary); --ring-plan: var(--primary-100); }
.ovh-ring-plan { stroke: var(--ring-plan); }
.ovh-ring-done { stroke: var(--ring); }
.ovh-ring-pct { font-size: 22px; font-weight: 700; fill: var(--ink); }
.ovh-hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.ovh-cap { font-size: 12.5px; color: var(--muted); }
.ovh-plan { font-size: 30px; font-weight: 700; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.ovh-line { font-size: 13px; color: var(--ink-soft); }
.ovh-hero-text .ovh-line + .ovh-cap { margin-top: 4px; }
.ov-health .tone-good, .ovhi .tone-good { color: var(--ovh-good, var(--success-600)); }
.ov-health .tone-warn, .ovhi .tone-warn { color: var(--ovh-warn, var(--warning-600)); }
.ov-health .tone-bad, .ovhi .tone-bad { color: var(--ovh-bad, #dc2626); }
.ovh-rows { display: flex; flex-direction: column; }
.ovh-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border-soft, var(--border)); font-size: 13px; }
.ovh-row:last-child { border-bottom: 1px solid var(--border-soft, var(--border)); }
.ovh-k { color: var(--ink-soft); white-space: nowrap; }
.ovh-k b { color: var(--ink); }
.ovh-v { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; color: var(--ink); text-align: right; }
.ovh-v b { font-weight: 700; white-space: nowrap; }
.ovh-side { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.ovh-tag { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ovh-tag.tone-good { background: var(--success-100); color: var(--success-700); }
.ovh-tag.tone-warn { background: var(--warning-100); color: var(--warning-700); }
.ovh-tag.tone-bad { background: var(--danger-100); color: #b91c1c; }
.ovh-muted { color: var(--muted); font-weight: 400; }
.ovh-reasons h3 { margin: 0 0 5px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ovh-reasons ul { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.ovh-reasons li { display: flex; align-items: flex-start; gap: 10px; }
.ovh-reasons b { color: var(--ink); }
.ovh-dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; }
.tone-bg-good { background: var(--success-600); }
.tone-bg-warn { background: var(--warning-600); }
.tone-bg-bad { background: #dc2626; }
.ovh-more { align-self: flex-start; margin-top: auto; font-size: 13px; font-weight: 600; }
/* Ngăn kéo "Cách tính sức khỏe dự án" */
/* Hộp "Cách tính đánh giá dự án" (overview.js ovHealthInfo, #modal-ovhi) — bố cục ảnh mẫu 17/11/2026; màu mức giữ tone-* cũ */
body:has(#modal-ovhi-toggle:checked) #modal-ovhi { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#modal-ovhi-toggle:checked) #modal-ovhi .modal-box { transform: scale(1); opacity: 1; }
.ovhi-modal { display: flex; flex-direction: column; width: min(1040px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 16px 22px 14px; border-radius: 20px; overflow: hidden; }
.ovhi-top { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ovhi-top h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.ovhi-top p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.ovhi { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px; } /* thanh cuộn: kiểu chung cả ứng dụng (cuối file) */
.ovhi-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 8px 14px; border-radius: 14px; }
.ovhi-banner > .ovh-pill { padding: 4px 13px; font-size: 14px; background: var(--surface); }
.ovhi-meta { display: inline-flex; align-items: center; gap: 6px; padding-left: 16px; border-left: 1px solid color-mix(in srgb, currentColor 22%, transparent); font-size: 12.5px; color: var(--ink-soft); }
.ovhi-meta svg { color: var(--ink-soft); }
/* Thang 3 mức bên phải dải đầu: chấm nối bằng vạch, mức đang rơi vào nổi bật */
.ovhi-scale { display: flex; align-items: flex-start; margin: 0 0 0 auto; padding: 0; list-style: none; }
.ovhi-scale li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px; font-size: 12px; color: var(--ink-soft); }
.ovhi-scale li + li::before { content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 2px; background: color-mix(in srgb, var(--ink-soft) 25%, transparent); }
.ovhi-scale i { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--border); border: 2px solid var(--surface); }
.ovhi-scale .is-good i { background: var(--success-600); }
.ovhi-scale .is-warn i { background: var(--warning-600); }
.ovhi-scale .is-bad i { background: #dc2626; }
.ovhi-scale li:not(.is-on) i { opacity: .45; }
.ovhi-scale li.is-on i { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.ovhi-scale li.is-on span { padding: 1px 10px; border-radius: 999px; background: var(--surface); font-weight: 700; }
.ovhi-scale .is-good.is-on { color: var(--success-700); }
.ovhi-scale .is-warn.is-on { color: var(--warning-700); }
.ovhi-scale .is-bad.is-on { color: #b91c1c; }
.ovhi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ovhi-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 2px 10px rgba(15, 23, 42, .03); }
.ovhi-ic { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); }
.ovhi-ic.is-sm { width: 26px; height: 26px; border-radius: 8px; }
.ovhi-body { min-width: 0; }
.ovhi-box h3, .ovhi-trend h3, .ovhi-notes h3 { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.ovhi-head .ovh-pill { padding: 2px 10px; font-size: 12px; }
.ovhi-head .ovh-pill::before { display: none; }
.ovhi-main { margin: 5px 0 1px; font-size: 13.5px; color: var(--ink); }
.ovhi-note { margin: 0; font-size: 12px; color: var(--muted); }
.ovhi-chips { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.ovhi-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 42px; padding: 4px 8px; border: 1px solid transparent; border-radius: 9px;
  background: var(--bg); font-size: 12px; line-height: 1.35; text-align: center; color: var(--ink-soft); }
.ovhi-chip b { font-weight: 500; }
.ovhi-chip.is-on, .ovhi-chip.is-on b { font-weight: 700; }
.ovhi-chip.tone-chip-good { border-color: var(--success-600); background: var(--success-50); color: var(--success-700); }
.ovhi-chip.tone-chip-warn { border-color: var(--warning-600); background: var(--warning-50); color: var(--warning-700); }
.ovhi-chip.tone-chip-bad { border-color: #dc2626; background: var(--danger-50); color: #b91c1c; }
.ovhi-extra { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.ovhi-trend { display: flex; gap: 12px; align-items: flex-start; }
.ovhi-trend .ovhi-main { font-size: 13.5px; }
.ovhi-notes { padding-left: 14px; border-left: 1px solid var(--border); }
.ovhi-notes h3 { display: flex; align-items: center; gap: 8px; }
.ovhi-notes ul { margin: 5px 0 0; padding-left: 18px; list-style: disc; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.ovhi-foot { flex: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ovhi-foot p { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; font-style: italic; color: var(--ink-soft); }
.ovhi-foot p svg { flex: none; }
.ovhi-acts { display: flex; gap: 10px; }
.ovhi-acts .btn-primary, .ovhi-acts .btn-secondary { min-width: 100px; height: 34px; padding: 0 16px; font-size: 13.5px; justify-content: center; }
@media (max-width: 860px) {
  .ovhi-grid, .ovhi-extra { grid-template-columns: 1fr; }
  .ovhi-notes { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .ovhi-scale { margin-left: 0; }
}
@media (max-width: 560px) {
  .ovhi-modal { padding: 16px 14px 14px; }
  .ovhi-box { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .ovhi-box > .ovhi-ic { display: none; }
  .ovhi-meta { padding-left: 0; border-left: 0; }
  .ovhi-chips { gap: 6px; }
  .ovhi-chip { font-size: 12px; }
  .ovhi-acts { width: 100%; }
  .ovhi-acts .btn-primary, .ovhi-acts .btn-secondary { flex: 1; min-width: 0; }
}
.tone-box-good { background: var(--success-50); color: var(--success-700); }
.tone-box-warn { background: var(--warning-50); color: var(--warning-700); }
.tone-box-bad { background: var(--danger-50); color: #b91c1c; }
.tone-box-none { background: var(--bg); color: var(--ink-soft); }
/* Thẻ "Dự báo hoàn thành" (overview.js ovForecastCardHTML, rộng 1/3): nhãn · ngày dự kiến lớn · hạn + số ngày trễ · gợi ý (màu theo ảnh mẫu) */
.ov-forecast { grid-column: span 4; gap: 4px; }
.ov-forecast > h2 { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 0; font-size: 17px; font-weight: 800; color: #0f172a; }
.ovfc-sub { margin: 0 0 10px; font-size: 13px; color: #64748b; }
.ovfc-pill { padding: 3px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ovfc-pill.is-bad { background: #ffe4e6; color: #e11d48; }
.ovfc-pill.is-good { background: #dcfce7; color: #15803d; }
.ovfc-pill.is-none { background: #f1f5f9; color: #475569; }
.ovfc-date { margin: 2px 0 4px; font-size: 42px; font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: #0f172a; }
.ovfc-date.is-bad { color: #e11d48; }
.ovfc-date.is-good { color: #16a34a; }
.ovfc-date.is-none { color: #94a3b8; }
.ovfc-line { margin: 0; font-size: 13.5px; color: #64748b; }
/* Thẻ Dự báo hoàn thành theo ảnh mẫu 16/11/2026: 2 ô số (xanh dương = tốc độ hiện tại, xanh lá = cần để kịp hạn) + thanh khoảng cách tiến độ */
.ovfc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; }
.ovfc-st { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border: 1px solid #e3eefc; border-radius: 12px; background: #f1f7ff; }
.ovfc-st.is-need { border-color: #d6f3e4; background: #effbf5; }
.ovfc-st-ic { display: grid; flex: none; place-items: center; color: #38bdf8; }
.ovfc-st.is-need .ovfc-st-ic { color: #22c55e; }
.ovfc-st > span:last-child { display: grid; gap: 2px; min-width: 0; }
.ovfc-st small { font-size: 12.5px; color: #64748b; }
.ovfc-st b { font-size: 17px; font-weight: 800; line-height: 1.2; color: #0f172a; overflow-wrap: anywhere; }
.ovfc-gap { display: grid; gap: 6px; margin: 14px 0 0; }
.ovfc-gap-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; color: #64748b; }
.ovfc-gap-h b { font-weight: 800; color: #0f172a; }
.ovfc-gap-row { display: flex; align-items: center; gap: 10px; }
.ovfc-bar { flex: 1; height: 10px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.ovfc-bar i { display: block; height: 100%; border-radius: inherit; background: #38bdf8; transition: width 0.2s ease; }
.ovfc-bar.is-ok i { background: #22c55e; }
.ovfc-gap-row em { flex: none; font-style: normal; font-size: 13px; color: #64748b; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .ovfc-bar i { transition: none; } }
.ovfc-tip { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: #f1f5f9; font-size: 13.5px; line-height: 1.5; color: #334155; }
.ovfc-tip b { font-weight: 800; color: #0f172a; }
.ovfc-tip-ic { display: inline-flex; flex: none; margin-top: 2px; color: #f59e0b; }
@media (max-width: 1100px) { .ov-health, .ov-forecast { grid-column: span 6; } }
@media (max-width: 760px) { .ov-health, .ov-forecast { grid-column: span 12; } }
/* Thanh cuộn ngang / dọc của các thẻ bảng việc (Đến hạn, Quá hạn, Vướng mắc, Chờ duyệt): mảnh, xám nhạt */
.ov-tasktable, .ov-tasktable * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
/* Popup "Thêm thẻ" (overview.js renderOvCardsModal): danh mục trái 232px · tiêu đề + tìm + chip · thẻ theo nhóm (cuộn riêng) · chân cố định */
.ovk-box { --ovk-accent: #0f766e; --ovk-accent-50: #f0fdfa; --ovk-accent-100: #ccfbf1;
  width: min(1100px, calc(100vw - 32px)); max-width: none; height: min(760px, calc(100vh - 32px)); max-height: none; padding: 0; overflow: hidden; display: flex; }
.ovk { flex: 1; min-width: 0; min-height: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); } /* hàng cao đúng bằng hộp -> vùng giữa mới cuộn được, chân hộp không bị đẩy ra ngoài */
.ovk-nav { display: flex; flex-direction: column; gap: 4px; padding: 20px 12px 14px; border-right: 1px solid var(--border-soft, var(--border)); background: var(--bg); overflow: auto; }
.ovk-nav-title { margin: 0 8px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ovk-nav-list { display: flex; flex-direction: column; gap: 2px; }
.ovk-cat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: 13.5px; color: var(--ink-soft); text-align: left; cursor: pointer; }
.ovk-cat:hover { background: var(--surface); color: var(--ink); }
.ovk-cat.is-active { background: var(--ovk-accent-100); color: var(--ovk-accent); font-weight: 700; }
.ovk-cat-n { min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface); font-size: 11.5px; line-height: 20px; text-align: center; color: var(--ink-soft); }
.ovk-cat.is-active .ovk-cat-n { background: var(--ovk-accent); color: #fff; }
.ovk-nav-note { margin: auto 0 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.ovk-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.ovk-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 0; }
.ovk-head-text { flex: 1; min-width: 0; }
.ovk-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--ink); }
.ovk-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ovk-search { display: flex; align-items: center; gap: 8px; width: 260px; max-width: 40%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--muted); }
.ovk-search:focus-within { border-color: var(--ovk-accent); box-shadow: 0 0 0 3px var(--ovk-accent-100); }
.ovk-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); }
.ovk-close { flex: none; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.ovk-chips { display: flex; gap: 8px; padding: 12px 22px 14px; border-bottom: 1px solid var(--border-soft, var(--border)); overflow-x: auto; scrollbar-width: none; }
.ovk-chip { flex: none; padding: 5px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.ovk-chip:hover { border-color: var(--ovk-accent); color: var(--ovk-accent); }
.ovk-chip.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.ovk-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 22px 22px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.ovk-scroll::-webkit-scrollbar { width: 10px; }
.ovk-scroll::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: var(--scroll-thumb); background-clip: padding-box; }
.ovk-scroll::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
.ovk-group { margin-top: 18px; }
.ovk-group h3 { margin: 0 0 10px; font-size: 15px; font-weight: 800; color: var(--ink); }
.ovk-group h3 small { margin-left: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.ovk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ovk-card { display: flex; flex-direction: column; overflow: hidden; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: box-shadow 0.15s ease, border-color 0.15s ease; }
.ovk-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); }
.ovk-card.is-on { border-color: var(--ovk-accent); }
.ovk-card.is-locked:not(.is-on) { cursor: default; }
.ovk-card.is-locked:not(.is-on) .ovk-art > :first-child { opacity: 0.45; filter: grayscale(0.6); }
.ovk-card:focus-within { box-shadow: 0 0 0 3px var(--ovk-accent-100); }
.ovk-art { position: relative; display: grid; place-items: center; height: 112px; background: linear-gradient(135deg, #f8fafc, #eef2f7); }
.ovk-card.is-on .ovk-art { background: linear-gradient(135deg, var(--ovk-accent-100), var(--ovk-accent-50)); }
.ovk-new { position: absolute; top: 8px; left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--surface); font-size: 11px; font-weight: 700; color: var(--ovk-accent); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.ovk-lock { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); color: var(--ink-soft); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); cursor: help; }
.ovk-num { display: inline-flex; align-items: baseline; gap: 6px; font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ovk-num small { font-size: 13px; font-weight: 600; }
.ovk-num.is-violet { color: #6d28d9; }
.ovk-num.is-rose { color: #e11d48; }
.ovk-num.is-amber { color: #b45309; }
.ovk-num.is-teal { color: #0f766e; }
.ovk-donut { width: 72px; height: 72px; border-radius: 50%; -webkit-mask: radial-gradient(circle, transparent 44%, #000 45%); mask: radial-gradient(circle, transparent 44%, #000 45%); }
.ovk-bars { display: flex; align-items: flex-end; gap: 7px; height: 64px; }
.ovk-bars i { display: block; width: 14px; border-radius: 4px 4px 0 0; }
.ovk-stack { display: flex; width: 72%; height: 18px; overflow: hidden; border-radius: 999px; }
.ovk-stack i { display: block; min-width: 3px; }
.ovk-line { width: 72%; height: 60px; }
.ovk-line polyline { stroke: #e11d48; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ovk-line-zero { stroke: #cbd5e1; stroke-width: 1; stroke-dasharray: 3 3; }
.ovk-lines { display: flex; flex-direction: column; gap: 6px; width: 64%; padding: 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.85); color: var(--ovk-accent); }
.ovk-lines.is-ai { color: #7c3aed; }
.ovk-lines i { display: block; height: 6px; border-radius: 3px; background: currentColor; opacity: 0.3; }
.ovk-nodata { font-size: 12.5px; color: var(--muted); }
.ovk-info { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.ovk-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ovk-title { font-size: 14px; color: var(--ink); }
.ovk-desc { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.ovk-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 64px 16px; color: var(--muted); text-align: center; }
.ovk-empty p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.ovk-foot { display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--border-soft, var(--border)); background: var(--surface); }
.ovk-foot-n { flex: 1; font-size: 13px; color: var(--ink-soft); }
.ovk-foot-n b { color: var(--ink); }
.ovk-done { min-width: 88px; justify-content: center; background: var(--ovk-accent); border-color: var(--ovk-accent); }
.ovk-done:hover { filter: brightness(1.08); }
/* Thẻ vừa thêm trên Tổng quan: nhấp nháy viền ngắn */
.ov-grid > [data-ov-flash] { animation: ovFlash 1.6s ease; }
@keyframes ovFlash { 0%, 100% { box-shadow: none; } 20%, 60% { box-shadow: 0 0 0 3px var(--primary-100), 0 0 0 5px var(--primary); } }
@media (max-width: 1000px) { .ovk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .ovk-box { width: 100vw; height: 100dvh; border-radius: 0; }
  .ovk { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .ovk-nav { padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border-soft, var(--border)); }
  .ovk-nav-title, .ovk-nav-note { display: none; }
  .ovk-nav-list { flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .ovk-cat { flex: none; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
  .ovk-head { flex-wrap: wrap; padding: 14px 14px 0; }
  .ovk-search { order: 3; width: 100%; max-width: none; }
  .ovk-chips { padding: 10px 14px; }
  .ovk-scroll { padding: 4px 14px 16px; }
  .ovk-grid { grid-template-columns: 1fr; }
  .ovk-foot { padding: 10px 14px; flex-wrap: wrap; }
  .ov-add-card { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .ov-drag, .ovk-card { transition: none; } .ov-grid > [data-ov-flash] { animation: none; } .ovk-scroll { scroll-behavior: auto; } }
.ov-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.ov-card { display: flex; flex-direction: column; }
.ov-card > .report-empty, .ov-center { margin: auto; padding: 12px 0; text-align: center; }
.ov-center { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 460px; }
.ov-center .ov-ai-actions { justify-content: center; }
.ov-grid .report-card { margin-bottom: 0; }
.ov-grid .report-card h2 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ov-grid .report-card h2 small { font-size: 12px; font-weight: 500; color: var(--muted); }
.ov-ai { grid-column: span 6; min-height: 260px;}
.ov-right { grid-column: span 8; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1280px) { .ov-right { grid-column: span 12; } } /* màn vừa: 5 ô số trải hết hàng cho đủ chỗ chữ */
.ov-right > .ov-status { flex: 1; }
.ov-right > :not(.ov-status) { flex-shrink: 0; } /* 5 ô số + dòng tỉ lệ giữ đủ cao, chỉ thẻ trạng thái bên dưới co giãn (không thì chữ trong ô bị ép bẹp) */
.ov-mid { grid-column: span 4; min-height: 320px; }
/* 3 thẻ giữa: chừa sẵn 2 dòng cho tiêu đề + 2 dòng cho ghi chú để phần nội dung bên dưới luôn thẳng hàng */
.ov-grid .ov-mid > h2 { min-height: calc(2 * 1.45em); line-height: 1.45; align-items: flex-start; margin-bottom: 6px; }
.ov-mid > .ov-sub { min-height: calc(2 * 1.5em); line-height: 1.5; margin-top: 0; }
.ov-due { grid-column: span 4; min-height: 0; }
.ov-activity { grid-column: span 6; min-height: 420px; }
/* Thẻ Hoạt động gần đây: tên thẻ + tab lọc (Tất cả / Công việc / Bình luận / Tệp… theo tính năng dự án) cùng 1 hàng */
.ov-act-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ov-act-head h2 { margin: 0; }
.ov-act-tabs { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ov-act-tab { flex: none; padding: 5px 12px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.ov-act-tab:hover { background: var(--bg); color: var(--ink); }
.ov-act-tab.is-active { background: var(--ink); color: #fff; }
.ov-act-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.ov-sub { margin: -6px 0 10px; font-size: 12px; color: var(--muted); }
.ov-note { margin: 8px 0 0; font-size: 12px; color: var(--warning-700); }
.ov-more { margin-top: 6px; }

/* Thẻ số: bấm mở danh sách */
.ov-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
/* 5 ô số đầu thẻ Số việc và trạng thái (rộng 2/3) */
.ov-tiles-main { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ov-tile.is-purple { --ovt-bg: #f5f3ff; --ovt-line: #ede9fe; --ovt-ink: #7c3aed; }
@media (max-width: 760px) { .ov-tiles-main { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* 4 ô có màu (overview.js ovStatTileHTML tone): nền nhạt + số đậm cùng tông, như thẻ "Tính toán nhanh" */
.ov-tile.is-blue { --ovt-bg: var(--primary-50); --ovt-line: var(--primary-100); --ovt-ink: var(--primary-600); }
.ov-tile.is-green { --ovt-bg: var(--success-50); --ovt-line: var(--success-100); --ovt-ink: var(--success-600); }
.ov-tile.is-orange { --ovt-bg: var(--warning-50); --ovt-line: var(--warning-100); --ovt-ink: var(--warning-600); }
.ov-tile.is-red { --ovt-bg: var(--danger-50); --ovt-line: var(--danger-100); --ovt-ink: var(--danger-600); }
.ov-tiles .ov-tile[class*=" is-"] { background: var(--ovt-bg); border-color: var(--ovt-line); }
.ov-tiles .ov-tile[class*=" is-"]:hover { border-color: var(--ovt-ink); }
.ov-tiles .ov-tile[class*=" is-"] .report-tile-value { color: var(--ovt-ink); font-weight: 600; }
/* 4 ô số đầu Tổng quan: căn trái — nhãn đậm cùng màu, số lớn (+ "/ tổng"), dòng "x% việc gốc" */
/* Ô hẹp (thẻ Tổng quan rộng 1/3): chữ / số nhỏ lại + được xuống dòng, không tràn khỏi ô */
/* 3 tầng cố định (nhãn trên · số giữa · % dưới), khoảng cách đều nhau; các ô cao bằng nhau nên số và dòng % thẳng hàng ngang */
.ov-tiles-main { align-items: stretch; }
.ov-tiles-main .ov-tile > * { flex-shrink: 0; }
/* .ov-tiles.ov-tiles-main: thắng quy tắc chung .ov-tiles .ov-tile (aspect-ratio 4/3, min-height 0) nằm phía sau trong file */
.ov-tiles.ov-tiles-main .ov-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px; aspect-ratio: auto; min-width: 0; min-height: 112px; padding: 14px 16px; text-align: left; overflow: hidden; }
.ov-tiles-main .ov-tile .report-tile-label { display: block; max-width: 100%; font-size: 13px; font-weight: 600; line-height: 1.45; padding-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: flex-start; }
.ov-tiles-main .ov-tile[class*=" is-"] .report-tile-label { color: var(--ovt-ink); }
.ov-tiles-main .ov-tile .report-tile-value { display: flex; align-items: baseline; gap: 4px; max-width: 100%; margin: 0; text-align: left; font-size: clamp(24px, 2.2vw, 30px); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-tiles-main .ov-tile-of { font-size: 15px; font-weight: 500; color: var(--muted); }
.ov-tiles-main .ov-tile .report-tile-hint { max-width: 100%; text-align: left; font-size: 12px; line-height: 1.45; padding-bottom: 1px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .ov-tiles.ov-tiles-main .ov-tile { min-height: 100px; padding: 12px 14px; } }
/* Thẻ "Thời gian từ tạo đến hoàn thành" (rộng 1/3, overview.js ovLead*): 3 ô màu + đường tím theo tuần */
.ov-lt-card { --ovlt-line: #8b5cf6; grid-column: span 4; }
.ovlt-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ovlt-tiles .ov-tile { aspect-ratio: auto; min-height: 0; padding: 10px 12px; text-align: center; }
.ovlt-tiles .ov-tile .report-tile-value { margin: 4px 0 0; font-size: 26px; }
.ovlt-cap { margin: 14px 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.ovlt-chart { flex: 1; display: flex; align-items: center; min-height: 0; }
.ovlt-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ovlt-area { fill: color-mix(in srgb, var(--ovlt-line) 10%, transparent); }
.ovlt-line { fill: none; stroke: var(--ovlt-line); stroke-width: 2; stroke-linejoin: round; }
.ovlt-dot { fill: var(--ovlt-line); stroke: var(--surface); stroke-width: 1.5; cursor: default; }
.ovlt-dot:hover { r: 5; }
.ovlt-none { margin: auto; text-align: center; }
@media (max-width: 760px) { .ov-lt-card { grid-column: span 12; } }
/* 3 thẻ rộng 1/4 (overview.js ovLinksCardHTML / ovCommentsCardHTML / ovDocsCardHTML): danh sách tự cuộn trong thẻ */
.ov-q-card { grid-column: span 4; height: 340px; min-width: 0; }
.ov-q-card h2 .ov-q-all { margin-left: auto; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.ovq-list { flex: 1; min-height: 0; margin: 0 -6px; padding: 0 2px; list-style: none; overflow-y: auto; scrollbar-width: thin; }
.ovq-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--radius-sm); }
.ovq-item + .ovq-item { border-top: 1px solid var(--border-soft); }
.ovq-item:hover { background: var(--bg); }
.ovq-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.ovq-main b, .ovq-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ovq-main b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ovq-main span { font-size: 12px; color: var(--muted); }
.ovq-main:hover b, .ovq-main:focus-visible b { color: var(--primary-600); }
.ovq-fav { position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primary-50); font-size: 13px; font-weight: 700; color: var(--primary-600); overflow: hidden; }
.ovq-fav img { position: absolute; inset: 5px; width: 20px; height: 20px; background: var(--primary-50); }
.ovq-star { flex: none; width: 28px; height: 28px; font-size: 17px; line-height: 1; color: var(--muted); }
.ovq-star.is-on { color: var(--warning); }
/* Ô "Thêm link": viền đứt 2px, nằm dưới link cuối (chưa có link thì nằm trên cùng) */
.ovq-add { display: flex; align-items: center; justify-content: center; gap: 6px; flex: none; margin-top: 8px; padding: 9px; border: 2px dashed var(--border); border-radius: var(--radius-md); font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease; }
.ov-q-card h2 + .ovq-add { margin: 0 0 8px; }
.ovq-add:hover, .ovq-add:focus-visible { border-color: var(--primary); color: var(--primary-600); outline: none; }
.ovc-list li + li { border-top: 1px solid var(--border-soft); }
.ovc-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 6px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.ovc-item:hover, .ovc-item:focus-visible { background: var(--bg); outline: none; }
.ovc-item .ov-avatar { width: 30px; height: 30px; font-size: 11px; }
.ovc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ovc-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.ovc-top b { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ovc-top small { flex: none; font-size: 11.5px; color: var(--muted); }
.ovc-text { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.ovc-task { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ovc-count { flex: none; align-self: center; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: 11.5px; color: var(--ink-soft); }
.ovdoc-icon { flex: none; display: inline-flex; color: var(--warning); }
.ovdoc-where { flex: none; max-width: 38%; padding: 2px 6px; border: 0; border-radius: var(--radius-pill); background: var(--bg); font: inherit; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ovdoc-where:hover, .ovdoc-where:focus-visible { color: var(--primary-600); outline: none; }
.ovdoc-where.is-project { cursor: default; }
@media (max-width: 1280px) { .ov-q-card { grid-column: span 4; } }
@media (max-width: 1100px) { .ov-q-card { grid-column: span 6; } }
@media (max-width: 760px) { .ov-q-card { grid-column: span 12; height: auto; max-height: 420px; } }
@media (prefers-reduced-motion: reduce) { .ovq-add { transition: none; } }
/* Dòng tỉ lệ hoàn thành giữa 4 ô và thanh trạng thái */
.ov-rate {display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font: inherit;
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    color: var(--ink-soft);
    cursor: pointer;
    transition: border-color 0.15s ease; }
.ov-rate:hover { border-color: var(--success); }
.ov-rate:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--success-100); }
.ov-rate-icon { display: inline-flex; color: var(--success-600); }
.ov-rate b { font-size: 17px; color: var(--success-600); }
.ov-tile { font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s ease; }
.ov-tile:hover { border-color: var(--primary); }
.ov-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
/* Thẻ số nhỏ: cao = 3/4 rộng, số to nằm giữa (như thẻ đếm của các dashboard quen thuộc) */
.ov-tiles .ov-tile { aspect-ratio: 6 / 5; min-height: 0; }
.ov-tile .report-tile-value { margin: auto 0; text-align: center; font-size: clamp(26px, 3.4vw, 40px); font-weight: 500; line-height: 1; }
.ov-tile .report-tile-hint { text-align: center; }

/* Tóm tắt AI */
.ov-ai-text { flex: 1 1 0; min-height: 120px; overflow: auto; font-size: 13.5px; line-height: 1.55; }
.ov-ai-text p { margin: 0 0 6px; }
.ov-ai-text ul { margin: 0 0 6px; padding-left: 18px; }
.ov-ai-meta { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.ov-ai-stale { color: var(--warning-700); }
.ov-ai-error { margin: 8px 0 0; font-size: 13px; color: var(--danger-600); }
.ov-ai-wait { margin: 4px 0; font-size: 13px; color: var(--muted); }
.ov-ai-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ov-ai-text.ai-answer { scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent; }
/* Tiêu đề thẻ AI (ovAiTitleHTML): chữ chạy màu neon 3 sắc + icon lấp lánh đổi màu mượt — chung mọi thẻ AI.
   Mã màu cố định (xanh / đỏ / vàng nhạt của bảng màu) để màu thương hiệu workspace không làm đổi hiệu ứng AI */
.ov-ai { --ai-c1: #38bdf8; --ai-c2: #fb7185; --ai-c3: #fbbf24; }
/* Nền mọi thẻ AI (Tóm tắt AI, AI Team / Project Update, StandUp): trắng trong chuyển dần sang xanh nhẹ (chủ dự án 16/11/2026), nhận ra là nội dung AI mà không sặc */
.report-card.ov-ai { border-color: #dcebfb; background: linear-gradient(100deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.7) 45%, #e8f3ff 100%); }
.ov-ai-logo { flex: none; width: 24px; height: 24px; object-fit: contain; } /* logo AI riêng (assets/img/LogoAI-icon.png) thay icon lấp lánh */
.ov-ai-title { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
/* Chữ tiêu đề thẻ AI: chỉ chạy từ trắng trong sang xanh (chủ dự án 16/11/2026, bỏ 3 màu xanh / đỏ / vàng); dải xanh đậm chiếm phần lớn để chữ luôn đọc được */
.ov-ai-title-text {
  background: linear-gradient(90deg, #1677ff 0%, #38bdf8 30%, rgba(255, 255, 255, 0.85) 50%, #38bdf8 70%, #1677ff 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: aiTextFlow 3s linear infinite;
}
@keyframes aiTextFlow { to { background-position: -200% 0; } }

/* Thẻ AI đang tạo / đang tải (ovAiDotsHTML): 4 chấm ở giữa thẻ, lần lượt sáng to lên rồi nhỏ lại */
.ov-ai-dots { margin: auto; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 0; }
.ov-ai-dots i { width: 10px; height: 10px; border-radius: 50%; opacity: 0.55; animation: aiDotPulse 1.6s ease-in-out infinite; }
.ov-ai-dots i:nth-child(1) { --dot: #fb7185; background: var(--dot); }
.ov-ai-dots i:nth-child(2) { --dot: #fbbf24; background: var(--dot); animation-delay: 0.2s; }
.ov-ai-dots i:nth-child(3) { --dot: #34d399; background: var(--dot); animation-delay: 0.4s; }
.ov-ai-dots i:nth-child(4) { --dot: #38bdf8; background: var(--dot); animation-delay: 0.6s; }
@keyframes aiDotPulse {
  0%, 50%, 100% { transform: scale(1); opacity: 0.55; box-shadow: none; }
  20% { transform: scale(1.6); opacity: 1; box-shadow: 0 0 8px var(--dot); }
}
@media (prefers-reduced-motion: reduce) { .ov-ai-dots i { animation: none; opacity: 1; } }

/* Thẻ AI đang tạo nội dung: viền sáng 3 màu chạy vòng quanh thẻ + quầng sáng chìm đổi màu */
@property --ai-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
/* Lớp: ::after = dải 3 màu nhòe tỏa ra ngoài (ánh neon) · ::before = nền thẻ che phần giữa · viền 2px = dải 3 màu sắc nét */
.ov-ai.ov-ai-busy {
  position: relative; isolation: isolate;
  border: 2px solid transparent; padding: 14px;
  background: linear-gradient(transparent, transparent) padding-box,
    conic-gradient(from var(--ai-angle), var(--ai-c1), var(--ai-c2), var(--ai-c3), var(--ai-c1)) border-box;
  animation: aiAngle 4s linear infinite, aiBreath 4.5s linear infinite;
}
.ov-ai.ov-ai-busy::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: calc(var(--radius-md) - 2px); pointer-events: none;
  background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--ai-c1) 12%, transparent), transparent 60%),
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--ai-c3) 12%, transparent), transparent 60%),
    radial-gradient(120% 80% at 100% 100%, color-mix(in srgb, var(--ai-c2) 12%, transparent), transparent 60%),
    var(--surface);
}
.ov-ai.ov-ai-busy::after {
  content: ""; position: absolute; inset: -4px; z-index: -2; border-radius: calc(var(--radius-md) + 4px); pointer-events: none;
  background: conic-gradient(from var(--ai-angle), var(--ai-c1), var(--ai-c2), var(--ai-c3), var(--ai-c1));
  filter: blur(12px);
  animation: aiAngle 4s linear infinite, aiNeon 1.6s ease-in-out infinite;
}
@keyframes aiAngle { to { --ai-angle: 360deg; } }
@keyframes aiNeon { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes aiBreath {
  0%, 100% { box-shadow: 0 0 16px -4px color-mix(in srgb, var(--ai-c1) 60%, transparent), inset 0 0 18px -10px var(--ai-c1); }
  33.3% { box-shadow: 0 0 16px -4px color-mix(in srgb, var(--ai-c2) 60%, transparent), inset 0 0 18px -10px var(--ai-c2); }
  66.6% { box-shadow: 0 0 16px -4px color-mix(in srgb, var(--ai-c3) 60%, transparent), inset 0 0 18px -10px var(--ai-c3); }
}
@media (prefers-reduced-motion: reduce) {
  .ov-ai-title-text, .ov-ai.ov-ai-busy, .ov-ai.ov-ai-busy::after { animation: none; }
}

/* Thanh trạng thái xếp chồng (chuẩn hóa 100%) */
.ov-stack { display: flex; height: 15px; border-radius: 2rem; overflow: hidden; background: var(--border-soft); }
.ov-stack-part { min-width: 4px; padding: 0; border: 0; cursor: pointer; transition: opacity 0.15s ease; }
.ov-stack-part:hover { opacity: 0.85; }
.ov-stack-part:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ov-stack-scale { display: flex; justify-content: space-between; margin: 4px 0 0px; font-size: 11px; color: var(--muted); }
.ov-legend { list-style: none; margin: 0; padding: 0; }
.ov-legend-row { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.ov-legend-item {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 0px; border: 0; border-radius: 6px;
  background: transparent; font: inherit; font-size: 12.5px; color: var(--ink-soft); cursor: pointer;
}
.ov-legend-item:hover:not(:disabled) { background: var(--primary-50); }
.ov-legend-item:disabled { cursor: default; opacity: 0.6; }
.ov-legend-item b { color: var(--ink); }
.ov-legend-item span { color: var(--muted); }
.ov-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

/* Biểu đồ tròn: vòng + nhãn Tên / % nối bằng đường dẫn (SVG co theo bề ngang thẻ) */
.ov-pie { flex: 1; display: flex; align-items: center; justify-content: center; }
.ov-pie-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ov-pie circle { transition: opacity 0.15s ease; }
.ov-pie circle:hover { opacity: 0.8; }
.ov-pie circle[data-action] { cursor: pointer; outline: none; }
.ov-pie circle[data-action]:focus-visible { opacity: 0.7; }
.ov-pie-num { font-size: 26px; font-weight: 700; fill: var(--ink); }
.ov-pie-unit { font-size: 11px; fill: var(--muted); }
.ov-pie-label text { font-size: 10.5px; }
.ov-pie-name { font-weight: 600; fill: var(--ink-soft); }
.ov-pie-pct { fill: var(--muted); }
.ov-grid .ov-avatar { flex: none; width: 22px; height: 22px; font-size: 9.5px; }
.ov-avatar-empty { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; }

/* Biểu đồ cột: nhiều người thì cuộn ngang, tên không bị bóp */
.ov-bars-scroll { flex: 1; display: flex; align-items: flex-end; overflow-x: auto; scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;}
.ov-bars { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; min-width: 100%; padding-bottom: 4px; }
.ov-bar-col {
  flex: 1 0 64px; min-width: 0; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px;
  border: 0; border-radius: 8px; background: transparent; font: inherit; cursor: pointer;
}
.ov-bar-col:hover { background: var(--bg); }
.ov-bar-col:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.ov-bar-val { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.ov-bar-track { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 140px; border-bottom: 1px solid var(--border); }
.ov-bar { display: block; width: 60%; max-width: 40px; border-radius: 6px 6px 0 0; }
.ov-bar-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--ink-soft); }

/* Hoàn thành tuần này */
.ov-big { margin: 0 0 8px; font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.ov-big small { font-size: 13px; font-weight: 500; color: var(--muted); }
.ov-done-list { list-style: none; margin: 0; padding: 0; }
.ov-task-link {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; border: 0; border-radius: 6px;
  background: transparent; font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer;
}
.ov-task-link:hover { background: var(--bg); }
.ov-task-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-task-date { font-size: 12px; color: var(--muted); }

/* Đến hạn tuần này / quá hạn: dòng việc của tab Danh sách, bỏ cột Đính kèm + Bình luận */
.ov-due-scroll { max-height: 600px; overflow: auto;scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent; }
.ov-due-group + .ov-due-group { margin-top: 12px; }
.ov-due-head { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ov-due-head.is-overdue { color: var(--danger-600); }
.ov-due-head.is-today { color: var(--primary-600); }
.ov-tasktable .pl-table-scroll { margin-left: 0; overflow-y: hidden; } /* bảng chỉ cuộn ngang; cả thẻ đã cuộn dọc */
.ov-tasktable .pl-table { min-width: 640px; }
/* Thẻ ở Tổng quan không cần cột kéo thả + ô tích chọn bên trái */
.ov-tasktable .pl-row { grid-template-columns: minmax(200px, 1fr) 120px 108px 92px 48px; }
.ov-tasktable .pl-gutter { display: none; }
/* Nút thêm task con / đổi tên chỉ chiếm chỗ khi rê vào, để tên việc có đủ chỗ trong thẻ hẹp */
.ov-tasktable .pl-name-actions { display: none; }
.ov-tasktable .pl-cell-name:hover .pl-name-actions, .ov-tasktable .pl-name-actions:focus-within { display: inline-flex; }
.ov-tasktable .pl-row-head .pl-cell { white-space: nowrap; }
.ov-tasktable .pl-row > :nth-child(6), .ov-tasktable .pl-row > :nth-child(7) { display: none; }

/* Hoạt động gần đây */
.ov-act { flex: 1 1 0; min-height: 0; list-style: none; margin: 0; padding: 0 4px 0 0; overflow: auto;scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent; }
.ov-act-day { margin: 10px 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ov-act-day:first-child { margin-top: 0; }
/* Mỗi hoạt động: hàng người + thời gian, bên dưới khung viền gồm tên công việc + hành động (bấm khung = mở việc) */
.ov-act-item { display: flex; flex-direction: column; gap: 6px; padding: 8px 2px; font-size: 12.5px; color: var(--ink); }
.ov-act-item + .ov-act-item { border-top: 1px solid var(--border-soft); }
.ov-act-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ov-act-who b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ov-act-time { margin-left: auto; flex-shrink: 0; font-size: 11.5px; color: var(--muted); }
.ov-act-box {
  display: flex; flex-direction: column; gap: 3px; width: auto; margin-left: 30px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink-soft); text-align: left;
}
button.ov-act-box { cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
button.ov-act-box:hover, button.ov-act-box:focus-visible { border-color: var(--primary); background: var(--primary-50); outline: none; }
.ov-act-task { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; color: var(--ink); }
.ov-act-task .pl-status-icon { display: inline-flex; flex-shrink: 0; }
.ov-act-task-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-act-text { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { button.ov-act-box { transition: none; } }

@media (max-width: 1100px) {
  .ov-mid { grid-column: span 6; }
  .ov-done { grid-column: span 12; min-height: 0; } /* thẻ thứ 3 nằm riêng 1 hàng: trải hết bề ngang cho cân */
  .ov-due, .ov-activity, .ov-attention { grid-column: span 12; }
  .ov-due { min-height: 0; }
}
@media (max-width: 760px) {
  .ov-ai, .ov-right, .ov-mid { grid-column: span 12; }
  .ov-ai, .ov-mid, .ov-due { min-height: 0; } /* 1 cột: thẻ cao theo nội dung, không chừa khoảng trống */
  .ov-activity { min-height: 380px; }
  .ov-ai-text { flex: none; min-height: 0; overflow: visible; }
  .ov-tiles { gap: 8px; }
  .ov-tiles .ov-tile { aspect-ratio: auto; min-height: 96px; }
  .ov-tiles .report-tile { padding: 10px 12px; }
  .ov-tiles .report-tile-value { font-size: 30px; }
  .ov-tools { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .ov-tile, .ov-stack-part, .ov-pie circle { transition: none; } }

/* ---------- Tự động hóa: danh sách quy tắc + hộp thoại Phạm vi → Khi → Nếu → Thì (automations.js) ---------- */
.auto-rules-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.auto-rules-head .auto-rules-title { flex: 1; margin: 0; }
.auto-rule-name { font-size: 13px; font-weight: 700; color: var(--primary-600); }
.auto-rule-text { overflow-wrap: anywhere; }
/* Công tắc bật / tắt + nút ⋯ (dùng chung 2 chế độ xem); menu ⋯ mở về phía trái, mép phải thẳng nút */
.auto-controls { display: flex; flex: none; align-items: center; gap: 6px; }
.auto-menu-wrap { position: relative; }
.auto-menu-btn { opacity: 1; border-color: var(--border-soft); } /* luôn hiện (kiểu nút ⋯ của tab Danh sách mặc định chỉ hiện khi rê) */
.auto-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
/* Nút chọn chế độ xem: dạng thẻ / dạng danh sách */
.auto-view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--bg); }
.auto-view-btn { display: inline-grid; place-items: center; width: 32px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.auto-view-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auto-view-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
/* Dạng thẻ (lưới tự chia cột): tên + phạm vi mờ, các ô Khi / Nếu / Thì, số lần chạy, lần chạy gần nhất */
/* Thẻ quy tắc: lưới 3 / 2 / 1 cột, thẻ cùng hàng cao bằng nhau, chân thẻ luôn sát đáy */
.auto-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.auto-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.auto-card:hover, .auto-card:focus-visible { border-color: var(--primary-100); box-shadow: var(--shadow-md); outline: none; }
.auto-card:focus-visible { border-color: var(--primary); }
.auto-rule.is-editable { cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.auto-rule.is-editable:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.auto-card-head { display: flex; align-items: flex-start; gap: 10px; }
.auto-card-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--bg); color: var(--ink-soft); }
.auto-card-ico.is-yellow { background: var(--warning-100); color: var(--warning-600); }
.auto-card-ico.is-red { background: var(--danger-50); color: var(--danger-600); }
.auto-card-ico.is-green { background: var(--success-50); color: var(--success-600); }
.auto-card-ico.is-blue { background: var(--primary-50); color: var(--primary-600); }
.auto-card-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.auto-card-scope { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.auto-card.is-off :is(.auto-card-name, .auto-card-ico, .auto-flow) { opacity: 0.5; }
.auto-card.is-busy .auto-switch { opacity: 0.6; pointer-events: none; }
/* Khối luồng KHI / NẾU / THÌ: chấm màu nối bằng đường dọc */
.auto-flow { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.auto-flow-step { position: relative; display: grid; grid-template-columns: 14px 44px minmax(0, 1fr); align-items: baseline; gap: 6px; padding: 4px 0; font-size: 13px; color: var(--ink); }
.auto-flow-step:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: -6px; width: 2px; background: var(--border); }
.auto-flow-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); transform: translateY(1px); }
.auto-flow-step.is-if .auto-flow-dot { background: var(--muted); }
.auto-flow-step.is-then .auto-flow-dot { background: var(--warning-600); }
.auto-flow-label { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--ink-soft); }
.auto-flow-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.auto-flow-step.is-then .auto-flow-text > span:not(.auto-flow-more) { font-weight: 700; }
.auto-flow-none, .auto-flow-more { color: var(--ink-soft); font-weight: 400; }
/* Chân thẻ: số lần chạy · chấm trạng thái · ⋯ (rê chuột thì hiện nút Sửa) */
.auto-card-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-soft); font-size: 13px; color: var(--ink-soft); }
.auto-card-foot .auto-controls { margin-left: auto; }
.auto-run { display: inline-flex; align-items: center; gap: 6px; }
.auto-run b { color: var(--ink); }
.auto-run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.auto-run-dot.is-ok { background: var(--success); }
.auto-run-dot.is-skip { background: var(--warning-600); }
.auto-run-dot.is-err { background: var(--danger); }
.auto-card-edit { display: none; margin-left: auto; }
.auto-card:hover .auto-card-edit { display: inline-flex; }
.auto-card:hover .auto-card-foot .auto-controls:not(:focus-within) { display: none; }
.ar-logs-box { width: min(760px, 94vw); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
#auto-logs-body { flex: 1; min-height: 0; overflow-y: auto; }
.auto-logs .auto-log-list { max-height: none; }
.auto-logs-head { margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.auto-log-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.auto-log { display: grid; grid-template-columns: 112px 104px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-top: 1px solid var(--border-soft); font-size: 12.5px; }
.auto-log:first-child { border-top: 0; }
.auto-log-time { color: var(--muted); }
.auto-log-res { font-weight: 600; }
.auto-log.is-ok .auto-log-res { color: var(--success-700); }
.auto-log.is-partial .auto-log-res, .auto-log.is-skipped .auto-log-res { color: var(--warning-700); }
.auto-log.is-error .auto-log-res { color: var(--danger-600); }
.auto-log-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auto-log-main .pl-link-btn { align-self: flex-start; padding: 0; text-align: left; }
.auto-log-detail { color: var(--ink-soft); overflow-wrap: anywhere; }

/* Form quy tắc 2 cột (automations.js renderAutoModal): đầu + chân cố định, thân cuộn */
.ar-modal-box { width: min(1080px, calc(100vw - 32px)); max-width: none; height: min(860px, calc(100vh - 32px)); max-height: none; display: flex; flex-direction: column; }
#modal-auto-rule .modal-head { gap: 10px; }
#modal-auto-rule .modal-head h2 { flex: 1; }
.ar-head-tools { display: flex; gap: 8px; }
.ar-tpl-btn { display: inline-flex; align-items: center; gap: 6px; }
.ar-tpl-btn.is-open { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); }
/* Nút X của hộp thoại này màu trung tính (màu đỏ dành cho xóa) */
#modal-auto-rule .modal-head .icon-btn { border-color: var(--border); background: var(--surface); color: var(--ink-soft); }
#modal-auto-rule .modal-head .icon-btn:hover { border-color: var(--border); background: var(--bg); color: var(--ink); box-shadow: none; }
#modal-auto-rule .modal-head .icon-btn:focus-visible { box-shadow: 0 0 0 3px var(--primary-100); }
#auto-rule-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 20px 24px; background: var(--bg); }
.ar-hint { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.ar-and { padding: 1px 8px; border-radius: 6px; background: var(--primary-50); color: var(--primary-600); font-size: 11.5px; font-weight: 700; }
.ar-step { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700;     justify-content: center;
    align-items: center !important;}
.ar-text { width: 100%; resize: vertical; }
.ar-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.ar-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.ar-people { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; }
.ar-person { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.ar-person:hover { background: var(--bg); }
.ar-person .ar-avatar { width: 22px; height: 22px; font-size: 9px; }
.ar-tpl-note { margin: 0; padding: 10px 12px; border: 1px solid var(--primary-100); border-radius: var(--radius-sm); background: var(--primary-50); font-size: 13px; color: var(--ink); }

/* Trường có nhãn: nhãn trên, ô dưới; thiếu thông tin = viền đỏ + câu báo ngay dưới */
.arf { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.arf-label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.arf-label small { font-weight: 500; color: var(--muted); }
.arf-req { color: var(--danger-600); }
.arf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.arf-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.arf-btn:hover { border-color: var(--primary); }
.arf-btn:focus-visible, .arf-btn.is-open { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.arf-btn.is-empty .arf-val { color: var(--muted); }
.arf-val { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.arf-chev { flex: none; color: var(--muted); transform: rotate(90deg); transition: transform 0.15s ease; }
.arf-btn.is-open .arf-chev { transform: rotate(-90deg); }
.arf .form-control { min-height: 40px; }
.arf-time { max-width: 160px; }
.arf.is-error .arf-btn, .arf.is-error .form-control { border-color: var(--danger-600); }
.arf-err { margin: 0; font-size: 12px; font-weight: 600; color: var(--danger-600); }

/* Phía trên: tên quy tắc + phạm vi */
.ar-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
/* Hai cột Khi nào? → Thực hiện gì? */
.ar-cols { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); gap: 12px; align-items: start; }
.ar-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ar-arrow { display: grid; place-items: center; width: 44px; height: 44px; margin-top: 28px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }
.ar-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.ar-card-head { display: flex; align-items: center; gap: 12px; }
.ar-card-head h3 { margin: 0; font-size: 18px; font-weight: 800; color: var(--ink); }
.ar-card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.ar-card-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; }
.ar-card-icon.is-when { background: var(--primary-50); color: var(--primary-600); }
.ar-card-icon.is-then { background: var(--warning-50); color: var(--warning-700); }
.ar-sub { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.ar-sub-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ar-sub-title small { font-weight: 500; color: var(--muted); }
.ar-empty { margin: 0; font-size: 12.5px; color: var(--muted); }
/* 1 điều kiện / 1 hành động đã thêm: khung riêng, tiêu đề + nút nhỏ bên cạnh */
.arb { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--bg); }
.ar-card > .arb + .arb { margin-top: 2px; }
.arb-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.arb-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.arb-and { display: flex; justify-content: center; margin: -4px 0; }
.arb-tool { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.arb-tool:hover:not(:disabled) { border-color: var(--border); background: var(--surface); color: var(--ink); }
.arb-tool.is-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger-600); }
.arb-tool:disabled { opacity: 0.35; cursor: default; }
.arb-tool:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.ar-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--primary-600); cursor: pointer; }
.ar-add:hover, .ar-add:focus-visible { outline: none; background: var(--primary-50); }

/* Danh sách chọn (vị trí do JS đặt theo ô chọn, tính trong .ar-modal-box) */
.arc-pop { position: absolute; z-index: 40; max-width: calc(100% - 16px); display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-md); }
.arc-pop-title { margin: 4px 6px 2px; font-size: 12px; color: var(--muted); }
.arc-opts { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow: auto; }
.arc-checkline { min-height: 34px; padding: 4px 8px; border-radius: 6px; }
.arc-checkline:hover { background: var(--bg); }
.arc-tpls { max-height: 420px; }
.arc-tpl { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.arc-tpl:hover, .arc-tpl:focus-visible { outline: none; background: var(--bg); border-color: var(--border-soft); }
.arc-tpl.is-current { background: var(--primary-50); }
.arc-tpl-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.arc-tpl-desc { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* Chân hộp thoại: luôn thấy — tóm tắt bên trái, Hủy / Lưu bên phải */
.ar-foot { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 14px 24px 16px; border-top: 1px solid var(--border-soft); background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.ar-foot .ov-ai-error { margin: 0; }
.ar-foot-row { display: flex; align-items: center; gap: 20px; }
.ar-summary { flex: 1; min-width: 0; }
.ar-summary-label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ar-preview { margin: 3px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.ar-foot-btns { flex: none; display: flex; gap: 8px; }
.ar-foot-btns .btn-primary { display: inline-flex; align-items: center; gap: 6px; }
.ar-dup { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--warning-100); border-radius: var(--radius-sm); background: var(--warning-50); font-size: 13px; color: var(--warning-700); }
.ar-foot-btns .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
/* Kiểm tra với một công việc */
.ar-test { margin-top: 16px; }
.ar-card-icon.is-test { background: var(--success-50); color: var(--success-700); }
.ar-test .ar-card-head > div { flex: 1; min-width: 0; }
.ar-test-pick { display: flex; flex-direction: column; gap: 8px; }
.ar-test-list { display: flex; flex-direction: column; max-height: 220px; overflow: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.ar-test-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name pill" "sub pill"; column-gap: 10px; align-items: center;
  padding: 7px 10px; border: 0; border-top: 1px solid var(--border-soft); background: transparent; font: inherit; text-align: left; cursor: pointer;
}
.ar-test-item:first-child { border-top: 0; }
.ar-test-item:hover, .ar-test-item.is-current { background: var(--primary-50); }
.ar-test-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ar-test-name { grid-area: name; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-test-sub { grid-area: sub; font-size: 12px; color: var(--muted); }
.ar-test-item .status-pill { grid-area: pill; }
.ar-test-result { display: flex; flex-direction: column; gap: 10px; }
.ar-test-verdict { margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; }
.ar-test-verdict.is-yes { background: var(--success-50); color: var(--success-700); }
.ar-test-verdict.is-no { background: var(--danger-50); color: var(--danger-600); }
.ar-test-stale { margin: 0; font-size: 12.5px; color: var(--warning-700); }
.ar-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ar-check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.ar-check-ico { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 800; color: #fff; background: var(--muted); }
.ar-check-row.is-yes .ar-check-ico { background: var(--success); }
.ar-check-row.is-no .ar-check-ico { background: var(--danger); }
.ar-check-row.is-no { color: var(--ink); }
/* Từng hành động: dùng chung cho kết quả kiểm tra và lịch sử chạy */
.ar-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
/* Dòng hành động (Kiểm tra quy tắc / lịch sử chạy): trùng tên lớp với vòng tròn số .ar-step 22px của trình sửa quy tắc —
   phải gỡ hết kích thước / nền / căn giữa của vòng tròn, nếu không mỗi dòng bị ép rộng 22px và chữ dồn thành cột dọc */
.ar-steps .ar-step { display: flex; width: auto; height: auto; min-width: 0; border-radius: 0; background: none; place-items: initial; justify-content: flex-start; align-items: flex-start !important;
  gap: 8px; font-size: 12.5px; font-weight: 400; line-height: 1.45; color: var(--ink-soft); }
.ar-step-badge { flex: none; min-width: 64px; padding: 1px 6px; border-radius: 999px; text-align: center; font-size: 11px; font-weight: 700; background: var(--border-soft); color: var(--muted); }
.ar-step.is-ok .ar-step-badge { background: var(--success-50); color: var(--success-700); }
.ar-step.is-skip .ar-step-badge { background: var(--warning-50); color: var(--warning-700); }
.ar-step.is-error .ar-step-badge { background: var(--danger-50); color: var(--danger-600); }
.ar-step-text { min-width: 0; overflow-wrap: anywhere; }
.auto-log-main .ar-steps { margin-top: 4px; }
@media (max-width: 900px) {
  .ar-top { grid-template-columns: 1fr; }
  .ar-cols { grid-template-columns: 1fr; }
  .ar-arrow { margin: 0 auto; transform: rotate(90deg); }
  .ar-foot-row { flex-direction: column; align-items: stretch; }
  .ar-foot-btns { justify-content: flex-end; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .ar-modal-box { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .auto-rule { align-items: flex-start; }
  .auto-card-grid { grid-template-columns: 1fr; }
  .ar-logs-box { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .auto-log { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Cài đặt › Không gian làm việc: Thông tin & thương hiệu (settings.js settingsBrandHTML) ----------
   Dạng hàng: nhãn + mô tả bên trái, thao tác bên phải; điện thoại thì xếp dọc, không tràn ngang */
.brand-card + .brand-card { margin-top: 0; }
.brand-rows { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: var(--radius-md); }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px 16px; min-width: 0; }
.brand-row + .brand-row { border-top: 1px solid var(--border-soft); }
.brand-row-text { flex: 1 1 260px; min-width: 0; }
.brand-row-title { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.brand-row-desc { margin: 3px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.brand-row-desc a { color: var(--primary-600); font-weight: 600; }
.brand-row .form-error-text { margin: 6px 0 0; }
.brand-row-actions { flex: 0 1 auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.brand-input { width: min(320px, 100%); }
.brand-row.has-error .form-control { border-color: var(--danger-600); }
.brand-pick { cursor: pointer; }
.brand-avatar { width: 44px; height: 44px; font-size: 16px; box-shadow: none; border-radius: 12px; }
.brand-avatar img, .brand-thumb img { width: 100%; height: 100%; object-fit: cover; }
.brand-thumb { display: inline-grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: repeating-conic-gradient(var(--bg) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px; }
.brand-thumb.is-square { width: 44px; height: 44px; }
.brand-thumb.is-wide { width: 140px; height: 32px; }
.brand-thumb.is-wide img { object-fit: contain; }
.brand-thumb.is-share { width: 96px; height: 50px; }
.brand-warn { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; font-size: 12.5px; color: var(--warning-700); }
.brand-warn svg { flex: none; margin-top: 2px; }
.brand-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-swatch { width: 26px; height: 26px; padding: 0; border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.brand-swatch.is-on { box-shadow: 0 0 0 2px var(--ink); }
.brand-swatch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100), 0 0 0 1px var(--ink); }
.brand-color-custom { display: flex; align-items: center; gap: 6px; }
.brand-color-custom input[type="color"] { width: 36px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.brand-color-custom .form-control { width: 104px; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.brand-slug { display: flex; align-items: center; width: min(360px, 100%); }
.brand-slug .form-control { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.brand-slug-suffix { flex: none; padding: 0 12px; height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--border); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--bg); font-size: 13.5px; color: var(--ink-soft); }
/* Bản xem trước: dùng biến --pv* riêng nên màu thử không đổi màu cả app trước khi lưu */
.brand-row-preview { align-items: flex-start; }
.brand-preview { flex: 0 1 520px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; min-width: 0; font-size: 12px; }
.brand-pv-app { grid-column: 1 / -1; display: flex; min-height: 120px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.brand-pv-side { flex: 0 0 150px; display: flex; flex-direction: column; gap: 4px; padding: 10px; background: var(--surface); border-right: 1px solid var(--border-soft); min-width: 0; }
.brand-pv-ws { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; min-width: 0; }
.brand-pv-ws strong, .brand-pv-login strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-pv-mark { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; overflow: hidden; border-radius: 6px; background: linear-gradient(135deg, var(--pv), var(--pv-600)); color: #fff; font-size: 10px; font-weight: 700; }
.brand-pv-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-pv-nav { padding: 4px 8px; border-radius: 6px; color: var(--ink-soft); }
.brand-pv-nav.is-on { background: var(--pv-50); color: var(--pv-600); font-weight: 700; }
.brand-pv-main { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 8px; padding: 12px; min-width: 0; }
.brand-pv-link { color: var(--pv-600); font-weight: 600; text-decoration: underline; }
.brand-pv-btn { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 6px; background: var(--pv); color: #fff; font-weight: 600; }
.brand-pv-status { padding: 2px 8px; border-radius: 999px; background: #fffbeb; color: #b45309; font-weight: 600; } /* màu trạng thái cố định, không đổi theo thương hiệu */
.brand-pv-login { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; }
.brand-pv-login img { max-width: 100%; max-height: 32px; object-fit: contain; }
.brand-pv-share { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; }
.brand-pv-share img, .brand-pv-share-empty { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.brand-pv-share-empty { display: grid; place-items: center; background: var(--bg); color: var(--muted); }
.brand-pv-share-text { display: flex; flex-direction: column; padding: 6px 8px; min-width: 0; }
.brand-pv-share-text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-pv-share-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .brand-row { flex-direction: column; align-items: stretch; }
  .brand-row-text { flex-basis: auto; }
  .brand-row-actions { justify-content: flex-start; }
  .brand-input, .brand-slug { width: 100%; }
  .brand-preview { flex-basis: auto; grid-template-columns: 1fr; }
  .brand-pv-side { flex-basis: 120px; }
}

/* Logo WEA cạnh tên ứng dụng ở đầu thanh bên (logo.png có nền riêng nên bỏ nền màu của ô) */
.sidebar-brand-mark.sidebar-app-logo { overflow: hidden; background: none; }
.sidebar-app-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Bảng Lọc: Sắp xếp + Bộ lọc đã lưu (tasks.js sfSortHTML / sfPanelHTML / sfBarHTML) ---------- */
.tf-popover { width: 300px; max-height: min(70vh, 560px); overflow-y: auto; }
.sf-sort { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 6px; padding: 10px 10px 4px; border-top: 1px solid var(--border-soft); font-size: 12.5px; color: var(--ink-soft); }
.sf-sort label { flex-basis: 100%; font-weight: 600; color: var(--ink); }
.sf-sort .tf-select { flex: 1; min-width: 0; }
.sf-dir { min-height: 36px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; }
.sf-panel { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.sf-panel .tf-empty { margin: 4px 10px 8px; line-height: 1.5; }
.sf-list { display: flex; flex-direction: column; gap: 2px; }
.sf-item { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-sm); }
.sf-item:hover, .sf-item.is-active { background: var(--primary-50); }
.sf-apply { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; border-radius: var(--radius-sm); }
.sf-apply span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-item.is-active .sf-apply { font-weight: 700; color: var(--primary-600); }
.sf-apply:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.sf-dot { width: 13px; height: 13px; flex: none; }
.sf-mini { width: 28px; height: 28px; flex: none; opacity: 0.6; }
.sf-item:hover .sf-mini, .sf-mini:focus-visible { opacity: 1; }
.sf-mini.is-danger:hover { color: var(--danger-600); border-color: var(--danger); }
.sf-new { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--primary-600); text-align: left; cursor: pointer; }
.sf-new:hover, .sf-new:focus-visible { outline: none; background: var(--primary-50); border-color: var(--primary); }
.sf-form { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 4px; }
.sf-form .form-control { flex: 1 1 100%; min-width: 0; }
.sf-form .form-control[aria-invalid="true"] { border-color: var(--danger-600); }
.sf-form .tf-error { flex-basis: 100%; margin: 0; }
.sf-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--primary-100); border-radius: var(--radius-md); background: var(--primary-50); font-size: 13px; color: var(--ink); }
.sf-bar.is-modified { border-color: #fde68a; background: var(--warning-50); }
.sf-bar-name { min-width: 0; overflow-wrap: anywhere; }
.sf-badge { padding: 2px 8px; border-radius: 999px; background: var(--warning-100); color: var(--warning-700); font-size: 11.5px; font-weight: 700; }
.sf-badge.is-saved { background: var(--success-100); color: var(--success-700); }
.sf-bar-btn { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
.sf-bar .filter-chip-remove { margin-left: auto; }
.sf-notice { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--warning-700); }
@media (max-width: 640px) {
  .tf-popover { width: min(300px, calc(100vw - 32px)); }
}

/* ---------- TAB BIỂU MẪU của dự án (intake.js) ----------
   Như tab Tổng quan: không dùng Tìm / Lọc / Thêm Việc, ẩn các chế độ xem khác. Trái = cấu hình, phải = bản xem trước (dính khi cuộn). */
.intake-view { display: none; }
.page-view:has(input[id$="-form"]:checked) .intake-view { display: block; }
.page-view:has(input[id$="-form"]:checked) :is(.kanban-board, .task-list-view, .calendar-view, .workflow-view, .gantt-view, .overview-view,
  .empty-state.is-no-results, .active-filters, .sf-bar, .tf-editor, .pv-filter-note, .wf-board-note, .project-empty-hint, .project-progress-bar) { display: none; }
.page-view:has(input[id$="-form"]:checked) .toolbar :is(.search-field, .tf-wrap, .tb-add-task) { display: none; }
.page-view:has(input[id$="-overview"]:checked) :is(.sf-bar, .tf-editor) { display: none; }
.intake-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.intake-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.intake-col-preview { position: sticky; top: calc(var(--topbar-h) + 12px); }
.intake-status { display: block; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.intake-status.is-on { color: var(--success-700); font-weight: 600; }
.intake-status.is-warn { color: var(--warning-700); font-weight: 600; }
.intake-link { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.intake-link .form-control { flex: 1 1 260px; min-width: 0; font-size: 12.5px; }
.intake-link .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
.intake-count { font-size: 12px; font-weight: 500; color: var(--muted); }
.intake-recent { display: flex; flex-direction: column; }
.intake-recent-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--border-soft); font-size: 13px; }
.intake-recent-row small { flex-basis: 100%; color: var(--muted); overflow-wrap: anywhere; }
.intake-code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 700; color: var(--primary-600); }
.intake-gone { color: var(--muted); }
.intake-preview-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.intake-preview { display: flex; flex-direction: column; gap: 12px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.intake-preview h3 { margin: 0; font-size: 18px; color: var(--ink); overflow-wrap: anywhere; }
.intake-pv-intro { margin: 0; font-size: 13.5px; color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.intake-pv-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.intake-pv-field small { font-weight: 500; color: var(--muted); }
.intake-req { color: var(--danger-600); }
.intake-pv-file { padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); font-weight: 500; color: var(--muted); }
.intake-pv-send { align-self: flex-start; pointer-events: none; }
@media (max-width: 900px) {
  .intake-grid { grid-template-columns: 1fr; }
  .intake-col-preview { position: static; }
}
@media (max-width: 520px) {
  .intake-field-row { grid-template-columns: 1fr 1fr; }
  .intake-field-row > div { grid-column: 1 / -1; }
}

/* ---------- Trang biểu mẫu công khai (form.html, form.js): dùng khung trang chọn workspace, rộng hơn chút ---------- */
.form-page .form-card { max-width: 620px; }
.form-logo { display: block; max-height: 44px; max-width: 220px; margin: 0 0 14px; object-fit: contain; }
.form-intro { white-space: pre-line; overflow-wrap: anywhere; }
.form-card .form-field small { font-weight: 500; color: var(--muted); }
.form-card .form-field.has-error .form-control { border-color: var(--danger-600); }
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-done { text-align: center; }
.form-done .start-actions { justify-content: center; }
.form-done-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 50%; background: var(--success-100); color: var(--success-700); font-size: 28px; font-weight: 700; }
.form-code { margin: 14px 0; font-size: 15px; color: var(--ink); }
.form-code strong { padding: 4px 10px; border-radius: var(--radius-sm); background: var(--primary-50); color: var(--primary-600); font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.05em; }

/* ---------- Trợ lý AI: chọn tệp có sẵn trong công việc (ai.js aiFilePickHTML) ---------- */
.ai-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; width: 100%; }
.ai-pick-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.ai-pick-opt:hover, .ai-pick-opt:focus-visible { outline: none; border-color: var(--primary); background: var(--primary-50); }
.ai-pick.is-list { flex-direction: column; align-items: stretch; gap: 8px; }
.ai-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.ai-pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; }
.ai-pick-file { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.ai-pick-file strong { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.ai-pick-file small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ai-pick-file:hover:not(:disabled), .ai-pick-file:focus-visible { outline: none; background: var(--primary-50); border-color: var(--primary-100); }
.ai-pick-file.is-off { opacity: 0.6; cursor: not-allowed; }
.tw-ai-file { color: var(--primary-600); }

/* ---------- KHUNG TÌM KIẾM CÓ THẺ (tasks.js taskSearchBoxHTML) — bố cục theo mẫu Discord ----------
   Từ khóa + thẻ điều kiện lọc trong 1 khung; bấm vào khung xổ danh sách gợi ý ngay dưới (loại bộ lọc / kết quả khớp).
   Thẻ nhiều thì hàng thẻ cuộn ngang (ẩn thanh cuộn), ô gõ luôn ở cuối. Gantt không có khung này: dùng nút Lọc + chip cũ. */
.search-field.ts-box { } /* responsive-zoom.css giới hạn ô tìm 290px: khung có thẻ cần rộng hơn */
.ts-box { position: relative; gap: 8px; cursor: text; transition: width 0.18s ease, flex-basis 0.18s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.ts-box:is(.is-open, :focus-within) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.ts-box .ts-lens { flex: none; color: var(--muted); }
.ts-tokens { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.ts-tokens::-webkit-scrollbar { display: none; }
.ts-box .ts-input { flex: 1 0 96px; min-width: 96px; height: 24px; padding: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); }
.ts-box .ts-input::-webkit-search-cancel-button { display: none; } /* dùng nút × riêng của khung */
.ts-token { flex: none; display: inline-flex; align-items: center; max-width: 230px; height: 24px; border-radius: 6px; background: #e8edf3; color: var(--ink); font-size: 13px; line-height: 1; }
.ts-token.is-editing { background: var(--primary-100); }
.ts-token-text { min-width: 0; height: 100%; padding: 0 2px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
span.ts-token-text { display: inline-flex; align-items: center; cursor: default; }
.ts-token-text b { font-weight: 700; }
.ts-token-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin: 0 3px 0 1px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.ts-token-x:hover, .ts-token-x:focus-visible { background: rgba(15, 23, 42, 0.1); color: var(--ink); }
.ts-clear { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer; }
.ts-clear:hover, .ts-clear:focus-visible { background: var(--bg); color: var(--ink); }

.ts-drop { position: absolute; top: calc(100% + 6px); right: -1px; z-index: 60; width: max(calc(100% + 2px), 380px); max-width: calc(100vw - 32px); max-height: min(70vh, 540px);scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; 
  overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); cursor: default; text-align: left; }
.ts-group + .ts-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.ts-group-title { padding: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ts-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.ts-opt:hover, .ts-opt.is-active { background: #eef2f6; }
.ts-opt:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ts-ico { flex: none; width: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.ts-ico .ts-avatar { width: 26px; height: 26px; font-size: 10.5px; }
.ts-ico-color { display: inline-flex; }
.ts-opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ts-opt-text strong, .ts-opt-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-opt-text strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.ts-opt-text small { font-size: 12.5px; color: var(--muted); }
.ts-opt-text small b { font-weight: 700; color: var(--ink-soft); }
.ts-check { flex: none; color: var(--primary-600); }
.ts-opt-row { display: flex; align-items: center; gap: 2px; }
.ts-opt-row .ts-opt { flex: 1; min-width: 0; }
.ts-drop .ts-mini { flex: none; width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); }
.ts-drop .ts-mini:hover { background: #eef2f6; color: var(--ink); }
.ts-drop .ts-mini.is-danger:hover { background: var(--danger-50); color: var(--danger-600); }
.ts-sub-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border-soft); font-size: 14px; font-weight: 700; color: var(--ink); }
.ts-sub-head small { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.ts-sub-head .ts-back { flex: none; width: 30px; height: 30px; }
.ts-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 8px 10px 4px; }
.ts-range label { flex: 1 1 130px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.ts-range .tf-error, .ts-sf-form .tf-error { flex-basis: 100%; margin: 0; }
.ts-sf-form { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px; }
.ts-sf-form input { flex: 1 1 160px; min-width: 0; }
.ts-empty { margin: 0; padding: 10px; font-size: 13px; color: var(--muted); }

/* Kích thước theo trang: dự án (1 hàng công cụ) và trang Dự án; mở / đang gõ thì khung rộng ra như mẫu */
.page-view .toolbar .ts-box { width: 300px; flex: 0 1 300px; }
.page-view .toolbar .ts-box:is(.is-open, :focus-within) { width: 440px; flex-basis: 440px; }
.pl-page-head .ts-box { width: 320px; }
.pl-page-head .ts-box:is(.is-open, :focus-within) { width: 440px; }
/* Nút Lọc + hàng chip cũ: chỉ còn ở tab Gantt (không có ô tìm); các chỗ khác thẻ nằm trong khung tìm kiếm */
.toolbar .tf-wrap.tf-legacy { display: none; }
.page-view:has(input[id$="-gantt"]:checked) .toolbar .tf-wrap.tf-legacy { display: inline-block; }
.active-filters[data-filter-chips] { display: none; }
.page-view:has(input[id$="-gantt"]:checked) .active-filters[data-filter-chips] { display: flex; }
@media (max-width: 620px) {
  .page-view .toolbar .ts-box, .page-view .toolbar .ts-box:is(.is-open, :focus-within),
  .pl-page-head .ts-box, .pl-page-head .ts-box:is(.is-open, :focus-within) { width: auto; flex: 1 1 100%; }
  .ts-drop { left: -1px; right: -1px; width: auto; max-width: none; max-height: 60vh; }
}
@media (prefers-reduced-motion: reduce) { .ts-box { transition: none; } }

/* =====================================================
   BÁO CÁO › PHÂN BỔ CÔNG VIỆC (reports.js wl*)
   Hàng = thành viên, cột = ngày; ô bo góc như ClickUp Workload. Trạng thái luôn có chữ ("Đã đủ", "Vượt X giờ"),
   màu chỉ là kênh phụ. Ngày nghỉ = nền gạch chéo. Điện thoại: thẻ từng người (.wl-cards).
   ===================================================== */
.wl-weeknav { display: inline-flex; align-items: center; gap: 4px; }
.wl-weeknav .icon-btn { border: 1px solid var(--border); }
.wl-next svg { transform: rotate(180deg); }
.wl-today.is-on { border-color: var(--primary); color: var(--primary-600); }
.wl-pick .form-control { width: auto; }
.wl-range { font-size: 14px; color: var(--ink); white-space: nowrap; }
.wl-saved { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--success-50); color: var(--success-700); font-size: 12.5px; font-weight: 600; }

.wl-th-dow { color: var(--muted); }
.wl-th-date { font-weight: 700; color: var(--ink); }
.wl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.wl-chip { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; background: var(--bg); color: var(--muted); }
.wl-span { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.wl-span-btn { padding: 5px 10px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.wl-span-btn:hover { background: var(--bg); }
.wl-span-btn.is-on { background: var(--primary-50); color: var(--primary-600); }

/* Timeline Workload kiểu ClickUp: 1 khung cuộn 2 chiều, cột thành viên dính trái (--wl-left), hàng ngày dính trên (--wl-day) */
.wlb-card { padding: 0; overflow: hidden; }
.wlb {
  position: relative; --wl-left: 280px; --wl-day: 84px;
  /* Màu ô giờ kiểu ClickUp: xanh = có làm, vàng = nghỉ / lễ, đỏ = vượt, xám = chưa giao người */
  --wl-green: #c3e8cf; --wl-green-bd: #a6dbb7; --wl-green-ink: #276a43;
  --wl-yellow: #f7dba6; --wl-yellow-bd: #efc77f; --wl-yellow-ink: #85560f;
  --wl-red: #f9c9cf; --wl-red-bd: #f3a6b0; --wl-red-ink: #a3243b;
  --wl-grey: #efefef; --wl-grey-bd: #dcdcdc; --wl-grey-ink: #8a8a8a;
}
.wlb-scroll { overflow: auto; max-height: 80vh; min-height: 220px; overscroll-behavior: contain; }
.wlb-grid { position: relative; }
/* Thanh cuộn mảnh xám như ClickUp: thuộc tính chuẩn đặt thẳng lên khung cuộn (Chrome 121+, Edge, Firefox) */
.wlb-scroll { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.wlb-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border-soft); }
.wlb-row:hover > .wlb-left, .wlb-row:hover > .wlb-days { background-color: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.wlb-left { position: sticky; left: 0; z-index: 2; flex: none; width: var(--wl-left); display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 10px; background: var(--surface); border-right: 1px solid var(--border); min-width: 0; }
.wlb-days { display: flex; flex: none; padding: 4px 0; background: var(--surface); }
.wlb-head { position: sticky; top: 0; z-index: 3; }
.wlb-head .wlb-left, .wlb-head .wlb-days { background: var(--bg); }
.wlb-corner { z-index: 4; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.wlb-corner small { font-weight: 600; color: var(--muted); }
.wlb-dayh { flex: none; width: var(--wl-day); display: flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 2px; font-size: 12.5px; white-space: nowrap; }
.wlb-dayh.is-off { color: var(--muted); }
.wlb-dayh.is-today .wl-th-date { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--danger-600); color: #fff; }
.wlb-caret { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.wlb-caret svg { transform: rotate(180deg); transition: transform 0.2s; }
.wlb-caret.is-open svg { transform: rotate(-90deg); }
.wlb-caret:hover, .wlb-caret:focus-visible { border-color: var(--primary); color: var(--primary-600); }
.wlb-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wlb-who .log-member { min-width: 0; }
.wlb-chip { --c: var(--primary-600); flex: none; padding: 3px 9px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--c) 8%, var(--surface)); font: inherit; font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--c) 80%, var(--ink)); white-space: nowrap; cursor: pointer; }
.wlb-chip.is-over { --c: var(--danger-600); }
.wlb-chip.is-off { --c: var(--muted); cursor: default; }
.wlb-unassigned-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); color: var(--muted); }
.wlb-cellwrap { flex: none; width: var(--wl-day); padding: 0 3px; }
.wlb-cellwrap.is-off { background: repeating-linear-gradient(135deg, var(--border-soft) 0 6px, transparent 6px 12px); border-radius: var(--radius-sm); min-height: 48px; }
.wlb-cell {
  position: relative; width: 100%; min-height: 48px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--wl-green-bd); border-radius: 8px; background: var(--wl-green); color: var(--wl-green-ink);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: filter 0.15s, box-shadow 0.15s;
}
.wlb-cell:hover, .wlb-cell.is-open { filter: brightness(0.96); box-shadow: 0 0 0 2px color-mix(in srgb, var(--wl-green-ink) 25%, transparent); }
.wlb-cell:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 1px; }
.wlb-cell.is-over { background: var(--wl-red); border-color: var(--wl-red-bd); color: var(--wl-red-ink); }
.wlb-cell.is-leave, .wlb-cell.is-holiday { background: var(--wl-yellow); border-color: var(--wl-yellow-bd); color: var(--wl-yellow-ink); }
.wlb-cell.is-none { background: var(--wl-grey); border: 2px solid var(--wl-grey-bd); color: var(--wl-grey-ink); }
.wlb-cell.has-pending { border-style: dashed; border-color: var(--wl-yellow-bd); }
.wlb-badge { position: absolute; top: -6px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 999px; background: #f5b324; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; }
.wlb-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); padding-left: 36px; }
/* Khung nhỏ cạnh ô giờ (bấm ô) */
.wlb-tip { position: fixed; z-index: 45; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; background: #26282c; color: #f1f1f1; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); font-size: 13px; }
.wlb-tip-title { font-size: 15px; font-weight: 700; color: #fff; }
.wlb-tip-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #c9cbcf; }
.wlb-tip-chip { padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 700; }
.wlb-tip-chip.is-over { background: rgba(251, 113, 133, 0.35); }
.wlb-tip-line { padding: 4px 0 4px 10px; border-left: 3px solid #8ab4f8; font-weight: 600; color: #fff; }
.wlb-tip-line.is-warn { border-left-color: #f5b324; }
.wlb-tip-line.is-leave { border-left-color: #efc77f; }
.wlb-tip-tasks { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.wlb-tip-task { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; margin: 0 -6px; border: 0; border-radius: 6px; background: none; color: #e8e8e8; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.wlb-tip-task:hover, .wlb-tip-task:focus-visible { background: rgba(255, 255, 255, 0.1); }
.wlb-tip-task span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wlb-tip-task b { flex: none; color: #c9cbcf; font-weight: 600; }
.wlb-tip-more { font-size: 12px; color: #a8abb0; }
/* Làn thanh việc của 1 người (mở bằng mũi tên) */
.wlb-lanes { background: var(--bg); }
.wlb-lanes > .wlb-left { align-items: flex-end; background: var(--bg); }
.wlb-lane-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; width: 100%; font-size: 12px; }
.wlb-lane-links .is-danger { color: var(--danger-600); }
.wlb-track { position: relative; flex: none; touch-action: none; }
.wlb-track.is-creatable { cursor: cell; } /* dấu + kiểu Excel: bấm / kéo để thêm việc, ngày nghỉ */
.wlb-col { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--border-soft); }
.wlb-col.is-off { background: repeating-linear-gradient(135deg, var(--border-soft) 0 6px, transparent 6px 12px); }
.wlb-today-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--danger-600); opacity: 0.6; pointer-events: none; }
.wlb-empty-hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--muted); pointer-events: none; }
.wlb-bar {
  position: absolute; height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 10px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary-600) 45%, transparent); border-radius: 8px;
  background: var(--surface); box-shadow: var(--shadow-sm); font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.wlb-bar { --bc: #a78bfa; background: color-mix(in srgb, var(--bc) 45%, var(--surface)); border-color: color-mix(in srgb, var(--bc) 65%, var(--surface)); color: var(--ink); box-shadow: none; }
.wlb-bar::before { content: none; }
.wlb-bar:hover, .wlb-bar:focus-visible { border-color: color-mix(in srgb, var(--bc) 90%, var(--ink)); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); z-index: 2; }
.wlb-bar.is-editable { cursor: grab; }
.wlb-bar.is-dragging { cursor: grabbing; opacity: 0.85; z-index: 3; box-shadow: var(--shadow-lg); }
.wlb-bar.is-overdue { border-color: color-mix(in srgb, var(--danger-600) 55%, transparent); }
.wlb-bar.is-overdue { box-shadow: inset 3px 0 0 var(--danger-600); }
.wlb-bar.is-locked { border-style: dashed; }
.wlb-bar.is-noest { background: color-mix(in srgb, var(--bc) 25%, var(--surface)); }
/* Việc cha + task con: màu theo TRẠNG THÁI (--bc = STATUS_META, reports.js wlBarHTML). Cha đậm hơn + biểu tượng nhóm (giờ không cộng),
   con nhạt hơn + biểu tượng nhánh, nằm dưới việc cha */
.wlb-bar.is-parent, .wlb-bar.is-parent.is-noest { background: color-mix(in srgb, var(--bc) 55%, var(--surface)); border-color: color-mix(in srgb, var(--bc) 80%, var(--surface)); color: var(--ink); }
.wlb-bar.is-sub, .wlb-bar.is-sub.is-noest { background: color-mix(in srgb, var(--bc) 25%, var(--surface)); border-color: color-mix(in srgb, var(--bc) 55%, var(--surface)); color: var(--ink); }
.wlb-kind-ic { flex: none; color: currentColor; opacity: 0.75; }
.wlb-bar.is-parent .wlb-kind-ic { margin-left: auto; opacity: 0.85; }
.wlb-bar.is-cut-s { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.wlb-bar.is-cut-e { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.wlb-bar.is-saving { animation: wlb-pulse 1s ease-in-out infinite; }
@keyframes wlb-pulse { 50% { opacity: 0.55; } }
.wlb-bar-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.wlb-bar-h { flex: none; font-size: 11.5px; color: var(--ink-soft); }
.wlb-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 1; }
.wlb-handle.is-s { left: 0; }
.wlb-handle.is-e { right: 0; }
.wlb-bar.is-editable:hover .wlb-handle { background: color-mix(in srgb, var(--primary) 25%, transparent); }
.wlb .gantt-drag-tip { position: absolute; z-index: 5; padding: 2px 8px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.wlb-ghost, .wlb-hover { position: absolute; height: 28px; border-radius: 8px; pointer-events: none; }
.wlb-hover { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.wlb-ghost { border: 2px dashed var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.wlb-new-pop { position: fixed; z-index: 40; display: flex; flex-direction: column; max-height: 420px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16); cursor: default; overflow: hidden; }
.wlp-tabs { display: flex; align-items: center; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--border-soft); flex: none; }
.wlp-tab { padding: 11px 6px 9px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.wlp-tab:hover { color: var(--ink); }
.wlp-tab.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.wlp-close { flex: none; width: 28px; height: 28px; margin-left: auto; } /* nút ✕ đóng popup thêm việc (góc phải trên) */
.wlp-tabs .wlp-proj + .wlp-close { margin-left: 6px; }
.wlp-proj { margin-left: auto; max-width: 160px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font: inherit; font-size: 12px; color: var(--ink); }
.wlp-body { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 12px; min-height: 0; overflow-y: auto; }
.wlp-search { display: flex; align-items: center; gap: 8px; padding: 4px 0 8px; border-bottom: 1px solid var(--border-soft); color: var(--muted); }
.wlp-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 14px; color: var(--ink); }
.wlp-browse, .wlp-empty { margin: 0; font-size: 12px; color: var(--primary-600); }
.wlp-empty { color: var(--muted); }
.wlp-list { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.wlp-group-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.wlp-proj-dot { width: 10px; height: 10px; border: 2px solid; border-radius: 50%; }
.wlp-task { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px 6px 20px; border: 0; border-radius: 6px; background: none; font: inherit; text-align: left; cursor: pointer; }
.wlp-task:hover, .wlp-task:focus-visible { background: var(--bg); }
.wlp-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.wlp-task-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink); }
/* Task con: thụt vào, tên việc cha nhỏ màu xám phía trên (như Browse tasks của ClickUp) */
.wlp-task.is-sub { padding-left: 34px; }
.wlp-task.is-sub .wlp-dot { opacity: 0.6; }
.wlp-parent { display: block; font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wlp-sub-ic { margin-right: 5px; color: var(--ink-soft); }
/* Chi tiết rộng: đồng hồ đã ghi / ước lượng (ô nhập hiện như chữ, bấm là sửa) */
.wm-est { gap: 4px; cursor: text; }
.wm-est-sep { color: var(--ink-soft); }
.wm-est-unit { font-size: 12px; color: var(--ink-soft); }
.wm-est-box { display: inline-flex; align-items: center; gap: 1px; padding: 0 2px; border: 1px solid transparent; border-radius: 6px; }
.wm-est:hover .wm-est-box:has(input:not(:disabled)), .wm-est-box:focus-within { border-color: var(--border); background: var(--surface); }
.wm-est-box:focus-within { border-color: var(--primary); }
.wm-est-h, .wm-est-m { width: 2.4ch; min-width: 0; height: 24px; padding: 0; border: 0; background: transparent; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; color: var(--ink); outline: none; }
.wm-est-h::placeholder, .wm-est-m::placeholder { color: var(--ink-soft); font-weight: 500; }
.wm-est-h:focus, .wm-est-m:focus { border-radius: 4px; background: var(--primary-50); }
.wm-est-h { text-align: right; }
.wm-est-m { text-align: left; }
.wm-est-box .wm-est-unit { font-size: 13px; color: var(--ink); }
.wide-meta .wm-est .wm-est-unit { text-transform: none; }
/* Thanh thông tin chi tiết rộng: 4 nhóm ngăn bằng vạch mảnh, mọi ô cao 32px, giá trị nằm trong ô bo góc (kiểu ClickUp) */
.wide-meta { gap: 8px; text-transform: none; }
.wm-sep { flex: none; align-self: center; width: 1px; height: 20px; background: var(--border-soft); }
.wide-meta .wm-label, .wide-meta .wm-field > span { font-size: 12.5px; color: var(--ink-soft); margin-right: 2px; }
.wide-meta .wm-est { gap: 3px; height: 32px; padding: 0 10px; border-radius: 10px; background: var(--bg); color: var(--ink); font-weight: 600; }
.wide-meta .wm-date { height: 32px; padding: 0 8px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); }
.wide-meta .wm-date:hover:not(:disabled) { border-color: var(--border); }
.wide-meta .wm-date:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-50); }
.wide-meta .assignee-picker-avatars .avatar { width: 28px; height: 28px; font-size: 11px; box-shadow: 0 0 0 2px var(--surface); }
.wide-meta .assignee-picker-avatars .assignee-more { background: var(--bg); color: var(--ink-soft); font-weight: 700; }
.wide-meta .assignee-picker-avatars .assignee-add-btn { width: 28px; height: 28px; border: 0; border-radius: 8px; background: var(--bg); color: var(--ink-soft); box-shadow: none; }
.wide-meta .assignee-picker-avatars .assignee-add-btn:hover { background: var(--primary-50); color: var(--primary-600); }
.wide-meta .wm-status { gap: 0; }
.wide-meta > .star-btn { width: 32px; height: 32px; border-radius: 10px; }
/* Màn hẹp: thanh xuống 2 hàng, vạch ngăn có thể treo ở cuối hàng -> ẩn, các nhóm tách bằng khoảng cách */
@media (max-width: 1100px) { .wm-sep { display: none; } .wide-meta { column-gap: 12px; row-gap: 8px; } }
.wlp-has { font-size: 11px; color: var(--muted); }
.wlp-task-id { flex: none; font-size: 11.5px; color: var(--muted); }
.wlp-title { border: 0; outline: none; background: none; padding: 6px 0 2px; font: inherit; font-size: 18px; font-weight: 600; color: var(--ink); }
.wlp-title::placeholder, .wlp-desc::placeholder { color: var(--muted); font-weight: 500; }
.wlp-desc { border: 0; outline: none; background: none; resize: vertical; min-height: 40px; padding: 0; font: inherit; font-size: 13.5px; color: var(--ink); }
.wlp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 4px; }
.wlp-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.wlp-chip .avatar-stack, .wlp-chip .avatar { transform: scale(0.85); }
.wlb-new-pop .wlp-chip select { -webkit-appearance: none; appearance: none; height: auto; padding: 0 2px; border: 0; border-radius: 0; box-shadow: none; outline: none; background: none; font: inherit; color: inherit; cursor: pointer; }
.wlp-chip.is-status { border: 0; background: #eaf7ff; color: #0284c7; font-weight: 700; letter-spacing: 0.02em; }
.wlp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border-soft); flex: none; }
.wlp-foot-hint { font-size: 12.5px; color: var(--muted); }
.wlp-foot-btns { display: inline-flex; gap: 6px; }
.wlp-range { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.wlp-label { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.wlp-kinds { display: flex; flex-direction: column; gap: 6px; }
.wlp-kind { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.wlp-kind:hover { background: var(--bg); }
.wlp-kind:focus-within { outline: 2px solid var(--primary-600); outline-offset: 1px; }
.wlp-kind-ic { width: 20px; text-align: center; }
.wlp-check { margin-left: auto; color: var(--primary-600); }
.wlp-kind.is-on { border-color: color-mix(in srgb, var(--primary) 55%, transparent); }
.wlp-note { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.wlp-note input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 13.5px; color: var(--ink); }
.wlp-err { margin: 0; }
.wlb-new-pop .form-error-text { margin: 0; }
.wlb-new-actions { display: flex; justify-content: flex-end; gap: 6px; }
.wlb-divider { position: absolute; top: 0; bottom: 0; left: calc(var(--wl-left) - 4px); width: 8px; z-index: 6; cursor: col-resize; touch-action: none; }
.wlb-divider::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background 0.15s; }
.wlb-divider:hover::after, .wlb-divider:focus-visible::after, .wlb.is-dragging .wlb-divider::after { background: var(--primary); }
.wlb.is-dragging { user-select: none; }
@media (prefers-reduced-motion: reduce) {
  .wlb-bar, .wlb-caret svg, .wlb-divider::after { transition: none; }
  .wlb-bar.is-saving { animation: none; opacity: 0.7; }
}
/* Ô 1 ngày / ô tổng tuần: nền + viền theo mức (--c) */
.wl-cell, .wl-total {
  --c: var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; height: 100%; min-height: 56px; padding: 6px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  font: inherit; color: var(--ink); cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
span.wl-total { cursor: default; min-height: 0; padding: 4px 10px; flex-direction: row; flex-wrap: wrap; }
.wl-cell:hover, .wl-cell:focus-visible, button.wl-total:hover, button.wl-total:focus-visible {
  border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, var(--surface)); box-shadow: var(--shadow-sm);
}
.wl-cell:focus-visible, button.wl-total:focus-visible { outline: 2px solid var(--primary-600); outline-offset: 1px; }
.wl-cell.is-off, .wl-total.is-off { --c: var(--muted); }
.wl-cell.is-full, .wl-total.is-full { --c: var(--primary-600); }
.wl-cell.is-over, .wl-total.is-over { --c: var(--danger-600); }
.wl-cell-h { font-size: 13.5px; font-weight: 700; }
.wl-total-h { font-size: 13px; color: var(--ink-soft); }
.wl-total-h b { color: var(--ink); }
.wl-cell-label { font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.wl-bar { display: block; width: 80%; height: 4px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--c) 18%, transparent); overflow: hidden; }
.wl-bar span { display: block; height: 100%; background: var(--c); border-radius: inherit; }

/* Panel danh sách việc của 1 ô */
body:has(#workload-panel-toggle:checked) #workload-overlay { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#workload-panel-toggle:checked) #workload-overlay .detail-panel { transform: translateX(0); }
#workload-overlay { z-index: 54; } /* dưới bảng chi tiết việc (55): mở việc từ panel thì chi tiết đè lên */
.workload-panel { max-width: 560px; }
.workload-panel-body { flex: 1; overflow-y: auto; padding: 14px 16px 20px; }
.wl-panel-sum { --c: var(--primary-600); margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--c) 10%, var(--surface)); font-size: 13.5px; }
.wl-panel-sum.is-over { --c: var(--danger-600); }
.wl-panel-hint { margin-top: 12px; }
.wl-task-meta { font-size: 12px; color: var(--ink-soft); }
.wl-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.wl-flag { padding: 1px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; }
.wl-flag.is-over { background: var(--danger-50); color: var(--danger-600); }
.wl-flag.is-locked { background: var(--warning-50); color: var(--warning-700); }

/* Khu thu gọn "Chưa thể phân bổ" / "Quá hạn" */
.wl-section summary { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; cursor: pointer; list-style: none; }
.wl-section summary::-webkit-details-marker { display: none; }
.wl-section summary::before { content: "\25B8"; color: var(--muted); transition: transform 0.2s; }
.wl-section[open] summary::before { transform: rotate(90deg); }
.wl-section[open] summary { margin-bottom: 8px; }
.wl-count { padding: 0 9px; border-radius: var(--radius-pill); background: var(--bg); font-size: 12.5px; }
.wl-section.is-overdue .wl-count { background: var(--danger-50); color: var(--danger-600); }
.wl-section.is-unalloc .wl-count { background: var(--warning-50); color: var(--warning-700); }

/* Hộp thoại Lịch làm việc */
.wl-set-box { max-width: 560px; }
.wl-days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wl-day { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: 13px; cursor: pointer; }
.wl-day:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.wl-set-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.wl-set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: 0; padding: 6px 4px; border-bottom: 1px solid var(--border-soft); }
.wl-set-row .form-error-text { width: 100%; margin: 0; }
.wl-set-input { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.wl-set-input .form-control { width: 90px; }
.wl-set-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Điện thoại: thẻ từng người thay cho bảng 7 cột */
.wl-cards { display: none; }
@media (max-width: 760px) {
  .wl-desktop { display: none; }
  .wl-cards { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
  .wl-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
  .wl-card-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
  .wl-card-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .wl-card-head .wl-total { width: auto; min-height: 0; flex: none; }
  .wl-card-caret { flex: none; transform: rotate(180deg); color: var(--muted); transition: transform 0.2s; }
  .wl-card.is-open .wl-card-caret { transform: rotate(-90deg); }
  .wl-card-days { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 12px; }
  .wl-card-day { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 2px 10px; min-height: 0; padding: 8px 10px; text-align: left; }
  .wl-card-day .wl-card-dlabel { grid-row: 1 / span 2; font-weight: 700; }
  .wl-card-day .wl-bar { width: 100%; grid-column: 2; }
  .wl-card-day .wl-cell-h { grid-column: 2; font-size: 12.5px; }
  .wl-card-day.is-off { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12.5px; color: var(--muted);
    background: repeating-linear-gradient(135deg, var(--border-soft) 0 6px, transparent 6px 12px); }
  .wl-range { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .wl-cell, .wl-total, .wl-card-caret, .wl-section summary::before { transition: none; }
}

/* =====================================================
   MẪU CÔNG VIỆC (teamwork.js tpl*): danh sách / sửa mẫu / xem trước khi tạo việc
   Cây task con thụt lề theo cấp (--d); điện thoại: các ô của 1 dòng xuống hàng.
   ===================================================== */
.tpl-modal-box { width: min(980px, calc(100vw - 32px)); max-width: none; max-height: min(88vh, 900px); display: flex; flex-direction: column; }
.tpl-modal-box .modal-body { overflow-y: auto; }
.tpl-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tpl-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.tpl-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tpl-card-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-card-sub { font-size: 12.5px; color: var(--muted); }
.tpl-card-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.tpl-del-btn { color: var(--danger-600); }
.tpl-root-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tpl-root-line .form-control, .tpl-row .form-control { width: auto; }
.tpl-tree-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 14px 0 6px; }
.tpl-tree { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.tpl-row { margin: 0; padding: 6px 8px 6px calc(8px + (var(--d, 1) - 1) * 22px); border-radius: var(--radius-sm); border-left: 3px solid color-mix(in srgb, var(--primary) calc(var(--d, 1) * 25%), transparent); background: var(--bg); }
.tpl-row.is-off { opacity: 0.5; }
.tpl-row-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.tpl-name { flex: 1 1 200px; min-width: 140px; }
.tpl-pri { flex: none; }
.tpl-est, .tpl-days label, .tpl-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.tpl-est .form-control { width: 70px !important; }
.tpl-days { display: inline-flex; flex-wrap: wrap; gap: 4px 8px; }
.tpl-days .form-control { width: 64px !important; }
.tpl-row-tools { display: inline-flex; gap: 2px; margin-left: auto; }
.tpl-row-tools .icon-btn { width: 28px; height: 28px; font-weight: 700; }
.tpl-desc { width: 100% !important; margin-top: 6px; }
.tpl-row .form-error-text { width: 100%; margin: 4px 0 0; }
/* Dính đáy khung cuộn: bù đúng phần đệm 20px của .modal-body để không lộ dòng bên dưới */
.tpl-foot { display: flex; justify-content: flex-end; gap: 8px; margin: 16px -20px -20px; position: sticky; bottom: -20px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border-soft); }
.tpl-apply-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.tpl-apply-grid .form-control { width: 100%; }
.tpl-dates { display: flex; gap: 6px; }
.tpl-people { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow-y: auto; }
.tpl-person-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); font-size: 13px; cursor: pointer; }
.tpl-person-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.tpl-inc { flex: 1 1 200px; min-width: 0; font-size: 13.5px; color: var(--ink); white-space: normal; }
.tpl-apply-name { font-weight: 600; }
.tpl-apply-meta { font-size: 12px; color: var(--muted); }
.tpl-person { flex: 0 1 170px; }
.tpl-apply-head { display: flex; justify-content: flex-end; gap: 8px; padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tpl-apply-head span:first-child { margin-right: auto; }
@media (max-width: 760px) {
  .tpl-modal-box { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .tpl-apply-grid { grid-template-columns: 1fr; }
  .tpl-card { flex-wrap: wrap; }
  .tpl-card-actions { width: 100%; justify-content: flex-end; }
  .tpl-row-tools { margin-left: 0; }
  .tpl-person, .tpl-row input[type="date"] { flex: 1 1 140px; }
  .tpl-apply-head { display: none; }
}

/* =====================================================
   NGÀY NGHỈ (reports.js leave*): ô "Nghỉ" / "Lễ", thanh ngày nghỉ trên làn, cảnh báo việc trùng ngày nghỉ, danh sách đơn
   Màu cam (--warning) cho ngày nghỉ; đơn chờ duyệt = viền nét đứt + mờ. Luôn có chữ / biểu tượng, không chỉ dùng màu.
   ===================================================== */
.wlb-off-cell { --c: var(--warning-600); display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 48px; padding: 4px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--c) 10%, var(--surface)); font: inherit; font-size: 12px; font-weight: 700; color: var(--warning-700); cursor: pointer; }
.wlb-off-cell.is-holiday { --c: #8b5cf6; color: #6d28d9; }
.wlb-off-cell:hover, .wlb-off-cell:focus-visible { border-color: var(--c); }
.wlb-cell.has-pending { box-shadow: inset 0 -3px 0 var(--warning); }
.wlb-dayh.is-holiday { background: color-mix(in srgb, #8b5cf6 10%, var(--bg)); }
.wlb-hol-tag { padding: 0 5px; border-radius: var(--radius-pill); background: #ede9fe; color: #6d28d9; font-size: 10.5px; font-weight: 700; }
.wlb-leave { position: absolute; height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 10px; overflow: hidden; border: 1px solid #dcdcdc; border-radius: 8px; background: #f2f2f2; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; cursor: pointer; z-index: 1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.wlb-leave-ic { font-size: 14px; }
.wlb-leave span { overflow: hidden; text-overflow: ellipsis; }
.wlb-leave.is-pending { border-style: dashed; background: var(--surface); }
.wlb-leave:hover, .wlb-leave:focus-visible { box-shadow: var(--shadow-sm); }
.wlb-bar.is-clash { border-color: var(--warning-600); }
.wlb-clash-ic { flex: none; color: var(--warning-600); }
.wl-pending-btn { border-color: var(--warning-600); color: var(--warning-700); }
.leave-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.leave-head h2 { margin: 0 0 4px; font-size: 16px; }
.leave-list { display: flex; flex-direction: column; gap: 6px; }
.leave-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.leave-row-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.leave-row-sub { font-size: 12.5px; color: var(--muted); }
.leave-row-sub.is-danger { color: var(--danger-600); }
.leave-row-actions { display: flex; align-items: center; gap: 6px; }
.leave-chip { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; }
.leave-chip.is-pending { background: var(--warning-50); color: var(--warning-700); }
.leave-chip.is-approved { background: var(--success-50); color: var(--success-700); }
.leave-chip.is-rejected { background: var(--danger-50); color: var(--danger-600); }
.leave-modal-box { width: min(800px, calc(100vw - 24px)); max-width: none; }
.leave-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.holiday-title { margin: 18px 0 2px; font-size: 14px; }
.holiday-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.holiday-add .form-field { margin: 0; flex: 1 1 140px; }
@media (max-width: 480px) { .leave-dates { grid-template-columns: 1fr; } }

/* Trạng thái hoạt động: chấm góc dưới phải avatar (xanh = đang hoạt động, vàng = vắng mặt, xám rỗng = ngoại tuyến).
   Hình khác nhau cho từng trạng thái (đặc / nửa / rỗng) để không chỉ dựa vào màu. */
.avatar-presence { position: relative; display: inline-flex; flex: none; }
.presence-dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); box-sizing: content-box; }
.presence-dot.is-online { background: #22c55e; }
.presence-dot.is-away { background: linear-gradient(135deg, #f59e0b 50%, var(--surface) 50%); box-shadow: inset 0 0 0 2px #f59e0b; }
.presence-dot.is-offline { background: var(--surface); box-shadow: inset 0 0 0 2px #94a3b8; }
.mqv-top { position: relative; }
.mqv-presence { position: relative; width: 0; align-self: flex-end; }
.mqv-presence .presence-dot { right: 4px; bottom: 4px; width: 14px; height: 14px; }
.mqv-status { margin: 2px 0 0; font-size: 12.5px; font-weight: 600; opacity: 0.9; }
.set-switch-row { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }

/* Chỉ số giờ ở Báo cáo › Đội nhóm › Thời gian (reports.js rt*) */
.rt-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 16px; }
.rt-legend div { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.rt-legend b { font-size: 13px; color: var(--ink); }
.rt-period-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.rt-period-head h2 { margin: 0; }
.rt-table th, .rt-table td { white-space: nowrap; }
.rt-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }

/* Mẫu dự án (projects.js ptpl*) — dùng lại khung của Mẫu công việc (.tpl-*) */
.ptpl-open-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--border); }
.ptpl-open-line .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
.ptpl-people { display: flex; flex-direction: column; gap: 6px; }
.ptpl-person { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.ptpl-person .form-control { width: 100%; }
.ptpl-from { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.ptpl-arrow { color: var(--muted); }
.ptpl-tag { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; font-size: 11.5px; color: var(--danger-600); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.ptpl-row .tpl-row-line { gap: 4px 12px; }
.ptpl-name { flex: 1 1 200px; min-width: 0; font-size: 13.5px; color: var(--ink); }
.ptpl-dates { min-width: 110px; text-align: right; }
.ptpl-wf { margin-top: 10px; }
@media (max-width: 640px) {
  .ptpl-person { grid-template-columns: 1fr; gap: 2px; }
  .ptpl-arrow { display: none; }
  .ptpl-dates { min-width: 0; text-align: left; }
}

/* Tab Workload của dự án (reports.js workloadViewHTML): như tab Biểu mẫu, không dùng Tìm / Lọc / Thêm Việc */
.wl-proj-view { display: none; }
.page-view:has(input[id$="-workload"]:checked) .wl-proj-view { display: block; }
.page-view:has(input[id$="-workload"]:checked) :is(.kanban-board, .task-list-view, .calendar-view, .workflow-view, .gantt-view, .overview-view,
  .empty-state.is-no-results, .active-filters, .sf-bar, .tf-editor, .pv-filter-note, .wf-board-note, .project-empty-hint, .project-progress-bar) { display: none; }
.page-view:has(input[id$="-workload"]:checked) .toolbar :is(.search-field, .tf-wrap, .tb-add-task) { display: none; }
.wl-proj-view .report-toolbar { margin-top: 4px; }

/* Thanh công cụ của Phân bổ / tab Workload: gọn như ClickUp — mọi nút, ô chọn cao 30px, chữ 13px */
.wl-toolbar { align-items: center; gap: 6px 12px; margin-bottom: 8px; }
.wl-toolbar .report-filters { gap: 6px; }
.wl-toolbar :is(.btn-secondary, .icon-btn, .form-control, .report-select, .wl-span) {
  height: 30px; min-height: 30px; padding-top: 0; padding-bottom: 0; border-radius: 6px; font-size: 13px; font-weight: 500; line-height: 1;
}
.wl-toolbar :is(.btn-secondary, .form-control, .report-select) { padding-left: 10px; padding-right: 10px; display: inline-flex; align-items: center; gap: 5px; }
.wl-toolbar select.form-control, .wl-toolbar .report-select { padding-right: 26px; }
.wl-toolbar .icon-btn { width: 30px; padding: 0; display: inline-grid; place-items: center; }
.wl-toolbar .wl-range { font-size: 13px; font-weight: 600; }
.wl-toolbar .wl-span { display: inline-flex; align-items: center; padding: 2px; }
.wl-toolbar .wl-span-btn { height: 24px; padding: 0 9px; font-size: 13px; font-weight: 500; }
.wl-toolbar svg { width: 13px; height: 13px; }

/* Hộp thoại ngày nghỉ kiểu ClickUp (reports.js renderLeaveForm) */
.lv-sub { margin: -6px 0 14px; font-size: 13.5px; color: var(--muted); }
.lv-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; }
.lv-left, .lv-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lv-who { display: flex; align-items: center; gap: 8px; margin: 0; }
.lv-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lv-chip-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lv-chip-label { font-size: 13px; color: var(--muted); }
.lv-chip { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 2px solid transparent; border-radius: 8px; background: var(--bg); font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lv-chip.is-active { border-color: var(--primary); background: var(--surface); }
.lv-chip:disabled { cursor: default; }
.lv-cal-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; font-size: 15px; }
.lv-cal-nav { display: inline-flex; align-items: center; gap: 2px; }
.lv-today { border: 0; background: none; font: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.lv-today:hover { background: var(--bg); }
.lv-cal-nav .icon-btn { width: 28px; height: 28px; }
.lv-cal-nav .icon-btn:last-child svg { transform: none; }
.lv-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; text-align: center; }
.lv-dow { padding: 6px 0; font-size: 13px; color: var(--muted); }
.lv-day { position: relative; height: 36px; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.lv-day span { position: relative; z-index: 1; display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 8px; }
.lv-day:hover:not(:disabled) span { background: var(--bg); }
.lv-day.is-out { color: var(--muted); opacity: 0.6; }
.lv-day.is-range { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.lv-day.has-range-r { background: linear-gradient(90deg, transparent 50%, color-mix(in srgb, var(--primary) 16%, transparent) 50%); }
.lv-day.has-range-l { background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 16%, transparent) 50%, transparent 50%); }
.lv-day.is-today span { border-radius: 50%; background: var(--danger-600); color: #fff; }
.lv-day.is-start span, .lv-day.is-end span { border-radius: 8px; background: var(--primary-600); color: #fff; }
.lv-day:focus-visible { outline: 2px solid var(--primary-600); outline-offset: -2px; }
.lv-day:disabled { cursor: default; }
.lv-total { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.lv-total b { font-size: 15px; color: var(--ink); font-weight: 600; }
.lv-kinds .wlp-kind { padding: 10px 12px; }
.lv-note-ro { margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; }
.lv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px -20px -20px; padding: 14px 20px; border-top: 1px solid var(--border-soft); background: var(--bg); border-radius: 0 0 var(--radius-lg, 14px) var(--radius-lg, 14px); }
.lv-foot-btns { display: inline-flex; align-items: center; gap: 8px; }
.lv-del { border: 0; background: none; padding: 6px 4px; font: inherit; font-size: 14px; color: var(--danger-600); cursor: pointer; }
.lv-del:hover { text-decoration: underline; }
.lv-cancel { cursor: pointer; }
.lv-err { margin: 10px 0 0; }
@media (max-width: 680px) {
  .lv-cols { grid-template-columns: 1fr; }
  .lv-foot { flex-wrap: wrap; }
}

/* Dòng "Khác" của loại nghỉ: ô nhập lý do nằm ngay trong dòng (như "Enter custom type" của ClickUp) */
.wlp-kind-other { cursor: text; }
.wlp-kind-input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 0; font: inherit; font-size: inherit; color: var(--ink); }
.wlp-kind-input::placeholder { color: var(--muted); }
.wlp-kind-other:has(.has-error), .form-field.has-error .wlp-kind-other { border-color: var(--danger-600); }
.leave-modal-box .modal-body { overflow-x: hidden; }

/* Popup trên timeline: ô đã chọn giữ màu xanh, thanh cuộn mảnh xám như ClickUp */
.wlb-ghost.is-selected { border: 0; background: color-mix(in srgb, var(--primary) 22%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent); }
.wlb-new-pop, .wlp-body, .wlp-list, .wlb-tip, .leave-modal-box .modal-body { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }

/* ---------- Trợ lý định kỳ (Tự động hóa › Trợ lý định kỳ, automations.js agent*) ---------- */
.agent-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.agent-head > div { flex: 1 1 320px; min-width: 0; }
.agent-head h2 { color: var(--primary-600); }
.agent-item { border-left-color: var(--primary); }
.agent-item:hover { border-color: var(--primary-100); border-left-color: var(--primary-600); }
.agent-item .rec-item-next { color: var(--primary-600); }
.agent-item-tools { flex: none; display: flex; align-items: center; gap: 8px; }
.agent-paused { font-size: 12.5px; color: var(--warning-700); }
.agent-modal-box { width: min(640px, calc(100vw - 32px)); height: min(780px, calc(100vh - 32px)); }
.agent-form { display: flex; flex-direction: column; gap: 12px; }
.agent-form .form-field { margin: 0; }
.agent-form label small { font-weight: 500; color: var(--muted); }
.agent-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.agent-tpl { margin: 0; padding: 8px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); font-size: 13.5px; color: var(--ink-soft); }
.agent-people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; max-height: 200px; overflow: auto; margin-top: 6px; padding: 6px 2px; }
.agent-people .ar-check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.agent-preview { margin-top: 16px; }
.agent-report { display: flex; flex-direction: column; gap: 12px; }
.agent-meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.agent-summary { position: relative; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--primary-50); font-size: 13.5px; line-height: 1.55; }
.agent-summary p { margin: 0 0 4px; }
.agent-summary ul { margin: 0; padding-left: 18px; }
.agent-badge { display: inline-block; margin-bottom: 6px; padding: 1px 8px; border-radius: 999px; background: var(--surface); font-size: 11px; font-weight: 700; color: var(--primary-600); }
.agent-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.agent-tile { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); }
.agent-tile span { font-size: 12px; color: var(--muted); }
.agent-tile b { font-size: 20px; color: var(--ink); }
.agent-tile.is-danger b { color: var(--danger-600); }
.agent-tile.is-warn b { color: var(--warning-700); }
.agent-sec h4 { margin: 0 0 4px; font-size: 13.5px; color: var(--ink); }
.agent-sec h4 span { font-weight: 500; color: var(--muted); }
.agent-tasks, .agent-sug { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.agent-reason { color: var(--ink-soft); }
.agent-who { color: var(--muted); }
.agent-sec .btn-secondary { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
@media (max-width: 640px) {
  .agent-item { flex-direction: column; }
  .agent-item-tools { align-self: flex-end; }
  .agent-modal-box { width: 100vw; }
}
section.is-overdue,section.is-blocked , section.is-review{
  height: 400px;
    overflow: auto;
}
/* ---------- Thẻ "Khối lượng theo trạng thái" (biểu đồ vòng, rộng 1/3) + popup lớn (overview.js ovDonut*, renderOvChartModal) ---------- */
.ov-donut-card { grid-column: span 4; min-height: 320px; }
/* Biểu đồ to + nằm giữa phần trống của thẻ, chú thích 4 trạng thái luôn ở đáy thẻ */
.ov-donut-card .ovd-wrap { flex: 1; align-items: center; margin-top: 8px; }
.ov-donut-card h2 .ovd-expand { margin-left: auto; width: 28px; height: 28px; opacity: 0; transition: opacity 0.15s ease; }
.ov-donut-card:hover .ovd-expand, .ovd-expand:focus-visible { opacity: 1; }
.ovd-wrap { position: relative; display: flex; justify-content: center; cursor: pointer; }
.ovd-svg { max-width: 100%; height: auto; overflow: visible; }
.ovd-seg { cursor: pointer; outline: none; transition: transform 0.18s ease, opacity 0.18s ease; }
.ovd-seg path { stroke: var(--surface); stroke-width: 2; }
/* Rê vào 1 phần: phần đó bật ra theo hướng tâm, phần còn lại mờ đi */
.ovd-svg:has(.ovd-seg:hover) .ovd-seg:not(:hover) { opacity: 0.45; } /* chỉ khi đúng trên 1 phần, rê vào lỗ giữa không mờ cả vòng */
.ovd-seg:hover, .ovd-seg:focus-visible, .ovd-seg.is-on { transform: translate(var(--dx), var(--dy)); }
.ovd-seg:focus-visible path { stroke: var(--ink); }
.ovd-pct { font-size: 9px; font-weight: 400; fill: #0f172a; pointer-events: none; } /* ~11.5px trên thẻ (biểu đồ 286px phóng từ khung 220) */
.ovd-total { font-size: 34px; font-weight: 700; fill: var(--ink); }
.ovd-unit { font-size: 12px; fill: var(--muted); }
.ovd-tip {
  position: absolute; z-index: 3; display: none; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); box-shadow: var(--shadow-sm); font-size: 12.5px; color: var(--ink); white-space: nowrap; pointer-events: none;
}
.ovd-tip.is-on { display: block; }
.ovd-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: auto 0 0; padding: 12px 0 0; list-style: none; font-size: 12.5px; color: var(--ink-soft); }
.ovd-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ovd-legend b { color: var(--ink); }
.ovch-box { width: min(1240px, calc(100vw - 32px)); max-width: none; height: min(820px, calc(100vh - 32px)); max-height: none; display: flex; flex-direction: column; }
.ovch-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.ovch-left { display: flex; flex-direction: column; gap: 12px; padding: 18px 24px; overflow: auto; }
.ovch-left .ovd-wrap { flex: 1; align-items: center; }
.ovch-left .ovd-pct { font-size: 6.5px; } /* ~12.5px ở popup (biểu đồ 420px) */
.ovch-crumb { margin: 0; font-size: 12.5px; color: var(--muted); }
.ovch-right { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border-soft); background: var(--bg); }
.ovch-tabs { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-bottom: 1px solid var(--border-soft); }
.ovch-st { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: 13.5px; color: var(--ink-soft); text-align: left; cursor: pointer; }
.ovch-st span { flex: 1; }
.ovch-st b { color: var(--ink); }
.ovch-st small { min-width: 44px; text-align: right; color: var(--muted); }
.ovch-st:hover:not(:disabled) { background: var(--surface); }
.ovch-st.is-on { border-color: var(--primary); background: var(--surface); color: var(--ink); font-weight: 600; }
.ovch-st:disabled { cursor: default; opacity: 0.5; }
.ovch-list-head { padding: 10px 14px 6px; font-size: 13px; color: var(--ink-soft); }
.ovch-list { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 12px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.ovch-task { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.ovch-task:hover { background: var(--surface); }
.ovch-task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ovch-task-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovch-task-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); }
.ovch-none { color: var(--muted); }
@media (max-width: 1100px) { .ov-donut-card { grid-column: span 6; } }
@media (max-width: 760px) {
  .ov-donut-card { grid-column: span 12; min-height: 0; }
  .ovch-box { width: 100vw; height: 100dvh; border-radius: 0; }
  .ovch-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); overflow: auto; }
  .ovch-right { border-left: 0; border-top: 1px solid var(--border-soft); }
}
@media (prefers-reduced-motion: reduce) { .ovd-seg, .ov-donut-card h2 .ovd-expand { transition: none; } }
/* ---------- Thẻ "Xu hướng chậm tiến độ trung bình" (2/3) + "Tình trạng tiến độ" (1/6) (overview.js ovTrendCardHTML / ovProgressCardHTML) ---------- */
.ov-trend-card { grid-column: span 8; min-height: 320px; }
.ov-prog-card { grid-column: span 3; min-height: 320px; }
/* Thẻ rộng 1/4: vòng ở trên, chú thích 2 dòng ở dưới (như thẻ Khối lượng theo trạng thái) */
.ovpg-row { flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-height: 0; }
.ovpg-row > .ovpg-wrap { flex: 1; }
.ovpg-row > .ovpg-wrap .ovpg-svg { max-width: 220px; }
.ovpg-row > .ovpg-legend { flex: none; min-width: 0; }
.ovtr-body { flex: 1; display: flex; align-items: center; gap: 16px; min-height: 0; }
.ovtr-chart { flex: 1; min-width: 0; }
.ovtr-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ovtr-grid { stroke: var(--border-soft); stroke-width: 1; }
.ovtr-grid.is-zero { stroke: var(--border); }
.ovtr-axis { font-size: 11px; fill: var(--muted); }
.ovtr-area { fill: color-mix(in srgb, var(--danger) 14%, transparent); }
.ovtr-line { fill: none; stroke: var(--danger-600); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ovtr-hit { fill: transparent; }
.ovtr-dot { fill: var(--success); stroke: var(--surface); stroke-width: 2; transition: r 0.15s ease; }
.ovtr-dot.is-late { fill: var(--danger-600); }
.ovtr-val { font-size: 12px; font-weight: 700; }
.ovtr-val.is-late { fill: var(--danger-600); }
.ovtr-val.is-ok { fill: var(--success-700); }
/* Rê 1 điểm: điểm đó to ra, các điểm khác mờ đi; bấm mở popup */
.ovtr-pt { cursor: pointer; outline: none; transition: opacity 0.15s ease; }
.ovtr-svg:hover .ovtr-pt:not(:hover) { opacity: 0.4; }
.ovtr-pt:hover .ovtr-dot, .ovtr-pt:focus-visible .ovtr-dot { r: 7; }
.ovtr-pt:focus-visible .ovtr-dot { stroke: var(--ink); }
.ovtr-side { flex: 0 0 168px; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--bg); text-align: center; }
.ovtr-now { display: flex; flex-direction: column; gap: 4px; padding: 6px 4px 10px; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: transparent; font: inherit; cursor: pointer; transition: background 0.15s ease; }
.ovtr-now:hover, .ovtr-now:focus-visible { background: var(--surface); outline: none; }
.ovtr-now span, .ovtr-prev > span:first-child { font-size: 12.5px; color: var(--ink-soft); }
.ovtr-now b { font-size: 26px; font-weight: 700; }
.ovtr-now b.is-late { color: var(--danger-600); }
.ovtr-now b.is-ok { color: var(--success-700); }
.ovtr-prev { display: flex; flex-direction: column; gap: 4px; }
.ovtr-cmp { font-size: 13px; font-weight: 600; color: var(--muted); }
.ovtr-cmp.is-late { color: var(--danger-600); }
.ovtr-cmp.is-ok { color: var(--success-700); }
/* Thẻ hẹp: biểu đồ vòng ở trên, 2 dòng chú thích ở dưới */
.ovpg-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 6px 0; }
.ovpg-svg { width: 100%; max-width: 180px; height: auto; overflow: visible; }
.ovpg-seg { cursor: pointer; outline: none; transition: opacity 0.15s ease; }
/* Chỉ làm mờ các phần còn lại khi chuột / bàn phím đang ĐÚNG trên 1 phần (rê vào lỗ giữa không làm mờ cả vòng);
   không phình nét (16 -> 20 làm phần đang chọn trồi ra ngoài vòng, mép chồng sang phần bên cạnh) */
.ovpg-svg:has(.ovpg-seg:hover) .ovpg-seg:not(:hover), .ovpg-svg:has(.ovpg-seg:focus-visible) .ovpg-seg:not(:focus-visible) { opacity: 0.4; }
.ovpg-total { font-size: 26px; font-weight: 700; fill: var(--ink); }
.ovpg-unit { font-size: 9px; fill: var(--muted); }
.ovpg-legend { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ovpg-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; font-size: 12.5px; color: var(--ink-soft); text-align: left; cursor: pointer; }
.ovpg-item span { flex: 1; min-width: 0; }
.ovpg-item b { color: var(--ink); white-space: nowrap; }
.ovpg-item small { font-weight: 400; color: var(--muted); }
.ovpg-item:hover:not(:disabled), .ovpg-item:focus-visible { background: var(--bg); outline: none; }
.ovpg-item:disabled { cursor: default; opacity: 0.5; }
/* ---------- Thẻ "Phân bổ theo mức ưu tiên" (rộng 1/3, overview.js ovPriority*) ---------- */
.ov-prio-card { grid-column: span 4; min-height: 320px; }
.ovpr { --ovpr-h: 190px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.ovpr-avg-label { align-self: flex-end; font-size: 12.5px; color: var(--ink-soft); }
.ovpr-avg-label b { color: var(--ink); }
.ovpr-chart { display: flex; gap: 8px; margin-top: 18px; }
.ovpr-axis { position: relative; flex: 0 0 22px; height: var(--ovpr-h); font-size: 11px; color: var(--muted); text-align: right; }
.ovpr-axis span { position: absolute; right: 0; transform: translateY(50%); }
.ovpr-plot { position: relative; flex: 1; min-width: 0; display: flex; height: var(--ovpr-h); border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(to top, transparent 0 calc(var(--ovpr-h) / 3 - 1px), var(--border-soft) calc(var(--ovpr-h) / 3 - 1px) calc(var(--ovpr-h) / 3)); }
.ovpr-avg { position: absolute; left: 0; right: 0; z-index: 2; border-top: 2px dashed var(--danger-600); pointer-events: none; }
.ovpr-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; transition: opacity 0.15s ease; }
.ovpr-stack { position: relative; display: flex; flex-direction: column-reverse; width: min(48px, 56%); min-height: 2px; }
.ovpr-seg { display: block; width: 100%; min-height: 3px; padding: 0; border: 0; cursor: pointer; }
.ovpr-stack .ovpr-seg:last-of-type { border-radius: 4px 4px 0 0; } /* phần trên cùng bo góc */
.ovpr-total { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding: 0 4px 3px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink); cursor: pointer; }
.ovpr-name { position: absolute; top: calc(100% + 6px); max-width: 100%; padding: 0 4px; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
/* Rê 1 cột: cột đó nổi bật, cột khác mờ, hiện khung số theo trạng thái */
.ovpr-plot:hover .ovpr-col:not(:hover), .ovpr.has-sel .ovpr-col:not(.is-on) { opacity: 0.45; }
.ovpr-col:hover .ovpr-stack, .ovpr-col.is-on .ovpr-stack { filter: brightness(1.05) drop-shadow(0 2px 6px rgba(15, 23, 42, 0.18)); }
.ovpr-seg:focus-visible, .ovpr-total:focus-visible, .ovpr-name:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ovpr-tip {
  position: absolute; top: 0; left: 50%; z-index: 5; display: none; flex-direction: column; gap: 3px; min-width: 140px; padding: 8px 10px;
  transform: translate(-50%, -12px); border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-md);
  font-size: 12px; color: var(--ink-soft); white-space: nowrap; pointer-events: none;
}
.ovpr-col:hover .ovpr-tip, .ovpr-col:focus-within .ovpr-tip { display: flex; }
.ovpr-tip > b { font-size: 12px; color: var(--ink); }
.ovpr-tip span { display: flex; align-items: center; gap: 6px; }
.ovpr-tip span i, .ovpr-legend i { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.ovpr-tip em { margin-top: 4px; font-style: italic; color: var(--ink); }
.ovpr-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 34px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--ink-soft); }
.ovpr-legend li { display: inline-flex; align-items: center; gap: 5px; }
.ovch-left .ovpr-big { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.ovch-left .ovpr-big .ovpr { --ovpr-h: 380px; flex: none; }
@media (max-width: 1100px) { .ov-prio-card { grid-column: span 6; } }
@media (max-width: 760px) { .ov-prio-card { grid-column: span 12; min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .ovpr-col { transition: none; } }
/* Chiều cao chung của mọi thanh công cụ (dự án, Tổng quan, Đã đánh dấu, Thành viên › Mọi người / Nhóm / Vai trò, Báo cáo…):
   + hàng nút đầu trang dự án (Trợ lý AI, Mời, Tài liệu, Nhật ký, Thùng rác, ⋯) và đầu trang Dự án (ô tìm, Trợ lý AI, Thêm dự án):
   nút, ô chọn, ô tìm, nút Lọc, nút đổi dạng xem đều cao bằng nút phụ "Làm mới" / "Cập nhật" (--toolbar-h) */
:root { --toolbar-h: 32px; }
:is(.toolbar, .report-filters, .rep-head-tools, .ord-filter, .roles-head, .ov-scopebar, .project-header-actions, .pl-page-head) :is(.btn-primary, .btn-secondary, .filter-btn, select.form-control, input.form-control, .cselect-btn.form-control) { box-sizing: border-box; height: var(--toolbar-h); padding-top: 0; padding-bottom: 0; }
.toolbar .search-field:not(.ts-box), .page-view .toolbar .search-field:not(.ts-box) { box-sizing: border-box; height: var(--toolbar-h); padding-top: 0; padding-bottom: 0; }
.toolbar .ts-box, .page-view .toolbar .ts-box, .pl-page-head .ts-box { box-sizing: border-box; min-height: var(--toolbar-h); padding-top: 3px; padding-bottom: 3px; }
:is(.toolbar, .ov-scopebar, .project-header-actions, .pl-page-head) .icon-btn { width: var(--toolbar-h); height: var(--toolbar-h); }
.toolbar .member-layout-toggle { box-sizing: border-box; height: var(--toolbar-h); align-items: center; padding: 2px; }
.toolbar .member-layout-btn { height: calc(var(--toolbar-h) - 6px); }
/* Nút Lọc chỉ có icon (chữ cho trình đọc màn hình): vuông như nút icon, số điều kiện đang lọc ở chấm góc trên phải */
.filter-btn.is-icon { position: relative; box-sizing: border-box; width: var(--toolbar-h); height: var(--toolbar-h); padding: 0; justify-content: center; flex-shrink: 0; }
.filter-btn.is-icon .role-filter-badge { position: absolute; top: -6px; right: -6px; }

/* Nút lọc Phạm vi / Loại đầu tab Tổng quan (overview.js ovScopeFilterHTML) + bảng chọn có ô vuông */
.ov-sf { position: relative; flex-shrink: 0; }
.ov-sf-btn.is-on { color: var(--primary-600); background: var(--primary-50); border-color: var(--primary); }
.ov-sf-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; display: flex; flex-direction: column; gap: 8px; width: 220px; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); animation: setOpen 0.15s ease;
}
.ov-sf-group + .ov-sf-group { padding-top: 8px; border-top: 1px solid var(--border-soft); }
.ov-sf-title { margin: 0 4px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ov-sf-opt { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.ov-sf-opt:hover { background: var(--bg); }
.ov-sf-opt.is-on { color: var(--ink); font-weight: 600; }
.ov-sf-opt input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .ov-sf-pop { animation: none; } }

/* Nút lọc thời gian góc phải tiêu đề thẻ biểu đồ (overview.js ovRangeBtnHTML) + bảng chọn */
.ov-rg { position: relative; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ovd-expand + .ov-rg { margin-left: 0; }
.ov-rg-btn { width: 28px; height: 28px; }
.ov-rg-btn.is-on { color: var(--primary-600); background: var(--primary-50); border-color: var(--primary); }
.ov-rg-chip { max-width: 140px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--primary-50); font-size: 11.5px; font-weight: 600; color: var(--primary-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-rg-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 236px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.14));
  font-size: 13px; font-weight: 400; color: var(--ink); animation: setOpen 0.15s ease;
}
.ov-rg-hint { margin: 2px 4px 6px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.ov-rg-opt { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 7px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; color: var(--ink-soft); text-align: left; cursor: pointer; }
.ov-rg-opt:hover, .ov-rg-opt:focus-visible { background: var(--bg); outline: none; }
.ov-rg-opt.is-on { color: var(--primary-600); font-weight: 600; }
.ov-rg-custom { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding: 8px 4px 2px; border-top: 1px solid var(--border-soft); }
.ov-rg-custom label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.ov-rg-custom .form-error-text { margin: 0; }
@media (prefers-reduced-motion: reduce) { .ov-rg-pop { animation: none; } }
/* Popup của 2 thẻ (renderOvPlanModal): biểu đồ lớn bên trái, mục đang chọn nổi bật, phần khác mờ */
.ovch-left .ovtr-body.is-big { flex: 1; }
.ovch-left .ovpg-wrap.is-big { flex: 1; }
.ovpg-wrap.is-big .ovpg-svg { max-width: 400px; }
.ovtr-svg.has-sel .ovtr-pt:not(.is-on) { opacity: 0.45; }
.ovtr-pt.is-on .ovtr-dot { r: 7; stroke: var(--ink); }
.ovpg-svg.has-sel .ovpg-seg:not(.is-on) { opacity: 0.4; }
.ovch-st small.is-late { color: var(--danger-600); }

@media (max-width: 1280px) { .ov-prog-card { grid-column: span 4; } }
@media (max-width: 1100px) { .ov-trend-card { grid-column: span 12; } .ov-prog-card { grid-column: span 6; } }
@media (max-width: 760px) {
  .ov-trend-card, .ov-prog-card { grid-column: span 12; min-height: 0; }
  .ovtr-body { flex-direction: column; align-items: stretch; }
  .ovtr-side { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .ovtr-pt, .ovtr-dot, .ovpg-seg, .ovtr-now { transition: none; } }
/* ---------- Thẻ "Tốc độ hoàn thành theo tuần" + "Luồng công việc tích lũy" (rộng 1/2, overview.js ovVelocity* / ovFlow*) ---------- */
.ov-velo-card, .ov-flow-card { grid-column: span 6; min-height: 320px; }
.ovv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.ovv-legend, .ovf-legend { margin: 0; justify-content: flex-start; }
.ovv-legend i { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.ovv-key-plan { background: var(--border); }
.ovv-key-done { background: var(--primary); }
.ovv-chart { flex: 1; display: flex; align-items: center; min-height: 0; margin-top: 8px; }
.ovv-svg, .ovf-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ovv-hit { fill: transparent; }
.ovv-plan { fill: var(--border); }
.ovv-done { fill: var(--primary); }
.ovv-line-plan { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 4; pointer-events: none; }
.ovv-line-done { fill: none; stroke: var(--primary-600); stroke-width: 2; stroke-linejoin: round; pointer-events: none; }
.ovv-dot-plan { fill: var(--ink-soft); pointer-events: none; }
.ovv-dot-done { fill: var(--primary-600); pointer-events: none; }
.ovv-wk { cursor: pointer; outline: none; transition: opacity 0.15s ease; }
.ovv-svg:hover .ovv-wk:not(:hover), .ovv-svg.has-sel .ovv-wk:not(.is-on) { opacity: 0.45; }
.ovv-wk:focus-visible .ovv-hit { stroke: var(--primary); stroke-width: 2; }
.ovf-area { fill-opacity: 0.85; transition: fill-opacity 0.15s ease; }
.ovf-svg.has-sel .ovf-area:not(.is-on) { fill-opacity: 0.25; }
.ovf-since { stroke: var(--ink-soft); stroke-width: 1.5; stroke-dasharray: 4 4; }
/* ---------- Thẻ "Khối lượng theo nhân viên" (rộng 1/2, overview.js ovWorkload*): cột trên + slide thẻ người dưới ---------- */
.ov-wl-card { --ovw-green: #5ccf4f; --ovw-track: #e9e9ef; grid-column: span 6; min-width: 0; scrollbar-color: var(--scroll-thumb) transparent; }
.ovw-top { display: flex; gap: 10px; padding: 6px 2px 8px; margin-bottom: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); overflow-x: auto; scrollbar-width: thin; }
.ovw-top::-webkit-scrollbar { height: 6px; }
.ovw-top::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--scroll-thumb); }
.ovw-col { flex: 1 0 calc((100% - 80px) / 9); min-width: 40px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0 4px; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; }
.ovw-col:hover, .ovw-col:focus-visible { background: var(--bg); outline: none; }
.ovw-bar { position: relative; display: block; width: 8px; height: 150px; border-radius: 4px; background: var(--ovw-track); overflow: hidden; }
.ovw-bar i { position: absolute; left: 0; right: 0; bottom: 0; min-height: 0; border-radius: 4px; background: var(--ovw-green); }
.ovw-col .ov-avatar, .ovw-who .ov-avatar { width: 34px; height: 34px; font-size: 12px; }
.ovw-slider { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ovw-nav { flex: none; width: 30px; height: 30px; font-size: 20px; line-height: 1; }
.ovw-track { flex: 1; min-width: 0; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab; user-select: none; }
.ovw-track::-webkit-scrollbar { display: none; }
.ovw-track.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.ovw-slide { flex: 0 0 calc((100% - 12px) / 2); min-width: 0; padding: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--surface); scroll-snap-align: start; box-sizing: border-box; }
.ovw-who { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; margin-bottom: 12px; padding: 2px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.ovw-who:hover, .ovw-who:focus-visible { background: var(--bg); outline: none; }
.ovw-col.is-on { background: color-mix(in srgb, var(--ovw-green) 14%, transparent); }
.ovw-col.is-on .ov-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ovw-green); }
.ovw-slide.is-on { border-color: var(--ovw-green); box-shadow: 0 0 0 1px var(--ovw-green); }
/* Trong popup: khối to hơn, nằm giữa khung trái */
.ovw.is-big { --ovw-green: #5ccf4f; --ovw-track: #e9e9ef; flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.ovw.is-big .ovw-bar { height: 220px; }
.ovch-list-head-top .ov-avatar { width: 24px; height: 24px; vertical-align: middle; }
.ovw-who b { font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ovw-body { display: flex; align-items: center; gap: 8px; }
.ovw-num { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 4px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.ovw-num:hover, .ovw-num:focus-visible { background: var(--bg); outline: none; }
.ovw-num b { font-size: 20px; font-weight: 600; color: var(--ink); }
.ovw-num span { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.ovw-ring { flex: none; width: 76px; height: 76px; }
.ovw-ring-bg, .ovw-ring-fg { fill: none; stroke-width: 7; }
.ovw-ring-bg { stroke: var(--ovw-track); }
.ovw-ring-fg { stroke: var(--ovw-green); stroke-linecap: round; }
.ovw-ring-txt { font-size: 14px; font-weight: 500; fill: var(--ink); }
@media (max-width: 760px) { .ov-wl-card { grid-column: span 12; } }
@media (max-width: 480px) { .ovw-slide { flex-basis: 100%; } }
.ovf-wrap { position: relative; width: 100%; }
.ovf-area { cursor: pointer; outline: none; }
.ovf-svg:has(.ovf-area:hover) .ovf-area:not(:hover) { fill-opacity: 0.3; }
.ovf-svg.has-sel .ovf-area:hover, .ovf-svg .ovf-area:hover, .ovf-svg .ovf-area:focus-visible { fill-opacity: 1; }
.ovf-area:focus-visible { stroke: var(--ink); stroke-width: 1.5; }
.ovf-guide { stroke: var(--ink-soft); stroke-width: 1; opacity: 0; pointer-events: none; }
.ovf-wrap.is-tip .ovf-guide { opacity: 0.6; }
.ovf-tip {
  position: absolute; z-index: 5; display: none; flex-direction: column; gap: 3px; min-width: 110px; padding: 8px 10px;
  transform: translate(-50%, calc(-100% - 14px)); border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-md);
  font-size: 12px; color: var(--ink-soft); white-space: nowrap; pointer-events: none;
}
.ovf-wrap.is-tip .ovf-tip { display: flex; }
.ovf-tip > b { color: var(--ink); }
.ovf-tip span { display: flex; align-items: center; gap: 6px; }
.ovf-tip span.is-on { color: var(--ink); font-weight: 600; }
.ovf-tip i { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.ovf-key { display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px; border: 0; border-radius: var(--radius-sm); background: transparent; font: inherit; color: inherit; cursor: pointer; }
.ovf-key i { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.ovf-key b { color: var(--ink); }
.ovf-key:hover, .ovf-key:focus-visible { background: var(--bg); outline: none; }
.ovch-left .ovv-big { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
@media (max-width: 480px) { .ov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .ov-velo-card, .ov-flow-card { grid-column: span 12; min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .ovv-wk, .ovf-area { transition: none; } }
/* Popup của thẻ số: tên + số rất lớn ở giữa khung trái */
.ovch-title { margin: 8px 0 0; font-size: 22px; font-weight: 600; color: var(--ink); }
.ovch-bignum { flex: 1; display: grid; place-items: center; font-size: clamp(72px, 9vw, 120px); font-weight: 500; line-height: 1; color: var(--ink); }
.ovch-list-head-top { padding-top: 14px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.ovch-count { margin-left: 6px; font-weight: 700; color: var(--ink); }
/* Popup "Việc chưa hoàn thành theo người phụ trách": đủ các cột, cột đang xem nổi bật, cột khác mờ */
.ovab { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-x: auto; scrollbar-width: thin; }
.ovab-unit { margin: 4px 0 10px; font-size: 12.5px; color: var(--muted); }
.ovab-plot { position: relative; flex: 1; min-height: 240px; max-height: 420px; margin: 24px 0 52px 32px; }
.ovab-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--border-soft); }
.ovab-line span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11.5px; color: var(--muted); }
.ovab-cols { position: absolute; inset: 0; display: flex; justify-content: space-around; gap: 12px; }
.ovab-col {
  position: relative; flex: 1 0 56px; max-width: 140px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 0; border: 0; border-radius: 6px 6px 0 0; background: transparent; font: inherit; cursor: pointer;
}
.ovab-bar { position: relative; display: block; width: 62%; min-height: 3px; border-radius: 6px 6px 0 0; opacity: .35; transition: opacity .15s; }
.ovab-bar b { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--ink); }
.ovab-col:hover .ovab-bar { opacity: .6; }
.ovab-col.is-on .ovab-bar { opacity: 1; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary-100); }
.ovab-col:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.ovab-name { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--ink-soft); }
.ovab-name > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovab-col.is-on .ovab-name { color: var(--ink); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .ovab-bar { transition: none; } }
/* Popup "Phân bổ công việc theo người phụ trách": chú thích bấm được dưới vòng lớn */
.ovap-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ovap-item { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 5px 10px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.ovap-item > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovap-item b { color: var(--ink); }
.ovap-item small { color: var(--muted); }
.ovap-item:hover { background: var(--bg); }
.ovap-item.is-on { border-color: var(--primary); background: var(--primary-50, var(--bg)); color: var(--ink); font-weight: 600; }
.ovap-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
/* Popup "Công việc theo trạng thái": thanh ngang lớn, lưới dọc + trục 0–100% */
.ovb-wrap { flex: 1; flex-direction: column; justify-content: center; padding: 0 12px; cursor: default; }
.ovch-left .ovb-wrap { align-items: stretch; } /* thanh trải hết bề ngang khung trái (khung biểu đồ vòng thì căn giữa) */
.ovb-plot { position: relative; height: 280px; }
.ovb-plot > i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border-soft); }
.ovb-bar { position: absolute; left: 0; right: 0; top: 50%; display: flex; height: 160px; transform: translateY(-50%); border-radius: 6px; overflow: hidden; }
.ovb-seg { display: grid; place-items: center; min-width: 4px; padding: 0; border: 0; border-right: 2px solid var(--surface); font: inherit; font-size: 12.5px; color: #0f172a; cursor: pointer; transition: opacity 0.15s ease, filter 0.15s ease; }
.ovb-seg:last-child { border-right: 0; }
.ovb-bar:hover .ovb-seg:not(:hover) { opacity: 0.5; }
.ovb-seg.is-on { filter: saturate(1.2) brightness(0.95); box-shadow: inset 0 0 0 3px rgba(15, 23, 42, 0.55); }
.ovb-seg:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--ink); }
.ovb-axis { position: relative; height: 22px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.ovb-axis span { position: absolute; transform: translateX(-50%); }
.ovb-caption { margin-top: 4px; text-align: center; font-size: 12.5px; color: var(--muted); }
/* Danh sách việc trong popup = bảng của thẻ "Đến hạn tuần này"; cột phải rộng hơn để bảng đủ chỗ */
.ovch-body { grid-template-columns: minmax(0, 1fr) 560px; }
/* Thẻ "Tổng quan các dự án" (Portfolio): rộng cả hàng, cao 400px; bảng cột tỷ lệ cố định, cuộn ngang khi hẹp */
.ov-portfolio { grid-column: 1 / -1; height: 400px; min-width: 0; }
.ov-portfolio > h2 .pf-expand { margin-left: auto; width: 28px; height: 28px; }
.pf-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.pf-table { width: 100%; }
.pf-row { display: grid; grid-template-columns: var(--pf-cols); align-items: center; min-height: 52px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.pf-row:not(.pf-head):hover { background: var(--bg); }
.pf-row:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--primary-100); }
.pf-head { position: sticky; top: 0; z-index: 2; min-height: 40px; background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: default; }
.pf-cell { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13.5px; color: var(--ink); }
.pf-head .pf-cell { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.pf-icon { display: inline-flex; flex: none; }
.pf-name-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pf-name-text b, .pf-name-text small, .pf-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-name-text b { font-weight: 500; }
.pf-name-text small { font-size: 12px; color: var(--muted); }
.pf-swatch { width: 14px; height: 14px; border-radius: 4px; }
.pf-bar { flex: 1; min-width: 60px; height: 8px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.pf-bar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.pf-frac { flex: none; min-width: 44px; font-variant-numeric: tabular-nums; }
.pf-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.pf-num.is-done { color: var(--success-600); }
.pf-num.is-overdue { color: var(--danger-600); }
.pf-dash { color: var(--muted); }
.pf-avatar { width: 24px; height: 24px; flex: none; font-size: 10px; }
/* Cột "+" ở popup: dính mép phải khi cuộn ngang */
.pf-plus { position: sticky; right: 0; justify-content: flex-end; padding-right: 6px; background: var(--surface); }
.pf-row:not(.pf-head):hover .pf-plus { background: var(--bg); }
/* Popup mở rộng: 1 khung trải hết hộp thoại (không chia trái / phải) */
.ovch-body.is-single { display: flex; }
.pf-modal { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 8px 24px 16px; }
@media (max-width: 760px) { .ov-portfolio { height: 400px; } .pf-modal { padding: 8px 12px 12px; } }

.ovch-list.ov-tasktable { padding: 0 10px 12px; }
.ovch-list .ov-due-scroll { max-height: none; overflow: visible; }
.ovch-list .pl-table { min-width: 520px; }
.ovch-list .pl-row { grid-template-columns: 36px minmax(160px, 1fr) 110px 100px 84px 40px; }
/* Bảng việc trong popup = khung trái của Gantt: cột Tên dính trái, tiêu đề dính trên, các cột trường cuộn ngang bên dưới */
.ovch-list.ovpt-host { padding: 0 0 12px; }
.ovpt { --row-h: 44px; --head-h: 40px; }
.ovpt .gantt-ltable { min-width: calc(var(--ovname) + var(--lmin)); }
.ovpt .gantt-lrow { grid-template-columns: var(--ovname) var(--cols); }
.ovpt .gantt-lhead, .ovpt .gantt-lrow { background: var(--bg); }
.ovpt .gantt-lhead .gantt-lplus, .ovpt .gantt-lrow.gantt-task > .gantt-lcell:last-child { background: var(--bg); }
.ovpt .gantt-lcell-name { position: sticky; left: 0; z-index: 2; background: var(--bg); }
.ovpt .gantt-lhead .gantt-lcell-name { z-index: 4; }
.ovpt .gantt-lrow.gantt-task:hover, .ovpt .gantt-lrow.gantt-task:hover > .gantt-lcell-name,
.ovpt .gantt-lrow.gantt-task:hover > .gantt-lcell:last-child { background: var(--surface); }

/* Ô chọn nhanh (người phụ trách, hạn, ưu tiên) mở từ bảng trong popup phải nổi trên popup */
body:has(#modal-ov-chart-toggle:checked) .pl-pop { z-index: 61; }
@media (max-width: 1100px) { .ovch-body { grid-template-columns: minmax(0, 1fr) 460px; } }
@media (prefers-reduced-motion: reduce) { .ovb-seg { transition: none; } }
@media (max-width: 760px) { .ovch-body { grid-template-columns: 1fr; } .ovb-plot { height: 200px; } .ovb-bar { height: 110px; } }

/* =====================================================
   PHỤ THUỘC GIỮA CÔNG VIỆC (Đợt 9) + khối lượng gọn khi chọn người (Đợt 8)
   ===================================================== */
/* Mục "Phụ thuộc" trong chi tiết việc */

/* Hộp thoại dời lịch: xem trước rồi xác nhận */
.dep-box { max-width: 640px; }
.dep-intro { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.dep-skip { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.dep-skip ul { margin: 4px 0 0; padding-left: 18px; }
.dep-error { margin-top: 10px; }

/* Gantt: mũi tên phụ thuộc + chấm kéo nối */
.gantt-deps, .gantt-dep-temp { position: absolute; top: 0; left: 0; z-index: 2; overflow: visible; pointer-events: none; }
.gantt-dep-line { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.gantt-dep-head { fill: var(--muted); }
.gantt-dep-head.is-bad { fill: var(--danger); }
.gantt-dep.is-conflict .gantt-dep-line { stroke: var(--danger); stroke-dasharray: 4 3; }
.gantt-dep-hit { fill: none; stroke: transparent; stroke-width: 10; pointer-events: stroke; cursor: pointer; }
.gantt-dep:hover .gantt-dep-line { stroke: var(--primary-600); stroke-width: 2; }
.gantt-dep-temp line { stroke: var(--primary-600); stroke-width: 2; stroke-dasharray: 5 4; }
.gantt-dep-dot {
  position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; border: 2px solid var(--primary-600); border-radius: 50%;
  background: var(--surface); cursor: crosshair; opacity: 0; transition: opacity 0.15s ease; touch-action: none; z-index: 2;
}
.gantt-bar:hover .gantt-dep-dot, .gantt-bar:focus-visible .gantt-dep-dot { opacity: 1; }
.gantt-bar.is-dep-target { box-shadow: 0 0 0 3px var(--primary-100); }
@media (prefers-reduced-motion: reduce) { .gantt-dep-dot { transition: none; } }

/* Ô chọn người phụ trách: giờ kế hoạch / khả năng tuần này */
.asg-load { margin-left: auto; padding-left: 8px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.asg-load.is-over { color: var(--danger-600); font-weight: 600; }
.pl-pop-option .asg-load { flex: none; }

/* Gantt: mũi tên Quy trình (chỉ xem thứ tự, sửa ở tab Quy trình) */
.gantt-dep.is-wf .gantt-dep-line { stroke: var(--success); stroke-dasharray: 2 3; }
.gantt-dep-head.is-wf { fill: var(--success); }
.gantt-dep.is-wf:hover .gantt-dep-line { stroke: var(--success); stroke-width: 1.5; }

/* ---------- Ô chọn người phụ trách kiểu ClickUp (assignee.js asg*): tìm → đang phụ trách → Mọi người → Nhóm → Giao bằng AI ---------- */
.assignee-picker .assignee-picker-panel.asg-cu { width: 300px; max-width: calc(100vw - 32px); padding: 8px; border-radius: 12px; }
.asg-search { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.asg-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-50); }
.asg-search-input { flex: 1 1 auto; width: 100%; min-width: 0; max-width: none; height: 30px; box-shadow: none !important; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ink); padding: 0; }
.asg-search-input::-webkit-search-cancel-button { cursor: pointer; }
.asg-close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.asg-close:hover { background: var(--bg); color: var(--ink); }
.asg-scroll { max-height: 300px; overflow-y: auto; margin: 6px -2px 0; padding: 0 2px; scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;}
.asg-group + .asg-group { margin-top: 4px; }
.asg-sec { padding: 6px 6px 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.asg-cu .asg-row { display: flex !important; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 6px; border: 0; border-radius: 6px;
  background: transparent; font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; white-space: nowrap; }
.asg-cu .asg-row:hover, .asg-cu .asg-row:focus-within, .asg-cu .asg-row:focus-visible { background: var(--bg); }
.asg-cu .asg-row.is-on { background: var(--primary-50); }
.asg-cu .asg-hide, .asg-cu .asg-row.asg-hide { display: none !important; }
.asg-cu .asg-av, .asg-cu .avatar.asg-av { width: 24px !important; height: 24px !important; min-width: 24px; font-size: 10px; flex: none; }
.asg-cu .team-avatar.asg-av { border-radius: 6px; font-size: 10px; }
.asg-cu .avatar-presence .presence-dot { width: 7px; height: 7px; right: -1px; bottom: -1px; border-width: 1.5px; }
.asg-cu .asg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.asg-me { font-style: normal; color: var(--muted); font-size: 12px; }
.asg-meta { margin-left: auto; padding-left: 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.asg-cu .asg-load { font-size: 11px; }
.asg-hint { margin: 4px 6px; font-size: 12px; color: var(--muted); white-space: normal; }
.asg-foot { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.asg-ai-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.asg-ai-btn svg { color: #a855f7; }
.asg-ai-btn:hover:not(:disabled) { border-color: #a855f7; background: #faf5ff; }
.asg-ai-btn:disabled { opacity: 0.6; cursor: progress; }
.asg-ai-box { position: relative; margin-top: 6px; padding: 8px; border: 1px solid #e9d5ff; border-radius: 8px; background: #faf5ff; font-size: 12.5px; color: var(--ink); white-space: normal; }
.asg-ai-box[role="status"] { display: flex; align-items: center; gap: 8px; }
.asg-ai-box .set-spinner { border-color: #e9d5ff; border-top-color: #a855f7; }
.asg-ai-box.is-error { border-color: var(--danger); background: var(--surface); }
.asg-ai-box.is-error p { margin: 0 20px 6px 0; }
.asg-ai-x { position: absolute; top: 6px; right: 6px; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.asg-ai-x:hover { background: var(--surface); color: var(--ink); }
.asg-ai-title { display: flex; align-items: baseline; gap: 4px; margin-right: 20px; font-weight: 700; }
.asg-ai-title .asg-meta { margin-left: 0; font-weight: 400; }
.asg-ai-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; margin-top: 6px; }
.asg-ai-item { padding-top: 6px; border-top: 1px dashed #e9d5ff; }
.asg-ai-item:first-child { padding-top: 0; border-top: 0; }
.asg-ai-task { display: flex; align-items: center; gap: 4px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asg-ai-task .pl-priority { flex: none; }
.asg-ai-people { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; }
.asg-ai-person { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 1px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; }
.asg-ai-person .asg-av { width: 20px !important; height: 20px !important; min-width: 20px; font-size: 9px; }
.asg-ai-person.is-new { border-color: #c084fc; }
.asg-ai-person.is-keep { opacity: 0.75; }
.asg-ai-why { flex-basis: 100%; font-size: 11.5px; color: var(--ink-soft); }
.asg-ai-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.asg-ai-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
/* Ô tick nhỏ bên phải mỗi người (cả dòng bấm được); dòng đang chọn có nền xanh */
.asg-cu .asg-row { position: relative; }
.asg-cu .asg-row input.asg-check { position: static; flex: none; width: 14px; height: 14px; margin: 0 0 0 8px; opacity: 1; pointer-events: auto; accent-color: var(--primary); cursor: pointer; }
.asg-cu .asg-row:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: -2px; }
/* Popup nằm trong hàng .detail-field (CSS chung ép label rộng 112px, chữ nhỏ màu nhạt): trả lại kích thước riêng */
.asg-cu label.asg-close { width: 20px !important; margin: 0 !important; }
.asg-cu label.asg-row { width: 100% !important; margin: 0 !important; font-size: 13px !important; color: var(--ink) !important; }

/* ---------- Tổng quan: thẻ AI Team Update / AI Project Update (overview.js ovDg*) + popup #modal-ov-digest ---------- */
/* 3 nút vuông góc phải tiêu đề thẻ AI Team / Project Update: Xem chi tiết · Làm mới · Đổi thiết lập (cùng kiểu nút cài đặt) */
.ov-ai .ov-dg-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.ov-ai .ov-dg-tool { width: 28px; height: 28px; }
.ov-dg-sum { cursor: pointer; border-radius: var(--radius-sm); padding: 6px 8px; margin: 0 -8px; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; flex: 0 1 auto; min-height: 0; transition: background 0.2s; }
.ov-dg-sum:hover, .ov-dg-sum:focus-visible { background: var(--bg); outline: none; }
.ov-dg-sum:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.ov-dg .ov-ai-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-dg .set-spinner, .dg-box .set-spinner { border-color: var(--primary-100); border-top-color: var(--primary-600); vertical-align: -2px; }
.dg-box { width: min(920px, calc(100vw - 32px)); max-width: none; max-height: min(860px, calc(100vh - 32px)); display: flex; flex-direction: column; }
.dg-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.dg-foot { display: flex; justify-content: flex-end; gap: 8px; }
.dg-setup { display: flex; flex-direction: column; gap: 14px; }
.dg-row > label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.dg-count { margin-left: auto; font-weight: 500; color: var(--muted); }
.dg-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dg-dates label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.dg-err { display: block; margin: 6px 0 0; }
.dg-people { margin-top: 8px; max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; scrollbar-width: thin; }
.dg-sec { padding: 6px 8px 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.dg-pick { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.dg-pick:hover { background: var(--bg); }
.dg-pick:has(input:checked) { background: var(--primary-50); }
.dg-pick.is-hidden { display: none; }
.dg-group:not(:has(.dg-pick:not(.is-hidden))) { display: none; } /* tìm không còn ai trong mục thì ẩn cả tiêu đề mục */
.dg-pick small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.dg-pick input { margin-left: auto; width: 15px; height: 15px; flex: none; accent-color: var(--primary); }
.dg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-box .dg-av, .dg-box .avatar.dg-av { width: 24px !important; height: 24px !important; min-width: 24px; font-size: 10px; flex: none; }
.dg-box .team-avatar.dg-av { border-radius: 6px; }
.dg-ai { padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg); font-size: 13.5px; line-height: 1.55; }
.dg-ai p, .dg-note p { margin: 0 0 6px; }
.dg-ai ul, .dg-note ul { margin: 0 0 6px; padding-left: 18px; }
.dg-ai-sum { font-weight: 600; margin-bottom: 8px; }
.dg-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.dg-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.dg-tile span { font-size: 11.5px; color: var(--muted); }
.dg-tile b { font-size: 20px; color: var(--ink); }
.dg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin-top: 10px; }
.dg-sec-block h3 { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--ink); }
.dg-sec-block h3 small { color: var(--muted); font-weight: 500; }
.dg-tasks { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.dg-tasks li { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; border-bottom: 1px dashed var(--border-soft); min-width: 0; }
.dg-tasks li:last-child { border-bottom: 0; }
.dg-tasks small { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.dg-task { padding: 0; border: 0; background: none; font: inherit; color: var(--primary-600); text-align: left; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-task:hover { text-decoration: underline; }
.dg-more { color: var(--muted); font-size: 12px; }
.dg-person { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.dg-person-head { display: flex; align-items: center; gap: 8px; }
.dg-person-head small { color: var(--muted); font-size: 12px; }
.dg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.dg-chip { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--bg); font-size: 12px; color: var(--ink-soft); }
.dg-chip.is-muted { color: var(--muted); }
.dg-note { font-size: 13px; line-height: 1.5; }
@media (max-width: 760px) {
  .dg-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dg-grid, .dg-dates { grid-template-columns: 1fr; }
  .dg-box { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .ov-dg-sum { transition: none; } }
/* Thẻ Team hiện đủ nội dung (thẻ đã cao cố định + tự cuộn ở .ov-ai), kết luận năng suất + hạng thành viên */
.ov-dg-full { display: flex; flex-direction: column; gap: 0; font-size: 13.5px; height: 360px;
    overflow-y: auto;  scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;}
.ov-dg-full .dg-person { margin-top: 10px; padding-top: 10px; }
.ov-dg-full .dg-av, .ov-dg-full .avatar.dg-av { width: 24px !important; height: 24px !important; min-width: 24px; font-size: 10px; flex: none; }
.dg-conclusion { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--primary-100); background: var(--primary-50); font-size: 13.5px; line-height: 1.55; }
.dg-conclusion > b { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--primary-600); }
.dg-conclusion .ai-answer p { margin: 0 0 4px; }
.dg-rank-rule { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.dg-rank { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--bg); font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.dg-rank.is-top1 { background: #fef3c7; color: #92400e; }
.dg-rank.is-top2 { background: #e5e7eb; color: #374151; }
.dg-rank.is-top3 { background: #fde2cf; color: #9a3412; }
/* Chỉ số từng người = 1 thanh màu chia đoạn theo tỷ lệ (overview.js ovDgBarsHTML); rê / focus vào đoạn hiện khung số liệu */
.dg-bars { margin: 8px 0; max-width: 90%; }
.dg-bars.is-empty { font-size: 12.5px; color: var(--muted); }
.dg-stack { display: flex; height: 12px; border-radius: 999px; background: var(--bg); }
.dg-seg { position: relative; display: flex; align-items: center; justify-content: center; min-width: 6px; font-size: 10px; font-weight: 700; color: #fff; cursor: default; outline: none; }
.dg-seg + .dg-seg { box-shadow: inset 2px 0 0 var(--surface); }
.dg-seg:first-child { border-radius: 999px 0 0 999px; }
.dg-seg:last-child { border-radius: 0 999px 999px 0; }
.dg-seg:only-child { border-radius: 999px; }
.dg-seg:hover, .dg-seg:focus-visible { filter: brightness(0.92); }
.dg-seg::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 5; padding: 5px 9px; border-radius: 6px;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.12s; }
.dg-seg:hover::after, .dg-seg:focus-visible::after { opacity: 1; }
.dg-bar-extra { margin: 4px 2px 0; font-size: 11.5px; color: var(--muted); }
.dg-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.dg-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dg-legend i { width: 9px; height: 9px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) { .dg-seg::after { transition: none; } }
/* Bố cục Team Update: tiêu đề mục đánh số + các dòng "Nhãn: nội dung" */
.dg-h { margin: 16px 0 6px; font-size: 14px; font-weight: 800; color: var(--ink); }
.dg-h:first-child { margin-top: 2px; }
.dg-pnote { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.55; }
.dg-pnote li { margin: 2px 0; }
.dg-pnote li::marker { color: var(--muted); }
.dg-pnote b { font-weight: 700; color: var(--ink); }
.dg-pnote li.is-blocker b { color: var(--danger-600); }
.dg-pnote li.is-next b { color: var(--primary-600); }
.dg-note ul { margin: 0; padding-left: 18px; }
.dg-pnote, .dg-pnote li, .dg-note ul, .dg-note ul li { list-style: disc; }
/* Project Update: các dòng trạng thái có biểu tượng (kiểu thẻ AI Project Update của ClickUp) + mục con */
.dg-status { display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin: 2px 0 6px; padding: 10px; border-radius: 12px; background: linear-gradient(135deg, #eef7ff, #f7f0ff); }
.dg-prog { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); font-size: 12.5px; }
.dg-prog > span:first-child { color: var(--ink-soft); font-weight: 600; }
.dg-prog b { font-size: 15px; color: var(--ink); }
.dg-prog-track { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.dg-prog-track i { display: block; height: 100%; border-radius: 999px; background: var(--success); }
.dg-prog small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.dg-srow { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; font-size: 12.5px; }
.dg-srow b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); }
.dg-sico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; flex: none; }
.dg-slabel { color: var(--ink-soft); }
.dg-srow.is-done { background: #ecfdf5; } .dg-srow.is-done .dg-sico { background: #10b981; }
.dg-srow.is-open { background: #eef2ff; } .dg-srow.is-open .dg-sico { background: #6366f1; }
.dg-srow.is-overdue { background: #fff1f2; } .dg-srow.is-overdue .dg-sico { background: #f43f5e; }
.dg-srow.is-blocked { background: #fff7ed; } .dg-srow.is-blocked .dg-sico { background: #f97316; }
.dg-srow.is-review { background: #fefce8; } .dg-srow.is-review .dg-sico { background: #ca8a04; }
.dg-pnote li.is-bad b { color: var(--danger-600); }
.dg-pnote li.is-review b { color: #a16207; }
.dg-sub { margin-top: 2px; }
.dg-sub ul { margin: 0; padding-left: 18px; list-style: circle; }
.dg-sub li { list-style: circle; }
.dg-sub p { margin: 0; }
/* AI StandUp */
.dg-su-title { margin: 2px 0 0; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.dg-su-range { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.dg-fixed { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg); font-size: 13px; color: var(--ink-soft); }
.dg-pnote li.is-yesterday b { color: var(--ink-soft); }
.dg-pnote li.is-today b { color: var(--primary-600); }
.ov-card.ov-right{
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
ul.ovq-list.ovc-list {
    max-height: 400px;
}
/* ===== Gói dịch vụ (plan_lib.php): nhãn gói, ghi chú chỉ xem / tạm dừng, thẻ Cài đặt › Không gian làm việc ===== */
.plan-note {
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--warning-100);
  border-radius: var(--radius-sm);
  background: var(--warning-50);
  color: var(--warning-700);
  font-size: 13px;
  line-height: 1.45;
}
.plan-note.is-inline { margin: 6px 0 0; padding: 4px 8px; font-size: 12px; }
.plan-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: middle;
  white-space: nowrap;
}
.plan-badge.is-free { background: var(--border-soft); color: var(--ink-soft); }
.plan-badge.is-business { background: var(--success-50); color: var(--success-700); }
.plan-rows { display: grid; gap: 6px; margin: 10px 0; }
.plan-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.plan-row b { font-weight: 600; white-space: nowrap; }
.plan-row.is-over b { color: var(--danger-600); }
.plan-trial .set-footer { gap: 8px; flex-wrap: wrap; }
.plan-trial select { flex: 1 1 200px; min-width: 0; }
.wl-span-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Thanh toán gói / nạp xu (settings.js settingsPayHTML, hộp thoại #modal-pay) */
.pay-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 10px; }
.pay-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.pay-field .field-error { color: var(--danger); font-size: 12px; }
.pay-order-row { align-items: flex-start; gap: 10px; }
.pay-order-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; text-align: right; }
.pay-st { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); white-space: nowrap; }
.pay-st.is-paid { background: #dcfce7; color: #166534; }
.pay-st.is-pending { background: var(--primary-50); color: var(--primary-600); }
.pay-st.is-review_required { background: var(--warning-50); color: var(--warning-700); }
.pay-box { width: min(460px, calc(100vw - 32px)); }
.pay-what { margin: 0 0 10px; font-size: 14px; }
.pay-qr-wrap { display: flex; justify-content: center; margin: 4px 0 12px; }
.pay-qr { width: 240px; height: 240px; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.pay-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.pay-row span { color: var(--muted); min-width: 110px; }
.pay-row b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pay-done { padding: 12px; border-radius: var(--radius-sm); background: #dcfce7; color: #166534; font-weight: 500; }
.wallet-topup input { max-width: 180px; }
#pay-body{
  scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}.pay-card .pl-link-btn.is-danger, #modal-pay .pl-link-btn.is-danger { color: var(--danger); }

/* Tab Cài đặt › Gói & thanh toán (settings.js settingsPlanHTML / settingsPlanCompareHTML / settingsPayHistoryHTML) */
.plan-sub { margin: 16px 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.plan-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.plan-col { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md, 12px); background: var(--surface, #fff); min-width: 0; }
.plan-col.is-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.plan-col h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plan-col h3 .plan-badge { margin-left: 0; font-size: 13px; }
.plan-cur { color: var(--primary-600); font-weight: 500; }
.plan-price { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }
.plan-price b { font-size: 20px; color: var(--ink); }
.plan-col .form-hint { margin: 0; }
.plan-lims { list-style: none; margin: 4px 0; padding: 0; font-size: 13px; }
.plan-lims li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--border-soft); }
.plan-lims li span { color: var(--muted); }
.plan-lims li b { font-weight: 600; text-align: right; }
.plan-pick { width: 100%; margin: 6px 0 4px; }
.plan-pick.is-empty { display: block; height: 0; margin: 0; }
.plan-col h3 { font-size: 18px; }
.plan-col.is-business { border-color: var(--primary); background: linear-gradient(180deg, var(--primary-50), var(--surface) 140px); }
.plan-popular { padding: 1px 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; }
.plan-price-sub { margin: 0; min-height: 34px; font-size: 12px; color: var(--muted); }
.plan-list-head { margin: 10px 0 2px; padding-top: 10px; border-top: 1px solid var(--border-soft); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; }
.plan-list li { display: flex; align-items: flex-start; gap: 7px; }
.plan-list li svg { flex: none; margin-top: 3px; color: var(--success-700); }
.pay-hist-tabs { margin: 4px 0 8px; }
.pay-count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); font-size: 11px; font-weight: 600; text-align: center; }
.pay-order-link { padding: 0; font-weight: 600; }
.pay-reply { color: var(--ink-soft); overflow-wrap: anywhere; }
.pay-order-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.pay-st.is-expired, .pay-st.is-cancelled { background: var(--border-soft); color: var(--muted); }
.pay-st.is-sup-open, .pay-st.is-ev-unmatched, .pay-st.is-ev-review_required { background: var(--warning-50); color: var(--warning-700); }
.pay-st.is-sup-resolved, .pay-st.is-ev-processed { background: #dcfce7; color: #166534; }
/* Cài đặt › Xử lý thanh toán (người vận hành) + hộp thoại #modal-pay-admin */
.pa-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.pa-search { flex: 1 1 220px; min-width: 0; margin-bottom: 0; }
.pa-spacer { flex: 1 1 0; }
.pa-box { width: min(640px, calc(100vw - 32px)); }
#pa-body { max-height: min(75vh, 760px); overflow-y: auto; scrollbar-width: thin; }
.pa-cands { display: grid; gap: 6px; margin: 6px 0 10px; }
.pa-cand { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; }
.pa-cand.is-on { border-color: var(--primary); background: var(--primary-50); }
.pa-cand input { margin-top: 3px; }
.pa-cand span { min-width: 0; overflow-wrap: anywhere; }
.pa-diff { color: var(--danger-600, #e11d48); }
.pa-check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 10px; font-size: 13px; color: var(--warning-700); }
#modal-pay-admin .pl-link-btn.is-danger, .plan-card .pl-link-btn.is-danger, .set-card .pay-order-act .pl-link-btn.is-danger { color: var(--danger); }
@media (max-width: 640px) {
  .pay-order-row { flex-direction: column; }
  .pay-order-act { justify-content: flex-start; text-align: left; }
  .pa-spacer { display: none; }
  .plan-row { font-size: 13.5px; }
  .plan-row b { white-space: normal; text-align: right; }
}


/* Cài đặt › Không gian làm việc › Tính năng: mục thu gọn được (settings.js settingsFeatureSectionHTML) */
.ws-feat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ws-feat-head .set-title { margin: 0; }
.ws-feat-count { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.ws-feat-arrow { flex: none; color: var(--muted); transition: transform .2s ease; }
.ws-feat.is-open .ws-feat-arrow { transform: rotate(90deg); }
.ws-feat-head:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 6px; }
.ws-feat-body { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .ws-feat-arrow { transition: none; } }

/* =====================================================================
   Cài đặt — bố cục mới (menu dọc có nhóm + trang con; settings.js renderSettingsPage)
   Chỉ dùng biến màu: bật dark mode sau này chỉ cần thêm bộ biến cho :root.
   ===================================================================== */
#view-settings { padding-bottom: 0; }
/* Trang Cài đặt co giãn theo bề ngang màn hình (vw, chuẩn = màn 1470px ở zoom 100%): zoom 110–125% thì menu trái + chữ co theo,
   phần bên phải không bị bó lại làm các ô xuống hàng. clamp giữ sàn / trần để màn rất nhỏ / rất lớn không quá đà. */
.set-layout { display: grid; grid-template-columns: clamp(208px, 18vw, 300px) minmax(0, 1fr); gap: clamp(14px, 1.36vw, 24px); align-items: start; } /* kéo hết bề ngang (thanh bên luôn thu ở Cài đặt), không để hở bên phải */
.set-nav { position: sticky; top: calc(var(--topbar-h, 64px) + 12px); display: flex; flex-direction: column; gap: clamp(12px, 1.22vw, 20px); }
.set-nav-title { margin: 0; font-size: clamp(19px, 1.63vw, 26px); font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.set-nav-group { display: flex; flex-direction: column; gap: 2px; }
.set-nav-label { margin: 0 0 4px 10px; font-size: clamp(10.5px, 0.82vw, 13px); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.set-nav-item { display: flex; align-items: center; gap: clamp(8px, 0.68vw, 12px); width: 100%; padding: clamp(7px, 0.61vw, 10px) clamp(8px, 0.68vw, 12px); border: 1px solid transparent; border-radius: var(--radius-md); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.set-nav-item:hover { background: var(--bg); border-color: var(--border-soft); }
.set-nav-item.is-active { background: var(--primary-50); border-color: var(--primary-100); box-shadow: none; }
.set-nav-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.set-nav-ico { flex: none; display: grid; place-items: center; width: clamp(26px, 2.18vw, 36px); height: clamp(26px, 2.18vw, 36px); border-radius: 10px; background: var(--bg); color: var(--ink-soft); }
.set-nav-item.is-active .set-nav-ico { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }
.set-nav-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.set-nav-text b { font-size: clamp(12.5px, 0.95vw, 15.5px); font-weight: 600; }
.set-nav-text small { font-size: clamp(11.5px, 0.88vw, 14px); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-nav-item.is-active .set-nav-text b { color: var(--primary-600); }
.set-nav-go { flex: none; color: var(--ink-soft); display: none; }
/* Trang Cài đặt (theo mẫu chủ dự án duyệt 11/2026): nền trang KHÔNG trắng tinh mà xanh xám rất nhạt, để cột menu và các bảng trắng
   nổi lên tách lớp; cột menu là 1 bảng trắng bo góc, rê chuột nền xám nhạt, mục đang chọn nền xanh nhạt cả dòng + ô biểu tượng trắng chữ xanh */
body:has(#view-settings.is-active) .page-content { background: linear-gradient(180deg, #eef3f9, #f4f7fb 320px); }
.set-nav { padding: 0 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: transparent; }
.set-nav-title { padding: 0 10px; }
.set-nav-item { transition: background-color .15s, border-color .15s; }
@media (prefers-reduced-motion: reduce) { .set-nav-item { transition: none; } }
.set-main { min-width: 0; padding-bottom: 96px; } /* chừa chỗ thanh lưu; đặt trong hàng lưới để menu trái dính tới tận đáy, không bị đẩy lên */
.set-back { display: none; align-items: center; gap: 4px; margin: 0 0 10px; padding: 6px 2px; border: 0; background: none; color: var(--primary-600); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.set-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.set-head-ico { flex: none; display: grid; place-items: center; width: clamp(34px, 2.86vw, 46px); height: clamp(34px, 2.86vw, 46px); border-radius: 12px; background: linear-gradient(135deg, var(--primary-50), var(--primary-100)); color: var(--primary-600); }
.set-head h2 { margin: 0; font-size: clamp(18px, 1.5vw, 24px); font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.set-head p { margin: 2px 0 0; font-size: clamp(11.5px, 0.88vw, 14px); color: var(--ink-soft); }
.set-main .set-body { max-width: none; gap: 14px; }
.set-main .set-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.set-main .form-hint, .set-main .set-note { color: var(--ink-soft); font-size: 13px; }
.set-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.set-card-head .set-title { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.set-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary.btn-sm { display: inline-flex; align-items: center; gap: 6px; }

/* ⓘ: rê chuột (máy tính) / bấm (điện thoại) hiện chú thích */
.info-tip { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-soft); cursor: help; vertical-align: middle; }
.info-tip:hover, .info-tip.is-open { color: var(--primary-600); background: var(--primary-50); }
.info-tip:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.info-tip-pop { position: absolute; z-index: 60; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 280px; padding: 9px 11px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; box-shadow: var(--shadow-md); display: none; pointer-events: none; }
.info-tip-pop::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--ink); }
.info-tip.is-open .info-tip-pop { display: block; }
/* infoTipFit (settings.js): dời ngang cho khỏi bị cắt ở mép vùng cuộn, mũi tên vẫn chỉ đúng nút; sát mép trên thì lật xuống dưới */
.info-tip-pop { transform: translateX(calc(-50% + var(--tip-dx, 0px))); }
.info-tip-pop::after { margin-left: calc(-5px - var(--tip-dx, 0px)); }
.info-tip.is-below .info-tip-pop { top: calc(100% + 8px); bottom: auto; }
.info-tip.is-below .info-tip-pop::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ink); }
/* ⓘ ở mép phải (cuối tiêu đề thẻ): khung chú thích căn theo mép phải để không tràn ra ngoài */
.set-card-head > .info-tip:last-child .info-tip-pop { left: auto; right: -6px; transform: none; }
.set-card-head > .info-tip:last-child .info-tip-pop::after { left: auto; right: 11px; }
@media (hover: hover) { .info-tip:hover .info-tip-pop { display: block; } }

/* Thanh tiến độ 3 mức: xanh < 70%, cam 70–90%, đỏ > 90% */
.meter { display: block; height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .3s; }
.meter.is-mid i { background: var(--warning-600); }
.meter.is-high i { background: var(--danger); }

/* Thanh lưu dính đáy: chỉ hiện khi có thay đổi chưa lưu */
.save-bar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 10px 12px 10px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); animation: saveBarIn .2s ease; }
.save-bar-text { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.save-bar-text svg { color: var(--warning-600); }
.save-bar-text .is-bad { color: var(--danger-600); }
@keyframes saveBarIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Ô số liệu + thanh dùng token */
.use-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-bottom: 14px; }
.use-bar-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; color: var(--ink-soft); }
.use-bar-head b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat-tiles.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0; }
.stat-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg); }
.stat-label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.stat-value { font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.2; overflow-wrap: anywhere; }
.stat-sub { font-size: 13px; color: var(--ink-soft); }

/* Thẻ chọn 1 trong nhiều (Cấp độ AI, Văn phong) */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice-card { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice-card:hover { border-color: var(--primary-100); }
.choice-card.is-on { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px var(--primary-50); }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.choice-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.choice-badge { padding: 1px 7px; border-radius: 999px; background: var(--warning-50); color: var(--warning-700); font-size: 12px; font-weight: 700; }
.choice-badge.is-lock { background: var(--bg); color: var(--ink-soft); }
.choice-desc { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); }
.choice-warn { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warning-50); color: var(--warning-700); font-size: 13px; font-weight: 600; }
.ai-style-sample { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--bg); font-size: 14px; color: var(--ink); }
.ai-style-sample span { color: var(--ink-soft); }

/* Chip chọn 1 (Tự xóa sau, chọn nhanh số xu) */
.chip-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chip-line-label { font-size: 14px; color: var(--ink-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--primary-100); }
.chip.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.chip:has(input:focus-visible), .chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.set-ai-custom { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; }
.set-ai-custom .form-control { width: 120px; }

/* Hộp thoại Nạp xu */
.topup-box { width: min(480px, calc(100vw - 32px)); }
.topup-row { display: flex; gap: 8px; margin: 4px 0 10px; }
.topup-row .form-control { flex: 1; min-width: 0; }
.modal-sub { margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 14px; font-weight: 700; color: var(--ink); }
.list-rows { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; color: var(--ink); }
.list-row:last-child { border-bottom: 0; }
.list-row .is-plus { color: var(--success-700); }
.list-row .is-minus { color: var(--danger-600); }
.empty-mini { margin: 4px 0; font-size: 13px; color: var(--ink-soft); }

/* Đang tải: khung xương */
.skeleton-lines { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skeleton-lines span { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--border-soft), var(--bg), var(--border-soft)); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
.skeleton-lines span:nth-child(2) { width: 80%; }
.skeleton-lines span:nth-child(3) { width: 60%; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-lines span, .save-bar { animation: none; } .meter i { transition: none; } }

/* Dưới 768px: màn danh sách menu -> bấm vào trang con có "← Quay lại"; cột xếp dọc */
@media (max-width: 767px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .set-nav { position: static; padding: 0; border: 0; background: none; }
  .set-layout.is-list .set-main { display: none; }
  .set-layout:not(.is-list) .set-nav { display: none; }
  .set-back { display: inline-flex; }
  .set-nav-item { padding: 12px; background: var(--surface); border-color: var(--border-soft); margin-bottom: 6px; }
  .set-nav-item.is-active { border-color: var(--border-soft); box-shadow: none; }
  .set-nav-go { display: block; }
  .use-bars, .stat-tiles, .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-tiles.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .save-bar { bottom: 8px; flex-wrap: wrap; }
  .save-bar-text { flex-basis: 100%; }
  .save-bar .btn-primary, .save-bar .btn-secondary { flex: 1; justify-content: center; }
  .info-tip-pop { position: fixed; left: 16px; right: 16px; bottom: 16px; top: auto; transform: none; max-width: none; width: auto; }
  .info-tip-pop::after { display: none; }
}

/* Cài đặt › Không gian làm việc: tab con, lưới tính năng, thương hiệu (ô kéo thả + xem trước), vùng nguy hiểm */
.sub-tabs { display: flex; gap: 4px; margin: -4px 0 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.sub-tab { flex: none; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-soft); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sub-tab:hover { color: var(--ink); }
.sub-tab.is-active { color: var(--primary-600); border-bottom-color: var(--primary); }
.sub-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px; }
.ws-feat-count { margin-left: 4px; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.feat-search { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink-soft); }
.feat-search input { width: 180px; padding: 7px 0; border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); }
.feat-search:focus-within { border-color: var(--primary); }
.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.feat-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); transition: background .15s; }
.feat-card.is-off { background: var(--bg); }
.feat-card.is-off .feat-text b, .feat-card.is-off .feat-ico { color: var(--ink-soft); }
.feat-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary-50); color: var(--primary-600); }
.feat-card.is-off .feat-ico { background: var(--border-soft); }
.feat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.feat-text b { font-size: 14px; color: var(--ink); }
.feat-text small { font-size: 13px; color: var(--ink-soft); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feat-card .auto-switch { flex: none; margin-top: 2px; }

.brand-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.brand-side { position: sticky; top: calc(var(--topbar-h, 64px) + 12px); }
.brand-side-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.brand-master { display: flex; align-items: center; gap: 6px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border-soft); font-size: 15px; }
.brand-master .auto-switch { margin-left: auto; }
.brand-fields { margin: 0; padding: 0; border: 0; min-width: 0; transition: opacity .2s; }
.brand-fields:disabled { opacity: .45; }
.dropzone { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.dropzone.is-drag { margin: 0 -8px; padding: 12px 8px; border-radius: var(--radius-md); outline: 2px dashed var(--primary); background: var(--primary-50); }
.dz-thumb { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border: 1px dashed var(--border); border-radius: 10px; background: var(--bg); color: var(--ink-soft); cursor: pointer; overflow: hidden; }
.dz-thumb.is-logoWide, .dz-thumb.is-shareImage { width: 96px; }
.dropzone.has-img .dz-thumb { border-style: solid; background: var(--surface); }
.dz-thumb img { width: 100%; height: 100%; object-fit: contain; }
.dz-thumb.is-shareImage img { object-fit: cover; }
.dz-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dz-text b { font-size: 14px; color: var(--ink); }
.dz-text small { font-size: 13px; color: var(--ink-soft); }
.dz-actions { display: flex; align-items: center; gap: 6px; }
.dz-actions label.btn-secondary { cursor: pointer; }
.dz-del { color: var(--danger-600); opacity: 0; transition: opacity .15s; }
.dropzone:hover .dz-del, .dz-del:focus-visible { opacity: 1; }
@media (hover: none) { .dz-del { opacity: 1; } }
.brand-fields:disabled .dz-thumb, .brand-fields:disabled label { pointer-events: none; }
.brand-color { padding-top: 12px; }
.brand-color > b { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink); }
.brand-color-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

.owner-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; }
.danger-zone { border-color: #fecdd3; }
.danger-zone .set-btn-danger { white-space: nowrap; flex: none; }
.danger-zone .danger-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0; }
.danger-zone .danger-row + .danger-row { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--danger-50); }
.danger-zone b { color: var(--danger-600); font-size: 15px; }
.danger-zone p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.ws-delete-box { width: min(500px, calc(100vw - 32px)); }
.ws-loss { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; padding: 12px; border-radius: var(--radius-md); background: var(--danger-50); }
.ws-loss li { font-size: 13px; color: var(--ink-soft); }
.ws-loss b { display: block; font-size: 18px; color: var(--danger-600); }

@media (max-width: 1100px) { .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .brand-layout { grid-template-columns: minmax(0, 1fr); } .brand-side { position: static; } }
@media (max-width: 767px) {
  .feat-grid, .owner-pick { grid-template-columns: minmax(0, 1fr); }
  .set-card-head { flex-wrap: wrap; }
  .feat-search, .feat-search input { width: 100%; }
  .danger-zone .danger-row { flex-direction: column; align-items: flex-start; }
}

/* Cài đặt › Gói & thanh toán: banner trạng thái, thẻ Gói hiện tại, Chọn gói, bảng so sánh, ngăn kéo mua, lịch sử đơn */
.plan-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 11px 14px; border: 1px solid; border-radius: var(--radius-md); font-size: 14px; }
.plan-banner-text { flex: 1; min-width: 200px; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.plan-banner.is-warn { background: var(--warning-50); border-color: var(--warning-100); color: var(--warning-700); }
.plan-banner.is-danger { background: var(--danger-50); border-color: var(--danger-100); color: var(--danger-600); }
.plan-banner.is-info { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-600); margin-bottom: 15px;}
.plan-banner .pl-link-btn { font-weight: 700; color: inherit; text-decoration: underline; }
.plan-banner select.form-control { width: auto; min-width: 180px; padding: 6px 10px; }
.badge, .badge-ok { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-ok, .badge.is-ok { background: var(--success-50); color: var(--success-700); }
.badge.is-warn { background: var(--warning-50); color: var(--warning-700); }
.badge.is-mute { background: var(--bg); color: var(--ink-soft); }
.plan-name { font-size: 17px; }
.plan-head-actions { display: flex; gap: 8px; }
.stat-tiles.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-of { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.stat-tile .meter { margin-top: 6px; }
.plan-more { display: inline-flex; align-items: center; gap: 4px; margin: 12px 0 0 auto; padding: 4px 2px; border: 0; background: none; color: var(--primary-600); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; float: right; }
.plan-more svg { transform: rotate(90deg); transition: transform .15s; }
.plan-more[aria-expanded="true"] svg { transform: rotate(-90deg); }
.plan-more.is-center { float: none; display: flex; margin: 14px auto 0; }
.plan-card::after { content: ""; display: block; clear: both; }
.cycle-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.cycle-toggle .is-on { color: var(--ink); font-weight: 700; }
.plan-col h4 { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 16px; color: var(--ink); }
.plan-col > button, .plan-col .tip-wrap { margin-top: auto; width: 100%; justify-content: center; }
.plan-col .tip-wrap button { width: 100%; }
.plan-col .plan-list { margin-bottom: 12px; }
.cmp-wrap { margin-top: 12px; max-height: 520px; overflow: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-md); }
.cmp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.cmp-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: center; color: var(--ink); }
.cmp-table thead th:first-child, .cmp-table tbody th { text-align: left; }
.cmp-table tbody th, .cmp-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-soft); font-weight: 400; color: var(--ink); }
.cmp-table td { text-align: center; }
.cmp-table td.is-yes { color: var(--success-700); font-weight: 700; }
.cmp-table td.is-no { color: var(--ink-soft); }
.cmp-table tr.cmp-group th { background: var(--bg); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }

/* Ngăn kéo bên phải (Báo cáo) */
.drawer-overlay { position: fixed; inset: 0; z-index: 70; display: none; background: rgba(15, 23, 42, .35); }
body:has(#rep-drawer-toggle:checked) #rep-drawer-overlay { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; display: flex; flex-direction: column; width: min(440px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .22s ease; }
body:has(#rep-drawer-toggle:checked) #rep-drawer { transform: none; }
.drawer { visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
body:has(#rep-drawer-toggle:checked) #rep-drawer { visibility: visible; transition: transform .22s ease; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); }
.drawer-head h2 { margin: 0; font-size: 18px; color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; }
/* Popup mua / gia hạn gói (settings.js renderPlanDrawer, #modal-plan-buy): thanh bước + 3 cột + lưu ý */
.pb-box { width: min(1180px, calc(100vw - 32px)); max-width: none; max-height: min(92vh, 780px); }
.pb-box .modal-head { padding: 14px 20px; border-bottom: 0; }
.pb-box .modal-head h2 { font-size: 18px; }
.pb-box .modal-body { padding: 4px 20px 20px; scrollbar-width: thin; }
.pd-steps { display: flex; align-items: center; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: none; }
.pd-steps li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.pd-steps li:not(:last-child)::after { content: ""; flex: 1; min-width: 12px; height: 2px; margin: 0 10px; border-radius: 2px; background: var(--border-soft); }
.pd-steps li:last-child { flex: 0 0 auto; }
.pd-steps li span { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-50); color: var(--primary-600); font-size: 12px; font-weight: 700; }
.pd-steps li.is-on { color: var(--primary-600); font-weight: 600; }
.pd-steps li.is-on span { background: var(--primary); color: #fff; }
.pd-steps li.is-done { color: var(--ink); }
.pd-steps li.is-done span { background: var(--primary-100); color: var(--primary-600); }
.pd-steps li.is-done::after { background: var(--primary-100); }
.pb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
/* Chu kỳ trong popup: nút gạt .pl-cycle như bảng so sánh gói, kéo đủ ngang cột */
.pl-cycle.pd-cycle { display: flex; width: 100%; }
.pl-cycle.pd-cycle > button { flex: 1 1 auto; justify-content: center; padding: 0 10px; font-size: 12.5px; white-space: nowrap; }
.pl-cycle.pd-cycle > .pl-save { flex: none; margin-right: 2px; white-space: nowrap; }
.pl-cycle.pd-cycle > button:disabled { cursor: not-allowed; opacity: .6; }
.pb-col .pb-vouchers { margin: 4px 0 12px; }
.pb-col { display: flex; flex-direction: column; min-width: 0; padding: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--surface); }
.pb-col .form-field { margin: 12px 0 0; }
.pb-h { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.pb-plan { padding: 12px; border-radius: var(--radius-sm); background: var(--primary-50); }
.pb-plan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pb-plan-top b { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.pb-plan-top svg { color: var(--primary-600); }
.pb-price { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.pb-price b { font-size: 18px; font-weight: 800; color: var(--ink); }
.pd-seats { display: grid; grid-template-columns: 44px 1fr 44px; gap: 6px; }
.pd-seats .form-control { width: 100%; height: 40px; text-align: center; font-weight: 600; }
.pd-seats .icon-btn { width: 44px; height: 40px; font-size: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.pd-seats .icon-btn[data-d="1"] { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-100); }
.pd-seats .icon-btn:disabled { opacity: .5; cursor: not-allowed; }
.pb-sub { margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); }
/* Đơn tiện ích trong popup thanh toán 3 cột (settings.js renderAddonDrawer): mỗi tiện ích 1 dòng icon · tên + seat · thành tiền */
/* Tối đa ~5 dòng; dài hơn thì cuộn TRONG cột (thanh cuộn mảnh, mờ), không kéo dài cả popup */
.pb-items { display: grid; gap: 6px; max-height: 268px; margin: 0; padding: 0 4px 0 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .35) transparent; }
.pb-items::-webkit-scrollbar { width: 5px; }
.pb-items::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(148, 163, 184, .35); }
.pb-items::-webkit-scrollbar-track { background: transparent; }
.pb-items li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: #FFFBEF; }
.pb-items li > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.pb-items b { overflow: hidden; font-size: 13px; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }
.pb-items small { font-size: 12px; color: var(--muted); }
.pb-items em { flex: none; font-style: normal; font-size: 13px; font-weight: 700; color: var(--ink); }
.pb-method { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.pb-method-head { display: flex; align-items: center; gap: 10px; }
.pb-method-head b { display: block; font-size: 14px; color: var(--ink); }
.pb-method-head small { display: block; font-size: 12px; color: var(--ink-soft); }
.pb-method-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 800; }
.pb-qr { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 156px; padding: 12px; border-radius: var(--radius-sm); background: var(--primary-50); }
.pb-qr-img { width: 132px; height: 132px; padding: 4px; border-radius: var(--radius-sm); background: #fff; }
.pb-qr-ph { display: grid; place-items: center; width: 132px; height: 132px; border: 2px dashed var(--primary-100); border-radius: var(--radius-sm); background: var(--surface); color: var(--primary-100); }
.pb-qr-ph.is-done { border-style: solid; color: var(--success-700); font-size: 40px; font-weight: 800; }
.pb-qr-text { display: flex; flex-direction: column; gap: 2px; max-width: 130px; }
.pb-qr-text b { font-size: 14px; color: var(--primary-600); }
.pb-qr-text span { font-size: 12px; color: var(--ink-soft); }
.pb-or { margin: 0; text-align: center; font-size: 12px; color: var(--ink-soft); }
.pb-bank { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg); }
.pb-bank-row { display: grid; grid-template-columns: 100px 1fr 26px; align-items: center; gap: 6px; min-height: 30px; font-size: 13px; }
.pb-bank-row span { color: var(--ink-soft); }
.pb-bank-row b { min-width: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pb-copy { width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--primary-600); }
.pb-sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; color: var(--ink-soft); }
.pb-sum-row b { color: var(--ink); white-space: nowrap; }
.pd-total { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 10px 0 4px; }
.pd-total span { font-size: 14px; font-weight: 600; color: var(--ink); }
.pd-total b { font-size: 24px; font-weight: 800; color: var(--primary-600); }
.pb-col-sum .set-note, .pb-col-sum .form-hint { font-size: 12px; }
/* Đợt 12: voucher dạng vé (mẫu chủ dự án chốt 28/10/2026) — cuống trái "-20%" + răng cưa + đường đứt, thân tên / mức giảm / hạn, nút bên phải.
   Màu theo hạn: bình thường · is-warn (dưới 7 ngày: viền + chữ vàng) · is-danger (≤ 3 ngày: nền hồng) · is-expired (xám, gạch ngang)
   · is-later (chưa tới ngày dùng) · is-off (không dùng được cho đơn đang chọn) · is-applied (đang áp trong popup mua: xanh lá). */
.vt { --vt-line: #fecdd3; --vt-accent: #e11d48; --vt-stub: #fff1f2; --vt-bg: linear-gradient(90deg, #fff 0%, #fffaf3 100%); --vt-hole: var(--surface);
  position: relative; display: flex; align-items: stretch; min-width: 0; min-height: 58px; border: 1px dashed var(--vt-line); border-radius: 12px; background: var(--vt-bg); color: var(--ink); }
.vt-stub { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 70px;
  border-right: 1.5px dashed var(--vt-line); border-radius: 11px 0 0 11px; background: var(--vt-stub); color: var(--vt-accent); }
.vt-stub b { font-size: 19px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.vt-stub small { white-space: nowrap; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
/* Răng cưa: 2 nửa hình tròn khoét ở đầu / cuối đường đứt, màu nền nơi đặt thẻ */
.vt-stub::before, .vt-stub::after { content: ""; position: absolute; right: -8px; width: 14px; height: 14px; border: 1px solid var(--vt-line); border-radius: 50%; background: var(--vt-hole); }
.vt-stub::before { top: -8px; clip-path: inset(50% 0 0 0); }
.vt-stub::after { bottom: -8px; clip-path: inset(0 0 50% 0); }
.vt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 0 8px 8px; }
.vt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.vt-when { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 1.35; color: var(--ink-soft); }
/* Nút bên phải: Áp dụng (viền xanh chủ đạo) / Đang dùng (nền xanh nhạt + ✓) xếp chồng 1 ô lưới, đổi bằng lớp .is-using, chuyển 0.2s */
.vt-act { flex: none; display: grid; align-items: center; justify-items: end; padding: 0 12px 0 4px; }
.vt-act > * { grid-area: 1 / 1; transition: opacity .2s ease, transform .2s ease, visibility .2s; }
.vt-apply { height: 30px; padding: 0 14px; border: 1px solid var(--primary); border-radius: 999px; background: var(--surface); color: var(--primary-600); font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.vt-apply:hover { background: var(--primary-50); }
.vt-apply:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vt-using { display: inline-flex; align-items: center; gap: 4px; height: auto; padding: 0 5px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.vt.is-pick .vt-using, .vt.is-pick.is-using .vt-apply { opacity: 0; visibility: hidden; transform: scale(.92); pointer-events: none; }
.vt.is-pick.is-using .vt-using { opacity: 1; visibility: visible; transform: none; }
@media (prefers-reduced-motion: reduce) { .vt-act > * { transition: none; } }
.vt.is-warn { --vt-line: #fbbf24; }
.vt.is-warn .vt-when { color: #b45309; font-weight: 600; }
.vt.is-danger { --vt-bg: #fff1f2; --vt-stub: #ffe4e6; }
.vt.is-danger .vt-when { color: #e11d48; font-weight: 700; }
.vt.is-expired { --vt-line: #e2e8f0; --vt-accent: #94a3b8; --vt-stub: #f1f5f9; --vt-bg: #f8fafc; color: #94a3b8; }
.vt.is-expired .vt-name { text-decoration: line-through; color: #94a3b8; }
.vt.is-later, .vt.is-off { --vt-line: var(--border); --vt-accent: #64748b; --vt-stub: #f1f5f9; --vt-bg: #f8fafc; }
.vt.is-off .vt-when { color: #b45309; }
.pb-v-list .vt-when, .vt.is-applied .vt-when { white-space: normal; }
.vt.is-applied { --vt-line: #6ee7b7; --vt-accent: var(--success-700); --vt-stub: transparent; --vt-bg: var(--success-50); }
.vt.is-applied .vt-name { font-size: 13px; }
/* Trong popup thanh toán: chữ voucher nhỏ hơn 1 nấc cho cân với các dòng tiền */
.pb-vouchers .vt-stub { width: 66px; }
.pb-vouchers .vt-stub b { font-size: 17px; }
.pb-vouchers .vt-name { font-size: 12.5px; }
.pb-vouchers .vt-when { font-size: 11.5px; }
.pb-vouchers .vt-apply, .pb-vouchers .vt-using { height: 28px; padding: 0 12px; font-size: 12px; }
.pb-vouchers .vt-check { width: 22px; height: 22px; }
.vt.is-applied .vt-stub small { font-size: 8px; letter-spacing: .02em; }
.vt-check { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--success, #34d399); color: #fff; }
.pb-v-off { align-self: flex-start; padding: 0; margin-top: 2px; font-size: 12px; }
/* Popup mua gói */
.pb-vouchers { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.pb-v-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; }
.pb-v-h { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.pb-v-more { font-size: 12px; white-space: nowrap; }
.pb-v-explain { margin: 0; padding: 8px 12px; border: 1px solid #fde68a; border-radius: 10px; background: #fffbeb; font-size: 12px; line-height: 1.5; color: #78350f; }
.pb-v-list { display: flex; flex-direction: column; gap: 8px; }
.pb-sum-row.is-voucher b { color: var(--success-700); }
.pd-total.has-voucher { flex-wrap: wrap; align-items: center; }
.pd-total > span { white-space: nowrap; }
.pd-total-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; margin-left: auto; }
.pd-total-old { font-size: 13px; color: var(--ink-soft); }
.pd-save { white-space: nowrap; padding: 2px 10px; border-radius: 999px; background: var(--success-50); color: var(--success-700); font-size: 12px; font-weight: 700; }
/* Danh sách ở trang Gói & thanh toán: 3 thẻ / hàng, nhiều hơn thì kéo ngang (hít khớp từng thẻ) */
.pay-vcard { display: flex; flex-direction: column; gap: 10px; }
.pay-vhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pay-vhead .set-title { margin: 0; }
.pay-vcount { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); font-size: 12px; font-weight: 700; vertical-align: 2px; }
.pay-vnav { display: flex; gap: 6px; }
.pay-vtrack { display: flex; gap: 12px; padding: 8px 2px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.pay-vtrack::-webkit-scrollbar { display: none; }
.pay-vtrack.is-drag { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.pay-vtrack > .vt { flex: 0 0 calc((100% - 12px) / 3); scroll-snap-align: start; }
@media (max-width: 640px) { .pay-vtrack > .vt { flex-basis: 88%; } }
.tfb-done .pay-vtrack { justify-content: center; }
.tfb-done .pay-vtrack > .vt { flex-basis: 100%; text-align: left; }
/* Hộp phản hồi khi hết dùng thử */
body:has(#modal-trial-fb-toggle:checked) #modal-trial-fb { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#modal-trial-fb-toggle:checked) #modal-trial-fb .modal-box { transform: scale(1); opacity: 1; }
.tfb-box { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 22px 22px 18px; }
.tfb-box h2 { margin: 0 0 4px; font-size: 18px; }
.tfb-box > p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-soft); }
.tfb-gift { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--primary-50); border: 1px solid var(--primary-100); font-size: 13px; color: var(--ink); }
.tfb-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; border: 0; }
.tfb-reasons legend { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 600; }
.tfb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; }
.tfb-chip:hover { background: var(--bg); }
.tfb-chip:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.tfb-chip:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.tfb-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tfb-done { text-align: center; }
.pb-code { margin: 0; font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.pb-act { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 12px; }
.pb-main { width: 100%; min-height: 44px; justify-content: center; font-size: 15px; }
.pb-wait { display: flex; align-items: center; gap: 6px; margin: 0; }
.pb-links { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pb-links .is-danger { color: var(--danger); }
.pb-safe { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 12px; color: var(--ink-soft); }
.pb-col-sum .pay-done { margin: 0; }
.pb-note { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--primary-100); border-radius: var(--radius-md); background: var(--primary-50); font-size: 13px; color: var(--ink-soft); }
.pb-note svg { flex: 0 0 auto; margin-top: 1px; color: var(--primary-600); }
.pb-note b { display: block; margin-bottom: 2px; color: var(--ink); }
.pb-note ul { margin: 0; padding-left: 18px; }
@media (max-width: 860px) {
  .pb-grid { grid-template-columns: 1fr; }
  .pd-steps li { font-size: 0; gap: 0; }
  .pd-steps li.is-on { font-size: 13px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }

/* Lịch sử đơn hàng (settings.js settingsPayHistoryHTML): lọc trạng thái + khoảng ngày, bảng 7 cột, phân trang; nút cao 32px */
.ord-title { margin-bottom: 6px; }
.ord-title .set-title { margin: 0; }
.ord-title .set-note { margin: 2px 0 0; }
.ord-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.ord-filters .form-control { height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.ord-filters > .form-control:not(.cselect-native) { flex: 0 0 210px; width: 210px; max-width: 100%; } /* ô chọn tùy biến (cselect-btn) đứng ngay sau <select> gốc */
.ord-range { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-soft); font-size: 13px; }
.ord-range .form-control { width: 132px; height: 28px; padding: 0 4px; border: 0; background: transparent; box-shadow: none; }
.ord-table { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: var(--radius-md); overflow: hidden; }
.ord-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) minmax(84px, .9fr) 64px minmax(96px, 1fr) minmax(118px, 1fr) minmax(92px, .9fr) 40px; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; color: var(--ink); }
.ord-row:last-child { border-bottom: 0; }
.ord-head { padding-top: 10px; padding-bottom: 10px; background: var(--bg); font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.ord-c { text-align: center; }
.ord-r { text-align: right; }
.ord-code-cell { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ord-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; color: var(--ink); }
.ord-copy { width: 22px; height: 22px; color: var(--ink-soft); }
.ord-plan { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; border: 1px solid var(--border-soft); color: var(--ink); background: var(--bg); }
/* Đơn gói dùng nhãn gói vương miện (.plan-tag), chỉ chỉnh cỡ cho bảng; đơn tiện ích viền vàng như thẻ Extension */
.ord-plan.plan-tag { height: 24px; margin-left: 0; padding: 0 9px 0 7px; font-size: 12px; font-style: normal; }
.ord-plan.is-addon { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ord-plan.is-xu { color: var(--ink-soft); }
.ord-amt { font-weight: 600; white-space: nowrap; }
.ord-st { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--border-soft); color: var(--ink-soft); }
.ord-st.is-paid { background: #dcfce7; color: #15803d; }
.ord-st.is-pending { background: #fff7ed; color: #c2410c; }
.ord-st.is-review_required { background: var(--warning-50); color: var(--warning-700); }
.ord-st.is-cancelled { background: #ffe4e6; color: #e11d48; }
.ord-time { display: flex; flex-direction: column; line-height: 1.35; font-size: 13px; }
.ord-time small { color: var(--ink-soft); font-size: 12px; }
.ord-act { display: flex; justify-content: flex-end; }
.ord-view { width: 30px; height: 30px; border-radius: 8px; color: var(--primary-600); }
.ord-view:hover { background: var(--primary-50); }
.ord-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.ord-pager { display: flex; gap: 6px; }
.ord-pager button { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.ord-pager button.is-on { border-color: var(--primary); background: var(--primary); color: #fff; }
.ord-pager button:disabled { opacity: .45; cursor: not-allowed; }
.ord-pager button:not(:disabled):not(.is-on):hover { background: var(--primary-50); }
.empty-mini-box { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 0; font-size: 14px; color: var(--ink-soft); }
.empty-mini-box p { margin: 0; }

@media (max-width: 900px) { .stat-tiles.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .stat-tiles.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ord-head { display: none; }
  .ord-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "code amt act" "plan st act" "time time act"; row-gap: 4px; }
  .ord-row > :nth-child(1) { grid-area: code; }
  .ord-row > :nth-child(2) { grid-area: plan; }
  .ord-row > :nth-child(3) { display: none; }
  .ord-row > :nth-child(4) { grid-area: amt; }
  .ord-row > :nth-child(5) { grid-area: st; text-align: right; }
  .ord-row > :nth-child(6) { grid-area: time; flex-direction: row; gap: 6px; color: var(--ink-soft); }
  .ord-row > :nth-child(7) { grid-area: act; }
  .ord-range { flex: 1 1 100%; }
  .ord-range .form-control { flex: 1; width: auto; min-width: 0; }
  .ord-filters > .form-control:not(.cselect-native) { flex: 1 1 100%; width: auto; }
  .cycle-toggle { flex-wrap: wrap; }
}

/* Báo cáo › Đội nhóm: đầu trang 1 hàng bộ lọc, bảng theo người, bảng nhiệt theo ngày */
.rep-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.rep-head h1 { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 22px; color: var(--ink); }
.rep-head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rep-head-tools .report-select { width: auto; min-width: 0; }
.date-range { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font-size: 14px; color: var(--ink-soft); }
.date-range input { border: 0; background: transparent; font: inherit; color: var(--ink); }
.date-range:focus-within { border-color: var(--primary); }
.rep-search { margin-bottom: 10px; max-width: 320px; }
.rep-mrow { cursor: pointer; }
.rep-mrow:hover td, .rep-mrow:focus-visible td { background: var(--primary-50); }
.rep-mrow:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.rep-open { display: inline-flex; align-items: center; gap: 8px; }
.rep-open b { min-width: 22px; }
.rep-bar { width: 80px; height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.rep-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.rep-zero { color: var(--muted); }
.badge.is-danger { background: var(--danger-50); color: var(--danger-600); }
.rep-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 0; font-size: 14px; color: var(--ink-soft); }
.rep-empty p { margin: 0; }
.rep-tasks { display: flex; flex-direction: column; gap: 8px; }
.rep-task { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: 14px; text-align: left; color: var(--ink); cursor: pointer; }
.rep-task:hover { border-color: var(--primary-100); background: var(--primary-50); }
.rep-task-sub { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-soft); }
.rt-bar { height: 10px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.rt-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.rt-bar.is-high i { background: var(--warning); }
.rt-bar.is-over i { background: var(--danger); }
.rt-legend-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }
.rt-key { display: inline-flex; align-items: center; gap: 5px; }
.rt-key::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--primary-100); }
.rt-key.is-high::before { background: var(--warning-100); }
.rt-key.is-over::before { background: var(--danger-100); }
.rt-heat { border-collapse: separate; border-spacing: 4px; font-size: 13px; }
.rt-heat thead th { padding: 4px 6px; font-weight: 600; white-space: nowrap; color: var(--ink-soft); }
.rt-heat tbody th { position: sticky; left: 0; z-index: 1; min-width: 170px; padding: 4px 8px 4px 0; background: var(--surface); text-align: left; font-weight: 400; }
.rt-heat td { padding: 0; }
.rt-cell { width: 100%; min-width: 76px; padding: 9px 6px; border: 0; border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; }
.rt-cell.is-empty { background: var(--bg); color: var(--muted); font-weight: 400; }
.rt-cell.is-low { background: var(--primary-50); color: var(--primary-600); }
.rt-cell.is-high { background: var(--warning-100); color: var(--warning-700); }
.rt-cell.is-over { background: var(--danger-100); color: var(--danger-600); }
.rt-cell:hover { box-shadow: inset 0 0 0 2px currentColor; }
.report-card > .sub-tabs, .report-body > .sub-tabs { margin-bottom: 12px; }
@media (max-width: 767px) {
  .rep-head-tools { width: 100%; }
  .rep-head-tools > * { flex: 1 1 140px; }
  .rep-bar { display: none; }
}
.rep-members-card .report-table-scroll, .rt-heat-wrap { height: auto; max-height: 560px; }
.rt-heat-wrap { overflow-x: auto; }
.rep-members-card .report-table { font-size: 14px; }
.rt-heat thead th:first-child { text-align: left; }

/* Báo cáo › Đội nhóm (reports.js tg*): dải gợi ý, 4 ô số, bảng gom theo nhóm, khung chi tiết mở ngay dưới dòng người */
.tg-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.tg-period { display: inline-flex; align-items: center; gap: 2px; box-sizing: border-box; height: var(--toolbar-h); padding: 0 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.tg-period .icon-btn { width: 28px; height: 28px; }
.tg-period-label { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.tg-period-label svg { color: var(--primary-600); }
.tg-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin: 4px 0 12px; border-bottom: 1px solid var(--border); }
.tg-bar .sub-tabs { margin: 0; border-bottom: 0; }
.tg-bar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-bottom: 6px; }
.tg-bar-tools .rep-compare { margin-left: 0; }
.tg-bar-tools .rep-search { width: 220px; margin: 0; }
.tg-table { font-size: 14px; }
.tg-table td { vertical-align: middle; }
.tg-table td:first-child { min-width: 180px; }
/* Bảng Đội nhóm cao theo nội dung (khung chi tiết mở dưới dòng không bị cắt trong vùng cuộn 300px của bảng báo cáo) */
.tg-card .report-table-scroll { height: auto; max-height: none; }
.tg-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tg-who b { font-weight: 600; color: var(--ink); }
.tg-who small { font-size: 12px; color: var(--ink-soft); }
.tg-rate { font-weight: 700; }
.tg-rate.is-good { color: var(--success-700); }
.tg-rate.is-mid { color: var(--warning-700); }
.tg-rate.is-bad { color: var(--danger-600); }
.tg-group td { background: var(--bg); }
.tg-row.is-open td { background: var(--primary-50); }
/* Thẻ chi tiết 1 người: thẻ nhỏ nổi ngay dưới dòng vừa bấm (reports.js tgPopRender), gắn ở body để bảng cuộn không cắt */
.tg-pop { position: absolute; z-index: 55; width: 300px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); font-size: 13px; color: var(--ink); }
.tg-pop[hidden] { display: none; }
.tg-pop::before { content: ""; position: absolute; top: -6px; left: var(--tg-arrow, 24px); width: 10px; height: 10px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); background: var(--surface); transform: rotate(45deg); }
.tg-pop.is-new { animation: tg-pop-in .2s ease-out; }
@keyframes tg-pop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.tg-dhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tg-dhead .tg-who { flex: 1; }
.tg-dhead .tg-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-dhead .tg-who b { font-size: 14.5px; }
.tg-dhead .badge { flex: none; font-size: 11.5px; }
.tg-h4 { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); }
.tg-days { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.tg-cols { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 76px; padding: 0 4px; }
.tg-col { flex: 1; display: flex; align-items: flex-end; min-width: 0; height: 100%; }
.tg-col i { display: block; width: 100%; max-width: 28px; min-height: 2px; margin: 0 auto; border-radius: 5px 5px 0 0; background: var(--primary); }
.tg-col i.is-over { background: var(--danger); }
.tg-col i.is-high { background: var(--warning); }
.tg-std { position: absolute; left: 0; right: 0; bottom: var(--std); z-index: 1; border-top: 1.5px dashed var(--warning); pointer-events: none; }
.tg-col-labels { display: flex; gap: 10px; padding: 4px 4px 0; }
.tg-cols.is-many, .tg-col-labels.is-many { gap: 3px; }
.tg-col-labels span { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; font-size: 11px; color: var(--ink-soft); }
.tg-col-labels b { font-weight: 600; color: var(--ink); }
.tg-col-labels.is-many b { font-size: 9.5px; font-weight: 400; color: var(--ink-soft); }
.tg-dtasks { display: flex; flex-direction: column; }
.tg-dtask { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -6px; padding: 7px 6px; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; background: transparent; font: inherit; font-size: 13px; text-align: left; color: var(--ink); cursor: pointer; }
.tg-dtask:last-of-type { border-bottom: 0; }
.tg-dtask:hover { background: var(--bg); }
.tg-dtask > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-dtask .badge { flex: none; font-size: 11px; }
.tg-dtasks .wf-link-btn { align-self: flex-start; margin-top: 4px; font-size: 12.5px; }
.tg-pop .empty-mini { margin: 0; }
.tg-dacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.tg-dacts.is-one { grid-template-columns: 1fr; }
.tg-pop-btn { height: 34px; padding: 0 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.tg-pop-btn:hover { background: var(--bg); }
.tg-pop-btn.is-ai { border-color: #ddd6fe; background: #f5f3ff; color: #7c3aed; }
.tg-pop-btn.is-ai:hover { background: #ede9fe; }
.tg-pop-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tg-tip { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 6px; width: 230px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); font-size: 13px; pointer-events: none; }
.tg-tip[hidden] { display: none; }
.tg-tip-who { font-size: 13.5px; color: var(--ink); }
.tg-tip-row { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-soft); }
.tg-tip-row b { color: var(--ink); }
.tg-tip-row.is-over, .tg-tip-row.is-over b { color: var(--danger-600); }
.tg-tip small { font-size: 12px; color: var(--ink-soft); }
.tg-start { position: relative; display: flex; align-items: flex-start; gap: 16px; }
.tg-start-hide { position: absolute; top: 10px; right: 12px; font-size: 13px; }
.tg-start-ico { display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--primary-50); color: var(--primary-600); }
.tg-start h3 { margin: 0 0 4px; font-size: 16px; color: var(--ink); }
.tg-start p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-soft); }
.tg-steps { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.tg-steps li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.tg-steps li b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-50); color: var(--primary-600); font-size: 12px; }
.tg-heat th small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.tg-heat .tg-heat-sum { padding: 4px 8px; white-space: nowrap; text-align: right; }
.tg-heat .rt-cell { min-width: 52px; }
@media (prefers-reduced-motion: reduce) {
  .tg-pop.is-new { animation: none; }
}
@media (max-width: 767px) {
  .tg-bar-tools, .tg-bar-tools .rep-search { width: 100%; }
  .tg-start { flex-direction: column; }
}

/* Thanh trên cùng đi theo khi cuộn trang (logo, tìm kiếm, chuông luôn trong tầm tay) */
.topbar { position: sticky; top: 0; z-index: 30; }
/* Nhãn gói cạnh tên không gian làm việc: cùng hàng, nhẹ hơn tên */
.sidebar-brand-text .ws-name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ws-name-row > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Nhãn gói cạnh tên workspace = nhãn gói vương miện (.plan-tag), chỉ gọn lại cho thanh đầu trang */
.ws-plan-badge.plan-tag { flex: none; margin-left: 0; height: 18px; padding: 0 7px 0 5px; gap: 3px; font-size: 10.5px; font-style: normal; line-height: 1; }
.ws-plan-badge .plan-tag-ico { width: 11px; height: 11px; }
/* Menu Cài đặt không cao quá màn hình: cuộn tới đáy trang không bị đẩy lên dưới thanh trên cùng */
/* Tiêu đề "Cài đặt" đứng yên, chỉ .set-nav-list cuộn (thanh cuộn bắt đầu ngay dưới tiêu đề) */
.set-nav { margin-top:4px , max-height: calc(100vh - var(--topbar-h, 64px) - 15px); overflow: hidden; }
.set-nav-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: clamp(12px, 1.22vw, 20px); overflow-y: auto; padding-bottom: 12px; }
@media (max-width: 767px) { .set-nav { max-height: none; overflow: visible; } .set-nav-list { overflow: visible; } }
/* Thẻ số ở Báo cáo tổng quát: mỗi loại 1 màu (cùng bộ màu thẻ số Tổng quan dự án .ov-tile) để dễ phân biệt */
:is(.report-tile, .rep-tile)[data-kind="open"] { --ovt-bg: var(--primary-50); --ovt-line: var(--primary-100); --ovt-ink: var(--primary-600); }
:is(.report-tile, .rep-tile)[data-kind="overdue"] { --ovt-bg: var(--danger-50); --ovt-line: var(--danger-100); --ovt-ink: var(--danger-600); }
:is(.report-tile, .rep-tile)[data-kind="next7"] { --ovt-bg: var(--warning-50); --ovt-line: var(--warning-100); --ovt-ink: var(--warning-600); }
:is(.report-tile, .rep-tile)[data-kind="done"] { --ovt-bg: var(--success-50); --ovt-line: var(--success-100); --ovt-ink: var(--success-600); }
:is(.report-tile, .rep-tile)[data-kind] { background: var(--ovt-bg); border-color: var(--ovt-line); }
:is(.report-tile, .rep-tile)[data-kind]:hover { border-color: var(--ovt-ink); }
:is(.report-tile, .rep-tile)[data-kind] :is(.report-tile-value, .rep-tile-value, .report-tile-label, .rep-tile-label) { color: var(--ovt-ink); }
.rep-tile[data-kind].is-on { border-color: var(--ovt-ink); box-shadow: 0 0 0 1px var(--ovt-ink); }
/* Đầu trang báo cáo: ô chọn / nút theo chuẩn --toolbar-h (xem quy tắc thanh công cụ chung); ô khoảng ngày + nhóm Ngày/Tuần/Tháng cao bằng */
.rep-head-tools :is(.date-range, .wl-span) { box-sizing: border-box; height: var(--toolbar-h); align-items: center; }
.rep-head-tools .date-range { padding-top: 0; padding-bottom: 0; font-size: 13px; }
.rep-head-tools .wl-span-btn { height: calc(var(--toolbar-h) - 6px); padding: 0 10px; }
/* Nhãn số theo cột ở Báo cáo › Đội nhóm (cùng màu thẻ số): Chưa xong xanh dương, Hạn tới cam */
.badge.is-info { background: var(--primary-50); color: var(--primary-600); }
.badge.is-soon { background: var(--warning-100); color: var(--warning-600); }
.badge.is-review { background: #f3e8ff; color: #7c3aed; }
.report-num[data-kind="review"], .report-num[data-kind="reviewLong"] { background: #f3e8ff; color: #7c3aed; }
.report-num[data-kind="review"]:hover, .report-num[data-kind="reviewLong"]:hover { border-color: #7c3aed; background: #ede9fe; }
/* Hồ sơ: nút "Xóa" ảnh dạng chữ đỏ (viền chỉ hiện khi rê), email chỉ đọc có icon khóa, công tắc ẩn trạng thái trong thẻ riêng */
.set-text-danger { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--danger-600); cursor: pointer; }
.set-text-danger:hover, .set-text-danger:focus-visible { border-color: var(--danger-100); background: var(--danger-50); }
.set-readonly-wrap { position: relative; display: block; }
.set-readonly-wrap .form-control { padding-right: 34px; }
.set-readonly-wrap svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); pointer-events: none; }
.set-switch-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.set-switch-card .set-title { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 2px; }
.set-switch-card .form-hint { margin: 0; }
.form-label .info-tip { vertical-align: middle; }

/* Check Log: đầu trang có nhãn khóa, thanh lọc 1 hàng, bảng nhóm theo ngày, loại có màu, mã đơn dạng chip chép được */
.logs-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logs-title h1 { margin: 0; font-size: 22px; color: var(--ink); }
.logs-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--warning-50); color: var(--warning-700); font-size: 13px; font-weight: 600; }
.logs-bar { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.logs-bar .form-control { width: auto; font-size: 14px; }
.logs-search { flex: 1 1 260px; min-width: 200px; }
.logs-search .search-field { width: 100%; }
.toolbar .date-range { box-sizing: border-box; height: var(--toolbar-h); padding-top: 0; padding-bottom: 0; font-size: 13px; }
.logs-chips { flex-wrap: wrap; margin: 0 0 12px; }
.logs-count { color: var(--ink-soft); }
.logs-card { padding: 0; overflow: hidden; }
.log-table { display: flex; flex-direction: column; }
.log-row2 { display: grid; grid-template-columns: 52px 150px 104px minmax(0, 1.15fr) minmax(0, 1fr) 96px; gap: 12px; align-items: center; min-height: 40px; padding: 5px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; color: var(--ink); }
.log-row2[data-action] { cursor: pointer; }
.log-row2[data-action]:hover, .log-row2[data-action]:focus-visible { background: var(--primary-50); outline: none; }
.log-head { min-height: 38px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); }
.log-day { padding: 7px 16px; background: var(--primary-50); font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--primary-100); }
/* Chú thích đủ nội dung khi bị cắt (logs.js logTipCheck): cùng kiểu chú thích của .pl-name-btn, hiện dưới dòng, thẳng cột Hoạt động */
.logs-card { overflow: visible; }
.log-table > .log-row2:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.log-row2[data-tip] { position: relative; --log-tip-left: 358px; }
.log-row2.has-tip::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 4px); left: var(--log-tip-left); z-index: 6;
  max-width: min(640px, calc(100% - var(--log-tip-left) - 16px)); padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm);
  color: var(--ink); font-size: 12.5px; font-weight: 500; line-height: 1.5; white-space: normal; overflow-wrap: anywhere;
  opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none;
  transition: opacity 0.15s ease 0.25s, transform 0.15s ease 0.25s, visibility 0s linear 0.4s;
}
.log-row2.has-tip:hover::after, .log-row2.has-tip:focus-visible::after { opacity: 1; visibility: visible; transform: none; transition-delay: 0.25s, 0.25s, 0s; }
/* 2 dòng cuối: hiện lên trên để khỏi tràn khỏi khung */
.log-table > .log-row2:nth-last-child(-n+2).has-tip::after { top: auto; bottom: calc(100% + 4px); transform: translateY(4px); }
@media (prefers-reduced-motion: reduce) { .log-row2.has-tip::after { transition: none; } }
.log-head > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.log-head svg { flex: none; color: var(--primary-600); }
@media (max-width: 1180px) and (min-width: 768px) {
  .log-row2 { grid-template-columns: 48px 140px 100px minmax(0, 1.15fr) minmax(0, 1fr) 20px; }
  .log-c-more { font-size: 0; } /* hẹp: chỉ còn mũi tên */
  .log-row2[data-tip] { --log-tip-left: 340px; }
}
.log-day > span { display: inline-flex; align-items: center; gap: 8px; }
.log-day svg { color: var(--primary-600); }
.log-day b { font-weight: 700; }
.log-day small { font-size: 12.5px; color: var(--muted); }
.log-c-time { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.log-c-who .log-member { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.log-member-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-sys-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--ink-soft); }
.log-c-msg { min-width: 0; font-weight: 600; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Cột Chi tiết: chữ xám 1 dòng, dài thì "…" (rê dòng xem đủ, bấm mở ngăn kéo) */
.log-c-detail { min-width: 0; font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-c-detail .log-project-tag { margin-right: 0; padding: 0 7px; font-size: 12px; vertical-align: 1px; }
.log-dsep { margin: 0 6px; color: var(--muted); }
.log-none { color: var(--muted); }
.log-c-more { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; font-size: 12.5px; font-weight: 500; color: var(--primary-600); white-space: nowrap; }
.log-row2[data-action]:not(:hover):not(:focus-visible) .log-c-more { opacity: 0.75; }
.log-c-who .avatar { width: 26px; height: 26px; font-size: 11px; }
.log-c-who .log-member { font-weight: 500; }
.log-type { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--ink-soft); }
.log-type.is-pay { background: var(--warning-50); color: var(--warning-700); }
.log-type.is-task { background: var(--primary-50); color: var(--primary-600); }
.log-type.is-project { background: #f3e8ff; color: #7c3aed; }
.log-type.is-member { background: var(--success-50); color: var(--success-700); }
.log-type.is-setting { background: var(--danger-50); color: var(--danger-600); }
.log-code { display: inline-flex; align-items: center; gap: 4px; margin: 0 2px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.log-code:hover, .log-code:focus-visible { border-color: var(--primary); color: var(--primary-600); }
.logs-foot { padding: 12px 16px; text-align: center; font-size: 13px; color: var(--ink-soft); }
/* Chi tiết bản ghi Check Log (logs.js logOpenDetail): tiêu đề lớn trong thân, thẻ nội dung nổi bật, các dòng có icon */
#rep-drawer[data-kind="log"] .drawer-head { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 0; border: 0; background: transparent; }
#rep-drawer[data-kind="log"] .drawer-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* giữ cho trình đọc màn hình */
.lgd-hero { display: flex; align-items: center; gap: 12px; margin: 2px 40px 14px 0; }
.lgd-hero-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100)); color: var(--primary-600); }
.lgd-hero strong { display: block; font-size: 17px; color: var(--ink); }
.lgd-hero small { font-size: 12.5px; color: var(--muted); }
.lgd-msg { --mc: var(--primary-600); --mb: var(--primary-50); display: flex; gap: 12px; padding: 14px; border: 1px solid color-mix(in srgb, var(--mc) 18%, transparent); border-radius: 14px;
  background: linear-gradient(135deg, var(--mb), var(--surface)); }
.lgd-msg.is-pay { --mc: var(--warning-700); --mb: var(--warning-50); }
.lgd-msg.is-project { --mc: #7c3aed; --mb: #f3e8ff; }
.lgd-msg.is-member { --mc: var(--success-700); --mb: var(--success-50); }
.lgd-msg.is-setting { --mc: var(--danger-600); --mb: var(--danger-50); }
.lgd-msg-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); color: var(--mc); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.lgd-msg > div { min-width: 0; }
.lgd-msg p { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.lgd-rows { margin-top: 14px; border-top: 1px solid var(--border-soft); }
.lgd-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 4px; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent;
  font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; }
.lgd-row.is-link { cursor: pointer; border-radius: 8px; }
.lgd-row.is-link:hover, .lgd-row.is-link:focus-visible { background: var(--primary-50); outline: none; }
.lgd-label { flex: none; display: inline-flex; align-items: center; gap: 10px; width: 150px; color: var(--ink-soft); }
.lgd-label svg { color: var(--muted); }
.lgd-val { flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; text-align: right; }
.lgd-val .log-member { font-weight: 600; }
.lgd-chev { flex: none; color: var(--muted); }
.lgd-note { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--ink-soft); }
.lgd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.lgd-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; }
.lgd-foot { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--muted); }
@media (max-width: 480px) { .lgd-label { width: 120px; } .lgd-actions { grid-template-columns: 1fr; } }
#rep-drawer .plan-rows { margin-bottom: 14px; }
@media (max-width: 767px) {
  .log-head { display: none; }
  .log-row2 { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "time who type" "msg msg msg" "detail detail detail"; row-gap: 4px; padding: 8px 14px; }
  .log-c-time { grid-area: time; } .log-c-who { grid-area: who; } .log-c-type { grid-area: type; }
  .log-c-msg { grid-area: msg; white-space: normal; } .log-c-detail { grid-area: detail; white-space: normal; }
  .log-c-more, .log-c-detail:has(> .log-none:only-child) { display: none; }
  .log-row2.has-tip::after { display: none; } /* điện thoại: chữ đã xuống dòng đủ */
  .logs-bar .form-control { flex: 1 1 140px; }
}
/* Trang Tự động hóa: đầu trang + đồng hồ lượt chạy, thanh công cụ theo tab, tab Lặp lại / Trợ lý bỏ phần đầu trùng với tab */
.auto-head h1 { margin: 0; font-size: 22px; color: var(--ink); }
.auto-sub { display: flex; align-items: center; gap: 4px; margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.auto-quota-meter { width: min(280px, 100%); font-size: 13px; color: var(--ink-soft); }
.auto-toolbar { flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.auto-search { flex: 0 1 260px; min-width: 180px; }
.auto-search .search-field { width: 100%; }
.auto-tab-body .rec-manage-head { display: none; }
.auto-tab-body .rec-manage { margin-top: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.auto-chat-card { margin-top: 12px; }
.auto-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.auto-empty-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); }
.auto-drawer-tools { margin: 12px 0; }
#rep-drawer .auto-flow { margin-top: 10px; }
@media (max-width: 1100px) { .auto-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .auto-card-grid { grid-template-columns: minmax(0, 1fr); } .auto-search { flex: 1 1 100%; } }
/* Hộp thoại Thêm quy tắc: Bắt đầu nhanh, tên + phạm vi 1 hàng, chip biến chèn vào ô nội dung, nhãn TÓM TẮT */
.ar-quick { margin-bottom: 12px; }
.ar-top.ar-top-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 0; border: 0; background: none; }
.ar-scope-btn { width: auto; min-width: 200px; max-width: 320px; }
.ar-vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.ar-var { padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.ar-var:hover, .ar-var:focus-visible { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); }
.ar-summary-label { text-transform: uppercase; letter-spacing: .05em; font-size: 12px; font-weight: 700; }
.ar-sub-title .info-tip { vertical-align: middle; }
@media (max-width: 640px) { .ar-top.ar-top-row { grid-template-columns: minmax(0, 1fr); } .ar-scope-btn { max-width: none; width: 100%; } }
/* Hộp thoại Trợ lý định kỳ: 640px, khối Lịch gửi nền xám, người nhận dạng chip + danh sách 3 cột */
.agent-row.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agent-row.is-3 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.agent-sched { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg); }
.agent-sched-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--ink); }
.agent-tpl-line { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.agent-tz-line { margin: 0; font-size: 13px; color: var(--ink-soft); }
.agent-rcp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.agent-rcp-head .form-label { margin: 0; }
.agent-count { margin-left: auto; font-size: 13px; color: var(--ink-soft); }
.agent-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.agent-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); font-size: 13px; font-weight: 600; }
.agent-chip button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.agent-chip button:hover, .agent-chip button:focus-visible { background: var(--primary-100); }
.agent-people .ar-check.is-disabled { opacity: .45; cursor: not-allowed; }
.req { color: var(--danger-600); }
@media (max-width: 640px) { .agent-row.is-2, .agent-people { grid-template-columns: minmax(0, 1fr); } }
/* Ngăn kéo chi tiết quy tắc: tiêu đề dài gọn lại, lịch sử chạy dạng dòng thời gian (không cuộn lồng trong ngăn kéo) */
#rep-drawer .drawer-head h2 { font-size: 16px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.adr { margin-top: 18px; }
.adr-title { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.adr-empty { margin: 0; padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius-md); text-align: center; font-size: 14px; color: var(--ink-soft); }
.adr-list { position: relative; list-style: none; margin: 0; padding: 0 0 0 18px; }
.adr-list::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--border-soft); }
.adr-run { --c: var(--success); --cbg: var(--success-50); --cink: var(--success-700); position: relative; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.adr-run:hover { border-color: var(--border); box-shadow: var(--shadow-sm); }
.adr-run::before { content: ""; position: absolute; left: -18px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--surface); }
.adr-run.is-partial, .adr-run.is-skipped { --c: var(--warning-600); --cbg: var(--warning-50); --cink: var(--warning-700); }
.adr-run.is-error { --c: var(--danger); --cbg: var(--danger-50); --cink: var(--danger-600); }
.adr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.adr-badge { padding: 1px 9px; border-radius: 999px; background: var(--cbg); color: var(--cink); font-size: 12px; font-weight: 700; }
.adr-top time { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.adr-task { display: block; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; text-align: left; color: var(--primary-600); cursor: pointer; overflow-wrap: anywhere; }
button.adr-task:hover, button.adr-task:focus-visible { text-decoration: underline; }
.adr-reason { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.adr-steps { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--border-soft); display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink); }
.adr-steps li { display: flex; align-items: baseline; gap: 8px; }
.adr-steps b { font-weight: 600; }
.adr-steps em { font-style: normal; font-size: 12px; color: var(--ink-soft); }
.adr-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--success); transform: translateY(-1px); }
.adr-steps .is-skip .adr-dot { background: var(--warning-600); }
.adr-steps .is-error .adr-dot { background: var(--danger); }
.adr-steps .is-notrun .adr-dot { background: var(--muted); }
@media (prefers-reduced-motion: reduce) { .adr-run { transition: none; } }
.auto-flow-step.is-empty { opacity: 0.45; } /* chưa có điều kiện: mờ cả bước NẾU để nhận ra ngay */
/* Biểu mẫu tiếp nhận (người sửa được): 1 thẻ cấu hình + thanh lưu dính đáy thẻ; xem trước dính bên phải */
.ik-card { display: flex; flex-direction: column; gap: 14px; padding-bottom: 0; }
.ik-head { display: flex; align-items: center; gap: 10px; }
.ik-head .set-title { margin: 0; }
.ik-open { margin-left: auto; }
.ik-sub { display: flex; align-items: center; gap: 4px; margin: -8px 0 0; }
.ik-link { display: flex; gap: 8px; }
.ik-link .form-control { flex: 1; min-width: 0; font-size: 14px; color: var(--ink-soft); }
.ik-copy { flex: none; min-width: 96px; justify-content: center; }
.ik-copy.is-done { border-color: var(--success-100); background: var(--success-50); color: var(--success-700); }
.ik-link-more { margin: -6px 0 0; font-size: 13px; color: var(--ink-soft); }
.ik-label { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ik-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-top: 1px solid var(--border-soft); border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; }
.ik-row:hover { background: var(--bg); }
.ik-row.is-hl { background: var(--primary-50); box-shadow: inset 3px 0 0 var(--primary); }
.ik-row-text { flex: 1; min-width: 0; }
.ik-row-text b { display: block; font-size: 14px; color: var(--ink); }
.ik-row-text small { display: block; font-size: 13px; color: var(--ink-soft); }
.ik-lock { display: inline-flex; color: var(--warning-600); }
.ik-ctrl { display: flex; align-items: center; gap: 10px; }
.ik-req { padding: 2px 8px; border: 1px solid transparent; border-radius: 999px; background: none; font: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.ik-req.is-req { color: var(--danger-600); font-weight: 600; }
.ik-req:hover, .ik-req:focus-visible { border-color: var(--border); background: var(--surface); }
.ik-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ik-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 14px; color: var(--ink); }
.ik-chip button { width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.ik-chip button:hover, .ik-chip button:focus-visible { background: var(--danger-50); color: var(--danger-600); }
.ik-chip-av.avatar, .ik-chip .avatar { width: 24px; height: 24px; font-size: 10px; }
.ik-add-wrap { position: relative; }
.ik-add { padding: 4px 12px; border: 1px dashed var(--border); border-radius: 999px; background: none; font: inherit; font-size: 14px; color: var(--primary-600); cursor: pointer; }
.ik-add:hover, .ik-add:focus-visible, .ik-add[aria-expanded="true"] { border-color: var(--primary); background: var(--primary-50); }
.ik-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: 260px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-lg); }
.ik-pop-list { max-height: 220px; overflow-y: auto; margin-top: 6px; }
.ik-pop-list .pl-pop-option { display: flex; align-items: center; gap: 8px; width: 100%; }
.ik-section.has-error .ik-chips { padding: 6px; border: 1px solid var(--danger); border-radius: var(--radius-sm); }
.ik-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 8px; margin: 0 -22px; padding: 12px 22px; border-top: 1px solid var(--border-soft); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--surface); }
.ik-dirty { margin-right: auto; font-size: 13px; font-weight: 600; color: var(--warning-600); }
.ik-clean { margin-right: auto; font-size: 13px; color: var(--ink-soft); }
.intake-pv-field { border-radius: var(--radius-sm); transition: background .2s, box-shadow .2s; }
.intake-pv-field.is-hl { background: var(--primary-50); box-shadow: 0 0 0 6px var(--primary-50), 0 0 0 7px var(--primary-100); }
@media (max-width: 900px) { .intake-grid { grid-template-columns: minmax(0, 1fr); } .intake-col-preview { position: static; } }
@media (prefers-reduced-motion: reduce) { .ik-row, .intake-pv-field { transition: none; } }

/* ===== Hộp thoại Sửa dự án (projects.js openEditProjectModal / ep*) =====
   Tên to + chấm màu, 10 chấm màu + "+ Tùy chọn", 2 thẻ quyền xem, công tắc, vùng nguy hiểm; màu theo biến chủ đề */
.ep-box { width: min(520px, 100%); }
.ep-head-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.ep-more { position: relative; }
.ep-more[hidden] { display: none; }
.ep-more-btn { border-color: transparent; background: transparent; }
.ep-more-btn:hover, .ep-more-btn[aria-expanded="true"] { border-color: var(--border); background: var(--bg); }
.ep-more-menu { min-width: 170px; }
.ep-more-menu[hidden] { display: none; }
.ep-label { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ep-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ep-swatch { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: var(--sw); cursor: pointer; transition: transform 0.12s; }
.ep-swatch:hover { transform: scale(1.1); }
/* Màu đang chọn: viền ngoài (khoảng trắng + vòng màu) */
.ep-swatch.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.ep-swatch:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.ep-swatch-more { height: 28px; padding: 0 10px; border: 1px dashed var(--border); border-radius: var(--radius-pill); background: transparent; color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ep-swatch-more:hover, .ep-swatch-more[aria-expanded="true"] { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); }
.ep-custom { margin-top: 10px; }
.ep-custom[hidden] { display: none; }
.ep-vis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ep-vis-card { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.ep-vis-card b { font-size: 14px; }
.ep-vis-card small { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.ep-vis-card:hover { border-color: var(--primary); }
.ep-vis-card.is-on { border-color: var(--primary-600); background: var(--primary-50); box-shadow: 0 0 0 1px var(--primary-600); }
.ep-vis-card:focus-visible, .ep-vis-alt:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ep-vis-alt { margin-top: 8px; padding: 4px 0; border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.ep-vis-alt:hover { color: var(--ink); text-decoration: underline; }
.ep-vis-alt.is-on { color: var(--primary-600); font-weight: 600; }
.ep-switch-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ep-switch-text { flex: 1; min-width: 0; }
.ep-switch-text b, .ep-danger b { display: block; font-size: 14px; color: var(--ink); }
.ep-switch-text small, .ep-danger small { display: block; font-size: 12.5px; color: var(--ink-soft); }
.ep-danger { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); border-radius: var(--radius-md); background: var(--danger-50); }
.ep-danger[hidden] { display: none; }
.ep-danger > div { flex: 1; min-width: 0; }
.ep-danger b { color: var(--danger-600); }
.ep-danger-btn { flex: none; padding: 6px 14px; border: 1px solid var(--danger-600); border-radius: var(--radius-sm); background: var(--surface); color: var(--danger-600); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ep-danger-btn:hover, .ep-danger-btn:focus-visible { background: var(--danger-600); color: #fff; outline: none; }
@media (max-width: 520px) { .ep-vis { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .ep-swatch, .ep-vis-card { transition: none; } }
/* Hộp xác nhận mạnh: gõ lại tên để xác nhận (shared.js moHopThoai nhapLai) */
.app-dialog-retype { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--ink-soft); text-align: left; }
.app-dialog-retype b { color: var(--ink); overflow-wrap: anywhere; }
.app-dialog-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== Form Thêm công việc kiểu ClickUp (tasks.js at*) =====
   Ô tên lớn không viền, "Thêm mô tả…", hàng pill thuộc tính có bảng nhỏ ngay dưới pill; màu theo biến chủ đề */
.at-box { width: min(560px, 100%); overflow: visible; }
.at-head { justify-content: space-between; padding: 14px 18px 0; border-bottom: 0; }
.at-head .icon-btn { margin-left: auto; }
.at-tpl { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.at-tpl.cselect-btn { display: inline-flex; align-items: center; gap: 6px; width: auto; }
.at-tpl:hover { border-color: var(--primary); color: var(--ink); }
.at-body { overflow: visible; padding: 10px 22px 6px; }
.at-name-field { margin-bottom: 4px; }
.at-name { width: 100%; padding: 4px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 22px; font-weight: 700; }
.at-name::placeholder { color: var(--muted); }
.at-name-field.has-error .at-name::placeholder { color: var(--danger); }
.at-desc-btn { display: block; padding: 2px 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: text; }
.at-desc-btn:hover { color: var(--ink-soft); }
.at-desc-btn[hidden], .at-desc[hidden] { display: none; }
.at-desc { margin-top: 4px; resize: vertical; }
.at-project { margin-top: 4px; }
/* Hàng pill */
.at-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.at-pill-wrap { position: relative; }
.at-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.at-pill:hover, .at-pill.is-open { border-color: var(--primary); color: var(--ink); }
.at-pill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.at-pill.has-value { color: var(--ink); }
.at-pill.is-late { border-color: var(--danger); color: var(--danger-600); background: var(--danger-50); }
.at-caret { font-size: 10px; color: var(--muted); }
.at-st-icon { flex: none; }
.at-flag { font-size: 13px; }
.at-pill.is-low, .at-opt.is-low .at-flag { --pc: var(--primary-600); }
.at-pill.is-medium, .at-opt.is-medium .at-flag { --pc: var(--warning-600); }
.at-pill.is-high, .at-opt.is-high .at-flag { --pc: var(--danger-600); }
.at-pill.is-low, .at-pill.is-medium, .at-pill.is-high { border-color: color-mix(in srgb, var(--pc) 40%, var(--border)); background: color-mix(in srgb, var(--pc) 10%, var(--surface)); }
.at-pill .at-flag, .at-opt .at-flag { color: var(--pc); }
.at-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.at-chip + .at-chip { margin-left: 2px; }
.at-chip.is-more { padding: 0 6px; border-radius: var(--radius-pill); background: var(--bg); font-size: 12px; }
.at-chip-av { width: 20px; height: 20px; font-size: 8.5px; flex: none; }
/* Bảng nhỏ dưới pill */
.at-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 190px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 2px; }
.at-pop[hidden] { display: none; }
.at-opt { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; box-sizing: border-box; }
.at-opt:hover, .at-opt:focus-visible, .at-opt.is-on, .at-opt:has(input:checked) { background: var(--primary-50); outline: none; }
.at-opt:has(input:focus-visible) { outline: 2px solid var(--primary); }
.at-opt input { position: absolute; opacity: 0; pointer-events: none; }
.at-opt small { margin-left: auto; color: var(--muted); font-size: 12px; }
.at-opt.is-clear { color: var(--ink-soft); border-top: 1px solid var(--border-soft); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.at-due-pick { display: flex; flex-direction: column; gap: 4px; padding: 8px 9px 4px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--ink-soft); }
/* Bảng Người phụ trách */
.at-asg-wrap .at-pop { width: min(440px, calc(100vw - 48px)); }
.at-asg-tools { display: flex; gap: 6px; padding: 2px 2px 6px; }
.at-asg-search { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); }
.at-asg-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.at-asg-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; }
.at-asg-team { max-width: 160px; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.at-asg-team[hidden] { display: none; }
.at-asg-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.at-asg-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.at-asg-row[hidden] { display: none; }
.at-asg-row:hover { background: var(--bg); }
.at-asg-row:has(input:checked) { background: var(--primary-50); }
.at-asg-row:has(input:disabled) { cursor: default; opacity: 0.75; }
.at-asg-row input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--primary-600); }
.at-asg-av { width: 26px; height: 26px; font-size: 10px; flex: none; }
.at-asg-name { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-load { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
.at-load small { font-size: 12px; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.at-bar { display: block; width: 72px; height: 5px; border-radius: var(--radius-pill); background: var(--border-soft); overflow: hidden; }
.at-bar b { display: block; height: 100%; border-radius: inherit; background: var(--tone, var(--success-600)); }
.at-load.is-ok { --tone: var(--success-600); }
.at-load.is-high { --tone: var(--primary-600); }
.at-load.is-over { --tone: var(--danger-600); }
.at-load.is-over small { color: var(--danger-600); font-weight: 600; }
/* Chưa đủ dữ liệu (nhiều việc thiếu ước lượng / ngày): xám, không báo "còn rảnh" */
.at-load.is-nodata { --tone: #94a3b8; }
.wl-overdue { font-style: normal; color: #c2410c; font-weight: 600; }
.asg-load.is-nodata { color: #94a3b8; }
.mqv-load.is-nodata .mqv-load-bar i { background: #cbd5e1; }
.mqv-load.is-nodata .mqv-load-top b { color: var(--ink-soft); }
.mqv-load.is-high .mqv-load-bar i { background: var(--primary-600); }
.mqv-load.is-ok .mqv-load-bar i { background: var(--success-600); }
.mqv-load-sub { margin: 6px 0 0; font-size: 12px; color: var(--ink-soft); }
.at-asg-note, .at-asg-empty { margin: 6px 8px; font-size: 12.5px; color: var(--muted); }
.at-asg-note[hidden] { display: none; }
.at-asg-teambtn { height: 34px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; flex-shrink: 0; }
.at-asg-teambtn[aria-pressed="true"] { border-color: var(--primary); color: var(--primary-600); }
.at-asg-teambtn[hidden], .at-asg-teams[hidden] { display: none; }
.at-asg-teams { margin: 0 8px 6px; font-size: 12.5px; font-weight: 600; color: var(--primary-600); }
@media (max-width: 520px) { .at-asg-tools { flex-wrap: wrap; } }
.at-warn { margin: 2px 0 8px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--warning-50); color: var(--warning-700); font-size: 12.5px; line-height: 1.45; }
.at-warn[hidden] { display: none; }
/* Task con (bắt buộc ít nhất 1) */
.at-sub { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.at-sub-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.at-sub-label small { font-weight: 400; color: var(--muted); }
/* Chân: "Tạo thêm việc khác" bên trái, Hủy + Thêm bên phải */
.at-foot { align-items: center; }
.at-more { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.at-more input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary-600); }
#add-task-submit:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 560px) {
  .at-body { padding: 8px 16px 4px; }
  .at-name { font-size: 19px; }
  /* Điện thoại: bảng nhỏ thành tấm nổi ở đáy màn hình cho dễ bấm */
  .at-pop, .at-asg-wrap .at-pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 70vh; overflow-y: auto; }
  .at-load small { display: none; }
  .at-foot { flex-wrap: wrap; }
  .at-more { width: 100%; }
}

/* =====================================================
   BẢNG CHI TIẾT NHỎ KIỂU MỚI (tasks.js detailPanelInnerHTML, tiền tố dq-)
   Chỉ áp trong #task-detail-overlay; chi tiết rộng (subtasks.js) giữ kiểu cũ.
   Phần tử dùng chung (vòng task con, thẻ phụ thuộc, dòng tệp, khối giờ) có kiểu gốc ở đầu khối.
   ===================================================== */
/* --- Dùng chung với chi tiết rộng --- */
.dq-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 700; color: var(--primary-600); cursor: pointer; }
.dq-link:hover { text-decoration: underline; }
.subtask-ring { flex: none; }
.subtask-ring-bg { fill: none; stroke: var(--border); stroke-width: 2.5; }
.subtask-ring-fg { fill: none; stroke: var(--success); stroke-width: 2.5; stroke-linecap: round; }
.subtask-ring-check { fill: none; stroke: var(--success-600); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.subtask-due { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.subtask-due.is-late { color: var(--danger-600); font-weight: 700; }
.dep-warn { margin: 6px 0 10px; padding: 7px 10px; border-radius: 10px; background: var(--warning-50); color: var(--warning-700); font-size: 12.5px; }
.tw-ai-pill { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 5px 11px; border: 0; border-radius: var(--radius-pill); background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); color: #6d28d9; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.tw-ai-pill:hover { background: color-mix(in srgb, #8b5cf6 20%, var(--surface)); }
.tw-file-menu { position: relative; flex: none; }
.tw-file-menu-btn { width: 30px; height: 30px; border-radius: 50%; }
.tw-file-menu-panel { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px; padding: 6px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.tw-file-menu-panel .task-menu-item { text-decoration: none; cursor: pointer; }
/* Thời gian làm việc (bảng nhỏ + chi tiết rộng): 4 trạng thái — chưa ghi / đang bấm giờ (thẻ xanh lá) / vượt ước lượng / ghi thủ công.
   Nút cao 36px theo theme, số đồng hồ cùng độ rộng (không nhảy khi đổi chữ số), mỗi dòng nhật ký 48px */
.time-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.time-head .section-title-v2 { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.time-est { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.time-est b { font-size: 13.5px; color: var(--ink); }
.time-est-btn { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 0; border-radius: 6px; background: none; font: inherit; color: inherit; cursor: pointer; }
.time-est-btn svg { color: var(--muted); }
.time-est-btn:hover { background: rgba(15, 23, 42, 0.06); }
.time-est-btn:hover svg { color: var(--primary-600); }
.time-est-input { width: 76px; height: 28px; padding: 0 8px; border: 1px solid var(--primary); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--primary-50); }
:is(#task-detail-overlay, #task-wide-box) .detail-section.is-time { transition: background-color 0.2s ease; }
:is(#task-detail-overlay, #task-wide-box) .detail-section.is-time.is-running { background: #ecfdf3; box-shadow: inset 0 0 0 1px #bbf7d0; }
:is(#task-detail-overlay, #task-wide-box) .detail-section.is-time.is-running .section-title-v2 { color: #15803d; }
.time-live { display: flex; align-items: center; gap: 7px; margin: 0 0 2px; font-size: 12.5px; font-weight: 700; color: #15803d; }
.time-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #bbf7d0; animation: timeLivePulse 1.6s ease-in-out infinite; }
@keyframes timeLivePulse { 50% { box-shadow: 0 0 0 6px rgba(187, 247, 208, 0.4); } }
.time-clock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.time-clock { font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: 0.01em; color: var(--ink); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.time-clock.is-running { color: #15803d; }
.time-over-chip { flex: none; padding: 3px 10px; border: 1px solid var(--danger-100); border-radius: var(--radius-pill); background: var(--danger-50); color: var(--danger-600); font-size: 12px; font-weight: 700; }
.detail-section.is-time .time-actions { display: flex; gap: 8px; margin: 0 0 12px; }
.detail-section.is-time .time-actions > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.detail-section.is-time .time-actions > :first-child { flex: 1; }
.detail-section.is-time.is-running .time-actions > button { flex: 1; }
.detail-section.is-time .time-actions .timer-btn { border: 0; background: #f59e0b; color: #fff; box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3); }
.detail-section.is-time .time-actions .timer-btn:hover { background: #ea8a06; }
.detail-section.is-time .time-actions .btn-secondary { border: 1px solid var(--border-soft); background: var(--surface); color: var(--ink); }
.detail-section.is-time .time-actions .btn-secondary:hover { border-color: var(--border); background: var(--bg); }
.time-btn-stop { border: 0; background: var(--danger-600); color: #fff; }
.time-btn-stop:hover { background: var(--danger); }
.time-run-note.form-control { height: 36px; margin-bottom: 10px; border-radius: 10px; background: var(--surface); }
.time-hint { margin: -4px 0 12px; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
/* Tiến độ: phần trong ước lượng màu cam, phần vượt màu đỏ */
.time-bar2 { display: flex; height: 6px; margin: 2px 0 6px; border-radius: var(--radius-pill); background: rgba(15, 23, 42, 0.08); overflow: hidden; }
.time-bar2 .is-in { background: #f59e0b; }
.time-bar2 .is-out { background: var(--danger); }
.detail-section.is-time .time-summary { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-soft); }
/* Nhật ký: dòng 48px, ✎ / 🗑 hiện khi rê chuột */
.time-entry-list { margin-top: 4px; }
.detail-section.is-time .time-entry { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 4px; border-top: 1px solid rgba(15, 23, 42, 0.07); font-size: 13px; }
.detail-section.is-time .time-entry .avatar { width: 28px; height: 28px; font-size: 11px; flex: none; }
.detail-section.is-time .time-entry-min { min-width: 44px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.time-entry-tools { display: inline-flex; gap: 2px; flex: none; opacity: 0; transition: opacity 0.15s; }
.time-entry:hover .time-entry-tools, .time-entry:focus-within .time-entry-tools { opacity: 1; }
@media (hover: none) and (pointer: coarse) { .time-entry-tools { opacity: 1; } }
.time-entry-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.time-entry-btn:hover { background: rgba(15, 23, 42, 0.06); color: var(--primary-600); }
.time-entry-btn.is-danger:hover { background: var(--danger-50); color: var(--danger-600); }
.time-total { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 4px; border-top: 1px solid rgba(15, 23, 42, 0.1); font-size: 13px; color: var(--ink-soft); }
.time-total b { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.time-empty { margin: 4px 0 0; padding: 14px 0 4px; border-top: 1px solid rgba(15, 23, 42, 0.07); text-align: center; font-size: 12.5px; color: var(--muted); }
/* Ghi thủ công: lỗi ngay dưới ô, Lưu khóa tới khi hợp lệ */
.detail-section.is-time .time-form { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.time-form-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.time-form-field > span { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.time-form-field em { font-style: normal; font-weight: 400; color: var(--muted); }
.detail-section.is-time .time-form .form-control { height: 36px; border-radius: 10px; }
.time-form-field.has-error .form-control { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-50); }
.time-form-err { font-size: 12px; color: var(--danger-600); }
.time-form-err:empty { display: none; }
.time-form-actions { display: flex; gap: 8px; }
.time-form-actions > * { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; border-radius: 10px; }
.time-form-actions .btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.time-form-actions .btn-primary { flex: 1; }
/* Chip giờ trên thanh đầu chi tiết rộng: đỏ khi vượt ước lượng */
.wide-meta .wm-est.is-over { background: var(--danger-50); color: var(--danger-600); }
.wide-meta .wm-est.is-over .wm-est-spent { color: var(--danger-600); }
@media (prefers-reduced-motion: reduce) { .time-live-dot { animation: none; } }

/* --- Khung panel --- */
/* Màn lớn nới theo bề ngang để mô tả / task con đỡ chật, nhưng không quá 1100px kẻo che hết bảng việc phía sau */
#task-detail-overlay .detail-panel { max-width: clamp(540px, 33vw, 1100px); border-radius: 18px 0 0 18px; }
#task-detail-overlay .dq-head { gap: 8px; padding: 10px 16px; position: relative; z-index: 6; background: var(--surface); }
.dq-crumb { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.dq-crumb-project { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dq-mini-timer { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--radius-pill); background: var(--danger-50); color: var(--danger-600); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dq-tools { gap: 6px !important; }
/* Nút icon vuông 32px nền xám nhạt; Đóng màu xám (không đỏ) */
#task-detail-overlay .dq-tool,
#task-detail-overlay .dq-tools .task-menu-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: #f4f5fa; color: var(--ink-soft); cursor: pointer; }
#task-detail-overlay .dq-tool:hover,
#task-detail-overlay .dq-tools .task-menu-btn:hover,
#task-detail-overlay .dq-tools .task-menu-btn.is-open { background: var(--primary-50); color: var(--primary-600); }
#task-detail-overlay .dq-tool.is-favorite { color: #f59e0b; }
#task-detail-overlay .dq-tools .task-menu-panel { right: 0; left: auto; }
#task-detail-overlay .dq-body { padding: 16px 22px 24px; }

/* Tiêu đề lớn, bấm vào sửa tại chỗ */
#task-detail-overlay .detail-title-input { font-size: 22px !important; font-weight: 800; line-height: 1.3; margin-bottom: 12px; }

/* Khối duyệt (bảng nhỏ + chi tiết rộng): card tím nhạt như nhãn "Cần kiểm tra"; chữ bên trái, nút cùng hàng bên phải, nút cao 32px */
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid #e3dcff; border-radius: 14px; background: linear-gradient(135deg, #f1ebff 0%, #eaf3ff 100%); }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review > * { grid-column: 1; }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review > .tw-actions { grid-column: 2; grid-row: 1 / span 2; flex-wrap: nowrap; gap: 8px; margin: 0; }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review > .tw-box-warn,
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review > .tw-form { grid-column: 1 / -1; }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review .tw-box-head strong { display: inline-flex; align-items: center; gap: 6px; color: #6d28d9; font-size: 14px; }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review .tw-box-meta { margin-top: 3px; font-size: 12px; line-height: 1.5; }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review .tw-box-time { font-size: inherit; }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review .tw-history-link { font-size: inherit; }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review .tw-btn { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review .tw-btn-green-solid { background: #22c55e; border-color: #22c55e; color: #fff; box-shadow: 0 2px 6px rgba(34, 197, 94, 0.28); }
:is(#task-detail-overlay, #task-wide-box) .tw-box.is-review .tw-btn-pink { background: var(--surface); border: 1px solid var(--danger-100); color: var(--danger-600); }
#task-detail-overlay .tw-approved { display: inline-flex; padding: 6px 14px; border-radius: var(--radius-pill); background: var(--success-50); color: var(--success-700); font-size: 13px; font-weight: 700; }

/* Thuộc tính: nhãn 128px | giá trị, không kẻ dòng, rê dòng thì nền nhạt */
.dq-props { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 4px; }
.dq-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 40px; padding: 3px 8px; margin: 0 -8px; border-radius: 10px; transition: background 0.15s; }
.dq-row:hover { background: #f7f8fc; }
.dq-label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); min-width: 0; }
.dq-label svg { flex: none; color: var(--muted); }
.dq-label label, .dq-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: inherit; }
.dq-value { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dq-empty, .dq-text { font-size: 13.5px; color: var(--ink-soft); }
/* Trạng thái / Ưu tiên: pill pastel, bỏ mũi tên thừa */
.dq-props .cselect-btn.dq-select { width: auto; min-width: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.dq-props .cselect-btn.dq-select .cselect-caret { display: none; }
.dq-props .cselect-btn.dq-select .status-pill,
.dq-props .cselect-btn.dq-select .priority-pill { padding: 5px 13px; border-width: 0; font-size: 13px; }
.dq-props .cselect-btn.dq-select-plain { padding: 5px 12px; border-radius: var(--radius-pill); background: var(--bg); font-size: 13px; font-weight: 700; }
.dq-props .cselect-btn:disabled { cursor: default; }
/* Ngày: pill bấm mở lịch, ô date thật ẩn bên trong */
.dq-date-wrap { position: relative; display: inline-flex; }
.dq-pill { display: inline-flex; align-items: center; padding: 6px 14px; border: 0; border-radius: var(--radius-pill); background: var(--bg); font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
button.dq-pill { cursor: pointer; }
button.dq-pill:hover { background: var(--primary-50); }
.dq-pill.is-empty { color: var(--muted); font-weight: 500; }
.dq-pill.is-late { background: var(--danger-50); color: var(--danger-600); }
.dq-rel { font-weight: 700; }
.dq-date-input { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.dq-est { display: inline-flex; align-items: center; gap: 4px; }
.dq-input { width: 84px; padding: 5px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; font: inherit; font-size: 14px; color: var(--ink); -moz-appearance: textfield; }
.dq-input::-webkit-outer-spin-button, .dq-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } /* bỏ nút tăng/giảm để không che chữ gợi ý "VD: 2.5" */
.dq-input:hover { background: var(--surface); border-color: var(--border-soft); }
.dq-input:focus { background: var(--surface); border-color: var(--primary); outline: none; }
.dq-unit { font-size: 13.5px; color: var(--ink-soft); }
#task-detail-overlay .dq-props .assignee-picker-avatars { display: flex; align-items: center; }
#task-detail-overlay .dq-props .assignee-picker { flex: none; width: auto; }
#task-detail-overlay .dq-props .assignee-picker-avatars .avatar,
#task-detail-overlay .dq-props .assignee-add-btn { width: 30px !important; height: 30px !important; min-width: 30px; display: flex; border-radius: 50% !important; flex-shrink: 0; padding: 0; }
#task-detail-overlay .dq-props .assignee-add-btn { border: 1.5px dashed var(--border) !important; background: var(--surface); color: var(--muted); }
#task-detail-overlay .dq-props .assignee-add-btn:hover { border-color: var(--primary) !important; color: var(--primary-600); }
#task-detail-overlay .dq-props .assignee-picker .assignee-picker-panel { width: auto !important; max-width: 300px; }
#task-detail-overlay .dq-props .assignee-picker .assignee-picker-panel.asg-cu { width: 300px !important; max-width: none; }
#task-detail-overlay .dq-props .assignee-check-item span { white-space: nowrap; }

/* Các thẻ mục: bo 16px, ít viền */
:is(#task-detail-overlay, #task-wide-box) .detail-section.is-time,
:is(#task-detail-overlay, #task-wide-box) .dep-section { padding: 14px 16px; border-radius: 16px; border: 0; }
:is(#task-detail-overlay, #task-wide-box) .detail-section.is-time { background: #fff4e0; margin-top: 12px; }
:is(#task-detail-overlay, #task-wide-box) .dep-section { background: #fafbfe; border: 1px solid var(--border-soft); }
/* Phụ thuộc: huy hiệu tổng quan · 2 nhóm cùng cấu trúc (tiêu đề + số đếm · dòng 56px · ô "+ Thêm…") */
.dep-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.dep-head .section-title-v2 { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.dep-ready { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.dep-ready.is-ok { background: var(--success-50); color: var(--success-700); }
.dep-ready.is-blocked { background: var(--warning-50); color: var(--warning-700); }
.dep-group + .dep-group { margin-top: 16px; }
.dep-gh { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dep-gt { font-size: 13px; font-weight: 700; color: var(--ink); }
.dep-gc { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dep-list { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.dep-row { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 10px 0 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.dep-row:hover { border-color: var(--primary-100); }
.dep-ic { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--bg); color: var(--ink-soft); }
.dep-row.is-done .dep-ic, .dep-ic.is-done { background: var(--success-50); color: var(--success-700); }
.dep-row.is-late .dep-ic, .dep-ic.is-late { background: var(--danger-50); color: var(--danger-600); }
.dep-row.is-doing .dep-ic, .dep-ic.is-doing { background: var(--warning-50); color: var(--warning-700); }
.dep-row.is-review .dep-ic, .dep-ic.is-review { background: #f3e8ff; color: #7c3aed; }
.dep-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dep-name { max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.dep-name:hover { color: var(--primary-600); text-decoration: underline; }
.dep-row.is-done .dep-name { color: var(--muted); text-decoration: line-through; }
.dep-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dep-st { flex: none; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--bg); color: var(--ink-soft); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.dep-st.is-done { background: var(--success-50); color: var(--success-700); }
.dep-st.is-late { background: var(--danger-50); color: var(--danger-600); }
.dep-st.is-doing { background: var(--warning-50); color: var(--warning-700); }
.dep-st.is-review { background: #f3e8ff; color: #7c3aed; }
/* ✕ chỉ hiện khi rê chuột vào dòng (bàn phím / màn cảm ứng: luôn thấy) */
.dep-remove { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.dep-row:hover .dep-remove, .dep-remove:focus-visible { opacity: 1; }
.dep-remove:hover { background: var(--danger-50); color: var(--danger-600); }
@media (hover: none) and (pointer: coarse) { .dep-remove { opacity: 1; } }
.dep-hidden { padding: 4px 2px; font-size: 12.5px; color: var(--muted); }
.dep-empty { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.dep-addbtn { display: flex; align-items: center; gap: 6px; width: 100%; height: 40px; padding: 0 12px; border: 1.5px dashed var(--border); border-radius: 12px; background: none; font: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.dep-addbtn:hover, .dep-addbtn:focus-visible { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
/* Ô tìm: ô gõ viền xanh + danh sách thả xuống + dòng gợi ý phím */
.dep-pick { border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; }
.dep-pick-box { display: flex; align-items: center; gap: 8px; height: 40px; margin: 6px; padding: 0 10px; border: 1.5px solid var(--primary); border-radius: 10px; color: var(--primary-600); }
.dep-pick-box input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 13.5px; color: var(--ink); }
.dep-pick-list { max-height: 264px; margin: 0; padding: 0 6px 6px; overflow-y: auto; list-style: none; }
.dep-opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.dep-opt.is-active, .dep-opt:not(.is-off):hover { background: var(--primary-50); }
.dep-opt.is-off { opacity: 0.55; cursor: not-allowed; }
.dep-opt .dep-ic { width: 26px; height: 26px; background: var(--primary-50); color: var(--primary-600); }
.dep-opt.is-off .dep-ic { background: var(--bg); color: var(--muted); }
.dep-opt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dep-sub.is-reason { color: var(--ink-soft); font-style: italic; }
.dep-opt-none { padding: 12px 8px; font-size: 13px; color: var(--muted); }
.dep-pick-foot { padding: 7px 12px; border-top: 1px solid var(--border-soft); background: var(--bg); font-size: 11.5px; color: var(--muted); }
/* Chip "Bị chặn" trên thẻ Kanban */
.dep-card-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--warning-50); color: var(--warning-700); font-size: 11.5px; font-weight: 700; }
/* Hộp dời lịch: thẻ cảnh báo vàng, tick từng việc, hạn cũ → đề xuất */
#modal-dep-title { display: inline-flex; align-items: center; gap: 8px; }
#modal-dep-title svg { color: var(--warning-700); }
.dep-warncard { padding: 14px; border: 1px solid #fde68a; border-radius: 14px; background: #fffbeb; }
.dep-warncard .dep-intro { color: var(--ink); }
.dep-table { border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); overflow: hidden; }
.dep-tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border-soft); font-size: 13px; cursor: pointer; }
.dep-tr:first-child { border-top: 0; }
.dep-tr.is-off { opacity: 0.55; }
.dep-tr input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.dep-th { background: var(--bg); font-size: 12px; font-weight: 600; color: var(--muted); cursor: default; }
.dep-td-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.dep-td-date { white-space: nowrap; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.dep-td-date b { color: var(--primary-600); }
#dep-foot .btn-secondary, #dep-foot .btn-primary { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; }
:is(#task-detail-overlay, #task-wide-box) .detail-section.is-time .section-title-v2 { color: #c2410c; }

/* Task con */
#task-detail-overlay .milestone-head { gap: 10px; }
#task-detail-overlay .milestone-head h3 { font-size: 15px; font-weight: 800; }
:is(#task-detail-overlay, #task-wide-box) .subtask-row { padding: 6px 4px; border-radius: 10px; }
:is(#task-detail-overlay, #task-wide-box) .subtask-row .checklist-delete-btn { opacity: 0; transition: opacity 0.15s; }
:is(#task-detail-overlay, #task-wide-box) .subtask-row:hover .checklist-delete-btn,
:is(#task-detail-overlay, #task-wide-box) .subtask-row:focus-within .checklist-delete-btn { opacity: 1; }
#task-detail-overlay .subtask-progress .progress-fill { background: linear-gradient(90deg, var(--primary), #2563eb); }
#task-detail-overlay .is-checklist .checklist-editor-row .form-control { border-radius: 12px; background: var(--surface); border-color: transparent; }

/* Phụ thuộc: mỗi việc là thẻ nhỏ */
#task-detail-overlay .dq-hist { padding-left: 0; border-left: 0; }
#task-detail-overlay .dq-hist-item::before { left: 2px; top: 13px; }


/* Mô tả: giữ trình soạn cũ (thanh định dạng hiện sẵn, kéo mép dưới để dài ra) */
#task-detail-overlay .dq-desc .section-title-v2 { margin-top: 14px; }
/* Kéo góc dưới phải để ô soạn dài ra (Jodit chỉ có tay nắm khi đặt chiều cao cố định) */
#task-detail-overlay .dq-desc .jodit-workplace { resize: vertical; overflow: auto; max-height: none !important; }
#task-detail-overlay .dq-desc .jodit-wysiwyg { max-height: none !important; }

/* Tệp đính kèm: thẻ ngang (ô loại tệp, tên, dung lượng · Tải xuống), ô "+" cuối hàng */
:is(#task-detail-overlay, #task-wide-box) .dq-files { margin-top: 16px; padding: 0; }
:is(#task-detail-overlay, #task-wide-box) .dq-files.is-drag-over .tw-chip-list { outline: 2px dashed var(--primary); outline-offset: 4px; border-radius: 12px; background: var(--primary-50); }
.dq-files-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dq-files-title { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.tw-chip-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.tw-chip-file { display: flex; align-items: center; gap: 10px; flex: 0 1 230px; min-width: 0; padding: 8px 8px 8px 10px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.tw-chip-icon { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--bg); color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.tw-chip-icon.is-pdf { background: var(--danger-50); color: var(--danger-600); }
.tw-chip-icon.is-doc { background: #e8f0ff; color: #2563eb; }
.tw-chip-icon.is-sheet { background: var(--success-50); color: var(--success-700); }
.tw-chip-icon.is-slide { background: var(--warning-50); color: var(--warning-700); }
.tw-chip-icon.is-image { background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); color: #6d28d9; }
.tw-chip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tw-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--ink); }
.tw-chip-ver { font-size: 11px; font-weight: 700; color: var(--muted); }
.tw-chip-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tw-chip-meta a { color: var(--primary-600); text-decoration: underline; }
.tw-chip-ai { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); color: #6d28d9; cursor: pointer; }
.tw-chip-ai:hover { background: color-mix(in srgb, #8b5cf6 22%, var(--surface)); }
.tw-chip-file .tw-file-menu-btn { width: 26px; height: 26px; }
.tw-chip-add { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 52px; padding: 0 12px; border: 1.5px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: 13px; cursor: pointer; }
.tw-chip-add.is-empty { flex: 1; min-height: 48px; }
.tw-chip-add:hover { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); }
.tw-chip-none { margin: 0; font-size: 13px; color: var(--muted); }

/* Task con dạng thẻ: tay kéo ⋮⋮ ngoài thẻ, ô tick, tên, mô tả ngắn bên dưới */
:is(#task-detail-overlay, #task-wide-box) .is-checklist.is-cards { margin-top: 18px; padding: 0; background: none; border: 0; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .milestone-head { gap: 12px; margin-bottom: 10px; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .milestone-head h3 { flex: 1; color: var(--ink); font-size: 15px; font-weight: 700; }
.subtask-pct { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.subtask-pct .progress-track { display: block; width: 110px; height: 6px; border-radius: var(--radius-pill); background: var(--border-soft); overflow: hidden; }
.subtask-pct .progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--success)); }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-list { gap: 6px; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row { position: relative; flex-wrap: wrap; margin-left: 22px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row:hover { border-color: var(--primary-100); background: var(--surface); }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-drag { position: absolute; left: -22px; top: 8px; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-name { font-weight: 500; color: var(--ink); }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row.is-done .subtask-name { color: var(--ink); }
/* Mô tả dưới tên: đúng 1 dòng, dài thì "…" (rê chuột xem đủ) */
.subtask-note { flex-basis: 100%; min-width: 0; margin: 4px 0 0 30px; font-size: 12.5px; color: var(--muted); line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Ô tick xanh lá */
/* Ô tích tự vẽ: nền trắng viền xám; xong = viền + dấu tích xanh lá, nền vẫn trắng (không tô kín) */
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-check { appearance: none; -webkit-appearance: none; flex: none; width: 17px; height: 17px; margin: 0; border: 1.5px solid #cbd5e1; border-radius: 5px; background: #fff center / 12px no-repeat; cursor: pointer; transition: border-color 0.15s; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-check:hover:not(:disabled) { border-color: #22c55e; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-check:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-check:checked { border-color: #22c55e; background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%2316a34a%27 stroke-width=%273.2%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M5 12.5l4.5 4.5L19 7.5%27/%3E%3C/svg%3E"); }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-check:disabled { cursor: default; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row { padding: 8px 12px; border-radius: 10px; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-drag { font-size: 16px; letter-spacing: -3px; color: var(--ink-soft); opacity: 0.7; cursor: grab; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-drag:hover { opacity: 1; }
/* Kéo thả thẻ task con: thẻ đang kéo mờ đi, vạch xanh báo chỗ sẽ thả (trên / dưới thẻ đích) */
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row.is-draggable { cursor: grab; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row.is-draggable:active { cursor: grabbing; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row.is-dragging { opacity: 0.45; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row.is-drop-before::before,
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row.is-drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 3px; background: var(--primary); pointer-events: none; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row.is-drop-before::before { top: -6px; }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-row.is-drop-after::after { bottom: -6px; }

/* Thẻ nháp "Task con mới": viền đậm, trượt lên khi mở */
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-draft { align-items: flex-start; flex-wrap: nowrap; margin-top: 8px; border: 1.5px solid var(--ink); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); }
:is(#task-detail-overlay, #task-wide-box) .is-cards .subtask-draft .subtask-check { margin-top: 2px; }
.subtask-draft.is-entering { animation: subtaskDraftIn 0.22s ease-out; }
@keyframes subtaskDraftIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.subtask-draft-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.subtask-draft-name { width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); outline: none; }
.subtask-draft-name::placeholder { color: var(--muted); font-weight: 600; }
.subtask-draft-desc { width: 100%; padding: 7px 10px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; color: var(--ink); outline: none; }
.subtask-draft-desc:focus { border-color: var(--primary); }
.subtask-draft-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.subtask-draft-actions .btn-primary, .subtask-draft-actions .btn-secondary { padding: 5px 14px; font-size: 13px; border-radius: 8px; }
.subtask-draft-space { flex: 1; }
/* Nút nhỏ nền xám: Thêm mô tả / Giao người */
.subtask-chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; border-radius: 8px; background: var(--bg); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.subtask-chip-btn:hover { background: var(--primary-50); color: var(--primary-600); }
.subtask-chip-btn .avatar { width: 20px; height: 20px; font-size: 9px; }
.subtask-chip-btn.has-person { background: var(--primary-50); color: var(--primary-600); }
.subtask-assign-wrap { position: relative; }
.subtask-assign-pop { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30; width: 240px; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); }
.subtask-assign-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; text-align: left; color: var(--ink); cursor: pointer; }
.subtask-assign-opt:hover { background: var(--primary-50); }
.subtask-assign-opt > .avatar { flex: none; width: 24px; height: 24px; font-size: 10px; }
.subtask-assign-opt > span:not(.avatar) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtask-assign-opt b { color: var(--success-700); }
/* Thanh "+ Task con mới": viền đứt bo góc, nút phụ bên phải */
.subtask-new-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 8px 0 0 22px; padding: 6px 10px 6px 14px; border: 1.5px dashed var(--border); border-radius: 10px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.subtask-new-bar:hover, .subtask-new-bar:focus-visible { border-color: var(--primary); background: var(--primary-50); outline: none; }
.subtask-new-plus { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); }
.subtask-new-tools { display: inline-flex; gap: 6px; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .subtask-draft.is-entering { animation: none; } }

/* 3 tab cuối: Bình luận | Thời gian làm việc | Log */
.dq-btabs { display: flex; gap: 2px; margin: 22px 0 12px; border-bottom: 1px solid var(--border-soft); overflow-x: auto; scrollbar-width: none; }
.dq-btab { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 10px 12px 9px; border: 0; border-bottom: 2.5px solid transparent; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.dq-btab:hover { color: var(--ink); }
.dq-btab.is-active { color: var(--primary-600); border-bottom-color: var(--primary-600); font-weight: 800; }
.dq-tab-count { padding: 1px 7px; border-radius: var(--radius-pill); background: var(--bg); font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.dq-pane[hidden] { display: none !important; }
#task-detail-overlay .dq-pane.is-time { margin-top: 0; }
#task-detail-overlay .dq-pane.is-comments .comment-list { display: flex; flex-direction: column; gap: 12px; }
#task-detail-overlay .dq-pane.is-comments .comment-main { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 14px; background: #f4f5fa; }
#task-detail-overlay .comment-text .mention,
#task-detail-overlay .comment-text .comment-mention { padding: 1px 6px; border-radius: 6px; background: var(--primary-50); color: var(--primary-600); font-weight: 700; }

/* Log: nhóm theo ngày */
.dq-hist { margin: 0; padding: 0; list-style: none; }
.dq-hist-day { margin: 12px 0 4px; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.dq-hist-day:first-child { margin-top: 0; }
#task-detail-overlay .dq-hist-item { padding: 5px 0 5px 16px; font-size: 13.5px; }
.dq-hist-more { display: block; margin: 8px auto 0; }

/* Ô bình luận dính đáy panel */
.dq-composer { flex: none; padding: 10px 16px 12px; border-top: 1px solid var(--border-soft); background: var(--surface); }
.comment-composer.is-docked .comment-composer-row { align-items: center; gap: 8px; }
.comment-composer.is-docked .comment-me { flex: none; width: 32px; height: 32px; }
.comment-composer.is-docked textarea.form-control { min-height: 40px; padding: 9px 16px; border-radius: 20px; resize: none; }
.comment-composer.is-docked textarea.form-control:focus { border-radius: 14px; min-height: 64px; }
.comment-composer.is-docked .icon-btn { width: 36px; height: 36px; border-radius: 50%; }
.comment-composer.is-docked .comment-send-btn { border-radius: 12px; padding: 0 18px; }

@media (max-width: 640px) {
  #task-detail-overlay .detail-panel { border-radius: 0; }
  .dq-row { grid-template-columns: 112px minmax(0, 1fr); }
  .dq-label label, .dq-label span { white-space: normal; line-height: 1.3; }
  #task-detail-overlay .dq-body { padding: 14px 16px 20px; }
  .tw-chip-file { flex-basis: 100%; }
  .time-clock { font-size: 26px; }
  :is(#task-detail-overlay, #task-wide-box) .tw-box.is-review { grid-template-columns: minmax(0, 1fr); }
  :is(#task-detail-overlay, #task-wide-box) .tw-box.is-review > .tw-actions { grid-column: 1; grid-row: auto; margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .dq-row, #task-detail-overlay .subtask-row .checklist-delete-btn { transition: none; }
}
/* ===== Thẻ "Cập nhật của trưởng nhóm" (.ov-psu) + "Sắp tới & mốc dự án" (.ov-upc), rộng 1/2 — overview.js ovPsu* / ovUpcoming* ===== */
.ov-psu, .ov-upc { grid-column: span 6; gap: 12px; }
.ov-psu > h2, .ov-upc > h2 { margin-bottom: 0; }
.ovp-meta { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.ovp-sub { margin: -6px 6px 0; font-size: 12.5px; color: #64748b; }
.ovp-stale { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: 0; padding: 3px 10px; border-radius: 999px; background: #fff7ed; font-size: 12px; font-weight: 700; color: #c2410c; }
.ovp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ovp-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border: 1.5px solid transparent; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; opacity: 0.55; transition: opacity 0.15s ease, border-color 0.15s ease; }
.ovp-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ovp-pill:hover:not(:disabled), .ovp-pill.is-on { opacity: 1; }
.ovp-pill:disabled { cursor: default; }
.ovp-pill.tone-green { background: #ecfdf5; color: #059669; }
.ovp-pill.tone-amber { background: #fffbeb; color: #d97706; }
.ovp-pill.tone-red { background: #fff1f2; color: #e11d48; }
.ovp-pill.is-on.tone-green { border-color: #10b981; }
.ovp-pill.is-on.tone-amber { border-color: #f59e0b; }
.ovp-pill.is-on.tone-red { border-color: #e11d48; }
.ovp-pill:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.ovp-note { display: block; width: 100%; margin: 0; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; background: #fafbfe; font: inherit; font-size: 14px; line-height: 1.6; text-align: left; color: #334155; white-space: pre-wrap; overflow-wrap: anywhere; }
button.ovp-note { cursor: text; }
button.ovp-note:hover { border-color: var(--border); }
button.ovp-note:focus-visible { outline: none; border-color: var(--primary); }
.ovp-note b { font-weight: 800; color: #0f172a; }
.ovp-at { color: var(--primary-600) !important; }
.ovp-muted { color: var(--ink-soft); font-style: italic; }
.ovp-note-edit { display: flex; flex-direction: column; gap: 8px; }
.ovp-note-actions { display: flex; align-items: center; gap: 8px; }
.ovp-count { margin-right: auto; font-size: 12px; color: var(--ink-soft); }
.ovp-help { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; max-width: 100%; margin: 0; padding: 5px 12px; border: 0; border-radius: 999px; background: #fef3c7; font: inherit; font-size: 13px; text-align: left; color: #92400e; }
button.ovp-help:not(:disabled) { cursor: pointer; }
.ovp-help b { font-weight: 800; color: #92400e; }
.ovp-help svg { flex: none; }
.ovp-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 6px 0; }
.ovp-empty p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.ovp-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.ovp-hist { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 12.5px; color: var(--ink-soft); }
.ovp-dot { width: 13px; height: 13px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
.ovp-dot.tone-green { background: #10b981; }
.ovp-dot.tone-amber { background: #f59e0b; }
.ovp-dot.tone-red { background: #f43f5e; }
.ovp-dot.is-current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; }
.ovp-dot.is-current.tone-green { color: #10b981; }
.ovp-dot.is-current.tone-amber { color: #f59e0b; }
.ovp-dot.is-current.tone-red { color: #f43f5e; }
.ovp-dot:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.ovp-foot .btn-secondary, .ovp-foot .btn-primary { display: inline-flex; align-items: center; gap: 6px; }
/* Sắp tới: thanh 7 / 14 / 30 ngày, ô ngày màu theo mức gấp */
.ovu-seg { display: inline-flex; gap: 2px; margin-left: auto; padding: 3px; border-radius: 10px; background: #f1f5f9; }
.ovu-seg-btn { padding: 5px 12px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: #64748b; cursor: pointer; white-space: nowrap; }
.ovu-seg-btn.is-on { background: var(--surface); color: #0f172a; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.ovu-seg-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.ovu-list { display: flex; flex-direction: column; max-height: 372px; margin: 0; padding: 0 2px 0 0; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.ovu-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border-soft, var(--border)); }
.ovu-row:first-child { border-top: 0; }
.ovu-item { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 10px 4px; border: 0; background: transparent; font: inherit; text-align: left; color: var(--ink); cursor: pointer; border-radius: 8px; }
.ovu-item:hover { background: #f8fafc; }
.ovu-item:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary); }
.ovu-date { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 42px; height: 44px; border-radius: 10px; line-height: 1; }
.ovu-date b { font-size: 18px; font-weight: 800; }
.ovu-date small { margin-top: 3px; font-size: 10.5px; font-weight: 700; }
.ovu-date.tone-red { background: #ffe4e6; color: #e11d48; }
.ovu-date.tone-amber { background: #ffedd5; color: #c2410c; }
.ovu-date.tone-violet { background: #ede9fe; color: #7c3aed; }
.ovu-date.tone-green { background: #dcfce7; color: #15803d; }
.ovu-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ovu-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovu-name svg { flex: none; color: #0f172a; }
.ovu-sub { font-size: 12.5px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovu-sub.is-bad { color: #e11d48; font-weight: 600; }
.ovu-move { flex: none; }
.ovu-add { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 12px; border: 1px dashed var(--border); border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--primary-600); cursor: pointer; }
.ovu-add:hover { border-color: var(--primary); background: var(--primary-50); }
/* Hộp thoại chung #modal-ovx */
.ovx-box { width: min(560px, calc(100vw - 32px)); }
.ovx-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.ovx-err { margin: 6px 0 0; font-size: 12px; color: var(--danger-600); }
.ovx-error { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--danger-50); font-size: 13px; color: var(--danger-600); }
.ovx-hint { margin: 0 0 12px; font-size: 13px; color: var(--ink-soft); }
.ovx-summary { font-family: inherit; font-size: 13px; line-height: 1.55; background: #fafbfe; }
.ovx-tasks { display: flex; flex-direction: column; gap: 2px; max-height: 220px; margin-top: 8px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-y: auto; }
.ovx-task { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; padding: 6px 8px; border-radius: 6px; font-size: 13px !important; font-weight: 500 !important; cursor: pointer; }
.ovx-task:hover { background: var(--bg); }
.ovx-task .pl-status-icon { display: inline-flex; }
#ovx-body .modal-foot a.btn-secondary { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
#ovx-body .modal-foot .btn-primary { display: inline-flex; align-items: center; gap: 6px; }
/* Ngăn kéo chi tiết mốc / 1 lần cập nhật cũ */
.ovms { display: flex; flex-direction: column; gap: 10px; }
.ovms-when { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.ovms-when.is-bad { color: #e11d48; }
.ovms-bar { height: 8px; overflow: hidden; border-radius: 999px; background: #eef2f7; }
.ovms-bar i { display: block; height: 100%; border-radius: inherit; background: #10b981; }
.ovms-pct { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.ovms-tasks, .ovms-changes { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ovms-task { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13.5px; text-align: left; color: var(--ink); cursor: pointer; }
.ovms-task:hover { background: var(--bg); }
.ovms-task .pl-status-icon { display: inline-flex; flex: none; }
.ovms-tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovms-tdue { flex: none; font-size: 12px; color: var(--ink-soft); }
.ovms-h { margin: 8px 0 0; font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.ovms-changes li { padding: 8px 0; border-top: 1px solid var(--border-soft, var(--border)); font-size: 13px; color: var(--ink-soft); }
.ovms-reason { display: block; margin-top: 4px; color: var(--ink); }
.ovms-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ovms-actions .btn-secondary { display: inline-flex; align-items: center; gap: 6px; }
.ovms-del:hover { border-color: var(--danger); color: var(--danger-600); }
@media (max-width: 1100px) { .ov-psu, .ov-upc { grid-column: span 12; } }
@media (max-width: 520px) { .ovp-foot { flex-direction: column; align-items: stretch; } .ovp-hist { margin-right: 0; } .ovu-seg-btn { padding: 5px 9px; } }
@media (prefers-reduced-motion: reduce) { .ovp-pill { transition: none; } }
/* ===== Thẻ "Khối lượng & năng lực" (.ov-cap, rộng 2/3) + "Phạm vi & thay đổi" (.ov-scopec, rộng 1/3) — overview.js ovCap* / ovScope* ===== */
.ov-cap { grid-column: span 8; gap: 10px; }
.ov-scopec { grid-column: span 4; gap: 12px; }
.ov-cap > h2, .ov-scopec > h2 { margin-bottom: 0; }
/* Hiện 5 người (mỗi hàng cao 64px), đông hơn thì cuộn trong thẻ */
.ovc-rows { display: flex; flex-direction: column; max-height: calc(5 * 64px); margin: 0; padding: 0 4px 0 0; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.ovc-row { box-sizing: border-box; flex: none; height: 64px; display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) minmax(150px, auto); align-items: center; gap: 16px; padding: 0; border-top: 1px solid var(--border-soft, var(--border)); }
.ovc-whobox { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.ovc-noest { margin: -6px 0 0 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; color: #b45309; font-weight: 600; text-decoration: underline dotted; cursor: pointer; }
.ovc-noest:hover { color: #92400e; }
.ovx-est-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovx-est-input { width: 84px !important; flex: none; padding: 4px 8px !important; }
.ovc-row:first-child { border-top: 0; }
.ovc-who { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px; border: 0; border-radius: 8px; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.ovc-who:hover { background: #f8fafc; }
.ovc-who:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary); }
.ovc-av { flex: none; width: 30px; height: 30px; font-size: 12px; }
.ovc-name { display: flex; flex-direction: column; min-width: 0; }
.ovc-name b { font-size: 14px; font-weight: 700; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovc-name small { font-size: 12px; color: #64748b; }
.ovc-bar { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ovc-bar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ovc-bar-top small { font-size: 12px; color: #64748b; }
.ovc-bar-top b { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ovc-bar-top b.tone-red { color: #e11d48; }
.ovc-bar-top b.tone-blue { color: #2563eb; }
.ovc-bar-top b.tone-green { color: #16a34a; }
.ovc-track { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: #eef2f7; }
.ovc-track i { display: block; height: 100%; border-radius: inherit; }
.ovc-track i.tone-bg-red { background: #e11d48; }
.ovc-track i.tone-bg-blue { background: #3b82f6; }
.ovc-track i.tone-bg-green { background: #22c55e; }
.ovc-tags { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.ovc-tag { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ovc-tag.tone-red { background: #ffe4e6; color: #e11d48; }
.ovc-tag.tone-amber { background: #fef3c7; color: #b45309; }
.ovc-tag.tone-green { background: #dcfce7; color: #15803d; }
.ovc-tag.tone-gray { background: #f1f5f9; color: #475569; }
.ovc-move { padding: 3px 10px; border: 0; border-radius: 8px; background: #e0f2fe; font: inherit; font-size: 12px; font-weight: 700; color: #0369a1; cursor: pointer; white-space: nowrap; }
.ovc-move:hover { background: #bae6fd; }
.ovc-suggest { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: #f5f3ff; font-size: 13px; color: #334155; }
.ovc-suggest > svg { flex: none; color: #f59e0b; }
.ovc-suggest > span { flex: 1; min-width: 0; }
.ovc-suggest b { color: #6d28d9; }
.ovc-suggest small { color: #64748b; }
.ovc-apply { flex: none; padding: 4px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 800; color: #6d28d9; cursor: pointer; }
.ovc-apply:hover { background: #ede9fe; }
.ovx-meta { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.ovx-meta.tone-red { color: #e11d48; }
.ovx-meta.tone-blue { color: #2563eb; }
.ovx-meta.tone-green { color: #16a34a; }
/* Phạm vi & thay đổi */
.ovs-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ovs-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 12px 14px; border: 0; border-radius: 12px; font: inherit; text-align: left; cursor: pointer; transition: box-shadow 0.15s ease; }
.ovs-tile:disabled { cursor: default; }
.ovs-tile:not(:disabled):hover { box-shadow: 0 0 0 2px currentColor inset; }
.ovs-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.ovs-tile b { font-size: 26px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ovs-tile span { font-size: 12.5px; color: #475569; }
.ovs-tile.tone-blue { background: #eff6ff; color: #2563eb; }
.ovs-tile.tone-green { background: #ecfdf5; color: #059669; }
.ovs-tile.tone-amber { background: #fffbeb; color: #d97706; }
.ovs-warn { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 10px; background: #fff7ed; font-size: 13px; color: #c2410c; }
.ovs-warn svg { flex: none; margin-top: 2px; }
.ovs-h { margin: 4px 0 0; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
/* Hiện 4 việc (mỗi dòng 40px), nhiều hơn thì cuộn trong thẻ */
.ovs-moved { display: flex; flex-direction: column; max-height: calc(5 * 40px); margin: 0; padding: 0 4px 0 0; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.ovs-moved li { flex: none; }
.ovs-mrow { box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 4px; border: 0; border-top: 1px solid var(--border-soft, var(--border)); background: transparent; font: inherit; text-align: left; cursor: pointer; border-radius: 0; }
.ovs-moved li:first-child .ovs-mrow { border-top: 0; }
.ovs-mrow:hover { background: #f8fafc; }
.ovs-mrow:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary); }
.ovs-mname { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ovs-chain { flex: none; font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ovs-n { flex: none; padding: 2px 9px; border-radius: 999px; background: #fef3c7; font-size: 12px; font-weight: 700; color: #b45309; white-space: nowrap; }
@media (max-width: 1100px) { .ov-cap, .ov-scopec { grid-column: span 12; } }
@media (max-width: 640px) {
  .ovc-row { grid-template-columns: minmax(0, 1fr) auto; height: auto; padding: 8px 0; }
  .ovc-bar { grid-column: 1 / -1; grid-row: 2; }
  .ovs-chain { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ovs-tile { transition: none; } }

/* Cài đặt › Gói & thanh toán bản mới (settings.js planCurrentCardHTML / planChooseCardHTML / planQuickHTML / planHeadExtraHTML):
   hàng Gói hiện tại + Tổng quan sử dụng, So sánh các gói (Pro nổi bật ở giữa), 3 lối tắt; nổi lên + đổ bóng khi rê, thanh đo chạy 1 lần lúc mở */
.set-head-text { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
.set-head-text h2 { grid-column: 1; }
.set-head-text .set-head-sub { grid-column: 1; margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.set-head-text .pl-upgrade { grid-column: 2; grid-row: 1 / span 2; }
.pl-upgrade { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; background: linear-gradient(135deg, #38bdf8, #6366f1); background-size: 160% 160%; color: #fff; box-shadow: 0 6px 18px rgba(56, 189, 248, .35); transition: transform .2s ease, box-shadow .2s ease, background-position .4s ease; }
.pl-upgrade:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(99, 102, 241, .35); background-position: 100% 50%; }
.pl-upgrade svg { transition: transform .4s ease; }
.pl-upgrade:hover svg { transform: rotate(20deg) scale(1.15); }
.pl-page .set-card { margin-bottom: 14px; transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease; }
.pl-top { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(0, 2fr); gap: 14px; }
.pl-top > .set-card { margin: 0; display: flex; flex-direction: column; }
.pl-top > .set-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
/* Hàng tiêu đề 2 khung (Gói hiện tại / Tổng quan sử dụng) cùng chiều cao + cùng khoảng xuống nội dung -> tiêu đề và nội dung 2 bên thẳng hàng */
.plb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; margin-bottom: 12px; }
/* Cỡ chữ khu Gói co giãn theo bề ngang màn hình: màn to chữ to, màn nhỏ chữ nhỏ (có trần / sàn) */
.plb-label { font-size: clamp(14px, 0.55vw + 8px, 17px); font-weight: 700; color: var(--ink); }
.plb-head .plan-more { float: none; margin: 0; }
.pl-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.pl-pill.is-ok { background: #dcfce7; color: #15803d; }
.pl-pill.is-warn { background: #fff7ed; color: #c2410c; }
.pl-pill.is-bad { background: #ffe4e6; color: #e11d48; }
/* Thẻ Gói hiện tại (mẫu chủ dự án 30/10/2026): ô biểu tượng lớn + tên / giá · 2 cột ngày có vạch ngăn · 2 nút cùng cỡ */
.pl-cur-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pl-cur-text { min-width: 0; }
.pl-cur .plan-name { margin: 0 0 2px; font-size: clamp(18px, 1.6vw, 26px); font-weight: 700; line-height: 1.2; color: var(--ink); white-space: nowrap; }
/* Hàng tên gói + nhãn trạng thái: tên / giá không bao giờ bẻ chữ; thiếu chỗ thì nhãn lên dòng trên ở góc phải (wrap-reverse) */
.pl-cur > .d-flex { display: flex; flex-wrap: wrap-reverse; align-items: center; gap: 8px 12px; margin-bottom: 16px; }
.pl-cur > .d-flex > .pl-cur-main { flex: 1 1 auto; min-width: max-content; }
.pl-cur > .d-flex > div:last-child { margin-left: auto; }
.pl-cur-price { white-space: nowrap; }
.pl-plan-ic { flex: none; display: grid; place-items: center; width: clamp(48px, 2vw + 22px, 60px); height: clamp(48px, 2vw + 22px, 60px); border-radius: 14px; background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; transition: transform .3s ease; }
.pl-cur.is-pro .pl-plan-ic { background: linear-gradient(135deg, #ECFDF5, #FFFBEB); color: #047857; }
.pl-cur.is-business .pl-plan-ic { background: linear-gradient(135deg, #EAF7FF, #FFF1F3); color: #0369a1; }
.pl-cur:hover .pl-plan-ic { transform: rotate(-8deg) scale(1.08); }
.pl-cur-price { margin: 0; font-size: clamp(12px, 0.3vw + 8px, 14px); color: var(--ink-soft); }
.pl-cur-price b { font-size: clamp(13.5px, 0.35vw + 9px, 16px); color: var(--ink); }
.pl-cur-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: auto; }
.pl-cur-date { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.pl-cur-date + .pl-cur-date { padding-left: 16px; border-left: 1px solid var(--border-soft); }
.pl-cur-date:first-child:not(:only-child) { padding-right: 16px; }
.pl-cur-date-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary-600); }
.pl-cur-date > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pl-cur-date small { font-size: clamp(11.5px, 0.25vw + 8px, 12.5px); color: var(--ink-soft); }
.pl-cur-date b { font-size: clamp(13.5px, 0.4vw + 8px, 16px); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
/* Gói trả phí đã hết hạn: 1 hàng gọn thay cho ngày hết hạn (thay dải đỏ đầu trang), tông đỏ nhạt */
.pl-cur-dates.is-expired { grid-template-columns: minmax(0, 1fr); }
.pl-cur-dates.is-expired .pl-cur-date-ic { background: var(--danger-50); color: var(--danger-600); }
.pl-cur-dates.is-expired small { color: var(--danger-600); font-weight: 600; }
.pl-cur-dates.is-expired b { font-size: 13px; font-weight: 500; color: var(--ink-soft); line-height: 1.45; }
.pl-cur-left { font-style: normal; font-size: 11.5px; font-weight: 600; }
.pl-cur-left.is-ok { color: #15803d; } .pl-cur-left.is-warn { color: #c2410c; } .pl-cur-left.is-bad { color: #e11d48; }
/* Nhãn trạng thái có chấm tròn cùng màu chữ */
.pl-pill-dot { gap: 6px; padding: 3px 12px; font-size: 12px; }
.pl-pill-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pl-cur-foot { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; margin-top: auto;  }
.pl-cur-foot > button { order: 0; width: auto; min-width: 0; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pl-cur-more svg { color: var(--ink-soft); }
/* Nút "Chi tiết gói ⌄" / "Thu gọn ⌃": đang mở = viền + chữ xanh; mũi tên xoay theo trạng thái */
.pl-cur-more.is-open { border-color: var(--primary); color: var(--primary-600); }
.pl-cur-more.is-open svg { color: var(--primary-600); }

/* Cỡ chữ trong khung này: clamp(88% cỡ gốc, vw, cỡ gốc) — cỡ gốc đúng ở màn 1440px; zoom thì chữ co bớt (ít xuống dòng) nhưng không nhỏ hơn 88% */
/* Khung Chi tiết gói (settings.js planDetailHTML), theo mẫu chủ dự án duyệt 11/2026: nền sáng, mỗi nhóm 1 tông pastel theo chức năng
   (--pd-c: không gian xanh dương, thành viên xanh lá, AI / trạng thái tím, tự động hóa cam, biểu mẫu xanh ngọc), số liệu lớn, khoảng trắng thoáng.
   Cùng 1 tông cho biểu tượng, nền thẻ, rãnh thanh, chip của thẻ đó. Màu mang nghĩa (vàng sắp đầy, đỏ đầy / hết hạn) giữ riêng. */
/* Khung Chi tiết gói xổ xuống / thu lên: lớp chung .tm-collapse, rút còn 0,2 giây theo yêu cầu chủ dự án */
.pd-collapse, .pd-collapse > * { transition-duration: .2s; }
.pd { container-type: inline-size; display: flex; flex-direction: column; gap: 16px; margin-top: 16px; padding: 22px; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 4%, var(--surface)), var(--surface) 160px); }
.pd .is-blue { --pd-c: var(--primary); --pd-ink: var(--primary-600); }
.pd .is-green { --pd-c: var(--success); --pd-ink: var(--success-700); }
.pd .is-orange { --pd-c: #fb923c; --pd-ink: #c2410c; }
.pd .is-teal { --pd-c: #2dd4bf; --pd-ink: #0f766e; }
.pd .is-purple { --pd-c: #a78bfa; --pd-ink: #7c3aed; }
.pd-head { display: flex; align-items: center; gap: 14px; }
.pd-head > .pd-ic { width: 46px; height: 46px; border-radius: 14px; }
.pd-title { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font-size: clamp(17.6px, 1.389vw, 20px); font-weight: 700; color: var(--ink); }
.pd-ic { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: color-mix(in srgb, var(--pd-c, var(--muted)) 16%, var(--surface)); color: var(--pd-ink, var(--ink-soft)); }
.pd-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: clamp(10.6px, 0.833vw, 12px); font-weight: 600; line-height: 1.7; white-space: nowrap; }
.pd-chip.is-warn { background: var(--warning-100); color: var(--warning-700); }
.pd-chip.is-ok { background: var(--success-50); color: var(--success-700); }
.pd-chip.is-bad { background: var(--danger-50); color: var(--danger-600); }
.pd-chip.is-muted { background: var(--bg); color: var(--ink-soft); }
.pd-chip.is-tone { background: color-mix(in srgb, var(--pd-c) 16%, var(--surface)); color: var(--pd-ink); }
.pd-card > .pd-chip, .pd-metric > .pd-chip { align-self: flex-start; width: fit-content; }
/* Nút phụ dạng viên xanh nhạt (Cập nhật, Thu gọn); nút chính dùng .btn-primary */
.pd-soft-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--primary-50); font: inherit; font-size: clamp(11.4px, 0.903vw, 13px); font-weight: 600; color: var(--primary-600); cursor: pointer; transition: background-color .15s; }
.pd-soft-btn:hover { background: var(--primary-100); }
.pd-caret { transform: rotate(90deg); transition: transform .2s; }
.pd-caret.is-up { transform: rotate(-90deg); }
.pd-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pd-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
/* Khung hẹp (màn nhỏ hoặc zoom 125–150%): giảm số cột thay vì thu nhỏ chữ — giữ chữ đọc được khi zoom */
@container (max-width: 900px) {
  .pd-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-grid3 > :last-child { grid-column: 1 / -1; }
  .pd-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 560px) {
  .pd-grid3, .pd-grid4 { grid-template-columns: minmax(0, 1fr); }
}
.pd-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 15px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); overflow: hidden; transition: background-color .15s, border-color .15s; }
.pd-card.is-tone { background: color-mix(in srgb, var(--pd-c) 7%, var(--surface)); border-color: color-mix(in srgb, var(--pd-c) 24%, var(--surface)); }
.pd-card.is-tone:hover { background: color-mix(in srgb, var(--pd-c) 12%, var(--surface)); border-color: color-mix(in srgb, var(--pd-c) 38%, var(--surface)); }
/* Góc trên phải của 3 thẻ đầu: vệt màu nhạt tạo chiều sâu (chỉ trang trí) */
.pd-grid3 > .pd-card::before, .pd-grid3 > .pd-card::after { content: ""; position: absolute; top: 0; right: 0; pointer-events: none; }
.pd-grid3 > .pd-card::after { width: 96px; height: 64px; clip-path: polygon(38% 0, 100% 0, 100% 100%); background: linear-gradient(200deg, color-mix(in srgb, var(--pd-c) 42%, transparent), color-mix(in srgb, var(--pd-c) 10%, transparent)); }
.pd-grid3 > .pd-card::before { width: 150px; height: 96px; clip-path: polygon(18% 0, 40% 0, 100% 62%, 100% 92%); background: linear-gradient(200deg, color-mix(in srgb, var(--pd-c) 18%, transparent), transparent 85%); }
.pd-card-title { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 0 0 2px; font-size: clamp(14.1px, 1.111vw, 16px); font-weight: 700; color: var(--ink); }
.pd-note { margin: 0; font-size: clamp(11.9px, 0.938vw, 13.5px); line-height: 1.5; color: var(--ink); }
.pd-note.is-soft { font-size: clamp(11px, 0.868vw, 12.5px); color: var(--ink-soft); }
.pd-term-dates { display: flex; justify-content: space-between; gap: 10px; }
.pd-term-dates div { display: flex; flex-direction: column; gap: 2px; }
.pd-term-dates .is-end { text-align: right; }
.pd-term-dates small { font-size: clamp(11px, 0.868vw, 12.5px); color: var(--ink-soft); }
.pd-term-dates b { font-size: clamp(15.8px, 1.25vw, 18px); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pd-term-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-term-gone { display: inline-flex; align-items: center; gap: 6px; font-size: clamp(11px, 0.868vw, 12.5px); color: var(--ink-soft); }
.pd-bar { display: block; height: 6px; border-radius: 999px; background: #021e4214; overflow: hidden; }
.pd-bar i { display: block; height: 100%; border-radius: inherit; background: var(--pd-ink, var(--primary)); }
.pd-bar.is-term i { background: var(--primary); }
.is-near > .pd-bar i, .pd-bar.is-near i { background: var(--warning); }
.is-full > .pd-bar i, .pd-bar.is-full i { background: var(--danger); }
.pd-alert { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 1px solid; border-radius: 10px; font-size: clamp(11px, 0.868vw, 12.5px); line-height: 1.45; }
.pd-alert.is-warn { background: var(--warning-50); border-color: var(--warning-100); color: var(--warning-700); }
.pd-alert.is-bad { background: var(--danger-50); border-color: var(--danger-100); color: var(--danger-600); }
.pd-bigs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pd-big { display: flex; flex-direction: column; min-width: 0; }
.pd-big b { font-size: clamp(24.6px, 1.944vw, 28px); font-weight: 800; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.pd-big span { margin-top: 4px; font-size: clamp(11.9px, 0.938vw, 13.5px); font-weight: 600; color: var(--ink); }
.pd-big small { font-size: clamp(11px, 0.868vw, 12.5px); color: var(--ink-soft); }
.pd-state-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: auto; }
.pd-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: clamp(11.9px, 0.938vw, 13.5px); font-weight: 600; color: var(--primary-600); white-space: nowrap; cursor: pointer; }
.pd-link:hover { text-decoration: underline; }
.pd-link.is-danger { color: var(--danger-600); }
.pd-alert .pd-link { flex: none; color: inherit; text-decoration: underline; }
.pd-sec { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 4px 0 -4px; font-size: clamp(14.1px, 1.111vw, 16px); font-weight: 700; color: var(--ink); }
.pd-sec .pd-ic { width: 34px; height: 34px; }
.pd-sec-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pd-use { gap: 10px; container-type: inline-size; }
.pd-use .pd-card-title { margin-bottom: 4px; }
.pd-use .pd-metric { padding: 0; border-top: 0; }
/* Thẻ quá hẹp: nhãn lên trên, số lớn ngay dưới — nhãn giữ đủ chữ, không bị bẻ dòng cạnh số */
@container (max-width: 160px) {
  .pd-metric-top { flex-direction: column; align-items: flex-start; gap: 2px; }
}
/* Tab Hiện tại / Lượt dùng cạnh tiêu đề Mức sử dụng (dùng lại kiểu nút Ngày / Tuần của Workload) */
.pd-tabs { flex: none; }
.pd-metric { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--pd-c) 20%, var(--surface)); }
.pd-card-title + .pd-metric { padding-top: 10px; border-top: 0; }
.pd-use .pd-card-title + .pd-metric { padding-top: 0; }
/* Nội dung 3 thẻ đầu nằm trên lớp trang trí ở góc */
.pd-grid3 > .pd-card > * { position: relative; z-index: 1; }
.pd-metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: clamp(11px, 0.868vw, 12.5px); color: var(--ink); }
.pd-num { flex: none; font-size: clamp(12.8px, 1.007vw, 14.5px); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.pd-num small { font-size: clamp(12.3px, 0.972vw, 14px); font-weight: 700; color: var(--ink); }
.pd-metric.is-full .pd-num { color: var(--danger-600); }
.pd-metric .pd-chip { align-self: flex-start; }
.pd-metric-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pd-pct { font-size: clamp(11px, 0.868vw, 12.5px); font-weight: 600; color: var(--pd-ink, var(--ink-soft)); }
.pd-flag { font-size: clamp(10.6px, 0.833vw, 12px); font-weight: 600; white-space: nowrap; }
.pd-flag.is-near, .pd-flag.is-near .pd-link { color: var(--warning-700); }
.pd-flag.is-full, .pd-flag.is-full .pd-link { color: var(--danger-600); }
.pd-flag .pd-link { font-size: clamp(10.6px, 0.833vw, 12px); }
/* Tính năng theo gói: 4 thẻ trắng nhỏ, mỗi thẻ 3 dòng; ✓ xanh lá trong vòng nhạt; rê từng dòng tô nền */
.pd-feats { margin: 0; padding: 4px 8px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); list-style: none; }
.pd-feats li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--border-soft); font-size: clamp(12.3px, 0.972vw, 14px); color: var(--ink); transition: background-color .15s; }
.pd-feats li:last-child { border-bottom: 0; }
.pd-feats li:hover { border-radius: 8px; background: var(--bg); }
.pd-feats li.is-off { color: var(--muted); }
.pd-feats li small { display: block; font-size: clamp(10.6px, 0.833vw, 12px); color: var(--primary-600); }
.pd-check { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--success-100); color: var(--success-700); }
.pd-feats li.is-off .pd-check { background: var(--bg); color: var(--muted); }
.pd-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.pd-foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.pd-foot-sep { width: 1px; height: 18px; background: var(--border); }
/* Đang tải lại: khung xám giữ bố cục */
.pd-skel { min-height: 120px; }
.pd-skel span, .pd-skel-line { display: block; height: 12px; border-radius: 6px; background: var(--border-soft); }
.pd-skel span:first-child { width: 45%; }
.pd-skel span:nth-child(2) { width: 80%; }
.pd-skel span:nth-child(3) { width: 60%; }
.pd-skel-line.is-title { width: 30%; height: 18px; }
.pd-skel-line.is-short { width: 55%; }
@media (prefers-reduced-motion: reduce) { .pd-caret, .pd-card, .pd-feats li, .pd-soft-btn { transition: none; } }
@media (max-width: 600px) {
  .pd { padding: 16px; }
  .pd-head { flex-wrap: wrap; }
  .pd-foot { flex-wrap: wrap; }
  .pd-big b { font-size: clamp(21.1px, 1.667vw, 24px); }
}
.pl-usage .stat-tiles.is-4 { flex: 1; gap: 12px; }
.pl-tile { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid transparent; border-radius: var(--radius-md); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.pl-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(15, 23, 42, .08); }
.pl-tile.is-green { --t: #10b981; --tb: #ecfdf5; }
.pl-tile.is-blue { --t: #0ea5e9; --tb: #eff8ff; }
.pl-tile.is-pink { --t: #f43f5e; --tb: #fff1f3; }
.pl-tile.is-amber { --t: #f59e0b; --tb: #fffbeb; }
.pl-tile { background: var(--tb); border-color: color-mix(in srgb, var(--t) 18%, transparent); }
.pl-tile-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface); color: var(--t); box-shadow: 0 2px 6px rgba(15, 23, 42, .06); transition: transform .3s ease; }
.pl-tile:hover .pl-tile-ic { transform: scale(1.12) rotate(-6deg); }
/* Ô xếp dọc: hàng tên (icon + tên) / số / thanh đo / % — số được xuống dòng thay vì bị cắt "…" */
.pl-tile-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pl-tile-head .pl-tile-ic { width: 26px; height: 26px; border-radius: 8px; }
.pl-tile .stat-label { display: block; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(11.5px, 0.35vw + 7px, 13.5px); font-weight: 600; color: var(--ink-soft); }
.pl-tile .stat-value { margin-top: 12px; font-size: clamp(17px, 0.8vw + 8px, 23px); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pl-meter.is-none { visibility: hidden; }
/* Ô giãn theo chiều cao khung (bằng thẻ Gói hiện tại): thanh đo + % dính đáy, không để trống lơ lửng giữa ô */
.pl-tile .stat-value { margin-bottom: 12px; }
.pl-tile .pl-meter { margin-top: auto; }
.pl-usage .pl-tile { padding: 14px; min-height: 132px; }
.pl-tile .stat-of { font-size: clamp(11.5px, 0.35vw + 7.5px, 14px); font-weight: 500; color: var(--ink-soft); }
.pl-tile-pct { margin-top: 6px; font-size: clamp(11px, 0.3vw + 7px, 13px); color: var(--ink-soft); }
.pl-meter { display: block; height: 5px; margin-top: 6px; border-radius: 999px; background: color-mix(in srgb, var(--t) 15%, #fff); overflow: hidden; }
.pl-meter i { display: block; height: 100%; border-radius: inherit; background: var(--t); }
.pl-top.is-anim .pl-meter i { animation: plGrow .9s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes plGrow { from { width: 0; } }
.pl-choose .set-card-head { flex-wrap: wrap; gap: 10px; }
.pl-cycle { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--bg); }
.pl-cycle button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.pl-cycle button i { width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; transition: background .2s ease; }
.pl-cycle button.is-on { background: var(--surface); color: var(--primary-600); box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }
.pl-cycle button.is-on i { background: currentColor; }
.pl-cycle button:not(.is-on):hover { color: var(--ink); }
.pl-save { padding: 2px 10px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 11.5px; font-weight: 700; animation: plPulse 2.4s ease-in-out infinite; }
@keyframes plPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .35); } 50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); } }
.pl-choose .plan-compare { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; padding-top: 6px; }
.pl-choose .plan-col { position: relative; padding: 18px 16px 16px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.pl-choose .plan-col:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--primary), 0 14px 32px rgba(56, 189, 248, .18); border-color: var(--primary); } /* viền xanh chỉ hiện khi rê */
.pl-choose .plan-col.is-current { box-shadow: none; border-color: var(--border-soft); }
.pl-choose .plan-col.is-business { background: var(--surface); }
.pl-choose .plan-col.is-featured { background: linear-gradient(180deg, #f0f9ff, var(--surface) 160px); }
.pl-choose .plan-col.is-featured:hover::before { content: ""; position: absolute; inset: -2px; border-radius: 14px; padding: 2px; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .9) 50%, transparent 70%) -200% 0 / 200% 100% no-repeat; -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; animation: plShine 3.5s ease-in-out infinite; }
@keyframes plShine { 0% { background-position: -200% 0; } 60%, 100% { background-position: 200% 0; } }
.pl-choose .plan-col h4 { font-size: 17px; font-weight: 800; }
.pl-choose .plan-popular { margin-left: auto; padding: 2px 10px; background: linear-gradient(135deg, #a78bfa, #818cf8); font-size: 11px; }
.pl-choose .plan-price b { font-size: 22px; font-weight: 800; }
.pl-choose .plan-col.is-free .plan-price b { color: #16a34a; }
.pl-choose .plan-col.is-pro .plan-price b { color: var(--primary-600); }
.pl-choose .plan-list { margin: 8px 0 14px; gap: 8px; font-size: 13px; }
.pl-choose .plan-list li { transition: transform .2s ease; }
.pl-choose .plan-col:hover .plan-list li { transform: translateX(2px); }
.pl-choose .plan-list li svg { color: #10b981; }
.pl-choose .plan-col > button, .pl-choose .plan-col .tip-wrap button { height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 700; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.pl-choose .plan-col > button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(56, 189, 248, .3); }
.pl-choose .plan-col.is-business > .btn-secondary:not(:disabled) { border-color: var(--primary); color: var(--primary-600); }
.pl-choose .plan-col.is-business > .btn-secondary:not(:disabled):hover { background: var(--primary-50); }
.pl-top.is-anim ~ .pl-choose .plan-col { animation: plRise .5s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--i) * 80ms); }
@keyframes plRise { from { opacity: 0; transform: translateY(12px); } }
.plb-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.pl-quick-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--qb); border-radius: 14px; background: var(--qbg); font: inherit; text-align: left; cursor: pointer; transition: transform .25s ease, box-shadow .25s ease; }
.pl-quick-card.is-blue { --q: #0ea5e9; --qbg: #f0f9ff; --qb: #bae6fd; }
.pl-quick-card.is-orange { --q: #f97316; --qbg: #fff7ed; --qb: #fed7aa; }
.pl-quick-card.is-purple { --q: #a855f7; --qbg: #faf5ff; --qb: #e9d5ff; }
.pl-quick-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px color-mix(in srgb, var(--q) 22%, transparent); }
.pl-quick-card:focus-visible { outline: 2px solid var(--q); outline-offset: 2px; }
.pl-quick-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); color: var(--q); box-shadow: 0 2px 8px rgba(15, 23, 42, .06); transition: transform .3s ease; }
.pl-quick-card:hover .pl-quick-ic { transform: scale(1.1) rotate(-6deg); }
.pl-quick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-quick-text b { font-size: 14px; color: var(--ink); }
.pl-quick-text small { font-size: 12px; color: var(--ink-soft); }
.pl-quick-go { flex: none; color: var(--q); transition: transform .25s ease; }
.pl-quick-card:hover .pl-quick-go { transform: translateX(4px); }
/* Xếp chồng 2 khung đầu trang Gói theo bề rộng THẬT của vùng nội dung Cài đặt (không theo màn hình) -> zoom lớn vẫn đủ chỗ cho 4 ô */
.set-main { container: setmain / inline-size; }
@container setmain (max-width: 900px) {
  .pl-top { grid-template-columns: minmax(0, 1fr); }
  /* Khung Gói chiếm cả hàng: nút giữ độ rộng vừa chữ, xếp bên trái thay vì kéo dài hết bề ngang */
  .pl-cur-foot { grid-auto-columns: minmax(150px, max-content); justify-content: start; }
}
@media (max-width: 1100px) { .pl-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .pl-choose .plan-compare, .plb-quick { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .set-head-text { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .set-head-text .pl-upgrade { grid-column: 1; grid-row: auto; justify-self: start; }
  .pl-usage .stat-tiles.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-cycle { flex-wrap: wrap; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .pl-page *, .pl-page *::before, .set-head .pl-upgrade { animation: none !important; transition: none !important; }
}
.pl-usage { container-type: inline-size; }
.pl-tile { flex-direction: column; align-items: stretch; gap: 0; }
@container (max-width: 460px) { .pl-usage .stat-tiles.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pl-choose .plan-col.is-current:hover { box-shadow: 0 0 0 1px var(--primary), 0 14px 32px rgba(56, 189, 248, .18); border-color: var(--primary); }
/* Màu theo gói (chủ dự án chọn): nền dọc màu 1 (trên) → trắng (giữa) → màu 2 (dưới); giá chuyển giữa 2 màu đậm tương ứng
   Pro = Hoàn thành #ECFDF5 / Đang làm #FFFBEB (đậm #34D399 → #F59E0B); Business = Cần làm #EAF7FF / Cần kiểm tra #FFF1F3 (đậm #38BDF8 → #FB7185) */
.pl-choose .plan-col.is-pro, .pl-choose .plan-col.is-featured.is-pro, .pl-cur.is-pro { background: linear-gradient(180deg, #ECFDF5 0%, #fff 42%, #fff 58%, #FFFBEB 100%); }
.pl-choose .plan-col.is-business, .pl-cur.is-business { background: linear-gradient(180deg, #EAF7FF 0%, #fff 42%, #fff 58%, #FFF1F3 100%); }
.pl-choose .plan-col.is-pro .plan-price b, .pl-cur.is-pro .pl-cur-price b, .pl-cur.is-pro .plan-name { background: linear-gradient(90deg, #34D399, #F59E0B); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pl-choose .plan-col.is-business .plan-price b, .pl-cur.is-business .pl-cur-price b, .pl-cur.is-business .plan-name { background: linear-gradient(90deg, #38BDF8, #FB7185); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* Standard (14/11/2026): bạc hà #E9F9F4 (trên) → xanh băng #ECF7FF (dưới), giá xanh ngọc #18A6A6 → xanh trời; khác hẳn Pro / Business */
.pl-choose .plan-col.is-standard, .pl-cur.is-standard { background: linear-gradient(180deg, #E9F9F4 0%, #fff 42%, #fff 58%, #ECF7FF 100%); border-color: color-mix(in srgb, #18A6A6 22%, var(--border-soft)); }
.pl-choose .plan-col.is-standard .plan-price b, .pl-cur.is-standard .pl-cur-price b, .pl-cur.is-standard .plan-name { background: linear-gradient(90deg, #18A6A6, #38BDF8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pl-cur.is-standard .pl-plan-ic { background: linear-gradient(135deg, #E9F9F4, #ECF7FF); color: #0F766E; }
.pl-cur.is-standard .plan-name .pl-plan-ic { -webkit-background-clip: border-box; background-clip: border-box; }
.plan-popular.is-standard { background: #E6F7F4; color: #0F766E; }
.pl-choose .plan-price b.is-na { font-size: 15px; color: var(--ink-soft); background: none; -webkit-text-fill-color: currentColor; }
/* 4 gói cùng hàng ở màn rộng, hẹp dần xuống 2 cột rồi 1 cột */
.pl-choose { container-type: inline-size; }
.pl-choose .plan-compare { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (max-width: 980px) { .pl-choose .plan-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 520px) { .pl-choose .plan-compare { grid-template-columns: minmax(0, 1fr); } }
.pl-cur.is-pro .plan-name .pl-plan-ic, .pl-cur.is-business .plan-name .pl-plan-ic { -webkit-background-clip: border-box; background-clip: border-box; }

/* Cài đặt › Trợ lý AI bản mới (settings.js aiLevelCardsHTML / settingsAiHTML / aiUsageWalletCardHTML):
   thẻ chọn cấp độ AI hàng ngang · hàng dưới Cấu hình nâng cao (trái) + Sử dụng token có vòng % (phải) */
.set-head-text .ai-help-btn { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: 6px; height: 32px; border-color: var(--primary-100); color: var(--primary-600); transition: background .2s ease, transform .2s ease; }
.set-head-text .ai-help-btn:hover { background: var(--primary-50); transform: translateY(-1px); }
.ai-set-page .set-card { transition: box-shadow .25s ease, transform .25s ease; }
.ai-set-page .set-card:hover { box-shadow: var(--shadow-md); }
.ai-lv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ai-lv-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; }
.ai-lv-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 10px 24px rgba(56, 189, 248, .16); }
.ai-lv-card.is-on { border-color: var(--primary); background: linear-gradient(180deg, var(--primary-50), var(--surface) 90%); box-shadow: 0 0 0 1px var(--primary) inset; }
.ai-lv-card:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.ai-lv-radio { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 50%; background: var(--surface); color: transparent; transition: background .2s ease, border-color .2s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.ai-lv-card.is-on .ai-lv-radio { border-color: var(--primary); background: var(--primary); color: #fff; transform: scale(1.08); }
.ai-lv-ic { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 4px; border-radius: 10px; transition: transform .3s ease; }
.ai-lv-card.is-economy .ai-lv-ic { background: #fffbeb; color: #d97706; }
.ai-lv-card.is-standard .ai-lv-ic { background: #eff8ff; color: #0284c7; }
.ai-lv-card.is-deep .ai-lv-ic { background: #faf5ff; color: #9333ea; }
.ai-lv-card:hover .ai-lv-ic { transform: scale(1.1) rotate(-8deg); }
.ai-lv-name { font-size: 14.5px; color: var(--ink); padding-right: 24px; }
.ai-lv-family { margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--muted); } /* Lite / Flash / Pro: model thật của cấp */
.ai-lv-desc { font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.ai-lv-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 6px; }
.ai-lv-badges .choice-badge.is-on { background: #dcfce7; color: #15803d; }
.ai-set-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.ai-set-row > .set-card { margin: 0; }
.ai-cfg-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, auto); align-items: center; gap: 6px 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.ai-cfg-row:last-of-type { border-bottom: 0; }
.ai-cfg-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-cfg-label b { font-size: 13.5px; color: var(--ink); }
.ai-cfg-label small { font-size: 12px; color: var(--ink-soft); }
.ai-cfg-ctl { justify-self: end; }
.ai-cfg-ctl select.form-control, .ai-cfg-ctl .cselect-btn.form-control { width: 170px; height: 34px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.ai-cfg-row > .ai-style-sample, .ai-cfg-row > .set-ai-custom { grid-column: 1 / -1; margin: 4px 0 0; }
.ai-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border-soft); }
.ai-seg label { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.ai-seg label:hover { color: var(--ink); }
.ai-seg label.is-on { background: var(--surface); color: var(--primary-600); box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }
.ai-seg label:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.ait-ring-row { display: flex; align-items: center; gap: 18px; margin: 4px 0 14px; }
.ait-ring { position: relative; flex: none; width: 112px; height: 112px; transition: transform .3s ease; }
.ait-ring:hover { transform: scale(1.04); }
.ait-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ait-ring circle { fill: none; stroke-width: 10; }
.ait-ring-bg { stroke: var(--primary-50); }
.ait-ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ait-ring.is-warn .ait-ring-fg { stroke: #f97316; }
.ait-ring.is-bad .ait-ring-fg { stroke: var(--danger); }
.ait-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 800; color: var(--ink); }
.ai-set-page.is-anim .ait-ring-fg { animation: aitRing 1s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes aitRing { from { stroke-dashoffset: 263.9; } }
.ait-ring-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ait-ring-text > span { font-size: 12.5px; color: var(--ink-soft); }
.ait-big { font-size: 20px; font-weight: 800; color: var(--ink); }
.ait-big small { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.ait-unit { font-size: 12px; color: var(--ink-soft); }
.ait-left { align-self: flex-start; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #dcfce7; color: #15803d; }
.ait-left.is-warn { background: #fff7ed; color: #c2410c; }
.ait-left.is-bad { background: #ffe4e6; color: #e11d48; }
.ait-limits { padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.ait-limits h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink); }
.ait-limits ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ait-limits li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-soft); }
.ait-limits li b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.ait-reset { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.ai-set-page.is-anim .ai-lv-card { animation: plRise .45s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--i) * 70ms); }
@media (max-width: 900px) { .ai-set-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .set-head-text .ai-help-btn { grid-column: 1; grid-row: auto; justify-self: start; }
  .ai-cfg-row { grid-template-columns: minmax(0, 1fr); }
  .ai-cfg-ctl { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { .ai-set-page *, .ai-help-btn { animation: none !important; transition: none !important; } }
.ai-cfg .set-note { display: flex; align-items: flex-start; gap: 6px; }
.ai-cfg .set-note svg { flex: none; margin-top: 3px; }

/* Bảng so sánh đầy đủ bản mới (settings.js planCompareTableHTML): góc trái có tiêu đề, cột gói có nhãn màu, dải nhóm tô màu, hàng có biểu tượng */
.cmp-wrap { max-height: 620px; border-radius: 14px; background: var(--surface); }
.cmp-table { font-size: 13.5px; table-layout: fixed; }
.cmp-table thead th { padding: 14px 12px; border-bottom: 1px solid var(--border-soft); background: var(--surface); vertical-align: middle; }
.cmp-table thead th + th, .cmp-table tbody td { border-left: 1px solid var(--border-soft); }
.cmp-col-name { width: 34%; }
.cmp-corner { text-align: left; }
.cmp-corner-in { display: flex; align-items: center; gap: 12px; }
.cmp-corner-in > span:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.cmp-corner b { font-size: 15px; color: var(--ink); }
.cmp-corner small { font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.cmp-corner-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--primary-50), var(--primary-100)); color: var(--primary-600); }
.cmp-plan b { font-size: 15px; color: var(--ink); }
.cmp-plan.is-current { background: linear-gradient(180deg, var(--primary-50), var(--surface)); }
.cmp-tag { display: inline-block; margin-left: 6px; padding: 3px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600; vertical-align: middle; }
.cmp-tag.is-free { background: #EAF7FF; color: #0284c7; }
.cmp-tag.is-pro { background: #ECFDF5; color: #059669; }
.cmp-tag.is-business { background: #FFF1F3; color: #e11d48; }
.cmp-table tbody th { display: table-cell; font-weight: 500; }
.cmp-table tbody th, .cmp-table td { padding: 9px 12px; }
.cmp-row-ic { display: inline-grid; place-items: center; width: 22px; margin-right: 10px; vertical-align: -3px; color: var(--ink-soft); }
.cmp-table tbody tr:not(.cmp-group) { transition: background .15s ease; }
.cmp-table tbody tr:not(.cmp-group):hover { background: var(--primary-50); }
.cmp-table tbody tr:not(.cmp-group):hover .cmp-row-ic { color: var(--primary-600); }
.cmp-table tr.cmp-group th { padding: 10px 12px; font-size: 13.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.cmp-table tr.cmp-group.is-blue th { background: #EAF7FF; }
.cmp-table tr.cmp-group.is-purple th { background: #F5F3FF; }
.cmp-table tr.cmp-group.is-green th { background: #ECFDF5; }
.cmp-table tr.cmp-group.is-blue .cmp-row-ic { color: #0284c7; }
.cmp-table tr.cmp-group.is-purple .cmp-row-ic { color: #7c3aed; }
.cmp-table tr.cmp-group.is-green .cmp-row-ic { color: #059669; }
.cmp-inf { font-size: 17px; font-weight: 700; color: #10b981; }
.cmp-dash { color: var(--ink-soft); }
.cmp-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 12px; font-weight: 600; }
.cmp-yes { display: inline-grid; place-items: center; color: #10b981; }
.cmp-yes svg { stroke-width: 3; }
.cmp-no { display: inline-block; position: relative; width: 16px; height: 16px; border-radius: 50%; background: #cbd5e1; vertical-align: middle; }
.cmp-no::after { content: ""; position: absolute; left: 4px; right: 4px; top: 7px; height: 2px; border-radius: 2px; background: #fff; }
@media (max-width: 760px) {
  .cmp-table { table-layout: auto; min-width: 560px; }
  .cmp-col-name { width: auto; }
  .cmp-corner small { display: none; }
  .cmp-tag { display: block; width: max-content; margin: 4px auto 0; }
}
/* Tên hàng dài xuống dòng vẫn thẳng mép chữ (biểu tượng đứng riêng bên trái) */
.cmp-table tbody th { position: relative; padding-left: 44px; }
.cmp-table tbody th .cmp-row-ic { position: absolute; left: 12px; top: 50%; margin: 0; transform: translateY(-50%); }
.cmp-table tr.cmp-group th { padding-left: 44px; }
.cmp-wrap { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.cmp-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.cmp-wrap::-webkit-scrollbar-thumb { border-radius: 8px; background: var(--scroll-thumb); }
.cmp-wrap::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
.cmp-wrap::-webkit-scrollbar-track { background: transparent; }
.cmp-wrap::-webkit-scrollbar-button { display: none; }

/* Báo cáo tổng quát: [Hiệu suất nhân sự | Theo người] (reports.js repStaffHTML / repPeopleBarsHTML) */
.rep-scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.rep-scroll::-webkit-scrollbar { width: 6px; }
.rep-scroll::-webkit-scrollbar-thumb { border-radius: 6px; background: var(--scroll-thumb); }
.rep-scroll::-webkit-scrollbar-button { display: none; }
/* Theo người: danh sách lấp đầy chiều cao thẻ (cao bằng thẻ Hiệu suất bên cạnh), dài hơn thì cuộn trong khung */
.rep-people { display: flex; flex-direction: column; }
/* Vùng danh sách cao cố định (chủ dự án 09/11/2026): đổi tab Quá hạn / Hoàn thành, kể cả khi trống, thẻ không co lại
   (thẻ Theo dự án cùng hàng cao theo thẻ này); nhiều người thì cuộn trong vùng */
/* Vừa đúng 5 người: dòng 44px (ảnh 34px + đệm 2×5px) × 5 + khoảng cách 4px × 4 = 236px; nhiều hơn thì cuộn */
.rep-people .rep-pbar-row { box-sizing: border-box; height: 44px; flex: none; }
.rep-people .rep-pbars, .rep-people .rep-people-empty { flex: none; height: 236px; padding-right: 4px; }
.rep-people .rep-people-empty { display: flex; align-items: center; justify-content: center; box-sizing: border-box; margin: 0; padding-top: 0; padding-bottom: 0; }
/* Dòng mô tả 2 tab dài ngắn khác nhau: luôn 1 dòng (cắt …) để đầu thẻ không cao thêm khi đổi tab */
.rep-people .rep-card-head { flex-wrap: nowrap; }
.rep-people .rep-card-head > div:first-child { flex: 1 1 0; min-width: 0; }
.rep-people .rep-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-people .rep-card-head { align-items: flex-start; }
.rep-ptabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg); flex: none; }
.rep-ptab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.rep-ptab:hover { color: var(--ink); }
.rep-ptab.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.rep-ptab-n { min-width: 18px; padding: 0 5px; border-radius: 999px; background: rgba(15, 23, 42, .06); font-size: 11px; line-height: 18px; text-align: center; }
.rep-ptab-n.is-red { background: var(--danger); color: #fff; }
/* Hiệu suất nhân sự */
.rep-staff { display: flex; flex-direction: column; }
.rep-stiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.rep-stile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid transparent; border-radius: 12px; transition: transform .2s ease, box-shadow .2s ease; }
.rep-stile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 23, 42, .07); }
.rep-stile.is-blue { background: #eff8ff; border-color: #dbeefd; --c: #0284c7; }
.rep-stile.is-green { background: #ecfdf5; border-color: #d1f5e3; --c: #059669; }
.rep-stile.is-violet { background: #f5f3ff; border-color: #e9e3fe; --c: #7c3aed; }
.rep-stile b { font-size: 22px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.rep-stile small { font-size: 11.5px; color: var(--ink-soft); }
.rep-stile .rep-delta { align-self: flex-start; }
.rep-h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.rep-staff-table { max-height: 236px; border: 1px solid var(--border-soft); border-radius: 12px; }
.rep-staff-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) 72px minmax(96px, auto); align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border-soft); background: none; font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; transition: background .15s ease; }
.rep-staff-row:last-child { border-bottom: 0; }
.rep-staff-row:not(.is-head):hover { background: var(--primary-50); }
.rep-staff-row.is-head { position: sticky; top: 0; z-index: 1; background: var(--bg); font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: default; }
.rep-staff-table.has-hours .rep-staff-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) 64px 72px minmax(96px, auto); }
.rep-staff-row .is-num { text-align: right; }
.rep-staff-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rep-staff-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-staff-proj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.rep-staff-proj small { color: var(--muted); }
.rep-staff-pct { font-weight: 700; }
.rep-staff-pct.is-good { color: #059669; }
.rep-staff-pct.is-low { color: var(--warning-700); }
.rep-spill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.rep-spill.is-red { background: var(--danger-50); color: var(--danger-600); }
.rep-spill.is-blue { background: #eff8ff; color: #0284c7; }
.rep-spill.is-gray { background: var(--bg); color: var(--ink-soft); }
.rep-spill.is-green { background: #dcfce7; color: #15803d; }
/* Biểu đồ năng lực theo thời gian */
.rep-cap { margin-top: 14px; }
.rep-cap-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rep-cap-head .rep-h3 { margin: 0; }
.rep-cap-legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink-soft); }
.rep-cap-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rep-cap-legend i { width: 10px; height: 10px; border-radius: 50%; }
.rep-cap-legend .is-done i { background: #3b82f6; }
.rep-cap-legend .is-open i { background: #bfdbfe; }
.rep-cap-legend .is-plan i { width: 12px; height: 0; border-radius: 0; border-top: 2px dashed #10b981; }
.rep-cap-chart { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); height: 130px; margin-top: 8px; }
.rep-cap-axis { display: flex; flex-direction: column; justify-content: space-between; padding: 0 6px 0 0; font-size: 11px; color: var(--muted); text-align: right; }
.rep-cap-chart svg { width: 100%; height: 100%; overflow: visible; }
.rep-cap-grid { stroke: var(--border-soft); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.rep-cap-area { fill: #dbeafe; opacity: .7; }
.rep-cap-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rep-cap-line.is-done { stroke: #3b82f6; stroke-width: 2.5; }
.rep-cap-line.is-open { stroke: #93c5fd; }
.rep-cap-line.is-plan { stroke: #10b981; stroke-dasharray: 5 4; }
.rep-cap-dots { position: absolute; top: 0; bottom: 0; left: 28px; right: 0; pointer-events: none; }
.rep-cap-dot { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #3b82f6; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); cursor: pointer; pointer-events: auto; transition: transform .15s ease; }
.rep-cap-dot:hover, .rep-cap-dot:focus-visible { transform: scale(1.5); }
.rep-cap-x { display: flex; justify-content: space-between; margin: 4px 0 0 28px; font-size: 11px; color: var(--muted); }
@media (max-width: 1200px) { .rep-stiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rep-stile b { font-size: 18px; } }
@media (max-width: 600px) {
  .rep-stiles { grid-template-columns: minmax(0, 1fr); }
  .rep-staff-row, .rep-staff-table.has-hours .rep-staff-row { grid-template-columns: minmax(0, 1fr) 56px minmax(84px, auto); }
  .rep-staff-row > :nth-child(2), .rep-staff-table.has-hours .rep-staff-row > :nth-child(3) { display: none; }
  .rep-people .rep-card-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .rep-stile, .rep-cap-dot, .rep-ptab { transition: none; } }
.rep-cap-chart svg { display: block; height: 130px; }
.rep-cap-chart { grid-template-rows: 130px; }
/* Hiệu suất nhân sự gọn hơn (theo mẫu): nút xuất, ô số thấp hơn, bảng hiện 3 người rồi cuộn, ảnh + tên nhỏ hơn, biểu đồ thấp hơn */
.rep-staff .rep-card-head { align-items: flex-start; }
.rep-staff-export { display: flex; gap: 6px; flex: none; }
.rep-xbtn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.rep-xbtn:hover:not(:disabled) { transform: translateY(-1px); }
.rep-xbtn.is-pdf { color: #e11d48; border-color: #fecdd3; }
.rep-xbtn.is-pdf:hover:not(:disabled) { background: #fff1f3; }
.rep-xbtn.is-xlsx { color: #059669; border-color: #bbf7d0; }
.rep-xbtn.is-xlsx:hover:not(:disabled) { background: #ecfdf5; }
.rep-xbtn:disabled { opacity: .6; cursor: wait; }
.rep-stiles { gap: 8px; margin-bottom: 10px; }
.rep-stile { padding: 8px 10px; gap: 0; }
.rep-stile b { font-size: 18px; line-height: 1.3; }
.rep-stile small { font-size: 11px; line-height: 1.35; }
.rep-staff-row { padding: 6px 10px; font-size: 12.5px; min-height: 38px; }
.rep-staff-row.is-head { min-height: 32px; font-size: 11.5px; }
.rep-staff-row .avatar, .rep-staff-row .member-avatar { width: 22px !important; height: 22px !important; min-width: 22px; font-size: 9.5px; }
.rep-staff-who { gap: 6px; }
.rep-staff-table { max-height: calc(32px + 3 * 38px + 2px); }
.rep-cap { margin-top: 10px; }
.rep-cap-chart { height: 96px; grid-template-rows: 96px; }
.rep-cap-chart svg { height: 96px; }
.rep-h3 { margin-bottom: 6px; font-size: 13px; }
.rep-period { margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--bg); font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; vertical-align: middle; }
.rep-staff .rep-card-head { align-items: center; }
.rep-staff > .rep-card-head { margin-bottom: 12px; }

/* Cài đặt › Thông báo dạng thẻ (settings.js settingsNotifyHTML): Công việc | Bình luận + Lịch nhắc, Báo cáo, Email tổng hợp; chữ nhỏ gọn theo mẫu */
.set-ngrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.set-ncol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.set-ncard { padding: 14px 16px 10px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .04); transition: box-shadow .2s ease; }
.set-ncard:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .06); }
.set-ncard + .set-ncard, .set-ngrid + .set-ncard { margin-top: 14px; }
.set-ncol > .set-ncard + .set-ncard { margin-top: 0; }
.set-ncard.is-blue { --nc: #0284c7; --nb: #eff8ff; }
.set-ncard.is-violet { --nc: #7c3aed; --nb: #f5f3ff; }
.set-ncard.is-amber { --nc: #b45309; --nb: #fffbeb; background: #fffdf5; border-color: #fde68a; }
.set-ncard.is-green { --nc: #059669; --nb: #ecfdf5; }
.set-ncard-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.set-ncard-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.set-ncard-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--nb); color: var(--nc); }
.set-ncard-count { margin-left: auto; padding: 2px 9px; border-radius: 999px; background: var(--nb); color: var(--nc); font-size: 11px; font-weight: 700; white-space: nowrap; }
.set-ncard.is-amber .set-ncard-count, .set-ncard.is-amber .set-ncard-ic { background: #fef3c7; }
.set-ncard .set-row { grid-template-columns: minmax(0, 1fr) 104px 64px; gap: 8px; padding: 9px 2px; border-radius: 0; border-bottom: 1px solid var(--border-soft); }
.set-ncard .set-row:last-child { border-bottom: 0; }
.set-ncard .set-row:not(.set-row-head):hover { background: transparent; }
.set-ncard .set-row-head { padding: 2px 2px 6px; font-size: 10.5px; letter-spacing: .04em; }
.set-ncard .set-event strong { font-size: 12.5px; font-weight: 700; }
.set-ncard .set-event small { font-size: 11px; line-height: 1.4; }
.set-ncard .auto-switch { transform: scale(.9); transform-origin: center; }
.set-ncard.is-amber .set-row { border-bottom-color: #fdecc0; }
.set-ncard .set-reminders { margin: 6px 0 6px; padding: 12px 12px 2px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; }
.set-ncard .set-rem-row { grid-template-columns: 110px minmax(0, 1fr); gap: 4px 10px; padding-bottom: 10px; }
.set-ncard .set-rem-label { font-size: 12px; padding-top: 4px; }
.set-ncard .set-rem-opts { gap: 6px 14px; font-size: 12.5px; }
.set-ncard .set-rem-opts .form-hint { font-size: 11px; }
.set-ncard .set-check { font-size: 12.5px; }
.set-ncard .set-seg { padding: 2px; }
.set-ncard .set-seg-item { padding: 4px 11px; font-size: 12px; }
.set-ncard .set-time-field .form-control { height: 32px; font-size: 13px; }
/* Email tổng hợp: 1 hàng biểu tượng + chữ + công tắc */
.set-ncard.set-digest { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.set-ncard.set-digest h3 { margin: 0 0 2px; font-size: 14px; font-weight: 700; color: var(--ink); }
.set-ncard.set-digest .set-digest-text p { font-size: 12px; }
@media (max-width: 1000px) { .set-ngrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .set-ncard { padding: 12px; }
  .set-ncard .set-row { grid-template-columns: 1fr 1fr; padding: 8px; border: 1px solid var(--border-soft); border-radius: 10px; margin-bottom: 8px; }
  .set-ncard .set-row:last-child { border-bottom: 1px solid var(--border-soft); }
  .set-ncard .set-rem-row { grid-template-columns: 1fr; }
}
.set-ncard .set-seg { flex-wrap: wrap; width: auto; border-radius: 14px; }
.set-ncard .set-rem-opts { min-width: 0; }
.set-ncard .set-row { grid-template-columns: minmax(0, 1fr) 112px 56px; }
.set-ncard .set-row-head > span { white-space: nowrap; }
.set-ncard .auto-switch input:checked + span { background: var(--primary); }
/* Thông báo: nút chọn dạng lưới / danh sách + lưới 2×2 (hàng 1 = Công việc | Lịch nhắc cao bằng thẻ Công việc, Lịch nhắc cuộn trong thẻ) */
.set-nview { display: flex; justify-content: flex-end; gap: 4px; margin: -4px 0 10px; }
.set-nview .icon-btn { width: 32px; height: 32px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); color: var(--ink-soft); transition: background .15s ease, color .15s ease, border-color .15s ease; }
.set-nview .icon-btn:hover { color: var(--ink); background: var(--bg); }
.set-nview .icon-btn.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.set-ngrid { display: grid; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.set-ngrid.is-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.set-ngrid.is-list { grid-template-columns: minmax(0, 1fr); }
.set-ngrid > .set-ncard { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.set-ngrid + .set-ncard { margin-top: 0; }
.set-ncard-body { min-height: 0; }
/* Lịch nhắc ở dạng lưới: không tự đẩy chiều cao hàng — cao theo thẻ Công việc, phần dư cuộn */
.set-ngrid.is-grid > .set-ncard.is-amber .set-ncard-body { flex: 1 1 0; overflow-y: auto; margin-right: -8px; padding-right: 8px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.set-ngrid.is-grid > .set-ncard.is-amber .set-row-head { position: sticky; top: 0; z-index: 1; background: #fffdf5; }
@media (max-width: 1000px) {
  .set-ngrid.is-grid { grid-template-columns: minmax(0, 1fr); }
  .set-ngrid.is-grid > .set-ncard.is-amber .set-ncard-body { flex: none; overflow: visible; }
}
.set-head-text .set-nview { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
/* Thông báo: mỗi thẻ nền + viền nhạt theo màu nhóm (như thẻ Lịch nhắc) */
.set-ncard.is-blue { background: #f7fbff; border-color: #cfe8fb; }
.set-ncard.is-violet { background: #fbfaff; border-color: #ddd6fe; }
.set-ncard.is-green { background: #f6fdf9; border-color: #c6f0da; }
.set-ncard.is-blue .set-row { border-bottom-color: #e2f0fc; }
.set-ncard.is-violet .set-row { border-bottom-color: #ede9fe; }
.set-ncard.is-green .set-row { border-bottom-color: #dcf5e8; }
.set-ncard.is-blue .set-ncard-ic, .set-ncard.is-blue .set-ncard-count { background: #e0f2fe; }
.set-ncard.is-violet .set-ncard-ic, .set-ncard.is-violet .set-ncard-count { background: #ede9fe; }
.set-ncard.is-green .set-ncard-ic, .set-ncard.is-green .set-ncard-count { background: #d1fae5; }

/* Cài đặt › Không gian làm việc bản mới (settings.js wsHeadExtraHTML / wsGeneralTabHTML / wsFeaturesTabHTML / wsDataTabHTML): đầu trang có hình minh họa,
   tab con dạng nút bo tròn, thẻ có ô biểu tượng màu, tab Chung 2 cột (form | hình + lời giới thiệu), Dữ liệu có hình cơ sở dữ liệu, khu vực nguy hiểm nền hồng */
.set-head-text .ws-art-head { grid-column: 2; grid-row: 1 / span 2; width: 190px; height: auto; margin: -14px 0 -18px; }
.ws-tabs { gap: 8px; margin: 0 0 14px; padding: 0; border-bottom: 0; }
.ws-tabs .sub-tab { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); font-size: 13px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease; }
.ws-tabs .sub-tab:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, .07); }
.ws-tabs .sub-tab.is-active { border-color: transparent; background: linear-gradient(135deg, #38bdf8, #0ea5e9); color: #fff; box-shadow: 0 6px 16px rgba(56, 189, 248, .35); }
.ws-tabs .sub-tab:focus-visible { border-radius: 999px; outline-offset: 2px; }
.ws-card { border-radius: 16px; }
.ws-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ws-card-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; }
.ws-card-ic.is-blue { background: #e0f2fe; color: #0284c7; }
.ws-card-ic.is-violet { background: #ede9fe; color: #7c3aed; }
.ws-card-ic.is-amber { background: #fef3c7; color: #b45309; }
.ws-card-ic.is-red { background: #ffe4e6; color: #e11d48; }
.ws-card-title { flex: 1; min-width: 0; }
.ws-card-title h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.ws-card-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.ws-card-head .feat-search { flex: 0 1 240px; }
/* Tab Chung */
.ws-field-label { display: flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.ws-field-hint { margin: 2px 0 6px; font-size: 12px; color: var(--ink-soft); }
.ws-field .ws-field-label + .form-control, .ws-field .ws-field-label + .brand-slug { margin-top: 6px; }
.ws-field .form-error-text { margin: 6px 0 0; }
.ws-field.has-error .form-control { border-color: var(--danger-600); }
.ws-count-wrap { position: relative; }
.ws-count-wrap .form-control { padding-right: 58px; }
.ws-count { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
@keyframes wsFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
/* Tab Tính năng */
.ws-card .feat-grid { gap: 12px; }
.ws-card .feat-card { padding: 14px; border-color: var(--border-soft); border-radius: 14px; box-shadow: 0 1px 3px rgba(15, 23, 42, .04); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.ws-card .feat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 23, 42, .08); border-color: var(--primary-100); }
.ws-card .feat-ico { width: 36px; height: 36px; border-radius: 11px; }
.feat-card.is-blue .feat-ico { background: #e0f2fe; color: #0284c7; }
.feat-card.is-rose .feat-ico { background: #ffe4e6; color: #e11d48; }
.feat-card.is-violet .feat-ico { background: #ede9fe; color: #7c3aed; }
.feat-card.is-amber .feat-ico { background: #fef3c7; color: #d97706; }
.feat-card.is-teal .feat-ico { background: #ccfbf1; color: #0d9488; }
.feat-card.is-sky .feat-ico { background: #dbeafe; color: #2563eb; }
.feat-card.is-purple .feat-ico { background: #f3e8ff; color: #9333ea; }
.feat-card.is-green .feat-ico { background: #dcfce7; color: #16a34a; }
.feat-card.is-pink .feat-ico { background: #fce7f3; color: #db2777; }
.ws-card .feat-card.is-off .feat-ico { background: var(--border-soft); color: var(--ink-soft); }
.ws-card .feat-card .auto-switch input:checked + span { background: var(--primary); }
.ws-upsell { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; border: 1px solid #bae6fd; border-radius: 14px; background: linear-gradient(135deg, #f0f9ff, #eef2ff); }
.ws-upsell > div { flex: 1; min-width: 0; }
.ws-upsell b { font-size: 13.5px; color: var(--ink); }
.ws-upsell p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.ws-upsell .btn-primary { flex: none; }
/* Tab Dữ liệu */
.ws-data { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: center; }
.ws-drows { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); }
.ws-drow { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.ws-drow + .ws-drow { border-top: 1px solid var(--border-soft); }
.ws-drow-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #e0f2fe; color: #0284c7; }
.ws-drow-text { flex: 1; min-width: 0; }
.ws-drow-text b { display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--ink); }
.ws-drow-text p { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); }
.ws-drow .btn-sm, .ws-drow .set-btn-danger { flex: none; white-space: nowrap; }
.ws-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ws-meter-bar { flex: 1; height: 7px; border-radius: 999px; background: #e0f2fe; overflow: hidden; }
.ws-meter-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38bdf8, #2563eb); }
.ws-meter-bar i.is-warn { background: #f97316; }
.ws-meter-bar i.is-bad { background: var(--danger); }
.ws-meter small { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.ws-data-art { display: grid; place-items: center; padding: 10px; border-radius: 14px; background: linear-gradient(160deg, #f0f9ff, #eef2ff); }
.ws-art-data { width: 100%; max-width: 200px; height: auto; animation: wsFloat 5s ease-in-out infinite; }
.ws-danger { background: #fff7f8; border-color: #fecdd3; }
.ws-danger .ws-card-title h3 { color: var(--danger-600); }
.ws-danger .ws-drows { border-color: #fde2e6; }
.ws-danger .ws-drow + .ws-drow { border-top-color: #fde2e6; }
.ws-danger .ws-drow-ic { background: #ffe4e6; color: #e11d48; }
.ws-danger .ws-drow-text b { color: var(--ink); }
@media (max-width: 1100px) { .set-head-text .ws-art-head { width: 150px; } }
@media (max-width: 900px) {
  .ws-data { grid-template-columns: minmax(0, 1fr); }
  .ws-data-art { display: none; }
}
@media (max-width: 640px) {
  .set-head-text .ws-art-head { display: none; }
  .ws-card-head { flex-wrap: wrap; }
  .ws-card-head .feat-search { flex: 1 1 100%; }
  .ws-drow { flex-wrap: wrap; }
  .ws-upsell { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .ws-art-data { animation: none; } .ws-tabs .sub-tab, .ws-card .feat-card { transition: none; } }
/* Tab Chung: khung giới thiệu — chữ bên trái, quả cầu bên phải; nền hồng rất nhạt (trên) → trắng (giữa) → xanh dương nhạt (dưới phải) */
  background: linear-gradient(160deg, rgba(252, 231, 243, .45) 0%, rgba(255, 255, 255, .95) 48%, rgba(224, 242, 254, .85) 100%); }
/* Tab Dữ liệu và nguy hiểm gọn hơn: thẻ, hàng, nút, hình nhỏ lại */
.ws-card { padding: 14px 16px; }
.ws-card + .ws-card { margin-top: 12px; }
.ws-card .ws-card-head { margin-bottom: 10px; gap: 10px; }
.ws-card .ws-card-ic { width: 30px; height: 30px; border-radius: 9px; }
.ws-card .ws-card-ic svg { width: 15px; height: 15px; }
.ws-card .ws-card-title h3 { font-size: 14px; }
.ws-card .ws-card-title p { font-size: 12px; }
.ws-data { grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; }
.ws-drows { border-radius: 12px; }
.ws-drow { gap: 10px; padding: 9px 12px; }
.ws-drow-ic { width: 28px; height: 28px; border-radius: 8px; }
.ws-drow-ic svg { width: 14px; height: 14px; }
.ws-drow-text b { font-size: 13px; }
.ws-drow-text p { font-size: 11.5px; }
.ws-drow .btn-sm, .ws-drow .set-btn-danger, .ws-drow .set-btn-blue { height: 30px; padding: 0 12px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.ws-meter { margin-top: 6px; }
.ws-meter-bar { height: 6px; }
.ws-data-art { padding: 6px; border-radius: 12px; }
.ws-art-data { max-width: 140px; }
/* Chọn người nhận quyền sở hữu: ô tìm + danh sách ảnh nhỏ + tên đậm (cuộn khi > 3 người) + nút */
.owner-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "q go" "list list"; gap: 8px; margin: 0; }
.owner-pick #set-ws-owner-q { grid-area: q; height: 32px; font-size: 13px; }
.owner-pick [data-action=set-ws-owner-go] { grid-area: go; height: 32px; padding: 0 14px; font-size: 12.5px; }
.owner-list { grid-area: list; display: flex; flex-direction: column; max-height: calc(3 * 42px + 2px); overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 10px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.owner-list:focus { outline: none; }
.owner-opt { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 10px; cursor: pointer; transition: background .15s ease; }
.owner-opt + .owner-opt { border-top: 1px solid var(--border-soft); }
.owner-opt:hover { background: var(--bg); }
.owner-opt.is-on { background: var(--primary-50); box-shadow: inset 3px 0 0 var(--primary); }
.owner-opt:focus-within { outline: 2px solid var(--primary); outline-offset: -2px; }
.owner-opt .avatar { width: 26px !important; height: 26px !important; min-width: 26px; font-size: 10.5px; }
.owner-opt-text { display: flex; flex-direction: column; min-width: 0; }
.owner-opt-text b { font-size: 13px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-opt-text small { font-size: 11.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-list .empty-mini { margin: 0; padding: 10px 12px; }
.owner-pick .form-error-text { grid-column: 1 / -1; margin: 0; }
.owner-list .owner-opt { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.ws-data { grid-template-columns: minmax(0, 1fr) 120px; }
.ws-art-data { max-width: 110px; }
.ws-danger .ws-card-head { margin-bottom: 10px; }

/* Tab Thương hiệu bản mới (settings.js wsBrandTabHTML): dải công tắc tổng nổi bật · 2 thẻ cùng hàng cao bằng nhau · xem trước 3 khung ngang */
.brand-master-card { background: linear-gradient(135deg, #faf5ff, #fff 55%, #f0f9ff); border-color: #e9d5ff; }
.brand-master-card.is-on { border-color: #c4b5fd; box-shadow: 0 6px 18px rgba(139, 92, 246, .12); }
.brand-master-card .ws-card-head { margin-bottom: 0; }
.brand-master-card .plan-note { margin: 10px 0 0; }
.brand-master-switch { flex: none; transform: scale(1.15); transform-origin: right center; }
.brand-state { padding: 1px 9px; border-radius: 999px; background: var(--border-soft); color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.brand-state.is-on { background: #dcfce7; color: #15803d; }
.brand-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: stretch; margin: 12px 0; padding: 0; border: 0; min-width: 0; }
.brand-grid > .ws-card { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.ws-card + .brand-grid, .brand-grid + .ws-card { margin-top: 12px; }
/* Ô ảnh: dạng hàng gọn trong khung viền (như các hàng tab Dữ liệu) */
.brand-dz-list { flex: 1; }
.brand-dz-list .dropzone { gap: 10px; padding: 10px 12px; border-bottom: 0; }
.brand-dz-list .dropzone + .dropzone { border-top: 1px solid var(--border-soft); }
.brand-dz-list .dropzone.is-drag { margin: 0; padding: 10px 12px; border-radius: 12px; }
.brand-dz-list .dz-thumb { width: 44px; height: 44px; border-radius: 9px; }
.brand-dz-list .dz-thumb.is-logoWide, .brand-dz-list .dz-thumb.is-shareImage { width: 76px; }
.brand-dz-list .dz-text b { font-size: 13px; }
.brand-dz-list .dz-text small { font-size: 11.5px; }
.brand-dz-list .dz-actions .btn-sm, .brand-dz-list .dz-actions label.btn-secondary { height: 30px; padding: 0 12px; font-size: 12.5px; display: inline-flex; align-items: center; }
/* Màu chủ đạo: ô bảng màu + mã màu, mẫu áp dụng nằm dưới cùng để thẻ cao bằng thẻ Logo */
.ws-card.brand-color { padding-top: 14px; }
.brand-color-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.brand-color-box .brand-swatches { gap: 8px; }
.brand-color-box .brand-swatch { width: 28px; height: 28px; transition: transform .15s ease; }
.brand-color-box .brand-swatch:not(:disabled):hover { transform: scale(1.12); }
.brand-color-box .brand-color-custom .form-control { height: 34px; }
.brand-color-box .form-error-text { margin: 0; }
.brand-sample-title { margin: auto 0 6px; padding-top: 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.brand-sample { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--pv-50, #f0f9ff); font-size: 12px; }
.brand-sample-nav { padding: 4px 10px; border-radius: 8px; background: var(--surface); color: var(--pv-600); font-weight: 700; }
.brand-sample-dot { width: 14px; height: 14px; margin-left: auto; border-radius: 50%; background: var(--pv); box-shadow: 0 0 0 4px var(--pv-100, #e0f2fe); }
.brand-fields:disabled .brand-sample { filter: grayscale(.6); }
/* Xem trước: giao diện app | trang đăng nhập | thẻ chia sẻ link — cùng chiều cao */
.brand-side { position: static; }
.brand-side .brand-preview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.brand-side .brand-pv-app { grid-column: auto; min-height: 150px; }
.brand-side .brand-pv-login, .brand-side .brand-pv-share { min-height: 150px; }
.brand-side .brand-pv-app, .brand-side .brand-pv-login, .brand-side .brand-pv-share { transition: transform .2s ease, box-shadow .2s ease; }
.brand-side .brand-pv-app:hover, .brand-side .brand-pv-login:hover, .brand-side .brand-pv-share:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 23, 42, .08); }
@media (max-width: 1000px) {
  .brand-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-side .brand-preview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .brand-side .brand-pv-app { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .brand-side .brand-preview { grid-template-columns: minmax(0, 1fr); } .brand-dz-list .dropzone { flex-wrap: wrap; } }
.ws-card-ic.is-green { background: #dcfce7; color: #16a34a; }
/* Tab Chung (bản chỉnh): quả cầu ở trên lệch phải, chữ ở dưới lệch trái — so le, cân đối */
/* Thương hiệu: màu đang dùng + 7 màu gợi ý trên 1 hàng, ô màu tùy chỉnh bên dưới */
.brand-color-box .brand-swatches { align-items: center; flex-wrap: nowrap; gap: 8px; }
.brand-cur { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; }
.brand-cur small { font-size: 10.5px; font-weight: 700; color: var(--ink-soft); }
.brand-swatch.is-cur { display: block; width: 36px; height: 36px; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--ink); cursor: default; }
.brand-sw-sep { flex: none; width: 1px; height: 28px; margin: 0 2px 14px; background: var(--border); }
.brand-color-box .brand-swatch:not(.is-cur) { width: 26px; height: 26px; margin-bottom: 14px; }
.brand-color-custom { flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--border-soft); }
.brand-custom-label { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
/* Logo: ô ảnh lớn hơn cho khít hàng */
.brand-dz-list .dropzone { padding: 12px; }
.brand-dz-list .dz-thumb { width: 60px; height: 60px; border-radius: 11px; }
.brand-dz-list .dz-thumb.is-logoWide { width: 116px; }
.brand-dz-list .dz-thumb.is-shareImage { width: 114px; }
/* Xem trước: giao diện app 1 hàng; trang đăng nhập và thẻ chia sẻ mỗi cái 1 hàng, dạng ngang gọn */
.brand-side .brand-preview { grid-template-columns: minmax(0, 1fr); }
.brand-side .brand-pv-app { grid-column: auto; min-height: 140px; }
.brand-side .brand-pv-login { min-height: 0; flex-direction: row; justify-content: space-between; padding: 12px 16px; }
.brand-side .brand-pv-login > :first-child { margin-right: auto; }
.brand-side .brand-pv-login img { max-height: 36px; max-width: 232px; }
.brand-side .brand-pv-share { min-height: 0; flex-direction: row; align-items: stretch; }
.brand-side .brand-pv-share img, .brand-side .brand-pv-share-empty { flex: none; width: 210px; aspect-ratio: 1.91 / 1; }
.brand-side .brand-pv-share-text { justify-content: center; gap: 2px; padding: 10px 14px; }
@media (max-width: 1000px) { .brand-side .brand-preview { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .brand-side .brand-pv-share { flex-direction: column; } .brand-side .brand-pv-share img, .brand-side .brand-pv-share-empty { width: 100%; } .brand-color-box .brand-swatches { flex-wrap: wrap; } }
/* Dữ liệu: khối hàng bên trái vừa nội dung, hình minh họa to bên phải */
.ws-data { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 14px; align-items: stretch; }
.ws-data .ws-drows { align-self: center; }
.ws-data .ws-drow { padding: 10px 12px; }
.ws-data-art { padding: 10px; }
.ws-art-data { max-width: 230px; }
.ws-drow .btn-sm, .ws-drow .set-btn-danger, .ws-drow .set-btn-blue { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.ws-danger .ws-drow { padding: 9px 12px; }
@media (max-width: 900px) { .ws-data { grid-template-columns: minmax(0, 1fr); } }
.ws-data { grid-template-columns: minmax(0, 1fr) 260px; }
.ws-data-art { padding: 4px 10px; max-height: 170px; }
.ws-art-data { max-width: 210px; max-height: 160px; }
/* Trang Dự án (projects.js plProjectCardHTML): bỏ dòng "workspace / Dự án"; hàng tên có số tóm tắt + tiến độ, trưởng nhóm, nút Mở dự án */
.pl-card-head { flex-wrap: wrap; row-gap: 6px; margin: 0 0 8px; }
.pl-card-stats { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.pl-card-stats b { color: var(--ink); }
.pl-card-stats .is-late { color: var(--danger-600); font-weight: 600; }
.pl-card-progress { display: inline-flex; align-items: center; gap: 8px; }
.pl-card-progress .progress-track { display: block; width: 90px; height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.pl-card-progress .progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--success, #22c55e); }
.pl-card-progress small { font-size: 12px; color: var(--ink-soft); }
.pl-card-spacer { flex: 1; }
.pl-card-lead { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.pl-card-lead .avatar { width: 24px; height: 24px; font-size: 10px; }
.pl-card-open { height: 30px; padding: 0 12px; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
/* Nhóm trạng thái: nền mờ đúng màu trạng thái (STATUS_META.bg) */
.pl-group-head { padding: 6px 10px; border-radius: 10px; background: var(--pl-gbg, transparent); }
/* Việc cha đang xổ task con: nổi bật để dễ nhận ra nhóm con thuộc việc nào */
.pl-row.is-expanded > .pl-cell { background: var(--primary-50); }
.pl-row.is-expanded > .pl-cell-name { box-shadow: inset 3px 0 0 var(--primary); }
.pl-row.is-expanded .pl-task-name { font-weight: 700; color: var(--primary-600); }
.pl-row.is-expanded[data-id]:hover > .pl-cell { background: #e0f2fe; }
@media (max-width: 760px) { .pl-card-progress .progress-track { width: 60px; } .pl-card-lead small { display: none; } }
/* Nhóm trạng thái (bản chỉnh): cả khối nhóm — từ tên nhóm tới hết các việc — nền mờ + viền cùng màu trạng thái */
.pl-group-head { padding: 0; border-radius: 0; background: none; }
.pl-group[style*="--pl-gbg"] { margin-bottom: 12px; padding: 8px 10px 6px; border: 1px solid color-mix(in srgb, var(--pl-gc) 45%, transparent); border-radius: 12px; background: var(--pl-gbg); }
.pl-group[style*="--pl-gbg"] .pl-row-head > .pl-cell, .pl-group[style*="--pl-gbg"] .pl-row-head > .pl-gutter { background: transparent; }
.pl-group[style*="--pl-gbg"] .pl-row:not(.pl-row-head) > .pl-cell { border-bottom-color: color-mix(in srgb, var(--pl-gc) 18%, transparent); }
/* Trong khối nhóm có nền màu: việc cha đang xổ nền trắng + vạch màu trạng thái để nổi lên trên nền nhóm */
.pl-group[style*="--pl-gbg"] .pl-row.is-expanded > .pl-cell, .pl-group[style*="--pl-gbg"] .pl-row.is-expanded[data-id]:hover > .pl-cell { background: #fff; }
.pl-group[style*="--pl-gbg"] .pl-row.is-expanded > .pl-cell-name { box-shadow: inset 3px 0 0 var(--pl-gc); }
/* Trang Dự án (bản chỉnh): hàng chip đều nhau — cùng cao 28px, cùng bo, cùng khoảng cách; trưởng nhóm cũng là chip, nút Mở dự án cao bằng */
.pl-chips { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-left: 6px; }
.pl-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.pl-chip svg { flex: none; }
.pl-chip.is-done { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.pl-chip.is-late { border-color: #fecdd3; background: #fff1f2; color: #e11d48; }
.pl-chip-progress .progress-track { display: block; width: 150px; height: 6px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.pl-chip-progress .progress-fill { display: block; height: 100%; border-radius: inherit; background: #22c55e; }
.pl-chip-progress b { min-width: 30px; text-align: right; color: var(--ink); }
.pl-chip.pl-card-lead { padding-left: 3px; max-width: 200px; }
.pl-chip.pl-card-lead .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.pl-chip.pl-card-lead > span:last-child { overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.pl-card-open { height: 28px; border-radius: 999px; }
.pl-card-head .pl-menu-btn { width: 28px; height: 28px; }
/* Rê chuột vào dòng việc trong khối nhóm có nền màu: dòng sáng trắng (không xám) */
.pl-group[style*="--pl-gbg"] .pl-row[data-id]:hover > .pl-cell { background: #fff; } /* chỉ các ô của dòng, không phủ ra ô chọn bên ngoài — giống hệt dòng đang xổ */
@media (max-width: 760px) { .pl-chips { margin-left: 0; } .pl-chip-progress .progress-track { width: 48px; } .pl-chip.pl-card-lead > span:last-child { display: none; } }
/* Rê chuột vào dòng việc: trông giống dòng đang chọn / đang xổ — nền trắng, vạch màu bên trái, tên đậm xanh */
.pl-row[data-id]:hover > .pl-cell-name { box-shadow: inset 3px 0 0 var(--pl-gc, var(--primary)); }
.pl-row[data-id]:hover .pl-task-name { color: var(--primary-600); }
.pl-group[style*="--pl-gbg"] .pl-row[data-id]:hover > .pl-cell-name { box-shadow: inset 3px 0 0 var(--pl-gc); }
@media (prefers-reduced-motion: no-preference) { .pl-row[data-id] .pl-task-name { transition: color .15s ease; } }
/* Tên việc khi rê / đang xổ: theo màu trạng thái của nhóm (đậm hơn một chút cho dễ đọc trên nền trắng) */
.pl-group[style*="--pl-gc"] .pl-row[data-id]:hover .pl-task-name,
.pl-group[style*="--pl-gc"] .pl-row.is-expanded .pl-task-name { color: color-mix(in srgb, var(--pl-gc) 78%, #0f172a); }
/* Hàng tên cột: chữ đậm, rõ hơn + vạch kẻ phía trên và dưới */
.pl-row-head > .pl-cell { font-weight: 700; color: var(--ink-soft); border-top: 1px solid var(--border); }
.pl-group[style*="--pl-gc"] .pl-row-head > .pl-cell { color: color-mix(in srgb, var(--pl-gc) 55%, #334155); border-top-color: color-mix(in srgb, var(--pl-gc) 35%, transparent); border-bottom-color: color-mix(in srgb, var(--pl-gc) 35%, transparent); }
/* Hàng "Thêm công việc" cuối nhóm (projects.js plFootRowHTML): khung viền đứt bao cả hàng (trừ ô chọn), nền trong suốt;
   ô "Thêm công việc" dài hết cột tên, các ô con nền sẫm nhẹ + viền mảnh mờ để biết bấm được */
.pl-row-foot { position: relative; min-height: 52px; }
.pl-row-foot::before { content: ""; position: absolute; left: 44px; right: 0; top: 4px; bottom: 4px; border: 1.5px dashed color-mix(in srgb, var(--pl-gc, var(--primary)) 45%, transparent); border-radius: 10px; pointer-events: none; }
.pl-row-foot > .pl-cell { min-height: 52px; padding-top: 8px; padding-bottom: 8px; background: transparent !important; }
.pl-row-foot > .pl-cell-name { padding-left: 10px; }
.pl-row-foot > .pl-cell-name .pl-quick { flex: 1; width: 100%; }
.pl-row-foot .pl-quick,
.pl-row-foot .pl-field.is-box { border: 1px solid color-mix(in srgb, var(--pl-gc, var(--primary)) 22%, transparent); background: color-mix(in srgb, var(--pl-gc, var(--primary)) 7%, transparent); box-shadow: none; }
.pl-row-foot .pl-quick-btn { flex: 1; justify-content: flex-start; }
.pl-row-foot .pl-quick-more { border-left: 1px solid color-mix(in srgb, var(--pl-gc, var(--primary)) 22%, transparent); }
.pl-row-foot .pl-quick:hover,
.pl-row-foot .pl-field.is-box:hover,
.pl-row-foot .pl-field.is-box:focus-visible { border-color: color-mix(in srgb, var(--pl-gc, var(--primary)) 50%, transparent); background: color-mix(in srgb, var(--pl-gc, var(--primary)) 13%, transparent); }
.pl-row-foot .pl-field.is-box.is-open { border-color: var(--pl-gc, var(--primary)); }
.pl-row-foot .pl-field.is-box.is-readonly { opacity: .6; background: color-mix(in srgb, var(--pl-gc, var(--primary)) 4%, transparent); }
.pl-row-foot > .pl-cell:last-child { padding-right: 8px; }
/* Hàng Thêm công việc: rê vào thì chữ / biểu tượng đen đậm lên (không đổi sang xanh) */
.pl-row-foot .pl-quick:hover .pl-quick-btn, .pl-row-foot .pl-quick-btn:hover, .pl-row-foot .pl-quick-more:hover { color: var(--ink); }
.pl-row-foot .pl-quick:hover .pl-quick-btn { font-weight: 600; }
.pl-row-foot .pl-quick-more:hover { background: transparent; }
.pl-row-foot .pl-field.is-box:hover .pl-empty, .pl-row-foot .pl-field.is-box:hover .pl-count { color: var(--ink); }
/* Hàng Thêm công việc (bản chỉnh): khung viền đứt xám mờ; rê vào hàng thì viền đổi màu trạng thái, dày 2px.
   Ô con không viền (chỉ nền sẫm nhẹ), rê vào / đang mở mới hiện viền */
.pl-row-foot::before { border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent); transition: border-color .15s ease, border-width .15s ease; }
.pl-row-foot:hover::before, .pl-row-foot:focus-within::before { border: 2px dashed var(--pl-gc, var(--primary)); }
.pl-row-foot .pl-quick, .pl-row-foot .pl-field.is-box { border-color: transparent; }
.pl-row-foot .pl-quick-more { border-left-color: transparent; }
.pl-row-foot .pl-quick:hover, .pl-row-foot .pl-quick:focus-within,
.pl-row-foot .pl-field.is-box:hover, .pl-row-foot .pl-field.is-box:focus-visible { border-color: color-mix(in srgb, var(--pl-gc, var(--primary)) 55%, transparent); }
.pl-row-foot .pl-quick:hover .pl-quick-more { border-left-color: color-mix(in srgb, var(--pl-gc, var(--primary)) 35%, transparent); }
.pl-row-foot .pl-field.is-box.is-open { border-color: var(--pl-gc, var(--primary)); }
/* Hàng Thêm công việc: chuyển màu / viền mượt 0.3s */
.pl-row-foot::before { transition: border-color .3s ease, border-width .3s ease; }
.pl-row-foot .pl-quick, .pl-row-foot .pl-field.is-box, .pl-row-foot .pl-quick-more, .pl-row-foot .pl-quick-btn, .pl-row-foot .pl-empty, .pl-row-foot .pl-count { transition: border-color .3s ease, background-color .3s ease, color .3s ease; }
@media (prefers-reduced-motion: reduce) { .pl-row-foot::before, .pl-row-foot .pl-quick, .pl-row-foot .pl-field.is-box, .pl-row-foot .pl-quick-more, .pl-row-foot .pl-quick-btn { transition: none; } }
/* Hàng Thêm công việc: đổi độ dày viền đứt bằng 2 lớp chồng nhau và chỉ đổi độ mờ (opacity) — trình duyệt vẽ mượt,
   không giật như khi chuyển border-width (nét đứt bị tính lại từng khung hình) */
.pl-row-foot::before { border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent) !important; opacity: 1; transition: opacity .3s ease; }
.pl-row-foot::after { content: ""; position: absolute; left: 44px; right: 0; top: 4px; bottom: 4px; border: 2px dashed var(--pl-gc, var(--primary)); border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.pl-row-foot:hover::before, .pl-row-foot:focus-within::before { opacity: 0; }
.pl-row-foot:hover::after, .pl-row-foot:focus-within::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pl-row-foot::after { transition: none; } }
/* Tab Danh sách trong dự án (tasks.js listViewHTML) kiểu mẫu: đầu nhóm nền mờ màu trạng thái, nhãn chữ màu trạng thái + số đếm dạng huy hiệu;
   hàng tên cột nền xám nhạt, chữ thường có biểu tượng; khung nhóm viền nhạt theo màu nhóm */
.task-list-group[style*="--gbg"] { border-color: color-mix(in srgb, var(--gc) 22%, var(--border-soft)); border-radius: 14px; background: var(--surface); }
.task-list-group[style*="--gbg"] > .task-list-group-head { padding: 10px 14px; background: var(--gbg); border-bottom-color: color-mix(in srgb, var(--gc) 18%, transparent); }
.task-list-group[style*="--gbg"] > .task-list-group-head .pl-status { padding: 0; background: transparent !important; color: color-mix(in srgb, var(--gc) 70%, #0f172a); font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: 0; box-shadow: none; }
.task-list-group[style*="--gbg"] > .task-list-group-head .pl-status svg { width: 15px; height: 15px; color: var(--gc); }
.task-list-group[style*="--gbg"] > .task-list-group-head .pl-group-count { min-width: 20px; padding: 0 7px; border-radius: 999px; background: color-mix(in srgb, var(--gc) 16%, transparent); color: color-mix(in srgb, var(--gc) 75%, #0f172a); font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.task-list-group[style*="--gbg"] .task-table-head-v2 { background: #f6f8fb; border-bottom-color: var(--border-soft); }
.task-list-group[style*="--gbg"] .task-table-head-v2 .task-cell { text-transform: none; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding-top: 10px; padding-bottom: 10px; }
.task-list-group[style*="--gbg"] .task-table-head-v2 .task-cell svg { width: 14px; height: 14px; margin-right: 6px; color: var(--ink-soft); vertical-align: -3px; }
.task-list-group[style*="--gbg"] .task-table-body-row-v2 { transition: background-color .2s ease; }
/* Mũi tên đầu nhóm kiểu chevron mảnh như mẫu: đang mở = ^, thu gọn = v (xoay mượt) */
.task-list-group[style*="--gbg"] .list-group-chevron::before { width: 7px; height: 7px; margin-top: 4px; border: 0; border-top: 1.8px solid currentColor; border-left: 1.8px solid currentColor; border-radius: 1px; transform: rotate(45deg); transition: transform .2s ease, margin .2s ease; }
.task-list-group[style*="--gbg"] .list-group-toggle:checked + .task-list-group-head .list-group-chevron::before { margin-top: -4px; transform: rotate(225deg); }
.task-list-group[style*="--gbg"] .list-group-chevron { color: color-mix(in srgb, var(--gc) 70%, #0f172a); }
.task-list-group[style*="--gbg"] .list-group-chevron:hover { background: color-mix(in srgb, var(--gc) 14%, transparent); color: color-mix(in srgb, var(--gc) 80%, #0f172a); }
@media (prefers-reduced-motion: reduce) { .task-list-group[style*="--gbg"] .list-group-chevron::before { transition: none; } }
.task-list-view .task-list-group[style*="--gbg"] .task-table-head-v2 .task-cell > svg { display: inline-block; }
/* Tab Danh sách: hàng "Thêm công việc" giống trang Dự án — khung viền đứt xám mờ, rê vào thì viền màu nhóm 2px (đổi bằng opacity cho mượt);
   ô "Thêm công việc" dài hết cột tên, ô con nền sẫm nhẹ không viền, rê / đang mở mới hiện viền; chữ rê vào đen đậm; chuyển động 0.3s */
.task-list-view .list-foot-row { position: relative; min-height: 52px; }
.task-list-view .list-foot-row::before, .task-list-view .list-foot-row::after { content: ""; position: absolute; left: 44px; right: 0; top: 4px; bottom: 4px; border-radius: 10px; pointer-events: none; transition: opacity .3s ease; }
.task-list-view .list-foot-row::before { border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent); }
.task-list-view .list-foot-row::after { border: 2px dashed var(--gc, var(--primary)); opacity: 0; }
.task-list-view .list-foot-row:hover::before, .task-list-view .list-foot-row:focus-within::before { opacity: 0; }
.task-list-view .list-foot-row:hover::after, .task-list-view .list-foot-row:focus-within::after { opacity: 1; }
.task-list-view .list-foot-row .task-cell { padding-top: 8px; padding-bottom: 8px; background: transparent !important; }
.task-list-view .list-foot-row .task-cell-name .pl-quick { flex: 1; width: 100%; }
.task-list-view .list-foot-row .pl-quick-btn { flex: 1; justify-content: flex-start; }
.task-list-view .list-foot-row .pl-quick,
.task-list-view .list-foot-row .pl-field.is-box { border: 1px solid transparent; background: color-mix(in srgb, var(--gc, var(--primary)) 7%, transparent); box-shadow: none; }
.task-list-view .list-foot-row .pl-quick-more { border-left: 1px solid transparent; }
.task-list-view .list-foot-row .pl-quick:hover, .task-list-view .list-foot-row .pl-quick:focus-within,
.task-list-view .list-foot-row .pl-field.is-box:hover, .task-list-view .list-foot-row .pl-field.is-box:focus-visible { border-color: color-mix(in srgb, var(--gc, var(--primary)) 55%, transparent); background: color-mix(in srgb, var(--gc, var(--primary)) 13%, transparent); }
.task-list-view .list-foot-row .pl-quick:hover .pl-quick-more { border-left-color: color-mix(in srgb, var(--gc, var(--primary)) 35%, transparent); }
.task-list-view .list-foot-row .pl-field.is-box.is-open { border-color: var(--gc, var(--primary)); }
.task-list-view .list-foot-row .pl-field.is-box.is-readonly { opacity: .6; background: color-mix(in srgb, var(--gc, var(--primary)) 4%, transparent); }
.task-list-view .list-foot-row .pl-quick:hover .pl-quick-btn, .task-list-view .list-foot-row .pl-quick-btn:hover, .task-list-view .list-foot-row .pl-quick-more:hover { color: var(--ink); }
.task-list-view .list-foot-row .pl-quick:hover .pl-quick-btn { font-weight: 600; }
.task-list-view .list-foot-row .pl-quick-more:hover { background: transparent; }
.task-list-view .list-foot-row .pl-field.is-box:hover .pl-empty, .task-list-view .list-foot-row .pl-field.is-box:hover .pl-count { color: var(--ink); }
.task-list-view .list-foot-row .pl-quick, .task-list-view .list-foot-row .pl-field.is-box, .task-list-view .list-foot-row .pl-quick-more,
.task-list-view .list-foot-row .pl-quick-btn, .task-list-view .list-foot-row .pl-empty, .task-list-view .list-foot-row .pl-count { transition: border-color .3s ease, background-color .3s ease, color .3s ease; }
@media (prefers-reduced-motion: reduce) {
  .task-list-view .list-foot-row::before, .task-list-view .list-foot-row::after, .task-list-view .list-foot-row .pl-quick,
  .task-list-view .list-foot-row .pl-field.is-box, .task-list-view .list-foot-row .pl-quick-btn { transition: none; }
}
/* Tab Danh sách: mũi tên xổ task con kiểu chevron mảnh như mẫu — thu gọn = >, đang mở = v (xoay mượt 0.3s) */
.task-list-view .pl-caret::before { width: 6px; height: 6px; margin-left: -2px; border: 0; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; border-radius: 1px; transform: rotate(-45deg); transition: transform .3s ease, margin .3s ease; }
.task-list-view .pl-caret.is-open::before { margin: -3px 0 0; transform: rotate(45deg); }
.task-list-view .pl-caret { color: color-mix(in srgb, var(--gc, var(--ink-soft)) 70%, #0f172a); }
.task-list-view .pl-caret:hover { background: color-mix(in srgb, var(--gc, var(--primary)) 14%, transparent); }
@media (prefers-reduced-motion: reduce) { .task-list-view .pl-caret::before { transition: none; } }
/* Tab Danh sách: thẻ ưu tiên kiểu mẫu — nền nhạt, cờ đặc + chữ cùng màu (Cao đỏ, Vừa cam, Thấp xanh) */
.task-list-view .priority-pill { gap: 5px; padding: 3px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.task-list-view .priority-pill svg { width: 11px; height: 11px; }
.task-list-view .priority-high { background: #fef2f2; color: #dc2626; }
.task-list-view .priority-medium { background: #fffbeb; color: #d97706; }
.task-list-view .priority-low { background: #eff6ff; color: #2563eb; }
/* Hàng Thêm công việc ở tab Danh sách: ô con nền trắng, rê vào / đang mở thì hiện viền xám mờ nhẹ */
.task-list-view .list-foot-row .pl-quick,
.task-list-view .list-foot-row .pl-field.is-box { background: var(--surface); border-color: transparent; }
.task-list-view .list-foot-row .pl-quick:hover, .task-list-view .list-foot-row .pl-quick:focus-within,
.task-list-view .list-foot-row .pl-field.is-box:hover, .task-list-view .list-foot-row .pl-field.is-box:focus-visible,
.task-list-view .list-foot-row .pl-field.is-box.is-open { background: var(--surface); border-color: color-mix(in srgb, var(--muted) 40%, transparent); box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.task-list-view .list-foot-row .pl-quick:hover .pl-quick-more { border-left-color: color-mix(in srgb, var(--muted) 30%, transparent); }
.task-list-view .list-foot-row .pl-field.is-box.is-readonly { background: var(--surface); opacity: .55; }
/* Nút con mắt + dấu "+" ở đầu nhóm: chưa rê = không nền, viền 1px cùng màu chữ; rê vào = nền + chữ giống huy hiệu số việc của nhóm */
.task-list-group[style*="--gbg"] .task-list-group-head .list-head-btn { border: 1px solid color-mix(in srgb, var(--gc) 75%, #0f172a); background: transparent; color: color-mix(in srgb, var(--gc) 75%, #0f172a); box-shadow: none; transform: none; transition: background-color .3s ease, color .3s ease, border-color .3s ease; }
.task-list-group[style*="--gbg"] .task-list-group-head .list-head-btn:hover,
.task-list-group[style*="--gbg"] .task-list-group-head .list-head-btn:focus-visible,
.task-list-group[style*="--gbg"] .task-list-group-head .list-head-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--gc) 16%, transparent); color: color-mix(in srgb, var(--gc) 75%, #0f172a); border-color: transparent; box-shadow: none; transform: none; }
@media (prefers-reduced-motion: reduce) { .task-list-group[style*="--gbg"] .task-list-group-head .list-head-btn { transition: none; } }
/* Tab Danh sách (bản chỉnh): thanh trạng thái bo góc, thấp gọn; cách khối nội dung 10px; khối nội dung (hàng tên cột + các việc)
   có viền mờ bo góc, rộng bằng đúng thanh trạng thái; dòng việc thấp gọn hơn */
.task-list-view .task-list-group[style*="--gbg"] > .task-list-group-head { padding: 5px 10px; border-radius: 10px; border: 0; min-height: 36px; }
/* Việc của tôi (Tổng quan): thanh nhóm hạn nền nhạt (--gbg), tên nhóm là thẻ nền đặc màu nhóm, chữ / icon dùng lại màu nhạt
   (giống đầu nhóm ở tab Cần tôi xử lý) */
.today-list-group[style*="--gbg"] > .task-list-group-head .pl-status { padding: 4px 10px !important; border-radius: 6px; background: var(--gc) !important; color: var(--gbg); font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; }
.today-list-group[style*="--gbg"] > .task-list-group-head .pl-status svg { width: 13px; height: 13px; color: var(--gbg); }
.today-list-group[style*="--gbg"] > .task-list-group-head .pl-group-count { min-width: 0; padding: 0; background: transparent; font-size: 13px; }
.task-list-view .task-list-group[style*="--gbg"] > .task-table-scroll { margin-top: 10px; border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 12px; }
.task-list-view .task-list-group[style*="--gbg"] .task-table-head-v2 { border-radius: 11px 11px 0 0; }
.task-list-view .task-list-group[style*="--gbg"] .task-table-head-v2 .task-cell { padding-top: 8px; padding-bottom: 8px; }
.task-list-view .task-list-group[style*="--gbg"] .task-table-body-row-v2 { min-height: 38px; border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }
.task-list-view .task-list-group[style*="--gbg"] .task-table-body-row-v2 .task-cell { padding-top: 6px; padding-bottom: 6px; }
.task-list-view .task-list-group[style*="--gbg"] .list-foot-row { min-height: 46px; }
.task-list-view .task-list-group[style*="--gbg"] .list-foot-row .task-cell { padding-top: 6px; padding-bottom: 6px; }
.task-list-view .task-list-group[style*="--gbg"] .task-table-empty-row-v2 { padding: 12px; }
.task-list-view .task-list-group[style*="--gbg"] > .task-table-scroll { margin-left: 0; margin-right: 0; } /* bỏ lệch -2px cũ để khối nội dung rộng đúng bằng thanh trạng thái */

/* ===== Hộp thoại kiểu thẻ (10/2026): Tài liệu dự án, Thành viên dự án, Thùng rác ===== */
/* Đầu chung: ô icon + tiêu đề + mô tả, lề đều 24px, bo 4 góc, thanh cuộn mảnh xám */
.modal-box.mhx-box { border-radius: 20px; overflow: hidden; }
.mhx-head { align-items: flex-start; gap: 14px; padding: 20px 24px 16px; }
.mhx-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100)); color: var(--primary-600); }
.trash-modal-box .mhx-ico { background: linear-gradient(135deg, var(--danger-50), color-mix(in srgb, var(--danger) 18%, var(--surface))); color: var(--danger-600); }
.mhx-text { flex: 1; min-width: 0; }
.mhx-text h2 { margin: 0; font-size: 17px; }
.mhx-text p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.mhx-actions:empty { display: none; }
.mhx-add { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--primary-600); border-color: var(--primary-100); }
.mhx-box > .modal-body { padding: 16px 24px 20px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.mhx-box > .modal-body::-webkit-scrollbar { width: 6px; }
.mhx-box > .modal-body::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; }
.mhx-box > .modal-body::-webkit-scrollbar-button { display: none; height: 0; }
.mhx-tabs { display: flex; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: var(--bg); }
.mhx-tab { flex: 1; padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.mhx-tab.is-active { background: var(--surface); color: var(--primary-600); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }
.mhx-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.mhx-count { font-weight: 500; color: var(--muted); }
.mhx-card { padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); }
.mhx-card + .mhx-card { margin-top: 12px; }
.mhx-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.mhx-card-head svg { color: var(--primary-600); }
.mhx-card-meta { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.mhx-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.mhx-foot .plink-show-option { margin: 0; }
.mhx-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; border: 1px dashed var(--border); border-radius: 14px; text-align: center; }
.mhx-empty-ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); }
.mhx-empty p { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* Tài liệu dự án */
#modal-project-links .plink-box { max-width: 680px; }
#modal-project-links .plink-list { margin: 0; }
#modal-project-links .plink-item { gap: 12px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--border-soft); border-radius: 12px; }
#modal-project-links .plink-item:last-child { border-bottom: 1px solid var(--border-soft); }
#modal-project-links .plink-item:hover { border-color: var(--primary-100); background: color-mix(in srgb, var(--primary-50) 45%, var(--surface)); }
.plink-type { --tc: #64748b; --tb: var(--bg); flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--tb); color: var(--tc); font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; }
.plink-type.is-red { --tc: #dc2626; --tb: #fee2e2; }
.plink-type.is-blue { --tc: #2563eb; --tb: #dbeafe; }
.plink-type.is-green { --tc: #16a34a; --tb: #dcfce7; }
.plink-type.is-orange { --tc: #ea580c; --tb: #ffedd5; }
.plink-type.is-violet { --tc: #7c3aed; --tb: #ede9fe; }
.plink-type.is-teal { --tc: #0f766e; --tb: #ccfbf1; }
/* Link: favicon nằm trên chữ cái đầu (favicon lỗi thì bị gỡ, còn chữ) */
.plink-type.is-fav { position: relative; border: 1px solid var(--border-soft); background: var(--surface); color: var(--primary-600); font-size: 15px; }
.plink-type.is-fav img { position: absolute; inset: 9px; width: 20px; height: 20px; border-radius: 4px; object-fit: contain; opacity: 0; }
.plink-type.is-fav.has-img img { opacity: 1; }
.plink-type.is-fav.has-img > span { visibility: hidden; } /* favicon đã tải xong mới ẩn chữ cái đầu */
/* Link Google Docs / Sheets / Slides / Forms, Word / Excel / PowerPoint online: icon ứng dụng vẽ sẵn (projects.js plinkAppIconHTML) */
.plink-type.is-app { width: 40px; height: 44px; background: transparent; }
.plink-type.is-app svg { width: 30px; height: 38px; }
/* Tệp: trang giấy góc gấp, dải màu + nhãn đuôi tệp */
.plink-type.is-file { width: 40px; height: 44px; background: transparent; }
.plink-type.is-file svg { width: 32px; height: 40px; }
.plink-type.is-file .pf-page { fill: var(--tb); stroke: color-mix(in srgb, var(--tc) 35%, transparent); stroke-width: 1.2; }
.plink-type.is-file .pf-fold { fill: color-mix(in srgb, var(--tc) 35%, var(--tb)); }
.plink-type.is-file .pf-band { fill: var(--tc); }
.plink-type.is-file .pf-label { fill: #fff; font: 800 7.5px/1 var(--font-ui, sans-serif); letter-spacing: 0.02em; }
.plink-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#modal-project-links .plink-title { font-size: 14px; }
.plink-meta { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 12px; color: var(--muted); }
.plink-meta span + span::before { content: "·"; margin-right: 6px; }
.plink-acts { flex: none; display: inline-flex; gap: 6px; }
.plink-act { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.plink-act:hover, .plink-act:focus-visible { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); outline: none; }
.plink-act.is-danger:hover, .plink-act.is-danger:focus-visible { border-color: var(--danger); color: var(--danger-600); background: var(--danger-50); }
#modal-project-links .plink-dropzone { flex-direction: row; justify-content: flex-start; gap: 14px; margin: 0; padding: 18px; border-width: 1.5px; border-radius: 12px; text-align: left;
  background: color-mix(in srgb, var(--primary-50) 50%, var(--surface)); }
.plink-drop-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface); color: var(--primary-600); }
.plink-drop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--ink-soft); }
.plink-drop-text b { color: var(--ink); }
.plink-drop-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--primary-100); border-radius: 10px; background: var(--surface); color: var(--primary-600); font-weight: 600; }
#modal-project-links .plink-form { padding-top: 14px; border-top: 1px solid var(--border-soft); }
.plink-form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: end; }
.plink-form-row .form-field { margin: 0; }
.plink-form-row .btn-primary { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Thành viên dự án */
#modal-project-members .modal-box.pm-box { max-width: 880px; }
.pm-tools { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 10px; }
.pm-search { position: relative; display: block; }
.pm-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pm-search .form-control { padding-left: 36px; }
.pm-count { margin: 12px 0 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
#modal-project-members .pm-list { margin: 0 0 14px; }
#modal-project-members .pm-item { display: grid; grid-template-columns: auto minmax(150px, 1fr) minmax(0, 1.15fr) 220px 28px; gap: 12px; padding: 7px 4px; }
#modal-project-members .pm-item .avatar { width: 30px; height: 30px; font-size: 11px; }
#modal-project-members .pm-name { font-size: 13.5px; }
.pm-sub { font-size: 11.5px; }
/* Thẻ vai trò: mỗi vai trò nền nhạt + chữ đậm cùng màu vai trò; nhiều thẻ thì nằm 1 hàng, thẻ dài "…" */
.pm-tags { min-width: 0; display: flex; gap: 6px; overflow: hidden; }
.pm-tag { --rc: #0ea5e9; flex: 0 1 auto; min-width: 0; max-width: 160px; padding: 2px 9px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--rc) 13%, var(--surface)); color: color-mix(in srgb, var(--rc) 78%, #0f172a);
  font-size: 11.5px; font-weight: 600; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-tag.is-manager { --rc: #f59e0b; box-shadow: inset 0 0 0 1px color-mix(in srgb, #f59e0b 40%, transparent); }
.pm-tag.is-viewer { --rc: #64748b; }
.pm-presence > span { overflow: hidden; text-overflow: ellipsis; }
.pm-remove { width: 28px; height: 28px; border-radius: 8px; }
.pm-who { min-width: 0; display: flex; flex-direction: column; }
#modal-project-members .pm-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#modal-project-members .pm-badge { background: var(--primary-50); color: var(--primary-600); border: 0; }
#modal-project-members .pm-badge.is-manager { background: var(--warning-50); color: var(--warning-700); border: 1px solid var(--warning-100); }
#modal-project-members .pm-badge.is-viewer { background: var(--bg); color: var(--ink-soft); }
.pm-presence { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-presence i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.pm-presence.is-online { color: var(--success-700); }
.pm-presence.is-online i { background: var(--success); }
.pm-presence.is-away i { background: var(--warning); }
.pm-remove { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--danger-50); color: var(--danger-600); cursor: pointer; }
.pm-remove:hover, .pm-remove:focus-visible { background: var(--danger); color: #fff; outline: none; }
#modal-project-members .pm-invite { display: flex; gap: 14px; padding: 14px 16px; border: 1px solid var(--primary-100); border-radius: 14px; background: color-mix(in srgb, var(--primary-50) 60%, var(--surface)); }
.pm-invite-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); color: var(--primary-600); }
.pm-invite-main { flex: 1; min-width: 0; }
.pm-invite-main strong { font-size: 14px; color: var(--ink); }
.pm-invite-main .form-hint { margin: 2px 0 10px; }
#modal-project-members .pm-invite-row .btn-primary { display: inline-flex; align-items: center; gap: 6px; }
/* Ô chọn người co theo khung (chữ dài thì "…"), không đẩy tràn ngang */
#modal-project-members .pm-invite-row .form-field { min-width: 0; }
#modal-project-members .pm-invite-row .form-control { width: 100%; min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
  .pm-tools { grid-template-columns: 1fr; }
  #modal-project-members .pm-item { grid-template-columns: auto minmax(0, 1fr) 28px; row-gap: 4px; }
  #modal-project-members .pm-item .pm-tags { grid-column: 2; grid-row: 2; }
  #modal-project-members .pm-item .pm-presence { grid-column: 2; grid-row: 3; }
  #modal-project-members .pm-item .pm-remove, #modal-project-members .pm-item .pm-remove-gap { grid-column: 3; grid-row: 1; }
  #modal-project-members .pm-invite { flex-direction: column; gap: 10px; }
  #modal-project-members .pm-invite-row .form-field { flex-basis: 100%; }
  #modal-project-members .pm-invite-row .btn-primary { width: 100%; justify-content: center; }
  .plink-form-row { grid-template-columns: 1fr; }
  #modal-project-links .plink-dropzone { flex-wrap: wrap; }
  .mhx-head { padding: 16px 18px 12px; }
  .mhx-box > .modal-body { padding: 14px 16px 16px; }
}

/* Thùng rác */
.modal-box.trash-modal-box { max-width: 1040px; }
.trx-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.trx-bulk { display: inline-flex; gap: 8px; }
.trx-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; cursor: pointer; }
.trx-btn.is-restore { border-color: var(--primary-100); color: var(--primary-600); }
.trx-btn.is-restore:hover:not(:disabled) { background: var(--primary-50); border-color: var(--primary); }
.trx-btn.is-purge:not(:disabled) { border-color: var(--danger-100); color: var(--danger-600); }
.trx-btn.is-purge:hover:not(:disabled) { background: var(--danger-50); border-color: var(--danger); }
.trx-btn:disabled { opacity: 0.55; cursor: not-allowed; }
/* Bảng theo mẫu: đầu bảng nền xanh rất nhạt, dòng cao ~44px, chữ 13px, ô icon việc xanh, cột thao tác căn phải */
.trash-modal-box .mhx-text p { max-width: 720px; }
.trx-bar { justify-content: flex-end; margin: -4px 0 12px; }
.trx-card { border: 1px solid #e6edf7; border-radius: 12px; overflow: hidden; background: var(--surface); }
.trx-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.trx-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 13px; color: var(--ink-soft); }
.trx-table th { height: 42px; padding: 0 14px; background: #f4f8fd; border-bottom: 1px solid #e6edf7; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.trx-th-ico { display: inline-flex; vertical-align: -2px; margin-right: 8px; color: var(--primary-600); }
.trx-table td { height: 46px; padding: 6px 14px; border-top: 1px solid #eef2f7; vertical-align: middle; }
.trx-table tbody tr:first-child td { border-top: 0; }
.trx-table tbody tr:hover { background: #f8fbff; }
.trx-table tbody tr.is-selected { background: var(--primary-50); }
.trx-sel { width: 44px; padding-right: 0 !important; }
.trx-sel input { display: block; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.trx-name { min-width: 240px; }
.trx-name-in { display: flex; align-items: center; gap: 12px; }
.trx-task-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; background: var(--primary-50); color: var(--primary-600); box-shadow: inset 0 0 0 1px var(--primary-100); }
.trx-name-text { min-width: 0; display: flex; flex-direction: column; }
.trx-name strong { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.trx-name small { font-size: 11.5px; color: var(--muted); }
.trx-muted { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trx-num { font-variant-numeric: tabular-nums; }
.trx-who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--ink-soft); }
.trx-who .avatar { width: 24px; height: 24px; font-size: 10px; }
.trx-acts { width: 1%; white-space: nowrap; }
.trx-acts-in { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.trx-restore { justify-content: center; min-width: 112px; height: 32px; padding: 0 14px; border-radius: 8px; background: var(--surface); }
.trx-purge { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--danger-100); border-radius: 8px; background: var(--danger-50); color: var(--danger-600); cursor: pointer; }
.trx-purge:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; }
.trx-purge:disabled { opacity: 0.5; cursor: not-allowed; }
.trx-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ===== Biểu đồ trong câu trả lời Trợ lý AI (ai.js aiChartHTML) — dùng lại lớp biểu đồ của tab Tổng quan (ovd-*, ovv-*) ===== */
.ai-chart { container-type: inline-size; }
.ai-chart .ovd-seg, .ai-chart .ovv-wk { cursor: default; }
.ai-ch-donut { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }
.ai-ch-donut .ovd-svg { flex: none; }
.ai-ch-dlegend { display: grid; gap: 8px; min-width: 180px; margin: 0; padding: 0; list-style: none; }
.ai-ch-dlegend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 48px; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.ai-ch-dlegend i { width: 10px; height: 10px; border-radius: 3px; }
.ai-ch-dlegend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ai-ch-dlegend small { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ai-chart .ovv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ai-chart .ovpr-legend { margin: 0; justify-content: flex-start; }
.ai-ch-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 12px; color: var(--ink-soft); }
.ai-ch-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ai-ch-legend i { width: 10px; height: 10px; border-radius: 3px; }
.ai-ch-bars { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.ai-ch-bars li { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr) 36px; align-items: center; gap: 10px; font-size: 13px; }
.ai-ch-label { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); }
.ai-ch-label > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-ch-label .ov-avatar, .ai-ch-label .avatar { flex: none; width: 22px; height: 22px; font-size: 10px; }
.ai-ch-track { display: flex; height: 14px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.ai-ch-track i, .ai-ch-legend i { display: block; }
.ai-ch-track i + i { box-shadow: -1px 0 0 var(--surface); }
.ai-ch-num { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.ai-chart .is-late { background: var(--danger); }
.ai-chart .is-open { background: var(--primary); }
.ai-chart .is-done { background: var(--success); }
.ai-chart .is-today { background: var(--warning); }
.ai-chart .is-later { background: color-mix(in srgb, var(--primary) 45%, var(--surface)); }
.ai-chart .is-none { background: #cbd5e1; }
.ai-ch-empty { margin: 6px 0 !important; font-size: 13px; color: var(--muted); }
@container (max-width: 420px) {
  .ai-ch-bars li { grid-template-columns: minmax(80px, 34%) minmax(0, 1fr) 30px; }
  .ai-ch-donut { gap: 12px; }
}

/* ===== Kỹ năng của Trợ lý AI (ai.js aiSkill* / renderAiSkillsModal) ===== */
/* Nút "Kỹ năng" ở hàng dưới khung nhập (cạnh ô chọn cấp AI) + ô chọn nổi phía trên */
.ai-skill-wrap { position: relative; display: inline-flex; min-width: 0; }
.ai-skill-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 180px; height: 32px; padding: 0 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.ai-skill-btn svg { flex: none; color: #f59e0b; }
/* Chế độ trợ lý (ai.js aiModesSync): hàng chip trên ô nhập, điện thoại cuộn ngang */
.ai-modes { display: flex; gap: 6px; margin-bottom: 6px; overflow-x: auto; scrollbar-width: none; }
.ai-modes::-webkit-scrollbar { display: none; }
.ai-mode-chip { flex: none; height: 28px; padding: 0 11px; border: 1px solid var(--border-soft); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 12.5px; cursor: pointer; }
.ai-mode-chip:hover { background: var(--bg); }
.ai-mode-chip.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
.ai-mode-chip:disabled { opacity: .6; cursor: default; }
.ai-skill-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-skill-btn:hover, .ai-skill-btn:focus-visible, .ai-skill-btn[aria-expanded="true"] { border-color: var(--primary-100); color: var(--ink); outline: none; }
.ai-skill-btn.is-on { border-color: #fcd34d; background: #fffbeb; color: #92400e; font-weight: 600; }
.ai-skill-pop { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20; width: min(340px, 80vw); max-height: 360px; display: flex; flex-direction: column;
  border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16); overflow: hidden; }
.ai-skill-pop[hidden] { display: none; }
.ai-skp-head { padding: 10px 10px 6px; }
.ai-skp-head .form-control { height: 34px; font-size: 13px; }
.ai-skp-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 6px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.ai-skp-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 8px; border: 0; border-radius: 10px; background: transparent; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.ai-skp-item.is-auto { width: calc(100% - 12px); margin: 0 6px 4px; border-bottom: 1px solid var(--border-soft); border-radius: 10px 10px 0 0; }
.ai-skp-item:hover, .ai-skp-item:focus-visible { background: var(--primary-50); outline: none; }
.ai-skp-item.is-on { background: #fffbeb; box-shadow: inset 0 0 0 1px #fcd34d; }
.ai-skp-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: #fef3c7; color: #b45309; }
.ai-skp-item.is-auto .ai-skp-ico { background: var(--primary-50); color: var(--primary-600); }
.ai-skp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ai-skp-text b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-skp-text small { font-size: 11.5px; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ai-skp-scope, .ais-scope { flex: none; max-width: 110px; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--bg); color: var(--ink-soft); font-size: 11px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-skp-scope.is-workspace, .ais-scope.is-workspace { background: var(--primary-50); color: var(--primary-600); }
.ai-skp-scope.is-project, .ais-scope.is-project { background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); color: #7c3aed; }
.ai-skp-note { margin: 6px 4px 10px; font-size: 12.5px; color: var(--muted); }
.ai-skp-note.is-err { color: var(--danger-600); }
.ai-skp-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border-soft); }
.ai-skp-link { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; border: 0; border-radius: 7px; background: transparent; color: var(--primary-600); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ai-skp-link:hover, .ai-skp-link:focus-visible { background: var(--primary-50); outline: none; }
/* Câu trả lời có dùng kỹ năng */
.ai-skill-used { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 6px !important; padding: 1px 9px; border-radius: var(--radius-pill); background: #fffbeb; color: #92400e; font-size: 11.5px; font-weight: 600; }
.ai-skill-used svg { color: #f59e0b; }
/* Kỹ năng AI đề xuất */
.ai-view.is-skills .ai-v-hico { background: #fef3c7; color: #b45309; }
.ai-sks { display: grid; gap: 10px; }
.ai-sk-card { padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.ai-sk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-sk-top b { font-size: 14px; color: var(--ink); }
.ai-sk-save { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; font-size: 12.5px; }
.ai-sk-desc { margin: 4px 0 0 !important; font-size: 12.5px; color: var(--ink-soft); }
.ai-sk-body { max-height: 160px; overflow: auto; margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--bg); font: inherit; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); white-space: pre-wrap; }
/* Hộp quản lý kỹ năng */
body:has(#modal-ai-skills-toggle:checked) #modal-ai-skills { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#modal-ai-skills-toggle:checked) #modal-ai-skills .modal-box { transform: scale(1); opacity: 1; }
#modal-ai-skills { z-index: 62; } /* nổi trên khung Trợ lý AI */
.modal-box.ai-skills-box { max-width: 720px; }
/* Hộp soạn kỹ năng (ai.js renderAiSkillsModal, theo mẫu chủ dự án duyệt 11/2026 — WEA Design System, đo theo ảnh mẫu):
   hộp 1000px hiện hết không cuộn; đầu hộp có hoa văn vòng tròn xanh nhạt ở góc phải, nút đóng ô trắng viền mảnh;
   trái = các ô có ô biểu tượng xanh nhạt + đếm ký tự trong ô; phải = nền xanh xám nhạt, thẻ Xem trước + Mẹo sử dụng */
.modal-box.ai-skills-box.is-form { max-width: 1080px; max-height: min(94vh, 780px); }
.ai-skills-box .mhx-head { position: relative; overflow: hidden; align-items: center; gap: 18px; padding: 20px 28px 18px; border-bottom: 1px solid var(--border-soft); background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 3%, var(--surface)), var(--surface)); }
/* Hoa văn: vòng tròn lồng nhau xanh nhạt ở góc trên phải (chỉ trang trí) */
.ai-skills-box .mhx-head::before, .ai-skills-box .mhx-head::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.ai-skills-box .mhx-head::before { top: -150px; right: -70px; width: 300px; height: 300px; border: 30px solid color-mix(in srgb, var(--primary) 7%, transparent); }
.ai-skills-box .mhx-head::after { top: -60px; right: 70px; width: 150px; height: 150px; background: radial-gradient(circle at 30% 70%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 70%); }
.ai-skills-box .mhx-head > * { position: relative; z-index: 1; }
.ai-skills-box .mhx-ico { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), color-mix(in srgb, var(--primary) 24%, var(--surface))); color: var(--primary-600); }
.ai-skills-box .mhx-ico svg { width: 26px; height: 26px; }
.ai-skills-box .mhx-text h2 { font-size: 20px; font-weight: 700; color: var(--ink); }
.ai-skills-box .mhx-text p { margin-top: 6px; font-size: 13.5px; color: var(--ink-soft); }
/* Nút đóng theo mẫu: ô trắng viền mảnh, X xám (khác nút đóng đỏ chung — chủ dự án chọn đúng mẫu cho hộp này) */
.ai-skills-box .mhx-head .icon-btn:has(> svg > use[href="#icon-close"]) { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.ai-skills-box .mhx-head .icon-btn:has(> svg > use[href="#icon-close"]):hover { border-color: var(--border); background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }
.ai-skills-box.is-form > .modal-body { padding: 0; }
.ais-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; }
.ais-form { display: flex; flex-direction: column; gap: 14px; padding: 20px 26px 18px 28px; }
.ais-row { display: flex; align-items: flex-start; gap: 14px; }
.ais-fic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-top: 2px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary-600); }
.ais-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ais-row-main .form-label { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.ais-req { color: var(--danger-600); }
.ais-form .form-control { height: 40px; padding: 0 14px; border: 1px solid #dbe3ee; border-radius: 10px; font-size: 14.5px; }
.ais-form .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.ais-input-wrap { position: relative; }
.ais-input-wrap .form-control { padding-right: 66px; }
.ais-cnt { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; pointer-events: none; }
.ais-form .ais-body { height: 150px; min-height: 150px; padding: 9px 14px 24px; line-height: 1.55; resize: vertical; }
.ais-input-wrap.is-area .ais-cnt { top: auto; bottom: 8px; transform: none; }
.ais-scope-field { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.ais-scope-field legend { margin-bottom: 6px; }
/* Ai dùng được: "Chỉ mình tôi" 1 dòng, 2 lựa chọn còn lại dòng dưới (như mẫu) */
.ais-radios { display: grid; grid-template-columns: max-content max-content; gap: 8px 36px; }
.ais-radios > :first-child { grid-column: 1 / -1; }
.ais-form .ais-radio { font-size: 14.5px; color: var(--ink); }
.ais-form .ais-radio input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary-600); }
.ais-row-main > .ais-enabled { margin-top: 0; }
.ais-side { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; border-left: 1px solid var(--border-soft); background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 5%, var(--bg)), var(--bg)); }
.ais-side-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.ais-side-title svg { color: var(--primary-600); }
.ais-pv { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 16px; padding: 20px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--surface)); border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 16%, var(--surface)), color-mix(in srgb, var(--primary) 6%, var(--surface))); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 10%, transparent); }
.ais-pv-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ais-pv-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.ais-pv-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--primary-600); }
.ais-pv-row { display: flex; align-items: center; gap: 12px; }
.ais-pv-input { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 11px 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); font-size: 14px; color: var(--ink-soft); }
.ais-pv-send { flex: none; display: grid; place-items: center; color: var(--primary-600); }
.ais-tips { padding: 18px 20px; border: 1px solid var(--border-soft); border-radius: 18px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.ais-tips h5 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--ink); }
.ais-bulb { display: grid; place-items: center; color: var(--warning-600); }
.ais-tips ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ais-tips li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--ink); }
.ais-check { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--success-100); color: var(--success-700); }
.ais-form-foot { position: sticky; bottom: 0; z-index: 1; display: flex; justify-content: flex-end; gap: 12px; padding: 14px 28px; border-top: 1px solid var(--border-soft); background: var(--surface); }
.ais-form-foot :is(.btn-primary, .btn-secondary) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; min-width: 88px; padding: 0 22px; border-radius: 10px; font-size: 15px; font-weight: 600; }
@media (max-width: 760px) {
  .ais-form-grid { grid-template-columns: minmax(0, 1fr); }
  .ais-form { padding: 16px; }
  .ais-side { padding: 16px; border-left: 0; border-top: 1px solid var(--border-soft); }
  .ais-radios { grid-template-columns: minmax(0, 1fr); }
  .ais-form-foot { padding: 12px 16px; }
  .ai-skills-box .mhx-head { padding: 18px 16px 14px; }
}
.ais-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ais-bar .btn-primary { display: inline-flex; align-items: center; gap: 6px; }
.ais-usage { font-size: 12.5px; color: var(--muted); }
.ais-list { display: grid; gap: 8px; }
.ais-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 12px; }
.ais-item.is-off { opacity: 0.6; }
.ais-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: #fef3c7; color: #b45309; }
.ais-main { flex: 1; min-width: 0; }
.ais-main b { font-size: 14px; color: var(--ink); margin-right: 6px; }
.ais-main p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.ais-main small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.ais-acts { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.ais-body { min-height: 180px; resize: vertical; font-size: 13px; line-height: 1.55; }
.ais-scope-field { display: grid; gap: 6px; margin: 4px 0 10px; padding: 0; border: 0; }
.ais-main .ais-scope { display: inline-block; max-width: min(220px, 100%); vertical-align: 2px; }
@media (max-width: 560px) {
  .ais-item { flex-wrap: wrap; }
  .ais-item .ais-main { flex: 1 1 calc(100% - 50px); }
  .ais-item .ais-acts { flex: 1 1 100%; justify-content: flex-end; }
  .ais-bar { flex-wrap: wrap; }
  .ais-main b { overflow-wrap: anywhere; }
}
.ais-radio { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.ai-skill-card { margin-bottom: 16px; }
.ai-skill-card-in { display: flex; align-items: center; gap: 14px; }
.ai-skill-card-in > div { flex: 1; min-width: 0; }
.ai-skill-card-in .set-note { margin: 2px 0 0; }
@media (max-width: 560px) { .ai-skill-card-in { flex-wrap: wrap; } }
.ais-note { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; background: var(--primary-50); font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Tổng quan › Cần tôi xử lý (teamwork.js aq*): 4 thẻ số liệu, 2 nhóm theo thời gian chờ, dạng bảng / thẻ ----------
   Tông màu: hot = chờ ≥ 7 ngày (đỏ), warn = ≥ 3 ngày (cam), ok = mới chờ (xanh lá) */
.aq-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.aq-stat { --tc: #38bdf8; display: flex; flex-direction: column; gap: 8px; padding: 14px 14px; border: 1px solid color-mix(in srgb, var(--tc) 35%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--tc) 8%, var(--surface)); min-width: 0; }
.aq-stat.is-red { --tc: #f43f5e; }
.aq-stat.is-amber { --tc: #f59e0b; }
.aq-stat.is-green { --tc: #10b981; }
/* Hình minh họa cao đúng bằng cụm chữ bên phải: tên thẻ 16px + số 28px + dòng phụ 16px = 60px (line-height cố định bên dưới) */
.aq-stat-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.aq-stat-art { flex: none; width: 60px; height: 60px; color: var(--tc); }
.aq-stat-art svg { display: block; width: 100%; height: 100%; }
.aq-stat-body { flex: 1; min-width: 0; }
.aq-stat-title { line-height: 16px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.aq-stat-num { font-size: 22px; font-weight: 800; line-height: 28px; color: color-mix(in srgb, var(--tc) 80%, #0f172a); }
.aq-stat-num small { font-size: 13px; font-weight: 600; color: var(--muted); }
.aq-stat-sub { font-size: 12px; line-height: 16px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aq-bar { display: block; height: 5px; margin-top: auto; border-radius: 99px; background: color-mix(in srgb, var(--tc) 15%, var(--surface)); overflow: hidden; }
.aq-bar i { display: block; height: 100%; border-radius: inherit; background: var(--tc); }
.aq-stat-proj { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.aq-stat-projbtn { display: flex; align-items: center; gap: 6px; width: calc(100% + 8px); min-width: 0; height: 22px; padding: 0 4px; margin: 0 -4px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s ease; }
.aq-stat-projbtn:hover, .aq-stat-projbtn:focus-visible, .aq-stat-projbtn.is-on { background: color-mix(in srgb, var(--tc) 14%, transparent); }
.aq-stat-projbtn i { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.aq-stat-projbtn span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aq-stat-projbtn b { font-size: 14px; font-weight: 800; color: var(--ink); }
.aq-select { width: auto; min-width: 140px; height: 36px; font-size: 13px; font-weight: 600; }

.aq-group { --tc: #10b981; margin-bottom: 18px; }
.aq-group.is-hot { --tc: #f43f5e; }
/* Đầu nhóm: thanh nền nhạt màu nhóm (--tl) + tam giác ▼ (thu gọn = ▶) + thẻ tên nền đặc, chữ / icon dùng lại màu nhạt đó + số đếm */
.aq-group { --tl: color-mix(in srgb, var(--tc) 10%, var(--surface)); }
.aq-group-head { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; border-radius: 10px; background: var(--tl); cursor: pointer; user-select: none; transition: background-color .25s ease; }
.aq-group-head:hover { background: color-mix(in srgb, var(--tc) 16%, var(--surface)); }
.aq-chev { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; color: var(--ink-soft); transition: background-color .2s ease; }
.aq-chev { color: color-mix(in srgb, var(--tc) 75%, #0f172a); }
.aq-chev::before { content: ""; display: block; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid currentColor; transition: transform .25s ease; }
.aq-group-toggle:checked + .aq-group-head .aq-chev::before { transform: rotate(-90deg); }
.aq-group-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: var(--tc); color: var(--tl); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.aq-group-pill svg { color: var(--tl); }
.aq-group-toggle:checked ~ .aq-group-body { display: none; }
.aq-group-toggle:focus-visible + .aq-group-head { outline: 2px solid var(--primary); outline-offset: 2px; }
.aq-group-count { font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--tc) 75%, #0f172a); }
.aq-group-hint { font-size: 12px; color: color-mix(in srgb, var(--tc) 70%, var(--ink-soft)); }
.aq-group-body { margin-top: 10px; }

.aq-table-scroll { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 10px 10px 0 0; background: var(--surface); }
.aq-table { min-width: 860px; }
.aq-row { display: grid; grid-template-columns: minmax(220px, 2.2fr) minmax(150px, 1.3fr) minmax(130px, 1.1fr) minmax(120px, 1fr) minmax(100px, .8fr) minmax(190px, auto); align-items: center; border-bottom: 1px solid var(--border-soft); }
.aq-row:last-child { border-bottom: 0; }
.aq-cell { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 12px; }
.aq-head .aq-cell:last-child { justify-content: center; }
.aq-head { background: color-mix(in srgb, var(--ink-soft) 6%, var(--surface)); }
.aq-head .aq-cell { padding-top: 9px; padding-bottom: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.aq-item.is-hot { --tc: #f43f5e; }
.aq-item.is-warn { --tc: #f59e0b; }
.aq-item.is-ok { --tc: #10b981; }
.aq-row.aq-item { box-shadow: inset 4px 0 0 var(--tc); transition: background-color .2s ease; }
.aq-row.aq-item:hover { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.aq-name { gap: 8px; padding-left: 14px; }
.aq-name-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
/* Tên việc là nút: bấm mới mở chi tiết (bấm chỗ khác trên dòng không mở) */
.aq-title { max-width: 100%; padding: 0; border: 0; background: none; font: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.aq-title:hover, .aq-title:focus-visible, .aq-card-title:hover, .aq-card-title:focus-visible { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
/* Ngôi sao: chưa đánh dấu = viền vàng không nền, đã đánh dấu = tô vàng */
.aq-star.star-btn { flex: none; width: 26px; height: 26px; padding: 0; border: 0; background: transparent; color: #f59e0b; box-shadow: none; }
.aq-star.star-btn:hover, .aq-star.star-btn:focus-visible { background: #fef9c3; }
.aq-star.star-btn.is-favorite { border: 0; color: #f59e0b; }
.aq-detail { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.aq-waitcell { flex-direction: column; align-items: flex-start; gap: 1px; }
.aq-since { font-size: 11.5px; color: var(--muted); }
.aq-actcell { justify-content: center; gap: 10px; }
.aq-actcell .pl-menu-dots { opacity: 1; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink-soft); }
.aq-actcell .pl-menu-dots:hover, .aq-actcell .pl-menu-dots.is-open { border-color: var(--primary); color: var(--primary); }
.aq-muted { color: var(--muted); }

.aq-proj { --pc: #38bdf8; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--pc) 13%, var(--surface)); color: color-mix(in srgb, var(--pc) 60%, #0f172a); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aq-proj i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--pc); }
.aq-person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.aq-person .aq-avatar { flex: none; width: 28px; height: 28px; font-size: 11px; }
.aq-person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink); }
.aq-wait { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.aq-wait.is-hot { background: #fff1f2; color: #e11d48; }
.aq-wait.is-warn { background: #fffbeb; color: #d97706; }
.aq-wait.is-ok { background: #ecfdf5; color: #059669; }
.aq-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--ink-soft) 10%, var(--surface)); color: var(--ink-soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.aq-chip.is-again { background: #fef3c7; color: #b45309; }
.aq-chip.is-blocker { background: #fffbeb; color: #d97706; }
.aq-chip.is-changes { background: #fff1f2; color: #e11d48; }
.aq-chip.is-comment { background: #eff6ff; color: #2563eb; }
.aq-go { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background-color .2s ease; }
.aq-go:hover, .aq-go:focus-visible { background: color-mix(in srgb, var(--primary) 82%, #0f172a); }
.aq-go.is-approve { background: #10b981; }
.aq-go.is-approve:hover, .aq-go.is-approve:focus-visible { background: #059669; }
.aq-go:disabled { opacity: .5; cursor: not-allowed; }

.aq-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.aq-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border: 1px solid var(--border-soft); border-top: 3px solid var(--tc); border-radius: 12px; background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease; }
.aq-card:hover { border-color: var(--primary); border-top-color: var(--tc); box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
.aq-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.aq-card-head { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.aq-card-head .aq-star { margin: -2px 0 0 -4px; }
.aq-card-title { padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aq-card-reason { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.aq-kind { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-soft); }
.aq-kind.is-review svg { color: #fb7185; }
.aq-kind.is-blocker svg { color: #f59e0b; }
.aq-kind.is-changes svg { color: #e11d48; }
.aq-kind.is-comment svg { color: #3b82f6; }
.aq-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border-soft); }

@media (max-width: 1100px) { .aq-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .aq-stats { grid-template-columns: 1fr; }
  .aq-select { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .aq-chev::before, .aq-chev, .aq-group-head, .aq-row.aq-item, .aq-card, .aq-go, .aq-stat-projbtn { transition: none; } }

/* ---------- Trang Đã đánh dấu (tasks.js starredGroupsHTML): nhóm theo dự án, mỗi nhóm 1 bảng ---------- */
body:has(#view-starred.is-active) .page-content { background: linear-gradient(180deg, #eef3f9, #f4f7fb 320px); }
.st-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.st-head-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 46px; height: 46px; border: 1px solid #fde68a; border-radius: 14px; background: #fef6dc; color: #f59e0b; }
.st-head-icon svg { width: 22px; height: 22px; }
.st-head h1 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--ink); }
.st-head p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* 4 ô số: chỉ để xem (không hover / bấm); nền pastel rất nhạt, viền trắng 2px + bóng mềm nổi nhẹ như mẫu */
.st-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.st-stat { --c: #38bdf8; --ink-c: #0284c7; display: flex; align-items: center; gap: 16px; min-width: 0; padding: 16px 20px; border: 2px solid #fff; border-radius: 16px; background: color-mix(in srgb, var(--c) 4%, var(--surface)); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04); }
.st-stat.is-green { --c: #34d399; --ink-c: #059669; }
.st-stat.is-amber { --c: #f59e0b; --ink-c: #d97706; }
.st-stat.is-rose { --c: #fb7185; --ink-c: #e11d48; }
.st-stat-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--ink-c); }
.st-stat-text { display: flex; flex-direction: column; min-width: 0; }
.st-stat-text b { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.st-stat-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--ink-soft); }

/* Hàng tab trạng thái + tìm + sắp xếp + lọc: mọi khối cao 36px, bo 12px (chuẩn = ô Sắp xếp);
   hover / bấm theo chuẩn ô tìm + ô lọc trang Nhóm (.tmg-tools): rê = viền xanh nhạt + nền xanh rất nhạt, đang mở / gõ = viền xanh + quầng */
.st-toolbar { --st-h: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.st-tabs { box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; height: var(--st-h); padding: 3px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.st-tab { box-sizing: border-box; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .2s ease; }
.st-tab:hover { background: color-mix(in srgb, var(--ink-soft) 8%, var(--surface)); }
.st-tab.is-on { border-color: color-mix(in srgb, var(--primary) 35%, var(--surface)); background: var(--primary-50); color: var(--primary-600); }
.st-tab span { font-variant-numeric: tabular-nums; }
.st-tab-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.st-toolbar .search-field { box-sizing: border-box; width: 300px; max-width: 100%; height: var(--st-h); border-radius: 12px; box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.08); }
.st-toolbar .search-field input { font-size: 13.5px; }
.st-sort { position: relative; display: inline-flex; align-items: center; width: 170px; }
.st-sort > svg { position: absolute; left: 12px; top: 50%; z-index: 1; color: var(--ink-soft); transform: translateY(-50%); pointer-events: none; }
.st-sort .st-select, .st-sort .cselect-btn { box-sizing: border-box; width: 100%; height: var(--st-h); min-height: 0; padding-left: 36px; border-radius: 12px; background-color: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.st-toolbar .tf-wrap .filter-btn { box-sizing: border-box; width: var(--st-h); height: var(--st-h); border-radius: 12px; }
.st-toolbar .search-field, .st-sort .cselect-btn, .st-toolbar .tf-wrap .filter-btn { transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s; }
.st-toolbar .search-field:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: #f8fbff; }
.st-toolbar .search-field:focus-within { border-color: var(--primary); background: var(--surface); box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.08), 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.st-toolbar .search-field:focus-within > svg { color: var(--primary-600); }
.st-sort .cselect-btn:hover, .st-toolbar .tf-wrap .filter-btn:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background-color: var(--primary-50); }
.st-sort .cselect-btn.is-open, .st-toolbar .tf-wrap .filter-btn[aria-expanded="true"] { border-color: var(--primary); background-color: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.st-sort:has(.cselect-btn.is-open) > svg { color: var(--primary-600); }
/* Nút Danh sách / Lưới: cùng khung 36px / bo 12px như hàng tab */
.st-layout { box-sizing: border-box; display: inline-flex; align-items: center; gap: 2px; height: var(--st-h); padding: 3px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.st-layout-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 28px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background-color .2s ease; }
.st-layout-btn:hover { background: color-mix(in srgb, var(--ink-soft) 8%, var(--surface)); }
.st-layout-btn.is-on { background: var(--primary-50); color: var(--primary-600); }
.st-sort > svg:last-child { color: var(--ink-soft); pointer-events: none; }

/* Nhóm dự án = 1 thẻ trắng: đầu nhóm pastel rất nhẹ theo màu dự án (chỉ tô biểu tượng thư mục + số), bảng bên dưới */
.st-group { margin-bottom: 16px; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.st-group-head { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 16px 0 10px; background: color-mix(in srgb, var(--pc) 5%, #f5f8fc); cursor: pointer; user-select: none; }
.st-gchev { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background-color .2s ease; }
.st-gchev svg { transform: rotate(180deg); transition: transform .2s ease; }
.st-group.is-closed .st-gchev svg { transform: none; }
.st-gchev:hover { background: color-mix(in srgb, var(--pc) 12%, var(--surface)); }
.st-folder { display: inline-flex; flex: none; color: var(--pc); }
.st-group-name { min-width: 0; overflow: hidden; padding: 2px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 17px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.st-group-name:hover { color: var(--primary-600); text-decoration: underline; text-underline-offset: 3px; }
.st-group-count { flex: none; min-width: 24px; padding: 0 8px; border-radius: 99px; background: color-mix(in srgb, var(--pc) 14%, var(--surface)); color: color-mix(in srgb, var(--pc) 75%, #0f172a); font-size: 12.5px; font-weight: 700; line-height: 24px; text-align: center; font-variant-numeric: tabular-nums; }

/* Bảng: đầu nhóm, đầu cột, dòng việc cùng cao 42px (chủ dự án chốt); cột tên co giãn, cột khác cố định để các nhóm thẳng hàng nhau */
.st-table { overflow-x: auto; }
.st-row { display: grid; grid-template-columns: 52px minmax(260px, 1fr) 160px 170px 180px 120px 52px; align-items: center; min-width: 1000px; border-top: 1px solid var(--border-soft); }
.st-cell { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 12px; }
.st-row-head { min-height: 42px; background: #f1f5f9; }
.st-row-head .st-cell { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.st-item { min-height: 42px; cursor: pointer; transition: background-color .2s ease; }
.st-row.st-item { background: var(--surface); }
.st-row.st-item:hover { background: #f6fcff; }
.st-star { justify-content: center; padding: 0; }
.st-star-btn.star-btn { width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: #f59e0b; box-shadow: none; }
.st-star-btn.star-btn:hover, .st-star-btn.star-btn:focus-visible { background: #fef6dc; }
.st-star-btn.star-btn.is-favorite { border: 0; color: #f59e0b; }
.st-name { gap: 10px; }
.st-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.st-sub { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Trạng thái: nền pastel + chữ cùng tông tươi như ảnh mẫu (không pha đen), không viền */
.st-status { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.st-status.is-todo { background: #eaf6fe; color: #0ea5e9; }
.st-status.is-doing { background: #fff6e5; color: #f59e0b; }
.st-status.is-review { background: #fff0f2; color: #f43f5e; }
.st-status.is-done { background: #eafaf1; color: #16a34a; }
.st-due { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.st-due svg { flex: none; }
.st-due-text { display: flex; flex-direction: column; line-height: 1.25; }
.st-due b { font-size: 14px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.st-due small { font-size: 12px; color: var(--ink-soft); }
.st-due.is-late, .st-due.is-late b, .st-due.is-late small { color: #e11d48; }
.st-due.is-today, .st-due.is-today small { color: #d97706; }
.st-due-none { font-size: 13px; color: var(--muted); }
.st-item .priority-pill { gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 8px; font-size: 13px; font-weight: 600; }
.st-item .priority-high { background: #fff1f2; color: #e11d48; }
.st-item .priority-medium { background: #fff7e6; color: #d97706; }
.st-item .priority-low { background: #eff6ff; color: #2563eb; }
/* Bảng cuộn ngang (màn hẹp / zoom): ★ + cột tên dính bên trái để luôn biết đang xem việc nào */
/* Nền lấy chung của dòng (inherit) — phải đặc để chữ các cột khác không chạy đè lên khi cuộn */
.st-row > .st-cell:nth-child(1), .st-row > .st-cell:nth-child(2) { position: sticky; z-index: 1; align-self: stretch; background: inherit; }
.st-row > .st-cell:nth-child(1) { left: 0; }
.st-row > .st-cell:nth-child(2) { left: 52px; }
.st-menu-cell { justify-content: center; padding: 0; }
/* Dạng lưới: thẻ trắng viền mảnh trong mỗi nhóm dự án */
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 14px; border-top: 1px solid var(--border-soft); }
.st-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; padding: 14px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.st-card:hover { background: #f6fcff; }
.st-card-top { display: flex; align-items: flex-start; gap: 8px; }
.st-card-top .st-star-btn { flex: none; margin: -4px 0 0 -6px; }
.st-card-title { display: -webkit-box; flex: 1; min-width: 0; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.st-card-top .pl-menu-dots { flex: none; margin: -4px -4px 0 0; }
.st-card-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-card .priority-pill { gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 8px; font-size: 13px; font-weight: 600; }
.st-card .priority-high { background: #fff1f2; color: #e11d48; }
.st-card .priority-medium { background: #fff7e6; color: #d97706; }
.st-card .priority-low { background: #eff6ff; color: #2563eb; }
.st-card .pl-menu-dots { opacity: 1; width: 32px; height: 32px; border-radius: 50%; }
.st-card .pl-menu-dots:hover, .st-card .pl-menu-dots.is-open { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: var(--primary-50); color: var(--primary-600); }
.st-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.st-item .pl-menu-dots { opacity: 1; width: 32px; height: 32px; border-radius: 50%; }
.st-item .pl-menu-dots:hover, .st-item .pl-menu-dots.is-open { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: var(--primary-50); color: var(--primary-600); }

.st-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 20px; border: 1px solid #fde68a; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, #fef3c7 70%, var(--surface)), color-mix(in srgb, var(--primary) 6%, var(--surface))); color: #f59e0b; text-align: center; }
.st-empty h2 { margin: 6px 0 0; font-size: 18px; color: var(--ink); }
.st-empty p { margin: 0 0 8px; font-size: 14px; color: var(--ink-soft); }

/* 1200px: gồm cả màn 1672px zoom 150% (~1115px) -> 4 ô số xuống 2 cột thay vì cắt chữ */
@media (max-width: 1200px) {
  .st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .st-stats { gap: 10px; }
  .st-stat { gap: 10px; padding: 12px; }
  .st-stat-icon { width: 40px; height: 40px; }
  .st-stat-text b { font-size: 22px; }
  .st-stat-text span { white-space: normal; font-size: 12.5px; line-height: 1.3; }
  .st-toolbar .search-field { flex: 1 1 100%; width: auto; }
  .st-tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; }
  .st-toolbar .toolbar-spacer { display: none; }
  .st-sort { flex: 1 1 auto; width: auto; }
  .st-row { grid-template-columns: 44px 200px 150px 150px 170px 110px 48px; min-width: 872px; }
  .st-row > .st-cell:nth-child(2) { left: 44px; box-shadow: 6px 0 8px -6px rgba(15, 23, 42, 0.12); }
  .st-cards { grid-template-columns: 1fr; padding: 10px; }
  .st-group-name { font-size: 15.5px; }
}
@media (prefers-reduced-motion: reduce) { .st-gchev, .st-gchev svg, .st-item, .st-tab, .st-layout-btn, .st-toolbar .search-field, .st-sort .cselect-btn, .st-toolbar .tf-wrap .filter-btn { transition: none; } }

/* Ngôi sao đánh dấu dùng chung mọi nơi (starButtonHTML shared.js, ghim liên kết ở Tổng quan dự án):
   luôn màu vàng — chưa đánh dấu chỉ có viền, đã đánh dấu thì tô đặc (fill do shared.js / overview.js gắn) */
/* !important: nút sao nằm trong nhiều khung có luật màu .icon-btn riêng (thẻ Kanban, chi tiết việc…) */
.star-btn, .ovq-star { color: #facc15 !important; }
.star-btn:hover, .star-btn:focus-visible, .ovq-star:hover, .ovq-star:focus-visible { color: #eab308 !important; }

/* ---------- Hộp thoại Thêm / Sửa dự án (index.html .pjf-box, projects.js ap* / ep* / pm*) ----------
   Đầu hộp: ô icon + tiêu đề + dòng phụ; tên dự án có ô biểu tượng màu; mô tả có bộ đếm; ô chọn quản lý kèm ảnh;
   thẻ quyền xem có icon + nút tròn; vùng nguy hiểm có icon thùng rác */
.pjf-box .modal-head { align-items: flex-start; }
.pjf-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pjf-head-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); }
.pjf-head h2 { margin: 0; }
.pjf-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.pjf-box .form-field > label, .pjf-box .ep-label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pjf-req { color: var(--danger); }

.pjf-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pjf-start .form-hint { flex-basis: 100%; margin: 2px 0 0; }
.pjf-chip { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: border-color .2s ease, background-color .2s ease, color .2s ease; }
.pjf-chip:hover, .pjf-chip:focus-visible { border-color: var(--primary); color: var(--primary-600); }
.pjf-chip.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); cursor: default; }
.pjf-chip svg { color: currentColor; }

.pjf-name { display: flex; align-items: center; gap: 12px; }
.pjf-name .form-control { flex: 1; min-width: 0; height: 46px; font-size: 15px; }
/* Sửa dự án: hình tròn nền đặc màu dự án, icon trắng; Thêm dự án (.is-square): ô vuông nền nhạt, icon màu dự án */
.pjf-name-ico { --pc: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: none; width: 50px; height: 50px; border-radius: 50%; background: var(--pc); color: #fff; transition: background-color .2s ease; }
.pjf-name-ico.is-square { width: 46px; height: 46px; border-radius: 10px; background: color-mix(in srgb, var(--pc) 14%, var(--surface)); color: var(--pc); }

.pjf-desc { position: relative; }
.pjf-desc textarea { min-height: 96px; padding-bottom: 24px; resize: vertical; }
.pjf-count { position: absolute; right: 12px; bottom: 8px; font-size: 11.5px; color: var(--muted); pointer-events: none; }

.pjf-select { position: relative; }
.pjf-select .form-control { height: 46px; padding-left: 50px; }
.pjf-select-av { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; pointer-events: none; }
.pjf-select-av .pjf-av { width: 28px; height: 28px; font-size: 11px; }
.pjf-av-empty { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg); color: var(--muted); }

/* Chấm màu to hơn, nút "Màu khác" dạt phải */
.pjf-box .ep-swatches { gap: 12px; }
.pjf-box .ep-swatch { width: 32px; height: 32px; }
.pjf-box .ep-swatch-more { display: inline-flex; align-items: center; gap: 6px; height: 40px; margin-left: auto; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--primary-600); font-size: 13.5px; }
.pjf-box .ep-swatch-more:hover, .pjf-box .ep-swatch-more[aria-expanded="true"] { border-color: var(--primary); background: var(--primary-50); }
.ep-swatch-caret { width: 6px; height: 6px; margin: -3px 0 0 4px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg); transition: transform .25s ease; }
.ep-swatch-more[aria-expanded="true"] .ep-swatch-caret { margin-top: 3px; transform: rotate(225deg); }
.pjf-swatches { margin-top: 14px; }
/* Bộ chọn màu: ô đậm / sáng bên trái, thanh sắc màu + mã màu bên phải */
.pjf-cpick .cpick { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 24px; align-items: start; }
.pjf-cpick .cpick-sv { grid-row: span 2; height: 150px; border-radius: 10px; }
.pjf-cpick .cpick-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
.pjf-cpick .cpick-hue { order: -1; flex-basis: 100%; margin: 6px 0 4px; }
.pjf-cpick .cpick-preview { width: 38px; height: 38px; border-radius: 50%; }
.pjf-cpick .cpick-hex { flex: 1; min-width: 0; height: 40px; }

/* Thẻ quyền xem: icon vuông + chữ + nút tròn bên phải */
.pjf-box .ep-vis-card { flex-direction: row; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 12px; }
.ep-vis-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--bg); color: var(--primary-600); }
.ep-vis-text { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.ep-vis-radio { flex: none; width: 18px; height: 18px; margin-top: 2px; border: 1.5px solid var(--border); border-radius: 50%; background: var(--surface); }
.ep-vis-card.is-on .ep-vis-radio { border: 5px solid var(--primary); }
.pjf-box .ep-vis-card.is-on { border-color: var(--primary); background: var(--primary-50); box-shadow: none; }
.ep-vis-card.is-on .ep-vis-ico { background: var(--surface); }
.pjf-box .ep-vis-alt { display: inline-flex; align-items: center; gap: 6px; }

.pjf-box .ep-danger { gap: 14px; padding: 14px 16px; border-radius: 12px; }
.ep-danger-ico { display: inline-flex; flex: none; color: var(--danger-600); }
.pjf-box .ep-danger b { font-size: 15px; }
.pjf-box .ep-danger-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-color: color-mix(in srgb, var(--danger-600) 45%, transparent); }
.pjf-submit { display: inline-flex; align-items: center; gap: 7px; }
.pjf-box .modal-foot .btn-primary, .pjf-box .modal-foot .btn-secondary { min-height: 44px; padding-left: 22px; padding-right: 22px; }

@media (max-width: 560px) {
  .pjf-cpick .cpick { grid-template-columns: 1fr; }
  .pjf-cpick .cpick-sv { grid-row: auto; }
  .pjf-box .ep-swatch-more { margin-left: 0; }
  .pjf-name-ico { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .pjf-chip, .pjf-name-ico, .ep-swatch-caret { transition: none; } }

/* Thêm / Sửa dự án bản rộng ngang: 2 cột, hiện đủ không cần cuộn trên máy tính (điện thoại về 1 cột, cuộn bình thường) */
.pjf-box { width: min(1040px, calc(100vw - 32px)); max-width: 1040px; max-height: min(94vh, 800px); }
.pjf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
.pjf-col { display: flex; flex-direction: column; min-width: 0; }
.pjf-col > .form-field, .pjf-col > .ep-switch-row { margin-bottom: 14px; }
.pjf-col > :last-child { margin-bottom: 0; }
.pjf-box .pjf-desc textarea { min-height: 112px; }
/* (#modal-add-project dùng khung .npj-box mới, chiều cao ô mô tả đặt ở khối "HỘP TẠO DỰ ÁN MỚI") */

/* Thẻ minh họa: nền chuyển hồng nhạt → xanh nhạt, hình SVG bên trái + câu ngắn bên phải */
.pjf-art { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 14px 18px; border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border-soft)); border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, #fce7f3 70%, var(--surface)), color-mix(in srgb, #e0f2fe 80%, var(--surface))); }
.pjf-art-svg { flex: none; width: 132px; height: 99px; }
.pjf-art-text { min-width: 0; }
.pjf-art-text b { display: block; font-size: 15px; line-height: 1.35; color: var(--ink); }
.pjf-art-text p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }

/* Thẻ quyền xem gọn hơn để vừa cột */
.pjf-box .ep-vis-card { padding: 11px 12px; gap: 10px; }
.pjf-box .ep-vis-card small { font-size: 12px; }
.pjf-box .ep-vis-ico { width: 32px; height: 32px; }
.pjf-box .ep-vis-alt { margin-top: 6px; }

/* Bộ chọn màu của hộp Thêm: ô đậm / sáng thấp lại */
#modal-add-project .pjf-cpick .cpick-sv { height: 112px; }
#modal-add-project .pjf-swatches { margin-top: 12px; gap: 10px; }
#modal-add-project .pjf-swatches .ep-swatch { width: 28px; height: 28px; }

/* Hộp Sửa: "Màu khác" mở ô nổi ngay dưới hàng màu, không làm hộp cao thêm */
.pjf-color-field { position: relative; }
.pjf-pop { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(15, 23, 42, .16); }
.pjf-pop .cpick-sv { height: 120px; }
.pjf-box .ep-switch-row { padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 12px; }

@media (max-width: 860px) {
  .pjf-grid { grid-template-columns: 1fr; }
  .pjf-art { order: -1; }
  .pjf-col + .pjf-col { margin-top: 14px; }
}
@media (max-width: 520px) {
  .pjf-art { flex-direction: column; text-align: center; }
}
#modal-edit-project .ep-swatches { flex-wrap: nowrap; gap: 8px; }
#modal-edit-project .ep-swatch { flex: none; width: 28px; height: 28px; }
#modal-edit-project .ep-swatch-more { flex: none; height: 36px; padding: 0 12px; }
#modal-edit-project .pjf-desc textarea { min-height: 220px; }
@media (max-width: 560px) { #modal-edit-project .ep-swatches { flex-wrap: wrap; } }

/* Kanban (tasks.js taskCardHTML / kanbanBoardHTML): khung cột bọc tiêu đề + thẻ việc nền mờ rất nhạt theo màu trạng thái (--kc);
   tiêu đề cột nền màu trạng thái rõ hơn; hàng đầu thẻ = chip hạn gọn; mô tả 1 dòng */
.kanban-column { padding: 8px; border: 1px solid color-mix(in srgb, var(--kc, var(--border)) 12%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--kc, var(--border)) 4%, transparent); }
.task-card-due-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-card-due-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.task-card-due-top .due-chip { gap: 5px; padding: 2px 8px; border: 0; border-radius: 6px; background: #f2f2f2; color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.task-card-due-top .due-chip.is-soon { background: #fef3c7; color: #b45309; }
.task-card-due-top .due-chip svg { width: 12px; height: 12px; }
.task-card-due-top .due-chip.is-overdue { border: 0; background: var(--danger-50); color: var(--danger-600); }
.task-card .task-card-desc { -webkit-line-clamp: 1; }
/* Rê vào thẻ Kanban: viền màu đậm của trạng thái cột (--kc) */
.kanban-column .task-card:hover { border-color: var(--kc); box-shadow: 0 10px 22px color-mix(in srgb, var(--kc) 20%, transparent); }
/* Kéo thẻ Kanban: viền đứt màu trạng thái bọc cả cột (tiêu đề + thẻ), không viền riêng danh sách;
   thẻ đang kéo không mờ đi mà nghiêng nhẹ sang trái + đổ bóng như vừa được nhấc ra khỏi cột */
.kanban-column-body.is-drag-over { background: transparent; outline: 0; }
.kanban-column { transition: outline-color .15s ease, background-color .15s ease; outline: 2px dashed transparent; outline-offset: -2px; }
/* Khung bảng cuộn ngang nên cắt mọi thứ tràn ra ngoài: chừa chút lề để viền đứt và thẻ đang kéo (phóng to) không bị che */
.kanban-board { padding-top: 6px; padding-bottom: 6px; }
.kanban-column.is-drag-over { outline-color: var(--kc); background: color-mix(in srgb, var(--kc) 9%, transparent); }
/* Kéo giống tab Kế hoạch (16/11/2026): thẻ gốc rút khỏi cột, ô viền đứt (.kh-drop-slot) giữ chỗ sẽ thả, ảnh kéo .kh-drag-ghost nghiêng theo chuột */
.task-card.is-dragging { display: none; }
.kanban-column-body:has(.kh-drop-slot) > .empty-state { display: none; }
.kanban-column-body > .kh-drop-slot { border-color: color-mix(in srgb, var(--kc, var(--primary)) 60%, transparent); background: color-mix(in srgb, var(--kc, var(--primary)) 8%, transparent); }
.kh-drag-ghost .task-card { margin: 0; animation: none; opacity: 1; transform: none; border: 1.5px solid var(--kc, var(--primary)); background: var(--surface); box-shadow: 0 22px 44px rgba(15, 23, 42, .18), 0 4px 12px rgba(15, 23, 42, .08); }
.kh-drag-ghost .task-card .task-delete-btn { display: none; }
@media (prefers-reduced-motion: reduce) { .kanban-column { transition: none; } }

/* ---------- Ghi chú dán (notes.js): lớp nổi trên mọi trang, dưới hộp thoại (60), trên bảng chi tiết việc ----------
   Thanh tiêu đề = màu ghi chú (--snc), thân = cùng màu pha trắng sáng hơn; bo góc 8px */
#sn-layer { position: fixed; inset: 0; z-index: 1000; pointer-events: none; } /* đè cao nhất: trên chi tiết việc, hộp thoại, ngăn kéo; chỉ hộp xác nhận (3000) và chú thích nổi (2000) nằm trên */
#sn-layer > * { pointer-events: auto; }
.sn-note { --snc: #facc15; --sn-fore: #1f2937; position: absolute; display: flex; flex-direction: column; min-width: 220px; min-height: 180px; border-radius: 8px; background: color-mix(in srgb, var(--snc) 32%, #fff); box-shadow: 0 10px 30px rgba(15, 23, 42, .22), 0 0 0 1px rgba(15, 23, 42, .06); color: #1f2937; overflow: visible; }
.sn-note.is-moving { box-shadow: 0 18px 40px rgba(15, 23, 42, .3), 0 0 0 1px rgba(15, 23, 42, .08); user-select: none; }
.sn-note.is-remind { animation: sn-pop-in .5s ease; }
@keyframes sn-pop-in { from { transform: scale(.92); opacity: .4; } to { transform: none; opacity: 1; } }
.sn-head { display: flex; align-items: center; gap: 4px; flex: none; height: 38px; padding: 0 4px 0 4px; border-radius: 8px 8px 0 0; background: var(--snc); cursor: grab; touch-action: none; }
.sn-note.is-moving .sn-head { cursor: grabbing; }
.sn-head-space { flex: 1; align-self: stretch; }
.sn-hbtn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #1f2937; cursor: pointer; }
.sn-hbtn:hover, .sn-hbtn:focus-visible { background: rgba(255, 255, 255, .45); outline: none; }
.sn-title { max-width: 55%; overflow: hidden; padding: 3px 6px; border-radius: 5px; font-size: 13.5px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; cursor: text; outline: none; }
.sn-title:hover { background: rgba(255, 255, 255, .35); }
.sn-title[contenteditable="true"] { background: rgba(255, 255, 255, .7); text-overflow: clip; }
.sn-color-dot { flex: none; width: 18px; height: 18px; margin-left: 2px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(15, 23, 42, .18); cursor: pointer; }
.sn-color-dot:focus-visible { outline: 2px solid #1f2937; outline-offset: 2px; }
.sn-main { position: relative; flex: 1; min-height: 0; }
.sn-body { position: absolute; inset: 0; overflow: auto; padding: 12px 14px; font-size: 14px; line-height: 1.55; outline: none; word-break: break-word; }
.sn-body:empty::before { content: attr(data-placeholder); color: rgba(31, 41, 55, .45); pointer-events: none; }
.sn-body img { display: inline-block; max-width: 100%; height: auto; margin: 4px 0; border-radius: 6px; cursor: pointer; }
.sn-body img.is-sel { outline: 2px solid #2563eb; outline-offset: 1px; }
/* Dòng có ô tích: ô vuông vẽ bằng ::before, bấm vào ô (24px đầu dòng) để tích / bỏ tích */
.sn-body .sn-check { position: relative; padding-left: 26px; }
.sn-body .sn-check::before { content: ""; position: absolute; left: 2px; top: .3em; width: 15px; height: 15px; border: 1.8px solid rgba(31, 41, 55, .55); border-radius: 4px; background: rgba(255, 255, 255, .7); cursor: pointer; }
.sn-body .sn-check[data-checked="1"]::before { border-color: #16a34a; background: #16a34a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 11px no-repeat; }
.sn-canvas { position: absolute; inset: 0; z-index: 2; cursor: crosshair; touch-action: none; }
.sn-note.is-drawing .sn-main { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--snc) 80%, #1f2937); }
.sn-img-handle { position: absolute; z-index: 3; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: #2563eb; box-shadow: 0 1px 4px rgba(15, 23, 42, .35); cursor: nwse-resize; touch-action: none; }
.sn-tools { display: flex; align-items: center; gap: 1px; flex: none; flex-wrap: wrap; padding: 4px 5px; border-top: 1px solid rgba(31, 41, 55, .1); border-radius: 0 0 8px 8px; }
.sn-tool { display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #1f2937; font-size: 15px; font-family: Georgia, "Times New Roman", serif; cursor: pointer; }
.sn-tool:hover, .sn-tool:focus-visible, .sn-tool[aria-pressed="true"] { background: rgba(255, 255, 255, .6); outline: none; }
.sn-tool[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px rgba(31, 41, 55, .5); }
.sn-tool:disabled { opacity: .4; cursor: not-allowed; }
.sn-tool-a { font-weight: 700; border-bottom: 3px solid var(--sn-fore); line-height: 1; padding-bottom: 1px; }
.sn-tool-sep { width: 1px; height: 18px; margin: 0 2px; background: rgba(31, 41, 55, .15); }
/* Viền / góc kéo đổi cỡ */
.sn-rz { position: absolute; z-index: 4; touch-action: none; }
.sn-rz-e { top: 8px; right: -4px; bottom: 8px; width: 8px; cursor: ew-resize; }
.sn-rz-w { top: 38px; left: -4px; bottom: 8px; width: 8px; cursor: ew-resize; }
.sn-rz-s { left: 8px; right: 8px; bottom: -4px; height: 8px; cursor: ns-resize; }
.sn-rz-se { right: -5px; bottom: -5px; width: 14px; height: 14px; cursor: nwse-resize; }
.sn-rz-sw { left: -5px; bottom: -5px; width: 14px; height: 14px; cursor: nesw-resize; }
/* Ô nổi trong tấm: màu, màu chữ, menu ⋯, nhắc lại */
.sn-pop { position: absolute; z-index: 6; min-width: 200px; max-width: 280px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 30px rgba(15, 23, 42, .2); color: var(--ink); }
.sn-pop-title { margin-bottom: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.sn-pop .cpick { max-width: 240px; }
.sn-pop-swatches { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.sn-sw { width: 22px; height: 22px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(15, 23, 42, .2); cursor: pointer; }
.sn-sw:hover, .sn-sw:focus-visible { transform: scale(1.12); outline: none; }
.sn-pop-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.sn-pop-menu { min-width: 220px; padding: 6px; }
.sn-mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.sn-mi span { display: flex; flex-direction: column; }
.sn-mi small { font-size: 11.5px; color: var(--muted); }
.sn-mi:hover, .sn-mi:focus-visible { background: var(--bg); outline: none; }
.sn-mi.is-danger { color: var(--danger-600); }
/* Danh sách ghi chú của dự án (như danh sách của Sticky Notes) */
#sn-list { position: absolute; top: 72px; right: 24px; display: flex; flex-direction: column; width: min(380px, calc(100vw - 32px)); max-height: min(78vh, 720px); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 44px rgba(15, 23, 42, .22); color: var(--ink); }
.sn-list-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; }
.sn-list-head .sn-hbtn { color: var(--ink-soft); }
.sn-list-head .sn-hbtn:hover, .sn-list-head .sn-hbtn:focus-visible { background: var(--bg); }
.sn-list-title { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.sn-list-title b { font-size: 17px; }
.sn-list-title small { overflow: hidden; font-size: 12px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.sn-list-search { display: flex; align-items: center; gap: 8px; margin: 4px 12px 10px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--muted); }
.sn-list-search input { flex: 1; min-width: 0; height: 36px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; outline: none; }
.sn-list-search:focus-within { border-color: var(--primary); }
.sn-list-body { display: flex; flex-direction: column; gap: 10px; overflow: auto; padding: 0 12px 12px; }
.sn-card { --snc: #facc15; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--border-soft); border-top: 4px solid var(--snc); border-radius: 8px; background: color-mix(in srgb, var(--snc) 10%, var(--surface)); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: box-shadow .2s ease, border-color .2s ease; }
.sn-card:hover, .sn-card:focus-visible { border-color: color-mix(in srgb, var(--snc) 60%, var(--border)); border-top-color: var(--snc); box-shadow: 0 6px 16px rgba(15, 23, 42, .1); outline: none; }
.sn-card.is-open { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--snc) 60%, transparent); }
.sn-card-top { display: flex; align-items: baseline; gap: 8px; }
.sn-card-top b { flex: 1; min-width: 0; overflow: hidden; font-size: 13.5px; white-space: nowrap; text-overflow: ellipsis; }
.sn-card-top small { flex: none; font-size: 11.5px; color: color-mix(in srgb, var(--snc) 55%, #713f12); }
.sn-card-text { display: -webkit-box; overflow: hidden; font-size: 13px; line-height: 1.5; white-space: pre-line; -webkit-line-clamp: 4; -webkit-box-orient: vertical; color: var(--ink-soft); }
.sn-card-text.is-empty { font-style: italic; color: var(--muted); }
.sn-list-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 12px; color: #ca8a04; text-align: center; }
.sn-list-empty b { color: var(--ink); }
.sn-list-empty p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.sn-open-count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: #fef9c3; color: #a16207; font-size: 11.5px; font-weight: 700; line-height: 18px; text-align: center; }
@media (max-width: 560px) { #sn-list { top: 64px; right: 16px; } }
@media (prefers-reduced-motion: reduce) { .sn-note.is-remind { animation: none; } .sn-card { transition: none; } }
/* Ghi chú bản nâng cấp: ô font, bảng bút trượt lên từ dưới thanh công cụ, thanh màu đỏ → tím, ảnh đặt tự do, thanh cuộn mảnh */
.sn-body { scrollbar-width: thin; scrollbar-color: rgba(31, 41, 55, .35) transparent; }
.sn-body::-webkit-scrollbar { width: 1px; height: 1px; }
.sn-body::-webkit-scrollbar-thumb { background: rgba(31, 41, 55, .4); }
.sn-body::-webkit-scrollbar-track { background: transparent; }
.sn-body img.sn-float { position: absolute; z-index: 1; margin: 0; cursor: move; -webkit-user-drag: none; user-select: none; touch-action: none; }
.sn-body img { -webkit-user-drag: none; }
/* Kéo ảnh giữa các dòng: ảnh mờ ở chỗ cũ, vạch xanh = chỗ sẽ thả */
.sn-body img:not(.sn-float) { cursor: grab; touch-action: none; }
.sn-body img.is-dragging { opacity: .45; }
.sn-note.is-img-drag, .sn-note.is-img-drag .sn-body, .sn-note.is-img-drag .sn-body img { cursor: grabbing; user-select: none; }
.sn-drop-line { position: absolute; left: 10px; right: 10px; z-index: 3; height: 3px; margin-top: -1.5px; border-radius: 2px; background: #2563eb; pointer-events: none; }
.sn-drop-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: #2563eb; }
/* Thanh công cụ: ô font hiện đủ tên font, các nút giữ nguyên cỡ; tấm hẹp thì nút rớt xuống hàng dưới */
.sn-tools { position: relative; z-index: 3; flex-wrap: wrap; background: color-mix(in srgb, var(--snc) 32%, #fff); }
.sn-tools > .sn-tool { flex: none; }
.sn-tools > .sn-font { flex: none; width: auto; }
.sn-font { width: auto; height: 28px; margin-right: 2px; padding: 0 4px; border: 1px solid rgba(31, 41, 55, .15); border-radius: 6px; background: rgba(255, 255, 255, .6); color: #1f2937; font: inherit; font-size: 12px; cursor: pointer; }
.sn-font:focus-visible { outline: 2px solid #1f2937; outline-offset: 1px; }
/* Khung cắt nằm ngay trên thanh công cụ: bảng bút ẩn bên dưới (khuất sau thanh công cụ), bấm Vẽ thì trượt lên */
.sn-pen-wrap { position: absolute; left: 0; right: 0; bottom: 100%; height: 50px; overflow: hidden; pointer-events: none; }
.sn-pen-panel { display: flex; align-items: center; gap: 8px; height: 46px; margin: 4px 6px 0; padding: 0 10px; border-radius: 10px 10px 0 0; background: #fff; box-shadow: 0 -4px 14px rgba(15, 23, 42, .12); transform: translateY(110%); visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s; }
.sn-note.is-pen .sn-pen-wrap { pointer-events: auto; }
.sn-note.is-pen .sn-pen-panel { transform: none; visibility: visible; transition: transform .28s ease, visibility 0s; }
.sn-cur-dot { flex: none; width: 22px; height: 22px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(15, 23, 42, .2); }
.sn-bw { flex: none; width: 18px; height: 18px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(15, 23, 42, .3); cursor: pointer; }
.sn-bw:hover, .sn-bw:focus-visible { transform: scale(1.15); outline: none; }
/* Thanh màu đỏ → tím (chỉ đổi sắc màu) */
.sn-hue { flex: 1; min-width: 70px; height: 10px; margin: 0; border-radius: 99px; background: linear-gradient(to right, hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%), hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%)); -webkit-appearance: none; appearance: none; cursor: pointer; }
.sn-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; background: transparent; box-shadow: 0 0 0 1px rgba(15, 23, 42, .35), 0 1px 4px rgba(15, 23, 42, .35); }
.sn-hue::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: transparent; box-shadow: 0 0 0 1px rgba(15, 23, 42, .35); }
.sn-size { flex: none; width: 64px; accent-color: #1f2937; cursor: pointer; }
.sn-stroke { flex: none; width: 200px; height: 24px; }
.sn-color-row { display: flex; align-items: center; gap: 10px; }
.sn-pop-text { min-width: 250px; }
/* AI tạo công việc từ ghi chú (notes.js snAiPopHTML) */
.sn-pop-ai { min-width: 250px; }
.sn-pop-title svg { vertical-align: -2px; color: var(--primary-600); }
.sn-ai-opt { display: flex; flex-direction: column; gap: 4px; width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); color: var(--ink); text-align: left; font: inherit; font-size: 13px; }
button.sn-ai-opt { cursor: pointer; }
button.sn-ai-opt:hover { background: var(--bg); }
.sn-ai-opt small { color: var(--ink-soft); font-size: 12px; }
.sn-ai-opt.is-form .form-control { width: 100%; font-size: 13px; }
.sn-ai-opt.is-form .btn-primary { align-self: flex-start; }
.sn-pop-hint.is-done { margin: 0 0 4px; padding: 6px 8px; border-radius: 6px; background: var(--success-50); color: var(--success-700); }
/* Danh sách: rê chuột vào thẻ thì ẩn giờ sửa, hiện nút ⋯ (Nhắc lại / Xóa) */
.sn-card { position: relative; }
.sn-card-more:hover, .sn-card-more:focus-visible { background: color-mix(in srgb, var(--snc) 22%, transparent); color: var(--ink); outline: none; }
/* Ô nổi của thẻ trong danh sách: vị trí cố định theo nút ⋯ (snPlaceListPop), không bị khung cuộn cắt */
.sn-lpop { position: fixed; cursor: default; }
@media (prefers-reduced-motion: reduce) { .sn-pen-panel { transition: none; } }
/* Hàng tiến độ dự án: thanh tiến độ rộng cố định, dòng "Hoàn thành x/y - Tiến độ z%", rồi nút Tài liệu + Ghi chú (notes.js) bên phải */
.project-progress-bar .project-progress { max-width: none; }
.project-progress-bar .progress-track { flex: 0 1 230px; min-width: 80px; }
.project-progress .sn-open-btn, .project-progress .plink-open-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; font-size: 12.5px; }
/* Nhắc lại (notes.js snMenuHTML / snBellBtnHTML): dòng menu "chuông · Nhắc lại · ô giờ nhỏ"; thẻ danh sách: giờ nhắc cùng hàng với
   thời gian sửa, rê chuột thì phần chữ mờ dần + trượt nhẹ (0,3 giây) nhường chỗ cho chuông bật / tắt và nút ⋯ */
.sn-mi-remind { cursor: default; }
.sn-mi-remind:hover { background: transparent; }
.sn-mi-remind > span:not(.sn-hm) { flex: 1; }
.sn-mi .sn-hm { flex-direction: row; }
.sn-mi-remind.is-off > span:not(.sn-hm) { color: var(--muted); }
/* Ô giờ nhắc 24 giờ: 2 ô số giờ : phút trong 1 khung, gõ đủ 2 số giờ tự sang phút */
.sn-hm { display: inline-flex; flex: none; align-items: center; gap: 1px; height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sn-hm:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); }
.sn-hm input { width: 20px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; text-align: center; outline: none; }
.sn-hm input:focus { background: var(--primary-50); }
.sn-mi-remind.is-off .sn-hm { color: var(--muted); background: var(--bg); }
.sn-bell { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; transition: background-color .2s ease, transform .2s ease; }
.sn-bell.is-on { color: #f59e0b; background: #fef3c7; }
.sn-bell.is-off { color: #94a3b8; background: #f1f5f9; }
.sn-bell:hover, .sn-bell:focus-visible { transform: scale(1.08); outline: none; }
.sn-bell.is-on:hover, .sn-bell.is-on:focus-visible { background: #fde68a; }
.sn-bell.is-off:hover, .sn-bell.is-off:focus-visible { background: #fee2e2; }
.sn-card-top { align-items: center; }
.sn-card-meta { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: flex-end; min-width: 64px; height: 28px; }
.sn-card-info { display: inline-flex; align-items: center; gap: 8px; transition: opacity .3s ease, transform .3s ease; }
.sn-card-info small { font-size: 11.5px; color: color-mix(in srgb, var(--snc) 55%, #713f12); white-space: nowrap; }
.sn-card-remind { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 99px; background: #fef3c7; color: #b45309; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sn-card-acts { position: absolute; top: 0; right: -4px; display: inline-flex; align-items: center; gap: 4px; opacity: 0; transform: translateX(6px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.sn-card-acts .sn-bell { width: 26px; height: 26px; }
.sn-card-more { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.sn-card:hover .sn-card-info, .sn-card:focus-within .sn-card-info, .sn-card.has-pop .sn-card-info { opacity: 0; transform: translateX(-6px); }
.sn-card:hover .sn-card-acts, .sn-card:focus-within .sn-card-acts, .sn-card.has-pop .sn-card-acts { opacity: 1; transform: none; pointer-events: auto; }
.sn-lpop.sn-pop-menu, .sn-pop.sn-pop-menu { min-width: 240px; }
@media (prefers-reduced-motion: reduce) { .sn-card-info, .sn-card-acts, .sn-bell { transition: none; } }
/* Danh sách ghi chú: cao tối đa 3 thẻ (notes.js đặt max-height), cuộn bằng thanh mảnh xám */
.sn-list-body { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.sn-list-body::-webkit-scrollbar { width: 4px; }
.sn-list-body::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--scroll-thumb); }
.sn-list-body::-webkit-scrollbar-track { background: transparent; }
/* Gói chưa có nhắc lại hằng ngày (Free): chuông xám có ổ khóa nhỏ, nhãn "Pro" thay cho ô giờ */
.sn-bell.is-locked { position: relative; color: #94a3b8; background: #f1f5f9; }
.sn-bell.is-locked:hover, .sn-bell.is-locked:focus-visible { background: #fef3c7; color: #b45309; }
.sn-bell-lock { position: absolute; right: -3px; bottom: -3px; display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border: 1.5px solid #fff; border-radius: 50%; background: #f59e0b; color: #fff; }
.sn-pro-badge { flex: none; padding: 2px 8px; border-radius: 99px; background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; }

/* ===== Vai trò: tab Quyền hạn / Hiển thị / Thành viên (Đợt 4) + @Tên theo màu vai trò ===== */
/* @Người / @Vai trò có màu: chữ theo màu vai trò, nền nhạt cùng màu (đặt sau các luật .mention khác để thắng) */
.mention[style*="--mc"],
#task-detail-overlay .comment-text .mention[style*="--mc"] { color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, transparent); }
.mention-role-icon { display: inline-flex; flex-shrink: 0; }
.role-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin: 0 0 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.role-tab { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-soft); padding: 8px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.role-tab:hover { background: var(--bg); }
.role-tab.is-on { color: var(--primary-600); border-bottom-color: var(--primary); }
.role-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.perm-tools .role-views { flex-shrink: 0; }
/* Ô tìm quyền: bên phải, ngắn */
.perm-tools .perm-search { flex: 0 1 260px; margin-left: auto; }
/* Tab Hiển thị */
.role-disp { display: flex; flex-direction: column; gap: 16px; max-width: 620px; }
.role-disp-name { display: flex; gap: 8px; }
.role-disp-name .form-control { flex: 1; min-width: 0; }
.role-swatch-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.role-swatch-big { position: relative; width: 96px; height: 64px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-swatch-big.is-none { color: var(--muted); background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 6px, var(--surface) 6px, var(--surface) 12px); }
.role-swatch-big:disabled { cursor: not-allowed; opacity: 0.6; }
.role-swatch-pen { position: absolute; top: 6px; right: 6px; }
.role-swatches { display: grid; grid-template-columns: repeat(10, 28px); gap: 8px; }
.role-swatch { width: 28px; height: 28px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.role-swatch.is-on { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface); }
.role-swatch:disabled { cursor: not-allowed; opacity: 0.5; }
.role-swatch:focus-visible, .role-swatch-big:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.role-disp-picker { margin-top: 12px; max-width: 320px; }
/* Tab Thành viên */
.role-mem { display: flex; flex-direction: column; gap: 12px; }
.role-mem-tools { display: flex; gap: 8px; align-items: center; }
.role-mem-tools .btn-primary { flex-shrink: 0; }
.role-mem-addbox { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--bg); }
.role-mem-list { display: flex; flex-direction: column; }
.role-mem-addbox .role-mem-list { max-height: 260px; overflow-y: auto; }
.role-mem-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; min-height: 48px; }
.role-mem-row:hover { background: var(--bg); }
.role-mem-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.role-mem-text b, .role-mem-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-mem-text small { color: var(--muted); }
.role-mem-remove { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--bg); color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.role-mem-remove:hover:not(:disabled) { background: var(--border-soft); color: var(--danger); }
.role-mem-remove:disabled, .role-mem-add:disabled { cursor: not-allowed; opacity: 0.45; }
@media (max-width: 640px) {
  .role-swatches { grid-template-columns: repeat(5, 28px); }
  .role-mem-tools, .perm-tools { flex-wrap: wrap; }
  .role-disp-name { flex-direction: column; }
}
.chat-mention[style*="--mc"]:not(.is-me) { color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, transparent); }
/* Bố cục đề xuất: khung phải cao cố định ở mọi tab (Hiển thị / Thành viên ít nội dung không làm khung co lại); nội dung dài thì cuộn trong khung */
@media (min-width: 761px) {
  .roles-split .role-card.is-split { display: flex; flex-direction: column; height: calc(80vh + 150px); }
  .role-card.is-split .role-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
  .role-card.is-split .role-pane > .box-role-perms { flex: 1; min-height: 0; height: auto; }
}
/* Tab Quản lý thành viên theo mẫu: ô tìm + nút Thêm cao 40px cùng hàng; mỗi người 1 dòng (ảnh 24px · tên đậm · email mờ cùng hàng · ✕ tròn xám) */
.role-mem { gap: 14px; }
.role-mem-tools { gap: 16px; }
.role-mem-tools .perm-search { height: 40px; border-radius: 8px; }
.role-mem-tools .perm-search input { height: 38px; font-size: 15px; }
.role-mem-tools .btn-primary { height: 36px; padding: 0 16px; border-radius: 8px; font-weight: 600; }
.role-mem-list { gap: 2px; }
.role-mem-row { gap: 10px; min-height: 42px; padding: 6px 8px; }
.role-mem-row .avatar { width: 24px; height: 24px; min-width: 24px; font-size: 10px; }
.role-mem-text { flex-direction: row; align-items: baseline; gap: 6px; }
.role-mem-text b { font-size: 14.5px; font-weight: 700; flex-shrink: 0; max-width: 60%; }
.role-mem-text small { font-size: 14px; }
.role-mem-remove { width: 20px; height: 20px; background: var(--muted); color: var(--surface); margin-right: 14px; }
.role-mem-remove svg { width: 11px; height: 11px; }
.role-mem-remove:hover:not(:disabled) { background: var(--danger); color: #fff; }
/* Quản lý thành viên (chỉnh theo mẫu): ảnh 36px, tên lớn + đậm hơn, nút gỡ tròn 18px màu xám nhạt với chữ X đậm màu tối nằm chính giữa */
.role-mem-row { min-height: 50px; gap: 12px; }
.role-mem-row .avatar { width: 36px; height: 36px; min-width: 36px; font-size: 13px; }
.role-mem-text b { font-size: 15.5px; font-weight: 800; }
.role-mem-remove { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; line-height: 0; background: #b5bac1; color: #232428; }
.role-mem-remove svg { display: block; width: 12px; height: 12px; }
.role-mem-remove:hover:not(:disabled) { background: var(--danger); color: #fff; }
/* Nút gỡ: hình X phủ kín ô tròn (vẽ đối xứng quanh tâm 9,9) -> luôn nằm chính giữa ở mọi cỡ chữ / thu phóng (màu: xem luật cuối file) */
.role-mem-remove { position: relative; color: var(--danger); }
.role-mem-remove svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Vai trò "Trưởng nhóm <tên>": khung giải thích + nút mở trang nhóm; dòng người chỉ xem (nhãn Trưởng nhóm thay nút gỡ) */
.role-lead-note { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink-soft); }
.role-lead-note > svg { flex-shrink: 0; color: var(--primary); }
.role-lead-note > div { flex: 1; min-width: 0; }
.role-lead-note b { display: block; color: var(--ink); font-size: 14px; }
.role-lead-note p { margin: 2px 0 0; font-size: 13px; }
.role-lead-note .btn-primary { flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 8px; }
.role-mem-tag { flex-shrink: 0; margin-right: 6px; padding: 2px 10px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); font-size: 12px; font-weight: 700; }
@media (max-width: 640px) { .role-lead-note { flex-wrap: wrap; } }
/* Nút gỡ người khỏi vai trò: cùng bảng màu nhãn ưu tiên "Cao" — nền đỏ nhạt, X + viền đỏ đậm; rê chuột = nền đỏ đậm, X trắng */
.role-mem-remove { background: var(--danger-50); color: var(--danger-600); border: 1px solid var(--danger-600); }
.role-mem-remove:hover:not(:disabled) { background: var(--danger-600); color: #fff; border-color: var(--danger-600); }
.role-mem-remove:disabled { background: var(--bg); color: var(--muted); border-color: var(--border); }
/* Nút xóa / gỡ dùng chung 1 kiểu (bảng màu nhãn ưu tiên "Cao"): ✕ gỡ người khỏi vai trò.
   Nền đỏ nhạt, biểu tượng + viền đỏ đậm; rê chuột = nền đỏ đậm loang từ tâm ra ngoài trong 0,3 giây (lớp ::before phóng to), biểu tượng chuyển trắng */
.role-mem-remove {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--danger-50); color: var(--danger-600); border: 1px solid var(--danger-600);
  transition: color 0.3s ease, box-shadow 0.3s ease;
}
.role-mem-remove::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--danger-600); transform: scale(0); transition: transform 0.3s ease;
}
.role-mem-remove:hover:not(:disabled), .role-mem-remove:focus-visible {
  background: var(--danger-50); color: #fff; border-color: var(--danger-600); box-shadow: none; outline: none;
}
.role-mem-remove:hover:not(:disabled)::before, .role-mem-remove:focus-visible::before { transform: scale(1); }
.role-mem-remove:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--danger-600); }
.role-mem-remove:disabled { background: var(--bg); color: var(--muted); border-color: var(--border); }
.role-mem-remove:disabled::before { display: none; }
@media (prefers-reduced-motion: reduce) {
  .role-mem-remove,
  .role-mem-remove::before { transition: none; }
}
/* Lấp đường viền trắng mảnh do khử răng cưa ở mép bo góc: loang xong (0,3 giây) thì nền của nút cũng thành đỏ đậm; rời chuột thì trả ngay */
.role-mem-remove { transition: color 0.3s ease, box-shadow 0.3s ease, background-color 0s; }
.role-mem-remove:hover:not(:disabled) {
  background-color: var(--danger-600); transition: color 0.3s ease, box-shadow 0.3s ease, background-color 0s linear 0.3s;
}
/* Thùng rác trên thẻ Kanban: nhỏ, cao bằng ô đếm tệp / bình luận bên cạnh (--kb-chip-h), không viền; nền đỏ nhạt,
   rê chuột = nền đỏ đậm + biểu tượng trắng, đổi màu thường 0,2 giây */
.task-card-actions .task-delete-btn {
  width: var(--kb-chip-h, 26px); height: var(--kb-chip-h, 26px); padding: 0; border: 0; border-radius: var(--radius-pill);
  background: var(--danger-50); color: var(--danger-600); transition: background-color 0.2s ease, color 0.2s ease;
}
.task-card-actions .task-delete-btn svg { width: 13px; height: 13px; }
.task-card-actions .task-delete-btn:hover, .task-card-actions .task-delete-btn:focus-visible { background: var(--danger-600); color: #fff; outline: none; }
.task-card-actions .task-delete-btn:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--danger-600); }
@media (prefers-reduced-motion: reduce) { .task-card-actions .task-delete-btn { transition: none; } }


/* Khung chú thích khi bấm biểu đồ ở Báo cáo tổng quát (reports.js repPop*): nổi cạnh phần vừa bấm, mũi nhọn chỉ vào */
.rep-pop { position: fixed; z-index: 45; width: 372px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); color: var(--ink); font-size: 13.5px; }
.rep-pop[hidden] { display: none; }
.rep-pop::before { content: ""; position: absolute; width: 12px; height: 12px; border: 1px solid var(--border); background: var(--surface); transform: rotate(45deg); }
.rep-pop[data-side="right"]::before { left: -7px; top: calc(var(--rep-pop-arrow) - 6px); border-top: 0; border-right: 0; }
.rep-pop[data-side="left"]::before { right: -7px; top: calc(var(--rep-pop-arrow) - 6px); border-bottom: 0; border-left: 0; }
.rep-pop[data-side="bottom"]::before { top: -7px; left: calc(var(--rep-pop-arrow) - 6px); border-right: 0; border-bottom: 0; }
.rep-pop[data-side="top"]::before { bottom: -7px; left: calc(var(--rep-pop-arrow) - 6px); border-top: 0; border-left: 0; }
.rep-pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 10px 8px 16px; }
.rep-pop-head small { display: block; margin-bottom: 2px; font-size: 11.5px; color: var(--muted); }
.rep-pop-head b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.rep-pop-head b .avatar { width: 24px; height: 24px; font-size: 11px; }
.rep-pop-x { width: 28px; height: 28px; flex: none; }
.rep-pop-vals { display: flex; flex-direction: column; gap: 6px; padding: 0 16px 12px; border-bottom: 1px solid var(--border-soft); }
.rep-pop-val { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 40px; align-items: center; gap: 8px; }
.rep-pop-val i { width: 12px; height: 12px; border-radius: 3px; }
.rep-pop-val span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rep-pop-val b { font-size: 15px; text-align: right; }
.rep-pop-val small { color: var(--muted); text-align: right; }
.rep-pop-note, .rep-pop-empty { margin: 10px 16px 0; font-size: 12.5px; color: var(--muted); }
.rep-pop-sec { min-height: 0; overflow: auto; padding: 10px 8px 4px; scrollbar-width: thin; }
.rep-pop-sec-title { padding: 0 8px 4px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.rep-pop-tasks { display: flex; flex-direction: column; }
.rep-pop-task { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 6px 8px; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.rep-pop-task:hover, .rep-pop-task:focus-visible { background: var(--bg); }
.rep-pop-tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rep-pop-tsub { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 12px; color: var(--muted); }
.rep-pop-tsub span { overflow: hidden; text-overflow: ellipsis; }
.rep-pop-tsub span::before { content: "·"; margin-right: 6px; color: var(--muted); }
.rep-pop-tsub .is-late { color: var(--danger-600); }
.rep-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 16px 12px; border-top: 1px solid var(--border-soft); margin-top: 4px; }
.rep-pop-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.rep-pop-btn { padding: 6px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.rep-pop-btn:hover { background: var(--bg); }
.rep-pop-btn.is-primary { border-color: var(--primary-600); color: var(--primary-600); }
.rep-pop-btn.is-primary:hover { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.rep-pop[data-side="sheet"] { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: none; max-height: 70vh; border-radius: 16px 16px 0 0; }
.rep-pop[data-side="sheet"]::before { display: none; }
/* Phần biểu đồ đang chọn: có viền, phần khác giữ nguyên màu */
#view-reports .rep-stack button.is-picked { box-shadow: inset 0 0 0 2px var(--ink); }
#view-reports .rep-legend-pill.is-picked { box-shadow: 0 0 0 2px var(--c); }
#view-reports .rep-week.is-picked, #view-reports .rep-age-col.is-picked { border-radius: 10px; background: var(--bg); box-shadow: 0 0 0 2px var(--primary); }
#view-reports .rep-pbar-row.is-picked { background: var(--bg); box-shadow: inset 0 0 0 2px var(--primary); }
#view-reports .rep-cap-dot.is-picked { transform: scale(1.5); background: var(--primary-600); }

/* Workload nâng cao (Đợt 6, reports.js): khoảng 3 tháng / ±3 tháng, dải tháng, đổi cỡ cột ngày, cột hẹp, trùng ngày nghỉ */
.wlb-col { width: var(--wl-day); }
.wlb-days-head { flex-direction: column; padding: 0; }
.wlb-dline { display: flex; padding: 4px 0; }
.wlb-mband { display: flex; border-bottom: 1px solid var(--border-soft); }
.wlb-month { flex: none; min-width: 0; padding: 5px 0 4px; border-left: 1px solid var(--border-soft); font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.wlb-month:first-child { border-left: 0; }
.wlb-month span { position: sticky; left: calc(var(--wl-left) + 8px); padding: 0 8px; }
.wlb-dayh { position: relative; }
.wlb-dayh-rs { position: absolute; top: 0; bottom: 0; right: -3px; z-index: 2; width: 7px; cursor: col-resize; touch-action: none; }
.wlb-dayh-rs::after { content: ""; position: absolute; top: 6px; bottom: 6px; left: 3px; width: 1px; background: transparent; }
.wlb-dayh:hover .wlb-dayh-rs::after, .wlb.is-dragging .wlb-dayh-rs::after { background: var(--border); }
.wlb-dayh-rs:hover::after { background: var(--primary) !important; }
.wlb.is-narrow .wlb-dayh, .wlb.is-tiny .wlb-dayh { padding: 8px 0; }
.wlb.is-narrow .wlb-hol-tag, .wlb.is-tiny .wlb-hol-tag { display: none; }
.wlb.is-narrow .wlb-cellwrap { padding: 0 2px; }
.wlb.is-narrow .wlb-cell-h { font-size: 10.5px; }
.wlb.is-tiny .wlb-cellwrap { padding: 0 1px; }
.wlb.is-tiny .wlb-cell-h { display: none; }
.wlb.is-tiny .wlb-badge { top: -4px; right: -3px; min-width: 9px; height: 9px; padding: 0; font-size: 0; }
.wlb .gantt-drag-tip.is-warn { background: #b45309; }
.wlb-lane-links .wf-link-btn.is-warn { color: #b45309; font-weight: 600; }

/* Workload kiểu ClickUp (Đợt 6, bản 2): thanh công cụ gọn đồng nhất, góc trái = khoảng đang thấy + ‹ ›, tiêu đề "T2 26", nút + − nổi mép phải */
.wl-toolbar { gap: 6px 10px; }
.wl-toolbar .report-filters { gap: 6px; flex-wrap: wrap; }
.wl-toolbar :is(.btn-secondary, .form-control, .report-select, .wl-tb-select, select) { height: 30px; min-height: 30px; padding-top: 0; padding-bottom: 0; border: 1px solid var(--border); border-radius: 6px; background-color: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink); box-shadow: none; }
.wl-toolbar :is(.btn-secondary, .form-control, .report-select, .wl-tb-select, select):hover:not(:disabled) { background-color: var(--bg); }
.wl-toolbar .wl-tb-select { padding: 0 26px 0 10px; }
.wl-toolbar .wl-pick .form-control { width: 140px; }
.wl-toolbar .wl-today { font-weight: 600; }
.wlb-corner { flex-direction: row; align-items: flex-end; justify-content: flex-end; gap: 4px; padding-bottom: 8px; }
.wlb-vrange { margin-right: 6px; font-size: 13px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.wlb-corner .icon-btn { width: 26px; height: 26px; border: 0; background: transparent; color: var(--ink-soft); }
.wlb-corner .icon-btn:hover { background: var(--border-soft); color: var(--ink); }
.wlb-corner .wl-next svg { transform: rotate(180deg); }
.wlb-mband { border-bottom: 0; }
.wlb-month { padding: 8px 0 2px; border-left: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.wlb-month span { padding: 0 12px; }
.wlb-dayh { gap: 5px; font-size: 13px; }
.wlb-dayh .wl-th-dow { font-size: 12.5px; color: var(--muted); }
.wl-th-dnum { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 3px; border-radius: var(--radius-pill); font-weight: 600; color: var(--ink); }
.wlb-dayh.is-today .wl-th-dnum { background: var(--danger-600); color: #fff; }
.wlb-dayh.is-today .wl-th-dow { color: var(--ink); font-weight: 700; }
.wlb.is-narrow .wlb-dayh { gap: 2px; font-size: 12px; }
.wlb.is-narrow .wlb-dayh .wl-th-dow { font-size: 11px; }
.wlb.is-tiny .wlb-dayh .wl-th-dow { display: none; }
.wlb-zoom { position: absolute; top: 78px; right: 12px; z-index: 6; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.wlb-zoom button { width: 28px; height: 28px; border: 0; background: transparent; font: inherit; font-size: 16px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.wlb-zoom button + button { border-top: 1px solid var(--border-soft); }
.wlb-zoom button:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.wlb-zoom button:disabled { color: var(--muted); cursor: default; }
@media (max-width: 760px) { .wlb-zoom { display: none; } }
/* Khoảng tính mức sử dụng (như Utilization Overview của ClickUp): nút ở góc trái, menu nổi, dải xanh trên hàng ngày */
.wlb-util { position: relative; margin-right: auto; }
.wlb-vrange { display: inline-flex; align-items: center; gap: 4px; height: 26px; margin: 0; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.wlb-vrange:hover, .wlb-vrange[aria-expanded="true"] { background: var(--border-soft); color: var(--ink); }
.wlb-vrange-caret { transform: rotate(-90deg); }
.wlb-util-pop { position: fixed; z-index: 60; width: 310px; padding: 8px 0 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); text-align: left; }
.wlb-util-title { padding: 6px 16px 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.wlb-util-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 16px; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); text-align: left; cursor: pointer; }
.wlb-util-item:hover, .wlb-util-item:focus-visible { background: var(--bg); }
.wlb-util-item.is-on svg { color: var(--primary-600); }
.wlb-util-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--border-soft); font-size: 13px; color: var(--ink-soft); }
.wlb-util-modes { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--bg); }
.wlb-util-modes button { display: inline-grid; place-items: center; width: 30px; height: 26px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.wlb-util-modes button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.wlb-dayh.is-util { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--primary) 22%, var(--surface)); }
.wlb-dayh.is-util-s { border-top-left-radius: 8px; }
.wlb-dayh.is-util-e { border-top-right-radius: 8px; }
.wlb-chip-bar { display: inline-block; width: 52px; height: 8px; border-radius: 999px; background: var(--border-soft); overflow: hidden; vertical-align: middle; }
.wlb-chip-bar i { display: block; height: 100%; border-radius: inherit; background: #34d399; }
.wlb-chip-bar.is-full i { background: #3b82f6; }
.wlb-chip-bar.is-over i { background: var(--danger-600); }
.wlb-util-foot > span:first-child { white-space: nowrap; }
.wlb-dline .wlb-dayh { cursor: pointer; }
.wlb-dline .wlb-dayh:hover:not(.is-util) { background: var(--border-soft); }
.wlb-dline .wlb-dayh.is-util:hover { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
/* Cách nhóm giờ trên Workload (như Workload Grouping của ClickUp, reports.js WL_GROUPS / wlGroupCellsHTML) */
.wl-group { position: relative; display: inline-flex; }
.wl-group-btn .wlb-vrange-caret { margin-left: 2px; }
.wl-group-pop { width: 340px; }
.wl-group-item { align-items: flex-start; }
.wl-group-item > span { display: flex; flex-direction: column; gap: 2px; }
.wl-group-item b { font-size: 14px; font-weight: 600; }
.wl-group-item small { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.wl-group-item svg { flex: none; margin-top: 3px; }
.wlb-cellwrap.is-span { flex: none; }
.wlb-cellwrap.is-span .wlb-cell { white-space: nowrap; overflow: hidden; }
.wlb-cell-pct { font-size: 11.5px; font-weight: 600; opacity: 0.8; }
/* Khung xem nhanh khi rê chuột lên ô giờ Workload (reports.js wlHoverCardShow) — cùng giao diện khung chi tiết, chỉ xem */
.wlb-tip.is-hover { width: 260px; z-index: 46; pointer-events: none; }
.wlb-tip.is-hover[hidden] { display: none; }
.wlb-tip-line.is-free { border-left-color: #34d399; }
.wlb-tip-task { justify-content: flex-start; }
.wlb-tip-task span { flex: 1; min-width: 0; }
.wlb-tip-dot { flex: none; width: 3px; height: 16px; border-radius: 2px; }

/* Workload — thanh công cụ gọn (chủ dự án chốt 10/2026): cụm 3 nút thả xuống bên trái, 3 nút chính bên phải */
.wl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.wl-tb-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wl-tb-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; cursor: pointer; }
.wl-tb-btn > svg:first-child { color: var(--ink-soft); }
.wl-tb-btn:hover:not(:disabled), .wl-tb-btn[aria-expanded="true"] { background: var(--bg); }
.wl-tb-btn:disabled { cursor: default; opacity: 0.7; }
.wl-tb-btn .wlb-vrange-caret { margin-left: 6px; color: var(--muted); }
.wl-tb-btn.is-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.wl-tb-btn.is-primary > svg:first-child { color: #fff; }
.wl-tb-btn.is-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.wl-tb-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger-600); color: #fff; font-size: 11.5px; }
.wl-tb-range { font-variant-numeric: tabular-nums; }
.wl-dd { position: relative; }
.wl-dd-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 250px; max-height: min(70vh, 520px); overflow: auto; padding: 6px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); }
.wl-dd-pop.is-date { width: 270px; padding: 12px 14px; }
.wl-dd-pop.is-date .wl-dd-title { padding: 0 0 6px; }
.wl-dd-pop.is-date input { width: 100%; }
.wl-dd-title { display: block; padding: 10px 14px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.wl-dd-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 14px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; }
.wl-dd-item > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wl-dd-item > span:has(> svg), .wl-dd-item > span:has(> .project-dot) { flex-direction: row; align-items: center; gap: 8px; }
.wl-dd-item b { font-weight: 600; }
.wl-dd-item small { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.wl-dd-item:hover:not(:disabled), .wl-dd-item:focus-visible { background: var(--bg); }
.wl-dd-item:disabled { color: var(--muted); cursor: default; }
.wl-dd-item.is-on > svg { flex: none; color: var(--primary-600); }
.wl-dd-hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
/* Cột tên dính trái luôn nằm trên thanh việc (rê / kéo thanh không đè lên cột trái); hàng ngày dính trên nằm trên cùng */
.wlb .wlb-left { z-index: 5; }
.wlb .wlb-head { z-index: 7; }
/* Thanh việc: nền màu NHẠT của trạng thái + vạch trạng thái bên trái (chữ luôn đậm, dễ đọc) */
.wlb-bar, .wlb-bar.is-noest { background: color-mix(in srgb, var(--bc) 16%, var(--surface)); border-color: color-mix(in srgb, var(--bc) 45%, var(--surface)); box-shadow: inset 3px 0 0 var(--bc); }
.wlb-bar.is-parent, .wlb-bar.is-parent.is-noest { background: color-mix(in srgb, var(--bc) 24%, var(--surface)); border-color: color-mix(in srgb, var(--bc) 55%, var(--surface)); }
.wlb-bar.is-sub, .wlb-bar.is-sub.is-noest { background: color-mix(in srgb, var(--bc) 10%, var(--surface)); border-color: color-mix(in srgb, var(--bc) 35%, var(--surface)); }
.wlb-bar:hover, .wlb-bar:focus-visible { background: color-mix(in srgb, var(--bc) 24%, var(--surface)); }
.wlb-bar.is-overdue { box-shadow: inset 3px 0 0 var(--danger-600); }
.wlb-bar-eye { display: none; flex: none; place-items: center; width: 22px; height: 22px; margin-right: -2px; border-radius: 5px; color: var(--ink-soft); cursor: pointer; }
.wlb-bar:hover .wlb-bar-eye, .wlb-bar:focus-visible .wlb-bar-eye { display: inline-grid; }
.wlb-bar-eye:hover { background: color-mix(in srgb, var(--bc) 30%, var(--surface)); color: var(--ink); }
/* Thẻ xem nhanh việc (bấm con mắt) */
.wl-peek { position: fixed; z-index: 47; width: 380px; max-width: calc(100vw - 16px); padding: 14px 14px 14px 16px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-md); }
.wl-peek[hidden] { display: none; }
.wl-peek-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wl-peek-status { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.wl-peek-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.wl-peek-chip.is-done { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.wl-peek-chip.is-late { border-color: color-mix(in srgb, var(--danger-600) 40%, transparent); color: var(--danger-600); }
.wl-peek-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.wl-peek-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wl-peek-name { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.wl-peek-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.wl-peek-right { display: flex; flex: none; align-items: center; gap: 4px; }
.wl-peek-avatars { display: inline-flex; }
.wl-peek-none { font-size: 12px; color: var(--muted); }
.wl-peek-more { width: 30px; height: 30px; border: 0; background: transparent; color: var(--ink-soft); }
.wl-peek-more:hover { background: var(--bg); color: var(--ink); }
/* Thẻ xem nhanh việc — bản gọn (dài hơn, chữ nhỏ hơn, dự án cùng hàng trạng thái ở góc phải, tên sửa tại chỗ) */
.wl-peek { width: 440px; padding: 12px 12px 12px 14px; }
.wl-peek-top { flex-wrap: nowrap; gap: 6px; }
.wl-peek-status, .wl-peek-chip { flex: none; height: 22px; padding: 0 8px; gap: 4px; font-size: 11.5px; }
.wl-peek-proj { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 50%; margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.wl-peek-proj .project-dot { flex: none; }
.wl-peek-proj { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wl-peek-main { margin-top: 8px; gap: 10px; }
.wl-peek-text { flex: 1; gap: 3px; }
.wl-peek-name { font-size: 14px; line-height: 1.35; }
button.wl-peek-name { display: block; width: 100%; margin: -2px 0 -2px -4px; padding: 2px 4px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); text-align: left; cursor: text; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
button.wl-peek-name:hover, button.wl-peek-name:focus-visible { background: var(--bg); }
.wl-peek-input { width: 100%; height: 28px; padding: 0 8px; border: 1px solid var(--primary); border-radius: 6px; background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.wl-peek-input.is-error { border-color: var(--danger-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-600) 15%, transparent); }
.wl-peek-err { font-size: 11.5px; color: var(--danger-600); }
.wl-peek-sub { gap: 5px; font-size: 11.5px; }
.wl-peek-sub svg { flex: none; }
.wl-peek-right { gap: 2px; }
.wl-peek-avatars .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.wl-peek-avatars .avatar-stack + .avatar-stack { margin-left: -6px; }
.wl-peek-more { width: 28px; height: 28px; }

/* ===== Workload bản thiết kế 10/2026 (reports.js: wlStatsHTML, wlTrayHTML, wlLevel, wlTotalRowHTML, wlToggleFull) ===== */
/* Phóng to toàn màn hình (như tab Quy trình): cả thanh công cụ + thẻ số liệu + bảng + khay */
.wl-shell.is-full { position: fixed; inset: 0; z-index: 50; overflow: auto; padding: 12px 16px; background: var(--bg); }

body.wl-fullscreen-open { overflow: hidden; }
.wlb-full { position: absolute; top: 6px; right: 10px; z-index: 8; width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--ink-soft); }
.wlb-full:hover { background: var(--bg); color: var(--ink); }
.wl-tb-btn.wl-tb-icon { width: 34px; padding: 0; justify-content: center; }
.wl-tb-btn.wl-tb-icon.is-on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary-600); }
/* 4 thẻ số liệu */
.wl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.wl-stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 14px; border-radius: 12px; }
.wl-stat[role="button"] { cursor: pointer; }
.wl-stat[role="button"]:hover { filter: brightness(0.98); }
.wl-stat-label { font-size: 12px; font-weight: 600; }
.wl-stat-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.wl-stat-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wl-stat-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.wl-stat.is-blue { background: #eaf6ff; }
.wl-stat.is-blue .wl-stat-label, .wl-stat.is-blue b { color: #0369a1; }
.wl-stat.is-red { background: #fff1f3; }
.wl-stat.is-red .wl-stat-label, .wl-stat.is-red b { color: #be123c; }
.wl-stat.is-yellow { background: #fffbeb; }
.wl-stat.is-yellow .wl-stat-label, .wl-stat.is-yellow b { color: #b45309; }
.wl-stat.is-green { background: #ecfdf5; }
.wl-stat.is-green .wl-stat-label, .wl-stat.is-green b { color: #047857; }
@media (max-width: 900px) { .wl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Bảng + khay bên phải */
.wl-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.wl-main.has-tray { grid-template-columns: minmax(0, 1fr) 280px; }
.wl-main-board { min-width: 0; }
@media (max-width: 1000px) { .wl-main.has-tray { grid-template-columns: minmax(0, 1fr); } }
/* Góc trái: Thành viên · n + sắp xếp */
.wlb-corner { align-items: center; justify-content: space-between; gap: 6px; padding: 0 10px; }
.wlb-corner-title { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.wlb-sort { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); font: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; cursor: pointer; }
.wlb-sort:hover { color: var(--ink); border-color: var(--ink-soft); }
/* Hàng ngày: số ngày ở trên, thứ ở dưới; vạch ngang ngăn với dải tháng */
.wlb-dline { border-top: 1px solid var(--border); }
.wlb-dline .wlb-dayh { flex-direction: column; justify-content: center; gap: 1px; padding: 4px 0; }
.wlb-dline .wlb-dayh .wl-th-dnum { min-width: 22px; height: 20px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.wlb-dline .wlb-dayh .wl-th-dow { font-size: 10.5px; line-height: 1; }
.wlb.is-tiny .wlb-dline .wlb-dayh .wl-th-dow { display: inline; font-size: 9.5px; }
/* Cột trái mỗi người: mũi tên gọn · ảnh · tên + chức danh · thanh giờ */
.wlb .wlb-left.wlb-person { gap: 8px; padding: 6px 10px 6px 4px; }
.wlb .wlb-caret { width: 20px; height: 20px; border: 0; background: transparent; }
.wlb .wlb-caret:hover, .wlb .wlb-caret:focus-visible { background: var(--bg); }
.wlb-person .wlb-caret svg { transform: none; }
.wlb-person .wlb-caret.is-open svg { transform: rotate(90deg); }
.wlb-person .avatar { flex: none; width: 30px; height: 30px; font-size: 11.5px; }
.wlb-pinfo { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wlb-pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.wlb-prole { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); }
.wlb-pload { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding: 2px 4px; border: 0; border-radius: 6px; background: transparent; font: inherit; cursor: pointer; }
.wlb-pload:hover { background: var(--bg); }
.wlb-pload-h { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wlb-pload-h b { color: var(--ink); }
.wlb-pbar { display: block; width: 64px; height: 4px; border-radius: 999px; background: var(--border-soft); overflow: hidden; }
.wlb-pbar i { display: block; height: 100%; border-radius: inherit; background: #10b981; }
.wlb-pload.is-warn .wlb-pbar i { background: #f59e0b; }
.wlb-pload.is-over .wlb-pbar i { background: var(--danger-600); }
.wlb-pload.is-over .wlb-pload-h b { color: var(--danger-600); }
.wlb-pload.is-off .wlb-pbar i { background: var(--muted); }
/* Ô giờ: trống = viền mảnh; có giờ = chip 4 mức; chữ số cùng độ rộng, số 0 có gạch (không nhầm chữ O) */
.wlb-cell { font-variant-numeric: tabular-nums slashed-zero; }
.wlb-cell.lv-empty { border: 1px solid var(--border-soft); background: transparent; }
.wlb-cell.lv-empty:hover, .wlb-cell.lv-empty.is-open { background: var(--bg); box-shadow: none; }
.wlb-cell.lv-l1 { border-color: #d3efdc; background: #eaf7ef; color: #3f8a5e; }
.wlb-cell.lv-l2 { border-color: #a6dbb7; background: #c3e8cf; color: #276a43; }
.wlb-cell.lv-l3 { border-color: #6fc593; background: #94d6ae; color: #1b5532; }
.wlb-cell.lv-over { border-color: #fda4af; background: #ffe4e8; color: #be123c; }
/* Hàng tổng cuối bảng (dính đáy khung cuộn) */
.wlb-totals { position: sticky; bottom: 0; z-index: 4; border-top: 1px solid var(--border); border-bottom: 0; background: var(--surface); }
.wlb-totals .wlb-left { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
.wlb-totals .wlb-left b { font-size: 12.5px; }
.wlb-totals .wlb-left small { font-size: 11px; color: var(--muted); }
.wlb-totals .wlb-days { background: var(--surface); }
.wlb-totals .wlb-cellwrap { display: grid; place-items: center; min-height: 34px; }
.wlb-total-h { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums slashed-zero; }
/* Chú giải dưới bảng */
.wl-legend { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 8px 4px 0; font-size: 12px; color: var(--muted); }
.wl-lg-keys { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.wl-lg-keys b { color: var(--ink-soft); }
.wl-lg-key { display: inline-flex; align-items: center; gap: 5px; }
.wl-lg-key i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid transparent; }
.wl-lg-key.lv-empty i { border-color: var(--border); }
.wl-lg-key.lv-l1 i { background: #eaf7ef; border-color: #d3efdc; }
.wl-lg-key.lv-l2 i { background: #c3e8cf; }
.wl-lg-key.lv-l3 i { background: #94d6ae; }
.wl-lg-key.lv-over i { background: #ffe4e8; border-color: #fda4af; }
/* Khay bên phải */
.wl-tray { display: flex; flex-direction: column; gap: 10px; max-height: 80vh; overflow: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; animation: wlTrayIn 0.2s ease-out; }
@keyframes wlTrayIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wl-tray { animation: none; } }
.wl-tray-sec { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.wl-tray-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--ink); }
.wl-tray-n { min-width: 22px; height: 20px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary-600); font-size: 11.5px; font-weight: 700; }
.wl-tray-sec.is-late .wl-tray-head b { color: var(--danger-600); }
.wl-tray-sec.is-late .wl-tray-n { background: var(--danger-50); color: var(--danger-600); }
.wl-tray-hint, .wl-tray-empty { margin: 0; font-size: 11.5px; color: var(--muted); }
.wl-tray-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); cursor: pointer; }
.wl-tray-item:hover, .wl-tray-item:focus-visible { background: var(--bg); }
.wl-tray-item[draggable="true"] { cursor: grab; }
.wl-tray-item.is-dragging { opacity: 0.5; }
.wl-tray-sec.is-late .wl-tray-item { border-color: #fecdd3; background: #fff5f6; }
.wl-tray-grip { flex: none; color: var(--muted); font-size: 12px; }
.wl-tray-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wl-tray-text b { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.wl-tray-text small { font-size: 11.5px; color: var(--muted); }
.wl-tray-text .is-late { color: var(--danger-600); font-weight: 600; }
.wl-tray-av .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.wl-tray-sec.is-ai { border-color: #e9d5ff; background: #faf5ff; }
.wl-tray-sec.is-ai .wl-tray-head b { color: #7c3aed; }
.wl-tray-sg { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.wl-tray-ai { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: #7c3aed; color: #fff; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.wl-tray-ai:hover { background: #6d28d9; }
/* Workload chỉnh 10/2026 (2): ô 0 giờ = viền + chữ "0h" mờ, không nền; hàng Cả nhóm thấp + nền tối nhẹ;
   phóng to: bảng kéo dài vừa khít màn hình (không chừa khoảng trống dưới chú giải), hàng tổng nằm sát đáy */
.wlb-cell.lv-empty { border-color: var(--border); color: var(--muted); font-weight: 600; }
.wlb-totals, .wlb-totals .wlb-days, .wlb-totals .wlb-left { background: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.wlb-totals .wlb-left { flex-direction: row; align-items: center; justify-content: flex-start; gap: 4px; padding-top: 4px; padding-bottom: 4px; }
.wlb-totals .wlb-left small { white-space: nowrap; }
.wlb-totals .wlb-cellwrap { min-height: 28px; }
.wlb-totals .wlb-cellwrap.is-off { background: transparent; }
.wl-shell.is-full { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.wl-shell.is-full > .report-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wl-shell.is-full .wl-main { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
.wl-shell.is-full .wl-main-board { display: flex; flex-direction: column; min-height: 0; }
.wl-shell.is-full .wlb-card { flex: 1; min-width: 0; min-height: 0; display: flex; }
.wl-shell.is-full .wlb { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.wl-shell.is-full .wlb-scroll { flex: 1; min-width: 0; min-height: 0; max-height: none; }
.wl-shell.is-full .wlb-grid { min-height: 100%; display: flex; flex-direction: column; }
.wl-shell.is-full .wlb-totals { margin-top: auto; }
.wl-shell.is-full .wl-tray { max-height: 100%; }
/* Hàng thứ / ngày thấp hơn 1/4 (chủ dự án yêu cầu 10/2026): ~49px -> ~37px */
.wlb-dline { padding: 1px 0; }
.wlb-dline .wlb-dayh { gap: 0; padding: 2px 0; }
.wlb-dline .wlb-dayh .wl-th-dnum { height: 18px; font-size: 12px; }
.wlb-dline .wlb-dayh .wl-th-dow { font-size: 10px; }
/* Thanh đang mở thẻ xem nhanh: con mắt hiện luôn tới khi đóng thẻ; nhãn Cần duyệt trong thẻ */
.wlb-bar.is-peek .wlb-bar-eye { display: inline-grid; background: color-mix(in srgb, var(--bc) 30%, var(--surface)); color: var(--ink); }
.wl-peek-chip.is-review { border-color: color-mix(in srgb, #fb7185 45%, transparent); background: #fff1f3; color: #be123c; }
.wl-peek-chip.is-late { background: var(--danger-50); }
/* Workload 10/2026 (3): kéo thanh sang người khác, Gợi ý chia lại, sửa giờ làm chuẩn tại chỗ, dải tháng thấp + nút phóng to căn giữa */
.wlb-row.is-drop-row > .wlb-days, .wlb-row.is-drop-row .wlb-track { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.wlb-row.is-drop-row > .wlb-left { box-shadow: inset 3px 0 0 var(--primary); }
.wl-tb-btn.is-ai { border-color: #ddd6fe; background: #f5f3ff; color: #6d28d9; font-weight: 600; }
.wl-tb-btn.is-ai:hover, .wl-tb-btn.is-ai[aria-expanded="true"] { background: #ede9fe; }
.wl-dd-pop.is-rb { left: auto; right: 0; width: 460px; max-width: calc(100vw - 24px); padding: 12px 14px; }
.wl-rb-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.wl-rb-head b { font-size: 14px; color: #6d28d9; }
.wl-rb-head small { font-size: 12px; color: var(--muted); }
.wl-rb-msg { margin: 6px 0; font-size: 13px; color: var(--ink-soft); }
.wl-rb-msg.is-error { color: var(--danger-600); }
.wl-rb-note { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.wl-rb-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.wl-rb-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: 10px; cursor: pointer; }
.wl-rb-item:hover { background: var(--bg); }
.wl-rb-item input { margin-top: 3px; flex: none; }
.wl-rb-text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wl-rb-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink); }
.wl-rb-move { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.wl-rb-move .avatar { width: 18px; height: 18px; font-size: 8.5px; }
.wl-rb-move small { color: var(--muted); font-variant-numeric: tabular-nums; }
.wl-rb-move small.is-over { color: var(--danger-600); }
.wl-rb-arrow { color: var(--muted); }
.wl-rb-h { flex: none; font-size: 12.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.wl-rb-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.wlb-pload.is-edit { cursor: default; }
.wlb-cap-input { width: 46px; height: 22px; padding: 0 4px; border: 1px solid var(--primary); border-radius: 5px; background: var(--surface); font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.wlb-pload.is-edit .wlb-pload-h { display: inline-flex; align-items: center; gap: 3px; }
.wlb-pload.is-edit small { font-size: 10.5px; color: var(--muted); }
/* Dải tháng thấp + chữ nhỏ; nút phóng to căn giữa theo chiều cao dải tháng */
.wlb-mband { height: 26px; align-items: center; }
.wlb-month { padding: 0; font-size: 13px; line-height: 26px; }
.wlb-full { top: 2px; width: 25px; height: 25px; }
.wlb-full svg { width: 13px; height: 13px; }
/* Kéo việc từ khay vào bảng: bóng mờ của thanh việc + viền đứt 2px ở đúng chỗ sẽ thả (1 ô ngày) */
.wlb-cellwrap { position: relative; }
.wlb-drop-ghost { position: absolute; z-index: 4; height: 28px; display: flex; align-items: center; padding: 0 8px; border: 2px dashed var(--bc); border-radius: 8px; background: color-mix(in srgb, var(--bc) 22%, transparent); color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; box-sizing: border-box; }
.wlb-drop-ghost.is-cell { inset: 0 3px; height: auto; justify-content: center; font-size: 11px; }

/* ===== Trang Kỹ năng AI (Đợt 10, ai.js renderSkillsPage) ===== */
.skp-head-text { flex: 1 1 420px; min-width: 0; }
/* Trang Kỹ năng AI (bố cục chủ dự án chốt 28/10/2026): mẫu 3 thẻ ngang viền đứt · thanh tìm + chip có số + sắp xếp · lưới thẻ 3 cột */
.skp-tpl { margin: 4px 0 18px; }
.skp-tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.skp-tpl-head h2 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.skp-tpl-head .pl-link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.skp-tpl-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.skp-tpl-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px; border: 1px dashed var(--border); border-radius: 14px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.skp-tpl-card:hover:not(:disabled), .skp-tpl-card:focus-visible { border-color: var(--primary); background: var(--primary-50); outline: none; }
.skp-tpl-card:disabled { opacity: 0.55; cursor: not-allowed; }
.skp-tpl-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); }
.skp-tpl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.skp-tpl-text b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skp-tpl-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skp-tpl-plus { flex: none; display: inline-flex; color: var(--muted); }
.skp-tpl-card:hover .skp-tpl-plus { color: var(--primary-600); }
.skp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 16px; }
.skp-toolbar .auto-search { flex: 0 1 260px; min-width: 180px; }
.skp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.skp-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.skp-chip:hover { background: var(--bg); }
.skp-chip.is-on { border-color: var(--primary-100); background: var(--primary-50); color: var(--primary-600); }
.skp-chip-n { min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 11.5px; font-weight: 700; text-align: center; }
.skp-chip.is-on .skp-chip-n { background: var(--surface); color: var(--primary-600); }
.skp-sort { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); } /* ô chọn dùng bộ chọn tùy biến chung (cselect) */
.skp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.skp-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s; }
.skp-card:hover { border-color: var(--primary-100); box-shadow: 0 0 0 1px var(--primary-100), var(--shadow-md); }
.skp-card.is-off { background: var(--bg); }
.skp-card.is-off h3, .skp-card.is-off .skp-desc { color: var(--muted); }
.skp-card-top { display: flex; align-items: center; gap: 12px; }
.skp-card-top h3 { flex: 1; min-width: 0; margin: 0; overflow: hidden; font-size: 15px; font-weight: 700; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.skp-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--primary-50); color: var(--primary-600); }
.skp-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.skp-pill { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-soft); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skp-pill.is-workspace { background: var(--primary-50); color: var(--primary-600); }
.skp-pill.is-project { background: #f5f3ff; color: #6d28d9; }
.skp-pill.is-off { background: #fff7ed; color: #c2410c; }
.skp-desc { flex: 1; margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skp-muted { color: var(--muted); font-style: italic; }
.skp-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.skp-tok { display: inline-flex; align-items: center; gap: 4px; }
.skp-card-foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.skp-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.skp-icon-btn:hover { background: var(--bg); color: var(--ink); }
.skp-icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.skp-menu-wrap { position: relative; display: inline-flex; }
.skp-menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 160px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-md); }
.skp-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.skp-menu button:hover { background: var(--bg); }
.skp-menu button.is-danger { color: var(--danger-600, #e11d48); }
.skp-use { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; font-size: 13px; }
@media (max-width: 1100px) { .skp-grid, .skp-tpl-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .skp-grid, .skp-tpl-row { grid-template-columns: minmax(0, 1fr); } .skp-sort { margin-left: 0; } .skp-toolbar .auto-search { flex-basis: 100%; } }

/* ===== Bài đăng (Đợt 10, posts.js) ===== */
.post-type { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; line-height: 1.6; }
.post-type.tone-amber { background: #fef3c7; color: #b45309; }
.post-type.tone-rose { background: #ffe4e6; color: #e11d48; }
.post-type.tone-blue { background: var(--primary-100); color: var(--primary-600); }
.post-type.tone-violet { background: #ede9fe; color: #6d28d9; }
.post-type.tone-green { background: #d1fae5; color: #047857; }
.post-new { padding: 1px 8px; border-radius: var(--radius-pill); background: var(--primary-600); color: #fff; font-size: 11px; font-weight: 700; }
.post-toolbar { flex-wrap: wrap; margin-bottom: 14px; }
.post-scope-select { width: auto; max-width: 240px; }
.post-unread-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.post-feed { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.post-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.post-card:hover, .post-card:focus-visible { border-color: var(--primary-100); box-shadow: var(--shadow-md); outline: none; }
.post-card:focus-visible { border-color: var(--primary); }
.post-card.is-unread { border-left: 3px solid var(--primary); }
.post-card.is-pinned { background: color-mix(in srgb, #fef3c7 35%, var(--surface)); }
.post-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-title { margin: 0; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.post-card.is-unread .post-title { font-weight: 700; }
.post-av { width: 24px; height: 24px; flex: none; font-size: 10px; }
.post-excerpt { margin: 2px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-foot:empty { display: none; }
.post-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink-soft); font-size: 12px; }
.post-chip.is-mine { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.post-chip.is-need { border-color: #fcd34d; background: #fffbeb; color: #b45309; font-weight: 600; }
.post-chip.is-done { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.post-chip.is-ack { border-color: var(--primary-100); color: var(--primary-600); font-weight: 600; }
.post-more { display: flex; justify-content: center; max-width: 860px; margin-top: 14px; }
/* Hộp xem 1 bài */
.post-content { margin: 14px 0; font-size: 14.5px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.post-content table { max-width: 100%; }
.post-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.post-imgs img { display: block; max-width: 220px; max-height: 180px; border: 1px solid var(--border); border-radius: var(--radius-md); object-fit: cover; }
.post-ack { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 12px 0; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13.5px; }
.post-ack > span { display: inline-flex; align-items: center; gap: 8px; }
.post-ack.is-stats { flex-direction: column; align-items: stretch; border: 1px solid var(--border); background: var(--bg); }
.post-ack-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.post-ack-bar { flex: 1 1 140px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.post-ack-bar span { display: block; height: 100%; background: var(--primary); }
.post-ack.is-stats .btn-secondary { align-self: flex-start; }
.post-mention { color: var(--primary-600); font-weight: 600; }
/* Hộp soạn bài */

/* ===== Gantt nâng cấp 27/10 (calendar.js ganttFloatHTML / ganttLegendHTML / thanh cha gộp theo task con) ===== */
/* Nút nổi ở mép phải khung thời gian (như Workload): phóng to + (dưới) + − độ rộng cột ngày */
.gantt-float { position: absolute; top: 0px; right: 14px; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px; } /* nút phóng to (22px) giữa dải tháng, + − ngay dưới, được đè lên hàng ngày */
.gantt-full-btn { width: 25px; height: 25px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.gantt-full-btn:hover { background: var(--bg); color: var(--ink); }
.gantt-full-btn svg { width: 13px; height: 13px; }
.gantt-zoom2 { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.gantt-zoom2 button { width: 28px; height: 28px; border: 0; background: transparent; font: inherit; font-size: 16px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.gantt-zoom2 button + button { border-top: 1px solid var(--border-soft); }
.gantt-zoom2 button:hover:not(:disabled), .gantt-zoom2 button:focus-visible { background: var(--bg); color: var(--ink); outline: none; }
.gantt-zoom2 button:disabled { color: var(--muted); cursor: default; }
/* Thanh: ảnh người phụ trách ở đầu thanh; thanh việc cha có phần đậm = % task con đã xong, số % đứng trước tên */
.gantt-bar { overflow: hidden; }
.gantt-bar.is-movable { cursor: grab; }
.gantt-split.is-dragging .gantt-bar.is-movable { cursor: grabbing; }
.gantt-bar-avs { position: absolute; top: 50%; left: 4px; z-index: 1; display: flex; transform: translateY(-50%); pointer-events: none; }
.gantt-bar-avs .gantt-av { width: 18px; height: 18px; margin-left: -4px; border: 1.5px solid var(--surface); font-size: 8px; }
.gantt-bar-avs .gantt-av:first-child { margin-left: 0; }
/* Nền thanh = màu trạng thái nhạt như thanh việc ở Workload (.wlb-bar); việc cha: phần đậm = % task con đã xong, số % nằm trong thanh */
/* Cùng bộ màu với cột Kanban (tasks.js): chữ / số = màu trạng thái đậm 100%; "màu mờ" = 18% (như chip tiêu đề cột) cho thanh việc
   và phần ĐÃ XONG của việc cha; "màu mờ hơn" = 4% (như nền cả cột) cho phần CHƯA XONG của việc cha. Không dùng opacity. */
.gantt-bar { background: color-mix(in srgb, var(--bar) 18%, var(--surface)); border-color: var(--bar); } /* viền = màu chữ (trạng thái đậm) */
.gantt-bar.is-parent { background: color-mix(in srgb, var(--bar) 4%, var(--surface)); }
/* Quá hạn: tên việc cạnh thanh đổi màu đỏ cảnh báo (viền vẫn theo trạng thái) */
.gantt-bar-label.is-overdue { color: var(--danger-600, var(--danger)); font-weight: 600; } /* cùng màu ngày quá hạn ở cột trái (.pl-due.is-overdue) */
.gantt-bar-fill { position: absolute; top: 0; bottom: 0; left: 0; background: color-mix(in srgb, var(--bar) 18%, var(--surface)); pointer-events: none; }
.gantt-bar-pct { margin-right: 6px; font-weight: 700; color: var(--bar, var(--ink)); }
.gantt-bar-label .gantt-bar-pct { color: var(--ink); }
.gantt-bar-pct.is-in { position: absolute; top: 50%; right: 8px; z-index: 1; margin: 0; transform: translateY(-50%); font-size: 11.5px; line-height: 1; pointer-events: none; }
/* Rê vào 1 thanh: đường phụ thuộc của việc đó rõ, đường khác mờ */
.gantt-split.is-dep-focus .gantt-dep:not(.is-on) { opacity: 0.12; }
.gantt-split.is-dep-focus .gantt-dep.is-on .gantt-dep-line { stroke-width: 2.4; }
/* Chú giải nhỏ dưới bảng */
.gantt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; padding: 0 4px; font-size: 12.5px; color: var(--ink-soft); }
.gantt-legend b { color: var(--ink); }
.gantt-lg-item { display: inline-flex; align-items: center; gap: 6px; }
.gantt-lg-item.is-note { color: var(--muted); }
.gantt-lg-sw { display: inline-block; width: 18px; height: 11px; border: 1px solid var(--bar); border-radius: 3px; background: color-mix(in srgb, var(--bar) 18%, var(--surface)); }
.gantt-legend .gantt-lg-txt-overdue { margin-right: 4px; color: var(--danger-600, var(--danger)); font-weight: 600; }
.gantt-lg-sw.is-fill { --bar: var(--primary); background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 18%, var(--surface)) 55%, color-mix(in srgb, var(--primary) 4%, var(--surface)) 55%); }
/* Phóng to toàn màn hình: cả trang dự án (thanh công cụ + Lọc + bảng + chú giải) phủ kín, thân bảng cao vừa khít (--gfull-h) */
body.gantt-fullscreen-open { overflow: hidden; }
body.gantt-fullscreen-open .page-view.is-active:has(.gantt-view.is-full) { position: fixed; inset: 0; z-index: 50; overflow: auto; padding: 6px 8px; background: var(--bg); }
.gantt-view.is-full .gantt-left, .gantt-view.is-full .gantt-right { max-height: var(--gfull-h, calc(100vh - 200px)); }
/* Phóng to: chỉ còn 1 thanh công cụ gọn như Gantt của ClickUp — trái = Hôm nay + Xuất, phải = Lọc; ẩn đầu dự án (Trợ lý AI, thành viên, Mời…) và hàng tab chế độ xem */
body.gantt-fullscreen-open .page-view.is-active:has(.gantt-view.is-full) :is(.ph-swap, .project-header, .pv-bar, .plan-note) { display: none; }
body.gantt-fullscreen-open .page-view.is-active:has(.gantt-view.is-full) .project-toolbar { margin: 0 0 6px; }
body.gantt-fullscreen-open .page-view.is-active:has(.gantt-view.is-full) .project-toolbar .gantt-tools { order: -1; }
@media (prefers-reduced-motion: reduce) { .gantt-bar-label, .gantt-bar { transition: none; } }
/* Cài đặt › Không gian làm việc › Góp ý (Đợt 12): cùng tông thẻ màu với Gói & thanh toán */
.fbk-promo { display: flex; align-items: center; gap: 16px; margin: 0 0 14px; padding: 14px 18px; border: 1px solid #fbcfe8; border-radius: 16px;
  background: linear-gradient(110deg, #fdf2f8 0%, #fff7ed 55%, #fffbeb 100%); }
.fbk-promo-stub { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 78px; height: 64px; border: 1.5px dashed #fda4af; border-radius: 12px; background: #fff; color: #e11d48; }
.fbk-promo-stub b { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.fbk-promo-stub small { margin-top: 3px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fbk-promo-text { flex: 1; min-width: 0; }
.fbk-promo-text h3 { margin: 0 0 3px; font-size: 16px; color: var(--ink); }
.fbk-promo-text p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.fbk-promo-btn { flex: none; }
.fbk-done { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid #bbf7d0; border-radius: 12px; background: var(--success-50); font-size: 13px; color: var(--success-700); }
/* Góp ý sản phẩm bản 3 (28/10/2026, theo bản phác thảo): lưới 12 cột, form 7/12 + danh sách 5/12, 2 thẻ cao bằng nhau */
.fbk-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.fbk-grid > .fbk-form, .fbk-grid > .fbk-thanks { grid-column: span 7; }
.fbk-grid > .fbk-side { grid-column: span 5; }
.fbk-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; }
.fbk-form { container-type: inline-size; }
.fbk-card .ws-card-head { margin-bottom: 0; }
/* Màu theo loại: xanh lá = đề xuất, vàng = báo lỗi, xanh da trời = khen / khác */
.fbk-ic { --c: #0284c7; --bg: #e0f2fe; flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--bg); color: var(--c); }
.fbk-ic.is-lg { width: 36px; height: 36px; border-radius: 11px; }
:is(.fbk-ic, .fbk-cat, .fbk-starter).is-green { --c: #16a34a; --bg: #dcfce7; --tint: #f6fef9; --line: #86efac; }
:is(.fbk-ic, .fbk-cat, .fbk-starter).is-amber { --c: #b45309; --bg: #fef3c7; --tint: #fffcf2; --line: #fcd34d; }
:is(.fbk-ic, .fbk-cat, .fbk-starter).is-sky { --c: #0284c7; --bg: #e0f2fe; --tint: #f5fbff; --line: #7dd3fc; }
:is(.fbk-ic, .fbk-cat, .fbk-starter).is-rose { --c: #e11d48; --bg: #ffe4e6; --tint: #fff7f8; --line: #fda4af; }
.fbk-quota { flex: none; padding: 4px 10px; border-radius: 999px; background: #e0f2fe; color: #0369a1; font-size: 12px; font-weight: 700; white-space: nowrap; }
.fbk-quota.is-out { background: #ffe4e6; color: #be123c; }
.fbk-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fbk-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.fbk-label-hint { font-weight: 400; color: var(--ink-soft); }
/* 3 thẻ loại: nền trắng, cùng chiều cao, tên 1 dòng, mô tả tối đa 2 dòng */
.fbk-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fbk-cat { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface);
  text-align: left; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.fbk-cat:hover { border-color: var(--line); }
.fbk-cat.is-on { padding: 10px 11px; border: 2px solid var(--c); background: var(--tint); box-shadow: 0 2px 8px rgba(15, 23, 42, .07); }
.fbk-cat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fbk-cat-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fbk-cat-name { overflow: hidden; font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.fbk-cat-radio { flex: none; width: 16px; height: 16px; border: 2px solid #cbd5e1; border-radius: 50%; background: var(--surface); }
.fbk-cat.is-on .fbk-cat-radio { border-color: var(--c); background: var(--c); box-shadow: inset 0 0 0 3px var(--surface); }
.fbk-cat-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2.7em; font-size: 12px; line-height: 1.35; color: var(--ink-soft); }
.fbk-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.fbk-row2 .form-control { height: 40px; }
/* Nút gạt mức độ */
.fbk-seg { display: inline-flex; align-self: flex-start; max-width: 100%; height: 40px; padding: 3px; border-radius: 12px; background: var(--surface-2, #f1f5f9); }
.fbk-seg-btn { flex: 1 1 auto; min-width: 0; padding: 0 13px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; cursor: pointer; }
.fbk-seg-btn:hover { color: var(--ink); }
.fbk-seg-btn.is-on { background: var(--surface); color: #15803d; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.fbk-seg.is-bug .fbk-seg-btn.is-on { color: #b45309; }
.fbk-stars { display: flex; align-items: center; gap: 2px; height: 40px; }
.fbk-star { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: #cbd5e1; cursor: pointer; }
.fbk-star:hover, .fbk-star.is-on { color: #f59e0b; }
.fbk-stars.is-read { height: auto; }
.fbk-stars.is-read .fbk-star { width: 18px; height: 18px; cursor: default; }
.fbk-note { min-height: 112px; resize: vertical; }
.fbk-note-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-soft); }
.fbk-count { flex: none; font-variant-numeric: tabular-nums; }
/* Vùng đính kèm nét đứt 1 dòng; báo lỗi = viền vàng nhạt */
.fbk-drop { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1.5px dashed var(--border); border-radius: 12px; background: var(--surface); font-size: 12.5px; color: var(--ink-soft); transition: border-color .15s, background-color .15s; }
.fbk-drop.is-bug { border-color: #fcd34d; background: #fffcf2; }
.fbk-drop.is-over { border-color: var(--primary); background: var(--primary-50); }
.fbk-drop-ic { flex: none; display: inline-grid; color: var(--ink-soft); }
.fbk-drop-text { flex: 1; min-width: 0; }
.fbk-drop-text b { color: #92400e; font-weight: 600; }
.fbk-drop-pick { flex: none; font-weight: 700; color: var(--primary-600); cursor: pointer; }
.fbk-drop-pick:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.fbk-drop-pick.is-off { color: var(--ink-faint, #94a3b8); cursor: not-allowed; }
.fbk-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.fbk-thumb { position: relative; width: 64px; height: 64px; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; background: var(--surface-2, #f1f5f9); }
.fbk-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fbk-thumb-x { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(15, 23, 42, .65); color: #fff; cursor: pointer; }
.fbk-thumb-x:hover { background: var(--danger-600); }
.fbk-opts { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; }
.fbk-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.fbk-check input { width: 16px; height: 16px; accent-color: var(--primary-600); }
.fbk-tech { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 11.5px; font-weight: 600; }
.fbk-tech .info-tip { width: 20px; height: 20px; color: #92400e; }
.fbk-neterr { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid #fecdd3; border-radius: 10px; background: var(--danger-50); font-size: 13px; color: var(--danger-600); }
.fbk-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.fbk-foot-note { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 12.5px; color: var(--ink); }
.fbk-foot-note b { display: block; font-weight: 600; }
.fbk-foot-note small { display: block; font-size: 11.5px; color: var(--ink-soft); }
.fbk-foot-act { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.fbk-send-wrap { display: inline-flex; }
.fbk-send { min-width: 128px; justify-content: center; }
.fbk-send:disabled { opacity: .45; cursor: not-allowed; }
.fbk-spin { display: inline-block; width: 14px; height: 14px; margin-right: 6px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; vertical-align: -2px; animation: fbkSpin .8s linear infinite; }
@keyframes fbkSpin { to { transform: rotate(360deg); } }
/* Màn cảm ơn (thay khung form) */
.fbk-thanks { align-items: center; justify-content: center; gap: 10px; padding: 36px 24px; text-align: center; }
.fbk-thanks-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #dcfce7; color: #16a34a; }
.fbk-thanks h3 { margin: 6px 0 0; font-size: 18px; color: var(--ink); }
.fbk-thanks p { max-width: 440px; margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-soft); }
.fbk-thanks-act { display: flex; gap: 10px; margin-top: 8px; }
/* Danh sách "Góp ý của đội bạn" */
.fbk-side { min-height: 0; }
.fbk-side-body { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.fbk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fbk-chip { padding: 4px 11px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.fbk-chip:hover { background: var(--surface-2, #f8fafc); color: var(--ink); }
.fbk-chip.is-on { border-color: #bae6fd; background: #e0f2fe; color: #0369a1; }
.fbk-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.fbk-side .fbk-list { max-height: 560px; padding-right: 2px; overflow-y: auto; }
.fbk-item { display: flex; gap: 11px; padding: 12px 13px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); cursor: pointer; transition: background-color .15s, border-color .15s; }
.fbk-item:hover { border-color: var(--border); background: var(--surface-2, #f8fafc); }
.fbk-item-body { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.fbk-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.fbk-item-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 700; line-height: 1.35;
  text-align: left; color: var(--ink); overflow-wrap: anywhere; cursor: pointer; }
.fbk-item-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.fbk-item-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; color: var(--ink-soft); }
.fbk-item-meta > span:not(.avatar) { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fbk-item-files { display: inline-flex; flex: none; align-items: center; gap: 3px; }
.avatar.fbk-av { flex: none; width: 20px; height: 20px; font-size: 9px; }
.fbk-av-ini { display: inline-grid; place-items: center; border-radius: 50%; background: #c7d2fe; color: #3730a3; font-weight: 700; }
.fbk-status { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.fbk-status.is-gray { background: #f1f5f9; color: #475569; }
.fbk-status.is-amber { background: #fef3c7; color: #b45309; }
.fbk-status.is-sky { background: #e0f2fe; color: #0369a1; }
.fbk-status.is-green { background: #dcfce7; color: #15803d; }
.fbk-status.is-rose { background: #ffe4e6; color: #be123c; }
.fbk-reply { padding: 8px 11px; border-left: 3px solid #38bdf8; border-radius: 0 8px 8px 0; background: #f8fafc; font-size: 12.5px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.fbk-reply b { font-weight: 700; }
.fbk-reply.is-rose { border-left-color: #fb7185; background: #fff7f8; }
.fbk-gift { display: inline-flex; align-self: flex-start; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 11.5px; font-weight: 700; }
.fbk-more { align-self: center; margin-top: auto; padding: 14px 8px 2px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--primary-600); cursor: pointer; }
.fbk-more:hover { text-decoration: underline; }
.fbk-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 26px 12px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.fbk-empty.is-small { padding: 18px 10px; }
.fbk-empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #e0f2fe; color: #0284c7; }
.fbk-empty h4 { margin: 4px 0 0; font-size: 16px; color: var(--ink); }
.fbk-empty p { margin: 0; }
.fbk-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.fbk-starter { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12px; font-weight: 600; color: var(--ink); cursor: pointer; }
.fbk-starter svg { color: var(--c); }
.fbk-starter:hover { border-color: var(--line); background: var(--tint); }
/* Hộp Xem tất cả / chi tiết */
body:has(#modal-fbk-toggle:checked) #modal-fbk { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#modal-fbk-toggle:checked) #modal-fbk .modal-box { transform: scale(1); opacity: 1; }
.modal-box.fbk-mbox { display: flex; flex-direction: column; width: min(640px, calc(100vw - 32px)); max-height: min(86vh, 760px); padding: 0; }
.fbk-mhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 12px; border-bottom: 1px solid var(--border-soft); }
.fbk-mtitle { margin: 0; font-size: 16px; color: var(--ink); }
.fbk-mbody { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 16px 20px; overflow-y: auto; }
.fbk-mfoot { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border-soft); }
.fbk-mfoot.is-pager { justify-content: center; }
.fbk-mfoot-gap { flex: 1; }
.fbk-mfoot .btn-danger-ghost { padding: 8px 14px; border-radius: 10px; }
.fbk-pageno { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.fbk-dhead { display: flex; align-items: flex-start; gap: 12px; }
.fbk-dhead-t { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
.fbk-dhead-t h3 { margin: 0; font-size: 15.5px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.fbk-dnote { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.fbk-drows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; padding: 10px 12px; border-radius: 10px; background: #f8fafc; font-size: 12.5px; }
.fbk-drows dt { color: var(--ink-soft); }
.fbk-drows dd { margin: 0; color: var(--ink); }
.fbk-dimgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fbk-dimg { display: block; aspect-ratio: 4 / 3; border: 1px solid var(--border-soft); border-radius: 10px; overflow: hidden; background: #f1f5f9; }
.fbk-dimg img { width: 100%; height: 100%; object-fit: cover; }
.fbk-techbox { font-size: 12px; color: var(--ink-soft); }
.fbk-techbox summary { cursor: pointer; font-weight: 600; }
.fbk-techbox dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 0; }
.fbk-techbox dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.fbk-dh { margin: 4px 0 0; font-size: 13px; color: var(--ink); }
.fbk-hist { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0 0 0 4px; list-style: none; }
.fbk-hist li { position: relative; padding-left: 18px; font-size: 12.5px; }
.fbk-hist li + li::before { content: ""; position: absolute; left: 4px; top: -10px; height: 12px; border-left: 2px solid var(--border-soft); }
.fbk-hist-dot { position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; }
.fbk-hist li.is-amber .fbk-hist-dot { background: #f59e0b; }
.fbk-hist li.is-sky .fbk-hist-dot { background: #38bdf8; }
.fbk-hist li.is-green .fbk-hist-dot { background: #22c55e; }
.fbk-hist li.is-rose .fbk-hist-dot { background: #fb7185; }
.fbk-hist-at { margin-left: 8px; color: var(--ink-soft); }
.fbk-hist p { margin: 3px 0 0; color: var(--ink-soft); }
@media (max-width: 1023px) {
  .fbk-grid > .fbk-form, .fbk-grid > .fbk-thanks, .fbk-grid > .fbk-side { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .fbk-row2 { grid-template-columns: minmax(0, 1fr); }
  .fbk-seg { align-self: stretch; }
  .fbk-drop { flex-wrap: wrap; }
  .fbk-foot-act, .fbk-send-wrap, .fbk-send { width: 100%; }
  .fbk-foot-act > * { flex: 1; }
  .fbk-thanks-act { flex-direction: column; width: 100%; }
  .fbk-dimgs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fbk-promo { flex-wrap: wrap; }
  .fbk-promo-btn { width: 100%; }
}
/* Khung form hẹp (cột 7/12 trên màn vừa, điện thoại): 3 thẻ loại xếp dọc thành hàng icon · tên + mô tả · nút chọn */
@container (max-width: 540px) {
  .fbk-cats { grid-template-columns: minmax(0, 1fr); }
  .fbk-cat { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
  .fbk-cat-top { display: contents; }
  .fbk-cat-text { order: 2; }
  .fbk-cat-radio { order: 3; }
  .fbk-cat-desc { min-height: 0; -webkit-line-clamp: 1; }
}
@media (prefers-reduced-motion: reduce) { .fbk-cat, .fbk-item, .fbk-drop { transition: none; } .fbk-spin { animation-duration: 2s; } }
/* Bài đăng: đầu trang + khung viết ngay trên bảng tin (28/10/2026). Màu loại: Thông báo vàng, Cập nhật xanh dương, Thảo luận xanh lá, Ý tưởng tím */
.post-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.post-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.post-head-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; }
#post-compose-slot { max-width: 860px; }
.pc { --pc-pad: 16px; margin: 0 0 16px; padding: var(--pc-pad); border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.pc.is-open { border-color: #7dd3fc; box-shadow: 0 0 0 3px #e0f2fe, 0 6px 18px rgba(15, 23, 42, .06); }
.pc-row { display: flex; align-items: center; gap: 12px; }
.pc .pc-av { flex: none; width: 36px; height: 36px; font-size: 13px; }
.pc-ph { flex: 1; min-width: 0; height: 42px; padding: 0 16px; overflow: hidden; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2, #f8fafc); font: inherit; font-size: 14px; text-align: left; color: var(--ink-soft); white-space: nowrap; text-overflow: ellipsis; cursor: text; }
.pc-ph:hover { border-color: #bae6fd; background: var(--surface); }
.pc-ph:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pc-ph-draft { margin-right: 8px; padding: 2px 8px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 11.5px; font-weight: 700; }
.pc-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0 48px; }
.pc-qtype, .pc-type { --t: #0284c7; --tb: #e0f2fe; --tl: #7dd3fc; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; transition: border-color .15s, background-color .15s; }
.pc-qtype { height: 28px; padding: 0 11px; font-size: 12.5px; gap: 5px; }
.pc-qtype svg, .pc-type svg { color: var(--t); }
.pc-qtype:hover, .pc-type:hover:not(:disabled) { border-color: var(--tl); background: var(--tb); }
:is(.pc-qtype, .pc-type).tone-amber { --t: #b45309; --tb: #fef3c7; --tl: #fcd34d; }
:is(.pc-qtype, .pc-type).tone-rose { --t: #e11d48; --tb: #ffe4e6; --tl: #fda4af; }
:is(.pc-qtype, .pc-type).tone-blue { --t: #0284c7; --tb: #e0f2fe; --tl: #7dd3fc; }
:is(.pc-qtype, .pc-type).tone-green { --t: #15803d; --tb: #dcfce7; --tl: #86efac; }
:is(.pc-qtype, .pc-type).tone-violet { --t: #7c3aed; --tb: #ede9fe; --tl: #c4b5fd; }
.pc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-types { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pc-type { height: 32px; padding: 0 11px; font-size: 12.5px; gap: 5px; }
.pc-type.is-on { border-color: var(--tl); background: var(--tb); color: var(--t); }
.pc-type:disabled { opacity: .45; cursor: not-allowed; }
.pc-type:focus-visible, .pc-qtype:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pc-scope { position: relative; margin-left: auto; }
.pc-scope-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 32px; padding: 0 10px 0 11px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface-2, #f8fafc); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.pc-scope-chip span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pc-scope-chip > svg:last-child { transform: rotate(90deg); color: var(--ink-soft); }
.pc-scope-chip:hover, .pc-scope-chip[aria-expanded="true"] { border-color: #bae6fd; background: #f0f9ff; }
.pc-pop { position: absolute; z-index: 20; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 32px rgba(15, 23, 42, .14); }
.pc-scope-pop { top: calc(100% + 6px); right: 0; width: 300px; max-width: calc(100vw - 32px); padding: 8px; }
.pc-scope-search { display: flex; align-items: center; gap: 8px; height: 36px; margin-bottom: 6px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink-soft); }
.pc-scope-search:focus-within { border-color: var(--primary); }
.pc-scope-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 13px; color: var(--ink); }
.pc-scope-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.pc-scope-group { padding: 8px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.pc-scope-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: none; font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.pc-scope-opt:hover, .pc-scope-opt:focus-visible { background: var(--surface-2, #f1f5f9); outline: none; }
.pc-scope-opt.is-on { background: #e0f2fe; }
.pc-scope-opt > svg { flex: none; color: var(--primary-600); }
.pc-scope-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2, #f1f5f9); color: var(--ink-soft); }
.pc-scope-txt { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.pc-scope-txt b { overflow: hidden; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.pc-scope-txt small { font-size: 11.5px; color: var(--ink-soft); }
.pc-scope-empty { margin: 6px 8px; font-size: 12.5px; color: var(--ink-soft); }
.pc-title { display: block; width: 100%; margin: 14px 0 0; padding: 4px 0; border: 0; outline: 0; background: none; font: inherit; font-size: 20px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.pc-title::placeholder { color: var(--ink-faint, #94a3b8); font-weight: 600; }
.pc-editor { margin-top: 6px; }
.pc-editor .jodit-container:not(.jodit_inline) { border: 0; background: none; }
.pc-editor .jodit-toolbar__box:not(:empty) { display: inline-block; margin-bottom: 6px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-2, #f8fafc); overflow: hidden; }
.pc-editor .jodit-workplace { border-radius: 10px; }
.pc-editor .jodit-wysiwyg { padding: 4px 0 !important; font-size: 14px; }
.pc-editor .jodit-status-bar { display: none; }
.pc-opts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.pc-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.pc-switch.is-off { color: var(--ink-soft); cursor: not-allowed; }
.pc-files { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-files:not(:empty) { margin-top: 10px; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.pc-tools { position: relative; display: flex; align-items: center; gap: 2px; }
.pc-emoji { position: relative; display: inline-flex; }
.pc-tool { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 16px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.pc-tool:hover, .pc-tool:focus-within, .pc-tool:focus-visible { background: var(--surface-2, #f1f5f9); color: var(--ink); outline: none; }
.pc-emoji-pop { bottom: calc(100% + 6px); left: 0; display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; padding: 6px; }
.pc-emoji-pop button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; font-size: 18px; cursor: pointer; }
.pc-emoji-pop button:hover, .pc-emoji-pop button:focus-visible { background: var(--surface-2, #f1f5f9); outline: none; }
.pc-acts { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pc-hint { font-size: 12px; color: var(--ink-soft); }
@media (max-width: 640px) {
  .pc .pc-av { display: none; }
  .pc-quick { margin-left: 0; }
  .pc-scope { margin-left: 0; width: 100%; }
  .pc-scope-pop { left: 0; right: auto; }
  .pc-hint { display: none; }
  .pc-acts { width: 100%; }
  .pc-acts > button { flex: 1; }
  .post-head-btn { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pc, .pc-type, .pc-qtype { transition: none; } }
/* Bài đăng: thanh lọc 1 hàng + bố cục 2 cột (chính ~860px, phải ~360–450px; màn nhỏ cột phải xuống dưới) */
.psf-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 16px; }
.psf-seg { flex-wrap: wrap; }
/* Nút lọc loại dùng chung kiểu tab dự án; là button (không phải radio) nên tab đang chọn theo lớp .is-on */
.view-tab.psf-tab { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; }
.view-tab.psf-tab.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); transform: scale(1.03); }
.view-tab.psf-tab.is-on svg { transform: scale(1.12); color: var(--primary-600); }
.view-tab.psf-tab:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
@media (prefers-reduced-motion: reduce) { .view-tab.psf-tab.is-on, .view-tab.psf-tab.is-on svg { transform: none; } }
.psf-right { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.psf-right .auto-search.psf-search { flex: 0 1 220px; width: 220px; min-width: 140px; margin: 0; }
.psf-scope { width: auto; max-width: 200px; height: 36px; }
.psf-unread { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.psf-unread-n { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #ffe4e6; color: #be123c; font-size: 11.5px; font-weight: 700; text-align: center; }
.posts-layout { display: grid; grid-template-columns: minmax(0, 860px) minmax(300px, 450px); gap: 20px; align-items: start; }
.posts-main { min-width: 0; }
.posts-main #post-compose-slot, .posts-main .post-feed, .posts-main .post-more { max-width: none; }
.posts-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }
.posts-side:empty { display: none; }
@media (max-width: 1100px) {
  .posts-layout { grid-template-columns: minmax(0, 1fr); }
  .posts-side { position: static; }
}
/* Thẻ bài: vạch trái màu loại khi chưa đọc, hàng đầu avatar + tên + vai trò, nhãn bên phải */
.pcard { --t: #0284c7; gap: 8px; padding: 16px 18px; border-color: var(--border-soft); border-radius: 14px; }
.pcard.tone-amber { --t: #f59e0b; }
.pcard.tone-rose { --t: #fb7185; }
.pcard.tone-blue { --t: #38bdf8; }
.pcard.tone-green { --t: #22c55e; }
.pcard.tone-violet { --t: #8b5cf6; }
.post-card.pcard.is-unread { border-left: 3px solid var(--t); padding-left: 16px; }
.post-card.pcard.is-pinned { background: var(--surface); }
.pcard-head { display: flex; align-items: flex-start; gap: 10px; }
.pcard .pcard-av { width: 36px; height: 36px; font-size: 12px; }
.pcard-who { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.pcard-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--ink); }
.pcard-name b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pcard-role { --rc: var(--ink-soft); flex: none; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--rc) 14%, transparent); font-size: 11px; font-weight: 600; color: var(--rc); }
.pcard-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.pcard-who small { font-size: 12px; color: var(--ink-soft); }
.pcard-tags { display: flex; flex: none; align-items: center; gap: 6px; }
.pcard-pin { display: inline-flex; align-items: center; color: #16a34a; }
.pcard-more { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; }
.pcard-more:hover, .pcard-more[aria-expanded="true"], .pcard-more:focus-visible { background: var(--surface-2, #f1f5f9); color: var(--ink); outline: none; }
.pcard .post-title { margin-top: 2px; font-size: 17px; font-weight: 700; line-height: 1.35; }
.pcard .post-excerpt { color: var(--ink); opacity: .85; }
.pcard-readmore { font-weight: 600; color: var(--primary-600); }
.pcard-files { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard-file { display: inline-flex; align-items: center; gap: 5px; max-width: 260px; padding: 4px 10px; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface-2, #f8fafc); font-size: 12.5px; color: var(--ink); text-decoration: none; white-space: nowrap; text-overflow: ellipsis; }
.pcard-file:hover { border-color: #bae6fd; }
.pcard-file.is-more { color: var(--ink-soft); }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.pcard-social { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pcard-react { display: inline-flex; align-items: center; gap: 3px; height: 28px; padding: 0 9px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.pcard-react:hover:not(:disabled) { border-color: #bae6fd; background: #f0f9ff; }
.pcard-react.is-mine { border-color: #7dd3fc; background: #e0f2fe; }
.pcard-react:disabled { cursor: default; }
/* Nút Thích (không viền) + bảng 3 cảm xúc hiện phía trên khi rê chuột / focus (cầu nối vô hình ::after để rê lên không bị tắt) */
.pcard-react-add { position: relative; display: inline-flex; }
.pcard-like { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; transition: background-color .15s, color .15s; }
.pcard-like:hover, .pcard-like:focus-visible { background: var(--surface-2, #f1f5f9); color: var(--ink); outline: none; }
.pcard-like.is-mine { color: #2563eb; }
.pcard-react-pop { position: absolute; bottom: calc(100% + 8px); left: -4px; z-index: 6; display: flex; gap: 2px; padding: 4px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); box-shadow: 0 10px 24px rgba(15, 23, 42, .16);
  opacity: 0; visibility: hidden; transform: translateY(4px) scale(.96); transform-origin: bottom left; transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s; }
.pcard-react-pop::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.pcard-react-add:hover .pcard-react-pop, .pcard-react-add:focus-within .pcard-react-pop { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.pcard-react-pop button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; font-size: 19px; cursor: pointer; transition: transform .12s ease; }
.pcard-react-pop button:hover, .pcard-react-pop button:focus-visible { transform: scale(1.22); background: var(--surface-2, #f1f5f9); outline: none; }
.pcard-cmt { display: inline-flex; align-items: center; gap: 6px; height: 30px; margin-left: 2px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.pcard-cmt:hover, .pcard-cmt:focus-visible, .pcard-cmt.is-on { background: var(--surface-2, #f1f5f9); color: var(--ink); outline: none; }
.pcard-cmt.is-on { color: var(--primary-600); }
/* Khung bình luận ngay dưới thẻ bài */
.pcm { display: flex; flex-direction: column; gap: 10px; margin: 2px -18px -16px; padding: 12px 18px 14px; border-top: 1px solid var(--border-soft); border-radius: 0 0 14px 14px; background: var(--surface-2, #f8fafc); cursor: default; }
@keyframes pcmIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pcm-list { display: flex; flex-direction: column; gap: 8px; }
.pcm-list:empty { display: none; }
.pcm-more { align-self: flex-start; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.pcm-more:hover { color: var(--primary-600); text-decoration: underline; }
.pcm-item { display: flex; align-items: flex-start; gap: 8px; }
.pcm .post-av { width: 28px; height: 28px; flex: none; font-size: 10px; }
.pcm-bubble { min-width: 0; max-width: 100%; padding: 7px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.pcm-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.pcm-head b { color: var(--ink); }
.pcm-head time { font-size: 11.5px; color: var(--ink-soft); }
.pcm-body { margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.pcm-new { display: flex; align-items: flex-end; gap: 8px; }
.pcm-field { position: relative; display: flex; flex: 1; align-items: flex-end; min-width: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.pcm-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.pcm-input { flex: 1; min-width: 0; min-height: 36px; max-height: 160px; padding: 8px 4px 8px 14px; border: 0; outline: 0; background: none; font: inherit; font-size: 13.5px; line-height: 20px; color: var(--ink); resize: none; }
.pcm-send { flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin: 3px; padding: 0; border: 0; border-radius: 50%; background: var(--primary); color: #fff; cursor: pointer; }
.pcm-send:hover { background: var(--primary-600); }
.pcm-send:disabled { opacity: .5; cursor: default; }
.pcm-hint { margin: -4px 0 0 36px; font-size: 11.5px; color: var(--ink-soft); }
.pcm-err { margin: -4px 0 0 36px; font-size: 12px; color: var(--danger-600); }
@media (prefers-reduced-motion: reduce) { .pcm, .pcard-react-pop, .pcard-react-pop button { animation: none; transition: none; } }
.pcard-ack { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pcard-ackstat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); }
.pcard-faces { display: inline-flex; }
.pcard-faces .avatar.pcard-face { width: 22px; height: 22px; margin-left: -6px; border: 2px solid var(--surface); font-size: 8.5px; }
.pcard-faces .avatar.pcard-face:first-child { margin-left: 0; }
.pcard-acked { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 12.5px; font-weight: 600; }
.pcard-ackbtn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 13px; font-size: 13px; }
.pcard-menu { position: fixed; z-index: 70; min-width: 210px; padding: 6px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(15, 23, 42, .16); }
.pcard-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; color: var(--ink); cursor: pointer; }
.pcard-menu-item svg { color: var(--ink-soft); }
.pcard-menu-item:hover, .pcard-menu-item:focus-visible { background: var(--surface-2, #f1f5f9); outline: none; }
.pcard-menu-item.is-danger, .pcard-menu-item.is-danger svg { color: var(--danger-600); }
.pcard-menu-item.is-danger:hover { background: var(--danger-50); }
.pcard-menu-sep { margin: 4px 2px; border: 0; border-top: 1px solid var(--border-soft); }
/* Cột phải */
.ps-card { padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.ps-card h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.ps-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: center; }
.ps-count.is-red { background: #ffe4e6; color: #be123c; }
.ps-count.is-amber { background: #fef3c7; color: #92400e; }
.ps-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ps-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.ps-row + .ps-row { border-top: 1px solid var(--border-soft); }
.ps-pin { flex: none; color: #e11d48; }
.ps-title { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.ps-title b { overflow: hidden; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }
.ps-title small { font-size: 11.5px; color: var(--ink-soft); }
.ps-title:hover b { color: var(--primary-600); }
.ps-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.ps-ack { flex: none; height: 28px; padding: 0 12px; font-size: 12.5px; }
.ps-empty { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.ps-card.ps-tip { border-color: #fde68a; background: linear-gradient(120deg, #fffbeb 0%, #fff1f2 100%); box-shadow: none; }
.ps-tip h3 { color: #92400e; }
.ps-tip p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink); }
/* Chưa có bài đăng nào */
.pe-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); text-align: center; }
.pe-ic { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 4px; border-radius: 18px; background: linear-gradient(135deg, #e0f2fe, #fce7f3); color: #e11d48; }
.pe-empty h3 { margin: 0; font-size: 17px; color: var(--ink); }
.pe-empty p { max-width: 380px; margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-soft); }
.pe-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
/* Bảng "Ai đã đọc" trong thẻ bài đang mở rộng (bấm "Đã đọc a/b") */
.pa-tabs { display: flex; gap: 6px; }
.pa-tab { height: 28px; padding: 0 12px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.pa-tab.is-on { border-color: var(--primary); background: var(--primary); color: #fff; }
.pa-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.pa-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); }
.pa-list .post-av { width: 28px; height: 28px; }
.pa-list time { margin-left: auto; font-size: 11.5px; color: var(--ink-soft); }
.pa-empty { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
@media (max-width: 640px) {
  .psf-seg { width: 100%; }
  .view-tab.psf-tab { flex: 1 1 auto; justify-content: center; padding: 6px 8px; }
  .psf-right { width: 100%; flex-wrap: wrap; }
  .psf-right .auto-search.psf-search { flex: 1 1 100%; width: 100%; }
  .psf-scope { flex: 1; max-width: none; }
  .pcard-tags .post-type { display: none; }
  .pcard-ack { width: 100%; justify-content: space-between; margin-left: 0; }
}
.skp-use:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.skp-sort .cselect-btn { height: 32px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink); }
/* Bài đăng: bảng gợi ý @Tên (khung viết + ô bình luận), đặt cố định theo con trỏ */
.post-mention-pop { position: fixed; z-index: 80; width: 260px; max-width: calc(100vw - 16px); padding: 6px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(15, 23, 42, .16); }
.post-mention-title { padding: 4px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.post-mention-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; text-align: left; color: var(--ink); cursor: pointer; }
.post-mention-opt span:not(.avatar) { min-width: 0; overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.post-mention-opt small { margin-left: auto; overflow: hidden; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; text-overflow: ellipsis; }
.post-mention-opt:hover, .post-mention-opt.is-on { background: #e0f2fe; }
.post-mention-opt .post-av { width: 24px; height: 24px; }
/* Khung viết đang trượt mở / thu: không cho nội dung tràn ra ngoài khung */
.pc { overflow-anchor: none; }
/* Bài đăng: sửa bài ngay trong khung viết */
.pc-edit-bar { display: flex; align-items: center; gap: 8px; margin: calc(var(--pc-pad) * -1) calc(var(--pc-pad) * -1) 14px; padding: 8px 10px 8px var(--pc-pad); border-bottom: 1px solid #fde68a; border-radius: 16px 16px 0 0; background: #fffbeb; font-size: 13px; font-weight: 600; color: #92400e; }
.pc-edit-bar span { flex: 1; }
.pc-edit-x { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: #92400e; cursor: pointer; }
.pc-edit-x:hover, .pc-edit-x:focus-visible { background: #fef3c7; outline: none; }
.pc.is-open.is-edit { border-color: #fcd34d; box-shadow: 0 0 0 3px #fef3c7, 0 6px 18px rgba(15, 23, 42, .06); }
.pc-scope-chip.is-locked { cursor: default; color: var(--ink-soft); }
.pc-scope-chip.is-locked > svg:last-child { transform: none; }
/* Bài đăng: nút ghim (ghim cây) ở hàng công cụ khung viết — đang ghim tô xanh dương */
.pc-tool.pc-pin.is-on { background: #dbeafe; color: #2563eb; }
.pc-tool.pc-pin.is-on:hover { background: #bfdbfe; color: #1d4ed8; }
.pc-tool.pc-pin:disabled { opacity: .4; cursor: not-allowed; }
.ps-card h3 > svg { flex: none; color: var(--ink-soft); }
.pcard-pin svg { flex: none; }
.comment-menu-item[data-action="chat-pin"] svg { vertical-align: -2px; color: #e11d48; }
.post-card.pcard.is-unread .pcm { margin-left: -16px; }
/* Bài đăng: thẻ bài mở rộng tại chỗ (bấm vào bài) */
.post-card.pcard.is-expanded { cursor: default; border-color: #bae6fd; box-shadow: var(--shadow-md); }
.pcard-full { display: flex; flex-direction: column; gap: 10px; }
.pcard-full .post-content { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink); }
.pcard-full .post-imgs { margin: 0; }
.pcard-edited { margin: 0; font-size: 12px; color: var(--ink-soft); }
.pcard-collapse { display: inline-flex; align-self: flex-start; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--primary-600); cursor: pointer; }
.pcard-collapse svg { transform: rotate(-90deg); }
.pcard-collapse:hover { text-decoration: underline; }
button.pcard-ackstat { padding: 2px 6px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
button.pcard-ackstat:hover, button.pcard-ackstat:focus-visible { background: var(--surface-2, #f1f5f9); color: var(--ink); outline: none; }
/* ⋯ của từng bình luận: hiện khi rê / focus, menu nhỏ ngay cạnh */
.pcm-item { position: relative; }
.pcm-act { position: relative; flex: none; align-self: center; }
.pcm-dots { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-soft); cursor: pointer; opacity: 0; transition: opacity .12s, background-color .12s; }
.pcm-item:hover .pcm-dots, .pcm-dots:focus-visible, .pcm-dots[aria-expanded="true"] { opacity: 1; }
.pcm-dots:hover, .pcm-dots[aria-expanded="true"], .pcm-dots:focus-visible { background: var(--surface); color: var(--ink); outline: none; }
.pcm-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 8; min-width: 170px; padding: 5px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 24px rgba(15, 23, 42, .16); }
@media (hover: none) { .pcm-dots { opacity: 1; } }
/* Sửa bình luận ngay dưới thẻ: bong bóng giãn hết bề ngang, ô sửa viền như ô viết */
.pcm-item.is-editing .pcm-bubble { flex: 1; }
.pcm-edited { font-size: 11px; color: var(--ink-soft); }
.pcm-input.pcm-edit { display: block; width: 100%; margin-top: 6px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.pcm-input.pcm-edit:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.pcm-edit-acts { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.pcm-edit-acts .pcm-hint { margin: 0 auto 0 0; }
.pcm-edit-acts .btn-primary, .pcm-edit-acts .btn-secondary { height: 30px; padding: 0 12px; font-size: 12.5px; }
.pcm-item.is-editing .pcm-err { margin: 4px 0 0; }
/* Bảng Ai đã đọc nằm trong thẻ, dưới hàng biểu cảm */
.post-ack.pcard-ackpanel { display: block; margin: 4px 0 0; padding: 12px 14px; cursor: default; }
.pcard-ackpanel .pa-tabs, .pcard-ackpanel .pa-list, .pcard-ackpanel .pa-empty { margin-top: 10px; }
.pcard-ackclose { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: auto; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; }
.pcard-ackclose:hover, .pcard-ackclose:focus-visible { background: var(--surface); color: var(--ink); outline: none; }
/* Chỉ thẻ bị cắt mới có "Xem thêm" + con trỏ bấm; bài ngắn đã hiện đủ thì không */
.pcard .pcard-readmore { display: none; align-self: flex-start; font-size: 13px; }
.pcard.is-expandable .pcard-readmore { display: inline; }
.post-card.pcard:not(.is-expandable):not(.is-expanded) { cursor: default; }
/* ===== Chi tiết nhóm: làm theo ảnh mẫu (06/11/2026). Màu + số đo đọc từ ảnh mẫu. Đè các lớp cũ ở trên ===== */
.team-detail { --tdv-ink: #0f172a; --tdv-soft: #4f6088; --tdv-line: #e9edf6; --tdv-blue: #0082fa; --tdv-fill: #1dabfb; --tdv-shadow: 0 6px 20px rgba(86, 100, 170, .08); }
.team-detail-head { gap: 14px; margin-bottom: 12px; }
.team-detail-title h2 { font-size: 24px; font-weight: 700; color: var(--tdv-ink); }
.team-detail-sub { font-size: 13.5px; color: var(--tdv-soft); }
.team-head-icon { width: 44px; height: 44px; border-radius: 12px; }
.team-detail-actions .btn-secondary { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-color: var(--tdv-line); border-radius: 12px; background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--tdv-ink); box-shadow: 0 1px 4px rgba(23, 36, 61, .05); }
.team-detail-actions .btn-secondary:hover { background: #f4f6fb; }
.team-detail-actions .btn-secondary.set-btn-danger { border-color: #fbd5dc; background: #fcf4f7; color: #e11d48; }
.team-detail-actions .btn-secondary.set-btn-danger:hover { background: #fbe9ee; }
/* Tab: gạch chân xanh, có biểu tượng */
.team-detail .tw-tabs { gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--tdv-line); }
.team-detail .tw-tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 500; color: var(--tdv-ink); transition: background-color .15s ease; }
.team-detail .tw-tab:hover { background: #f4f6fb; }
.team-detail .tw-tab.is-active { border-bottom-color: var(--tdv-blue); font-weight: 600; color: var(--tdv-blue); }
.team-detail .tw-tab-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: none; font-size: 13px; font-weight: 600; color: inherit; }
/* Thẻ */
.team-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 0; }
.team-overview .team-card-soft { padding: 16px 18px; border-color: var(--tdv-line); border-radius: 18px; background: var(--surface); box-shadow: var(--tdv-shadow); }
.team-overview .set-title { display: inline-flex; align-items: center; gap: 8px; font-size: 16.5px; font-weight: 700; color: var(--tdv-ink); }
.team-overview .team-card-head { margin-bottom: 10px; }
/* Giới thiệu: khối tím nhạt + ô biểu tượng tròn */
.tdv-intro-body { display: flex; align-items: center; gap: 12px; min-height: 66px; margin: 0 -2px; padding: 8px 14px; border-radius: 12px; background: #f6f5fe; }
.tdv-intro-text { flex: 1; min-width: 0; }
.tdv-intro-text .team-desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--tdv-ink); white-space: pre-line; }
.tdv-intro-ic { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #e8e3fb; color: #7c5cf0; }
/* Giới thiệu (thiết kế tương tác 11/2026): cây bút = hình trang trí (bấm chữ để sửa); đang sửa = khung trắng viền tím nhạt, Hủy / Lưu */
.tdv-intro-ic.is-edit { width: 38px; height: 38px; pointer-events: none; }
.tdv-intro-body.is-editing { display: block; padding: 12px 14px; background: var(--surface); box-shadow: inset 0 0 0 1px #d9d2fb; }
.tdv-intro-edit-title { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 700; color: var(--tdv-ink); }
.tdv-intro-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.tdv-intro-foot .btn-secondary, .tdv-intro-foot .btn-primary { height: 34px; padding: 0 16px; border-radius: 9px; font-size: 13px; }
/* Trưởng nhóm */
.tdv-leader .team-leader-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 66px; }
.tdv-leader .team-leader-person { flex: 1 1 200px; min-width: 0; }
.tdv-leader .team-person strong { font-size: 15px; font-weight: 700; color: var(--tdv-ink); }
.tdv-leader .team-person span span { font-size: 13px; color: var(--tdv-soft); }
.tdv-leader-acts { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; }
.tdv-pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-color: var(--tdv-line); border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--tdv-ink); }
.tdv-pill:hover { background: #f4f6fb; }
/* Công việc của nhóm: 4 thẻ số pastel */
.tdb-head { margin-bottom: 14px; }
.tdb-online { font-size: 13px; color: var(--tdv-ink); }
.tdb-online .presence-dot { width: 9px; height: 9px; }
/* Ô kỳ: viền + nền nằm trên chính nút chọn (cselect), biểu tượng lịch nổi bên trong -> khung xổ rộng bằng ô và thẳng mép trái với ô */
.tdv-period { position: relative; display: inline-flex; align-items: center; color: var(--tdv-ink); }
.tdv-period > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 1; pointer-events: none; transition: color 0.2s; }
.tdv-period .tdb-period { width: auto; min-width: 158px; height: 36px; padding: 0 12px 0 35px; border: 1px solid var(--tdv-line); border-radius: 10px; outline: 0; background: var(--surface); box-shadow: none; font: inherit; font-size: 13.5px; color: inherit; cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s; }
.tdv-period .tdb-period:hover { background: var(--primary-50); }
.tdv-period .tdb-period:focus-visible, .tdv-period .tdb-period.is-open { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.tdv-period:has(.tdb-period.is-open) > svg { color: var(--primary-600); }
.tdb-kpi { --k: #0354ee; --k1: #fcfcfe; --k2: #e9effd; --ki: #d0e4fe; --kl: #5b9bf8; position: relative; flex-direction: row; align-items: flex-start; gap: 12px; min-height: 128px; padding: 14px 14px 42px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--k2) 70%, var(--surface)); border-radius: 18px; background: linear-gradient(120deg, var(--k1), var(--k2)); font: inherit; color: var(--tdv-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--kl) 14%, transparent); transition: box-shadow .2s ease, filter .2s ease; }
.tdb-kpi.is-violet { --k: #4001bd; --k1: #f9f8fe; --k2: #efe8fe; --ki: #e7ddfb; --kl: #8b5cf6; }
.tdb-kpi.is-rose { --k: #ec0227; --k1: #fef6f9; --k2: #fbe6ef; --ki: #feebf3; --kl: #f7648a; }
.tdb-kpi.is-green { --k: #008a1c; --k1: #f3fbf7; --k2: #e0f6ea; --ki: #ddf8e6; --kl: #2fc984; }
button.tdb-kpi:hover { border-color: color-mix(in srgb, var(--k2) 70%, var(--surface)); filter: brightness(.98); box-shadow: 0 6px 18px color-mix(in srgb, var(--kl) 22%, transparent); }
button.tdb-kpi:focus-visible { outline: 2px solid var(--k); outline-offset: 2px; }
/* GĐ2 tương tác (11/2026): ô số đang mở khung danh sách = viền cùng tông */
button.tdb-kpi.is-open { border-color: color-mix(in srgb, var(--kl) 55%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--kl) 22%, transparent), 0 6px 18px color-mix(in srgb, var(--kl) 22%, transparent); }
.tdb-online[data-tdv-tip] { cursor: default; border-radius: 8px; padding: 2px 6px; transition: background-color 0.2s; }
.tdb-online[data-tdv-tip]:hover { background: var(--success-50); }
/* Ô tóm tắt: chấm màu theo trạng thái việc */
.tdv-tip-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.tdv-tip-dot.is-doing { background: #1dabfb; } /* cùng màu phần Đang làm của vòng tròn */
.tdv-tip-dot.is-review { background: #f59e0b; }
.tdv-tip-dot.is-done { background: #22c55e; }
.tdv-tip-dot.is-late { background: var(--danger); }
.tmg-tip-title.is-red { color: var(--danger); }
.tmg-tip-row > b { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Khung danh sách khi bấm ô số */
.tmg-pop.is-tdv { width: 360px; }
/* Biểu tượng riêng của ô số đặt cạnh tiêu đề ô tóm tắt / khung bấm */
.tdv-kpi-mini { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; }
.tdv-kpi-mini.is-blue { background: #e0edfe; color: #0354ee; }
.tdv-kpi-mini.is-violet { background: #ede7fe; color: #6d28d9; }
.tdv-kpi-mini.is-rose { background: #ffe4ea; color: #e11d48; }
.tdv-kpi-mini.is-green { background: #dcf7e8; color: #15803d; }
.tmg-tip-title .tdv-kpi-mini { width: 22px; height: 22px; }
.tmg-tip-title { gap: 7px; }
/* Bảng trong khung bấm ô số: hàng tên cột nền xám, dòng dự án (▾ xổ việc), dòng việc thụt vào; cao tối đa 5 hàng rồi cuộn mảnh mờ */
.tdv-ptable { max-height: 212px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 10px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tdv-prow { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-top: 1px solid var(--border-soft); background: var(--surface); font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color 0.2s; }
.tdv-prow:hover { background: #f5f9ff; }
.tdv-prow.is-head { position: sticky; top: 0; z-index: 1; height: 32px; border-top: 0; background: #f1f5f9; font-size: 12px; font-weight: 600; color: var(--ink); cursor: default; }
.tdv-prow-name { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.tdv-prow-name b { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdv-prow-name small { flex: none; font-size: 11.5px; color: var(--ink-soft); }
.tdv-prow.is-group > .tdv-prow-name > svg { flex: none; color: var(--ink-soft); transform: rotate(-90deg); transition: transform 0.2s; }
.tdv-prow.is-group.is-open > .tdv-prow-name > svg { transform: none; }
.tdv-prow-count { flex: none; min-width: 22px; padding: 1px 7px; border-radius: var(--radius-pill); background: #f1f5f9; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); text-align: center; }
.tdv-prow.is-task { padding-left: 34px; background: #fcfdff; }
.tdv-prow.is-task:hover { background: #f5f9ff; }
.tdv-prow.is-task .tdv-prow-name { gap: 5px; }
.tdv-task-ic { flex: none; display: inline-flex; }
.tdv-task-right { flex: none; font-size: 12px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tdv-task-right.is-late { color: var(--danger); }
.tdv-task-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdv-pop-proj { width: 22px; height: 22px; flex: none; border-radius: 6px; font-size: 9.5px; }
.tdv-pop-pct { flex: none; font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
/* Khung chi tiết dự án */
.tdv-pprog { display: flex; align-items: center; gap: 10px; margin: 2px 0 10px; }
.tdv-pprog b { flex: none; font-size: 12.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tdv-psub { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.tdv-pstat { display: flex; align-items: center; gap: 8px; height: 30px; font-size: 13px; color: var(--ink); }
.tdv-pstat span { flex: 1; }
.tdv-pstat b { font-weight: 700; font-variant-numeric: tabular-nums; }
/* Thanh % trong khung nổi (nằm ngoài trang nên đặt màu riêng, không dùng biến của trang) */
.tmg-pop .tdb-progress { flex: 1; min-width: 40px; height: 6px; border-radius: var(--radius-pill); background: #e8ecf5; overflow: hidden; }
.tmg-pop .tdb-progress i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
/* Nút Xem dự án: giữa chân khung, viền xanh, chữ gạch chân; rê chuột tô nền */
.tdv-pop-link { display: flex; align-items: center; justify-content: center; gap: 5px; height: 32px; margin: 12px auto 0; padding: 0 18px; border: 1px solid var(--primary); border-radius: 9px; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--primary-600); cursor: pointer; transition: background-color 0.2s; }
.tdv-pop-link span { text-decoration: underline; text-underline-offset: 2px; }
.tdv-pop-link:hover { background: var(--primary-50); }
/* Ô tóm tắt dự án: 3 dòng trạng thái trong khối nền xám bo góc */
.tmg-tip-box { display: block; margin-top: 6px; padding: 2px 8px; border-radius: 8px; background: #f1f5f9; }
/* Khung Phân tích tiến độ: số 4 phần, 2 tab, đường xu hướng / thanh theo dự án */
.tmg-pop.is-tdv:has(.tdv-ptabs) { width: 380px; }
.tdv-pparts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 4px 0 10px; font-size: 12.5px; color: var(--ink); }
.tdv-pparts span { display: flex; align-items: center; gap: 6px; }
.tdv-pparts small { color: var(--ink-soft); }
.tdv-ptabs { display: inline-flex; gap: 2px; margin-bottom: 10px; padding: 3px; border-radius: 10px; background: #f1f5f9; }
.tdv-ptab { height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.tdv-ptab.is-on { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }
.tdv-trend-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.tdv-trend-y { display: flex; flex-direction: column; justify-content: space-between; height: 120px; margin-top: -6px; margin-bottom: 14px; font-size: 11px; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.tdv-trend-y span { line-height: 12px; }
.tdv-trend-plot { min-width: 0; }
.tdv-trend { display: block; width: 100%; height: 120px; }
.tdv-trend line { stroke: #eef1f5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tdv-trend path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.tdv-trend .is-late { stroke: #fb5f7c; }
.tdv-trend .is-late-area { fill: rgba(251, 95, 124, 0.1); stroke: none; }
.tdv-trend .is-done { stroke: #22c55e; }
.tdv-trend .is-done-area { fill: rgba(34, 197, 94, 0.12); stroke: none; }
.tdv-trend-x { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tdv-pbars { display: flex; flex-direction: column; max-height: 136px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tdv-pbar { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) 90px 38px; align-items: center; gap: 10px; height: 34px; padding: 0 6px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color 0.2s; }
.tdv-pbar:hover { background: #f5f9ff; }
.tdv-pbar-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdv-pbar b { text-align: right; font-variant-numeric: tabular-nums; }
.tmg-tip-row.is-strong .tmg-tip-name, .tmg-tip-row.is-strong b { font-weight: 800; color: var(--ink); }
.tdv-pop-all { width: 100%; justify-content: center; height: 36px; margin-top: 10px; border-radius: 10px; font-size: 13px; }
.tdv-kpi-ic { position: relative; flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ki); color: var(--k); }
.tdv-kpi-txt { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; }
.tdb-kpi-value, .tdb-kpi.is-alert .tdb-kpi-value, .tdb-kpi.is-ok .tdb-kpi-value { font-size: 30px; font-weight: 700; line-height: 1.05; color: var(--k); font-variant-numeric: tabular-nums; }
.tdb-kpi-label { font-size: 13px; font-weight: 600; color: var(--tdv-ink); }
.tdb-kpi-sub { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 12px; line-height: 1.45; color: #586793; }
.tdb-trend { display: inline-flex; align-items: center; gap: 3px; padding: 0; background: none !important; font-size: 12.5px; font-weight: 700; }
.tdb-trend.is-up { color: #0f9f20; }
.tdb-trend.is-down { color: #e11d48; }
.tdb-trend.is-down svg { transform: rotate(180deg); }
/* Đường biểu đồ góc dưới phải: có dải riêng dưới chữ (padding dưới của thẻ) để không đè lên chữ, mờ dần về bên trái */
.tdv-wave { position: absolute; right: 0; bottom: 0; width: 62%; height: 36px; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.tdv-wave-fill { fill: var(--kl); fill-opacity: .16; stroke: none; }
.tdv-wave-line { fill: none; stroke: var(--kl); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* Tiến độ theo dự án + cột phải: cao bằng nhau */
.team-overview .tdb-grid { grid-template-columns: minmax(0, 557fr) minmax(0, 420fr); gap: 14px; align-items: stretch; }
.tdv-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tdv-side .tdb-people-card { flex: 1; }
.tdb-projects { gap: 0; max-height: 344px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tdb-project { gap: 12px; padding: 7px 0; border: 0; border-top: 1px solid var(--tdv-line); border-radius: 0; }
/* Dòng dự án là nút: rê chuột nền nhạt cả dòng, bấm mở khung chi tiết dự án */
button.tdb-project { box-sizing: border-box; width: 100%; margin: 0; padding-left: 8px; padding-right: 8px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background-color 0.2s; }
button.tdb-project:hover { background: #f5f9ff; }
button.tdb-project:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tdb-project-icon { width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--pc) 18%, var(--surface)); font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--pc) 72%, #000); }
.tdb-project-main { gap: 2px; }
.tdb-project-main strong { overflow: hidden; font-size: 13.5px; font-weight: 600; color: var(--tdv-ink); white-space: nowrap; text-overflow: ellipsis; }
.tdv-pline { display: flex; align-items: center; gap: 10px; }
.tdv-pline small { flex: none; font-size: 13px; color: var(--tdv-soft); font-variant-numeric: tabular-nums; }
.tdb-progress { flex: 1; min-width: 40px; height: 6px; background: #e8ecf5; }
.tdb-progress i { background: var(--tdv-fill); }
.tdv-ppct { flex: none; width: 42px; font-size: 14px; font-weight: 600; text-align: right; color: var(--tdv-ink); font-variant-numeric: tabular-nums; }
.tdb-state { flex: none; width: 114px; padding: 4px 0; border: 1px solid transparent; font-size: 12px; font-weight: 500; text-align: center; }
.tdb-state.is-ok { border-color: #b8e0fb; background: #d9f0fe; color: #0670c9; }
.tdb-state.is-risk { border-color: #fbd0d9; background: #feeaed; color: #e11d48; }
.tdb-state.is-done { border-color: #bdeed1; background: #e4f9ed; color: #0a9d50; }
/* Vòng tròn tiến độ */
.tdv-donut { display: flex; align-items: center; justify-content: space-around; gap: 16px; flex-wrap: wrap; }
.tdv-ring { position: relative; flex: none; width: 160px; height: 160px; }
.tdv-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.tdv-arc-track, .tdv-arc { fill: none; stroke-width: 16; }
.tdv-arc-track { stroke: #e5edfd; }
.tdv-arc.is-done { stroke: #4fda9c; }
.tdv-arc.is-doing { stroke: #1dabfb; }
.tdv-arc.is-review { stroke: #fbbf24; }
.tdv-arc.is-late { stroke: #fb5f7c; }
.tdv-ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
/* GĐ3 tương tác (11/2026): vòng tròn bấm được; rê 1 phần = phần đó dày lên + dòng chú giải cùng phần nền nhạt */
.tdv-donut[data-action] { margin: -6px; padding: 6px; border-radius: 14px; cursor: pointer; }
.tdv-donut[data-action]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tdv-arc { transition: stroke-width 0.2s; }
.tdv-arc.is-hl { stroke-width: 21; }
.tdv-keys li { margin: -4px -6px; padding: 4px 6px; border-radius: 8px; transition: background-color 0.2s; }
.tdv-keys li.is-hl { background: #f1f5f9; }
.tdv-keys li.is-hl b { color: var(--ink); }
.tdv-ring-txt b { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--tdv-ink); font-variant-numeric: tabular-nums; }
.tdv-ring-txt small { font-size: 13.5px; color: var(--tdv-ink); }
.tdv-keys { display: flex; flex: 1 1 170px; flex-direction: column; gap: 12px; max-width: 230px; margin: 0; padding: 0; list-style: none; }
.tdv-keys li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 46px; align-items: center; gap: 10px; font-size: 13px; color: var(--tdv-ink); }
.tdv-keys i, .tdv-chart-keys i { width: 10px; height: 10px; border-radius: 50%; }
.tdv-keys b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tdv-keys small { font-size: 13px; text-align: right; color: var(--tdv-soft); font-variant-numeric: tabular-nums; }
:is(.tdv-keys, .tdv-chart-keys) i.is-done, .tdv-bars i.is-done { background: #2fc984; }
:is(.tdv-keys, .tdv-chart-keys) i.is-doing, .tdv-bars i.is-doing { background: #1dabfb; }
.tdv-keys i.is-review { background: #fbbf24; }
:is(.tdv-keys, .tdv-chart-keys) i.is-late, .tdv-bars i.is-late { background: #fb5f7c; }
/* Thành viên: lưới ảnh */
.tdv-count { font-weight: 500; color: var(--tdv-soft); }
.tdv-all { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--tdv-blue); cursor: pointer; }
.tdv-all:hover { text-decoration: underline; }
.tdv-all:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.tdv-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: 196px; overflow-y: auto; scrollbar-width: thin; }
.tdv-person { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 13px; line-height: 1.25; text-align: center; color: var(--tdv-ink); cursor: pointer; transition: background-color .15s ease; }
.tdv-person:hover, .tdv-person:focus-visible { background: #f4f6fb; outline: none; }
.tdv-person > span:last-child { overflow-wrap: anywhere; }
.tdv-person-av { position: relative; display: inline-flex; }
.tdv-person-av .avatar { width: 44px; height: 44px; font-size: 15px; }
.tdv-crown { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; color: #f59e0b; }
/* Năng suất thành viên */
.tdv-view { display: inline-flex; gap: 8px; }
.tdv-view button { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; background: #f4f6fb; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--tdv-ink); cursor: pointer; transition: background-color .15s ease; }
.tdv-view button:hover { background: #e9edf6; }
.tdv-view button.is-on { border-color: var(--tdv-line); background: var(--surface); font-weight: 600; color: #0670e0; box-shadow: 0 1px 4px rgba(23, 36, 61, .08); }
.tdv-view button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tdb-table { border-collapse: collapse; }
.team-overview .tdb-table th { padding: 10px 12px; border-bottom: 1px solid #dfe5f0; background: none; font-size: 13px; font-weight: 500; text-align: center; color: var(--tdv-soft); white-space: nowrap; }
.team-overview .tdb-table th:first-child, .team-overview .tdb-table td:first-child { text-align: left; }
.team-overview .tdb-table td { padding: 8px 12px; border-bottom: 1px solid var(--tdv-line); text-align: center; }
.team-overview .tdb-table tbody tr:last-child td { border-bottom: 0; }
.team-overview .tdb-table tbody tr:hover td { background: #f7f9fc; }
.tdv-sort { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.tdv-sort.is-on { font-weight: 600; color: var(--tdv-ink); }
.tdv-sort:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.tdv-who { display: inline-flex; align-items: center; gap: 12px; min-width: 0; text-align: left; }
.tdv-who .avatar { width: 36px; height: 36px; flex: none; }
.tdv-who > span:last-child { display: flex; flex-direction: column; min-width: 0; max-width: 230px; }
.tdv-who strong { overflow: hidden; font-size: 14.5px; font-weight: 600; color: var(--tdv-ink); white-space: nowrap; text-overflow: ellipsis; }
.tdv-who small { overflow: hidden; font-size: 12.5px; color: var(--tdv-soft); white-space: nowrap; text-overflow: ellipsis; }
.tdv-chip { display: inline-grid; place-items: center; min-width: 42px; height: 28px; padding: 0 8px; border-radius: 10px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tdv-chip.is-info { background: #e7f2fe; color: #0670e0; }
.tdv-chip.is-danger { background: #fceaee; color: #e11d48; }
.tdv-chip.is-ok { background: #e4f9ed; color: #0a9d50; }
.tdv-rate { display: flex; align-items: center; gap: 10px; min-width: 120px; }
/* GĐ4 tương tác (11/2026): ô tóm tắt khi rê ảnh thành viên / ô tỉ lệ; thẻ thông tin nhanh */
.tdv-tip-person { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tdv-tip-person > span { display: flex; flex-direction: column; min-width: 0; }
.tdv-tip-person b { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.tdv-tip-person small { font-size: 12px; color: var(--ink-soft); }
/* Thẻ thông tin nhanh thành viên */
.tdv-mhead { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 10px; }
.tdv-mhead .tmg-pop-person-txt { flex: 1; }
.tdv-micon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.tdv-micon:hover { background: var(--primary-50); color: var(--primary-600); }
.tdv-minfo { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 30px; font-size: 12.5px; color: var(--ink-soft); }
.tdv-minfo b { font-weight: 600; color: var(--ink); }
.tdv-mrate { display: flex; align-items: center; gap: 10px; }
.tdv-mrate b { flex: none; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tdv-mfoot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tdv-mfoot .tdv-pop-link { width: 100%; }
.tdv-rate b { flex: none; width: 36px; font-size: 13.5px; font-weight: 600; text-align: left; color: var(--tdv-ink); font-variant-numeric: tabular-nums; }
.tdv-chart-keys { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; font-size: 13px; color: var(--tdv-ink); }
.tdv-chart-keys span { display: inline-flex; align-items: center; gap: 7px; }
.tdv-chart { display: flex; flex-direction: column; gap: 4px; }
.tdv-chart-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 118px; align-items: center; gap: 14px; width: 100%; padding: 6px 8px; border: 0; border-radius: 10px; background: none; font: inherit; color: inherit; cursor: pointer; transition: background-color .15s ease; }
.tdv-chart-row:hover, .tdv-chart-row:focus-visible { background: #f7f9fc; outline: none; }
.tdv-bars { display: flex; gap: 2px; height: 12px; }
.tdv-bars i { display: block; min-width: 3px; border-radius: 4px; }
.tdv-chart-n { font-size: 12.5px; font-weight: 500; text-align: right; color: var(--tdv-soft); font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) {
  .tdb-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-overview .tdb-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .team-overview { grid-template-columns: minmax(0, 1fr); }
  .team-detail-actions { width: 100%; }
  .team-detail .tw-tabs { overflow-x: auto; scrollbar-width: none; }
  .tdb-kpis { grid-template-columns: minmax(0, 1fr); }
  .tdb-state { width: auto; padding: 4px 8px; }
  .tdb-project { flex-wrap: wrap; }
  .tdb-project-main { flex-basis: calc(100% - 48px); }
  .tdv-ppct { margin-left: 48px; width: auto; }
  .tdv-chart-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tdv-chart-n { text-align: left; }
  .tdv-leader-acts { width: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .team-detail .tw-tab, .tdb-kpi, .tdv-person, .tdv-view button, .tdv-chart-row { transition: none; } }
/* ===== Gantt: làm lại theo ảnh mẫu (05/11/2026). Màu đọc từ ảnh mẫu. Đè các lớp Gantt cũ ở trên; bảng trong popup Tổng quan (.ovpt) giữ nguyên ===== */
.gantt-split:not(.ovpt) { --row-h: 36px; border-color: #e5ebf3; border-radius: 16px 16px 0 0; }
.gantt-view.is-full .gantt-split { border-radius: 16px; }
/* Cuối tuần: nền xanh xám cực nhạt, không sọc, không viền */
.gantt-weekend, .gantt-day.is-weekend { background: #f2f6fd; box-shadow: none; }
.gantt-day.is-weekend b { color: #838db2; }
.gantt-view.hide-off .gantt-weekends { display: none; }
.gantt-view.hide-off .gantt-day.is-weekend { background: none; }
.gantt-view.hide-off .gantt-day.is-weekend b { color: inherit; }
.gantt-view.hide-deps .gantt-deps { display: none; }
.gantt-view.hide-pct .gantt-bar-pct { display: none; }
/* Thanh việc: màu theo tình trạng (ganttBarState), nền nhạt + viền rõ + phần tiến độ đậm hơn */
.gantt-bar { --bar: #8fcdf7; --bar-bg: #e8f6fe; --bar-fill: #c9e9fd; --bar-ink: #017aea; border-radius: 8px; }
.gantt-bar.st-done { --bar: #6fdc9c; --bar-bg: #c8f5dd; --bar-fill: #aeeecb; --bar-ink: #0a9d50; }
.gantt-bar.st-doing { --bar: #8fcdf7; --bar-bg: #e8f6fe; --bar-fill: #c9e9fd; --bar-ink: #017aea; }
.gantt-bar.st-late { --bar: #f7a6b4; --bar-bg: #fed9df; --bar-fill: #fcbdc8; --bar-ink: #e11d48; }
.gantt-bar.st-risk { --bar: #fbcf7c; --bar-bg: #fff2d6; --bar-fill: #ffe3a8; --bar-ink: #b7791f; }
.gantt-bar.st-todo { --bar: #c2e6fe; --bar-bg: #f3faff; --bar-fill: #e8f6fe; --bar-ink: #3d8fd1; }
.gantt-bar, .gantt-bar.is-parent { background: var(--bar-bg); border-color: var(--bar); }
.gantt-bar-fill { background: var(--bar-fill); }
.gantt-bar .gantt-bar-pct, .gantt-bar-pct.is-in { display: inline-flex; align-items: center; gap: 3px; color: var(--bar-ink); }
.gantt-bar-label .gantt-bar-pct { font-size: 11.5px; color: var(--ink-soft); }
.gantt-sum { top: 14px; background: #b3f1d6; }
.gantt-sum > span { background: #6fdc9c; }
/* Phân cấp: dòng dự án nền xanh xám, việc cha đậm, task con nhẹ hơn + đường nối cây mảnh */
.gantt-lrow.gantt-lproject, .gantt-rrow.gantt-rproject { background: #f5f7fb; }
.gantt-lproject .gantt-lcell-name { font-size: 14px; font-weight: 700; }
.gantt-lrow.has-kids .gantt-name-text { font-weight: 600; }
/* Task con: chỉ khác bằng nền nhạt của cả dòng tên (chủ dự án chốt), chữ giữ nguyên màu */
.gantt-lrow.is-child:not(.is-hover), .gantt-lrow.is-child:not(.is-hover) > .gantt-lcell:last-child { background: #f6f8fc; }
.gantt-split.is-rowanim .gantt-deps { opacity: 0; }
.gantt-bar-label:empty { display: none; }
.gantt-bar-name { display: none; }
.gantt-view.show-name .gantt-bar-name { display: inline; }
.gantt-bar-label .gantt-bar-pct + .gantt-bar-name { margin-left: 6px; }
/* Ô tiêu đề cột Tên: số việc + nút tìm */
.gantt-lcol-count { margin-left: 6px; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.gantt-lcell-name.gantt-lcol { justify-content: flex-start; gap: 6px; }
.gantt-search-btn { flex: none; width: 30px; height: 30px; margin-left: auto; margin-right: 6px; border-radius: 8px; }
.gantt-search-btn.is-on { background: #e7f2fe; color: #0670e0; }
.gantt-search-input { flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: 1px solid var(--primary); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; color: var(--ink); outline: none; }
.gantt-search-input:focus { box-shadow: 0 0 0 3px var(--primary-100); }
.gantt-noresult { display: flex; align-items: center; height: var(--row-h); padding-left: 12px; font-size: 13px; color: var(--ink-soft); }
/* Thanh công cụ: 1 hệ thống: Hôm nay + ‹ › | Ngày / Tuần / Tháng | Xuất */
.gantt-tools { gap: 8px; }
.gantt-tg { display: inline-flex; align-items: center; height: var(--toolbar-h, 36px); border: 1px solid #e5ebf3; border-radius: 10px; background: var(--surface); }
.gantt-tg > button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 100%; min-width: 32px; padding: 0 11px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; transition: background-color .15s ease; }
.gantt-tg > button:first-child { border-radius: 9px 0 0 9px; }
.gantt-tg > button:last-child { border-radius: 0 9px 9px 0; }
.gantt-tg > button:only-child { border-radius: 9px; }
.gantt-tg > button + button { border-left: 1px solid #e5ebf3; }
.gantt-tg > button:hover { background: #f1f5fb; }
.gantt-tg > button:focus-visible { outline: 2px solid var(--primary-100); outline-offset: -2px; }
.gantt-tg > button.is-on, .gantt-tg > button.is-on:hover { background: #e7f2fe; color: #0670e0; font-weight: 600; }
.gantt-prev svg { transform: rotate(180deg); }
/* Chú giải: dính cạnh dưới màn hình khi chưa cuộn hết bảng, cuộn hết thì nằm ngay dưới bảng */
.gantt-legend { position: sticky; bottom: 0; z-index: 7; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; min-height: 46px; margin-top: 0; padding: 7px 18px; border: 1px solid #e5ebf3; border-top: 0; border-radius: 0 0 16px 16px; background: #f8fafe; box-shadow: 0 -4px 12px rgba(23, 36, 61, .05); font-size: 13px; color: var(--ink); }
.gantt-lg-show, .gantt-lg-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.gantt-lg-show > b { font-weight: 500; }
.gantt-lg-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.gantt-lg-check input { width: 16px; height: 16px; margin: 0; accent-color: #1a7df0; cursor: pointer; }
.gantt-lg-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.gantt-lg-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.gantt-lg-dot.st-done { background: #97ea9e; }
.gantt-lg-dot.st-doing { background: #8fcdf7; }
.gantt-lg-dot.st-risk { background: #ffd487; }
.gantt-lg-dot.st-late { background: #fe899d; }
.gantt-lg-dot.st-todo { background: #d6eefe; }
@media (max-width: 640px) {
  .gantt-tools { flex-wrap: wrap; }
  .gantt-legend { padding: 7px 10px; }
  .gantt-lg-keys { gap: 4px 12px; }
}
/* Thẻ chi tiết khi rê vào thanh việc / chấm vàng ở mép (calendar.js ganttHover*), thay title và tooltip đen */
.gantt-edge-mark::after { display: none; }
.ghc { position: fixed; z-index: 90; width: 300px; max-width: calc(100vw - 16px); padding: 12px 16px 8px; border: 1px solid #e5ebf3; border-radius: 16px; background: var(--surface); box-shadow: 0 12px 32px rgba(23, 36, 61, .14); font-size: 13.5px; color: var(--ink-soft); pointer-events: none; animation: ghcIn .15s ease; }
@keyframes ghcIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ghc-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.ghc-head b { min-width: 0; overflow: hidden; font-size: 14.5px; font-weight: 700; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }
.ghc-row { display: flex; align-items: center; gap: 10px; min-height: 36px; border-top: 1px solid #eef2f7; }
.ghc-ic { flex: none; display: grid; place-items: center; width: 18px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.ghc-val { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.ghc-chip { margin-left: auto; padding: 3px 10px; border-radius: 8px; background: #eef2f7; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.ghc-chip.is-ok { background: #dcfbe9; color: #0a9d50; }
.ghc-chip.is-info { background: #e7f2fe; color: #0670e0; }
.ghc-chip.is-warn { background: #fff0d6; color: #b7791f; }
.ghc-chip.is-bad { background: #fee2e7; color: #e11d48; }
@media (prefers-reduced-motion: reduce) { .gantt-tg > button { transition: none; } .ghc { animation: none; } }
/* ===== Thêm công việc + AI tạo việc: chép theo ảnh mẫu 06/11/2026 (màu đọc từ điểm ảnh, mẫu 1536px). Nút AI Agent ở task con giữ xanh nước theo chủ dự án ===== */
#modal-add-task { --at-blue: #0095fc; --at-blue2: #0284e0; --at-line: #dfe4ee; --at-ink: #0f172a; --at-soft: #5b6680; overflow-y: auto; align-items: flex-start; }
#modal-add-task .at-box { flex: none; width: min(600px, 100%); max-width: none; max-height: none; margin: auto; border-radius: 24px; }
#modal-add-task .at-box.is-ai { width: min(780px, 100%); }
.at-box.is-ai > .at-head, .at-box.is-ai > .at-mode, .at-box.is-ai > .at-body, .at-box.is-ai > .at-foot { display: none !important; }
.at-head { padding: 24px 28px 0 36px; }
.at-head h2 { margin: 0; font-size: 29px; font-weight: 700; line-height: 1.2; color: var(--at-ink); }
.at-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; border: 1px solid #edf0f5; border-radius: 12px; background: var(--surface); color: var(--at-ink); box-shadow: 0 2px 6px rgba(15, 23, 42, .05); cursor: pointer; transition: background-color .2s ease; }
.at-x:hover { background: #eef1f6; }
.at-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Hai chế độ chính */
.at-mode { display: flex; gap: 0; padding: 14px 36px 0; }
.at-mode[hidden] { display: none; }
.at-mode button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 207px; height: 52px; border: 1px solid #edf0f5; border-radius: 14px; background: var(--surface); font: inherit; font-size: 16px; font-weight: 500; color: var(--at-ink); box-shadow: 0 2px 8px rgba(15, 23, 42, .04); white-space: nowrap; cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.at-mode button:hover:not(.is-on):not(:disabled) { background: #eef1f6; }
.at-mode button.is-on { border-color: #e5f4fe; background: #e5f4fe; color: var(--at-blue2); font-weight: 600; }
.at-mode button[data-mode="ai"] svg { color: #0393f7; }
.at-mode button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.at-mode button:disabled { cursor: not-allowed; opacity: .6; }
/* Form Thủ công */
#modal-add-task .at-body { padding: 18px 36px 8px; }
.at-lb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; margin-bottom: 7px; }
.at-lb { display: block; margin-bottom: 7px; font-size: 15.5px; font-weight: 500; color: var(--at-ink); }
.at-lb em { font-style: normal; color: #ef4444; }
.at-lb-row .at-lb { margin-bottom: 0; }
/* Dùng mẫu: dropdown phụ của chế độ Thủ công, chỉ là chữ nhỏ cuối dòng nhãn */
#modal-add-task .at-tpl { height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: none; font-size: 13px; font-weight: 500; color: var(--at-soft); transition: background-color .2s ease; }
#modal-add-task .at-tpl:hover { background: #eef1f6; color: var(--at-soft); }
#modal-add-task .at-name-field { position: relative; margin-bottom: 14px; }
#modal-add-task .at-name { width: 100%; height: 54px; padding: 0 18px; border: 1px solid var(--at-line); border-radius: 14px; background: var(--surface); font-size: 15.5px; font-weight: 400; transition: border-color .2s ease, box-shadow .2s ease; }
.at-name::placeholder, .at-desc::placeholder { color: #7a859c; }
.at-name-field:has(.at-ai-fill:not([hidden])) .at-name { padding-right: 140px !important; }
#modal-add-task .at-name:focus, #modal-add-task .at-desc:focus { border-color: var(--at-blue); box-shadow: 0 0 0 3px #e5f4fe; outline: 0; }
.at-ai-fill { position: absolute; top: 1px; right: 1px; display: inline-flex; align-items: center; gap: 7px; height: 52px; padding: 0 18px; border: 0; border-radius: 0 13px 13px 0; background: #f6f4fd; font: inherit; font-size: 15px; font-weight: 600; color: #522dfb; cursor: pointer; transition: background-color .2s ease; }
.at-ai-fill:hover:not(:disabled) { background: #ebe7fb; }
.at-ai-fill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.at-ai-fill:disabled { cursor: wait; opacity: .6; }
.at-ai-fill.is-locked { background: var(--bg); color: var(--muted); }
#modal-add-task .at-desc { display: block; width: 100%; height: 102px; margin: 0 0 14px; padding: 13px 18px; border: 1px solid var(--at-line); border-radius: 14px; background: var(--surface); font: inherit; font-size: 15px; color: var(--at-ink); resize: vertical; transition: border-color .2s ease, box-shadow .2s ease; }
#modal-add-task .at-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; margin: 0 0 12px; }
.at-pills .at-asg-wrap { grid-column: 1 / -1; }
#modal-add-task .at-pill-wrap > .at-lb { margin-bottom: 6px; }
#modal-add-task .at-pill { display: flex; width: 100%; height: 50px; gap: 9px; padding: 0 14px; border: 1px solid var(--at-line); border-radius: 14px; background: var(--surface); font-size: 15px; font-weight: 500; color: #7a859c; transition: border-color .2s ease, background-color .2s ease; }
#modal-add-task .at-pill:hover { background: #f4f6fa; border-color: var(--at-line); color: #7a859c; }
#modal-add-task .at-pill.is-open { border-color: var(--at-blue); }
#modal-add-task .at-pill.has-value, #modal-add-task #at-pill-status { color: var(--at-ink); }
#modal-add-task .at-pill.is-late { border-color: var(--danger); color: var(--danger-600); }
.at-pill-txt { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.at-chev { flex: none; margin-left: auto; color: #5b6680; }
.at-pill .at-st-icon { width: 20px; height: 20px; }
#modal-add-task .at-pill.is-low { --pc: #0393f7; }
#modal-add-task .at-pill.is-medium { --pc: #fdae07; }
#modal-add-task .at-pill.is-high { --pc: #f84a4b; }
#modal-add-task .at-pop { top: calc(100% + 6px); }
#modal-add-task .at-sub { margin-top: 4px; padding-top: 4px; border-top: 0; }
#modal-add-task .at-sub-label { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 15.5px; font-weight: 500; color: var(--at-ink); }
.at-tip { display: inline-flex; color: var(--at-soft); cursor: help; }
.at-sub-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; border: 1.5px dashed #d6dce7; border-radius: 14px; background: none; font: inherit; font-size: 15px; color: var(--at-soft); cursor: pointer; transition: background-color .2s ease; }
.at-sub-add:hover { background: #f4f6fa; }
.at-sub-add:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.at-sub-add[hidden], #add-task-sub-row[hidden] { display: none; }
#modal-add-task .at-foot { gap: 10px; margin-top: 12px; padding: 20px 26px 22px 36px; border-top: 1px solid #f0f2f7; }
#modal-add-task .at-more { font-size: 15.5px; color: var(--at-ink); }
#modal-add-task .at-more input { width: 20px; height: 20px; }
#modal-add-task .at-foot .btn-secondary, .aid-foot .btn-secondary { display: inline-flex; align-items: center; height: 54px; padding: 0 26px; border: 1px solid #edf0f5; border-radius: 14px; background: var(--surface); font-size: 15.5px; font-weight: 600; color: var(--at-ink); box-shadow: 0 2px 6px rgba(15, 23, 42, .05); }
#modal-add-task .at-foot .btn-secondary:hover, .aid-foot .btn-secondary:hover:not(:disabled) { background: #eef1f6; }
#add-task-submit { height: 54px; padding: 0 26px; border: 0; border-radius: 14px; background: var(--at-blue); font-size: 15.5px; font-weight: 600; color: #fff; box-shadow: none; }
#add-task-submit:hover:not(:disabled) { background: var(--at-blue2); }
/* Bảng AI tạo việc (aiwrite.js aidHTML), dùng chung với hộp AI Agent chia nhỏ */
.aid-panel { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.aid-panel[hidden] { display: none; }
#modal-aid .aid-box { display: flex; flex-direction: column; width: min(800px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 40px); padding: 0; overflow: hidden; border-radius: 24px; }
.aid-head { position: relative; flex: none; display: flex; align-items: flex-start; gap: 10px; padding: 22px 28px 16px 26px; border-radius: 24px 24px 0 0; background: radial-gradient(62% 100% at 96% 0%, #f0e9ff 0%, rgba(240, 233, 255, 0) 100%); }
.aid-ic { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #f2eefe; color: #5b2df0; }
.aid-head-txt { flex: 1; min-width: 0; padding-top: 6px; }
.aid-head h2 { margin: 0 0 6px; font-size: 29px; font-weight: 700; line-height: 1.2; color: var(--at-ink, #0f172a); }
.aid-head p { max-width: 590px; margin: 0; font-size: 15.5px; line-height: 1.6; color: #465071; }
.aid-head-acts { position: relative; flex: none; display: flex; align-items: center; gap: 8px; }
.aid-back { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border: 1px solid #edf0f5; border-radius: 12px; background: var(--surface); font: inherit; font-size: 14px; font-weight: 500; color: #0f172a; cursor: pointer; transition: background-color .2s ease; }
.aid-back:hover:not(:disabled) { background: #eef1f6; }
.aid-back:disabled { cursor: not-allowed; opacity: .6; }
.aid-star { position: absolute; color: #d9cdfa; pointer-events: none; }
.aid-star.s1 { top: 26px; right: 130px; display: none; }
.aid-star.s2 { top: 100px; right: 44px; }
.aid-star.s3 { top: 104px; left: 14px; }
.aid-main { flex: 1 1 auto; min-height: 0; padding: 4px 28px 16px; overflow-y: auto; }
.aid-input { position: relative; }
.aid-input textarea { display: block; width: 100%; height: 130px; padding: 18px 56px 14px 22px; border: 1px solid var(--at-line, #dfe4ee); border-radius: 18px; background: var(--surface); font: inherit; font-size: 16px; line-height: 1.6; color: #0f172a; resize: vertical; transition: border-color .2s ease, box-shadow .2s ease; }
.aid-input textarea::placeholder { color: #6b7690; }
.aid-input textarea:focus { border-color: #8c6ef6; box-shadow: 0 0 0 3px #f2eefe; outline: 0; }
.aid-input .aiw-mic { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; }
.aid-listen:not(:empty) { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.aid-main > .field-error, .aid-results .field-error { margin: 8px 0 0; }
.aid-run-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.aid-run { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 30px; border: 0; border-radius: 16px; background: #8c6ef6; font: inherit; font-size: 16.5px; font-weight: 600; color: #fff; cursor: pointer; transition: background-color .2s ease; }
.aid-run:hover:not(:disabled) { background: #7a5be8; }
.aid-run:disabled { cursor: not-allowed; opacity: .6; }
.aid-loading { display: flex; flex-direction: column; gap: 12px; padding: 22px 2px; font-size: 14px; color: var(--ink); }
.aid-results { margin-top: 12px; }
.aid-res-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.aid-res-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #f4f6fb; color: #5b6680; }
.aid-res-head h3 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; color: #0f172a; }
.aid-all { display: inline-flex; align-items: center; gap: 10px; font-size: 15.5px; color: #1f2a44; cursor: pointer; }
.aid-check { flex: none; width: 22px; height: 22px; margin: 0; border-radius: 6px; accent-color: #0393f7; cursor: pointer; }
.aid-rows { display: flex; flex-direction: column; border: 1px solid #f0f2f8; border-radius: 16px; }
.aid-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 146px 160px 120px; align-items: center; gap: 10px; min-height: 82px; padding: 10px 8px 10px 12px; transition: opacity .2s ease; }
.aid-row + .aid-row { border-top: 1px solid #f0f2f8; }
.aid-rows.no-pick .aid-row { grid-template-columns: 22px minmax(0, 1fr) 160px 120px; }
.aid-namebox { min-width: 0; }
.aid-namebox .field-error { margin: 3px 0 0 6px; }
.aid-name { width: 100%; height: 40px; padding: 0 6px; border: 1px solid transparent; border-radius: 10px; background: none; font: inherit; font-size: 15.5px; font-weight: 500; color: #0f172a; text-overflow: ellipsis; transition: background-color .2s ease, border-color .2s ease; }
.aid-name:hover { background: #f4f6fa; }
.aid-name:focus { border-color: #0393f7; background: var(--surface); outline: 0; }
.aid-row.is-off { opacity: .45; }
/* Ô chọn: chữ / ảnh do mình vẽ, select + date thật phủ trong suốt lên trên để giữ bảng chọn gốc của máy (điện thoại dùng tốt) */
.aid-pick { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; height: 56px; padding: 0 8px; border: 1px solid #edf0f5; border-radius: 14px; background: var(--surface); font-size: 14.5px; color: #1f2a44; box-shadow: 0 2px 6px rgba(15, 23, 42, .03); cursor: pointer; transition: background-color .2s ease; }
.aid-pick:hover { background: #f4f6fa; }
.aid-pick:has(select:focus-visible, input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }
.aid-pick > select, .aid-pick > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.aid-pick > input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; cursor: pointer; }
.aid-pick-val { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.aid-pick-txt { min-width: 0; overflow: hidden; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.aid-pick .at-chip-av { width: 28px; height: 28px; font-size: 10.5px; }
.aid-pri.is-low { color: #0284e0; }
.aid-pri.is-medium { border-color: #fdf1d4; background: #fefdf9; color: #a86b00; }
.aid-pri.is-high { border-color: #fde3e3; background: #fffbfb; color: #dc2f30; }
.aid-pri.is-low svg:first-child { color: #0393f7; }
.aid-pri.is-medium svg:first-child { color: #fdae07; }
.aid-pri.is-high svg:first-child { color: #f84a4b; }
.aid-pri.is-medium:hover { background: #fdf7e6; }
.aid-pri.is-high:hover { background: #fdeeee; }
.aid-foot { flex: none; display: flex; align-items: center; gap: 12px; padding: 20px 26px 26px; border-top: 1px solid #f0f2f7; }
.aid-foot-gap { flex: 1; }
.aid-again { display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 18px; border: 1px solid #edf0f5; border-radius: 12px; background: var(--surface); font: inherit; font-size: 15px; font-weight: 500; color: #0f172a; box-shadow: 0 2px 6px rgba(15, 23, 42, .05); cursor: pointer; transition: background-color .2s ease; }
.aid-again:hover:not(:disabled) { background: #eef1f6; }
.aid-create { display: inline-flex; align-items: center; gap: 9px; height: 54px; padding: 0 26px; border: 0; border-radius: 14px; background: #7b37eb; font: inherit; font-size: 16px; font-weight: 600; color: #fff; cursor: pointer; transition: background-color .2s ease; }
.aid-create:hover:not(:disabled) { background: #6a28d8; }
.aid-create:disabled, .aid-again:disabled { cursor: not-allowed; opacity: .55; }
/* Nút AI Agent ở task con: xanh nước theo chủ dự án */
.aid-chip { background: #e2f6fb; color: #0e7f9f; transition: background-color .2s ease; }
.aid-chip:hover { background: #c9edf6; color: #0e7f9f; }
/* Màn hình thấp (laptop): thu khoảng cách để thấy đủ form và nút Thêm mà không phải cuộn */
@media (min-width: 721px) {
  .at-head { padding-top: 16px; }
  .at-head h2, .aid-head h2 { font-size: 24px; }
  .at-x { width: 38px; height: 38px; }
  .at-mode { padding-top: 8px; }
  .at-mode button { width: 170px; height: 42px; font-size: 15px; }
  #modal-add-task .at-body { padding-top: 10px; }
  .at-lb, #modal-add-task .at-sub-label, #modal-add-task .at-more { font-size: 14.5px; }
  .at-lb { margin-bottom: 4px; }
  .at-lb-row { margin-bottom: 4px; }
  #modal-add-task .at-name { height: 44px; }
  .at-ai-fill { height: 42px; font-size: 14px; }
  #modal-add-task .at-name-field { margin-bottom: 10px; }
  #modal-add-task .at-desc { height: 64px; margin-bottom: 10px; padding: 9px 18px; }
  #modal-add-task .at-pills { gap: 8px 16px; margin-bottom: 8px; }
  #modal-add-task .at-pill { height: 42px; font-size: 14.5px; }
  .at-sub-add { height: 44px; }
  @media (max-height: 700px) {
    .at-head { padding-top: 10px; }
    #modal-add-task { padding-top: 8px; padding-bottom: 8px; }
    #modal-add-task .at-desc { height: 44px; padding-top: 6px; padding-bottom: 6px; }
    #modal-add-task .at-name, #modal-add-task .at-pill { height: 38px; }
    .at-ai-fill { height: 36px; }
    .at-sub-add { height: 36px; }
    #modal-add-task .at-foot { padding-top: 8px; padding-bottom: 10px; }
    #modal-add-task .at-foot .btn-secondary, #add-task-submit { height: 38px; }
  }
  #modal-add-task .at-foot { margin-top: 6px; padding: 12px 26px 14px 36px; }
  #modal-add-task .at-foot .btn-secondary, #add-task-submit, .aid-foot .btn-secondary, .aid-create { height: 44px; }
  .aid-head { padding-top: 14px; padding-bottom: 10px; }
  .aid-head p { font-size: 14.5px; line-height: 1.45; }
  .aid-star.s2, .aid-star.s3 { display: none; }
  .aid-input textarea { height: 80px; padding-top: 10px; font-size: 14.5px; }
  .aid-ic { width: 42px; height: 42px; }
  .aid-ic svg { width: 26px; height: 26px; }
  .aid-res-ic { width: 32px; height: 32px; }
  .aid-res-head { margin-bottom: 8px; }
  .aid-res-head h3 { font-size: 15.5px; }
  .aid-all { font-size: 14px; }
  .aid-check { width: 18px; height: 18px; }
  .aid-run { height: 44px; font-size: 15px; }
  .aid-row { min-height: 66px; padding-top: 6px; padding-bottom: 6px; }
  .aid-pick { height: 50px; }
  .aid-foot { padding: 12px 26px 14px; }
}
@media (max-width: 720px) {
  #modal-add-task { padding: 8px; }
  .at-head { padding: 16px 14px 0 18px; }
  .at-head h2, .aid-head h2 { font-size: 22px; }
  .at-mode { padding: 10px 16px 0; }
  .at-mode button { flex: 1; width: auto; height: 46px; }
  #modal-add-task .at-body { padding: 12px 16px 6px; }
  #modal-add-task .at-pills { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .at-pills .at-pill-wrap:nth-child(3) { grid-column: 1 / -1; }
  .at-ai-fill span { display: none; }
  .at-name-field:has(.at-ai-fill:not([hidden])) .at-name { padding-right: 58px !important; }
  #modal-add-task .at-foot { padding: 14px 16px 16px; }
  #modal-add-task .at-foot .btn-secondary, #add-task-submit { flex: 1; justify-content: center; height: 48px; }
  .aid-panel, .aid-panel:has(.aid-results) { min-height: 0; max-height: calc(100vh - 16px); }
  .aid-head { flex-wrap: wrap; padding: 14px 14px 10px 16px; }
  .aid-ic { width: 42px; height: 42px; }
  .aid-head-txt { order: 3; flex-basis: 100%; padding-top: 0; }
  .aid-head-acts { margin-left: auto; }
  .aid-head p { font-size: 14px; }
  .aid-star { display: none; }
  .aid-main { padding: 4px 14px 12px; }
  .aid-input textarea { height: 104px; padding-left: 14px; font-size: 15px; }
  .aid-run { width: 100%; justify-content: center; height: 48px; }
  .aid-res-head h3 { font-size: 16px; }
  .aid-row, .aid-rows.no-pick .aid-row { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); padding: 10px; }
  .aid-namebox { grid-column: 2 / -1; }
  .aid-person { grid-column: 2 / -1; }
  .aid-due { grid-column: 2; }
  .aid-pri { grid-column: 3; }
  .aid-foot { flex-wrap: wrap; padding: 12px 14px 14px; }
  .aid-foot-gap { display: none; }
  .aid-foot > * { flex: 1; justify-content: center; }
  .aid-create { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { .aid-row, .at-ai-fill, .at-mode button, .aid-pick, .aid-run, .aid-create, .at-x { transition: none; } }
/* ===== Bài đăng: chép theo ảnh mẫu GPT (04/11/2026). Màu + kích thước đọc từ điểm ảnh của mẫu 1536 × 1024. Đè các lớp cũ ở trên ===== */
#view-posts { --primary: #0781fe; --primary-600: #0670e0; --primary-100: #d5e6fd; --primary-50: #e1ecfe; --ink: #0f172a; --ink-soft: #465071; --border-soft: #e9ecf8; --post-fill: #f4f5fc; --post-shadow: 0 6px 20px rgba(86, 100, 170, .08); }
body:has(#view-posts.is-active) .page-content { padding: 14px 14px 24px 20px; }
#view-posts .btn-primary { border-color: var(--primary); background: var(--primary); box-shadow: none; }
#view-posts .btn-primary:hover:not(:disabled) { border-color: var(--primary-600); background: var(--primary-600); }
.posts-layout { grid-template-columns: minmax(0, 805fr) minmax(300px, 422fr); gap: 28px; max-width: none; }
.post-head { margin-bottom: 14px; }
.post-head h1 { font-size: 27px; font-weight: 700; line-height: 1.2; color: var(--ink); }
/* Khung viết: x 271–1072, cao 119 */
.pc { margin-bottom: 10px; padding: 15px 18px; border-color: var(--border-soft); border-radius: 18px; background: #fff; box-shadow: var(--post-shadow); }
.pc .pc-av { width: 38px; height: 38px; }
.pc-row { gap: 11px; }
.pc-inp { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; height: 38px; padding-right: 4px; border: 1px solid var(--border-soft); border-radius: 999px; background: #f6f7fc; transition: background-color .15s ease; }
.pc-inp:hover { background: #eff1fa; }
.pc .pc-ph { height: 100%; padding: 0 15px; border: 0; border-radius: 999px; background: none; font-size: 13.5px; color: var(--ink-soft); }
.pc .pc-ph:hover { border: 0; background: none; }
.pc-qbtn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background-color .15s ease; }
.pc-qmic { width: 30px; color: var(--ink-soft); }
.pc-qmic:hover { background: #e4e7f6; }
.pc-qai { padding: 0 11px; background: #f0ecfd; color: #7c3aed; }
.pc-qai:hover { background: #e5defb; }
.pc-qbtn:focus-visible { outline: 2px solid var(--primary-100); outline-offset: 1px; }
.pc-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 15px 0 0; }
.pc-qtype, .pc-type { --t: #0670e0; --tb: #e7f2fe; border-color: transparent; background: var(--tb); color: var(--t); }
:is(.pc-qtype, .pc-type).tone-rose { --t: #e11d48; --tb: #feebf1; }
:is(.pc-qtype, .pc-type).tone-blue { --t: #0670e0; --tb: #e7f2fe; }
:is(.pc-qtype, .pc-type).tone-green { --t: #0a9d50; --tb: #e7faef; }
:is(.pc-qtype, .pc-type).tone-violet { --t: #7c3aed; --tb: #f0ecfd; }
.pc-qtype { justify-content: center; gap: 8px; height: 37px; border-radius: 12px; font-size: 13.5px; font-weight: 600; }
.pc-type { height: 36px; padding: 0 14px; border-radius: 12px; font-size: 13.5px; }
.pc-qtype:hover, .pc-type:hover:not(:disabled) { border-color: transparent; background: color-mix(in srgb, var(--tb) 88%, var(--t)); }
.pc-type.is-on, .pc-type.is-on:hover:not(:disabled) { border-color: var(--t); }
.pc-types { flex: 1 1 auto; }
.pc-scope { display: flex; align-items: center; gap: 4px; }
.pc-scope-chip { max-width: 170px; height: 36px; padding: 0 13px; border-color: var(--border-soft); background: #fff; font-size: 13.5px; }
.pc-scope-chip[aria-expanded="true"] { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-100); }
.pc-close { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; transition: background-color .15s ease; }
.pc-close:hover, .pc-close:focus-visible { background: var(--post-fill); outline: none; }
.pc.is-open { border-color: #b8d9fd; box-shadow: 0 0 0 3px #e7f2fe, var(--post-shadow); }
.pc-title { margin-top: 14px; font-size: 21px; }
.pc-editor { margin-top: 8px; border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; background: #fff; }
.pc-editor .jodit-toolbar__box:not(:empty) { display: flex; margin: 0; border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; background: #fff; overflow: visible; }
.pc-editor .jodit-wysiwyg { padding: 10px 14px !important; font-size: 14px; }
.pc-editor .aiw-tools { --aiw-c: #7c3aed; }
.pc-opts { margin-top: 12px; }
.pc-opts:has(.pc-switch.is-off) { display: none; }
.pc-foot { margin-top: 12px; padding-top: 12px; }
.pc-acts .btn-primary, .pc-acts .btn-secondary { height: 36px; padding: 0 16px; border-radius: 12px; font-size: 13.5px; }
/* Thẻ lọc: cao 89, nút loại trên, tìm kiếm dưới */
.psf-bar { flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap; gap: 10px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 18px; background: #fbfcff; box-shadow: var(--post-shadow); }
.psf-tabs { display: flex; justify-content: space-between; gap: 4px; padding-right: 32px; overflow-x: auto; scrollbar-width: none; }
.psf-tabs::-webkit-scrollbar { display: none; }
.psf-tab { --t: #0670e0; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 29px; padding: 0 13px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer; transition: background-color .15s ease; }
.psf-tab svg { flex: none; color: var(--t); }
.psf-tab.tone-rose { --t: #e11d48; }
.psf-tab.tone-green { --t: #0a9d50; }
.psf-tab.tone-violet { --t: #7c3aed; }
.psf-tab:hover { background: #eff1fa; }
.psf-tab.is-on, .psf-tab.is-on:hover { background: #e1ecfe; color: #0670e0; }
.psf-tab:focus-visible { outline: 2px solid var(--primary-100); outline-offset: 1px; }
.psf-n { font-size: 12.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.psf-tab.is-on .psf-n { color: inherit; }
.psf-row { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.psf-row .auto-search.psf-search { flex: 1 1 200px; width: auto; max-width: 338px; min-width: 150px; margin: 0; }
.psf-search .search-field { height: 34px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--post-fill); font-size: 13.5px; }
.psf-scope { width: auto; max-width: 180px; height: 34px; padding-left: 13px; border: 1px solid var(--border-soft); border-radius: 12px; background-color: #fbfbfe; font-size: 14px; font-weight: 500; color: var(--ink); }
.psf-unread { gap: 12px; height: 34px; margin: 0 0 0 16px; padding: 0; border: 0; background: none; font-size: 14px; font-weight: 600; color: var(--ink); }
/* Thẻ bài: x 271–1077, lề trái 38, vạch trái xanh nhạt, chấm 11px */
.post-feed { gap: 14px; }
.pcard { position: relative; gap: 4px; padding: 7px 18px 14px 37px; border-color: var(--border-soft); border-left: 3px solid #b8d9fd; border-radius: 16px; background: #fff; box-shadow: var(--post-shadow); }
.post-card:hover, .post-card:focus-visible { border-color: var(--border-soft); border-left-color: #b8d9fd; box-shadow: 0 8px 24px rgba(86, 100, 170, .12); }
.post-card.pcard.is-unread, .post-card.pcard.is-unread:hover { padding-left: 37px; border-left: 3px solid #b8d9fd; }
.post-card.pcard.is-pinned { background: #fff; }
.pcard-dot { position: absolute; top: 19px; left: 14px; width: 11px; height: 11px; background: #087bf7; }
.pcard-dot.is-read { background: #dae7fe; }
.pcard-head { align-items: center; gap: 12px; }
.pcard .pcard-av { width: 36px; height: 36px; font-size: 12px; }
.pcard-who { display: block; }
.pcard-name { flex-wrap: wrap; gap: 2px 10px; min-height: 36px; font-size: 14.5px; }
.pcard-name b { font-weight: 600; }
.pcard-role { padding: 2px 10px; border-radius: 999px; background: #eaf4fe; font-size: 12px; font-weight: 600; color: #0670e0; }
.pcard-who small { font-size: 12.5px; color: var(--ink-soft); }
.pcard-tags { gap: 8px; }
.post-type, .pcard-pin { gap: 5px; height: 22px; padding: 0 9px; border: 0; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1; }
.post-type.tone-rose { background: #fee8ed; color: #e11d48; }
.post-type.tone-blue { background: #e2effd; color: #0670e0; }
.post-type.tone-green { background: #e7faef; color: #0a9d50; }
.post-type.tone-violet { background: #f0ecfd; color: #7c3aed; }
.pcard-pin { display: inline-flex; align-items: center; background: #fef2d1; color: #b7791f; }
.pcard-more { width: 26px; height: 26px; color: var(--ink); }
.pcard .post-title { margin-top: 2px; font-size: 21px; font-weight: 700; line-height: 1.3; color: var(--ink); }
/* Nội dung trên thẻ giữ đúng định dạng đã soạn, dài quá thì mờ dần + Xem thêm */
.pcard-ex { position: relative; margin-top: 2px; }
.pcard .post-excerpt { display: block; -webkit-line-clamp: none; max-height: calc(20px * 5 + 14px); margin: 0; overflow: hidden; font-size: 14px; line-height: 20px; color: var(--ink); opacity: 1; }
.pcard.is-expandable .post-excerpt { -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
.pcard .post-excerpt > :first-child { margin-top: 0; }
.pcard .post-excerpt > :last-child { margin-bottom: 0; }
.pcard .post-excerpt p { margin: 0 0 3px; }
.pcard .post-excerpt h1, .pcard .post-excerpt h2, .pcard .post-excerpt h3 { margin: 0 0 3px; font-size: 14.5px; font-weight: 700; }
:is(.pcard .post-excerpt, .pcard-full .post-content) ul { margin: 2px 0 4px; padding-left: 20px; list-style: disc; }
:is(.pcard .post-excerpt, .pcard-full .post-content) ol { margin: 2px 0 4px; padding-left: 20px; list-style: decimal; }
.pcard-full .post-content { font-size: 14px; line-height: 20px; }
.pcard .pcard-readmore { position: absolute; right: 0; bottom: 0; padding-left: 30px; background: linear-gradient(90deg, transparent, #fff 24px); font-size: 14px; line-height: 20px; font-weight: 500; color: #0a5cf6; text-decoration: underline; }
.pcard-files { flex-wrap: nowrap; align-items: flex-start; gap: 12px; margin-top: 8px; }
.pcard-file { flex: 0 1 225px; min-width: 0; gap: 12px; max-width: 230px; height: 54px; padding: 0 14px 0 18px; border-color: var(--border-soft); border-radius: 12px; background: #f8f8fc; box-shadow: 0 2px 8px rgba(86, 100, 170, .07); transition: background-color .15s ease; }
.pcard-file:hover { border-color: var(--border-soft); background: #eff1fa; }
.pcard-file.is-thumb { flex: 0 1 252px; max-width: 252px; height: 74px; margin-right: 16px; padding: 0; }
.pcard-file.is-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pcard-file.is-more { flex: 0 0 auto; align-self: center; justify-content: center; height: 34px; min-width: 44px; padding: 0 10px; font-weight: 600; }
.pcard-fic { flex: none; display: grid; place-items: center; width: 26px; height: 28px; border-radius: 6px; background: #94a3b8; font-size: 7.5px; font-weight: 800; color: #fff; }
.pcard-fic.is-pdf { background: #fe4653; }
.pcard-fic.is-xls { background: #0cc661; }
.pcard-fic.is-doc { background: #2f9cfe; }
.pcard-fname { display: flex; flex-direction: column; min-width: 0; }
.pcard-fname b { overflow: hidden; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.pcard-fname small { font-size: 12px; color: var(--ink-soft); }
.pcard-foot { gap: 8px; margin-top: 8px; padding-top: 0; border-top: 0; }
.pcard-social { gap: 8px; margin-left: -8px; }
.pcard-react { gap: 6px; height: 28px; padding: 0 10px; border: 0; background: #eff1fa; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.pcard-react[data-key="like"] { background: #e8f3fe; color: #0670e0; }
.pcard-react[data-key="heart"] { background: #ffe8ed; color: #e11d48; }
.pcard-react[data-key="haha"] { background: #e6fbec; color: #0a9d50; }
.pcard-react:hover:not(:disabled), .pcard-react.is-mine { border: 0; filter: brightness(.96); }
.pcard-react[data-key="like"]:hover:not(:disabled), .pcard-react[data-key="like"].is-mine { background: #dcecfe; }
.pcard-react[data-key="heart"]:hover:not(:disabled), .pcard-react[data-key="heart"].is-mine { background: #ffdde4; }
.pcard-react[data-key="haha"]:hover:not(:disabled), .pcard-react[data-key="haha"].is-mine { background: #d8f7e2; }
.pcard-like { width: 28px; height: 28px; border-radius: 50%; color: var(--ink); }
.pcard-cmt { height: 28px; margin-left: 0; padding: 0 8px; font-size: 13px; color: var(--ink); }
.pcard-ack { gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.pcard-ackbtn { height: 28px; padding: 0 13px; border-radius: 999px; font-size: 12.5px; white-space: nowrap; }
.pcard-ackwho { margin-left: 6px; font-weight: 500; color: #0a5cf6; text-decoration: underline; }
button.pcard-ackstat { gap: 8px; padding: 2px 0; font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.pcard-acked { padding: 4px 11px; font-size: 12.5px; }
.pcard-faces .avatar.pcard-face { width: 24px; height: 24px; }
.post-more .btn-secondary { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 30px; border: 0; border-radius: 999px; background: #fff; font-size: 13.5px; font-weight: 600; color: var(--ink); box-shadow: var(--post-shadow); }
.post-more { margin-top: 12px; }
/* Bình luận dưới thẻ (chỉ mở khi bấm) */
.pcm, .post-card.pcard.is-unread .pcm { gap: 8px; margin: 8px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border-soft); border-radius: 0; background: none; }
.pcm-bubble { flex: 1; padding: 8px 14px; border-radius: 12px; background: #eff0fb; box-shadow: none; }
.pcm .post-av { width: 34px; height: 34px; }
.pcm-field { border-color: var(--border-soft); border-radius: 999px; background: #fff; }
/* Cột phải: rộng 422, đầu thẻ cao 52 màu hồng-tím nhạt, biểu tượng vàng đặc, thân gần trắng */
.posts-side { gap: 18px; }
.ps-card { padding: 0; border-color: var(--border-soft); border-radius: 18px; background: #fbfbfe; box-shadow: var(--post-shadow); overflow: hidden; }
.ps-card.ps-tip.is-violet { position: relative; border-color: var(--border-soft); background: #fff; box-shadow: var(--post-shadow); }
.ps-head { position: relative; display: flex; align-items: center; gap: 12px; min-height: 38px; margin: 0; padding: 0 18px; border-bottom: 1px solid #eceefa; background: linear-gradient(90deg, #fef8fa, #f1f0fe); }
.ps-h-ic { flex: none; display: grid; place-items: center; width: 24px; height: 24px; color: #fdb010; }
.ps-card h3, .ps-tip h3 { min-height: 0; margin: 0; gap: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.ps-all { margin-left: auto; padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 500; color: #0a5cf6; cursor: pointer; }
.ps-all:hover { text-decoration: underline; }
.ps-all:focus-visible { outline: 2px solid var(--primary-100); outline-offset: 2px; border-radius: 4px; }
.ps-body { padding: 6px 16px 10px 12px; }
.ps-empty { padding: 8px 6px; font-size: 13px; }
.ps-row { gap: 11px; padding: 10px 0; }
.ps-row + .ps-row { border-top: 0; }
.ps-pins .ps-row + .ps-row { border-top: 1px solid #eceefa; }
.ps-tile { --t: #0670e0; flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #e8f3fe; color: var(--t); }
.ps-tile.tone-rose { --t: #fe4653; background: #fef1f3; }
.ps-tile.tone-green { --t: #0a9d50; background: #eafaf1; }
.ps-tile.tone-violet { --t: #7c3aed; background: #f0eafe; }
.ps-title { gap: 3px; }
.ps-title b { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.ps-title small { overflow: hidden; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; text-overflow: ellipsis; }
.ps-ack { flex: none; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: #e1eefd; font: inherit; font-size: 13.5px; font-weight: 600; color: #0670e0; cursor: pointer; transition: background-color .15s ease; }
.ps-ack:hover { background: #d0e3fc; }
.ps-ack:focus-visible { outline: 2px solid var(--primary-100); outline-offset: 2px; }
.ps-ack:disabled { opacity: .55; cursor: default; }
.ps-tip .ps-head { align-items: flex-start; min-height: 104px; padding-top: 14px; border-bottom: 0; background: linear-gradient(90deg, #f4effd, #f1eefe); overflow: hidden; }
.ps-tip .ps-h-ic { color: #8b5cf6; }
.ps-tip-art { position: absolute; right: 26px; bottom: -4px; width: 150px; height: 80px; pointer-events: none; }
.ps-tip .ps-body { padding: 14px 18px 16px; }
.ps-tips { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ps-tips li { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; line-height: 20px; color: var(--ink); }
.ps-tips svg { flex: none; margin-top: 3px; color: #0cc661; }
@media (max-width: 1100px) {
  .posts-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .psf-tabs { padding-right: 0; }
  .psf-row .auto-search.psf-search { flex: 1 1 100%; max-width: none; }
  .psf-scope { flex: 1; max-width: none; }
  .psf-unread { margin-left: 0; }
  .pc { padding: 12px; }
  .pc-qai span { display: none; }
  .pc-qai { width: 30px; padding: 0; }
  .pc-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pcard { padding: 10px 12px 12px 26px; }
  .post-card.pcard.is-unread, .post-card.pcard.is-unread:hover { padding-left: 26px; }
  .pcard-dot { left: 8px; top: 22px; width: 9px; height: 9px; }
  .pcard .post-title { font-size: 17px; }
  .pcard-pin > span, .pcard-ackwho { display: none; }
  .pc-scope-chip { max-width: 100%; }
  .pcard-files { flex-wrap: wrap; }
  .pcard-file, .pcard-file.is-thumb { flex: 1 1 100%; max-width: none; margin-right: 0; }
  .pcard-social { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .psf-tab, .pc-qbtn, .pc-inp, .pc-close, .pcard-file, .ps-ack { transition: none; } }
/* ===== Tự động hóa › Kiểm tra quy tắc (bảng riêng thay chỗ phần soạn trong hộp thoại; 29/10/2026 theo mẫu chủ dự án) ===== */
.art { display: flex; flex-direction: column; gap: 16px; }
.art-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.art-head-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #dcfce7; color: #16a34a; }
.art-head-t { flex: 1; min-width: 0; }
.art-head-t h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.art-head-t p { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.art-mode { padding: 4px 10px; border-radius: 999px; background: #e0f2fe; color: #0369a1; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.art-close { display: inline-flex; align-items: center; gap: 4px; height: 34px; background: var(--surface-2, #f1f5f9); border-color: transparent; }
.art-close svg { transform: rotate(-90deg); }
.art-cols { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
/* Cột trái */
.art-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.art-search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink-soft); }
.art-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.art-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 13.5px; color: var(--ink); }
.art-filters { display: flex; align-items: center; gap: 6px; }
.art-filter { height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--surface-2, #f1f5f9); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.art-filter.is-on { background: var(--primary); color: #fff; }
.art-keys { margin-left: auto; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.art-list-wrap { position: relative; border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; }
.art-list-wrap::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 28px; background: linear-gradient(to bottom, transparent, var(--surface)); pointer-events: none; }
.art-list { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.art-item { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px 10px 14px; border: 0; border-bottom: 1px solid var(--border-soft); background: var(--surface); font: inherit; text-align: left; color: var(--ink); cursor: pointer; }
.art-item:last-child { border-bottom: 0; }
.art-item:hover, .art-item.is-hl { background: var(--surface-2, #f8fafc); }
.art-item.is-current { background: #f0f9ff; box-shadow: inset 3px 0 0 var(--primary); }
.art-item.is-off { opacity: .55; }
.art-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.art-item-main { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.art-item-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.art-item-name { min-width: 0; overflow: hidden; font-size: 13.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.art-tag { flex: none; padding: 0 7px; border-radius: 6px; background: var(--surface-2, #f1f5f9); font-size: 11px; font-weight: 600; line-height: 18px; color: var(--ink-soft); }
.art-tag.is-fit { background: #dcfce7; color: #15803d; }
.art-item-sub { overflow: hidden; font-size: 12px; color: var(--ink-soft); white-space: nowrap; text-overflow: ellipsis; }
.art-item-check { flex: none; display: inline-grid; place-items: center; width: 18px; color: var(--primary-600); }
.art-empty { margin: 4px 0; font-size: 13px; color: var(--ink-soft); }
/* Cột phải */
.art-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding-left: 24px; border-left: 1px solid var(--border-soft); }
.art-blank { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--ink-soft); }
.art-blank svg { color: var(--primary-600); }
.art-blank p { max-width: 360px; margin: 0; font-size: 13px; line-height: 1.55; }
.art-rhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.art-rhead-t { min-width: 0; }
.art-rhead-t small { font-size: 11.5px; color: var(--ink-soft); }
.art-rhead-t > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.art-rhead-t b { font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.art-link { padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--primary-600); text-decoration: none; cursor: pointer; }
.art-link:hover { text-decoration: underline; }
.art-time { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.art-rerun { display: inline-flex; align-items: center; gap: 5px; height: 34px; border-color: #7dd3fc; color: var(--primary-600); }
.art-spin { width: 14px; height: 14px; border: 2px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: artSpin .8s linear infinite; }
@keyframes artSpin { to { transform: rotate(360deg); } }
.art-skel { display: flex; flex-direction: column; gap: 10px; }
.art-skel span { height: 16px; border-radius: 8px; background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9); background-size: 200% 100%; animation: artShimmer 1.2s ease-in-out infinite; }
.art-skel span.is-banner { height: 58px; border-radius: 12px; }
.art-skel span.is-table { height: 90px; border-radius: 12px; }
@keyframes artShimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.art-banner { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid; border-radius: 12px; }
.art-banner b { display: block; font-size: 14.5px; }
.art-banner p { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink); }
.art-banner-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; color: #fff; }
.art-banner.is-yes { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.art-banner.is-yes .art-banner-ic { background: #22c55e; }
.art-banner.is-warn { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.art-banner.is-warn .art-banner-ic { background: #b45309; }
.art-banner.is-no { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.art-banner.is-no .art-banner-ic { background: #f43f5e; }
.art-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.art-chip { padding: 2px 9px; border-radius: 6px; background: var(--surface-2, #f1f5f9); font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.art-chip.is-yes { background: #dcfce7; color: #15803d; }
.art-chip.is-no { background: #ffe4e6; color: #be123c; }
.art-chip.is-warn { background: #fef3c7; color: #b45309; }
.art-checks { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.art-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-soft); font-size: 13.5px; color: var(--ink); }
.art-check-ic { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 800; }
.art-check.is-yes .art-check-ic { background: #dcfce7; color: #16a34a; }
.art-check.is-no .art-check-ic { background: #ffe4e6; color: #e11d48; }
.art-check.is-info .art-check-ic { background: var(--surface-2, #f1f5f9); color: var(--ink-soft); }
.art-check-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.art-check-t small { font-size: 12px; color: var(--ink-soft); }
.art-check-t .art-link { align-self: flex-start; }
.art-check.is-no .art-check-t > span { font-weight: 600; }
.art-sub { margin-top: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.art-table { border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; }
.art-tr { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--border-soft); font-size: 13px; }
.art-tr.is-head { border-top: 0; background: var(--surface-2, #f8fafc); padding-top: 8px; padding-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.art-act { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.art-muted { color: var(--ink-soft); }
.art-people { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.art-people .avatar.art-av { width: 24px; height: 24px; margin-right: -10px; border: 2px solid var(--surface); font-size: 9px; }
.art-people .avatar.art-av:last-of-type { margin-right: 0; }
.art-people > span:not(.avatar) { margin-left: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.art-res { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.art-badge { padding: 2px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--surface-2, #f1f5f9); color: var(--ink-soft); }
.art-badge.is-ok { background: #dcfce7; color: #15803d; }
.art-badge.is-skip { background: #fef3c7; color: #b45309; }
.art-badge.is-error { background: #ffe4e6; color: #be123c; }
.art-note { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
/* Chân hộp thoại: tóm tắt dạng câu có chip */
.ar-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ar-sum-w { font-weight: 600; color: var(--ink); }
.ar-sum-chip { max-width: 100%; padding: 3px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.ar-sum-chip.is-when { background: #e0f2fe; color: #0369a1; }
.ar-sum-chip.is-if { background: var(--surface-2, #f1f5f9); color: var(--ink-soft); }
.ar-sum-chip.is-then { background: #fef3c7; color: #b45309; }
@media (max-width: 900px) {
  .art-cols { grid-template-columns: minmax(0, 1fr); }
  .art-right { padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--border-soft); }
  .art-list { max-height: 260px; }
}
@media (max-width: 640px) {
  .art-tr { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .art-tr.is-head { display: none; }
  .art-mode { white-space: normal; }
  .art-keys { display: none; }
}
@media (prefers-reduced-motion: reduce) { .art-skel span, .art-spin { animation: none; } }
/* Kiểm tra quy tắc: trạng thái đang kiểm tra / chưa chọn việc / gợi ý sửa điều kiện */
.art-blank b { font-size: 15px; color: var(--ink); }
.art-loading { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink); }
.art-loading .art-spin { width: 18px; height: 18px; }
.art-fixrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.art-fix { padding: 4px 10px; border: 0; border-radius: 8px; background: #e0f2fe; font: inherit; font-size: 12.5px; font-weight: 600; color: #0369a1; cursor: pointer; }
.art-fix:hover, .art-fix:focus-visible { background: #bae6fd; outline: none; }
/* Kiểm tra quy tắc: hộp rộng hơn khi đang kiểm tra, cột danh sách việc rộng + cao hết phần còn trống (đỡ bị bóp) */
.ar-modal-box:has(.art) { width: min(1280px, calc(100vw - 32px)); }
.art-cols { grid-template-columns: minmax(320px, 460px) minmax(0, 1fr); }
.art-list { max-height: max(260px, min(620px, calc(100vh - 360px))); }
/* ===== Đợt 14 · Responsive (29/10/2026): điện thoại + tablet. Quét bằng tests/browser/responsive.js ===== */
@media (max-width: 760px) {
  /* Bảng danh sách công việc (Tổng quan, tab Danh sách, trang Dự án): không co bảng theo màn hình nữa —
     bảng giữ bề rộng tối thiểu và cuộn ngang, cột chọn + cột tên ghim ở mép trái để tên việc luôn đọc được */
  .task-list-view .task-table-v2 { min-width: 760px; }
  /* Trong ô tên: tên việc được ưu tiên chỗ, chip dự án co lại (Tổng quan › Việc của tôi), nút sửa nhanh ẩn (chỉ hiện khi rê chuột) */
  .task-list-view .list-tree-text { flex: 1 1 auto; min-width: 84px; }
  .task-list-view .list-proj-tag { flex: 0 1 auto; min-width: 0; max-width: 42%; overflow: hidden; text-overflow: ellipsis; }
  .task-list-view .task-table-row-v2 > .task-cell-sel { position: sticky; left: 0; z-index: 2; background: var(--surface); }
  .task-list-view .task-table-row-v2 > .task-cell-name { position: sticky; left: 44px; z-index: 2; background: var(--surface); box-shadow: 6px 0 8px -8px rgba(15, 23, 42, .25); }
  .task-list-view .task-table-head-v2 > .task-cell-sel, .task-list-view .task-table-head-v2 > .task-cell-name { background: var(--bg, #f8fafc); }
  .pl-table-scroll .pl-table { min-width: 620px; }
  /* Tab Tổng quan (Việc của tôi / Cần tôi xử lý / Được nhắc đến): 1 dòng, cuộn ngang khi chật */
  .tw-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tw-tabs > * { flex: none; white-space: nowrap; }
}
/* Tablet (≤ 1024px): bảng danh sách công việc giữ bề rộng tối thiểu + cuộn ngang, cột chọn + tên ghim trái, tên việc được ưu tiên chỗ */
@media (min-width: 761px) and (max-width: 1024px) {
  .task-list-view .task-table-v2 { min-width: 940px; }
  .task-list-view .task-table-row-v2 > .task-cell-sel { position: sticky; left: 0; z-index: 2; background: var(--surface); }
  .task-list-view .task-table-row-v2 > .task-cell-name { position: sticky; left: 44px; z-index: 2; background: var(--surface); box-shadow: 6px 0 8px -8px rgba(15, 23, 42, .25); }
  .task-list-view .task-table-head-v2 > .task-cell-sel, .task-list-view .task-table-head-v2 > .task-cell-name { background: var(--bg, #f8fafc); }
  .task-list-view .list-tree-text { flex: 1 1 auto; min-width: 96px; }
  .task-list-view .list-proj-tag { flex: 0 1 auto; min-width: 0; max-width: 42%; overflow: hidden; text-overflow: ellipsis; }
}
.d-flex{
  display: flex;
}
.jc-between{
  justify-content: space-between;
}
/* ===== Cài đặt › Không gian làm việc › Chung (mẫu chủ dự án 02/11/2026): hàng nhãn trái / ô nhập phải, thẻ tóm tắt, Mời thành viên ===== */
.ws-gen-top { display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 22vw, 340px); gap: clamp(12px, 1.1vw, 16px); align-items: start; margin-bottom: clamp(12px, 1.1vw, 16px); }
.ws-gen-top > .set-card, .ws-inv.set-card { margin: 0; }
.ws-rows { display: flex; flex-direction: column; }
.ws-row { display: grid; grid-template-columns: clamp(150px, 15vw, 240px) minmax(0, 1fr); gap: 8px clamp(16px, 1.6vw, 28px); align-items: start; padding: clamp(12px, 1vw, 16px) 0; border-top: 1px solid var(--border-soft); }
.ws-row:first-child { border-top: 0; padding-top: 2px; }
.ws-row:last-child { padding-bottom: 2px; }
.ws-row-label .ws-field-label { font-size: clamp(12.5px, 0.92vw, 14px); }
.ws-row-label .ws-field-hint { margin: 3px 0 0; font-size: clamp(11.5px, 0.82vw, 12.5px); line-height: 1.45; }
.ws-row-ctrl { min-width: 0; }
.ws-row-ctrl .form-error-text { margin: 6px 0 0; }
.ws-row.has-error .form-control { border-color: var(--danger-600); }
/* Thẻ tóm tắt không gian (thay hình trang trí) */
.ws-sum { padding: clamp(14px, 1.2vw, 18px); background: linear-gradient(160deg, #f0f9ff 0%, var(--surface) 55%, #fff1f3 100%); }
.ws-sum-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.ws-sum-av { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; overflow: hidden; background: var(--primary-50); color: var(--primary-600); font-size: 13px; font-weight: 700; }
.ws-sum-av img { width: 100%; height: 100%; object-fit: cover; }
.ws-sum-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-sum-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(13.5px, 1vw, 15px); color: var(--ink); }
.ws-sum-name small { font-size: 12px; color: var(--ink-soft); }
.ws-sum-plan { flex: none; padding: 2px 9px; border-radius: 999px; background: #fef3c7; color: #b45309; font-size: 11.5px; font-weight: 600; }
.ws-sum-plan.is-free { background: #f1f5f9; color: var(--ink-soft); }
.ws-sum-plan.is-pro { background: #dcfce7; color: #15803d; }
.ws-sum-rows { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.ws-sum-row, .ws-sum-owner { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: clamp(12px, 0.85vw, 13px); color: var(--ink-soft); }
.ws-sum-row b, .ws-sum-owner b { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink); font-weight: 600; text-align: right; }
.ws-sum-owner { padding-top: 12px; }
.ws-sum-oav { width: 22px; height: 22px; font-size: 9px; border-width: 1px; }
/* Khối Mời thành viên */
.ws-inv .ws-card-head { flex-wrap: wrap; }
.ws-new-tag { padding: 1px 8px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 11px; font-weight: 700; }
.ws-lock-chip { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 3px 10px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ws-inv-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ws-inv-card { --ti: #64748b; --tb: #f1f5f9; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 14px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.ws-inv-card.is-green { --ti: #15803d; --tb: #dcfce7; }
.ws-inv-card.is-blue { --ti: #0369a1; --tb: #e0f2fe; }
.ws-inv-card.is-violet { --ti: #6d28d9; --tb: #ede9fe; }
.ws-inv-card:hover { border-color: var(--border); background: var(--bg); }
.ws-inv-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ws-inv-card.is-on { border-color: var(--primary); background: #f0f9ff; box-shadow: 0 0 0 1px var(--primary); }
.ws-inv-radio { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid #cbd5e1; border-radius: 50%; background: var(--surface); color: #fff; }
.ws-inv-card.is-on .ws-inv-radio { border-color: var(--primary); background: var(--primary); }
.ws-inv-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--tb); color: var(--ti); }
.ws-inv-card b { padding-right: 22px; font-size: clamp(12.5px, 0.92vw, 14px); font-weight: 600; color: var(--ink); }
.ws-inv-card p { flex: 1; margin: 0; font-size: clamp(11.5px, 0.8vw, 12.5px); line-height: 1.45; color: var(--ink-soft); }
.ws-inv-tag { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 8px; border: 0; border-radius: 6px; font: inherit; font-size: 11.5px; font-weight: 600; }
.ws-inv-tag.is-slate { background: #f1f5f9; color: #475569; }
.ws-inv-tag.is-green { background: #dcfce7; color: #15803d; }
.ws-inv-tag.is-blue { background: #e0f2fe; color: #0369a1; }
.ws-inv-tag.is-violet { background: #ede9fe; color: #6d28d9; }
.ws-inv-pick { cursor: pointer; }
.ws-inv-pick svg { flex: none; transform: rotate(90deg); }
.ws-inv-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; width: max(100%, 240px); max-height: 260px; overflow-y: auto; padding: 5px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 24px rgba(15, 23, 42, .14); cursor: default; }
.ws-inv-opt-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: none; font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; }
.ws-inv-opt-row i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--rc); }
.ws-inv-opt-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-inv-opt-row small { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--ink-soft); }
.ws-inv-opt-row:hover:not(:disabled), .ws-inv-opt-row:focus-visible { background: var(--bg); outline: none; }
.ws-inv-opt-row.is-on { background: var(--primary-50); }
.ws-inv-opt-row:disabled { cursor: not-allowed; color: var(--muted); }
.ws-inv-empty { margin: 4px 8px 6px; font-size: 12px; color: var(--ink-soft); }
.ws-inv-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border: 1px solid; border-radius: 10px; font-size: clamp(12px, 0.85vw, 13px); line-height: 1.45; }
.ws-inv-note svg { flex: none; }
.ws-inv-note span { flex: 1; min-width: 0; }
.ws-inv-note .pl-link-btn { flex: none; white-space: nowrap; }
.ws-inv-note.is-cost { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ws-inv-note.is-info { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.ws-inv-note.is-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.ws-inv-opt { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.ws-inv-opt .auto-switch { margin-top: 1px; }
.ws-inv-opt b { display: block; font-size: clamp(12.5px, 0.92vw, 14px); font-weight: 600; color: var(--ink); }
.ws-inv-opt small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-soft); }
.ws-inv-foot { margin: 12px 0 0; font-size: 12px; color: var(--ink-soft); }
.save-bar-detail { margin-left: 6px; font-size: 12px; color: var(--ink-soft); }
/* Nhãn chờ gán vai trò ở danh sách thành viên */
.role-pill.is-pending { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
@container setmain (max-width: 900px) {
  .ws-gen-top { grid-template-columns: minmax(0, 1fr); }
  .ws-inv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container setmain (max-width: 640px) {
  .ws-row { grid-template-columns: minmax(0, 1fr); }
  .ws-lock-chip { margin-left: 0; }
}
@container setmain (max-width: 420px) { .ws-inv-cards { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .ws-inv-card { transition: none; } }
/* Hộp Mời thành viên (mẫu 02/11/2026): chấm đặc = chiếm seat, chấm rỗng = không; giá chỉ ở chú thích khi rê biểu tượng seat */
/* Nút đóng xám (không đỏ như nút nguy hiểm), cùng kiểu hộp Quy tắc tự động */
#modal-add-member .modal-head .icon-btn.invite-close { border-color: var(--border); background: var(--surface); color: var(--ink-soft); }
#modal-add-member .modal-head .icon-btn.invite-close:hover { border-color: var(--border); background: var(--bg); color: var(--ink); box-shadow: none; }
/* Ô nhiều email: chip + ô gõ chung 1 khung */
.invite-emails { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px; height: auto; padding: 5px 8px; cursor: text; }
.invite-emails:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.invite-email-chips { display: contents; }
.invite-emails input { flex: 1 1 140px; min-width: 120px; height: 30px; padding: 0 4px; border: 0; outline: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); }
.invite-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 4px 3px 9px; border-radius: 6px; background: var(--primary-50); color: var(--primary-600); font-size: 12.5px; font-weight: 600; }
.invite-chip.is-bad { background: #fff1f2; color: var(--danger-600); }
.invite-chip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px; background: none; color: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.invite-chip button:hover, .invite-chip button:focus-visible { background: rgba(15, 23, 42, .08); outline: none; }
/* Ô vai trò: dòng vai trò đang chọn, bấm = xổ danh sách ngay dưới */
.invite-role { position: relative; }
.invite-role-native { display: none !important; }
.invite-role-default { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); font-size: 13.5px; transition: border-color .2s ease, box-shadow .2s ease; }
.invite-role:not(.is-locked) .invite-role-default { cursor: pointer; }
.invite-role:not(.is-locked) .invite-role-default:hover { border-color: #cbd5e1; }
.invite-role-default:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.invite-role.is-open .invite-role-default { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.invite-role.is-locked .invite-role-default { background: var(--bg); }
.invite-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--rc); border: 2px solid var(--rc); box-sizing: border-box; }
.invite-dot.is-free { background: transparent; }
.invite-role-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.invite-role-tag { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--primary-50); color: var(--primary-600); font-size: 11.5px; font-style: normal; font-weight: 600; }
.invite-role-end { display: inline-flex; align-items: center; gap: 8px; flex: none; margin-left: auto; color: var(--ink-soft); }
.invite-role-end small { font-size: 12px; color: var(--muted); }
.invite-role-caret { transform: rotate(90deg); color: var(--ink-soft); }
.invite-role-close { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.invite-role-close svg { transform: rotate(-90deg); }
.invite-plus-seat { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border: 1px solid var(--border-soft); border-radius: 6px; background: var(--bg); font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.invite-role-list { max-height: 0; margin-top: 0; overflow: hidden; opacity: 0; transform: translateY(-6px); border: 1px solid transparent; border-radius: var(--radius-md); background: var(--surface); transition: max-height .25s ease, opacity .2s ease, transform .2s ease, margin-top .2s ease, border-color .2s ease; }
.invite-role.is-open .invite-role-list { max-height: 300px; margin-top: 6px; overflow-y: auto; padding: 4px; opacity: 1; transform: none; border-color: var(--border-soft); box-shadow: 0 10px 24px rgba(15, 23, 42, .1); }
.invite-role-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; }
.invite-role-opt > span:not(.invite-seat):not(.invite-role-check) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-role-opt:hover, .invite-role-opt:focus-visible { background: var(--bg); outline: none; }
.invite-role-opt.is-on { background: var(--primary-50); font-weight: 600; }
.invite-role-check { flex: none; width: 14px; height: 14px; color: var(--primary-600); }
.invite-seat { display: inline-grid; place-items: center; flex: none; color: var(--ink-soft); cursor: help; }
.invite-seat.is-row { width: 16px; }
.invite-seat.is-none { cursor: default; }
/* Cách B: 2 nhóm "Làm việc cùng bạn" (chiếm seat) / "Chỉ xem", tiêu đề nhỏ, biểu tượng seat ở góc phải tiêu đề */
.invite-group + .invite-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border-soft); }
.invite-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.invite-legend { display: flex; gap: 16px; margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--border-soft); font-size: 11.5px; color: var(--ink-soft); }
.invite-legend span { display: inline-flex; align-items: center; gap: 6px; }
/* Ghi chú trung tính dưới ô vai trò + tổng ở chân hộp */
.invite-note:empty { display: none; }
.invite-note-box { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 12.5px; color: var(--ink-soft); }
.invite-note .form-hint { margin-top: 6px; }
.invite-foot-sum { display: inline-flex; align-items: center; gap: 4px; margin-right: auto; font-size: 13px; color: var(--ink-soft); }
.invite-foot-seat { display: inline-flex; align-items: center; gap: 3px; }
@media (prefers-reduced-motion: reduce) { .invite-role-default, .invite-role-list { transition: none; } }

/* ---------- Tab Kế hoạch của dự án (planner.js, ảnh mẫu B1–B4 03/11/2026) ----------
   Cột như Kanban: --kc = màu cột (chữ tiêu đề + viền khi rê), nền cột = --kc pha mờ. Nhiều cột thì cuộn ngang (kiểu Trello). */
.toolbar .tb-kh-only { display: none; }
.page-view:has(input[id$="-planner"]:checked) .toolbar .tb-kh-only { display: inline-flex; }
.page-view:has(input[id$="-planner"]:checked) .toolbar .tb-add-task { display: none; }
.kh-view { position: relative; }
.kh-board { display: flex; align-items: stretch; gap: 14px; overflow-x: auto; padding: 6px 2px 14px; scroll-snap-type: x proximity; }
.kh-col { flex: 0 0 clamp(250px, 19vw, 296px); display: flex; flex-direction: column; gap: 10px; height: var(--kh-col-h, max(380px, calc(100vh - 300px))); padding: 10px;
  border: 1px solid color-mix(in srgb, var(--kc) 22%, transparent); border-radius: 18px; background: color-mix(in srgb, var(--kc) 7%, var(--surface));
  scroll-snap-align: start; transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease, opacity .2s ease, height .2s ease; outline: 2px dashed transparent; outline-offset: -2px; }
.kh-col:hover { border-color: color-mix(in srgb, var(--kc) 55%, transparent); }
.kh-col.is-inbox { background: var(--surface); }
.kh-col.is-drag-over { border-color: color-mix(in srgb, var(--kc) 55%, transparent); background: color-mix(in srgb, var(--kc) 10%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kc) 12%, transparent); }
.kh-col.is-dragging { opacity: .45; }
.kh-col.is-col-drop-l { box-shadow: -4px 0 0 var(--primary); }
.kh-col.is-col-drop-r { box-shadow: 4px 0 0 var(--primary); }
.kh-col-head { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 2px; }
.kh-col-name { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 6px; border: 1px solid transparent; border-radius: 8px; font-size: 16px; font-weight: 700; color: color-mix(in srgb, var(--kc) 82%, #0f172a); }
.kh-col-name.is-editable { cursor: text; transition: background-color .2s ease, border-color .2s ease; }
.kh-col-name.is-editable:hover { background: color-mix(in srgb, var(--kc) 10%, var(--surface)); border-color: color-mix(in srgb, var(--kc) 25%, transparent); }
.kh-col-name:focus-visible { outline: 2px solid var(--kc); outline-offset: 1px; }
.kh-col.is-inbox .kh-col-name { color: var(--ink); }
.kh-col-count { flex: none; min-width: 24px; padding: 1px 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--kc) 14%, var(--surface)); color: color-mix(in srgb, var(--kc) 82%, #0f172a); font-size: 12.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.kh-col-rule { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: #f59e0b; cursor: pointer; transition: background-color .2s ease; }
.kh-col-rule:hover:not(:disabled) { background: #fef3c7; }
.kh-col-rule:disabled { cursor: default; opacity: 1; }
.kh-col-menu { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: auto; border: 1px solid transparent; border-radius: 9px; background: transparent; color: color-mix(in srgb, var(--kc) 70%, #334155); cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.kh-col-menu:hover { background: color-mix(in srgb, var(--kc) 14%, var(--surface)); border-color: color-mix(in srgb, var(--kc) 30%, transparent); }
/* Ô sửa tên cột tại chỗ: cùng cỡ chữ với tên cột */
.kh-col-rename { width: 100%; min-width: 0; padding: 3px 6px; border: 1px solid var(--kc, var(--primary)); border-radius: 8px; background: var(--surface); font: inherit; font-size: 16px; font-weight: 700; color: var(--ink); }
.kh-col-rename:focus { outline: 2px solid color-mix(in srgb, var(--kc, var(--primary)) 30%, transparent); }
/* Ô nhập + nút Thêm / Hủy (thêm việc, thêm nhanh, thêm cột) */
.kh-quick.form-field, .kh-add-in.form-field, .kh-newcol.form-field { margin-bottom: 0; }
.kh-quick-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); font: inherit; font-size: 13.5px; color: var(--ink); }
.kh-quick-input:focus { outline: 2px solid color-mix(in srgb, var(--kc, var(--primary)) 30%, transparent); border-color: var(--kc, var(--primary)); }
.kh-newcol .kh-col-rename { font-size: 14.5px; font-weight: 600; padding: 8px 10px; }
.kh-add-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kh-add-actions .btn-primary { padding: 7px 14px; font-size: 13px; }
.kh-add-cancel { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background-color .2s ease; }
.kh-add-cancel:hover { background: color-mix(in srgb, var(--kc, var(--primary)) 12%, var(--surface)); color: var(--ink); }
/* Thêm nhanh ở Chưa xếp: nút chỉ hiện khi đang gõ */
.kh-quick:not(:focus-within):not(.has-error) .kh-add-actions { display: none; }
.kh-view .form-field.has-error .kh-quick-input, .kh-view .form-field.has-error .kh-col-rename { border-color: var(--danger-600); }
.kh-view .form-error-text { margin: 6px 2px 0; }
.kh-col-body { display: flex; flex-direction: column; gap: 10px; flex: 0 1 auto; min-height: 60px; overflow-y: auto; padding: 4px; margin: -4px; }
.kh-add-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 9px; border: 1px dashed color-mix(in srgb, var(--kc) 35%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--kc) 6%, var(--surface)); color: color-mix(in srgb, var(--kc) 82%, #0f172a); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background-color .2s ease; }
.kh-add-btn:hover { background: color-mix(in srgb, var(--kc) 13%, var(--surface)); }
.kh-empty { padding: 22px 12px; }
.kh-empty .empty-state-icon { width: 38px; height: 38px; }
.kh-empty p { font-size: 12.5px; }
/* Thẻ việc: rê vào nhấc nhẹ lên 2px trong 0,2 giây (không đổi kích thước bên trong nên không giật) */
.kh-card { position: relative; flex: none; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease; }
.kh-card:hover, .kh-card:focus-visible { border-color: var(--kc); box-shadow: 0 10px 22px color-mix(in srgb, var(--kc) 18%, transparent); transform: translateY(-2px); }
.kh-card:focus-visible { outline: 2px solid var(--kc); outline-offset: 2px; }
.kh-card[draggable="true"] { cursor: grab; }
/* Kéo thẻ (planner.js khGhost* / khSlotTo): thẻ gốc rút khỏi cột, chỗ sẽ thả = ô viền đứt xanh cao bằng thẻ;
   ảnh đi theo con trỏ = bản sao thẻ đục, nghiêng nhẹ, viền xanh, bóng nổi (nằm ngoài cột nên không bị khung cột cắt) */
.kh-card.is-dragging { display: none; }
.kh-drop-slot { flex: none; box-sizing: border-box; border: 2px dashed color-mix(in srgb, var(--primary) 55%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--primary) 7%, transparent); }
.kh-col-body:has(.kh-drop-slot) .kh-empty { display: none; }
.kh-drag-ghost { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; will-change: transform; transform-origin: 30% 50%; }
.kh-drag-ghost .kh-card { margin: 0; transform: none; border: 1.5px solid var(--primary); background: var(--surface); box-shadow: 0 22px 44px rgba(15, 23, 42, .18), 0 4px 12px rgba(15, 23, 42, .08); }
.kh-drag-ghost .kh-card-more { display: none; }
.kh-drag-ghost.is-landing { transition: transform .2s ease, opacity .2s ease; }
.kh-card-in { display: flex; flex-direction: column; gap: 8px; padding: 11px 12px; }
.kh-card-top { display: flex; align-items: flex-start; gap: 7px; }
.kh-card-top .pl-status-icon { margin-top: 1px; }
.kh-card-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 400; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.kh-card-more { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -3px -4px 0 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .2s ease, background-color .2s ease; }
.kh-card:hover .kh-card-more, .kh-card:focus-within .kh-card-more { opacity: 1; }
.kh-card-more:hover { background: var(--bg); color: var(--ink); }
/* Tiến độ task con (như thẻ Kanban, thanh xanh lá) */
.kh-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 8px; font-size: 12px; color: var(--ink-soft); }
.kh-progress-label { display: inline-flex; align-items: center; gap: 5px; }
.kh-progress-count { font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.kh-progress-track { grid-column: 1 / -1; height: 5px; border-radius: var(--radius-pill); background: var(--border-soft); overflow: hidden; }
.kh-progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--success); }
.kh-card-foot { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.kh-meta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kh-card-avatars { margin-left: auto; display: inline-flex; }
.kh-card-avatars .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.kh-due { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 7px; background: #f1f5f9; color: var(--ink-soft); font-size: 12px; font-weight: 600; white-space: nowrap; }
.kh-due.is-today { background: #ffedd5; color: #c2410c; }
.kh-due.is-overdue { background: var(--danger-50); color: var(--danger-600); }
.kh-card.is-done .kh-card-title { color: var(--muted); }
/* Bìa: trên đầu thẻ (ảnh cao 120px / màu 36px) hoặc phủ cả thẻ (ảnh làm nền, chữ trên dải trắng mờ ở đáy).
   Ảnh lệch tỷ lệ: mặc định cắt vừa khung; "Hiện đủ ảnh" (.is-contain) để chỗ thừa trong suốt */
.kh-cover { height: 36px; }
.kh-cover.is-img { height: 120px; background: var(--bg); }
.kh-cover.is-img.is-contain { background: transparent; }
.kh-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kh-cover.is-contain img { object-fit: contain; }
.kh-card.is-cover-full { display: grid; }
.kh-card.is-cover-full > .kh-cover { grid-area: 1 / 1; height: auto; min-height: 140px; }
.kh-card.is-cover-full > .kh-card-in { grid-area: 1 / 1; align-self: end; background: linear-gradient(to top, rgba(255, 255, 255, .96) 62%, rgba(255, 255, 255, 0)); padding-top: 26px; }
.kh-card.is-cover-full > .kh-cover:not(.is-img) + .kh-card-in { background: transparent; }
/* Ô "Thêm cột" cuối bảng */
.kh-col-ghost { flex: 0 0 clamp(220px, 16vw, 260px); align-self: stretch; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1.5px dashed #cbd5e1; border-radius: 18px; background: rgba(255, 255, 255, .5); color: var(--primary-600); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.kh-col-ghost:hover { background: var(--primary-50); border-color: var(--primary); }
.kh-col-ghost-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--primary-50); }
.kh-state { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 220px; color: var(--ink-soft); font-size: 14px; }
.kh-state.is-error { flex-direction: column; color: var(--danger-600); }
.kh-state p { margin: 0; }
.kh-spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: khSpin .8s linear infinite; }
@keyframes khSpin { to { transform: rotate(360deg); } }
/* Menu nổi: Thao tác với cột (B3) / với việc. Hiệu ứng mở chỉ ở lần đầu (.is-new) để đổi màu / sắp xếp không chớp lại */
.kh-pop { position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; padding: 10px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 16px; box-shadow: var(--shadow-lg); }
.kh-pop.is-new { animation: plPopIn .2s ease-out; }
.kh-pop-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.kh-pop-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; color: var(--ink); }
.kh-pop-x { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.kh-pop-x:hover { background: var(--bg); color: var(--ink); }
.kh-pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: background-color .2s ease; }
.kh-pop-item:hover:not(:disabled) { background: var(--bg); }
.kh-pop-item:disabled { cursor: default; }
.kh-pop-item svg { flex: none; color: var(--ink-soft); }
.kh-pop-item svg.is-auto { color: #f59e0b; }
.kh-pop-item.is-danger, .kh-pop-item.is-danger svg { color: var(--danger-600); }
.kh-pop-meta { margin-left: auto; font-size: 12px; color: var(--primary-600); font-weight: 600; white-space: nowrap; }
.kh-pop-meta.is-empty { color: var(--muted); font-weight: 500; }
.kh-pop-col i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.kh-pop-col.is-on { background: var(--primary-50); }
/* Tiêu đề mục trong menu (Màu cột, Sắp xếp theo, Tự động hóa…): nhỏ, vừa đậm, màu chữ phụ */
.kh-pop-label { margin: 10px 4px 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.kh-pop-sep { height: 1px; margin: 8px 2px; background: var(--border-soft); }
.kh-pop-note { margin: 6px 4px; font-size: 12.5px; color: var(--ink-soft); }
.kh-swatches { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 4px; }
.kh-swatch { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 2px solid var(--surface); border-radius: 50%; background: var(--sw); box-shadow: 0 0 0 1px color-mix(in srgb, var(--sw) 40%, transparent); color: #fff; cursor: pointer; transition: box-shadow .2s ease; }
.kh-swatch.is-on, .kh-swatch:hover { box-shadow: 0 0 0 2px var(--sw); }
/* Ô nhiều màu: mở bộ chọn màu tự do (colorPickerHTML, như Ghi chú dán) */
.kh-swatch.is-rainbow { --sw: #94a3b8; background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444); }
.kh-swatch.is-rainbow.is-open { box-shadow: 0 0 0 2px var(--primary); }
.kh-swatch.is-rainbow svg { filter: drop-shadow(0 0 1px rgba(15, 23, 42, .6)); }
.kh-colpick { margin: 10px 4px 2px; }
.kh-seg { display: flex; gap: 6px; padding: 0 4px; }
.kh-seg-btn { flex: 1; padding: 7px 6px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.kh-seg-btn:hover:not(:disabled) { background: var(--bg); }
.kh-seg-btn:disabled { cursor: not-allowed; opacity: .55; }
.kh-seg-btn.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); font-weight: 600; }
/* Khung quy tắc của cột (khRulePopHTML, bản thiết kế chủ dự án 04/11/2026): đầu khung ‹ tiêu đề ✕ · thẻ cam "có quy tắc tự động" + công tắc ·
   nhãn viên "Khi" / "Rồi" · thẻ sự kiện (xanh lá) · mỗi thao tác 1 hàng (ô biểu tượng · tên · ô chọn · ✕) · Thêm thao tác viền đứt xanh ·
   hộp ghi chú quyền xám · chân Xóa quy tắc / Hủy / Lưu quy tắc. Khung "Thêm thao tác" (.kh-pick-pop) nằm riêng bên cạnh. */
.kh-rule-pop { width: 360px; padding: 10px 12px 12px; border-radius: 16px; display: flex; flex-direction: column; gap: 8px; }
.kh-rule-phead { padding: 0 0 2px; }
.kh-rule-phead strong { text-align: center; font-size: 14px; font-weight: 700; white-space: normal; }
.kh-rule-dot { color: var(--muted); font-weight: 400; }
.kh-rico { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; --rc: var(--primary-600); background: color-mix(in srgb, var(--rc) 12%, var(--surface)); color: var(--rc); }
.kh-rico.is-green { --rc: #059669; }
.kh-rico.is-orange { --rc: #ea580c; }
.kh-rico.is-amber { --rc: #d97706; }
.kh-rico.is-red { --rc: var(--danger-600); }
.kh-rule-hero { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.kh-rule-hero .kh-rico { width: 34px; height: 34px; border-radius: 10px; background: #fff3e0; }
.kh-rule-hero > div { flex: 1; min-width: 0; }
.kh-rule-hero strong { display: block; font-size: 13px; color: var(--ink); }
.kh-rule-hero small { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--ink-soft); }
.kh-rule-hero.is-off .kh-rico { filter: grayscale(1); opacity: .6; }
.kh-rule-switch { width: 38px; height: 22px; }
.kh-rule-switch span::before { width: 18px; height: 18px; }
.kh-rule-switch input:checked + span { background: var(--primary-600); }
.kh-rule-switch input:checked + span::before { transform: translateX(16px); }
.kh-rule-switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.kh-rule-step { align-self: flex-start; padding: 2px 9px; border-radius: 7px; background: var(--primary-50); color: var(--primary-600); font-size: 12px; font-weight: 700; }
.kh-rule-when { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.kh-rule-when-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; font-size: 12.5px; color: var(--ink); }
.kh-rule-when-title { font-size: 13px; font-weight: 700; color: #059669; line-height: 28px; margin-bottom: -5px; }
.kh-rule-when-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kh-rule-at { font-size: 13px; color: var(--ink-soft); }
.kh-rule-then { display: flex; flex-direction: column; gap: 6px; }
.kh-rrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-height: 42px; padding: 6px 6px 6px 8px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); }
.kh-rrow-label { flex: 1 1 90px; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.kh-rrow-ctl { display: flex; align-items: center; gap: 5px; flex: 0 1 auto; min-width: 0; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.kh-rrow-x { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.kh-rrow-x:hover { background: var(--danger-50); color: var(--danger-600); }
.kh-select { min-width: 0; max-width: 100%; padding: 5px 8px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink); }
.kh-num { width: 56px; padding: 5px 6px; border: 1px solid var(--border-soft); border-radius: 8px; font: inherit; font-size: 12.5px; }
.kh-time { padding: 4px 6px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink); }
.kh-rule-more { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1.5px dashed color-mix(in srgb, var(--primary) 55%, transparent); border-radius: 10px; background: transparent; color: var(--primary-600); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .2s ease; }
.kh-rule-more:hover, .kh-rule-more.is-on { background: var(--primary-50); }
.kh-rule-info { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border-radius: 10px; background: var(--bg); color: var(--primary-600); }
.kh-rule-info svg { flex: none; margin-top: 1px; }
.kh-rule-info strong { display: block; font-size: 12px; color: var(--ink); }
.kh-rule-info small { display: block; margin-top: 1px; font-size: 11.5px; line-height: 1.4; color: var(--ink-soft); }
.kh-rule-note { margin: 0 2px; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.kh-rule-note.is-warn { color: #b45309; font-weight: 500; }
.kh-rule-err { display: flex; margin: 0 2px; }
.kh-rule-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.kh-rule-foot-r { display: flex; gap: 8px; }
.kh-rule-foot .btn-secondary, .kh-rule-foot .btn-primary { min-height: 34px; padding: 0 14px; font-size: 13px; }
.kh-rule-remove { display: inline-flex; align-items: center; gap: 5px; padding: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--danger-600); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background-color .2s ease; }
.kh-rule-remove:hover { background: var(--danger-50); }
/* Danh sách Thêm thao tác thay chỗ khung quy tắc (cùng .kh-rule-pop: cùng vị trí, cùng cỡ) */
.kh-pick-pop .kh-rule-picklist { margin-top: 2px; }
.kh-rule-picklist { display: flex; flex-direction: column; gap: 5px; }
.kh-rule-pick-btn { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 500; text-align: left; cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.kh-rule-pick-btn:hover { background: var(--bg); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.kh-col-rule.is-off { color: var(--muted); }
.kh-pop-meta.is-off { color: var(--muted); font-weight: 500; }

/* Hộp Bìa */
.kh-cover-box { max-width: 420px; }
.kh-cover-body { display: flex; flex-direction: column; gap: 4px; }
.kh-cover-body .kh-pop-label { margin-left: 0; }
.kh-cover-body .kh-seg { padding: 0; }
.kh-cover-sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kh-cover-size { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1.5px solid var(--border-soft); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; }
.kh-cover-size small { font-size: 12px; color: var(--ink-soft); }
.kh-cover-size.is-on { border-color: var(--primary); background: var(--primary-50); }
.kh-cover-size:disabled { cursor: not-allowed; opacity: .55; }
.kh-cover-mini { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; width: 100%; height: 58px; padding: 6px; border-radius: 8px; background: var(--bg); overflow: hidden; }
.kh-cover-mini i { position: absolute; left: 0; right: 0; top: 0; height: 22px; background: var(--cv); }
.kh-cover-mini.is-full i { height: 100%; }
.kh-cover-mini b { position: relative; display: block; height: 5px; width: 70%; border-radius: 3px; background: #94a3b8; }
.kh-cover-mini b + b { width: 45%; }
.kh-cover-clear { align-self: flex-start; margin-top: 8px; }
.kh-cover-colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.kh-cover-color { height: 34px; border: 2px solid transparent; border-radius: 9px; cursor: pointer; }
.kh-cover-color:hover { filter: brightness(.96); }
.kh-cover-color.is-on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); }
.kh-cover-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kh-cover-img { height: 64px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: var(--bg); cursor: pointer; }
.kh-cover-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kh-cover-img.is-on { border-color: var(--primary); }
.kh-cover-none { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.kh-cover-upload { align-self: stretch; justify-content: center; margin-top: 12px; cursor: pointer; }
.kh-cover-upload.is-disabled { pointer-events: none; opacity: .6; }
.kh-cover-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 640px) {
  .kh-col { flex-basis: min(84vw, 300px); height: auto; min-height: 260px; }
  .kh-col-body { overflow: visible; }
}
@media (max-width: 640px), (hover: none) { .kh-card-more { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kh-col, .kh-card, .kh-card-more, .kh-pop-item { transition: none; } .kh-card:hover { transform: none; } .kh-pop.is-new { animation: none; } .kh-spinner { animation-duration: 2s; } }

/* ---------- Đầu trang dự án bản THU GỌN (projects.js projectCompactHeadHTML, mặc định; mũi tên cạnh tên = xổ bản đầy đủ) ----------
   1 hàng: ô biểu tượng + tên / mô tả · Tiến độ & Thời hạn · Tài liệu & Ghi chú · Thành viên · Thao tác, ngăn bằng vạch dọc mảnh.
   Zoom / khung hẹp: mọi cỡ co theo cqw (bề rộng khung nội dung, tính cả menu trái mà vw không biết) để giữ 1 hàng. Chỉ khi khung quá hẹp mới xuống hàng dưới tên, bỏ vạch dọc. */
.ph-compact { display: flex; align-items: center; gap: 14px 0; margin-bottom: 18px; container-type: inline-size; flex-wrap: wrap; }
.ph-id { display: flex; align-items: center; gap: clamp(8px, 1.2cqw, 14px); flex: 1 1 140px; min-width: 0; padding-right: clamp(6px, 3cqw - 14px, 22px); }
.ph-ico svg { width: 50%; height: 50%; }
.ph-ico { display: inline-grid; place-items: center; width: clamp(36px, 4.7cqw, 56px); height: clamp(36px, 4.7cqw, 56px); flex: none; border-radius: clamp(11px, 1.35cqw, 16px); background: var(--primary-50); border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); color: var(--primary-600); }
.ph-title { min-width: 0; }
.ph-name-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ph-name { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(15px, 1.9cqw, 22px); font-weight: 700; color: var(--ink); }
.ph-desc { margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(11px, 1.06cqw, 12.5px); color: var(--ink-soft); }
.ph-toggle { display: inline-grid; place-items: center; width: clamp(22px, 2.5cqw, 30px); height: clamp(22px, 2.5cqw, 30px); flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; transition: background-color .2s ease, transform .2s ease; }
.ph-toggle:hover { background: var(--bg); }
.ph-toggle.is-open svg { transform: rotate(180deg); }
.project-header-top > .ph-toggle { margin-top: 4px; }
.ph-stat { --pc: var(--primary-600); display: flex; flex-direction: column; gap: clamp(5px, .85cqw, 10px); flex: none; padding: 2px clamp(6px, 3cqw - 14px, 22px); border-left: 1px solid var(--border-soft); }
.ph-stat.is-green { --pc: var(--success-600, #059669); }
.ph-stat.is-violet { --pc: #7c3aed; }
.ph-stat-label { display: flex; align-items: center; gap: clamp(4px, .6cqw, 7px); font-size: clamp(11px, 1.06cqw, 12.5px); font-weight: 600; color: var(--ink); white-space: nowrap; }
.ph-stat-label svg { color: var(--pc); }
.ph-stat-body { display: flex; align-items: center; gap: clamp(5px, .85cqw, 10px); min-height: clamp(28px, 3.2cqw, 38px); white-space: nowrap; }
.ph-bar { display: block; flex: none; width: clamp(26px, 8cqw - 34px, 64px); height: 6px; border-radius: 99px; background: var(--border-soft); overflow: hidden; }
.ph-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.ph-num { font-size: clamp(12.5px, 1.27cqw, 15px); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ph-sep { color: var(--muted); }
.ph-due { font-size: clamp(11.5px, 1.15cqw, 13.5px); color: var(--ink); white-space: nowrap; }
.ph-due.is-soon { color: #c2410c; font-weight: 600; }
.ph-due.is-late { color: var(--danger-600); font-weight: 600; }
.ph-due.is-none, .ph-empty { color: var(--ink-soft); font-size: 13px; }
.ph-count svg { width: clamp(15px, 1.7cqw, 20px); height: clamp(15px, 1.7cqw, 20px); }
.ph-count { display: inline-flex; align-items: center; gap: clamp(3px, .5cqw, 6px); padding: 4px clamp(4px, .7cqw, 8px); margin: 0 -4px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); font: inherit; cursor: pointer; transition: background-color .2s ease; }
.ph-count:hover { background: var(--bg); }
.ph-act svg { width: clamp(14px, 1.5cqw, 18px); height: clamp(14px, 1.5cqw, 18px); }
.ph-act { position: relative; display: inline-grid; place-items: center; width: clamp(28px, 3.2cqw, 38px); height: clamp(28px, 3.2cqw, 38px); border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); color: var(--ink-soft); cursor: pointer; box-shadow: var(--shadow-sm); transition: background-color .2s ease; }
.ph-act:hover { background: var(--bg); color: var(--ink); }
.ph-act.is-danger { color: var(--danger-600); }
.ph-act.is-danger:hover { background: var(--danger-50); }
.ph-act .trash-badge { position: absolute; top: -6px; right: -6px; margin: 0; }
.ph-stat-body .task-menu-btn { width: clamp(28px, 3.2cqw, 38px); height: clamp(28px, 3.2cqw, 38px); border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
@container (max-width: 600px) {
  .ph-id { flex-basis: 100%; padding-right: 0; }
  .ph-stat:nth-child(2) { border-left: 0; padding-left: 0; }
}
@media (max-width: 640px) {
  .ph-stat { border-left: 0; padding: 0 18px 0 0; }
}
/* Đổi qua lại 2 bản đầu trang: lớp chung .tm-collapse rút còn 0,2 giây; mở xong (is-done) mới cho menu ⋯ tràn ra ngoài khung */
.ph-swap, .ph-swap > * { transition-duration: .2s; }
.ph-swap.is-done > * { overflow: visible; }
@media (prefers-reduced-motion: reduce) { .ph-toggle, .ph-count, .ph-act { transition: none; } }
/* Nút Xóa cột trong menu cột tab Kế hoạch: chỉ chữ, căn giữa, nền hồng nhạt như chip quá hạn */
.kh-pop-item.kh-col-del { justify-content: center; margin-top: 4px; background: var(--danger-50); font-weight: 600; }
.kh-pop-item.kh-col-del:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); }

/* ---------- Nói thành chữ + Trợ lý viết AI (aiwrite.js, ảnh mẫu C1–C5) ----------
   Chuyển động: mở / đóng / đổi khung đều 0,2 giây; sóng âm là thứ DUY NHẤT lặp lại, chỉ chạy khi đang nghe (như mẫu, thấy rõ micro đang thu).
   --aiw-c = xanh tím của AI theo mẫu. */
#aiw-float, .aiw-tools, .comment-composer, .aiw-box { --aiw-c: #4f6ef7; }
/* Micro + AI cùng hàng đầu của thanh công cụ, sát phải; bộ nút Jodit chiếm phần còn lại và tự xuống dòng trong phần đó */
.aiw-tools { display: inline-flex; flex: none; align-items: center; gap: 4px; padding: 4px 6px; }
.jodit-toolbar__box:has(.aiw-tools) { display: flex; flex-wrap: nowrap; align-items: flex-start; }
.jodit-toolbar__box:has(.aiw-tools) > .jodit-toolbar-editor-collection { flex: 1 1 0; min-width: 0; }
.aiw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 32px; min-width: 32px; padding: 0 7px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .2s ease, color .2s ease, transform .2s ease, opacity .2s ease; }
.aiw-btn:hover:not(:disabled) { background: var(--bg); color: var(--ink); transform: translateY(-1px); }
.aiw-btn:active:not(:disabled) { transform: scale(.96); }
.aiw-btn:disabled { cursor: not-allowed; opacity: .5; }
.aiw-btn.is-on { background: var(--danger-50); color: var(--danger-600); }
.aiw-ai { padding: 0 10px; background: color-mix(in srgb, var(--aiw-c) 12%, var(--surface)); color: var(--aiw-c); }
.aiw-ai:hover:not(:disabled) { background: color-mix(in srgb, var(--aiw-c) 20%, var(--surface)); color: var(--aiw-c); }
.aiw-btn.is-locked { background: var(--bg); color: var(--muted); }
/* Thanh Đang nghe (C2): mở / thu theo chiều cao */
.aiw-bar { display: grid; grid-template-rows: 0fr; background: var(--surface); transition: grid-template-rows .2s ease; }
.aiw-bar.is-on { grid-template-rows: 1fr; }
.aiw-bar-in { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); opacity: 0; transition: opacity .2s ease; }
.aiw-bar:not(.is-on) .aiw-bar-in { padding-top: 0; padding-bottom: 0; border-bottom: 0; }
.aiw-bar.is-on .aiw-bar-in { opacity: 1; }
.aiw-listen { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px 4px 14px; border-radius: 14px; background: var(--primary-50); font-size: 13.5px; font-weight: 500; }
.aiw-listen:empty { display: none; }
.aiw-listen-text { white-space: nowrap; color: var(--ink); }
.aiw-wave { display: inline-flex; align-items: center; gap: 2.5px; height: 20px; flex: none; color: var(--primary-600); }
.aiw-wave i { display: block; width: 2.5px; height: 18px; border-radius: 2px; background: currentColor; transform: scaleY(.35); animation: aiwWave 1s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -130ms); }
.aiw-wave i:nth-child(3n) { height: 14px; }
.aiw-wave.is-long { margin-left: auto; }
@keyframes aiwWave { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
.aiw-time { font-variant-numeric: tabular-nums; color: var(--ink); margin-left: 4px; }
.aiw-stop { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; background: var(--danger-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-600) 18%, transparent); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.aiw-stop i { display: block; width: 10px; height: 10px; border-radius: 2.5px; background: #fff; }
.aiw-stop:hover { transform: scale(1.08); box-shadow: 0 0 0 5px color-mix(in srgb, var(--danger-600) 18%, transparent); }
.aiw-clean { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); cursor: pointer; }
.aiw-clean.is-locked { color: var(--ink-soft); cursor: default; }
.aiw-switch input:checked + span { background: var(--primary-600); }
.aiw-plan { padding: 2px 9px; border-radius: 999px; background: #fef3c7; color: #b45309; font-size: 11.5px; font-style: normal; font-weight: 600; }
.aiw-live { font-size: 15px; line-height: 1.75; color: var(--muted); word-break: break-word; }
.aiw-live:empty { display: none; }
.aiw-live::after { content: ""; display: inline-block; width: 1.5px; height: 1.05em; margin-left: 2px; vertical-align: -3px; background: var(--ink); }
/* Ô bình luận (C4) */
.aiw-field { position: relative; flex: 1; min-width: 0; display: flex; }
.aiw-field:has(.aiw-mic) textarea.form-control { padding-right: 38px; }
.aiw-field .aiw-mic { position: absolute; right: 4px; bottom: 2px; }
.comment-composer-row > .aiw-ai { flex: none; height: 36px; border-radius: 12px; }
.comment-composer-row .aiw-clip { border-color: transparent; background: transparent; transition: background-color .2s ease, opacity .2s ease; }
.comment-composer-row .aiw-clip:hover { background: var(--bg); }
.comment-send-btn { transition: opacity .2s ease, background-color .2s ease; }
.comment-send-btn:disabled { opacity: .45; }
.aiw-pill { display: none; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.aiw-pill .aiw-listen { min-height: 36px; padding: 2px 4px 2px 12px; border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent); border-radius: 12px; }
.aiw-pill .aiw-stop { width: 26px; height: 26px; box-shadow: none; }
.aiw-pill-live { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aiw-pill-live:empty { display: none; }
.comment-composer.is-listening .aiw-field { display: none; }
.comment-composer.is-listening .aiw-pill { display: flex; animation: aiwFadeUp .2s ease both; }
.comment-composer:not(.is-listening) .aiw-field { animation: aiwFadeUp .2s ease both; }
.comment-composer.is-listening .aiw-clip { opacity: .4; pointer-events: none; }
@keyframes aiwFadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* Menu ✦ AI (C1) + thẻ báo (C5) */
#aiw-float { position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 18px; box-shadow: 0 18px 44px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .06); transform-origin: top right; animation: aiwPopIn .2s cubic-bezier(.2, .8, .3, 1) both; }
#aiw-float[hidden] { display: none; }
#aiw-float.is-closing { pointer-events: none; animation: aiwPopOut .16s ease both; }
@keyframes aiwPopIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes aiwPopOut { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
.aiw-float-menu { width: 330px; max-width: calc(100vw - 16px); max-height: min(580px, calc(100vh - 16px)); overflow-y: auto; padding: 10px; }
.aiw-ask { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border: 1px solid var(--border-soft); border-radius: 12px; color: var(--aiw-c); transition: border-color .2s ease, box-shadow .2s ease; }
.aiw-ask:focus-within { border-color: var(--aiw-c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aiw-c) 14%, transparent); }
.aiw-ask input { flex: 1; min-width: 0; height: 30px; padding: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ink); }
.aiw-ask-mic { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background-color .2s ease; }
.aiw-ask-mic:hover { background: var(--bg); }
.aiw-ask-mic.is-on { background: var(--danger-50); color: var(--danger-600); }
.aiw-menu-label { margin: 12px 10px 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.aiw-menu-label em { font-style: normal; font-weight: 500; color: var(--aiw-c); }
.aiw-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 38px; padding: 7px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: background-color .2s ease; animation: aiwRowIn .2s ease both; animation-delay: calc(var(--i) * 14ms); }
@keyframes aiwRowIn { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
.aiw-row > svg { flex: none; color: var(--aiw-c); transition: transform .2s ease; }
.aiw-row.is-active > svg:first-child { transform: scale(1.1); }
.aiw-row > span { flex: 1; min-width: 0; }
.aiw-row b { display: block; font-weight: 500; }
.aiw-row small { display: block; margin-top: 1px; font-size: 11.5px; color: var(--ink-soft); }
.aiw-row.is-active { background: color-mix(in srgb, var(--aiw-c) 10%, var(--surface)); }
.aiw-row:disabled { opacity: .45; cursor: not-allowed; }
.aiw-tones { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 8px 8px 39px; }
.aiw-tones-wrap, .aiw-tones-wrap > * { transition-duration: .2s; }
.aiw-tone { padding: 5px 11px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.aiw-tone:hover { background: color-mix(in srgb, var(--aiw-c) 10%, var(--surface)); border-color: var(--aiw-c); }
.aiw-menu-hint { margin: 8px 10px; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.aiw-float-notice { width: 290px; max-width: calc(100vw - 16px); padding: 14px; font-size: 13px; color: var(--ink); }
.aiw-notice-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 12px; }
.aiw-notice-head strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.aiw-notice-head svg { color: var(--aiw-c); }
.aiw-notice-head .kh-pop-x svg { color: var(--muted); }
.aiw-notice-main { display: flex; align-items: center; gap: 12px; }
.aiw-notice-main strong { font-size: 13.5px; line-height: 1.4; }
.aiw-notice-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: color-mix(in srgb, var(--aiw-c) 12%, var(--surface)); color: var(--aiw-c); }
.aiw-float-notice p { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.aiw-notice-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.aiw-notice-foot > * { justify-content: center; min-height: 38px; border-radius: 12px; }
.aiw-notice-box { display: flex; align-items: center; gap: 10px; margin: 0 !important; padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; color: var(--ink) !important; }
.aiw-notice-danger { padding: 12px; border: 1px solid var(--danger-100); border-radius: 14px; background: var(--danger-50); }
.aiw-notice-danger strong { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.aiw-notice-danger strong svg { flex: none; color: var(--danger-600); }
.aiw-notice-danger button { width: 100%; justify-content: center; margin-top: 10px; background: var(--surface); }
/* Khung đang viết + xem trước (C3) */
.aiw-box { width: min(720px, calc(100vw - 32px)); max-width: none; padding: 20px; border-radius: 20px; }
.aiw-box > * { animation: aiwFadeUp .2s ease both; }
.aiw-x { position: absolute; top: 12px; right: 12px; }
.aiw-loading { display: flex; align-items: center; gap: 16px; padding: 8px 28px 8px 4px; }
.aiw-loading > div { flex: 1; min-width: 0; }
.aiw-loading strong { display: block; margin-bottom: 12px; font-size: 15px; font-weight: 500; }
.aiw-loading-ico { flex: none; color: var(--aiw-c); }
.aiw-prog { height: 9px; border-radius: 99px; background: var(--border-soft); overflow: hidden; }
/* Máy chủ không báo tiến độ thật nên không ghi %: thanh chạy nhanh rồi chậm dần tới 92% trong lúc chờ */
.aiw-prog i { display: block; width: 92%; height: 100%; border-radius: inherit; background: var(--primary-600); transform-origin: left; animation: aiwProg 30s cubic-bezier(.08, .75, .2, 1) both; }
@keyframes aiwProg { from { transform: scaleX(.02); } to { transform: scaleX(1); } }
.aiw-head { display: flex; align-items: center; padding-right: 28px; margin-bottom: 16px; }
.aiw-head strong { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; }
.aiw-head svg { color: var(--primary-600); }
.aiw-compare { display: grid; grid-template-columns: minmax(0, 4fr) auto minmax(0, 7fr); align-items: start; gap: 14px; }
.aiw-compare.is-new { grid-template-columns: minmax(0, 1fr); }
.aiw-col { border: 1px solid var(--border-soft); border-radius: 16px; overflow: hidden; }
.aiw-col.is-before { background: var(--bg); animation: aiwSlideR .2s ease both; }
.aiw-col.is-after { box-shadow: var(--shadow-sm); animation: aiwSlideL .2s ease both; }
@keyframes aiwSlideR { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes aiwSlideL { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.aiw-col > h3 { margin: 0; padding: 8px 14px; background: var(--bg); font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.aiw-col.is-after > h3 { background: #dcfce7; color: #15803d; }
.aiw-col-body { padding: 12px 14px; max-height: 46vh; overflow-y: auto; font-size: 14px; line-height: 1.6; word-break: break-word; }
.aiw-col.is-before .aiw-col-body { max-height: 190px; color: var(--ink-soft); font-size: 13.5px; transition: max-height .2s ease; }
.aiw-col.is-before.is-full .aiw-col-body { max-height: 46vh; }
.aiw-col-body h3 { margin: 2px 0 8px; font-size: 15px; font-weight: 700; color: var(--ink); }
.aiw-col.is-after mark { padding: 1px 3px; border-radius: 5px; background: #dcfce7; color: inherit; }
.aiw-col.is-after ul, .aiw-col.is-after ol { margin: 4px 0 8px; padding-left: 20px; }
.aiw-col.is-after ul { list-style: disc; }
.aiw-col.is-after ol { list-style: decimal; }
.aiw-col.is-after li { margin-bottom: 4px; }
.aiw-col.is-after p { margin: 0 0 6px; }
.aiw-arrow { align-self: center; color: var(--ink-soft); }
.aiw-original { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 3px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--primary-600); font: inherit; font-size: 13px; cursor: pointer; transition: background-color .2s ease; }
.aiw-original:hover { background: var(--primary-50); }
.aiw-voice-note { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.aiw-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--danger-50); color: var(--danger-600); font-size: 13.5px; line-height: 1.5; }
.aiw-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.aiw-foot > :last-child { margin-left: auto; }
.aiw-foot > * { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; border-radius: 12px; transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease; }
.aiw-foot > *:hover:not(:disabled) { transform: translateY(-1px); }
/* Chữ vừa vào ô: nền xanh phai dần 1 lần */
.aiw-flash { animation: aiwFlash .7s ease-out; }
@keyframes aiwFlash { from { background-color: #dcfce7; } to { background-color: transparent; } }
@media (max-width: 640px) {
  .aiw-compare { grid-template-columns: minmax(0, 1fr); }
  .aiw-arrow { display: none; }
  .aiw-foot > :last-child { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #aiw-float, #aiw-float.is-closing, .aiw-row, .aiw-prog i, .aiw-box > *, .aiw-col.is-before, .aiw-col.is-after, .aiw-flash,
  .comment-composer.is-listening .aiw-pill, .comment-composer:not(.is-listening) .aiw-field { animation: none; }
  .aiw-wave i { animation: none; transform: scaleY(.7); }
  .aiw-bar, .aiw-bar-in, .aiw-btn, .aiw-foot > *, .aiw-col.is-before .aiw-col-body { transition: none; }
}

/* ===== Khung Trợ lý AI theo 2 ảnh mẫu 07/11/2026: lấy bố cục + màu của mẫu, cỡ chữ / ô theo cỡ thật của ứng dụng (lấy nguyên cỡ ảnh thì màn 100% phải cuộn, chủ dự án đã phản hồi). Đè các lớp cũ ở trên ===== */
.ai-main { position: relative; background: #fafcfe; }
.ai-main::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background-repeat: no-repeat; background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%20190%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23e2edfd%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23f8fbfd%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22url(%23a)%22%20d%3D%22M0%208C40%206%2062%2040%2084%2080s60%2066%20116%2090v20H0Z%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20opacity%3D%22.7%22%20d%3D%22M0%2062C36%2052%2070%2072%2094%20102s50%2050%2090%2070v18H0Z%22%2F%3E%3C%2Fsvg%3E"), url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20230%20180%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23e6effc%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23f8fbfd%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22url(%23a)%22%20d%3D%22M230%204C190%206%20160%2032%20130%2072S70%20132%200%20180h230Z%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20opacity%3D%22.7%22%20d%3D%22M230%2062c-30%202-54%2018-76%2044s-50%2050-84%2074h160Z%22%2F%3E%3C%2Fsvg%3E"); background-size: 200px 190px, 230px 180px; background-position: 0 66%, 100% 88%; }
.ai-main > * { position: relative; z-index: 1; }
.ai-head { background: #fdfefe; }
.ai-head-icon { width: 38px; height: 38px; border-radius: 12px; background: #eef5fe; box-shadow: none; overflow: hidden; }
/* Tên + số token luôn 1 hàng; số dài thì cắt, không đẩy xuống dòng */
.ai-head .help-title { display: flex; align-items: center; white-space: nowrap; font-size: 17px; }
.ai-head .ai-beta { min-width: 0; margin-left: 6px; padding: 3px 8px; overflow: hidden; border: 0; background: #fef4e0; font-size: 11.5px; color: #a8691d; text-overflow: ellipsis; }
.ai-head .ai-beta.is-high { background: var(--danger-50); color: var(--danger-600); }
.ai-new-btn { height: 34px; padding: 0 8px; border: 1px solid #e6ebf5; border-radius: 12px; background: #fff; font-size: 12.5px; color: var(--ink); }
.ai-new-btn:hover { background: #f1f5fb; }
.ai-project { align-items: center; margin: 10px 15px 4px; padding: 9px 13px; border: 1px solid #dbedfe; background: #e2f1fc; }
.ai-body { background: transparent; }
/* Màn chào nằm giữa khung theo chiều dọc; cỡ theo vh: màn cao không trống, màn thấp không phải cuộn */
.ai-hero { gap: clamp(8px, 1.8vh, 18px); margin: auto 0; padding: 6px 8px; }
.ai-hero-art { flex: none; display: grid; place-items: center; width: clamp(72px, 17vh, 140px); height: clamp(72px, 17vh, 140px); border-radius: 50%; background: radial-gradient(circle, #edf4fd 0, #edf4fd 60%, rgba(237, 244, 253, 0) 100%); }
.ai-robot { width: 84%; height: 84%; object-fit: contain; }
.ai-hero h3 { font-size: clamp(17px, 2.4vh, 21px); color: #0f172a; }
.ai-hero h3 em { padding-bottom: 5px; background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20120%208%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%237fb4f8%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20d%3D%22M2%206C24%201%2044%201%2058%205c16-4%2040-4%2060%201%22%2F%3E%3C%2Fsvg%3E") center bottom / 100% 7px no-repeat; font-style: normal; color: #0269f2; }
.ai-hero-sub { margin: -2px 0 6px; font-size: 13.5px; color: #6b7c98; }
/* 3 thẻ hỏi nhanh: kiểu thẻ của mẫu mở to, dùng cho cả khung hẹp */
.ai-hero-suggest { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: clamp(6px, 1.2vh, 12px); width: 100%; max-width: 400px; }
.ai-hero-chip { position: relative; display: flex; align-items: center; gap: 11px; min-width: 0; width: 100%; padding: clamp(6px, 1.2vh, 11px) 28px clamp(6px, 1.2vh, 11px) 10px; border: 1px solid #f2f7fd; border-radius: 14px; background: #fff; box-shadow: 0 3px 10px rgba(86, 120, 180, .09); text-align: left; transition: background-color .2s ease, box-shadow .2s ease; }
.ai-hero-chip:hover:not(:disabled), .ai-hero-chip:focus-visible { border-color: #f2f7fd; background: #f4f8fd; box-shadow: 0 8px 22px rgba(86, 120, 180, .13); }
.ai-hero-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ai-hero-ico svg { width: 18px; height: 18px; }
.ai-hero-ico { width: clamp(32px, 5vh, 40px); height: clamp(32px, 5vh, 40px); background: #e1f4ff; color: #0284e0; }
.ai-hero-chip:nth-child(3n + 2) .ai-hero-ico { background: #ebe6fd; color: #5b3fd6; }
.ai-hero-chip:nth-child(3n) .ai-hero-ico { background: #e2faf1; color: #0f9d6a; }
.ai-hero-txt { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ai-hero-txt b { font-size: 14px; font-weight: 600; line-height: 1.3; color: #0f172a; }
.ai-hero-txt small { font-size: 12.5px; line-height: 1.35; color: #6b7c98; }
.ai-hero-chev { position: absolute; top: 50%; right: 8px; width: 14px; height: 14px; margin-top: -7px; color: #0284e0; }
.ai-hero-chip:nth-child(3n + 2) .ai-hero-chev { color: #5b3fd6; }
.ai-hero-chip:nth-child(3n) .ai-hero-chev { color: #0f9d6a; }
/* Ô soạn */
.ai-composer { background: rgba(252, 253, 254, .92); }
.ai-mode-chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-color: #eef0f8; font-size: 13.5px; color: #465071; transition: background-color .2s ease; }
.ai-mode-chip svg { display: none; color: #0284e0; }
.ai-mode-chip.is-on { border-color: #a1dffd; background: #e3f3fe; color: #0284e0; }
.ai-input-box { border: 1px solid #dee4f7; background: #fff; box-shadow: 0 4px 14px rgba(86, 120, 180, .06); }
.ai-input-row .ai-attach-btn, .ai-input-bar .ai-mic-btn { border-radius: 50%; background: #e1f1fd; color: #0284e0; }
.ai-composer .ai-send { border-radius: 50%; background: #07a7fe; }
.ai-composer .ai-send:hover:not(:disabled) { background: #0592e0; }
.ai-send-plane { display: none; }
/* Mở to */
body:has(#ai-wide-toggle:checked) #ai-overlay .ai-panel { width: min(1320px, 100%); height: min(780px, 100%); }
body:has(#ai-wide-toggle:checked) .ai-main { background: #fafcfe; }
body:has(#ai-wide-toggle:checked) .ai-main::before { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201308%20420%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22a%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23e9f1fd%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fafcfe%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23dfecfd%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fafcfe%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpath%20fill%3D%22url(%23a)%22%20d%3D%22M0%20120C60%2060%20120%2020%20190%2020S330%2090%20420%20150%20560%20260%20640%20300v120H0Z%22%2F%3E%3Cpath%20fill%3D%22url(%23a)%22%20opacity%3D%22.6%22%20d%3D%22M0%20210c70-40%20150-70%20220-50s130%2080%20220%20130%2090%2060%20130%2090H0Z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M1308%20100c-58-30-108-40-158-30S1010%20130%20920%20190%20790%20280%20720%20310v110h588Z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20opacity%3D%22.55%22%20d%3D%22M1308%20210c-60-26-110-30-170-10s-110%2080-190%20130-80%2060-110%2090h470Z%22%2F%3E%3C%2Fsvg%3E"); background-size: 100% 420px; background-position: 0 150px; }
body:has(#ai-wide-toggle:checked) .ai-head { min-height: 56px; padding: 8px 18px 8px 18px; }
body:has(#ai-wide-toggle:checked) .ai-head-icon { width: 38px; height: 38px; background: none; }
body:has(#ai-wide-toggle:checked) .ai-head-icon img { width: 36px; height: 36px; }
body:has(#ai-wide-toggle:checked) .ai-head .help-title { font-size: 19px; }
body:has(#ai-wide-toggle:checked) .ai-head .ai-beta { margin-left: 10px; padding: 3px 10px; font-size: 12.5px; }
body:has(#ai-wide-toggle:checked) .ai-head .ai-new-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
body:has(#ai-wide-toggle:checked) .ai-head .ai-new-btn .ai-new-ico { display: block; }
body:has(#ai-wide-toggle:checked) .ai-head .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
body:has(#ai-wide-toggle:checked) .ai-project { margin: 10px 18px 0; padding: 6px 14px; border: 0; border-radius: 12px; background: #e7f1fe; font-size: 13.5px; }
.ai-scope-pick { position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-left: auto; border-radius: 8px; color: #465071; cursor: pointer; transition: background-color .2s ease; }
.ai-scope-pick:hover { background: #d6e7fb; }
.ai-scope-pick:has(select:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }
.ai-scope-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
body:has(#ai-wide-toggle:checked) .ai-body { padding: 8px 18px; }
body:has(#ai-wide-toggle:checked) .ai-hero-art { width: clamp(72px, 18vh, 150px); height: clamp(72px, 18vh, 150px); }
body:has(#ai-wide-toggle:checked) .ai-hero h3 { font-size: clamp(19px, 3vh, 26px); }
body:has(#ai-wide-toggle:checked) .ai-hero-sub { font-size: 14px; }
body:has(#ai-wide-toggle:checked) .ai-hero-suggest { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); align-items: stretch; gap: 14px; max-width: 960px; }
body:has(#ai-wide-toggle:checked) .ai-hero-chip { min-height: 0; }
body:has(#ai-wide-toggle:checked) .ai-composer { padding: 10px 18px 14px; }
body:has(#ai-wide-toggle:checked) .ai-mode-chip { height: 32px; padding: 0 13px; font-size: 13.5px; }
body:has(#ai-wide-toggle:checked) .ai-mode-chip svg { display: block; }
body:has(#ai-wide-toggle:checked) .ai-modes { gap: 8px; margin-bottom: 8px; }
body:has(#ai-wide-toggle:checked) .ai-input-box { border-radius: 18px; }
body:has(#ai-wide-toggle:checked) .ai-composer .ai-send { background: #02b4fe; }
body:has(#ai-wide-toggle:checked) .ai-composer .ai-send:hover:not(:disabled) { background: #029fe0; }
body:has(#ai-wide-toggle:checked) .ai-send-up { display: none; }
body:has(#ai-wide-toggle:checked) .ai-send-plane { display: block; }
/* Cột trò chuyện */
body:has(#ai-wide-toggle:checked) .ai-side { width: 300px; border-right-color: #dfe6f5; background: #fefefd; }
.ai-side .chat-side-head { padding: 12px 16px 8px 18px; border-bottom: 0; }
.ai-side .chat-side-head h2 { font-size: 19px; font-weight: 700; color: #0f172a; }
.ai-side .chat-new-btn { height: 32px; padding: 0 14px; border: 0; background: #02b1fe; font-size: 13.5px; font-weight: 600; color: #fff; }
.ai-side .chat-new-btn:hover { background: #029ce0; }
.ai-side-search { position: relative; display: flex; align-items: center; gap: 8px; height: 36px; margin: 0 14px 10px; padding: 0 4px 0 12px; border-radius: 11px; background: #f3f6fb; color: #5b6680; }
.ai-side-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 13px; color: #0f172a; }
.ai-side-search input::placeholder { color: #6b7c98; }
.ai-side-search:focus-within { box-shadow: 0 0 0 2px var(--primary-100); }
.ai-side-filter { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: #5b6680; cursor: pointer; transition: background-color .2s ease; }
.ai-side-filter:hover { background: #e4eaf4; }
.ai-side-filter.is-on { background: #e1f4ff; color: #0284e0; }
.ai-side-filter:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ai-side-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 5; display: flex; flex-direction: column; gap: 2px; min-width: 190px; padding: 6px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.ai-side-opt { padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s ease; }
.ai-side-opt:hover { background: var(--bg); }
.ai-side-opt.is-on { background: #e8f6fe; font-weight: 600; }
.ai-side-list { flex: 1; min-height: 0; padding: 0 8px 8px; overflow-y: auto; }
.ai-side-item { position: relative; min-height: 52px; margin-bottom: 2px; border-radius: 12px; background: none; transition: background-color .2s ease; }
.ai-side-item:hover { background: #f3f7fc; }
.ai-side-item.is-active, .ai-side-item.is-active:hover { background: #e8f6fe; }
.ai-side-item.ai-side-new { padding: 7px 8px; }
.ai-side-open { padding: 7px 8px; }
.ai-side-ico { width: 34px; height: 34px; border-radius: 10px; background: #eef6fe; color: #0284e0; }
.ai-side-item.is-active .ai-side-ico { background: #f6fbff; }
.ai-side-item .chat-item-text strong { font-size: 13.5px; font-weight: 600; color: #0f172a; }
.ai-side-item .chat-item-text { padding-right: 60px; }
.ai-side-meta { display: block; }
.ai-side-scope, .ai-side-scope.is-ws { margin: 1px 0 0; padding: 0; background: none; font-size: 12px; font-weight: 400; color: #5b6680; }
.ai-side-item.is-active .ai-side-scope { color: #0284e0; }
.ai-side-time { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); font-size: 11.5px; color: #6b7c98; transition: opacity .2s ease; }
.ai-side-item.is-active::after { content: ""; position: absolute; top: 50%; right: 14px; width: 9px; height: 9px; margin-top: -4px; border-radius: 50%; background: #0caefd; transition: opacity .2s ease; }
.ai-side-item.is-active .ai-side-time { display: none; }
.ai-side-item .ai-hist-del { position: relative; z-index: 1; width: 28px; height: 28px; opacity: 0; }
.ai-side-item:not(:hover) .ai-hist-del:not(:focus-visible) { position: absolute; pointer-events: none; }
.ai-side-item.is-active .ai-hist-del { opacity: 0; }
.ai-side-item:hover .ai-hist-del, .ai-side-item .ai-hist-del:focus-visible { opacity: 1; }
.ai-side-item:hover .ai-side-time, .ai-side-item:hover::after { opacity: 0; }
.ai-side-item:hover .chat-item-text { padding-right: 0; }
.ai-side-deco { position: relative; flex: none; height: 96px; background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20398%20150%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20fill%3D%22%23edf6fe%22%20d%3D%22M0%2070C70%2050%20130%20110%20220%2090S340%2040%20398%2050v100H0Z%22%2F%3E%3Cpath%20fill%3D%22%23f4f9fe%22%20d%3D%22M0%2034c80-14%20140%2040%20230%2026s120-34%20168-30v30C340%2040%20300%2070%20220%2090S70%2050%200%2070Z%22%2F%3E%3C%2Fsvg%3E") center bottom / 100% 100% no-repeat; pointer-events: none; }
.ai-side-deco img { position: absolute; bottom: 6px; left: 14px; width: 80px; height: 80px; object-fit: contain; opacity: .5; }
/* Màn thấp: bỏ phần trang trí trước, luôn thấy đủ thẻ và ô soạn mà không phải cuộn */
@media (max-height: 660px) {
  .ai-hero { gap: 6px; padding-top: 0; padding-bottom: 0; }
  .ai-side-deco { display: none; }
  .ai-hero-sub { display: none; }
}
@media (max-width: 1100px) {
  body:has(#ai-wide-toggle:checked) .ai-side { width: 260px; }
}
@media (max-width: 768px) {
  .ai-side-deco, .ai-side-time { display: none; }
  .ai-side-item .chat-item-text { padding-right: 0; }
  body:has(#ai-wide-toggle:checked) .ai-side { width: auto; }
  body:has(#ai-wide-toggle:checked) .ai-main::before { background-size: 760px 300px; background-position: center 90px; }
  body:has(#ai-wide-toggle:checked) .ai-head { padding-left: 46px; }
  body:has(#ai-wide-toggle:checked) .ai-head .help-title { font-size: 18px; }
  body:has(#ai-wide-toggle:checked) .ai-head .ai-new-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
  body:has(#ai-wide-toggle:checked) .ai-head .ai-new-text { display: none; }
  body:has(#ai-wide-toggle:checked) .ai-head .ai-beta { display: none; }
  body:has(#ai-wide-toggle:checked) .ai-project { margin: 8px 12px 0; font-size: 13.5px; }
  body:has(#ai-wide-toggle:checked) .ai-body { padding: 10px 12px; }
  body:has(#ai-wide-toggle:checked) .ai-hero h3 { font-size: 21px; }
  body:has(#ai-wide-toggle:checked) .ai-composer { padding: 10px 12px; }
  body:has(#ai-wide-toggle:checked) .ai-modes { flex-wrap: nowrap; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { .ai-hero-chip, .ai-mode-chip, .ai-side-item, .ai-side-time, .ai-side-item::after, .ai-side-filter, .ai-side-opt, .ai-scope-pick { transition: none; } }

/* Thanh tab chế độ xem của dự án theo ảnh mẫu (07/11/2026): chỉ đổi màu (khay trắng, bóng mềm), giữ nguyên kích thước cũ cho đều với các ô cùng hàng;
   tab đang chọn nền xanh nhạt + viền xanh, chữ xanh đậm */
.pv-bar .view-tabs {
  background: var(--surface); border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.pv-bar .view-tab-wrap:has(.view-radio:checked) { background: #e9f4ff; box-shadow: inset 0 0 0 1px #bfdcfb; }
.pv-bar .view-tab-wrap .view-tab:has(.view-radio:checked) { color: var(--primary-600); font-weight: 600; }
.pv-bar .view-tab-add { background: var(--surface); }

/* Thanh bên theo ảnh mẫu (07/11/2026): nền trắng xanh rất nhạt + hoa văn sóng mờ ở đáy (SVG vẽ tại chỗ, không thêm ảnh);
   khu Cài đặt ở đáy bỏ nền trắng để thấy hoa văn */
.sidebar {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 280 240' preserveAspectRatio='none'%3E%3Cpath d='M0 128C62 96 128 160 196 132C232 117 258 104 280 108V240H0Z' fill='%23dbe8fb' fill-opacity='.42'/%3E%3Cpath d='M0 168C70 136 150 196 280 150V240H0Z' fill='%23e7e0fc' fill-opacity='.38'/%3E%3Cpath d='M0 200C90 176 170 222 280 190V240H0Z' fill='%23dfeafb' fill-opacity='.5'/%3E%3Cpath d='M0 96C70 66 150 122 280 80' fill='none' stroke='%23c9dcf7' stroke-opacity='.7' stroke-width='1.2'/%3E%3Cpath d='M0 112C80 84 160 138 280 96' fill='none' stroke='%23dcd2fa' stroke-opacity='.6' stroke-width='1'/%3E%3C/svg%3E") left bottom / 100% 240px no-repeat,
    linear-gradient(180deg, #fbfcfe 0%, #f6f8fd 100%);
}
.sidebar-bottom { background: transparent; box-shadow: none; border-top-color: transparent !important; }
/* Khay tab cao đúng chiều cao chung của thanh công cụ (--toolbar-h) cho bằng ô tìm / nút Thêm Việc cùng hàng */
.pv-bar .view-tabs { box-sizing: border-box; height: var(--toolbar-h); padding: 2px; align-items: center; }
.pv-bar .view-tab, .pv-bar .view-tab-add { box-sizing: border-box; height: calc(var(--toolbar-h) - 6px); padding-top: 0; padding-bottom: 0; }

/* =====================================================
   BÁO CÁO TỔNG QUÁT theo ảnh mẫu (08/11/2026, reports.js reportOverviewHeadHTML / reportOverviewHTML)
   Đầu trang có ô biểu tượng; hàng 2: góc nhìn đã lưu | Bộ lọc + kỳ; 4 ô số có ô biểu tượng + đường xu hướng;
   lưới hàng: [trạng thái | AI] [dự án | nhân sự] [tiến độ | phân bổ theo dự án | tuổi quá hạn] [cần xử lý | theo tuần]
   ===================================================== */
#view-reports { container-type: inline-size; container-name: rep; }
.rep-top-v2 { align-items: center; margin-bottom: 16px; }
.rep-title-v2 { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rep-title-ic { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 16px; background: #f3efff; border: 1px solid #e4dcfd; color: #7c5cf0; }
.rep-title-v2 h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -0.3px; }
.rep-title-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.rep-top-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: 12px; font-weight: 600; }
.rep-top-actions .btn-primary.rep-top-btn { border: 0; background: linear-gradient(90deg, #38bdf8, #2f8ff2); box-shadow: 0 6px 16px rgba(47, 143, 242, .22); }
.rep-bar2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.rep-bar2 .rep-views { margin: 0; }
.rep-bar2-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.rep-flt { position: relative; }
.rep-flt-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: border-color .2s, background-color .2s; }
.rep-flt-btn:hover { background: #f8fbff; border-color: #cfe3fb; }
.rep-flt-btn.is-on { border-color: #a9d6fb; color: var(--primary-600); background: #f2f9ff; }
.rep-flt-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--primary-600); color: #fff; font-size: 11px; }
.rep-flt-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 300px; display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 16px 36px rgba(15, 23, 42, .14); }
.rep-flt-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink); }
.rep-flt-row { display: grid; gap: 4px; }
.rep-flt-row > span { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.rep-flt-row select { width: 100%; }
.rep-flt-foot { padding-top: 8px; border-top: 1px solid var(--border-soft); }
.rep-period-pill { min-height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }

/* 4 ô số */
.rep-kpi.rep-kpi-v2 { flex-direction: row; align-items: center; gap: 12px; min-height: 108px; padding: 16px 18px; border: 1px solid color-mix(in srgb, currentColor 16%, transparent); border-radius: 18px; }
.rep-kpi-v2 .rep-kpi-ic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; align-self: flex-start; border-radius: 14px; background: rgba(255, 255, 255, .75); color: inherit; }
.rep-kpi-v2 .rep-kpi-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.rep-kpi-v2 .rep-kpi-value { font-size: 30px; color: var(--ink); }
.rep-kpi-v2 .rep-kpi-hint { font-size: 12px; color: var(--ink-soft); opacity: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-kpi-trend { font-weight: 700; }
.rep-kpi-trend.is-bad { color: var(--danger-600); }
.rep-kpi-trend.is-good { color: var(--success-700, #047857); }
.rep-kpi-trend.is-flat { color: var(--muted); }
.rep-kpi-v2 .rep-spark { position: static; flex: none; align-self: center; width: 84px; height: 34px; opacity: .9; }

/* Lưới hàng */
.rep-row { display: grid; gap: 14px; margin-bottom: 14px; align-items: stretch; }
.rep-row-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.rep-row-3 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.rep-row-4 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .9fr); }
.rep-row-5 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.rep-row > .report-card { margin: 0; min-width: 0; }
@container rep (max-width: 1080px) { .rep-row-4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .rep-row-4 > :last-child { grid-column: 1 / -1; } }
@container rep (max-width: 860px) { .rep-row-2, .rep-row-3, .rep-row-4, .rep-row-5 { grid-template-columns: minmax(0, 1fr); } .rep-row-4 > :last-child { grid-column: auto; } .rep-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container rep (max-width: 520px) { .rep-kpis { grid-template-columns: minmax(0, 1fr); } .rep-donut-wrap { flex-direction: column; align-items: stretch; } }

/* Vòng tròn dùng chung (trạng thái, phân bổ theo dự án) */
.rep-donut-wrap { display: flex; align-items: center; gap: 22px; margin-top: 6px; }
.rep-donut-box { position: relative; width: 140px; height: 140px; flex: none; align-self: center; }
.rep-donut-wrap.is-lg .rep-donut-box { width: 168px; height: 168px; }
.rep-donut { width: 100%; height: 100%; display: block; }
.rep-donut circle { fill: none; stroke-width: 15; }
.rep-donut-arc.is-click { cursor: pointer; transition: stroke-width .2s ease; }
.rep-donut-arc.is-click:hover { stroke-width: 18; }
.rep-donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.rep-donut-mid b { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.rep-donut-mid span { font-size: 12.5px; color: var(--ink-soft); }
.rep-slegend { display: grid; gap: 4px; flex: 1; min-width: 0; margin: 0; }
.rep-slegend .rep-legend-pill { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 46px; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; font-size: 13.5px; color: var(--ink); text-align: left; }
.rep-slegend .rep-legend-pill:hover { background: var(--bg); }
.rep-slegend .rep-legend-pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.rep-slegend .rep-legend-pill b { font-weight: 700; text-align: right; }
.rep-slegend .rep-legend-pill small { font-size: 12.5px; color: var(--ink-soft); text-align: right; }
.rep-dlegend { display: grid; gap: 2px; flex: 1; min-width: 0; }
.rep-dleg-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer; }
.rep-dleg-row:hover:not(:disabled) { background: var(--bg); }
.rep-dleg-row:disabled { cursor: default; }
.rep-dleg-row i { width: 10px; height: 10px; border-radius: 50%; }
.rep-dleg-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-dleg-row b { font-weight: 700; color: var(--ink-soft); }

/* AI phân tích báo cáo (phong cách ảnh 2) */
.rep-ai-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border: 1px solid #e2dafc; border-radius: 18px;
  background: radial-gradient(120% 90% at 0% 0%, #f4efff 0%, rgba(244, 239, 255, 0) 60%), linear-gradient(135deg, #f5f1ff 0%, #eef3ff 55%, #eaf4ff 100%); box-shadow: 0 8px 24px rgba(124, 92, 240, .08); }
.rep-ai-hero { display: flex; align-items: center; gap: 14px; }
.rep-ai-logo { width: 58px; height: 58px; flex: none; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(124, 92, 240, .25)); }
.rep-ai-headtxt { min-width: 0; flex: 1; }
.rep-ai-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: #ede7ff; color: #6d4fe0; font-size: 10.5px; font-weight: 800; letter-spacing: .3px; }
.rep-ai-card h2 { margin: 4px 0 0; font-size: 19px; font-weight: 800; color: #1e1b4b; }
.rep-ai-card .rep-sub { margin: 2px 0 0; color: #475569; }
.rep-ai-deco { width: 108px; height: 64px; flex: none; fill: rgba(139, 92, 246, .16); stroke: none; }
.rep-ai-deco path { fill: none; stroke: #8b5cf6; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: .55; }
.rep-ai-list { display: grid; gap: 8px; margin: 0; padding: 12px 14px; list-style: none; border-radius: 14px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .9); }
.rep-ai-li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; color: #334155; }
.rep-ai-dot { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; color: #fff; }
.rep-ai-li.is-green .rep-ai-dot { background: #22c55e; }
.rep-ai-li.is-orange .rep-ai-dot { background: #f59e0b; }
.rep-ai-li.is-yellow .rep-ai-dot { background: #fde68a; color: #b45309; }
.rep-ai-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rep-ai-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 1 1 180px; min-height: 40px; padding: 0 14px; border: 1px solid #c7d7fb; border-radius: 12px; background: #fff; color: #1d6fd0; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background-color .2s, border-color .2s, box-shadow .2s; }
.rep-ai-btn:hover { background: #f5f9ff; border-color: #93c0f7; box-shadow: 0 4px 12px rgba(47, 143, 242, .12); }
.rep-ai-btn.is-main { color: #6d4fe0; border-color: #d6cbfb; }
.rep-ai-btn.is-main:hover { background: #faf8ff; border-color: #bba8f8; }

/* Ngăn kéo Phân tích chi tiết bằng AI (#rep-drawer kind "ai", trượt từ phải) */
#rep-drawer[data-kind="ai"] { width: min(460px, 100vw); background: #f6f7fe; }
#rep-drawer[data-kind="ai"] .drawer-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; border: 0; }
#rep-drawer[data-kind="ai"] .drawer-body { padding: 14px 14px 20px; }
.rep-aid { display: grid; gap: 12px; }
.rep-aid-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 44px 14px 14px; border-radius: 16px; background: linear-gradient(135deg, #f1edff, #e8f1ff); border: 1px solid #e2dafc; }
.rep-aid-head img { width: 54px; height: 54px; flex: none; object-fit: contain; }
.rep-aid-head h2 { margin: 0; font-size: 18px; font-weight: 800; color: #1e1b4b; }
.rep-aid-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.rep-aid-x { position: absolute; top: 8px; right: 8px; }
.rep-aid-sec { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-soft); --c: #2f8ff2; }
.rep-aid-sec.is-violet { --c: #7c5cf0; }
.rep-aid-sec.is-red { --c: #e11d48; }
.rep-aid-sec.is-green { --c: #16a34a; }
.rep-aid-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.rep-aid-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.rep-aid-sec ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13px; line-height: 1.55; color: #334155; }
.rep-aid-sec p { margin: 0 0 6px; font-size: 13px; color: #334155; }
.rep-aid-pts { display: grid; gap: 6px; }
.rep-aid-pt { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--pc) 7%, var(--surface)); font: inherit; font-size: 13px; line-height: 1.5; color: #334155; text-align: left; cursor: pointer; --pc: #e11d48; transition: background-color .2s; }
.rep-aid-pt:hover:not(:disabled) { background: color-mix(in srgb, var(--pc) 13%, var(--surface)); }
.rep-aid-pt:disabled { cursor: default; opacity: .75; }
.rep-aid-pt.is-orange { --pc: #f59e0b; }
.rep-aid-pt.is-violet { --pc: #7c5cf0; }
.rep-aid-pt.is-blue { --pc: #2f8ff2; }
.rep-aid-pt i { width: 9px; height: 9px; flex: none; margin-top: 6px; border-radius: 50%; background: var(--pc); }
.rep-aid-todo { display: grid; gap: 6px; }
.rep-aid-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; color: #334155; cursor: pointer; }
.rep-aid-check input { margin-top: 3px; accent-color: var(--primary-600); }
.rep-aid-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.rep-aid-quick button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; padding: 10px 8px; border: 1px solid #d7e5fb; border-radius: 14px; background: var(--surface); color: #1d6fd0; font: inherit; font-size: 12.5px; font-weight: 700; text-align: center; cursor: pointer; transition: background-color .2s, border-color .2s; }
.rep-aid-quick button:hover { background: #f5f9ff; border-color: #93c0f7; }
.rep-aid-ask { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid #e2dafc; background: linear-gradient(135deg, #f3efff, #eaf2ff); }
.rep-aid-ask img { width: 46px; height: 46px; flex: none; object-fit: contain; }
.rep-aid-ask b { display: block; font-size: 14.5px; color: #1e1b4b; }
.rep-aid-ask p { margin: 2px 0 10px; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.rep-aid-ask .btn-primary { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 12px; background: linear-gradient(90deg, #38bdf8, #2f8ff2); }

/* Theo dự án (thẻ gọn 4 cột) */
.rep-proj-card .rep-ptable th, .rep-proj-card .rep-ptable td { padding-top: 8px; padding-bottom: 8px; }

/* Tuổi quá hạn + Hoàn thành theo tuần: cột bo tròn, màu tươi như mẫu */
.rep-row .rep-age, .rep-row .rep-weeks { height: 200px; }
.rep-row .rep-week-bar:not(.is-zero) { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.rep-row .rep-week:nth-child(4n+2) .rep-week-bar:not(.is-zero) { background: linear-gradient(180deg, #fcd34d, #fbbf24); }
.rep-row .rep-week:nth-child(4n+3) .rep-week-bar:not(.is-zero) { background: linear-gradient(180deg, #67e8f9, #22d3ee); }
.rep-row .rep-week:nth-child(4n+4) .rep-week-bar:not(.is-zero) { background: linear-gradient(180deg, #c4b5fd, #a78bfa); }
@media (prefers-reduced-motion: reduce) { .rep-donut-arc.is-click, .rep-flt-btn, .rep-ai-btn, .rep-aid-quick button, .rep-aid-pt { transition: none; } }
/* Ô số: lưới như mẫu — biểu tượng trái (2 hàng), nhãn cùng hàng biểu tượng, số lớn + đường xu hướng hàng 2, dòng so sánh ở đáy */
.rep-kpi.rep-kpi-v2 { display: grid; grid-template-columns: 46px minmax(0, 1fr) minmax(56px, 84px); grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 2px; align-items: center; }
.rep-kpi-v2 .rep-kpi-main { display: contents; }
.rep-kpi-v2 .rep-kpi-ic { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
.rep-kpi-v2 .rep-kpi-label { grid-column: 2 / 4; grid-row: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-kpi-v2 .rep-kpi-row { grid-column: 2; grid-row: 2; }
.rep-kpi-v2 .rep-spark { grid-column: 3; grid-row: 2; width: 100%; }
.rep-kpi-v2 .rep-kpi-hint { grid-column: 1 / 4; grid-row: 3; margin-top: 6px; }
/* 4 ô số theo ảnh mẫu (chủ dự án 09/11/2026): mỗi tông 3 màu (--k nét / biểu tượng, --kl tên, --kv số lớn); nền chuyển màu pastel rất nhạt,
   viền cùng tông, bóng mềm; ô biểu tượng 40px tô nhạt; đường xu hướng cong mềm có vùng tô mờ (repSparkHTML); chip ▲ +1 không nền */
.rep-kpi-v2.is-blue { --k: #3b82f6; --kl: #1e3a8a; --kv: #172554; }
.rep-kpi-v2.is-red { --k: #f43f5e; --kl: #be123c; --kv: #881337; }
.rep-kpi-v2.is-orange { --k: #f59e0b; --kl: #b45309; --kv: #7c2d12; }
.rep-kpi-v2.is-green { --k: #22c55e; --kl: #166534; --kv: #14532d; }
.rep-kpi.rep-kpi-v2 { grid-template-columns: 40px minmax(0, 1fr) minmax(56px, 88px); column-gap: 12px; min-height: 0; padding: 14px 16px 12px; border: 1px solid color-mix(in srgb, var(--k) 22%, transparent); border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--k) 10%, var(--surface)) 0%, color-mix(in srgb, var(--k) 4%, var(--surface)) 100%); color: var(--k); box-shadow: 0 4px 14px color-mix(in srgb, var(--k) 8%, transparent); transition: box-shadow .2s, border-color .2s; }
.rep-kpi.rep-kpi-v2:hover, .rep-kpi.rep-kpi-v2:focus-visible { border-color: color-mix(in srgb, var(--k) 45%, transparent); box-shadow: 0 6px 18px color-mix(in srgb, var(--k) 16%, transparent); }
.rep-kpi-v2 .rep-kpi-ic { width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--k) 14%, var(--surface)); color: var(--k); align-self: start; }
.rep-kpi-v2 .rep-kpi-ic svg { width: 22px; height: 22px; }
.rep-kpi-v2 .rep-kpi-label { align-self: start; padding-top: 1px; font-size: 13px; font-weight: 700; color: var(--kl); }
.rep-kpi-v2 .rep-kpi-row { gap: 10px; }
.rep-kpi-v2 .rep-kpi-value { font-size: 30px; font-weight: 800; line-height: 1.05; color: var(--kv); }
.rep-kpi-v2 .rep-delta { padding: 0; background: none; font-size: 12.5px; }
.rep-kpi-v2 .rep-spark { height: 36px; opacity: 1; color: var(--k); }
.rep-kpi-v2 .rep-kpi-hint { margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .rep-kpi.rep-kpi-v2 { transition: none; } }
/* Chú giải trạng thái không bẻ dòng; vòng tròn nhỏ lại khi thẻ hẹp */
.rep-slegend .rep-legend-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-donut-wrap.is-lg .rep-donut-box { width: clamp(130px, 34%, 168px); height: auto; aspect-ratio: 1; }
/* Nút khung AI: giữ chữ 1 dòng, thiếu chỗ thì nút xuống hàng */
.rep-ai-btn { white-space: nowrap; }
/* Bảng Theo dự án gọn: không ép bề rộng tối thiểu (không cuộn ngang), tên dự án tự xuống dòng */
.rep-proj-card .rep-ptable { min-width: 0; width: 100%; }
.rep-proj-card .report-table-scroll { overflow-x: visible; }
/* Nút ✕ của ngăn kéo AI: dấu ✕ nhạt như mẫu (không nền màu), rê chuột nền trắng mờ */
#rep-drawer .rep-aid-x, #rep-drawer .rep-aid-x:focus { border-color: transparent; background: transparent; color: var(--ink-soft); box-shadow: none; }
#rep-drawer .rep-aid-x:hover { background: rgba(255, 255, 255, .85); color: var(--ink); }
#rep-drawer .rep-aid-x:focus-visible { box-shadow: 0 0 0 3px var(--primary-100); }

/* ===== Trợ lý AI hỏi về Báo cáo (ảnh mẫu 08/11/2026, ai.js aiReportCtxHTML / aiFormat) =====
   Thanh ngữ cảnh đầu cuộc trò chuyện; câu trả lời chia thẻ theo dòng "### …" (màu theo nội dung tiêu đề, aiSecTone);
   danh sách đánh số có số tròn; nút gợi ý có biểu tượng */
.ai-ctx { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid #dbe7fb; border-radius: 14px; background: linear-gradient(135deg, #f2f7ff, #f5f2ff); }
.ai-ctx-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: #e3eefe; color: #2f8ff2; }
.ai-ctx-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ai-ctx-txt b { font-size: 13px; color: var(--ink); }
.ai-ctx-txt span { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-ctx-btn { flex: none; padding: 6px 10px; border: 1px solid #c7d7fb; border-radius: 10px; background: #fff; color: #1d6fd0; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: background-color .2s, border-color .2s; }
.ai-ctx-btn:hover { background: #f5f9ff; border-color: #93c0f7; }

.ai-msg .ai-sec { --sc: #7c5cf0; margin: 8px 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--sc) 20%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--sc) 5%, var(--surface)); }
.ai-msg .ai-sec.is-green { --sc: #16a34a; }
.ai-msg .ai-sec.is-red { --sc: #e11d48; }
.ai-msg .ai-sec.is-orange { --sc: #f59e0b; }
.ai-msg .ai-sec.is-teal { --sc: #0d9488; }
.ai-msg .ai-sec-h { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; font-weight: 800; color: var(--ink); }
.ai-msg .ai-sec-ic { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; background: color-mix(in srgb, var(--sc) 14%, transparent); color: var(--sc); }
.ai-msg .ai-sec > :last-child { margin-bottom: 0; }
.ai-msg .ai-sec ul { margin: 0; }
/* Gợi ý hành động: mỗi dòng có dấu tích xanh thay cho chấm */
.ai-msg .ai-sec.is-teal ul { list-style: none; padding-left: 0; }
.ai-msg .ai-sec.is-teal ul li { position: relative; padding-left: 24px; }
.ai-msg .ai-sec.is-teal ul li::before { content: ""; position: absolute; left: 0; top: .2em; width: 16px; height: 16px; border-radius: 50%; background: #dcfce7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 12px no-repeat; }
/* Danh sách đánh số: số tròn nền nhạt như mẫu */
.ai-msg .ai-ol { margin: 4px 0; padding: 0; list-style: none; counter-reset: aiol; display: grid; gap: 5px; }
.ai-msg .ai-ol li { position: relative; padding-left: 28px; counter-increment: aiol; }
.ai-msg .ai-ol li::before { content: counter(aiol); position: absolute; left: 0; top: .05em; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: color-mix(in srgb, var(--sc, #2f8ff2) 14%, var(--surface)); color: var(--sc, #2f8ff2); font-size: 11.5px; font-weight: 800; }
.ai-chip.has-ico { display: inline-flex; align-items: center; gap: 6px; }
.ai-chip.has-ico svg { flex: none; color: var(--primary-600); }

/* Khung AI phân tích báo cáo — tông xanh theo ảnh mẫu (chủ dự án chốt 09/11/2026): nền trắng ngả xanh nhạt dần sang phải,
   viền xanh xám mảnh, chip tím xanh nhạt, hình trang trí + nút xanh dương; ngăn kéo phân tích dùng cùng tông */
.rep-ai-card { border-color: #dfe8f6; background: linear-gradient(100deg, #fbfcff 0%, #f3f7ff 45%, #e8f1ff 100%); box-shadow: 0 8px 24px rgba(37, 99, 235, .06); }
.rep-ai-card h2 { color: #1e2a5a; }
.rep-ai-chip { background: #ecebff; color: #5b4bd6; }
.rep-ai-logo { filter: drop-shadow(0 6px 12px rgba(37, 99, 235, .18)); }
.rep-ai-deco { fill: rgba(96, 165, 250, .22); }
.rep-ai-deco path { stroke: #60a5fa; opacity: .7; }
.rep-ai-list { background: rgba(255, 255, 255, .8); border-color: #edf2fb; }
.rep-ai-btn, .rep-ai-btn.is-main { border-color: #c9dafa; color: #2563eb; }
.rep-ai-btn:hover, .rep-ai-btn.is-main:hover { background: #f5f9ff; border-color: #93c0f7; }
#rep-drawer[data-kind="ai"] { background: #f5f8fe; }
.rep-aid-head, .rep-aid-ask { border-color: #dfe8f6; background: linear-gradient(100deg, #fbfcff 0%, #f0f6ff 55%, #e6f0ff 100%); }
.rep-aid-head h2, .rep-aid-ask b { color: #1e2a5a; }

/* Cần xử lý: thẻ cao bằng "Hoàn thành theo tuần" cùng hàng (chiều cao hàng do thẻ kia quyết định: height 0 + min-height 100%),
   phần danh sách cuộn bên trong; 1 cột (màn hẹp) thì giới hạn cao 460px rồi cuộn */
.rep-att { display: flex; flex-direction: column; }
.rep-att-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-right: -6px; padding-right: 6px; scrollbar-width: thin; }
/* Vùng danh sách dạng cột để ô trống căn giữa; nhóm / dòng không được co lại (nhóm có overflow ẩn sẽ bị ép dẹt khi danh sách dài) */
.rep-att-body > * { flex-shrink: 0; }
@container rep (min-width: 861px) { .rep-row-5 > .rep-att { height: 0; min-height: 100%; } }
@container rep (max-width: 860px) { .rep-att-body { max-height: 460px; } }
/* Nền khung AI: xanh dương nhạt rõ hơn (chủ dự án 09/11/2026) */
.rep-ai-card { border-color: #cfe0f8; background: linear-gradient(100deg, #eef5ff 0%, #e6f0ff 55%, #dcebff 100%); }
.rep-aid-head, .rep-aid-ask { border-color: #cfe0f8; background: linear-gradient(100deg, #eef5ff 0%, #e6f0ff 55%, #dcebff 100%); }
.rep-ai-list { background: rgba(255, 255, 255, .88); border-color: #e3edfb; }
/* Bảng ẩn cho trình đọc màn hình (vd Hoàn thành theo tuần): bảng bỏ qua height 1px của .sr-only nên vẫn cao theo số dòng
   và kéo dài trang thành khoảng trắng; đổi sang khối để đúng 1px, trình đọc màn hình vẫn đọc được */
table.sr-only { display: block; }
.rep-row > .report-card { position: relative; }
/* Theo dự án: thẻ cao bằng Hiệu suất nhân sự cùng hàng, bảng lấp đầy phần còn lại (bỏ khung cố định 300px cũ),
   chỉ cuộn khi nhiều dự án; 1 cột (màn hẹp) thì cao theo nội dung, tối đa 420px rồi cuộn */
.rep-proj-card { display: flex; flex-direction: column; }
.rep-proj-card .report-table-scroll { height: auto; flex: 1 1 auto; min-height: 0; }
@container rep (min-width: 861px) { .rep-row-3 > .rep-proj-card { height: 0; min-height: 100%; } }
@container rep (max-width: 860px) { .rep-proj-card .report-table-scroll { max-height: 420px; } }
/* Thẻ có vòng tròn (trạng thái, phân bổ theo dự án): khi bị kéo cao bằng thẻ cùng hàng thì vòng tròn + chú giải nằm giữa theo chiều dọc, không hở trắng dưới */
.rep-status, .rep-pdonut { display: flex; flex-direction: column; }
.rep-status .rep-donut-wrap, .rep-pdonut .rep-donut-wrap { flex: 1 1 auto; align-items: center; justify-content: center; }
.rep-status .rep-slegend { flex: 0 1 300px; }
/* Hiệu suất nhân sự (ảnh mẫu 09/11/2026, hàng cuối cạnh Cần xử lý): ô biểu tượng + tiêu đề + chip kỳ, nút Xuất bên phải; ô số có biểu tượng bên trái nhãn */
.rep-staff-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.rep-staff-title h2 { margin: 0; }
.rep-staff-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: #eef3ff; color: #3b5bdb; }
.rep-staff .rep-period { padding: 3px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
/* 3 ô Hiệu suất nhân sự theo ảnh mẫu (chủ dự án 09/11/2026): ngang, biểu tượng nét 26px không khung bên trái,
   số đậm 18px + tên nhỏ xám bên dưới; nền pastel + viền cùng tông, bo 12px */
.rep-staff .rep-stile { flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; }
.rep-staff .rep-stile.is-blue { background: color-mix(in srgb, #3b82f6 7%, var(--surface)); border-color: color-mix(in srgb, #3b82f6 18%, transparent); --c: #3b82f6; }
.rep-staff .rep-stile.is-green { background: color-mix(in srgb, #22c55e 8%, var(--surface)); border-color: color-mix(in srgb, #22c55e 20%, transparent); --c: #16a34a; }
.rep-staff .rep-stile.is-violet { background: color-mix(in srgb, #8b5cf6 8%, var(--surface)); border-color: color-mix(in srgb, #8b5cf6 18%, transparent); --c: #8b5cf6; }
.rep-stile-ic { display: grid; place-items: center; flex: none; color: var(--c); }
.rep-stile-txt { display: flex; flex-direction: column; min-width: 0; }
.rep-stile-v { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.rep-staff .rep-stile b { font-size: 18px; font-weight: 800; line-height: 1.25; color: var(--ink); }
.rep-staff .rep-stile small { font-size: 11.5px; line-height: 1.35; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-staff .rep-stile .rep-delta { padding: 0; background: none; font-size: 11px; white-space: nowrap; }
/* Hàng cuối: Hiệu suất nhân sự có bảng + biểu đồ nên cần rộng hơn Hoàn thành theo tuần trước đây */
@container rep (min-width: 861px) { .rep-row-5 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }

/* Dòng Cần xử lý (chủ dự án 09/11/2026): biểu tượng trạng thái trước tên (chỉ xem, không bấm), quá hạn = biểu tượng lịch + số ngày,
   chưa phân công = vòng tròn nét đứt có dấu + cỡ bằng ảnh đại diện, rê vào chuyển xanh, bấm mở ô chọn người (pl-pop dùng chung) */
.rep-att-main b { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rep-att-main .rep-att-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-att-main .rep-att-st { flex: none; cursor: default; }
.rep-att-main small { padding-left: 22px; }
.rep-due-pill.rep-late { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.rep-asg-add { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0; border: 1.5px dashed #a3b3c9; border-radius: 50%; background: var(--surface); color: #8a9ab3; cursor: pointer; transition: border-color .2s, color .2s, background-color .2s; }
.rep-asg-add:hover, .rep-asg-add:focus-visible { border-color: var(--primary); color: var(--primary-600); background: var(--primary-50); outline: none; }
.rep-asg-add.is-off { cursor: default; opacity: .7; }
.rep-asg-add.is-off:hover { border-color: #a3b3c9; color: #8a9ab3; background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .rep-asg-add { transition: none; } }
/* Dòng Cần xử lý: ảnh đại diện + vòng thêm người cùng 28px cho cân với chữ (chủ dự án 09/11/2026) */
.rep-att-end .avatar { width: 28px; height: 28px; font-size: 11px; }
.rep-asg-add { width: 28px; height: 28px; }
.rep-asg-add svg { width: 12px; height: 12px; }
/* Hiệu suất nhân sự: tiêu đề + chip kỳ và 2 nút Xuất cùng 1 hàng (chủ dự án 09/11/2026); thẻ quá hẹp thì nút mới xuống hàng */
.rep-staff > .rep-card-head { flex-wrap: wrap; align-items: center; row-gap: 8px; }
.rep-staff-title { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; }
.rep-staff-title h2 { white-space: nowrap; }
.rep-staff > .rep-card-head .rep-staff-export { flex: none; display: flex; gap: 6px; margin: 0; }
/* Thu nhẹ khoảng cách để tiêu đề + chip kỳ + 2 nút Xuất vừa 1 hàng ở thẻ rộng ~460px (màn 1440px) */
.rep-staff-title { gap: 8px; }
.rep-staff .rep-period { padding: 3px 8px; }
.rep-staff > .rep-card-head .rep-xbtn { padding-left: 9px; padding-right: 9px; }

/* Cần xử lý — tab + dải tóm tắt theo ảnh mẫu (chủ dự án 09/11/2026): 4 tab chia đều 1 hàng (không lọt dòng), biểu tượng nét viền có màu;
   tab đang chọn viền + nền nhạt theo màu tab; dải tóm tắt cùng màu + ô sắp xếp; Chờ duyệt có khối riêng .rep-rv; Chưa giao chỉ còn vòng + và nút nhắc khi rê */
.rep-att .is-red { --tc: #e11d48; --tcd: #be123c; }
/* Màu tab (chủ dự án 09/11/2026): Quá hạn đỏ, Vướng mắc vàng, Chờ duyệt tím, Chưa giao người xanh dương; đầu nhóm cùng tông */
.rep-att .is-yellow { --tc: #eab308; --tcd: #a16207; }
.rep-att .is-violet { --tc: #7c5cf0; --tcd: #5b3fd1; }
.rep-att .is-blue { --tc: #3b82f6; --tcd: #1d4ed8; }
.rep-att .rep-att-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0; margin: 4px 0 10px; background: none; border: 0; }
.rep-att .rep-att-tab { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 7px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 12.5px; color: var(--ink); box-shadow: none; transition: border-color .2s, background-color .2s; }
.rep-att .rep-att-tab svg { flex: none; color: var(--tc); }
.rep-att .rep-att-tab-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-att .rep-att-tab:hover { border-color: color-mix(in srgb, var(--tc) 45%, var(--border)); }
.rep-att .rep-att-tab.is-on { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 8%, var(--surface)); color: var(--tcd); box-shadow: none; }
.rep-att .rep-att-tab.is-empty:not(.is-on) { opacity: 1; color: var(--ink-soft); }
.rep-att .rep-att-tab .rep-att-badge { flex: none; background: color-mix(in srgb, var(--tc) 12%, var(--surface)); color: var(--tcd); }
.rep-att .rep-att-tab.is-on .rep-att-badge { background: var(--tc); color: #fff; }
.rep-att-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; padding: 8px 10px 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--tc) 9%, var(--surface)); color: var(--tcd); font-size: 13px; font-weight: 600; }
.rep-att-sum-txt { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.rep-att-sum-txt svg { flex: none; color: var(--tc); }
.rep-att-sort { flex: none; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
/* Ô trống theo ảnh mẫu: hình bảng việc + huy hiệu màu tab, tiêu đề đậm, câu giải thích mờ; căn giữa vùng danh sách */
.rep-att-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1 0 auto; padding: 24px 16px 32px; text-align: center; }
.rep-empty-art { width: 200px; max-width: 60%; height: auto; margin-bottom: 14px; }
.rep-empty-blob { fill: color-mix(in srgb, var(--tc) 9%, var(--surface)); }
.rep-empty-spark { fill: none; stroke: color-mix(in srgb, var(--tc) 70%, var(--surface)); stroke-width: 3.5; stroke-linecap: round; }
.rep-empty-board { fill: var(--surface); stroke: #b6c2dc; stroke-width: 3; }
.rep-empty-clip { fill: #e2e8f5; stroke: #b6c2dc; stroke-width: 3; }
.rep-empty-tick { fill: none; stroke: #8f9bb8; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.rep-empty-line { fill: none; stroke: #d5dcea; stroke-width: 3.5; stroke-linecap: round; }
.rep-empty-badge { fill: color-mix(in srgb, var(--tc) 75%, var(--surface)); stroke: var(--surface); stroke-width: 4; }
.rep-empty-badge-ic { color: #fff; }
.rep-att-empty h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--ink); }
.rep-att-empty p { max-width: 460px; margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.rep-att-act { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--tc) 8%, var(--surface)); color: var(--tcd); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .2s, border-color .2s; }
.rep-att-act:hover { background: color-mix(in srgb, var(--tc) 15%, var(--surface)); border-color: var(--tc); }
/* Dòng Chờ duyệt theo ảnh mẫu (chủ dự án 09/11/2026): hàng gọn = tên + chip Chờ N ngày (cam) + mũi tên;
   mở = khung tím nhạt trượt xuống (.tm-collapse): 4 ô thông tin có vạch ngăn, ghi chú, nút Duyệt ngay / Nhắc người duyệt / Xem chi tiết */
.rep-rv { --rv: #7c5cf0; --rvd: #5b3fd1; border-top: 1px solid var(--border-soft); }
.rep-att-list > .rep-rv:first-child { border-top: 0; }
.rep-rv > .rep-att-row { border-top: 0; }
.rep-rv-end { flex: none; display: flex; align-items: center; gap: 8px; }
.rep-rv-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.rep-rv-chip.is-wait { background: color-mix(in srgb, var(--rv) 12%, var(--surface)); color: var(--rvd); }
.rep-rv-toggle { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; transition: background-color .2s; }
.rep-rv-toggle:hover { background: var(--bg); }
.rep-rv-toggle svg { transition: transform .2s ease; }
.rep-rv.is-open .rep-rv-toggle svg { transform: rotate(180deg); }
.rep-rv > .tm-collapse { transition-duration: .2s; }
.rep-rv-panel { margin: 0 12px 12px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--rv) 14%, var(--border-soft)); border-radius: 14px; background: color-mix(in srgb, var(--rv) 5%, var(--surface)); }
.rep-rv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rep-rv-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 0 16px; border-left: 1px solid color-mix(in srgb, var(--rv) 14%, var(--border-soft)); }
.rep-rv-cell:first-child { padding-left: 0; border-left: 0; }
.rep-rv-cell:last-child { padding-right: 0; }
.rep-rv-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rep-rv-lbl svg { flex: none; }
.rep-rv-val { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 28px; font-size: 13.5px; color: var(--ink); }
.rep-rv-val b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rep-rv-val .avatar { width: 26px; height: 26px; font-size: 10px; flex: none; }
/* Người phụ trách (mọi dòng Cần xử lý + khung Chờ duyệt): ảnh chồng nhau như tab Danh sách, viền trắng tách từng ảnh */
.rep-av-stack { display: inline-flex; align-items: center; flex: none; }
.rep-av-stack .avatar { box-sizing: border-box; border: 2px solid var(--surface); }
.rep-av-stack .avatar + .avatar { margin-left: -8px; }
.rep-rv-val.is-late b { color: var(--danger-600); }
.rep-rv-val.is-muted { color: var(--muted); font-size: 13px; }
.rep-rv-note { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.rep-rv-note .rep-rv-lbl { flex: none; padding-right: 12px; border-right: 1px solid var(--border-soft); font-weight: 600; }
.rep-rv-note p { flex: 1; min-width: 0; margin: 0; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-rv-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.rep-rv-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--rv) 35%, var(--border)); border-radius: 10px; background: var(--surface); color: var(--rvd); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color .2s, border-color .2s; }
.rep-rv-btn:hover { background: color-mix(in srgb, var(--rv) 8%, var(--surface)); border-color: var(--rv); }
.rep-rv-btn.is-main { border-color: var(--rv); background: var(--rv); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--rv) 25%, transparent); }
.rep-rv-btn.is-main:hover { background: var(--rvd); }
.rep-rv-link { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px; border: 0; background: none; color: var(--rvd); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.rep-rv-link:hover { text-decoration: underline; }
.rep-rv :is(button):disabled { opacity: .6; cursor: default; }
@container rep (max-width: 600px) {
  .rep-rv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .rep-rv-cell { padding-left: 16px; }
  .rep-rv-cell:nth-child(odd) { padding-left: 0; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .rep-rv-toggle svg, .rep-rv-btn, .rep-rv > .tm-collapse, .rep-rv > .tm-collapse > * { transition: none; } }
@media (prefers-reduced-motion: reduce) { .rep-att .rep-att-tab, .rep-att-act { transition: none; } }
/* Tab Cần xử lý rộng theo độ dài nhãn (nhãn dài lấy thêm chỗ) để đủ chữ cả 4 tab ở thẻ ~620px */
.rep-att .rep-att-tabs { display: flex; flex-wrap: nowrap; gap: 6px; }
.rep-att .rep-att-tab { flex: 1 1 auto; gap: 5px; padding: 7px 7px; font-size: 12px; }
.rep-att .rep-att-tab svg { width: 15px; height: 15px; }
.rep-att .rep-att-tab .rep-att-badge { padding: 0 6px; font-size: 11px; }
/* Thu thêm để 4 nhãn tab đủ chữ ở thẻ ~620px (màn 1440px) */
.rep-att .rep-att-tab { gap: 4px; padding: 6px 5px; font-size: 11.5px; }
.rep-att .rep-att-tab .rep-att-badge { padding: 0 5px; }
/* Đầu trang Báo cáo (09/11/2026): hàng 2 = trái Bộ lọc + kỳ (+ góc nhìn), phải 3 nút; bảng Bộ lọc mở canh trái theo nút */
.rep-top-v2 { margin-bottom: 14px; }
.rep-bar2-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.rep-bar2 .rep-top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.rep-flt-pop { left: 0; right: auto; }

/* ===== Báo cáo › Đội nhóm › Tổng hợp theo ảnh mẫu (chủ dự án 09/11/2026), reports.js khối tgTiles / tgSummary / tgSide / tgBottom =====
   Màu theo chức năng (WEA): xanh dương = giờ / AI, đỏ = quá tải, cam = chưa giao, xanh lá = đúng hạn, tím = rủi ro phối hợp */
.tg-kpis2 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.tg-kpi { --k: #3b82f6; --kd: #1d4ed8; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--k) 18%, transparent); border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--k) 9%, var(--surface)) 0%, color-mix(in srgb, var(--k) 4%, var(--surface)) 100%); font: inherit; text-align: left; color: var(--ink); cursor: pointer;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--k) 7%, transparent); transition: border-color .2s, box-shadow .2s; }
.tg-kpi:hover, .tg-kpi:focus-visible { border-color: color-mix(in srgb, var(--k) 45%, transparent); box-shadow: 0 6px 18px color-mix(in srgb, var(--k) 14%, transparent); outline: none; }
.tg-kpi[disabled] { cursor: default; }
.tg-kpi.is-red { --k: #f43f5e; --kd: #be123c; }
.tg-kpi.is-orange { --k: #f59e0b; --kd: #b45309; }
.tg-kpi.is-green { --k: #22c55e; --kd: #15803d; }
.tg-kpi.is-violet { --k: #8b5cf6; --kd: #6d28d9; }
.tg-kpi-top { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--k); }
.tg-kpi-top svg { flex: none; }
.tg-kpi-top b { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--kd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-kpi-i { display: inline-grid; place-items: center; flex: none; color: var(--muted); cursor: help; }
.tg-kpi-mid { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.tg-kpi-v { display: flex; align-items: baseline; gap: 5px; min-width: 0; white-space: nowrap; }
.tg-kpi-v > b { font-size: clamp(22px, 2vw, 28px); font-weight: 800; line-height: 1.05; color: var(--kd); }
.tg-kpi-v > small { font-size: 14px; font-weight: 600; color: var(--kd); opacity: .7; }
.tg-kpi-d { display: flex; flex-direction: column; align-items: flex-end; flex: none; margin-left: auto; line-height: 1.3; text-align: right; }
.tg-kpi-d b { font-size: 12px; font-weight: 700; white-space: nowrap; }
.tg-kpi-d small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tg-kpi-d.is-good b { color: #15803d; }
.tg-kpi-d.is-bad b { color: #be123c; }
.tg-kpi-d.is-flat b, .tg-kpi-d.is-none b { color: var(--muted); }
.tg-kpi-foot { margin-top: auto; font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-kpi-foot b { color: var(--ink); }
.tg-kpi .tg-kpi-bar { display: block; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--k) 14%, var(--surface)); overflow: hidden; }
.tg-kpi .tg-kpi-bar i { display: block; height: 100%; border-radius: inherit; background: var(--k); }

/* Bố cục: bảng + cột phải; hàng 4 thẻ dưới */
.tg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: start; margin-bottom: 16px; }
.tg-sidecol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tg-bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 16px; align-items: stretch; }
.tg-hico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: color-mix(in srgb, var(--hc, #3b82f6) 12%, var(--surface)); color: var(--hc, #3b82f6); }
.tg-hico.is-red { --hc: #f43f5e; }
.tg-hico.is-orange { --hc: #f59e0b; }
.tg-hico.is-blue { --hc: #3b82f6; }
.tg-link { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #2563eb; cursor: pointer; white-space: nowrap; }
.tg-link:hover { text-decoration: underline; }
.tg-side-empty { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0; font-size: 13px; color: var(--muted); text-align: center; }
.tg-side-empty svg { color: #22c55e; flex: none; }

/* Thẻ Tổng quan đội nhóm */
.tg-ov { padding: 18px 18px 12px; }
.tg-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tg-card-head > div { flex: 1; min-width: 0; }
.tg-card-head h2 { margin: 0; font-size: 17px; }
.tg-card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.tg-card-head .tg-hico { width: 42px; height: 42px; border-radius: 13px; }
.tg-table2 { width: 100%; border-collapse: separate; border-spacing: 0; }
.tg-table2 th { padding: 8px 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft); text-align: center; white-space: nowrap; border-bottom: 1px solid var(--border-soft); }
.tg-table2 th:first-child, .tg-table2 th:nth-child(2) { text-align: left; }
.tg-table2 td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tg-table2 td:first-child, .tg-table2 td:nth-child(2) { text-align: left; }
.tg-table2 td:first-child { min-width: 150px; max-width: 220px; }
.tg-table2 .report-sort { font-weight: 600; color: inherit; }
.tg-table2 tr.rep-mrow { cursor: pointer; transition: background-color .2s; }
.tg-table2 tr.rep-mrow:hover td, .tg-table2 tr.tg-row.is-open td { background: var(--bg); }
.tg-mname { display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: 34px; }
.tg-table2.is-flat .tg-mname { padding-left: 0; }
.tg-mname .avatar { width: 30px; height: 30px; font-size: 11px; flex: none; }
.tg-mname b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-table2 .tg-group td { background: var(--surface); }
.tg-gname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tg-gname > svg { flex: none; color: var(--ink-soft); transition: transform .2s; }
.tg-group.is-closed .tg-gname > svg { transform: rotate(-90deg); }
.tg-gname > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tg-gname > span:last-child > b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-gname small { font-size: 12px; color: var(--muted); }
.tg-gico { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); color: #7c3aed; }
/* Số trong dòng thành viên là nút mở danh sách việc đã lọc (đặc tả 09/11/2026) */
.tg-num { padding: 0; border: 0; border-radius: 99px; background: none; font: inherit; cursor: pointer; transition: box-shadow .2s; }
.tg-num:hover .tg-dot, .tg-num:focus-visible .tg-dot { box-shadow: 0 0 0 2px currentColor; }
.tg-num:focus-visible { outline: none; }
.tg-dot { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 7px; border-radius: 99px; font-size: 12.5px; font-weight: 700; box-sizing: border-box; }
.tg-dot.is-blue { background: color-mix(in srgb, #3b82f6 13%, var(--surface)); color: #1d4ed8; }
.tg-dot.is-red { background: color-mix(in srgb, #f43f5e 13%, var(--surface)); color: #be123c; }
.tg-dot.is-violet { background: color-mix(in srgb, #8b5cf6 13%, var(--surface)); color: #6d28d9; }
.tg-dot.is-green { background: color-mix(in srgb, #22c55e 14%, var(--surface)); color: #15803d; }
.tg-table2 .tg-rate { display: inline-block; min-width: 44px; padding: 3px 8px; border-radius: 8px; font-size: 12.5px; }
.tg-table2 .tg-rate.is-good { background: color-mix(in srgb, #22c55e 14%, var(--surface)); color: #15803d; }
.tg-table2 .tg-rate.is-mid { background: color-mix(in srgb, #f59e0b 14%, var(--surface)); color: #b45309; }
.tg-table2 .tg-rate.is-bad { background: color-mix(in srgb, #f43f5e 13%, var(--surface)); color: #be123c; }
/* Bảng cao đúng bằng cột phải: contain:size để hàng lưới chỉ tính chiều cao cột phải, bảng giãn theo rồi cuộn bên trong;
   đầu bảng + dòng Tổng cộng dính để luôn thấy khi cuộn */
.tg-grid { align-items: stretch; }
.tg-grid > .report-card, .tg-sidecol > .report-card { margin: 0; }
.tg-grid > .tg-ov { display: flex; flex-direction: column; contain: size; min-height: 440px; }
.tg-grid > .tg-ov .report-table-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; }
.tg-grid > .tg-ov .tg-table2 thead th { position: sticky; top: 0; z-index: 2; }

/* Cột phải */
.tg-side { padding: 16px; }
.tg-side-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
.tg-side-head h2 { flex: 1; margin: 0; font-size: 15px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-alert { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--ac) 22%, transparent); border-radius: 10px;
  background: color-mix(in srgb, var(--ac) 7%, var(--surface)); font: inherit; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s, border-color .2s; }
.tg-alert:hover { background: color-mix(in srgb, var(--ac) 13%, var(--surface)); border-color: color-mix(in srgb, var(--ac) 40%, transparent); }
.tg-alert > svg:first-child { flex: none; color: var(--ac); }
.tg-alert > span { flex: 1; min-width: 0; }
.tg-alert > span b { color: var(--acd); font-weight: 800; }
.tg-alert > svg:last-child { flex: none; color: var(--ink-soft); }
.tg-alert.is-red { --ac: #f43f5e; --acd: #be123c; }
.tg-alert.is-orange { --ac: #f59e0b; --acd: #b45309; }
.tg-alert.is-violet { --ac: #8b5cf6; --acd: #6d28d9; }

/* Hàng 4 thẻ dưới */
.tg-bcard { display: flex; flex-direction: column; min-width: 0; padding: 16px; }
.tg-bcard .tg-side-head { margin-bottom: 4px; }
.tg-bcard .tg-side-head h2 { font-size: 14.5px; white-space: normal; }

/* Hộp Gợi ý AI cho đội nhóm (#modal-tgai) — tông xanh dương thay cho tím của ảnh mẫu */
#modal-tgai .tgai-modal { width: min(820px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 40px); padding: 22px 24px 20px; overflow-y: auto; border-radius: 22px;
  background: linear-gradient(180deg, color-mix(in srgb, #3b82f6 9%, var(--surface)) 0%, var(--surface) 38%); }
.tgai-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.tgai-head img { width: 76px; height: 76px; flex: none; object-fit: contain; }
.tgai-head > div { flex: 1; min-width: 0; }
.tgai-head h2 { margin: 0; font-size: 22px; }
.tgai-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.tgai-x { align-self: flex-start; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 8px rgba(15, 23, 42, .08); }
.tgai-tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tgai-tabs button { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 9px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.tgai-tabs button:hover { border-color: color-mix(in srgb, #3b82f6 35%, var(--border)); }
.tgai-tabs button.is-on { border-color: color-mix(in srgb, #3b82f6 40%, transparent); background: color-mix(in srgb, #3b82f6 10%, var(--surface)); color: #1d4ed8; }
.tgai-view { display: flex; flex-direction: column; gap: 14px; }
.tgai-box { padding: 16px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: 0 2px 10px rgba(15, 23, 42, .04); }
.tgai-box-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tgai-hico { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; background: color-mix(in srgb, #3b82f6 12%, var(--surface)); color: #2563eb; }
.tgai-box-head h3 { margin: 0; font-size: 18px; }
.tgai-box-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.tgai-sug { --sc: #3b82f6; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--sc) 18%, transparent); border-radius: 14px;
  background: color-mix(in srgb, var(--sc) 6%, var(--surface)); }
.tgai-sug.is-red { --sc: #f43f5e; }
.tgai-sug.is-orange { --sc: #f59e0b; }
.tgai-sug.is-green { --sc: #22c55e; }
.tgai-sug.is-violet { --sc: #8b5cf6; }
.tgai-sug-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--sc) 14%, var(--surface)); color: var(--sc); }
.tgai-sug-txt { min-width: 0; }
.tgai-sug-txt b { display: block; font-size: 14px; }
.tgai-sug.is-red .tgai-sug-txt b { color: #be123c; }
.tgai-sug-txt p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.tgai-lv { padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tgai-lv.is-red { background: color-mix(in srgb, #f43f5e 13%, var(--surface)); color: #be123c; }
.tgai-lv.is-blue { background: color-mix(in srgb, #3b82f6 13%, var(--surface)); color: #1d4ed8; }
.tgai-lv.is-green { background: color-mix(in srgb, #22c55e 14%, var(--surface)); color: #15803d; }
.tgai-sug-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; cursor: pointer; transition: border-color .2s, color .2s; }
.tgai-sug-btn:hover { border-color: #3b82f6; color: #1d4ed8; }
.tgai-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tgai-h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; }
.tgai-h3 svg { color: #3b82f6; }
.tgai-ins { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tgai-ins li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; }
.tgai-ins li i { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #22c55e; }
.tgai-ins li.is-red i { background: #f43f5e; }
.tgai-ins li.is-orange i { background: #f59e0b; }
.tgai-fc-wrap { display: grid; grid-template-columns: auto auto; justify-content: space-between; row-gap: 4px; color: #3b82f6; }
.tgai-fc { grid-column: 1 / -1; width: 100%; height: 90px; }
.tgai-fc circle { fill: var(--surface); stroke: currentColor; stroke-width: 2.5; }
.tgai-fc-now, .tgai-fc-next { display: flex; flex-direction: column; line-height: 1.2; }
.tgai-fc-next { align-items: flex-end; }
.tgai-fc-now b, .tgai-fc-next b { font-size: 15px; color: var(--ink); }
.tgai-fc-next b { font-size: 18px; color: #1d4ed8; }
.tgai-fc-now small, .tgai-fc-next small { font-size: 11px; color: var(--muted); }
.tgai-note { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.tgai-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tgai-table th, .tgai-table td { padding: 9px 8px; border-bottom: 1px solid var(--border-soft); text-align: center; white-space: nowrap; }
.tgai-table th:first-child { text-align: left; }
.tgai-table thead th { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.tgai-plan { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.tgai-plan li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.tgai-plan-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, #3b82f6 12%, var(--surface)); color: #1d4ed8; font-weight: 700; }
.tgai-plan small { font-size: 11.5px; font-weight: 600; color: #2563eb; }
.tgai-plan b { display: block; font-size: 13.5px; }
.tgai-plan p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.tgai-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.tgai-fbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .05); transition: border-color .2s, background-color .2s; }
.tgai-fbtn:hover { border-color: #3b82f6; }
.tgai-fbtn img { width: 22px; height: 22px; object-fit: contain; }
.tgai-fbtn.is-main { border-color: transparent; background: linear-gradient(135deg, #38bdf8, #3b82f6); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, #3b82f6 30%, transparent); }
.tgai-fbtn.is-main:hover { background: linear-gradient(135deg, #0ea5e9, #2563eb); }

@media (max-width: 640px) {
  .tgai-two { grid-template-columns: minmax(0, 1fr); }
  .tgai-sug { grid-template-columns: 40px minmax(0, 1fr); }
  .tgai-sug .tgai-lv, .tgai-sug .tgai-sug-btn { grid-column: 2; justify-self: start; }
  .tgai-plan li { grid-template-columns: 30px minmax(0, 1fr); }
  .tgai-plan .tgai-sug-btn { grid-column: 2; justify-self: start; }
  .tgai-head img { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .tg-kpi, .tg-todo, .tg-rk, .tg-alert, .tg-ai-btn, .tgai-tabs button, .tgai-sug-btn, .tgai-fbtn, .tg-gname > svg, .tg-table2 tr.rep-mrow { transition: none; } }

/* ===== Đội nhóm › Tổng quan bản 2 (ảnh mẫu chủ dự án 09/11/2026): bảng có cột Bị chặn + Trạng thái, Cần xử lý hôm nay,
   WEA AI gợi ý điều phối, So sánh hiệu suất, Xu hướng đúng hạn & quá hạn, Thành viên có rủi ro cao; tab Phân bổ ===== */
.tg-h1 { display: flex; align-items: center; gap: 10px; }
.tg-h1 svg { flex: none; color: #3b82f6; }
.tg-fchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid color-mix(in srgb, #3b82f6 30%, transparent); border-radius: 99px;
  background: color-mix(in srgb, #3b82f6 8%, var(--surface)); font: inherit; font-size: 12.5px; font-weight: 600; color: #1d4ed8; white-space: nowrap; cursor: pointer; transition: background-color .2s; }
.tg-fchip:hover { background: color-mix(in srgb, #3b82f6 15%, var(--surface)); }
.tg-export { display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap; }
/* Bảng Tổng quan đội nhóm */
.tg-table2 thead th { background: color-mix(in srgb, var(--bg) 85%, var(--surface)); border-bottom: 0; vertical-align: middle; }
.tg-table2 thead th:first-child { border-radius: 10px 0 0 10px; }
.tg-table2 thead th:last-child { border-radius: 0 10px 10px 0; }
.tg-table2 th small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); }
.tg-table2 .tg-th-st { text-align: center; }
.tg-dot.is-orange { background: color-mix(in srgb, #f59e0b 16%, var(--surface)); color: #b45309; }
.tg-ot { font-size: 12.5px; font-weight: 700; }
.tg-ot.is-good { color: #15803d; }
.tg-ot.is-mid { color: #b45309; }
.tg-ot.is-bad { color: #be123c; }
.tg-st { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tg-st.is-red { background: color-mix(in srgb, #f43f5e 12%, var(--surface)); color: #be123c; }
.tg-st.is-orange { background: color-mix(in srgb, #f59e0b 15%, var(--surface)); color: #b45309; }
.tg-st.is-green { background: color-mix(in srgb, #22c55e 14%, var(--surface)); color: #15803d; }
.tg-load2 { display: flex; flex-direction: column; gap: 4px; min-width: 112px; max-width: 132px; }
.tg-load2-p { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.tg-load2 .rt-bar { width: 100%; height: 6px; }
.tg-load2-num { font-size: 11.5px; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.tg-gico[style] { background: color-mix(in srgb, var(--tc) 14%, var(--surface)); color: var(--tc); }
.tg-gico.is-un { background: color-mix(in srgb, #f59e0b 16%, var(--surface)); color: #d97706; }
.tg-gname small b { font-weight: 600; color: var(--ink-soft); }
.tg-unrow .tg-gname > svg { color: var(--ink-soft); }
.tg-mtxt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tg-mline { display: flex; align-items: center; gap: 5px; min-width: 0; }
.tg-mtxt small { font-size: 11.5px; color: var(--muted); }
.tg-crown { display: inline-grid; flex: none; color: #f59e0b; }
/* Thành viên lồng trong khung nền nhạt dưới dòng nhóm */
.tg-table2 tr.in-group td { background: color-mix(in srgb, var(--bg) 55%, var(--surface)); padding-top: 7px; padding-bottom: 7px; }
.tg-table2 tr.in-group td:first-child { border-left: 1px solid var(--border-soft); }
.tg-table2 tr.in-group td:last-child { border-right: 1px solid var(--border-soft); }
.tg-table2 tr.in-group.is-first td { border-top: 1px solid var(--border-soft); }
.tg-table2 tr.in-group.is-first td:first-child { border-top-left-radius: 12px; }
.tg-table2 tr.in-group.is-first td:last-child { border-top-right-radius: 12px; }
.tg-table2 tr.in-group.is-last td:first-child { border-bottom-left-radius: 12px; }
.tg-table2 tr.in-group.is-last td:last-child { border-bottom-right-radius: 12px; }
.tg-table2 tr.in-group .tg-mname { padding-left: 26px; }
/* Cột phải: Cần xử lý hôm nay */
.tg-todo { --ac: #f43f5e; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 4px; border: 0; border-top: 1px solid var(--border-soft); background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  border-radius: 10px; transition: background-color .2s; }
.tg-side-head + .tg-todo { border-top: 0; }
.tg-todo:hover { background: var(--bg); }
.tg-todo.is-yellow { --ac: #eab308; }
.tg-todo.is-orange { --ac: #f59e0b; }
.tg-todo.is-violet { --ac: #8b5cf6; }
.tg-todo-ic { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: color-mix(in srgb, var(--ac) 14%, var(--surface)); color: var(--ac); }
.tg-todo-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.tg-todo-txt b { font-size: 13px; font-weight: 700; }
.tg-todo-txt small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-todo > svg:last-child { flex: none; color: var(--ink-soft); }
/* Cột phải: WEA AI gợi ý điều phối */
.tg-aicard { display: flex; flex-direction: column; gap: 12px; border: 1px solid color-mix(in srgb, #3b82f6 22%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, #3b82f6 10%, var(--surface)), color-mix(in srgb, #38bdf8 5%, var(--surface))); }
.tg-ai-head { display: flex; align-items: center; gap: 12px; }
.tg-ai-head img { width: 54px; height: 54px; flex: none; object-fit: contain; }
.tg-ai-head h2 { margin: 0; font-size: 15px; }
.tg-ai-head p { margin: 2px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.tg-ai-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tg-ai-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.tg-ai-list svg { flex: none; margin-top: 2px; color: #22c55e; }
.tg-ai-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-ai-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 11px; font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color .2s, border-color .2s; }
.tg-ai-btn.is-main { flex: 1 1 auto; background: #3b82f6; color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, #3b82f6 30%, transparent); }
.tg-ai-btn.is-main:hover { background: #2563eb; }
.tg-ai-btn.is-soft { flex: 0 1 auto; border-color: color-mix(in srgb, #3b82f6 30%, transparent); background: var(--surface); color: #1d4ed8; }
.tg-ai-btn.is-soft:hover { background: color-mix(in srgb, #3b82f6 8%, var(--surface)); }
/* Hàng dưới 3 thẻ: 2 thẻ dưới bảng + 1 thẻ thẳng cột phải */
.tg-bottom3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: stretch; }
.tg-bottom3 > .report-card { margin: 0; }
.tg-bcard .tg-side-head .tg-kpi-i { margin-left: -4px; }
.tg-cmp-sel { flex: none; max-width: 140px; height: 30px; margin-left: auto; padding: 0 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font: inherit; font-size: 12px; color: var(--ink); }
.tg-cmp { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.tg-cmp-row { display: grid; grid-template-columns: minmax(60px, 96px) minmax(0, 1fr); align-items: center; gap: 10px; }
.tg-cmp-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-cmp-track { display: flex; align-items: center; gap: 6px; height: 24px; border-left: 1px solid var(--border); }
.tg-cmp-track i { height: 100%; border-radius: 0 7px 7px 0; background: linear-gradient(90deg, #93c5fd, #3b82f6); }
.tg-cmp-track b { font-size: 12px; font-weight: 700; }
.tg-cmp-axis { margin-top: -6px; }
.tg-cmp-ticks { display: flex; justify-content: space-between; padding-right: 44px; font-size: 10.5px; color: var(--muted); }
.tg-cmp-ticks i { font-style: normal; }
.tg-tr-keys { display: inline-flex; gap: 12px; flex: none; margin-left: auto; font-size: 11.5px; color: var(--ink-soft); }
.tg-tr-keys span { display: inline-flex; align-items: center; gap: 5px; }
.tg-tr-keys i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.tg-tr-keys i.is-over { background: #f43f5e; }
.tg-tr { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.tg-tr text { font-size: 10px; fill: var(--muted); font-family: inherit; }
.tg-tr .tg-tr-grid { stroke: var(--border-soft); stroke-dasharray: 3 3; }
.tg-tr .tg-tr-area { fill: url(#tg-tr-g); }
.tg-tr .tg-tr-l { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tg-tr .tg-tr-l.is-on, .tg-tr circle.is-on { stroke: #22c55e; }
.tg-tr .tg-tr-l.is-over, .tg-tr circle.is-over { stroke: #f43f5e; }
.tg-tr circle { fill: var(--surface); stroke-width: 2; }
.tg-tr .tg-tr-pill rect { stroke-width: 1; }
.tg-tr .tg-tr-pill.is-on rect { fill: color-mix(in srgb, #22c55e 14%, var(--surface)); stroke: color-mix(in srgb, #22c55e 45%, transparent); }
.tg-tr .tg-tr-pill.is-over rect { fill: color-mix(in srgb, #f43f5e 12%, var(--surface)); stroke: color-mix(in srgb, #f43f5e 40%, transparent); }
.tg-tr .tg-tr-pill text { font-size: 10.5px; font-weight: 700; }
.tg-tr .tg-tr-pill.is-on text { fill: #15803d; }
.tg-tr .tg-tr-pill.is-over text { fill: #be123c; }
.tg-rk { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; padding: 10px 4px; border: 0; border-top: 1px solid var(--border-soft); border-radius: 10px;
  background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s; }
.tg-side-head + .tg-rk { border-top: 0; }
.tg-rk:hover { background: var(--bg); }
.tg-rk .avatar { width: 34px; height: 34px; font-size: 11px; }
.tg-rk-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tg-rk-who b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-rk-who small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-rk-load { padding: 3px 8px; border-radius: 8px; background: var(--bg); font-size: 11.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.tg-rk-load.is-red { background: color-mix(in srgb, #f43f5e 12%, var(--surface)); color: #be123c; }
.tg-rk-load.is-orange { background: color-mix(in srgb, #f59e0b 15%, var(--surface)); color: #b45309; }
.tg-rk-od { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
/* Bản 2 — vừa 9 cột ở màn 1366px: đệm ô gọn, cột tên / tải hẹp lại */
.tg-table2 th { padding: 8px 4px; }
.tg-table2 td { padding: 9px 4px; }
.tg-table2 td:first-child { min-width: 140px; max-width: 200px; }
.tg-table2 .tg-load2 { min-width: 96px; max-width: 116px; }
.tg-table2 .tg-st { padding: 3px 8px; font-size: 11px; }
/* Tên ô số dài: xuống tối đa 2 dòng thay vì cắt chữ */
.tg-kpi-top { align-items: flex-start; }
.tg-kpi-top b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
/* Hai nút thẻ AI xếp dọc, cùng bề rộng */
.tg-ai-btns { flex-direction: column; }
.tg-ai-btn.is-main, .tg-ai-btn.is-soft { flex: none; width: 100%; }
/* Tiêu đề thẻ hàng dưới: ô chọn / chú thích xuống dòng khi hẹp, tiêu đề không vỡ 3 dòng */
.tg-bottom3 .tg-side-head { flex-wrap: wrap; row-gap: 8px; }
.tg-bottom3 .tg-side-head h2 { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-bottom3 .tg-side-head > :not(h2):not(.tg-tr-keys) { flex-shrink: 0; }
.tg-tr-keys.is-row { flex-basis: 100%; justify-content: flex-end; }
.tg-bottom3 .tg-bcard { display: flex; flex-direction: column; }
.tg-cmp { flex: 1; justify-content: space-around; }
.tg-cmp-axis { margin-top: 0; }
.tg-cmp-ticks { position: relative; display: block; height: 14px; margin-right: 44px; padding-right: 0; }
.tg-cmp-ticks i { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.tg-cmp-ticks i:first-child { transform: none; }
.tg-cmp-ticks i:last-child { transform: translateX(-100%); }
/* Thành viên có rủi ro cao: % tải trên, số việc quá hạn dưới (đủ chỗ cho tên) */
.tg-rk { gap: 8px; }
.tg-rk-od { font-size: 11.5px; }
/* Bản 2 — tiêu đề thẻ theo ảnh mẫu: icon xanh đậm không ô nền; biểu tượng nhóm hình tròn */
.tg-ov .tg-card-head .tg-hico, .tg-today .tg-side-head .tg-hico, .tg-bottom3 .tg-side-head .tg-hico { width: auto; height: auto; border-radius: 0; background: none; color: #2563eb; }
.tg-ov .tg-card-head h2 { font-size: 18px; }
.tg-today .tg-side-head h2, .tg-bottom3 .tg-side-head h2 { font-size: 15.5px; }
.tg-gico { border-radius: 50%; }
.tg-kpi-top { gap: 8px; }

/* ===== Đội nhóm — đổi số cột theo bề rộng thật của vùng Báo cáo (container rep), để khi phóng to 110–200%
   chữ không xuống dòng, bảng không cuộn ngang, thẻ không vỡ. Đặt CUỐI tệp để đè các khối bản 2 phía trên. ===== */
.tg-tr-keys span, .tg-rk-load, .tg-rk-od, .tg-st, .tg-load2-p, .tg-kpi-d b { white-space: nowrap; }
.tg-gname small, .tg-mtxt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-cmp-sel, .tg-bottom3 .cselect-btn { max-width: 100%; }
/* Ô số: 5 cột khi đủ rộng (mỗi ô ≥ ~235px để tên ô 1 dòng); hẹp hơn thì 3 + 2 (2 ô cuối rộng hơn), rồi 2 cột, rồi 1 cột */
@container rep (max-width: 1220px) {
  .tg-kpis2 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tg-kpis2 > .tg-kpi { grid-column: span 2; }
  .tg-kpis2 > .tg-kpi:nth-child(n+4) { grid-column: span 3; }
}
/* Bảng cần ~710px: cột phải không còn đủ chỗ thì xuống dưới bảng (2 thẻ cạnh nhau), bảng dùng hết bề ngang */
@container rep (max-width: 1060px) {
  .tg-grid { grid-template-columns: minmax(0, 1fr); }
  .tg-grid > .tg-ov { contain: none; min-height: 0; }
  .tg-grid > .tg-ov .report-table-scroll { flex: none; max-height: 560px; }
  .tg-sidecol { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: stretch; }
  .tg-bottom3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tg-bottom3 > .tg-risk { grid-column: 1 / -1; }
}
@container rep (max-width: 760px) {
  .tg-kpis2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tg-kpis2 > .tg-kpi, .tg-kpis2 > .tg-kpi:nth-child(n+4) { grid-column: auto; }
  .tg-kpis2 > .tg-kpi:last-child { grid-column: 1 / -1; }
  .tg-card-head { flex-wrap: wrap; }
}
@container rep (max-width: 680px) {
  .tg-bottom3 { grid-template-columns: minmax(0, 1fr); }
  .tg-bottom3 > .tg-risk { grid-column: auto; }
}
@container rep (max-width: 480px) {
  .tg-kpis2 { grid-template-columns: minmax(0, 1fr); }
  .tg-kpis2 > .tg-kpi:last-child { grid-column: auto; }
}
/* So sánh hiệu suất: 1 lưới chung cho mọi dòng — cột tên rộng theo tên dài nhất (tối đa 50% thẻ), thanh luôn thẳng hàng */
.tg-cmp { display: grid; grid-template-columns: fit-content(50%) minmax(0, 1fr); column-gap: 10px; row-gap: 14px; align-content: space-around; align-items: center; }
.tg-cmp-row { display: contents; }
/* Bảng gọn thêm một chút để vừa cạnh cột phải ở màn 1366px */
.tg-table2 td:first-child { min-width: 130px; max-width: 190px; }
.tg-table2 .tg-load2 { min-width: 88px; max-width: 108px; }
.tg-table2 .tg-dot { min-width: 26px; padding: 0 6px; }
/* Vùng quá hẹp cho 8 cột (phóng to 150% trở lên): bảng cuộn ngang trong khung, cột tên dính bên trái để luôn biết dòng của ai */
@container rep (max-width: 1060px) {
  .tg-table2 td:first-child, .tg-table2 thead th:first-child { position: sticky; left: 0; z-index: 1; }
  .tg-table2 tbody td:first-child { background: var(--surface); }
  .tg-table2 tr.in-group td:first-child { background: color-mix(in srgb, var(--bg) 55%, var(--surface)); }
  .tg-table2 tr.rep-mrow:hover td:first-child { background: var(--bg); }
  .tg-grid > .tg-ov .tg-table2 thead th:first-child { z-index: 3; }
}
/* Màn ~1366px (vùng báo cáo 1060–1150px): cột phải 280px + đệm thẻ bảng gọn hơn để 8 cột vừa, không cuộn ngang */
@container rep (min-width: 1061px) and (max-width: 1150px) {
  .tg-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .tg-bottom3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 280px; }
  .tg-grid > .tg-ov { padding-left: 12px; padding-right: 12px; }
  .tg-table2 td:first-child { min-width: 124px; }
}
@container rep (min-width: 1061px) and (max-width: 1150px) {
  .tg-todo { gap: 10px; padding-left: 2px; padding-right: 2px; }
  .tg-todo-ic { width: 34px; height: 34px; }
  .tg-todo-txt small { font-size: 11px; }
}
/* Biểu đồ xu hướng giữ tỉ lệ: thẻ rộng (1 cột) thì không phóng to chữ trục, chỉ căn giữa */
.tg-tr { max-height: 240px; }

/* ===== Bảng Tổng quan đội nhóm gọn theo ảnh mẫu 1 (09/11/2026): header 42px, dòng nhóm ~52px, dòng thành viên ~38px ===== */
.tg-table2 thead th { height: 42px; padding: 4px 8px; font-size: 12px; }
.tg-table2 td { padding: 6px 8px; }
.tg-table2 th:first-child { width: 30%; }
.tg-table2 td:first-child { min-width: 170px; max-width: none; }
.tg-table2 tr.tg-group td, .tg-table2 tr.tg-unrow td { height: 52px; }
.tg-gname { gap: 10px; }
.tg-gico { width: 34px; height: 34px; }
.tg-gname > span:last-child > b { font-size: 14px; font-weight: 700; }
.tg-gname small { font-size: 11.5px; line-height: 1.35; }
/* Thành viên: thụt lề, avatar 28px, nền xanh xám rất nhạt, viền mảnh bao cả nhóm */
.tg-table2 tr.in-group td { height: 38px; padding-top: 3px; padding-bottom: 3px; background: #f7faff; border-bottom-color: #e7edf5; }
.tg-table2 tr.in-group td:first-child { border-left-color: #e7edf5; }
.tg-table2 tr.in-group td:last-child { border-right-color: #e7edf5; }
.tg-table2 tr.in-group.is-first td { border-top-color: #e7edf5; }
.tg-table2 tr.in-group .tg-mname { gap: 9px; padding-left: 38px; }
.tg-table2 tr.in-group .avatar, .tg-table2 tr.tg-row .avatar { width: 28px; height: 28px; font-size: 10.5px; }
.tg-mline b { font-size: 13px; font-weight: 600; }
.tg-mtxt { line-height: 1.25; }
.tg-mtxt small { font-size: 11px; }
/* Ô tải: % trên; dòng thành viên thanh + giờ cùng hàng; dòng nhóm giờ dưới thanh, căn phải */
.tg-table2 .tg-load2 { gap: 3px; min-width: 120px; max-width: 160px; }
.tg-load2-p { font-size: 12.5px; line-height: 1.2; }
.tg-load2-line { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.tg-load2-line .rt-bar { width: 100%; height: 6px; border-radius: 99px; background: #e6edf7; }
.tg-load2-line .rt-bar i { border-radius: 99px; }
.tg-load2-line .tg-load2-num { font-size: 11px; text-align: right; color: var(--ink-soft); }
.tg-load2.is-row .tg-load2-p { font-size: 11.5px; }
.tg-load2.is-row .tg-load2-line { flex-direction: row; align-items: center; gap: 8px; }
.tg-load2.is-row .rt-bar { flex: 1; height: 5px; }
.tg-load2.is-row .tg-load2-num { flex: none; }
.tg-load2.is-none .tg-load2-p { color: var(--muted); }
.tg-load2.is-none .tg-load2-num { font-size: 11px; color: var(--muted); text-align: left; white-space: nowrap; }
/* Số liệu: ô tròn đồng đều cao 24px */
.tg-table2 .tg-dot { height: 24px; min-width: 30px; padding: 0 8px; font-size: 12px; }
.tg-table2 tr.in-group .tg-dot { height: 22px; min-width: 26px; padding: 0 7px; font-size: 11.5px; }
.tg-table2 .tg-ot { font-size: 12.5px; }
.tg-table2 tr.in-group .tg-ot { font-size: 12px; }
/* Trạng thái: nhãn pastel nhỏ cao ~25px */
.tg-table2 .tg-st { display: inline-flex; align-items: center; height: 25px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; }
/* Cần xử lý hôm nay: mỗi mục ~56px, icon 38px, mô tả 1 dòng */
.tg-todo { min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
.tg-todo-txt b { font-size: 13.5px; }
.tg-todo-txt small { font-size: 11.5px; }
.tg-today .tg-side-head { margin-bottom: 6px; }
/* Vùng 1061–1150px (màn 1366): bảng vẫn vừa 8 cột */
@container rep (min-width: 1061px) and (max-width: 1150px) {
  .tg-table2 thead th, .tg-table2 td { padding-left: 4px; padding-right: 4px; }
  .tg-table2 th:first-child { width: auto; }
  .tg-table2 td:first-child { min-width: 128px; }
  .tg-table2 .tg-load2 { min-width: 96px; }
  .tg-table2 tr.in-group .tg-mname { padding-left: 26px; }
  .tg-table2 .tg-st { padding: 0 8px; font-size: 11px; }
}
@container rep (max-width: 1060px) {
  .tg-table2 th:first-child { width: auto; }
  .tg-table2 td:first-child { min-width: 190px; }
}
/* Cột tên rộng theo % bảng (max-width: 1px để ô bảng chịu rút gọn "…" thay vì giãn theo dòng phụ dài) */
.tg-table2 td:first-child { max-width: 1px; }
@container rep (min-width: 1061px) and (max-width: 1150px) { .tg-table2 th:first-child { width: 25%; } }
@container rep (max-width: 1060px) { .tg-table2 th:first-child { width: 28%; } }
@container rep (max-width: 800px) {
  .tg-table2 thead th, .tg-table2 td { padding-left: 4px; padding-right: 4px; }
  .tg-table2 td:first-child { min-width: 156px; }
  .tg-table2 .tg-load2 { min-width: 92px; }
  .tg-table2 tr.in-group .tg-mname { padding-left: 24px; }
  .tg-table2 .tg-st { padding: 0 8px; font-size: 11px; }
}
/* Màn rộng (vùng báo cáo > 1150px): bảng ~69% / cột phải ~31%; hàng 3 thẻ dưới thẳng cột với cột phải */
@container rep (min-width: 1151px) {
  .tg-grid { grid-template-columns: minmax(0, 69fr) minmax(300px, 31fr); }
  .tg-bottom3 { grid-template-columns: minmax(0, 34.5fr) minmax(0, 34.5fr) minmax(300px, 31fr); }
}
/* Thẻ WEA AI gợi ý điều phối — màu theo ảnh mẫu: nền xanh dương nhạt đậm dần về góc dưới phải, viền xanh nhạt,
   dấu tích trong ô tròn xanh mint, nút dải màu xanh (dùng color-mix với --surface để chế độ tối không chói) */
.tg-aicard { border-color: color-mix(in srgb, #3b82f6 22%, var(--surface));
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #3b82f6 3%, var(--surface)) 0%, transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, #3b82f6 7%, var(--surface)) 0%, color-mix(in srgb, #3b82f6 12%, var(--surface)) 55%, color-mix(in srgb, #3b82f6 17%, var(--surface)) 100%);
  box-shadow: 0 6px 18px color-mix(in srgb, #3b82f6 10%, transparent); }
.tg-ai-ck { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: color-mix(in srgb, #22c55e 20%, var(--surface)); color: #16a34a; }
.tg-ai-ck svg { margin: 0; stroke-width: 2.6; color: #16a34a; }
.tg-ai-btn.is-main { background: linear-gradient(180deg, #3b8cf7 0%, #2a6fe0 100%); box-shadow: 0 6px 14px color-mix(in srgb, #2563eb 28%, transparent); }
.tg-ai-btn.is-main:hover { background: linear-gradient(180deg, #2f7ff0 0%, #2160d0 100%); }
.tg-ai-btn.is-soft { background: color-mix(in srgb, var(--surface) 85%, transparent); }
.tg-rk.is-open { background: var(--bg); }

/* Thẻ chi tiết người từ "Thành viên có rủi ro cao" (ảnh mẫu 09/11/2026): nổi bên trái thẻ, mũi nhọn chỉ sang phải vào người đã chọn */
.tg-rk { grid-template-columns: 34px minmax(0, 1fr) auto auto 15px; border: 1px solid transparent; }
.tg-rk > svg:last-child { color: var(--ink-soft); }
.tg-rk.is-open { border-color: color-mix(in srgb, #3b82f6 35%, transparent); background: color-mix(in srgb, #3b82f6 8%, var(--surface)); }
.tg-rk.is-open + .tg-rk { border-top-color: transparent; }
.tg-pop.is-risk { width: 430px; padding: 16px; border-radius: 16px; box-shadow: 0 16px 40px rgba(15, 23, 42, .16); }
.tg-pop.is-risk:not(.is-below)::before { top: var(--tg-arrow-y, 24px); left: auto; right: -6px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-left: 0; }
.tg-pop.is-risk.is-new:not(.is-below) { animation-name: tg-rp-in; }
@keyframes tg-rp-in { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
.tg-rp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tg-rp-head .avatar { width: 44px; height: 44px; font-size: 14px; flex: none; }
.tg-rp-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tg-rp-who b { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-rp-who small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-rp-x { flex: none; align-self: flex-start; }
.tg-rp-tiles { display: grid; grid-template-columns: 1.7fr repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.tg-rp-tile { --c: #3b82f6; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); font: inherit; color: var(--ink); text-align: left; }
button.tg-rp-tile { cursor: pointer; transition: border-color .2s, background-color .2s; }
button.tg-rp-tile:not([disabled]):hover { border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 6%, var(--surface)); }
.tg-rp-tile[disabled] { cursor: default; }
.tg-rp-tile.is-red { --c: #f43f5e; background: color-mix(in srgb, #f43f5e 5%, var(--surface)); }
.tg-rp-tile.is-orange { --c: #f59e0b; }
.tg-rp-tile.is-violet { --c: #8b5cf6; }
.tg-rp-tile small { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-rp-tile > b { font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--c); }
.tg-rp-tile.is-load > b { color: var(--muted); }
.tg-rp-tile em { font-style: normal; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.tg-rp-load { display: flex; align-items: baseline; gap: 8px; }
.tg-rp-load b { font-size: 22px; font-weight: 800; line-height: 1.1; color: #2563eb; }
.tg-rp-load b.is-high { color: #b45309; }
.tg-rp-load b.is-over { color: #e11d48; }
.tg-rp-tile .rt-bar { width: 100%; height: 6px; border-radius: 99px; background: #e6edf7; }
.tg-rp-tile .rt-bar i { border-radius: 99px; }
.tg-rp-sec { padding: 12px 0; border-top: 1px solid var(--border-soft); }
.tg-rp-sec h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13.5px; font-weight: 700; }
.tg-rp-sec h4 > svg { flex: none; color: #e11d48; }
.tg-rp-sec + .tg-rp-sec h4 > svg { color: var(--ink-soft); }
.tg-rp-sec h4 .tg-link { margin-left: auto; font-size: 12px; }
.tg-rp-reasons { margin: 0; padding: 0 0 0 4px; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.tg-rp-reasons li { position: relative; padding-left: 16px; font-size: 12.5px; color: var(--ink); }
.tg-rp-reasons li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: #f43f5e; }
.tg-rp-tasks { display: flex; flex-direction: column; gap: 2px; }
.tg-rp-task { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s; }
.tg-rp-task:hover { background: var(--bg); }
.tg-rp-task > i { flex: none; width: 12px; height: 12px; border: 3px solid color-mix(in srgb, #a855f7 30%, var(--surface)); border-radius: 50%; background: #a855f7; box-sizing: border-box; }
.tg-rp-task > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-rp-task > em { flex: none; padding: 3px 9px; border-radius: 8px; font-style: normal; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.tg-rp-task > em.is-red { background: color-mix(in srgb, #f43f5e 12%, var(--surface)); color: #be123c; }
.tg-rp-task > em.is-orange { background: color-mix(in srgb, #f59e0b 15%, var(--surface)); color: #b45309; }
.tg-rp-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.tg-rp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid color-mix(in srgb, #3b82f6 30%, var(--border)); border-radius: 11px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: #1d4ed8; cursor: pointer; transition: background-color .2s; }
.tg-rp-btn:hover { background: color-mix(in srgb, #3b82f6 7%, var(--surface)); }
.tg-rp-btn.is-main { border-color: transparent; background: linear-gradient(180deg, #3b8cf7 0%, #2a6fe0 100%); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, #2563eb 25%, transparent); }
.tg-rp-btn.is-main:hover { background: linear-gradient(180deg, #2f7ff0 0%, #2160d0 100%); }
@media (prefers-reduced-motion: reduce) { .tg-pop.is-risk.is-new { animation: none; } .tg-rp-task, .tg-rp-btn, button.tg-rp-tile { transition: none; } }
.tg-pop.is-risk { width: 460px; }
.tg-rp-tiles { grid-template-columns: 1.45fr repeat(3, minmax(0, 1fr)); }
.tg-rp-tile { padding: 9px; gap: 5px; }
.tg-rp-tile small { font-size: 11px; }
.tg-rp-tile em { font-size: 11px; }
.tg-rp-load { flex-wrap: wrap; gap: 2px 6px; }
@container rep (min-width: 1061px) and (max-width: 1150px) {
  .tg-rk { gap: 6px; padding-left: 2px; padding-right: 2px; grid-template-columns: 30px minmax(0, 1fr) auto auto 13px; }
  .tg-rk .avatar { width: 30px; height: 30px; }
  .tg-rk-who b { font-size: 12.5px; }
  .tg-rk-load { padding: 3px 6px; font-size: 11px; }
}
/* Thẻ chi tiết từ dòng bảng: nổi bên phải cột tên, mũi nhọn chỉ sang trái vào dòng */
.tg-pop.is-side::before { top: var(--tg-arrow-y, 24px); left: -6px; border-top: 0; border-right: 0; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tg-pop.is-side.is-new { animation-name: tg-side-in; }
@keyframes tg-side-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
/* Mũi nhọn thẻ nổi cạnh dòng: 14px, tâm đúng giữa dòng (--tg-arrow-y = tâm - 7px) */
.tg-pop.is-side::before, .tg-pop.is-risk:not(.is-below)::before { width: 14px; height: 14px; }
.tg-pop.is-side::before { left: -8px; }
.tg-pop.is-risk:not(.is-below)::before { right: -8px; }

/* ===== Đội nhóm › Hiệu suất (ảnh mẫu + đặc tả 09/11/2026), reports.js khối tgPerf* ===== */
.tgp { display: flex; flex-direction: column; gap: 16px; }
.tgp .report-card { margin: 0; }
/* 4 ô số: ô biểu tượng tròn bên trái, tên, số lớn + chip so kỳ trước, dòng phụ */
.tgp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tgp-kpi { --k: #3b82f6; --kd: #1d4ed8; display: flex; align-items: center; gap: 14px; min-width: 0; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--k) 18%, transparent); border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--k) 9%, var(--surface)), color-mix(in srgb, var(--k) 4%, var(--surface))); font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.tgp-kpi:hover, .tgp-kpi:focus-visible { border-color: color-mix(in srgb, var(--k) 45%, transparent); box-shadow: 0 6px 18px color-mix(in srgb, var(--k) 14%, transparent); outline: none; }
.tgp-kpi.is-green { --k: #22c55e; --kd: #15803d; }
.tgp-kpi.is-red { --k: #f43f5e; --kd: #be123c; }
.tgp-kpi.is-violet { --k: #8b5cf6; --kd: #6d28d9; }
.tgp-kpi-ic { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--k) 14%, var(--surface)); color: var(--k); }
.tgp-kpi-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tgp-kpi-txt > b { font-size: 13.5px; font-weight: 700; color: var(--kd); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgp-kpi-v { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.tgp-kpi-v strong { font-size: clamp(24px, 2.2vw, 30px); font-weight: 800; line-height: 1.1; color: var(--kd); }
.tgp-kpi-txt small { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgp-delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.tgp-delta.is-good { color: #15803d; }
.tgp-delta.is-bad { color: #be123c; }
.tgp-delta.is-flat { color: var(--muted); }
.tgp-down { display: inline-flex; transform: rotate(180deg); }
/* Hàng 3 thẻ: biểu đồ / tròn / Top nhóm */
.tgp-row2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.tgp-card { display: flex; flex-direction: column; min-width: 0; padding: 16px 18px; }
.tgp-card .tg-side-head h2, .tgp-thead h2 { font-size: 15.5px; font-weight: 700; }
.tgp-card .tg-side-head h2 { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgp-card .tg-side-head .tg-hico { width: auto; height: auto; background: none; }
.tgp-svg { display: block; width: 100%; height: auto; max-height: 260px; }
.tgp-svg text { font-size: 10px; fill: var(--muted); font-family: inherit; }
.tgp-svg .tgp-axis-t { font-size: 10px; font-weight: 600; fill: var(--ink-soft); }
.tgp-svg .tgp-hit { fill: transparent; }
.tgp-svg .tgp-col { fill: #60a5fa; transition: fill .2s; }
.tgp-svg .tgp-bar.is-click { cursor: pointer; }
.tgp-svg .tgp-bar.is-click:hover .tgp-col { fill: #2563eb; }
.tgp-svg .tgp-bar.is-click:hover .tgp-hit { fill: color-mix(in srgb, #3b82f6 6%, transparent); }
.tgp-svg .tgp-line { fill: none; stroke: #8b5cf6; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.tgp-svg .tgp-dot { fill: var(--surface); stroke: #8b5cf6; stroke-width: 2; pointer-events: none; }
.tgp-svg .tgp-pill { pointer-events: none; }
.tgp-svg .tgp-pill rect { fill: color-mix(in srgb, #8b5cf6 14%, var(--surface)); stroke: color-mix(in srgb, #8b5cf6 40%, transparent); }
.tgp-svg .tgp-pill text { font-size: 10.5px; font-weight: 700; fill: #6d28d9; }
.tgp-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 8px 0 0; font-size: 11.5px; color: var(--ink-soft); }
.tgp-keys span { display: inline-flex; align-items: center; gap: 6px; }
.tgp-keys i { width: 12px; height: 10px; border-radius: 3px; background: #60a5fa; }
.tgp-keys i.is-line { height: 3px; border-radius: 2px; background: #8b5cf6; }
.tgp-keys .tgp-hint { margin-left: auto; color: var(--muted); }
/* Biểu đồ tròn */
.tgp-donut-body { display: flex; align-items: center; gap: 18px; margin: auto 0; padding: 6px 0; }
.tgp-donut-c { position: relative; flex: none; width: 140px; height: 140px; }
.tgp-donut-c .rep-donut { width: 100%; height: 100%; }
.tgp-donut-c > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; pointer-events: none; } /* số giữa vòng không chặn rê / bấm lát */
.tgp-donut-c > span b { font-size: 24px; font-weight: 800; }
.tgp-donut-c > span small { font-size: 12px; color: var(--muted); }
.tgp-legend { flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.tgp-legend button { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 6px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s; }
.tgp-legend button:hover:not([disabled]) { background: var(--bg); }
.tgp-legend button[disabled] { cursor: default; opacity: .65; }
.tgp-legend i { width: 10px; height: 10px; border-radius: 3px; }
.tgp-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgp-legend b { font-weight: 700; white-space: nowrap; }
.tgp-legend small { font-weight: 500; color: var(--muted); }
.tgp-od { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px solid color-mix(in srgb, #f43f5e 22%, transparent); border-radius: 10px; background: color-mix(in srgb, #f43f5e 6%, var(--surface)); font: inherit; font-size: 12px; font-weight: 600; color: #be123c; text-align: left; cursor: pointer; }
.tgp-od > svg:last-child { margin-left: auto; }
/* Top nhóm */
.tgp-top { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.tgp-top-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 6px; border: 1px solid transparent; border-radius: 10px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s, border-color .2s; }
.tgp-top-row:hover { background: var(--bg); }
.tgp-top-row.is-on { border-color: color-mix(in srgb, #3b82f6 35%, transparent); background: color-mix(in srgb, #3b82f6 7%, var(--surface)); }
.tgp-rank { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, #3b82f6 12%, var(--surface)); color: #1d4ed8; font-size: 12.5px; font-weight: 700; }
.tgp-top li:nth-child(1) .tgp-rank { background: color-mix(in srgb, #22c55e 15%, var(--surface)); color: #15803d; }
.tgp-top li:nth-child(3) .tgp-rank { background: color-mix(in srgb, #f59e0b 16%, var(--surface)); color: #b45309; }
.tgp-top-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tgp-top-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tgp-top-line b { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgp-top-line em { flex: none; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.tgp-top-bar { display: block; height: 7px; border-radius: 99px; background: #e6edf7; overflow: hidden; }
.tgp-top-bar i { display: block; height: 100%; border-radius: inherit; background: #60a5fa; }
/* ---------- Đội nhóm › Hiệu suất: trạng thái rê chuột (ảnh tương tác 11/2026) ---------- */
/* Ô số: nổi lên + nhãn "⚡ Xem chi tiết …" phía trên */
.tgp-kpi { position: relative; transition: border-color .2s, box-shadow .2s, transform .2s; }
.tgp-kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--k) 60%, transparent); box-shadow: 0 10px 24px color-mix(in srgb, var(--k) 18%, transparent); }
.tgp-kpi-hint { position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 6; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid color-mix(in srgb, var(--k) 35%, var(--border)); border-radius: 10px; background: var(--surface); color: var(--kd); font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 6px 16px rgba(15, 23, 42, .1); opacity: 0; transform: translate(-50%, 4px); pointer-events: none; transition: opacity .2s, transform .2s; }
.tgp-kpi-hint::after { content: ""; position: absolute; top: 100%; left: 50%; width: 8px; height: 8px; margin-top: -4px; border-right: 1px solid color-mix(in srgb, var(--k) 35%, var(--border)); border-bottom: 1px solid color-mix(in srgb, var(--k) 35%, var(--border)); background: var(--surface); transform: translateX(-50%) rotate(45deg); }
.tgp-kpi:hover .tgp-kpi-hint, .tgp-kpi:focus-visible .tgp-kpi-hint { opacity: 1; transform: translate(-50%, 0); }
/* Cột biểu đồ: sáng lên + vạch đứt dọc */
.tgp-svg .tgp-guide { stroke: #8b5cf6; stroke-width: 1.4; stroke-dasharray: 4 3; opacity: 0; pointer-events: none; transition: opacity .2s; }
.tgp-svg .tgp-guide.is-hot, .tgp-svg .tgp-guide.is-picked { opacity: .9; }
.tgp-svg .tgp-bar.is-hot .tgp-col { fill: #2563eb; filter: drop-shadow(0 4px 6px rgba(37, 99, 235, .3)); }
.tgp-svg .tgp-bar.is-hot .tgp-hit { fill: color-mix(in srgb, #3b82f6 7%, transparent); }
/* Lát vòng tròn: nhô ra theo hướng giữa lát + dày hơn; dòng chú giải cùng khóa sáng lên */
.tgp-donut .tgp-slice { cursor: pointer; transition: transform .2s, stroke-width .2s; }
.tgp-donut .tgp-slice.is-hot { transform: translate(var(--dx), var(--dy)); stroke-width: 19; }
.tgp-legend button.is-hot { background: var(--bg); }
/* Top nhóm: nền nhạt + nút → ở cuối dòng */
.tgp-top-row:hover { background: #f4f8fe; }
.tgp-top-go { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border: 1px solid color-mix(in srgb, #3b82f6 30%, var(--border)); border-radius: 9px; background: var(--surface); color: var(--primary-600); opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; }
.tgp-top-row:hover .tgp-top-go, .tgp-top-row:focus-visible .tgp-top-go { opacity: 1; transform: none; }
/* Bảng: rê dòng tô nền nhạt */
.tgp-table tbody tr.tgp-grow:hover > td, .tgp-table tbody tr.tgp-mrow:hover > td { background: #f4f8fe; }
.tgp-table tbody tr > td { transition: background-color .2s; }
/* Khung gợi ý chung (tgpTipShow) */
.tgp-tip { position: fixed; z-index: 90; max-width: 260px; pointer-events: none; animation: tgp-tip-in .2s ease; }
.tgp-tip[hidden] { display: none; }
.tgp-tip.is-bar, .tgp-tip.is-slice { padding: 10px 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 12.5px; box-shadow: 0 12px 28px rgba(15, 23, 42, .14); }
.tgp-tip.is-bar { min-width: 200px; }
.tgp-tip.is-bar > b { display: block; margin-bottom: 6px; font-size: 13.5px; }
.tgp-tip-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.tgp-tip-row span { flex: 1; color: var(--ink-soft); }
.tgp-tip-row strong { font-weight: 700; }
.tgp-tip-row i { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.tgp-tip-row i.is-col { background: #60a5fa; }
.tgp-tip-row i.is-line { height: 3px; border-radius: 2px; background: #8b5cf6; }
.tgp-tip.is-bar small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.tgp-tip.is-slice > span { display: block; margin-top: 2px; font-weight: 600; }
.tgp-tip.is-rate { padding: 5px 10px; border-radius: 8px; background: #1e293b; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
@keyframes tgp-tip-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
/* ---------- Đội nhóm › Hiệu suất: khung nổi khi BẤM (GĐ2, tgpPop*) — nền .rep-pop của Báo cáo tổng quát ---------- */
.tgp-pop { width: 400px; border-radius: 16px; box-shadow: 0 18px 40px rgba(15, 23, 42, .16); }
.tgp-pop.is-wide { width: 430px; } /* khung Chi tiết ô số: gọn, nằm bên phải ô */
.tgp-pop.is-team { width: 460px; }
.tgp-pop .rep-pop-foot .wf-link-btn { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
/* Nút × trắng như mẫu, rê thì đỏ (cùng kiểu hộp thoại nhãn) */
.tgp-pop .rep-pop-x.icon-btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft); transition: background-color .2s, border-color .2s, color .2s; }
.tgp-pop .rep-pop-x.icon-btn:hover { border-color: var(--danger); background: var(--danger); color: #fff; }
.tgp-pop.is-anim { animation: tgp-tip-in .2s ease; }
.tgp-phead { align-items: center; gap: 10px; padding: 14px 12px 8px 16px; }
.tgp-phead > div { flex: 1; min-width: 0; }
.tgp-phead b { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgp-phead small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-soft); }
.tgp-pteam-ic.tg-gico { width: 38px; height: 38px; border-radius: 12px; }
.tgp-pbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 16px 10px; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tgp-pbody h4 { margin: 12px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
.tgp-ptiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tgp-ptiles.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tgp-ptile { --c: #3b82f6; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--c) 22%, var(--surface)); border-radius: 12px; background: color-mix(in srgb, var(--c) 7%, var(--surface)); }
.tgp-ptile.is-green { --c: #22c55e; } .tgp-ptile.is-red { --c: #f43f5e; } .tgp-ptile.is-violet { --c: #8b5cf6; } .tgp-ptile.is-orange { --c: #f59e0b; }
.tgp-ptile b { display: flex; align-items: center; gap: 4px; font-size: 22px; font-weight: 800; line-height: 1.15; color: color-mix(in srgb, var(--c) 78%, #0f172a); font-variant-numeric: tabular-nums; }
.tgp-ptile b .tgp-delta { font-size: 18px; }
.tgp-ptiles.is-4 .tgp-ptile { padding: 8px 10px; }
.tgp-ptiles.is-4 .tgp-ptile b { font-size: 18px; }
.tgp-ptile small { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
.tgp-pcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.tgp-pcols.is-one { grid-template-columns: minmax(0, 1fr); }
.tgp-pteams { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tgp-pteams li { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.tgp-pteams li > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgp-pteams li b { font-weight: 700; white-space: nowrap; }
.tgp-pteams li small { font-weight: 500; color: var(--muted); }
.tgp-pteams .tg-gico { width: 24px; height: 24px; }
.tgp-spark { display: block; width: 100%; height: auto; }
.tgp-spark-line { fill: none; stroke: #22c55e; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tgp-spark-area { fill: color-mix(in srgb, #22c55e 14%, transparent); }
.tgp-spark circle { fill: var(--surface); stroke: #22c55e; stroke-width: 2; }
.tgp-spark text { font-size: 10.5px; font-weight: 700; fill: #15803d; font-family: inherit; }
.tgp-spark text.is-axis { font-weight: 500; fill: var(--muted); }
.tgp-ptasks { display: flex; flex-direction: column; gap: 2px; }
/* Khung cột: 3 dòng (3 × 34px + khe), dài hơn cuộn bằng thanh mảnh, mờ */
.tgp-ptasks.is-3 { max-height: 108px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
/* Khung danh sách theo nhóm: tối đa 6 hàng (tên nhóm + việc), dài hơn cuộn */
.tgp-pbody.tgp-plist { max-height: 246px; flex: none; }
.tgp-pbody::-webkit-scrollbar, .tgp-ptasks.is-3::-webkit-scrollbar { width: 5px; }
.tgp-pbody::-webkit-scrollbar-thumb, .tgp-ptasks.is-3::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--scroll-thumb); }
.tgp-ptask { min-height: 34px; box-sizing: border-box; }
.tgp-ptask { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 7px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: background-color .2s; }
.tgp-ptask:hover, .tgp-ptask:focus-visible { background: #f4f8fe; }
.tgp-pcheck { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; border-radius: 50%; background: #dcfce7; color: #16a34a; }
.tgp-pcheck.is-late { background: #ffe4e6; color: #e11d48; }
.tgp-pid { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tgp-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgp-ptag { --tc: #8b5cf6; flex: none; max-width: 120px; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--tc) 12%, var(--surface)); color: color-mix(in srgb, var(--tc) 80%, #0f172a); font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgp-ptag.is-proj { background: var(--bg); color: var(--ink-soft); }
.tgp-pill { flex: none; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-style: normal; font-weight: 600; white-space: nowrap; }
.tgp-pill.is-red { background: #fff1f2; color: #e11d48; } .tgp-pill.is-orange { background: #fff7e6; color: #d97706; } .tgp-pill.is-blue { background: #eff6ff; color: #2563eb; }
.tgp-pill.is-green { background: #ecfdf5; color: #16a34a; } .tgp-pill.is-gray { background: var(--bg); color: var(--ink-soft); }
.tgp-pgroup { margin-bottom: 4px; }
/* Hàng tên nhóm: nền nhạt để tách với dòng việc */
.tgp-pgroup-h { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; box-sizing: border-box; padding: 6px 8px; border: 0; border-radius: 8px; background: #f3f6fb; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.tgp-pgroup-h > svg:first-child { color: var(--muted); transition: transform .2s; }
.tgp-pgroup.is-closed .tgp-pgroup-h > svg:first-child { transform: rotate(-90deg); }
.tgp-pgroup-h .tg-gico { width: 24px; height: 24px; }
.tgp-pgroup-h small { color: var(--muted); font-weight: 600; }
.tgp-pmore { margin: 2px 8px 8px; font-size: 12px; color: var(--muted); }
/* Thẻ nhóm: so sánh 40% | đường xu hướng 60%, cùng hàng, khe 5px */
.tgp-pcmp { display: grid; grid-template-columns: 40% minmax(0, 1fr); align-items: center; gap: 5px; }
.tgp-pcmp > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.tgp-pcmp-chart { min-width: 0; }
/* Khoảng kỳ đang so (chữ mờ trong ngoặc) + "Đang xem: …"; chấm xu hướng bấm được, chấm đang chọn tô đặc */
.tgp-pspan { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.tgp-ptiles.is-past .tgp-ptile { border-style: dashed; } /* 4 ô đang là số của kỳ đã qua (bấm chấm xu hướng) */
.tgp-pview { margin-top: 4px; font-size: 11.5px; font-style: normal; color: var(--muted); }
.tgp-spark .tgp-spark-hit { fill: transparent; stroke: none; cursor: pointer; outline: none; }
.tgp-spark .tgp-spark-hit:hover + .tgp-spark-dot, .tgp-spark .tgp-spark-hit:focus-visible + .tgp-spark-dot { stroke-width: 3; }
.tgp-spark .tgp-spark-dot { pointer-events: none; }
.tgp-spark .tgp-spark-dot.is-on { fill: #22c55e; stroke: var(--surface); stroke-width: 2; }
.tgp-pcmp strong { display: inline-flex; align-items: center; gap: 4px; font-size: 20px; font-weight: 800; }
.tgp-pcmp strong.is-good { color: #16a34a; } .tgp-pcmp strong.is-bad { color: #e11d48; }
.tgp-pcmp small { font-size: 12.5px; color: var(--ink-soft); }
.tgp-pfoot { justify-content: flex-start; }
.tgp-pbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; box-sizing: border-box; padding: 0 14px; line-height: 1; border: 1px solid color-mix(in srgb, #3b82f6 35%, var(--border)); border-radius: 10px; background: var(--primary-50); color: var(--primary-600); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background-color .2s, border-color .2s; }
.tgp-pbtn:hover:not([disabled]) { border-color: var(--primary); background: color-mix(in srgb, #3b82f6 14%, var(--surface)); }
.tgp-pbtn:not(.is-main) { border-color: var(--border); background: var(--surface); color: var(--ink-soft); }
.tgp-pbtn[disabled] { cursor: not-allowed; opacity: .7; }
.tgp-pfoot { gap: 10px; }
/* Phần đang mở khung: viền xanh (ô số, dòng Top nhóm, dòng cảnh báo); cột đang chọn giữ màu đậm */
.tgp-kpi.is-picked { border-color: color-mix(in srgb, var(--k) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 16%, transparent); }
.tgp-top-row.is-picked { border-color: color-mix(in srgb, #22c55e 45%, transparent); background: color-mix(in srgb, #22c55e 8%, var(--surface)); }
.tgp-svg .tgp-bar.is-picked .tgp-col { fill: #2563eb; }
.tgp-legend button.is-picked { background: var(--bg); font-weight: 600; }
.tgp-table tbody tr.tgp-grow { cursor: pointer; }
@media (max-width: 640px) { .tgp-pcols { grid-template-columns: minmax(0, 1fr); } .tgp-ptiles.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .tgp-pop.is-anim { animation: none; } .tgp-ptask, .tgp-pgroup-h > svg:first-child, .tgp-pbtn { transition: none; } }
@media (hover: none) { .tgp-kpi-hint { display: none; } .tgp-top-go { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tgp-kpi, .tgp-kpi-hint, .tgp-top-go, .tgp-donut .tgp-slice, .tgp-svg .tgp-guide, .tgp-table tbody tr > td { transition: none; } .tgp-kpi:hover { transform: none; } .tgp-tip { animation: none; } }
.tgp-top li:nth-child(1) .tgp-top-bar i { background: #34d399; }
.tgp-top li:nth-child(3) .tgp-top-bar i { background: #a78bfa; }
.tgp-top-row.is-none em { color: var(--muted); font-weight: 600; }
.tgp-top-row.is-none .tgp-rank { background: var(--bg); color: var(--muted); }
/* Bảng */
.tgp-tablecard { padding: 16px 18px 12px; }
.tgp-thead { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.tgp-thead h2 { flex: 1 1 auto; margin: 0; min-width: 0; }
.tgp-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tg-seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg); }
.tg-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid transparent; border-radius: 9px; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background-color .2s, color .2s; }
.tg-seg button.is-on { border-color: color-mix(in srgb, #3b82f6 30%, transparent); background: var(--surface); color: #1d4ed8; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.tgp-sortsel { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 12.5px; color: var(--ink-soft); }
.tgp-sortsel select { height: 32px; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
/* Ô Sắp xếp (Hiệu suất + Thời gian): nút chọn bên trong không có khung riêng; rê = viền xanh nhạt + nền xanh rất nhạt, mở = viền xanh + quầng (chuẩn trang Nhóm) */
.tgp-sortsel { padding: 0 8px 0 12px; border-color: #e5eaf1; font-size: 13px; transition: border-color .2s, background-color .2s, box-shadow .2s; }
.tgp-sortsel .cselect-btn { height: 30px; min-height: 0; padding: 0 2px 0 4px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; font-size: 13px; font-weight: 600; color: var(--ink); }
.tgp-sortsel .cselect-btn:hover, .tgp-sortsel .cselect-btn.is-open { background: transparent; }
.tgp-sortsel .cselect-caret { color: var(--ink-soft); }
.tgp-sortsel:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--primary-50); }
.tgp-sortsel:has(.cselect-btn.is-open) { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
@media (prefers-reduced-motion: reduce) { .tgp-sortsel { transition: none; } }
.tgp-table .report-sort { display: inline-flex; align-items: center; }
.tgp-table th .tg-kpi-i { margin-left: 4px; vertical-align: middle; }
.tgp-table tr.tgp-grow td { height: 52px; }
.tgp-caret { display: grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; transition: background-color .2s; }
.tgp-caret:hover { background: var(--bg); }
.tgp-caret svg { transition: transform .2s; transform: rotate(-90deg); }
.tgp-grow.is-open .tgp-caret svg { transform: none; }
.tgp-gtxt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tgp-gname { padding: 0; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgp-gname:hover { color: #1d4ed8; text-decoration: underline; }
.tgp-gtxt b { font-size: 14px; font-weight: 700; }
.tgp-gtxt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgp-who { display: block; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.tgp-who:hover .tg-mline b { color: #1d4ed8; }
.tgp-rate { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.tgp-rate b { min-width: 38px; font-size: 12.5px; font-weight: 700; text-align: right; }
.tgp-rate-bar { display: block; width: 96px; height: 7px; border-radius: 99px; background: #e6edf7; overflow: hidden; }
.tgp-rate-bar i { display: block; height: 100%; border-radius: inherit; }
.tgp-rate-bar.is-good i { background: #34d399; }
.tgp-rate-bar.is-mid i { background: #fbbf24; }
.tgp-rate-bar.is-bad i { background: #fb7185; }
.tgp-rate:hover .tgp-rate-bar { box-shadow: 0 0 0 2px color-mix(in srgb, #3b82f6 25%, transparent); }
.tgp-table td.tgp-go, .tgp-table th.tgp-go { width: 28px; color: var(--ink-soft); }
.tgp-more { display: block; width: 100%; margin-top: 10px; padding: 9px; border: 1px dashed var(--border); border-radius: 10px; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #1d4ed8; cursor: pointer; }
.tgp-more:hover { background: var(--bg); }
.tgp-tablecard .form-hint { margin: 10px 0 0; }
/* Ô nổi phân tích 1 người */
.tg-pop.is-wide { width: 440px; padding: 16px; border-radius: 16px; box-shadow: 0 16px 40px rgba(15, 23, 42, .16); }
.tgp-pop-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tg-rp-tile.is-green { --c: #16a34a; }
.tg-rp-tile.is-blue { --c: #2563eb; }
.tg-rp-tile .tgp-delta { font-size: 11px; }
.tg-rp-task > em.is-violet { background: color-mix(in srgb, #8b5cf6 13%, var(--surface)); color: #6d28d9; }
.tgp-pop-vs { margin: -6px 0 10px; font-size: 12px; color: var(--ink-soft); }
/* Đổi số cột theo bề rộng vùng Báo cáo */
@container rep (max-width: 1150px) {
  .tgp-row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tgp-row2 > .tgp-chart { grid-column: 1 / -1; }
}
@container rep (max-width: 980px) { .tgp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container rep (max-width: 680px) {
  .tgp-row2 { grid-template-columns: minmax(0, 1fr); }
  .tgp-donut-body { flex-direction: column; align-items: stretch; }
  .tgp-donut-c { align-self: center; }
  .tgp-keys .tgp-hint { margin-left: 0; }
}
@container rep (max-width: 560px) { .tgp-kpi { gap: 10px; padding: 12px; } .tgp-kpi-ic { width: 38px; height: 38px; } .tgp-kpi-ic svg { width: 19px; height: 19px; } .tgp-kpi-txt > b { font-size: 12px; } .tgp-kpi-v { flex-wrap: wrap; gap: 0 6px; } }
@container rep (max-width: 300px) { .tgp-kpis { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .tgp-kpi, .tgp-legend button, .tgp-top-row, .tgp-caret, .tgp-caret svg, .tgp-svg .tgp-col, .tg-seg button { transition: none; } }
@container rep (max-width: 1150px) {
  .tgp-row2 { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .tgp-row2 > .tgp-chart { grid-column: auto; }
  .tgp-row2 > .tgp-tops { grid-column: 1 / -1; }
}
@container rep (max-width: 680px) {
  .tgp-row2 { grid-template-columns: minmax(0, 1fr); }
  .tgp-row2 > .tgp-tops { grid-column: auto; }
}
.tgp-tablecard .tgp-scroll { height: auto; max-height: 560px; }
.tgp-tablecard .tgp-scroll thead th { position: sticky; top: 0; z-index: 2; }
@container rep (max-width: 560px) { .tgp-kpi-txt small { white-space: normal; line-height: 1.3; } }
/* 5 ô số Đội nhóm › Tổng quan — gọn như ảnh mẫu: cỡ chữ / đệm theo vw để số + chip "so với kỳ trước" luôn cùng 1 hàng, không xuống dòng */
.tg-kpi { gap: clamp(6px, 0.55vw, 10px); padding: clamp(10px, 0.85vw, 16px) clamp(12px, 1vw, 18px); }
.tg-kpi-top { align-items: center; gap: clamp(5px, 0.45vw, 8px); }
.tg-kpi-top svg { width: clamp(15px, 1.1vw, 20px); height: clamp(15px, 1.1vw, 20px); }
.tg-kpi-top b { font-size: clamp(11px, 0.8vw, 13.5px); white-space: nowrap; display: block; overflow: hidden; text-overflow: ellipsis; }
.tg-kpi-mid { flex-wrap: nowrap; align-items: center; gap: clamp(4px, 0.4vw, 8px); }
.tg-kpi-v { flex: 1 1 auto; min-width: 0; overflow: hidden; gap: clamp(3px, 0.3vw, 6px); }
.tg-kpi-v > b { font-size: clamp(18px, 1.6vw, 30px); }
.tg-kpi-v > small { font-size: clamp(11px, 0.85vw, 15px); }
.tg-kpi-d { flex: 0 0 auto; }
.tg-kpi-d b { font-size: clamp(10px, 0.72vw, 12.5px); }
.tg-kpi-d small { font-size: clamp(9px, 0.6vw, 10.5px); }
.tg-kpi-foot { margin-top: 0; font-size: clamp(10.5px, 0.75vw, 12.5px); }
.tg-kpi .tg-kpi-bar { height: clamp(4px, 0.35vw, 6px); }
.tg-kpi-v > b { font-size: clamp(18px, 1.35vw, 28px); }
.tg-kpi-v > small { font-size: clamp(10.5px, 0.72vw, 14px); }
/* Thanh trong ô số: khung luôn hiện (chưa có dữ liệu = khung rỗng); thanh mang đúng màu của ô (không đổi theo mức tải) */
.tg-kpi .tg-kpi-bar { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k) 16%, transparent); }
/* Khung giải thích khi rê chuột vào ô số Đội nhóm (tgKpiTipShow): tên · ý nghĩa · Cách tính · Hiện tại · gợi ý */
.tg-ktip { --k: #3b82f6; position: fixed; z-index: 70; width: 320px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: 0 12px 32px rgba(15, 23, 42, .16); font-size: 12.5px; line-height: 1.5; color: var(--ink); pointer-events: none; animation: tg-ktip-in .15s ease-out; }
.tg-ktip[hidden] { display: none; }
.tg-ktip::before { content: ""; position: absolute; top: -6px; left: var(--ktip-arrow, 24px); width: 10px; height: 10px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); background: var(--surface); transform: rotate(45deg); }
.tg-ktip.is-above::before { top: auto; bottom: -6px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tg-ktip.is-red { --k: #f43f5e; }
.tg-ktip.is-orange { --k: #f59e0b; }
.tg-ktip.is-green { --k: #22c55e; }
.tg-ktip.is-violet { --k: #8b5cf6; }
.tg-ktip > b { display: block; padding-left: 10px; border-left: 3px solid var(--k); font-size: 13.5px; font-weight: 700; }
.tg-ktip > p { margin: 6px 0 8px; color: var(--ink); }
.tg-ktip dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--k) 6%, var(--surface)); }
.tg-ktip dt { font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.tg-ktip dd { margin: 0; }
.tg-ktip > small { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
@keyframes tg-ktip-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tg-ktip { animation: none; } }
.tg-ktip { animation: none; opacity: 1; background: var(--surface, #fff); }
/* Ô số xếp 3 + 2 (vùng báo cáo ≤ 1220px): ô rộng nên dùng cỡ chữ cố định, không co theo vw */
@container rep (max-width: 1220px) {
  .tg-kpi { gap: 8px; padding: 14px 16px; }
  .tg-kpi-top svg { width: 18px; height: 18px; }
  .tg-kpi-top b { font-size: 12.5px; }
  .tg-kpi-v > b { font-size: 26px; }
  .tg-kpi-v > small { font-size: 13px; }
  .tg-kpi-d b { font-size: 12px; }
  .tg-kpi-d small { font-size: 10.5px; }
  .tg-kpi-foot { font-size: 12px; }
  .tg-kpi .tg-kpi-bar { height: 6px; }
}
/* 4 ô số Hiệu suất nằm trên thanh tab (cùng chỗ 5 ô số Tổng quan) */
.tgp-kpis { margin-bottom: 16px; }

/* ===== Đội nhóm › Thời gian (ảnh mẫu + đặc tả 10/11/2026), reports.js khối tgTime* ===== */
/* 5 mức tải (tgLoadLv): nền pastel cho ô / nhãn, màu đậm hơn cho thanh */
.tgt-cell.is-low, .tgt-rate.is-low, .tgt-heat-keys i.is-low { background: #dbeafe; color: #1e40af; }
.tgt-cell.is-ok, .tgt-rate.is-ok, .tgt-heat-keys i.is-ok { background: #bbf7d0; color: #166534; }
.tgt-cell.is-near, .tgt-rate.is-near, .tgt-heat-keys i.is-near { background: #fde68a; color: #92400e; }
.tgt-cell.is-watch, .tgt-rate.is-watch, .tgt-heat-keys i.is-watch { background: #fdba74; color: #9a3412; }
.tgt-cell.is-over, .tgt-rate.is-over, .tgt-heat-keys i.is-over { background: #fca5a5; color: #9f1239; }
.tgt-cell.is-off, .tgt-heat-keys i.is-off, .tgt-pop-day.is-off { background: repeating-linear-gradient(135deg, var(--bg) 0 4px, var(--border-soft) 4px 6px); color: var(--muted); }
.tgt-bar.is-low i, .tgt-kpi-bar.is-low i { background: #93c5fd; }
.tgt-bar.is-ok i, .tgt-kpi-bar.is-ok i { background: #34d399; }
.tgt-bar.is-near i, .tgt-kpi-bar.is-near i { background: #fbbf24; }
.tgt-bar.is-watch i, .tgt-kpi-bar.is-watch i { background: #fb923c; }
.tgt-bar.is-over i, .tgt-kpi-bar.is-over i { background: #f87171; }
/* Ô số */
.tgp-kpi.is-orange { --k: #f59e0b; --kd: #b45309; }
.tgt-kpi-bar { display: block; width: clamp(80px, 9vw, 160px); height: 6px; margin: 2px 0 1px; border-radius: 99px; background: color-mix(in srgb, var(--k) 14%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k) 16%, transparent); overflow: hidden; }
.tgt-kpi-bar i { display: block; height: 100%; border-radius: inherit; background: var(--k); }
.tgt-skel { min-height: 92px; }
/* Bố cục 2 hàng thẻ */
.tgt-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: stretch; }
.tgt-row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: stretch; }
/* Biểu đồ giờ */
.tgp-svg .tgt-col-plan { fill: #bfdbfe; transition: fill .2s; }
.tgp-svg .tgt-col-act { fill: #3b82f6; transition: fill .2s; }
.tgp-svg .tgp-bar.is-click:hover .tgt-col-plan { fill: #93c5fd; }
.tgp-svg .tgp-bar.is-click:hover .tgt-col-act { fill: #1d4ed8; }
.tgp-keys i.tgt-k-plan { background: #bfdbfe; }
.tgp-keys i.tgt-k-act { background: #3b82f6; }
/* Lưới tải nhóm × ngày */
.tgt-heat-body { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.tgt-heat-scroll { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.tgt-heat-grid { display: grid; grid-template-columns: minmax(96px, 150px) repeat(var(--n), minmax(30px, 1fr)); gap: 5px; align-items: center; min-width: max-content; }
.tgt-heat-corner { position: sticky; left: 0; z-index: 1; background: var(--surface); font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.tgt-heat-h { display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 700; line-height: 1.2; }
.tgt-heat-h small { font-size: 9.5px; font-weight: 500; color: var(--muted); }
.tgt-heat-name { position: sticky; left: 0; z-index: 1; display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 6px; background: var(--surface); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgt-heat-name i { flex: none; width: 8px; height: 8px; border-radius: 3px; }
.tgt-cell { height: 26px; min-width: 30px; padding: 0; border: 0; border-radius: 6px; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; transition: box-shadow .2s; }
.tgt-cell:hover:not([disabled]) { box-shadow: 0 0 0 2px color-mix(in srgb, #3b82f6 40%, transparent); }
.tgt-cell[disabled] { cursor: default; }
.tgt-heat-keys { flex: none; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 11px; color: var(--ink-soft); }
.tgt-heat-keys li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tgt-heat-keys i { width: 12px; height: 12px; border-radius: 4px; }
/* Vòng tròn + xu hướng */
.tgt-legend b { font-size: 12px; }
.tgt-trend-body { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tgt-trend-body .tgt-tr-svg { flex: 1; min-width: 0; }
.tgp-svg .tgt-tr-line { fill: none; stroke: #3b82f6; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tgp-svg .tgt-tr-pt { cursor: pointer; }
.tgp-svg .tgt-tr-hit { fill: transparent; }
.tgp-svg .tgt-tr-dot { fill: var(--surface); stroke: #3b82f6; stroke-width: 2; }
.tgp-svg .tgt-tr-pt:hover .tgt-tr-dot { fill: #3b82f6; }
.tgp-svg .tgt-pill rect { fill: color-mix(in srgb, #3b82f6 12%, var(--surface)); stroke: color-mix(in srgb, #3b82f6 40%, transparent); }
.tgp-svg .tgt-pill text { fill: #1d4ed8; }
.tgt-trend-cmp { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, #22c55e 8%, var(--surface)); text-align: center; }
.tgt-trend-cmp b { font-size: 20px; font-weight: 800; color: #15803d; white-space: nowrap; }
.tgt-trend-cmp small { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
/* Bảng */
.tgt-tablecard .tgp-thead h2 { display: inline-flex; align-items: center; gap: 8px; }
.tgt-tablecard .tgp-thead h2 svg { color: #2563eb; }
.tgt-num { padding: 2px 6px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background-color .2s; }
.tgt-num:hover { background: color-mix(in srgb, #3b82f6 10%, var(--surface)); color: #1d4ed8; }
.tgt-rate { display: inline-block; min-width: 54px; padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.tgt-diff { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.tgt-diff.is-neg { color: #b45309; }
.tgt-diff.is-pos { color: #1d4ed8; }
.tgt-table .tgt-barcell { width: 18%; min-width: 90px; }
.tgt-bar { display: block; width: 100%; height: 8px; border-radius: 99px; background: #e6edf7; overflow: hidden; }
.tgt-bar i { display: block; height: 100%; border-radius: inherit; background: #93c5fd; }
/* Ô nổi người: cột theo ngày (kế hoạch) + vạch khả năng */
.tgt-pop-days { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; height: 92px; padding-top: 4px; }
.tgt-pop-day { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; padding-bottom: 16px; border-radius: 6px; background: none; color: var(--ink-soft); }
.tgt-pop-day i { display: block; width: 70%; max-width: 22px; border-radius: 4px 4px 0 0; background: #93c5fd; }
.tgt-pop-day.is-ok i { background: #34d399; } .tgt-pop-day.is-near i { background: #fbbf24; } .tgt-pop-day.is-watch i { background: #fb923c; } .tgt-pop-day.is-over i { background: #f87171; }
.tgt-pop-day em { position: absolute; left: 10%; right: 10%; height: 0; margin-bottom: 16px; border-top: 2px dashed #94a3b8; }
.tgt-pop-day small { position: absolute; bottom: 0; font-size: 10px; }
.tgt-pop-key { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 11px; font-weight: 500; color: var(--muted); }
.tgt-pop-key i { width: 10px; height: 8px; border-radius: 2px; background: #93c5fd; }
.tgt-pop-key em { width: 12px; border-top: 2px dashed #94a3b8; margin-left: 6px; }
.tgt-pop-leave { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12px; color: #6d28d9; }
/* Ngăn kéo bản ghi giờ */
.tgt-entries { display: flex; flex-direction: column; gap: 2px; }
.tgt-entry { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--border-soft); background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s; }
.tgt-entry:hover { background: var(--bg); }
.tgt-entry .avatar { width: 28px; height: 28px; font-size: 10.5px; flex: none; }
.tgt-entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tgt-entry-main b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgt-entry-main small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgt-entry em { flex: none; font-style: normal; font-size: 12.5px; font-weight: 700; color: #1d4ed8; }
/* Đổi số cột theo bề rộng vùng Báo cáo */
@container rep (max-width: 1060px) { .tgt-row2, .tgt-row3 { grid-template-columns: minmax(0, 1fr); } }
@container rep (max-width: 560px) {
  .tgt-heat-body { flex-direction: column; }
  .tgt-heat-keys { flex-direction: row; flex-wrap: wrap; gap: 6px 12px; }
  .tgt-trend-body { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { .tgt-cell, .tgt-num, .tgt-entry, .tgp-svg .tgt-col-plan, .tgp-svg .tgt-col-act { transition: none; } }
/* Lưới tải: 7 ngày vừa khung không cuộn; chú giải xuống dưới lưới khi thẻ hẹp */
.tgt-heat-grid { grid-template-columns: minmax(72px, 130px) repeat(var(--n), minmax(26px, 1fr)); gap: 4px; min-width: 0; }
.tgt-heat-grid[style*="--n:2"], .tgt-heat-grid { min-width: min-content; }
.tgt-cell { min-width: 26px; font-size: 9.5px; }
@container rep (max-width: 1400px) {
  .tgt-heat-body { flex-direction: column; gap: 10px; }
  .tgt-heat-scroll { width: 100%; }
  .tgt-heat-keys { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
}

/* ===== Đội nhóm › Thời gian — bố cục theo ảnh mẫu (chủ dự án 10/11/2026): chỉ giao diện, số liệu giữ nguyên =====
   Tỷ lệ đo trên ảnh mẫu 1440px: đầu trang 1 hàng (tiêu đề trái, bộ lọc phải) · ô số cao ~93px · 2 hàng thẻ biểu đồ trái : phải = 1 : 1,3 · bảng gọn */
/* Đầu trang Đội nhóm: tiêu đề + mô tả bên trái, bộ lọc bên phải cùng hàng; ô lọc cao 36px như nhau */
.tg-head { flex-wrap: nowrap; align-items: center; gap: 16px; margin-bottom: 18px; }
.tg-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.tg-head .tg-h1 { font-size: clamp(20px, 1.6vw, 24px); font-weight: 800; }
.tg-head .tg-sub { margin-top: 4px; font-size: 13px; }
.tg-head .rep-head-tools { flex: 0 1 auto; flex-wrap: nowrap; gap: 10px; }
.tg-head .rep-head-tools :is(.tg-period, .wl-span, select.form-control, .cselect-btn.form-control) { box-sizing: border-box; height: 36px; border-radius: 10px; }
.tg-head .rep-head-tools select.form-control { min-width: 0; max-width: 170px; padding-right: 28px; font-size: 13.5px; }
.tg-head .wl-span { align-items: center; padding: 3px; }
.tg-head .wl-span-btn { height: 28px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; }
.tg-head .tg-period .icon-btn { width: 28px; height: 28px; }
.tg-head > div:first-child { flex: 1 1 280px; }
@container rep (max-width: 960px) { .tg-head { flex-wrap: wrap; } .tg-head .rep-head-tools { flex-wrap: wrap; } }
/* 4 ô số: ô biểu tượng vuông bo, tên ở hàng trên cùng hàng biểu tượng, số lớn bên dưới, biểu tượng mờ lớn ở góc phải */
.tgp-kpis:has(.tgt-kpi) { gap: clamp(12px, 1.4vw, 22px); margin-bottom: 14px; }
.tgt-kpi { position: relative; overflow: hidden; align-items: flex-start; min-height: 0; height: clamp(84px, 6.5vw, 96px); gap: 12px; padding: 14px 16px; border-radius: 16px;
  border-color: color-mix(in srgb, var(--k) 14%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--k) 11%, var(--surface)), color-mix(in srgb, var(--k) 5%, var(--surface))); box-shadow: none; }
.tgt-kpi .tgp-kpi-ic { width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--k) 16%, var(--surface)); }
.tgt-kpi .tgp-kpi-ic svg { width: 22px; height: 22px; }
.tgt-kpi .tgp-kpi-txt { position: relative; z-index: 1; flex: 1 1 auto; gap: 6px; padding-top: 1px; }
.tgt-kpi .tgp-kpi-txt > b { font-size: clamp(12.5px, 0.95vw, 14px); font-weight: 700; }
.tgt-kpi .tgp-kpi-v { align-items: baseline; gap: 8px; }
.tgt-kpi .tgp-kpi-v strong { font-size: clamp(22px, 1.95vw, 28px); font-weight: 800; letter-spacing: -.01em; line-height: 1.05; }
.tgt-kpi .tgp-delta { font-size: clamp(11px, 0.85vw, 12.5px); }
.tgt-kpi-wm { position: absolute; right: 12px; bottom: 8px; color: var(--k); opacity: .16; pointer-events: none; }
.tgt-kpi.is-orange .tgt-kpi-wm { display: none; } /* ô Tỷ lệ sử dụng: thanh + chip đã chiếm chỗ (ảnh mẫu không có biểu tượng mờ) */
.tgt-kpi-wm svg { width: clamp(40px, 3.3vw, 52px); height: clamp(40px, 3.3vw, 52px); }
.tgt-kpi-barrow { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 2px; }
.tgt-kpi-barrow .tgt-kpi-bar { flex: 1 1 auto; width: auto; max-width: none; height: 7px; margin: 0; }
.tgp-delta.is-warn { color: #c2410c; }
@container rep (max-width: 980px) { .tgt-kpi { height: auto; } }
/* Thẻ: bo 16px, đệm 16–18px, tiêu đề 16px kèm ô biểu tượng xanh nhạt */
.tgt { gap: 16px; }
.tgt .tgp-card { padding: 16px 18px 14px; border-radius: 16px; }
.tgt .tg-side-head { gap: 10px; margin-bottom: 10px; }
.tgt .tgp-card .tg-side-head h2 { font-size: clamp(14.5px, 1.1vw, 16px); font-weight: 700; }
.tgt .tgp-card .tg-side-head .tg-hico { width: 30px; height: 30px; border-radius: 9px; background: #eaf4ff; color: #2b8ae6; }
.tgt-row2, .tgt-row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; }
.tgt-plot { flex: 1 1 auto; display: flex; align-items: center; min-width: 0; min-height: 0; }
.tgt .tgp-svg text { font-size: 11px; }
.tgt .tgp-svg .tg-tr-grid { stroke: #eef2f7; stroke-width: 1; }
.tgt .tgp-keys { justify-content: center; gap: 6px 22px; margin-top: 4px; font-size: 12px; }
.tgt .tgp-keys i { width: 14px; height: 9px; border-radius: 2px; }
.tgt .tgp-keys i.is-line { height: 3px; }
/* Biểu đồ giờ: cột kế hoạch xanh nhạt, cột thực tế xanh đậm cùng bề rộng chồng lên, đường tím chấm rỗng */
.tgt-chart-svg { max-height: 280px; }
.tgp-svg .tgt-col-plan { fill: #cfe6fb; }
.tgp-svg .tgt-col-act { fill: #48aaf0; }
.tgp-svg .tgp-bar.is-click:hover .tgt-col-plan { fill: #b5d8f8; }
.tgp-svg .tgp-bar.is-click:hover .tgt-col-act { fill: #2b8ae6; }
.tgp-keys i.tgt-k-plan { background: #cfe6fb; }
.tgp-keys i.tgt-k-act { background: #48aaf0; }
.tgt .tgp-svg .tgp-line { stroke: #8b5cf6; stroke-width: 2; }
.tgt .tgp-svg .tgp-dot { fill: var(--surface); stroke: #8b5cf6; stroke-width: 2; }
.tgt .tgp-svg .tgp-dot.is-last { fill: var(--surface); }
.tgt .tgp-svg .tgp-pill rect { fill: #8b5cf6; stroke: none; }
.tgt .tgp-svg .tgp-pill text { fill: #fff; font-size: 11px; font-weight: 700; }
.tgt-slot .tgp-hit { transition: fill .2s; }
.tgt-slot:hover .tgp-hit { fill: color-mix(in srgb, #3b82f6 5%, transparent); }
.tgp-svg .tgt-zero { fill: #cbd5e1; }
/* Lưới tải: ô màu không chữ (số ở khung rê chuột), cột ngày bằng nhau, chú giải chấm tròn bên phải */
.tgt-heat { container: tgheat / inline-size; }
.tgt-heat-body { flex-direction: column; gap: 12px; }
.tgt-heat-scroll { width: 100%; max-height: 360px; overflow: auto; scrollbar-width: thin; }
.tgt-heat-grid { grid-template-columns: minmax(96px, 150px) repeat(var(--n), minmax(30px, 1fr)); gap: 6px; width: 100%; min-width: min-content; }
.tgt-heat-corner, .tgt-heat-h { position: sticky; top: 0; z-index: 2; align-self: stretch; padding-bottom: 2px; background: var(--surface); }
.tgt-heat-corner { left: 0; z-index: 3; display: flex; align-items: flex-end; padding-left: 2px; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }
.tgt-heat-h { justify-content: flex-end; font-size: 11.5px; font-weight: 600; color: var(--ink); }
.tgt-heat-h small { font-size: 10.5px; font-weight: 500; }
.tgt-heat-name { height: 28px; gap: 8px; font-size: 12.5px; font-weight: 600; }
.tgt-heat-name > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tgt-heat-name > i { width: auto; height: auto; }
.tgt-heat-name .tg-gico { width: 22px; height: 22px; border-radius: 6px; }
.tgt-heat-name .tg-gico:not([style]) { background: #eef2f7; color: #64748b; }
.tgt-cell { height: 28px; min-width: 30px; border-radius: 6px; font-size: 0; }
.tgt-cell[aria-disabled="true"] { cursor: default; }
.tgt-cell:hover:not([disabled]):not([aria-disabled]), .tgt-cell:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, #3b82f6 45%, transparent); outline: none; }
/* Màu mức tải pastel theo ảnh mẫu (ô lưới + nhãn tỷ lệ trong bảng) */
.tgt-cell.is-low, .tgt-rate.is-low, .tgt-heat-keys i.is-low { background: #dbeafe; color: #1e40af; }
.tgt-cell.is-ok, .tgt-rate.is-ok, .tgt-heat-keys i.is-ok { background: #c9efd6; color: #15803d; }
.tgt-cell.is-near, .tgt-rate.is-near, .tgt-heat-keys i.is-near { background: #fde7a9; color: #a16207; }
.tgt-cell.is-watch, .tgt-rate.is-watch, .tgt-heat-keys i.is-watch { background: #fcc98f; color: #c2410c; }
.tgt-cell.is-over, .tgt-rate.is-over, .tgt-heat-keys i.is-over { background: #f7a07f; color: #9f1239; }
.tgt-rate.is-over { background: #fde0d6; color: #c2410c; }
.tgt-cell.is-off, .tgt-heat-keys i.is-off { background: repeating-linear-gradient(135deg, #f6f8fb 0 4px, #e8edf4 4px 6px); }
.tgt-heat-keys { display: grid; grid-template-columns: repeat(3, max-content); gap: 8px 18px; font-size: 11.5px; }
.tgt-heat-keys li { gap: 8px; }
.tgt-heat-keys b { font-weight: 600; color: var(--ink); }
.tgt-heat-keys span { color: var(--ink-soft); }
.tgt-heat-keys i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
@container tgheat (min-width: 540px) {
  .tgt-heat-body { flex-direction: row; gap: 14px; }
  .tgt-heat-scroll { flex: 1 1 0; width: auto; }
  .tgt-heat-keys { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 30px 0 0 14px; }
  .tgt-heat-keys li { display: grid; grid-template-columns: 10px 58px auto; align-items: center; gap: 8px; }
  .tgt-heat-keys li > span.is-keep { grid-column: 2 / -1; }
  .tgt-heat-keys li > span { font-size: 11px; }
}
@container tgheat (max-width: 440px) { .tgt-heat-keys { grid-template-columns: repeat(2, max-content); } }
/* Phân bổ thời gian: vòng tròn dày bên trái, danh sách (chấm · tên · "40% · 125h") bên phải */
.tgt-donut { container: tgdonut / inline-size; }
.tgt-donut-body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(18px, 2.4vw, 40px); margin: auto 0; padding: 0 0 4px 12px; }
.tgt-donut .tgp-donut-c { width: clamp(140px, 10.5vw, 165px); height: clamp(140px, 10.5vw, 165px); }
.tgt-donut .rep-donut-arc { stroke-width: 14; }
.tgt-donut .tgp-donut-c > span b { font-size: clamp(20px, 1.6vw, 24px); font-weight: 800; letter-spacing: -.01em; }
.tgt-donut .tgp-donut-c > span small { font-size: 11.5px; color: var(--ink-soft); }
.tgt-legend { gap: 0; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.tgt-legend button { grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; padding: 5px 6px; font-size: 13px; }
.tgt-legend button[aria-disabled="true"] { cursor: default; }
.tgt-legend button[aria-disabled="true"]:hover { background: none; }
.tgt-legend i { width: 10px; height: 10px; border-radius: 50%; }
.tgt-legend b { font-size: 13px; font-weight: 500; text-align: right; white-space: nowrap; }
.tgt-legend b small { font-size: 13px; font-weight: 500; color: var(--ink); }
.tgt-legend li.is-sub button { padding-left: 22px; font-size: 12.5px; color: var(--ink-soft); }
.tgt-legend li.is-sub i { width: 6px; height: 6px; margin-left: 2px; border: 1.5px solid #94a3b8; background: none; }
@container tgdonut (max-width: 400px) {
  .tgt-donut-body { grid-template-columns: minmax(0, 1fr); justify-items: center; padding-left: 0; }
  .tgt-legend { width: 100%; }
}
/* Xu hướng: đường xanh + vùng tô nhạt, điểm cuối có nhãn xanh, ô so sánh bên phải */
.tgt-trend { container: tgtrend / inline-size; }
.tgt-trend-body { flex: 1 1 auto; align-items: center; gap: 0px; }
.tgt-trend-body .tgt-plot { flex: 1 1 0; }
.tgt-tr-svg { max-height: 230px; }
.tgp-svg .tgt-tr-line { stroke: #2f8de4; stroke-width: 2; }
.tgp-svg .tgt-tr-dot { fill: var(--surface); stroke: #2f8de4; stroke-width: 2; }
.tgp-svg .tgt-tr-na line { stroke: #dbe2ec; stroke-width: 1; stroke-dasharray: 3 4; }
.tgp-svg text.is-na { fill: #b4c0cf; }
.tgp-svg .tgt-tr-pt.is-last .tgt-tr-dot { fill: var(--surface); stroke: #2f8de4; stroke-width: 2.5; }
.tgt .tgp-svg .tgt-pill rect { fill: #2f8de4; stroke: none; }
.tgt .tgp-svg .tgt-pill text { fill: #fff; }
.tgt-trend-cmp { flex: none; width: 150px; min-width: 0; max-width: none; gap: 6px; padding: 16px 12px; border: 0; border-radius: 14px; background: #ecf9f1; }
.tgt-trend-cmp b { display: inline-flex; align-items: center; gap: 4px; font-size: clamp(17px, 1.35vw, 20px); font-weight: 800; color: #16a34a; }
.tgt-trend-cmp small { font-size: 12px; color: var(--ink-soft); }
@container tgtrend (max-width: 520px) {
  .tgt-trend-body { flex-direction: column; align-items: stretch; }
  .tgt-trend-cmp { width: auto; }
}
/* Bảng chi tiết: đầu bảng chữ xám trên nền trắng, dòng ~46px, tên nhóm + số thành viên cùng hàng, thanh màu nhóm, › cuối dòng */
.tgt-tablecard { padding: 16px 18px 10px; border-radius: 16px; }
.tgt-tablecard .tgp-thead h2 { font-size: clamp(14.5px, 1.1vw, 16px); }
.tgt-tablecard .tgp-thead h2 svg { color: #2b8ae6; }
.tgt-tablecard .tgp-sortsel select { border: 0; box-shadow: none; padding: 0 22px 0 2px; background-color: transparent; }
.tgt-table thead th { height: 38px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-soft); border-bottom: 0; }
.tgt-table thead th .report-sort { font-weight: 500; color: inherit; }
.tgt-table td, .tgt-table th { white-space: nowrap; }
.tgt-table tbody td { border-bottom: 1px solid #f0f3f7; }
.tgt-table tr.tgp-grow td { height: 46px; }
.tgt-table tr.tgp-mrow td { height: 44px; }
.tgt-table :is(th, td):nth-child(n+2):nth-child(-n+6) { text-align: center; }
.tgt-table th:nth-child(n+2):nth-child(-n+6) .report-sort { justify-content: center; }
.tgt-table td:nth-child(n+2):nth-child(-n+4) { font-size: 14px; font-weight: 500; color: var(--ink); }
.tgt-rate { min-width: 64px; padding: 3px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; text-align: center; }
.tgt-diff, .tgt-diff.is-neg, .tgt-diff.is-pos { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.tgt-table .tgt-barcell { width: 22%; min-width: 120px; }
.tgt-bar { height: 8px; background: #e9eef5; }
.tgt-table .tgp-caret { width: 24px; height: 24px; border: 0; background: none; color: var(--ink); }
.tgt-table .tgp-caret svg { transform: none; }
.tgt-table .tgp-grow.is-open .tgp-caret svg { transform: rotate(180deg); }
.tgt-table .tg-gico { width: 30px; height: 30px; border-radius: 8px; }
.tg-gname > span.tgt-gtxt { flex-direction: row; align-items: baseline; gap: 8px; }
.tgt-gtxt b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.tgt-gtxt small { flex: none; font-size: 12px; }
.tgt-go { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; transition: background-color .2s; }
.tgt-go:hover { background: var(--bg); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .tgt-slot .tgp-hit, .tgt-go { transition: none; } }
/* Vùng báo cáo hẹp: 2 hàng thẻ về 1 cột (đặt sau tỷ lệ 1 : 1,3 ở trên để được áp dụng) */
@container rep (max-width: 1060px) { .tgt-row2, .tgt-row3 { grid-template-columns: minmax(0, 1fr); } }
/* Ô số tab Thời gian — theo góp ý chủ dự án 10/11/2026 trên ảnh mẫu:
   1) đệm ngoài thẻ ~8–10px, ô biểu tượng đệm nhỏ (~7px quanh biểu tượng); 2) chữ + số ~7 phần so với bản trước;
   3) tên → số → thanh cách đều nhau, hình mờ ở góc dưới phải lấn ra vùng đệm nửa cỡ đệm; 4) nền pastel phẳng, không chuyển sang trắng */
.tgt-kpi { --pad: clamp(8px, 0.62vw, 10px); --gap: clamp(6px, 0.5vw, 8px); height: auto; min-height: clamp(72px, 5.4vw, 86px); align-items: flex-start; gap: clamp(8px, 0.7vw, 12px);
  padding: var(--pad) calc(var(--pad) + 2px); border-radius: 14px; border-color: color-mix(in srgb, var(--k) 10%, transparent); background: color-mix(in srgb, var(--k) 10%, var(--surface)); }
.tgt-kpi .tgp-kpi-ic { align-self: flex-start; width: clamp(32px, 2.5vw, 38px); height: clamp(32px, 2.5vw, 38px); border-radius: 10px; background: color-mix(in srgb, var(--k) 20%, var(--surface)); }
.tgt-kpi .tgp-kpi-ic svg { width: clamp(18px, 1.5vw, 24px); height: clamp(18px, 1.5vw, 24px); }
.tgt-kpi .tgp-kpi-txt { gap: var(--gap); padding: clamp(2px, 0.2vw, 3px) 0 0; }
.tgt-kpi .tgp-kpi-txt > b { font-size: clamp(11px, 0.75vw, 12px); font-weight: 700; line-height: 1.25; }
.tgt-kpi .tgp-kpi-v { gap: clamp(6px, 0.55vw, 9px); padding-right: clamp(32px, 2.6vw, 42px); }
.tgt-kpi .tgp-kpi-v strong { font-size: clamp(17px, 1.3vw, 20px); font-weight: 700; line-height: 1.05; }
.tgt-kpi .tgp-delta { font-size: clamp(10px, 0.68vw, 11px); font-weight: 500; opacity: 1; }
.tgt-kpi .tgp-delta svg { width: 10px; height: 10px; }
.tgt-kpi .tgp-delta.is-good { color: #16a34a; }
.tgt-kpi .tgp-delta.is-bad { color: #e11d48; }
.tgt-kpi .tgp-delta.is-warn { color: #ea580c; }
.tgt-kpi .tgp-delta.is-flat { color: var(--ink-soft); }
/* Hình mờ: góc dưới phải, cách mép = nửa vùng đệm (lấn ra vùng đệm nửa cỡ đệm) */
.tgt-kpi-wm { right: calc(var(--pad) / 2); bottom: calc(var(--pad) / 2); opacity: .22; }
.tgt-kpi-wm svg { width: clamp(30px, 2.5vw, 38px); height: clamp(30px, 2.5vw, 38px); }
/* Thẻ Tỷ lệ sử dụng: thanh cách số đúng bằng khoảng tên → số */
.tgt-kpi.is-orange .tgp-kpi-v { padding-right: 0; }
.tgt-kpi.is-orange .tgt-kpi-barrow { margin: 0 calc(var(--pad) * 2) 0 0; }
.tgt-kpi-barrow { gap: 8px; }
.tgt-kpi-barrow .tgt-kpi-bar { height: 6px; background: color-mix(in srgb, var(--k) 16%, var(--surface)); box-shadow: none; }
.tgt-kpi .tgt-kpi-bar i, .tgt-kpi .tgt-kpi-bar.is-over i, .tgt-kpi .tgt-kpi-bar.is-watch i { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
/* Biểu đồ Giờ làm việc theo ảnh mẫu: cột nhạt xanh da trời, cột đậm xanh, trục trái / phải / đáy xám nhạt, chú giải đường có chấm tròn */
.tgp-svg .tgt-col-plan, .tgt .tgp-keys i.tgt-k-plan { fill: #b9dcf9; background: #b9dcf9; }
.tgp-svg .tgt-col-act, .tgt .tgp-keys i.tgt-k-act { fill: #4aa8f0; background: #4aa8f0; }
.tgp-svg .tgp-bar.is-click:hover .tgt-col-plan { fill: #a3d0f6; }
.tgp-svg .tgp-bar.is-click:hover .tgt-col-act { fill: #2f93e2; }
.tgp-svg .tgt-axis { stroke: #d5dde8; stroke-width: 1; }
.tgt-chart .tgp-keys i.is-line { position: relative; width: 22px; height: 2px; background: #8b5cf6; }
.tgt-chart .tgp-keys i.is-line::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border: 2px solid #8b5cf6; border-radius: 50%; background: var(--surface); transform: translate(-50%, -50%); }
/* Lưới tải theo góp ý chủ dự án 10/11/2026: phần dữ liệu nằm trong khung viền mảnh bo 7px, cách viền 5px, tách khỏi chú giải bên phải;
   hiện 5 hàng (đầu cột + 5 × 35px), nhiều hơn thì cuộn với thanh cuộn mảnh nhạt; giữa các hàng vạch 1px rất nhạt */
.tgt-heat-scroll { box-sizing: border-box; max-height: calc(36px + 5 * 35px + 12px); padding: 5px; border: 1px solid #e8edf4; border-radius: 7px; overflow: auto;
  scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tgt-heat-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.tgt-heat-scroll::-webkit-scrollbar-thumb { border-radius: 6px; background: var(--scroll-thumb); }
.tgt-heat-scroll::-webkit-scrollbar-track { background: transparent; }
.tgt-heat-grid { display: block; width: 100%; min-width: min-content; }
.tgt-heat-row { display: grid; grid-template-columns: minmax(96px, 150px) repeat(var(--n), minmax(30px, 1fr)); gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid rgba(15, 23, 42, .045); }
.tgt-heat-row:last-child { border-bottom: 0; }
.tgt-heat-row.is-head { position: sticky; top: -5px; z-index: 3; height: 36px; box-sizing: border-box; padding: 0 0 4px; background: var(--surface); }
.tgt-heat-row.is-head .tgt-heat-h { position: static; padding: 0; }
.tgt-heat-row.is-head .tgt-heat-corner { top: auto; padding-bottom: 0; }
.tgt-heat-blank { height: 28px; }
.tgt-heat-fill { height: 28px; border-radius: 6px; background: repeating-linear-gradient(135deg, #f6f8fb 0 4px, #e8edf4 4px 6px); }
.tgt-heat-scroll { border-left: 0; border-radius: 0 7px 7px 0; padding-left: 0; } /* chủ dự án: khung lưới không có viền trái */
.tgt-heat-fill { background: #f3f6fa; } /* hàng trống (không có nhóm): ô nền xám nhạt trơn, không gạch chéo */
/* Danh sách dự án ở Phân bổ thời gian (chủ dự án 10/11/2026): hiện tối đa 5 dòng, dài hơn thì cuộn với thanh cuộn mảnh, mờ; khối xích sang trái (gap nhỏ hơn) để có chỗ cho thanh cuộn */
.tgt-donut-body { gap: clamp(12px, 1.4vw, 24px); padding-left: 4px; }
.tgt-legend { max-height: calc(5 * 30px); padding-right: 6px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tgt-legend button { box-sizing: border-box; height: 30px; }
.tgt-legend::-webkit-scrollbar { width: 4px; }
.tgt-legend::-webkit-scrollbar-thumb { border-radius: 4px; background: var(--scroll-thumb); }
.tgt-legend::-webkit-scrollbar-track { background: transparent; }

/* Xu hướng (chủ dự án 10/11/2026): vùng dưới đường tô chuyển màu (fill = url(#tgt-tr-fill) trong SVG); ô so sánh: tăng = xanh lá Hoàn thành,
   giảm = hồng đỏ hạn chót, không đổi = xanh dương Cần làm (cả số, mũi tên, chữ "So với tuần trước"); mũi tên to và đậm hơn */
.tgt-trend-cmp b { gap: 5px; font-weight: 800; }
.tgt-trend-cmp b svg { width: 20px; height: 20px; stroke-width: 2.8; }
.tgt-trend-cmp.is-up { background: var(--success-50); }
.tgt-trend-cmp.is-up b, .tgt-trend-cmp.is-up small { color: var(--success-600); }
.tgt-trend-cmp.is-down { background: var(--danger-50); }
.tgt-trend-cmp.is-down b, .tgt-trend-cmp.is-down small { color: var(--danger-600); }
.tgt-trend-cmp.is-same { background: #eaf7ff; }
.tgt-trend-cmp.is-same b, .tgt-trend-cmp.is-same small { color: #0284c7; }
/* Bảng Chi tiết thời gian — góp ý chủ dự án 10/11/2026 */
/* Chữ "Đội nhóm" trên đầu cột bắt đầu thẳng hàng với biểu tượng nhóm (bỏ qua ô mũi tên 24px + khoảng cách 10px) */
.tgt-table:not(.is-flat) thead th:first-child .report-sort { padding-left: 34px; }
/* Tên trường nhỏ lại */
.tgt-table thead th, .tgt-table thead th .report-sort { font-size: 12px; }
/* Nhãn Tỷ lệ sử dụng: ≥ 80% xanh lá (kể cả trên 100%) · 50–80% vàng · < 50% xanh dương nhạt (tgRateTone) */
.tgt-table .tgt-rate.is-good { background: #dcfce7; color: #15803d; }
.tgt-table .tgt-rate.is-mid { background: #fef3c7; color: #b45309; }
.tgt-table .tgt-rate.is-low { background: #e0f2fe; color: #0369a1; }
/* Chênh lệch: sát kế hoạch xanh lá, lệch vừa vàng đậm, lệch nhiều hồng đỏ (tgDiffTone) */
.tgt-table .tgt-diff.is-good { color: #15803d; }
.tgt-table .tgt-diff.is-mid { color: #b45309; }
.tgt-table .tgt-diff.is-off { color: #be123c; }
/* Thanh cuối dòng: cùng thang màu với nhãn tỷ lệ (dịu, đồng bộ), dày hơn */
.tgt-table .tgt-bar { height: 10px; border-radius: 99px; background: #eef2f7; }
.tgt-table .tgt-bar i { border-radius: 99px; }
.tgt-table .tgt-bar.is-good i { background: linear-gradient(90deg, #6ee7b7, #34d399); }
.tgt-table .tgt-bar.is-mid i { background: linear-gradient(90deg, #fde68a, #fbbf24); }
.tgt-table .tgt-bar.is-low i { background: linear-gradient(90deg, #bae6fd, #7dd3fc); }
/* Ô Sắp xếp: khung bo nhẹ, chữ "Sắp xếp:" xám + giá trị đậm + mũi tên, không viền của ô chọn bên trong (đồng bộ ảnh mẫu) */
.tgt-tablecard .tgp-sortsel { height: 36px; padding: 0 8px 0 12px; border: 1px solid #e5eaf1; border-radius: 10px; background: var(--surface); font-size: 13px; }
.tgt-tablecard .tgp-sortsel .cselect-btn { height: 30px; padding: 0 2px 0 4px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; font-size: 13px; font-weight: 600; color: var(--ink); }
.tgt-tablecard .tgp-sortsel .cselect-btn:hover, .tgt-tablecard .tgp-sortsel .cselect-btn.is-open { background: transparent; color: var(--primary-600); }
.tgt-tablecard .tgp-sortsel .cselect-caret { color: var(--ink-soft); }
/* Nút Đội nhóm / Thành viên của bảng (ảnh mẫu): đang chọn = nền xanh nhạt của Cần làm + chữ xanh đậm cùng tông, không viền / bóng */
.tgt-tablecard .tg-seg button.is-on { border-color: transparent; background: #eaf7ff; color: #0284c7; box-shadow: none; }
/* ===== Tab Thời gian — khung RÊ CHUỘT dùng chung (đặc tả tương tác 10/11/2026, tgTimeTipShow) =====
   rộng 210–280px, đệm 12px, bo 12px, viền #E3EAF5, bóng mềm; hiện / ẩn mờ dần + trượt 4px trong 0,2 giây; mũi nhọn theo --tip-x */
.tgt-tip { z-index: 1050; box-sizing: border-box; width: max-content; min-width: 210px; max-width: min(280px, calc(100vw - 24px)); gap: 0; padding: 12px;
  border: 1px solid #e3eaf5; border-radius: 12px; background: var(--surface); box-shadow: 0 6px 20px rgba(28, 55, 108, .11); color: var(--ink);
  font-size: 12px; line-height: 18px; opacity: 0; transform: translateY(4px); transition: opacity .2s ease-out, transform .2s ease-out; }
.tgt-tip.is-below { transform: translateY(-4px); }
.tgt-tip.is-on { opacity: 1; transform: none; }
.tgt-tip::before { content: ""; position: absolute; left: var(--tip-x, 50%); bottom: -5px; width: 9px; height: 9px; margin-left: -5px; border-right: 1px solid #e3eaf5; border-bottom: 1px solid #e3eaf5; background: var(--surface); transform: rotate(45deg); }
.tgt-tip.is-below::before { top: -5px; bottom: auto; border: 0; border-left: 1px solid #e3eaf5; border-top: 1px solid #e3eaf5; }
.tgt-tip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tgt-tip-head b { font-size: 13px; font-weight: 700; line-height: 18px; }
.tgt-tip-head small { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.tgt-tip .tg-tip-row { display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 30px; border-bottom: 1px solid #edf1f7; color: var(--ink); }
.tgt-tip .tg-tip-row:last-of-type { border-bottom: 0; }
.tgt-tip .tg-tip-row > span { flex: 1 1 auto; min-width: 0; font-size: 12px; font-weight: 500; }
.tgt-tip .tg-tip-row > svg { flex: none; color: var(--ink-soft); }
.tgt-tip .tg-tip-row b { flex: none; font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tgt-tip .tg-tip-row.is-blue b { color: #0284c7; }
.tgt-tip .tg-tip-row.is-red b, .tgt-tip .tg-tip-row.is-red > svg { color: var(--danger-600); }
.tgt-tip .tg-tip-row.is-green b { color: var(--success-600); }
.tgt-tip .tg-tip-row.is-over b { color: var(--danger-600); }
.tgt-tip-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.tgt-tip-status { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 600; }
.tgt-tip-status.is-low { background: #eaf7ff; color: #0369a1; }
.tgt-tip-status.is-ok { background: var(--success-50); color: var(--success-600); }
.tgt-tip-status.is-near { background: #fff6dc; color: #a16207; }
.tgt-tip-status.is-watch { background: #ffedd5; color: #c2410c; }
.tgt-tip-status.is-over { background: var(--danger-50); color: var(--danger-600); }
.tgt-tip-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #edf1f7; font-size: 11px; color: var(--ink-soft); }
.tgt-tip > small { display: block; margin-top: 6px; font-size: 11px; color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .tgt-tip { transition: none; transform: none; } }
/* Khung rê ô số (mục 1, chủ dự án 10/11/2026): người nghỉ = hồng đỏ màu Cần kiểm tra, ngày lễ = tím */
.tgt-tip .tg-tip-row.is-pink b, .tgt-tip .tg-tip-row.is-pink > svg { color: #fb7185; }
.tgt-tip .tg-tip-row.is-violet b { color: #7c3aed; }
/* Ô số đang mở khung chi tiết */
.tgt-kpi.is-active { border-color: color-mix(in srgb, var(--k) 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 12%, transparent); }

/* ===== Tab Thời gian — khung CHI TIẾT KHI BẤM dùng chung (tgtPanel*) =====
   rộng 320px, đệm 14px, bo 16px, viền #DCE6F6, bóng mềm; hiện / ẩn mờ dần + trượt 4px trong 0,2 giây; màn < 768px = tấm trượt từ đáy */
.tgt-panel { position: absolute; z-index: 1060; box-sizing: border-box; width: min(320px, calc(100vw - 24px)); max-height: min(480px, calc(100vh - 32px)); overflow-y: auto; padding: 14px;
  border: 1px solid #dce6f6; border-radius: 16px; background: var(--surface); box-shadow: 0 12px 32px rgba(28, 55, 108, .14); color: var(--ink); font-size: 12px; line-height: 18px;
  opacity: 0; transform: translateY(4px); transition: opacity .2s ease-out, transform .2s ease-out; }
.tgt-panel.is-up { transform: translateY(-4px); }
.tgt-panel.is-on { opacity: 1; transform: none; }
.tgt-panel[hidden] { display: none; }
.tgt-panel-head { display: flex; align-items: center; gap: 10px; min-height: 32px; margin-bottom: 10px; }
.tgt-panel-head > b { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgt-panel-ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: #eaf4ff; color: #2b8ae6; }
.tgt-panel-ic.is-violet { background: #f3edff; color: #7c3aed; }
.tgt-panel-ic.is-green { background: var(--success-50); color: var(--success-600); }
.tgt-panel-x { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; transition: background-color .2s, color .2s; }
.tgt-panel-x:hover { background: var(--bg); color: var(--ink); }
.tgt-panel-range { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; margin-bottom: 10px; border: 1px solid #e3eaf5; border-radius: 9px; font-size: 12px; font-weight: 600; }
.tgt-panel-range svg { color: #2b8ae6; }
.tgt-panel-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 8px; }
.tgt-panel-seg button { height: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: #f4f7fb; font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background-color .2s, color .2s; }
.tgt-panel-seg button:hover { color: var(--ink); }
.tgt-panel-seg button.is-on { background: #eaf7ff; color: #0284c7; }
/* Danh sách: thấy tối đa 5 dòng (30px), dài hơn thì cuộn — thanh cuộn siêu mảnh, mờ */
.tgt-panel-list { max-height: calc(5 * 32px); margin: 0; padding: 0 4px 0 0; list-style: none; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.tgt-panel-list::-webkit-scrollbar { width: 3px; }
.tgt-panel-list::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--scroll-thumb); }
.tgt-panel-list::-webkit-scrollbar-track { background: transparent; }
.tgt-panel-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 46px; align-items: center; gap: 8px; box-sizing: border-box; width: 100%; height: 32px; padding: 0 6px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 12px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s; }
.tgt-panel-row:hover:not([aria-disabled]) { background: #f4f7fb; }
.tgt-panel-row[aria-disabled] { cursor: default; }
.tgt-panel-row .tg-gico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; }
.tgt-panel-row .tg-gico:not([style]) { background: #eef2f7; color: #64748b; }
.tgt-panel-row .avatar { width: 22px; height: 22px; font-size: 9px; }
.tgt-panel-dot { justify-self: center; width: 9px; height: 9px; border-radius: 50%; }
.tgt-panel-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tgt-panel-row b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tgt-panel-row em { font-style: normal; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.tgt-panel-total { display: grid; grid-template-columns: minmax(0, 1fr) auto 46px; align-items: center; gap: 8px; min-height: 38px; margin-top: 8px; padding: 0 10px 0 12px; border-radius: 10px; background: #eaf4ff; font-size: 12.5px; font-weight: 600; }
.tgt-panel-total b { font-weight: 800; font-variant-numeric: tabular-nums; }
.tgt-panel-total em { font-style: normal; font-weight: 700; text-align: right; color: var(--ink-soft); }
.tgt-panel-empty { margin: 14px 0 6px; font-size: 12px; color: var(--ink-soft); text-align: center; }
.tgt-panel.is-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-height: 85vh; padding: 18px 16px; border-radius: 18px 18px 0 0; transform: translateY(16px); }
.tgt-panel.is-sheet.is-on { transform: none; }
@media (prefers-reduced-motion: reduce) { .tgt-panel, .tgt-panel-x, .tgt-panel-seg button, .tgt-panel-row { transition: none; transform: none; } }
/* Biểu đồ giờ — rê / bấm cả khung ngày (mục 3, 4; chủ dự án chốt 10/11/2026): chỉ cột đậm hơn, không tô nền khung ngày */
.tgt-slot { cursor: pointer; outline: none; }
.tgt-slot .tgp-hit, .tgt-slot:hover .tgp-hit { fill: transparent; }
.tgp-svg .tgt-slot .tgt-col-plan, .tgp-svg .tgt-slot .tgt-col-act { transition: fill .2s; }
.tgp-svg .tgt-slot:hover .tgt-col-plan, .tgp-svg .tgt-slot:focus-visible .tgt-col-plan, .tgp-svg .tgt-slot.is-active .tgt-col-plan { fill: #a3d0f6; }
.tgp-svg .tgt-slot:hover .tgt-col-act, .tgp-svg .tgt-slot:focus-visible .tgt-col-act, .tgp-svg .tgt-slot.is-active .tgt-col-act { fill: #2f93e2; }
.tgt-slot:not([data-action]) { cursor: default; }
/* Khung chi tiết: 3 ô số nhỏ, dòng phụ, tiêu đề danh sách, dòng việc */
.tgt-panel-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.tgt-panel-mini > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 60px; box-sizing: border-box; padding: 9px 8px; border-radius: 9px; background: #eaf4ff; }
.tgt-panel-mini small { font-size: 11px; line-height: 16px; color: #2b8ae6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgt-panel-mini b { font-size: 19px; font-weight: 700; line-height: 24px; color: #1d6fd1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tgt-panel-mini .is-green { background: var(--success-50); }
.tgt-panel-mini .is-green small, .tgt-panel-mini .is-green b { color: var(--success-600); }
.tgt-panel-mini .is-amber { background: #fff6dc; }
.tgt-panel-mini .is-amber small, .tgt-panel-mini .is-amber b { color: #c2410c; }
.tgt-panel-sub { margin: 0 0 10px; font-size: 11px; color: var(--ink-soft); }
.tgt-panel-h { margin: 0 0 4px; padding-top: 10px; border-top: 1px solid #edf1f7; font-size: 12.5px; font-weight: 700; }
.tgt-panel-row.is-task { grid-template-columns: 22px minmax(0, 1fr) auto; }
.tgt-panel-pic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: color-mix(in srgb, var(--pc) 16%, var(--surface)); color: var(--pc); }
@media (prefers-reduced-motion: reduce) { .tgp-svg .tgt-slot .tgt-col-plan, .tgp-svg .tgt-slot .tgt-col-act { transition: none; } }
/* Lưới tải — rê / bấm ô (mục 5, 6; chủ dự án chốt 10/11/2026): viền 2px cùng tông mức tải, cỡ ô không đổi */
.tgt-cell { transition: box-shadow .2s; }
.tgt-heat .tgt-cell.is-low:hover, .tgt-heat .tgt-cell.is-low:focus-visible, .tgt-heat .tgt-cell.is-low.is-active { box-shadow: inset 0 0 0 2px #7dd3fc; }
.tgt-heat .tgt-cell.is-ok:hover, .tgt-heat .tgt-cell.is-ok:focus-visible, .tgt-heat .tgt-cell.is-ok.is-active { box-shadow: inset 0 0 0 2px #34d399; }
.tgt-heat .tgt-cell.is-near:hover, .tgt-heat .tgt-cell.is-near:focus-visible, .tgt-heat .tgt-cell.is-near.is-active { box-shadow: inset 0 0 0 2px #f59e0b; }
.tgt-heat .tgt-cell.is-watch:hover, .tgt-heat .tgt-cell.is-watch:focus-visible, .tgt-heat .tgt-cell.is-watch.is-active { box-shadow: inset 0 0 0 2px #ea580c; }
.tgt-heat .tgt-cell.is-over:hover, .tgt-heat .tgt-cell.is-over:focus-visible, .tgt-heat .tgt-cell.is-over.is-active { box-shadow: inset 0 0 0 2px #e11d48; }
.tgt-heat .tgt-cell[aria-disabled="true"]:hover { box-shadow: none; }
/* Đầu khung chi tiết có dòng phụ (nhóm – ngày) */
.tgt-panel-ttl { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.tgt-panel-ttl b { font-size: 14px; font-weight: 700; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgt-panel-ttl small { font-size: 11px; line-height: 16px; color: var(--ink-soft); }
/* Thành viên tham gia (avatar 24px chồng -6px, tối đa 4 + "+N") + nút Xem công việc cùng hàng */
.tgt-panel-ppl { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; }
.tgt-panel-av { display: inline-flex; align-items: center; }
.tgt-panel-av .avatar { width: 26px; height: 26px; font-size: 10px; border: 2px solid var(--surface); }
.tgt-panel-av .avatar + .avatar, .tgt-panel-av .tgt-panel-more { margin-left: -6px; }
.tgt-panel-more { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--surface); border-radius: 50%; background: #eef2f7; font-size: 10px; font-style: normal; font-weight: 700; color: var(--ink-soft); }
.tgt-panel-none { font-size: 11.5px; color: var(--ink-soft); }
.tgt-panel-cta { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 12px; border: 1px solid color-mix(in srgb, #38bdf8 35%, transparent); border-radius: 9px; background: #eaf7ff;
  font: inherit; font-size: 12px; font-weight: 600; color: #0284c7; cursor: pointer; transition: background-color .2s; }
.tgt-panel-cta:hover { background: #d9f0ff; }
@media (prefers-reduced-motion: reduce) { .tgt-cell, .tgt-panel-cta { transition: none; } }

.tgt-tip-head b { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* tên nhóm dài: 1 dòng + … */
.tgt-tip-head small { flex: none; }
/* Vòng tròn Phân bổ thời gian — rê lát / dòng (mục 7, chủ dự án chốt 10/11/2026): lát đó dày lên, lát khác mờ, dòng tương ứng tô nền; 0,2 giây */
.tgt-donut .tgt-arc { cursor: pointer; transition: stroke-width .2s, opacity .2s; }
.tgt-donut .tgt-arc:not([data-action]) { cursor: default; }
.tgt-donut.is-hl .tgt-arc { opacity: .35; }
.tgt-donut.is-hl .tgt-arc.is-hl-on { opacity: 1; stroke-width: 17; }
.tgt-donut .tgt-legend button[data-slice] { transition: background-color .2s, opacity .2s; }
.tgt-donut.is-hl .tgt-legend button[data-slice] { opacity: .55; }
.tgt-donut.is-hl .tgt-legend button.is-hl-on { opacity: 1; background: #f4f7fb; }
.tgt-tip-head .tgt-tip-dot { align-self: center; }
.tgt-tip-head:has(.tgt-tip-dot) { justify-content: flex-start; }
/* Khung Chi tiết tuần (mục 8): 2 dòng số, danh sách nhóm có thanh, nút Xem tuần này */
.tgt-panel-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; font-size: 12px; }
.tgt-panel-stat span { color: var(--ink-soft); }
.tgt-panel-stat b { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tgt-panel-stat b.is-green, .tgt-panel-stat b.is-up { color: var(--success-600); }
.tgt-panel-stat b.is-down { color: var(--danger-600); }
.tgt-panel-stat b.is-same { color: #0284c7; }
.tgt-panel-stat b.is-muted { font-weight: 500; color: var(--ink-soft); }
.tgt-panel-row.is-bar { grid-template-columns: 22px minmax(0, 1fr) 70px 46px; }
.tgt-panel-row.is-bar .tgt-bar { display: block; height: 7px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.tgt-panel-row.is-bar .tgt-bar i { display: block; height: 100%; border-radius: 99px; }
.tgt-panel-row.is-bar .tgt-bar.is-good i { background: linear-gradient(90deg, #6ee7b7, #34d399); }
.tgt-panel-row.is-bar .tgt-bar.is-mid i { background: linear-gradient(90deg, #fde68a, #fbbf24); }
.tgt-panel-row.is-bar .tgt-bar.is-low i { background: linear-gradient(90deg, #bae6fd, #7dd3fc); }
.tgt-panel-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .tgt-donut .tgt-arc, .tgt-donut .tgt-legend button[data-slice] { transition: none; } }
/* Điểm xu hướng / khung ngày bấm được: bỏ khung viền đen của trình duyệt sau khi bấm; dùng bàn phím (Tab) thì điểm có vòng sáng */
.tgt-tr-pt, .tgt-slot, .tgt-arc { outline: none; }
.tgp-svg .tgt-tr-pt:focus-visible .tgt-tr-dot, .tgp-svg .tgt-tr-pt.is-active .tgt-tr-dot { stroke-width: 3.5; filter: drop-shadow(0 0 3px rgba(47, 141, 228, .55)); }
.tgt-donut .tgp-donut-c > span { pointer-events: none; } /* chữ tổng ở giữa vòng tròn phủ cả vòng: không chặn chuột để rê / bấm được từng lát */
/* ===== Báo cáo tổng quát — khung rê / bấm theo bảng "Thông số chung (WEA Design System)" của ảnh mẫu 10/11/2026 (lớp .is-ov) =====
   Khung rê: rộng 220–260px, đệm 12×14, bo 12px; khung bấm: rộng 360–420px, đệm 18px, bo 16px, cao tối đa 80vh;
   bóng 0 8px 24px rgba(15,23,42,.08), viền #E5E7EB; hiện = mờ dần + phóng nhẹ 150ms ease-out. Chữ: tiêu đề khung 16/600, tiêu đề rê 13/600, nội dung 14/500, phụ 12/400 */
.tgt-tip.is-ov { min-width: 220px; max-width: min(260px, calc(100vw - 24px)); padding: 12px 14px; border-color: #e5e7eb; border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  transform: scale(.97); transform-origin: 50% 100%; transition: opacity .15s ease-out, transform .15s ease-out; }
.tgt-tip.is-ov.is-below { transform-origin: 50% 0; transform: scale(.97); }
.tgt-tip.is-ov.is-on { transform: none; }
.tgt-tip.is-ov::before { border-color: #e5e7eb; }
.tgt-tip.is-ov .tgt-tip-head b { font-size: 13px; font-weight: 600; }
.tgt-tip.is-ov .tg-tip-row { min-height: 30px; }
.tgt-tip.is-ov .tg-tip-row > span { font-size: 14px; font-weight: 500; color: #475569; }
.tgt-tip.is-ov .tg-tip-row b { font-size: 14px; font-weight: 700; }
.tgt-tip.is-ov .tg-tip-row.is-green b { color: #16a34a; }
.tgt-tip.is-ov .tg-tip-row.is-red b { color: #ef4444; }
.tgt-tip-info { display: inline-flex; margin-left: auto; color: var(--ink-soft); }
.tgt-tip-head:has(.tgt-tip-info) { justify-content: flex-start; }
.tgt-panel.is-ov { width: min(380px, calc(100vw - 24px)); max-height: min(80vh, calc(100vh - 32px)); padding: 18px; border-color: #e5e7eb; border-radius: 16px; box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
  transform: scale(.97); transform-origin: 0 0; transition: opacity .15s ease-out, transform .15s ease-out; }
.tgt-panel.is-ov.is-on { transform: none; }
.tgt-panel.is-ov .tgt-panel-ttl b, .tgt-panel.is-ov .tgt-panel-head > b { font-size: 16px; font-weight: 600; line-height: 22px; }
.tgt-panel.is-ov .tgt-panel-list { max-height: calc(5 * 36px); }
.tgt-panel.is-ov .tgt-panel-row { height: 36px; font-size: 14px; }
.tgt-panel.is-ov .tgt-panel-name { font-weight: 500; }
.tgt-panel.is-ov.is-sheet { width: 100%; border-radius: 18px 18px 0 0; transform: translateY(16px); }
.tgt-panel.is-ov.is-sheet.is-on { transform: none; }
.tgt-panel-ic.is-red { background: #fee2e2; color: #ef4444; }
.tgt-panel-ic.is-orange { background: #fef3c7; color: #d97706; }
/* Dòng việc (ảnh mẫu mục 1–4): biểu tượng trạng thái (chỉ xem) · tên · nhãn ưu tiên */
.tgt-panel-row.is-ovtask { grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; }
.tgt-panel-st { display: inline-flex; }
.rep-prio { flex: none; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-style: normal; font-weight: 600; white-space: nowrap; }
.rep-prio.is-high { background: #fee2e2; color: #ef4444; }
.rep-prio.is-medium { background: #fef3c7; color: #d97706; }
.rep-prio.is-low { background: #dbeafe; color: #3b82f6; }
.tgt-panel-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 2px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: #3b82f6; cursor: pointer; }
.tgt-panel-link:hover { text-decoration: underline; }
.tgt-panel-blank { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0 6px; text-align: center; }
.tgt-panel-blank > span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #eff6ff; color: #3b82f6; }
.tgt-panel-blank p { margin: 0; font-size: 12px; color: var(--ink-soft); }
/* Ô số đang mở khung */
.rep-kpi.is-active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--k, #3b82f6) 16%, transparent); }
@media (prefers-reduced-motion: reduce) { .tgt-tip.is-ov, .tgt-panel.is-ov { transition: none; transform: none; } }
.tgt-panel.is-ov .tgt-panel-list { max-height: calc(4 * 36px); } /* Báo cáo tổng quát: khung bấm thấy 4 việc, dài hơn thì cuộn (chủ dự án chốt 10/11/2026) */
/* Mục 5 – Công việc theo trạng thái (ảnh mẫu Báo cáo tổng quát): rê lát / dòng = lát dày lên, lát khác mờ, dòng tương ứng tô nền; bấm = khung danh sách cạnh chú giải */
.rep-status .tgt-arc { cursor: pointer; transition: stroke-width .15s ease-out, opacity .15s ease-out; }
.rep-status.is-hl .tgt-arc { opacity: .35; }
.rep-status.is-hl .tgt-arc.is-hl-on { opacity: 1; stroke-width: 18; }
.rep-status .rep-legend-pill { transition: background-color .15s, opacity .15s; }
.rep-status.is-hl .rep-legend-pill[data-slice] { opacity: .55; }
.rep-status.is-hl .rep-legend-pill.is-hl-on, .rep-status .rep-legend-pill.is-active { opacity: 1; background: #f3f4f6; }
.rep-status .rep-legend-pill[disabled] { cursor: default; }
.tgt-panel-foot.is-split { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.tgt-panel-foot.is-split .tgt-panel-link { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .rep-status .tgt-arc, .rep-status .rep-legend-pill { transition: none; } }
.tgt-panel-foot.is-split { flex-wrap: wrap; row-gap: 8px; } .tgt-panel-link { white-space: nowrap; } /* "Xem tất cả" luôn 1 dòng; thiếu chỗ thì nút Nhắc xuống hàng */
/* Báo cáo tổng quát — chip trong khung chi tiết (ảnh mới 1536 mục 1, 2): số lớn + nhãn trên nền nhạt cùng màu;
   chip đang chọn có bóng màu riêng nổi lên (chủ dự án chốt 10/11/2026); bấm chip = đổi danh sách */
.rep-ov-chips { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.rep-ov-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; min-height: 54px; padding: 6px 4px; border: 1px solid color-mix(in srgb, var(--c) 18%, transparent); border-radius: 10px;
  background: color-mix(in srgb, var(--c) 8%, var(--surface)); font: inherit; color: var(--c); cursor: pointer; transition: box-shadow .15s ease-out, border-color .15s ease-out, background-color .15s ease-out; }
.rep-ov-chip > svg { margin-bottom: -2px; }
.rep-ov-chip b { font-size: 18px; font-weight: 700; line-height: 22px; font-variant-numeric: tabular-nums; }
.rep-ov-chip small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 500; color: color-mix(in srgb, var(--c) 75%, #334155); }
.rep-ov-chip:hover { border-color: color-mix(in srgb, var(--c) 40%, transparent); }
.rep-ov-chip.is-on { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 13%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 22%, transparent), 0 6px 14px color-mix(in srgb, var(--c) 22%, transparent); }
.tgt-panel-subhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 4px; }
.tgt-panel-subhead b { font-size: 13px; font-weight: 600; }
.tgt-panel-subhead .tgt-panel-link { margin-top: 0; }
/* Tiến độ hoàn thành của dự án */
.tgt-panel-prog { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; margin-bottom: 10px; font-size: 13px; }
.tgt-panel-prog span { font-weight: 600; }
.tgt-panel-prog b { font-weight: 700; font-variant-numeric: tabular-nums; }
.tgt-panel-prog i { grid-column: 1 / -1; display: block; height: 6px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.tgt-panel-prog i em { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #818cf8, #6366f1); }
/* Danh sách thấy 3 việc (khung dự án), thanh cuộn mảnh mờ như các khung khác */
.tgt-panel.is-ov .tgt-panel-list.is-3 { max-height: calc(3 * 36px); }
/* Nhãn trạng thái bên phải dòng việc */
.rep-stpill { flex: none; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); font-size: 12px; font-style: normal; font-weight: 600; color: color-mix(in srgb, var(--c) 80%, #1e293b); white-space: nowrap; }
/* Dòng dự án đang rê / đang mở khung */
.rep-ptable tr.rep-prow { transition: background-color .15s; }
.rep-ptable tr.rep-prow:hover, .rep-ptable tr.rep-prow.is-active { background: #f3f6fb; }
@media (prefers-reduced-motion: reduce) { .rep-ov-chip, .rep-ptable tr.rep-prow { transition: none; } }
/* Góp ý 10/11/2026 (ảnh mới 1536 mục 1, 7): lát khác chỉ mờ nhẹ; chip không viền, chữ đậm hơn; tiêu đề danh sách đậm, tên việc nhỏ hơn;
   vạch mảnh mờ trên / dưới mỗi việc; nút Nhắc gọn vàng cam cạnh Xem tất cả; biểu tượng tiêu đề khung nhỏ lại */
.rep-status.is-hl .tgt-arc { opacity: .9; }
.rep-status.is-hl .rep-legend-pill[data-slice] { opacity: .9; }
.rep-ov-chip { border: 0; }
.rep-ov-chip.is-on { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent), 0 6px 14px color-mix(in srgb, var(--c) 24%, transparent); }
.rep-ov-chip b { color: color-mix(in srgb, var(--c) 82%, #0f172a); }
.rep-ov-chip small { color: color-mix(in srgb, var(--c) 60%, #0f172a); font-weight: 600; }
.tgt-panel-subhead b { font-size: 14px; font-weight: 700; }
.tgt-panel.is-ov .tgt-panel-row { font-size: 13px; }
.tgt-panel.is-ov .tgt-panel-list > li { border-top: 1px solid #f1f4f8; }
.tgt-panel.is-ov .tgt-panel-list > li:last-child { border-bottom: 1px solid #f1f4f8; }
.tgt-panel.is-ov .tgt-panel-ic { width: 26px; height: 26px; border-radius: 8px; }
.tgt-panel.is-ov .tgt-panel-ic svg { width: 14px; height: 14px; }
.tgt-panel.is-ov .tgt-panel-ttl b, .tgt-panel.is-ov .tgt-panel-head > b { font-size: 15px; }
.tgt-panel-acts { display: inline-flex; align-items: center; gap: 8px; }
.rep-remind-mini { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 0; border-radius: 7px; background: #fef6e0; font: inherit; font-size: 12px; font-weight: 600; color: #b45309; cursor: pointer; transition: background-color .15s; }
.rep-remind-mini:hover { background: #fdecc0; }
.tgt-panel.is-ov .tgt-panel-list { max-height: calc(4 * 37px); } .tgt-panel.is-ov .tgt-panel-list.is-3 { max-height: calc(3 * 37px); } /* tính cả vạch 1px giữa các việc */
/* Mục 3 (ảnh mới 1536) – khung Hiệu suất: ảnh đại diện ở đầu khung, ô số tím; dòng người đang rê / đang mở */
.tgt-panel-who { display: flex; align-items: center; gap: 10px; margin: -2px 0 12px; font-size: 13px; color: var(--ink-soft); } .tgt-panel-who .avatar { width: 32px; height: 32px; font-size: 12px; flex: none; }
.tgt-tip-av { display: inline-flex; flex: none; align-self: center; } .tgt-tip-av .avatar { width: 20px; height: 20px; font-size: 9px; }
.tgt-tip-head:has(.tgt-tip-av) { justify-content: flex-start; gap: 8px; }
.tgt-panel-mini .is-violet { background: #f3edff; } .tgt-panel-mini .is-violet small, .tgt-panel-mini .is-violet b { color: #7c3aed; }
.rep-staff-row.is-active, .rep-pbar-row.is-active { background: #f3f6fb; }
/* Ảnh mới 1536 mục 4, 5, 6 — Biểu đồ năng lực / Phân bổ theo dự án / Tuổi việc quá hạn */
.tgt-panel-mini .is-red { background: #fee2e2; } .tgt-panel-mini .is-red small, .tgt-panel-mini .is-red b { color: #dc2626; }
.tgt-panel-mini:has(> div:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Mục 4: 3 dòng Đã hoàn thành / Đang thực hiện / Quá hạn (chấm màu · tên · số), bấm dòng = danh sách */
.tgt-panel-row.is-cnt { grid-template-columns: 10px minmax(0, 1fr) auto; }
.tgt-panel-row.is-cnt[disabled] { cursor: default; opacity: .6; }
.tgt-panel-list.is-cnts { max-height: none; }
/* Mục 5: thanh Phân bổ theo trạng thái */
.tgt-panel-bars { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 6px; padding: 0; list-style: none; }
.tgt-panel-bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 70px; align-items: center; gap: 10px; font-size: 13px; }
.tgt-panel-bar > span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; white-space: nowrap; }
.tgt-panel-track { display: block; height: 7px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.tgt-panel-track em { display: block; height: 100%; border-radius: inherit; }
.tgt-panel-bar > b { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tgt-panel-bar > b small { font-weight: 500; color: var(--ink-soft); }
/* Mục 6: nhãn "Trễ N ngày" */
.rep-stpill.is-late { --c: #ef4444; display: inline-flex; align-items: center; gap: 4px; }
/* Mục 5: vòng tròn theo dự án — rê lát / dòng = lát dày lên, lát khác mờ nhẹ (0,9) */
.rep-pdonut .tgt-arc { cursor: pointer; transition: stroke-width .15s ease-out, opacity .15s ease-out; }
.rep-pdonut .tgt-arc:not([data-action]) { cursor: default; }
.rep-pdonut.is-hl .tgt-arc { opacity: .9; }
.rep-pdonut.is-hl .tgt-arc.is-hl-on { opacity: 1; stroke-width: 18; }
.rep-pdonut .rep-dleg-row { transition: background-color .15s, opacity .15s; }
.rep-pdonut.is-hl .rep-dleg-row[data-slice] { opacity: .9; }
.rep-pdonut.is-hl .rep-dleg-row.is-hl-on, .rep-pdonut .rep-dleg-row.is-active { opacity: 1; background: #f3f4f6; }
/* Mục 4, 6: điểm / cột đang mở khung */
.rep-cap-dot.is-active { transform: scale(1.35); box-shadow: 0 0 0 4px rgba(59, 130, 246, .2); }
.rep-age-col.is-active .rep-age-bar { filter: saturate(1.25) brightness(.95); box-shadow: 0 0 0 2px rgba(239, 68, 68, .2); }
.rep-age-col:not([data-action]) { cursor: default; }
@media (prefers-reduced-motion: reduce) { .rep-pdonut .tgt-arc, .rep-pdonut .rep-dleg-row { transition: none; } }
.tgt-panel.is-ov .tgt-panel-row.is-cnt { height: 32px; } /* mục 4: 3 dòng Chi tiết công việc thấp hơn (chủ dự án 10/11/2026) */
.tgt-panel { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; } /* khung bị giới hạn chiều cao (màn thấp / phóng to): thanh cuộn mảnh, mờ */
.tgt-panel::-webkit-scrollbar { width: 4px; } .tgt-panel::-webkit-scrollbar-thumb { border-radius: 4px; background: var(--scroll-thumb); } .tgt-panel::-webkit-scrollbar-track { background: transparent; }

/* Đội nhóm › "So sánh với đội khác" (#rep-drawer kind "tcmp", ảnh mẫu 12/11/2026): chủ dự án đổi thành popup lớn GIỮA màn hình cùng cỡ chi tiết công việc (.wide-box); đầu + chân cố định, thân cuộn */
/* Rộng theo số đội (--tcmp-w do tgCmpRender đặt), cao theo nội dung: ít đội thì khít, nhiều đội tự giãn */
#rep-drawer[data-kind="tcmp"] { top: 50%; left: 50%; right: auto; bottom: auto; width: min(var(--tcmp-w, 900px), calc(100vw - 40px)); height: auto; max-height: min(860px, calc(100vh - 40px)); background: var(--surface); border-radius: var(--radius-lg); opacity: 0; transform: translate(-50%, -50%) scale(.98); transition: transform .22s ease, opacity .22s ease, visibility 0s .22s; }
body:has(#rep-drawer-toggle:checked) #rep-drawer[data-kind="tcmp"] { opacity: 1; transform: translate(-50%, -50%); transition: transform .22s ease, opacity .22s ease; }
body:has(#rep-drawer-toggle:checked) #rep-drawer-overlay:has(+ #rep-drawer[data-kind="tcmp"]) { background: rgba(15, 23, 42, .45); }
#rep-drawer[data-kind="tcmp"] .drawer-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; border: 0; }
#rep-drawer[data-kind="tcmp"] .drawer-body { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; padding: 0; overflow: hidden; }
.tcmp { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; }
/* Chủ dự án chốt: nội dung trong popup thu còn 80% (khung giữ nguyên) để vừa 1 màn không cần cuộn; điện thoại giữ cỡ gốc */
@media (min-width: 641px) { #rep-drawer[data-kind="tcmp"] .tcmp { zoom: .8; } }
.tcmp-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 22px 12px; }
.tcmp-hic { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--primary-50); color: var(--primary-600); }
.tcmp-head > div { flex: 1; min-width: 0; }
.tcmp-head h2 { margin: 1px 0 2px; font-size: 17px; font-weight: 700; color: var(--ink); }
.tcmp-head p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); }
.tcmp-x { flex: none; }
.tcmp-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 0 22px 16px; }
.tcmp-sec { margin-bottom: 14px; }
.tcmp-sec h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.tcmp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tcmp-chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; box-sizing: border-box; padding: 0 6px 0 5px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; color: var(--ink); }
.tcmp-chip b { font-weight: 600; white-space: nowrap; }
.tcmp-chip.is-pin { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); background: var(--primary-50); color: var(--primary-600); }
.tcmp-ic { width: 26px; height: 26px; border-radius: 8px; }
.tcmp-chip-x { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background-color .2s; }
.tcmp-chip-x:hover { background: var(--bg); color: var(--ink); }
.tcmp-addwrap { position: relative; }
.tcmp-add { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--border)); border-radius: 10px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--primary-600); cursor: pointer; transition: background-color .2s; }
.tcmp-add:hover:not([disabled]) { background: var(--primary-50); }
.tcmp-add[disabled] { cursor: not-allowed; opacity: .55; }
.tcmp-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 3; width: 240px; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); }
.tcmp-menu-it { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; text-align: left; color: var(--ink); cursor: pointer; transition: background-color .2s; }
.tcmp-menu-it:hover, .tcmp-menu-it:focus-visible { background: var(--bg); }
.tcmp-menu-it b { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.tcmp-menu-it small { flex: none; color: var(--ink-soft); }
.tcmp-moderow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tcmp-moderow h3 { margin: 0; }
.tcmp-modes { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tcmp-mode { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border: 1px solid transparent; border-radius: 9px; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.tcmp-mode:hover { background: var(--bg); }
.tcmp-mode.is-on { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); background: var(--primary-50); color: var(--primary-600); }
.tcmp-soon { display: grid; place-items: center; gap: 8px; padding: 48px 16px; border: 1px dashed var(--border); border-radius: 16px; background: var(--bg); color: var(--ink-soft); text-align: center; }
.tcmp-soon p { margin: 0; font-size: 13.5px; }
.tcmp-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 12px 22px 14px; border-top: 1px solid var(--border-soft); }
.tcmp-foot .tgp-pbtn { height: 40px; padding: 0 16px; }
.tcmp-close { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 20px; }
@media (max-width: 640px) {
  #rep-drawer[data-kind="tcmp"] { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
  #rep-drawer[data-kind="tcmp"] .drawer-body, .tcmp, .tcmp-body { flex: 1 1 auto; }
  .tcmp-head, .tcmp-body, .tcmp-foot { padding-left: 14px; padding-right: 14px; }
  .tcmp-foot > * { flex: 1 1 auto; justify-content: center; }
  .tcmp-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; box-sizing: border-box; }
  .tcmp-mode { justify-content: center; padding: 0 4px; white-space: nowrap; font-size: 12.5px; }
  .tcmp-mode svg { display: none; }
}
/* Theo hiệu suất (GĐ2, ảnh 627×637) */
.tcmp-row2 { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 12px; margin-bottom: 16px; }
.tcmp-card { container-type: inline-size; min-width: 0; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.tcmp-card h4, .tcmp-h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); }
.tcmp-bars { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: 190px auto; column-gap: 4px; }
.tcmp-yax { display: flex; flex-direction: column; justify-content: space-between; margin: -6px 0; font-size: 10.5px; text-align: right; color: var(--ink-soft); }
.tcmp-plot { position: relative; }
.tcmp-gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--border-soft); }
.tcmp-cols { position: absolute; inset: 0; display: grid; gap: 8px; padding: 0 4px; }
.tcmp-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.tcmp-col b { margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--ink); }
.tcmp-col i { display: block; width: min(44px, 100%); min-height: 2px; border-radius: 6px 6px 2px 2px; transition: height .2s ease; }
.tcmp-col.is-pin::before { content: ""; position: absolute; inset: -6px max(-2px, calc(50% - 36px)) -2px; border: 1.5px solid color-mix(in srgb, #3b82f6 55%, transparent); border-radius: 10px; background: color-mix(in srgb, #3b82f6 5%, transparent); pointer-events: none; }
.tcmp-xnames { grid-column: 2; display: grid; gap: 8px; padding: 6px 4px 0; }
.tcmp-xnames span { font-size: 11.5px; font-weight: 600; line-height: 1.3; text-align: center; color: var(--ink); overflow-wrap: anywhere; }
.tcmp-radarwrap { display: flex; align-items: center; gap: 4px; }
.tcmp-radar { flex: 1 1 auto; min-width: 0; width: 100%; max-width: 300px; margin: 0 auto; height: auto; overflow: visible; }
.tcmp-rg { fill: none; stroke: var(--border); stroke-width: 1; }
.tcmp-rl { font-size: 11.5px; fill: var(--ink-soft); }
.tcmp-rp polygon { fill: color-mix(in srgb, var(--c) 14%, transparent); stroke: var(--c); stroke-width: 1.6; stroke-linejoin: round; }
.tcmp-rp circle { fill: var(--c); }
.tcmp-rp.is-pin polygon { stroke-width: 2.2; fill: color-mix(in srgb, var(--c) 20%, transparent); }
.tcmp-legend { flex: none; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--ink); }
.tcmp-legend li { display: flex; align-items: center; gap: 8px; max-width: 200px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tcmp-legend i { flex: none; width: 12px; height: 12px; border-radius: 3px; }
@container (max-width: 330px) { .tcmp-radarwrap { flex-direction: column; } .tcmp-legend { grid-template-columns: repeat(2, minmax(0, auto)); gap: 6px 14px; } .tcmp-legend li { max-width: none; } }
.tcmp-tablewrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); }
.tcmp-table { width: 100%; min-width: 520px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tcmp-table th { padding: 10px 4px; border-bottom: 1px solid var(--border-soft); background: var(--bg); font-size: 12px; font-weight: 600; text-align: center; white-space: nowrap; color: var(--ink-soft); }
.tcmp-table th:nth-child(2) { text-align: left; }
.tcmp-table td { padding: 8px 4px; border-bottom: 1px solid var(--border-soft); text-align: center; color: var(--ink); }
.tcmp-table tbody tr:last-child td { border-bottom: 0; }
.tcmp-table td:nth-child(2) { text-align: left; }
.tcmp-table th:nth-child(1) { width: 22px; } .tcmp-table th:nth-child(2) { width: 24%; } .tcmp-table th:nth-child(3) { width: 12%; } .tcmp-table th:nth-child(n+4):nth-child(-n+7) { width: 9.5%; } .tcmp-table th:nth-child(8) { width: 22%; }
.tcmp-table th { white-space: normal; line-height: 1.25; font-size: 11.5px; }
.tcmp-tr { cursor: pointer; transition: background-color .2s; }
.tcmp-tr:hover { background: #f4f8fe; }
.tcmp-tr.is-pin { background: color-mix(in srgb, #3b82f6 8%, var(--surface)); }
.tcmp-tr.is-pin td { border-bottom-color: color-mix(in srgb, #3b82f6 22%, var(--border-soft)); }
.tcmp-table .tcmp-tpin { width: 22px; padding-right: 0; color: var(--primary-600); }
.tcmp-tname { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 0; border: 0; background: transparent; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.tcmp-tname b { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.tcmp-tname:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.tcmp-th-info { display: inline-flex; align-items: center; gap: 4px; }
.tcmp-info { display: inline-grid; place-items: center; color: var(--ink-soft); cursor: help; }
.tcmp-spark { display: block; width: 100%; max-width: 130px; height: auto; margin: 0 auto; overflow: visible; }
.tcmp-spark polygon { fill: color-mix(in srgb, #22c55e 14%, transparent); }
.tcmp-spark polyline { fill: none; stroke: #22c55e; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tcmp-spark circle { fill: #22c55e; }
.tcmp-insight { margin-top: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, #8b5cf6 25%, var(--border-soft)); border-radius: 14px; background: color-mix(in srgb, #8b5cf6 6%, var(--surface)); }
.tcmp-insight h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: #6d28d9; }
.tcmp-insight p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink); }
/* Theo khối lượng (GĐ3, ảnh 2) */
.tcmp-row2.is-vol { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.tcmp-card { position: relative; display: flex; flex-direction: column; }
.tcmp-card > .tcmp-bars, .tcmp-card > .tcmp-unit { margin-top: auto; } /* biểu đồ cột dồn xuống đáy thẻ khi thẻ bên cạnh cao hơn */
.tcmp-unit { display: block; margin: -6px 0 6px; font-size: 11px; color: var(--ink-soft); }
.tcmp-volwrap { display: flex; align-items: center; gap: 14px; }
.tcmp-volwrap .tcmp-bars { flex: 1 1 auto; min-width: 0; }
.tcmp-bars.is-vol { grid-template-rows: 170px auto; }
.tcmp-stack { display: flex; flex-direction: column; width: min(48px, 100%); min-height: 2px; overflow: hidden; border-radius: 0; transition: height .2s ease; }
.tcmp-col .tcmp-stack i { display: block; width: 100%; min-height: 2px; border-radius: 0; transition: none; } /* không ăn bo góc của cột đúng hạn (.tcmp-col i) */
.tcmp-donutwrap { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 196px; }
.tcmp-donut { position: relative; flex: none; width: 164px; height: 164px; }
.tcmp-donut svg { width: 100%; height: 100%; }
.tcmp-arc-bg { fill: none; stroke: var(--bg); stroke-width: 22; }
.tcmp-arc { fill: none; stroke-width: 22; transition: stroke-width .2s ease; }
.tcmp-arc:hover { stroke-width: 26; }
.tcmp-donut > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.tcmp-donut b { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--ink); }
.tcmp-donut small { font-size: 12px; color: var(--ink-soft); }
.tcmp-legend.is-pct { flex: 1 1 auto; min-width: 0; max-width: 240px; gap: 12px; }
.tcmp-legend.is-pct li { max-width: none; }
.tcmp-legend.is-pct span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tcmp-legend.is-pct b { margin-left: auto; padding-left: 14px; font-weight: 700; }
.tcmp-table.is-vol th:nth-child(2) { width: 24%; } .tcmp-table.is-vol th:nth-child(3) { width: 10%; } .tcmp-table.is-vol th:nth-child(n+4):nth-child(-n+7) { width: 10%; } .tcmp-table.is-vol th:nth-child(8) { width: 22%; }
.tcmp-table .tg-dot.is-gray { background: var(--bg); color: var(--ink-soft); }
.tcmp-rate { display: flex; align-items: center; gap: 8px; padding: 0 6px; }
.tcmp-rate b { flex: none; width: 34px; text-align: right; font-weight: 700; }
.tcmp-rate-bar { flex: 1; height: 8px; overflow: hidden; border-radius: 99px; background: var(--bg); }
.tcmp-rate-bar i { display: block; height: 100%; border-radius: inherit; background: #4ade80; }
.tcmp-note { margin: 10px 2px 0; font-size: 12px; color: var(--ink-soft); }
@container (max-width: 360px) { .tcmp-volwrap { flex-direction: column; align-items: stretch; } .tcmp-volwrap .tcmp-legend { grid-template-columns: repeat(4, auto); justify-content: center; } }
@container (max-width: 330px) { .tcmp-donutwrap { flex-direction: column; } }
@media (max-width: 640px) { .tcmp-row2.is-vol { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .tcmp-stack, .tcmp-arc { transition: none; } }
/* Theo thời gian (GĐ4, ảnh 12/11) */
.tcmp-body.is-loading .tcmp-view, .tcmp-body.is-loading .tcmp-period ~ * { opacity: .5; pointer-events: none; transition: opacity .2s; }
.tcmp-period { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 14px; }
.tcmp-period h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.tcmp-range { background: var(--surface); }
.tcmp-modes.is-span .tcmp-mode { padding: 0 18px; }
.tcmp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.tcmp-kpi { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border: 1px solid var(--tk-b); border-radius: 14px; background: var(--tk-bg); }
.tcmp-kpi-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--tk) 13%, var(--surface)); color: var(--tk); } /* nền icon đậm hơn nền thẻ 1 chút */
.tcmp-kpi b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--tk); }
.tcmp-kpi small { font-size: 12.5px; color: var(--ink-soft); }
.tcmp-kpi.is-blue { --tk: #1d4ed8; --tk-bg: color-mix(in srgb, #3b82f6 7%, var(--surface)); --tk-b: color-mix(in srgb, #3b82f6 22%, var(--border-soft)); }
.tcmp-kpi.is-green { --tk: #15803d; --tk-bg: color-mix(in srgb, #22c55e 8%, var(--surface)); --tk-b: color-mix(in srgb, #22c55e 24%, var(--border-soft)); }
.tcmp-kpi.is-violet { --tk: #6d28d9; --tk-bg: color-mix(in srgb, #8b5cf6 7%, var(--surface)); --tk-b: color-mix(in srgb, #8b5cf6 22%, var(--border-soft)); }
.tcmp-kpi.is-red { --tk: #be123c; --tk-bg: color-mix(in srgb, #f43f5e 7%, var(--surface)); --tk-b: color-mix(in srgb, #f43f5e 22%, var(--border-soft)); }
.tcmp-row2.is-time { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.tcmp-line { display: block; width: 100%; height: auto; overflow: visible; }
.tcmp-lgl { stroke: var(--border-soft); stroke-dasharray: 3 3; }
.tcmp-lax { font-size: 10.5px; fill: var(--ink-soft); }
.tcmp-lser polyline { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tcmp-lser polygon { fill: color-mix(in srgb, var(--c) 12%, transparent); }
.tcmp-lser circle { fill: var(--surface); stroke: var(--c); stroke-width: 1.6; }
.tcmp-lser.is-pin polyline { stroke-width: 2.6; }
.tcmp-legend.is-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 6px; }
.tcmp-legend.is-row i { width: 10px; height: 10px; border-radius: 50%; }
.tcmp-hbars { display: grid; gap: 16px; max-height: 226px; overflow-y: auto; margin: 4px 0 0; padding: 0 6px 0 0; list-style: none; scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; } /* hiện tối đa 5 đội, nhiều hơn thì cuộn mảnh */
.tcmp-hbars::-webkit-scrollbar { width: 6px; } .tcmp-hbars::-webkit-scrollbar-thumb { border-radius: 99px; background: var(--scroll-thumb); }
.tcmp-hbars li > span:first-child { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.tcmp-hbars b { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); }
.tcmp-hbars em { flex: none; font-style: normal; font-weight: 700; color: var(--ink); }
.tcmp-hbar { display: block; height: 10px; overflow: hidden; border-radius: 99px; background: var(--bg); }
.tcmp-hbar i { display: block; height: 100%; border-radius: inherit; transition: width .2s ease; }
.tcmp-table.is-time th:nth-child(2) { width: 30%; } .tcmp-table.is-time th:nth-child(n+3):nth-child(-n+5) { width: 14%; } .tcmp-table.is-time th:nth-child(6) { width: 20%; }
@media (max-width: 640px) { .tcmp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tcmp-row2.is-time { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .tcmp-hbar i, .tcmp-body.is-loading .tcmp-view { transition: none; } }
@media (max-width: 640px) { .tcmp-row2 { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .tcmp-col i, .tcmp-tr { transition: none; } }
@media (prefers-reduced-motion: reduce) { .tcmp-chip-x, .tcmp-add, .tcmp-menu-it, .tcmp-mode { transition: none; } }
/* So sánh với đội khác: chữ to thêm ~1px (chủ dự án yêu cầu 12/11), giữ zoom .8 để popup không phải cuộn */
.tcmp-head h2 { font-size: 18px; } .tcmp-head p { font-size: 13.5px; }
.tcmp-sec h3, .tcmp-period h3, .tcmp-card h4, .tcmp-h3 { font-size: 15px; }
.tcmp-chip, .tcmp-add, .tcmp-mode { font-size: 14px; }
.tcmp-table { font-size: 14px; } .tcmp-table th { font-size: 12.5px; }
.tcmp-table .tg-dot { font-size: 13.5px; }
.tcmp-col b { font-size: 14px; } .tcmp-xnames span { font-size: 12.5px; } .tcmp-yax { font-size: 11.5px; }
.tcmp-rl { font-size: 12.5px; } .tcmp-lax { font-size: 11.5px; }
.tcmp-legend { font-size: 13px; }
.tcmp-unit { font-size: 12px; }
.tcmp-donut small { font-size: 13px; }
.tcmp-kpi small { font-size: 13.5px; } .tcmp-kpi b { font-size: 26px; }
.tcmp-hbars li > span:first-child { font-size: 13.5px; }
.tcmp-insight h4 { font-size: 15px; } .tcmp-insight p { font-size: 14px; }
.tcmp-note { font-size: 13px; }
.tcmp-foot .tgp-pbtn, .tcmp-close { font-size: 14.5px; }

/* Đội nhóm › Hiệu suất: trang danh sách lớn của 4 ô số (reports.js tgl*, ảnh mẫu 12/11/2026) */
.tgl { --tl: #4f46e5; --tl-bg: color-mix(in srgb, #6366f1 9%, var(--surface)); --tl-b: color-mix(in srgb, #6366f1 22%, var(--border-soft)); display: flex; flex-direction: column; gap: 14px; }
.tgl-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.tgl-back { flex: none; border: 1px solid var(--border); background: var(--surface); }
.tgl-hic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--tl-bg); color: var(--tl); }
.tgl-hic.is-violet, .tgl-hero.is-violet { --tl: #4f46e5; --tl-bg: color-mix(in srgb, #6366f1 10%, var(--surface)); --tl-b: color-mix(in srgb, #6366f1 22%, var(--border-soft)); }
.tgl-htxt { flex: 1 1 260px; min-width: 0; }
.tgl-htxt h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); }
.tgl-htxt h1 small { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.tgl-htxt p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.tgl-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tgl-range { background: var(--surface); }
.tgl-hero { position: relative; display: flex; align-items: center; gap: 18px; min-height: 108px; padding: 18px 260px 18px 24px; overflow: hidden; border: 1px solid var(--tl-b); border-radius: 18px; background: linear-gradient(100deg, var(--tl-bg), color-mix(in srgb, var(--tl-bg) 40%, var(--surface))); }
.tgl-hero-ic { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 18px; background: var(--surface); color: var(--tl); box-shadow: 0 6px 18px color-mix(in srgb, var(--tl) 14%, transparent); }
.tgl-hero-txt h2 { margin: 0; font-size: 24px; font-weight: 800; color: var(--tl); }
.tgl-hero-txt p { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.tgl-art { position: absolute; top: 6px; bottom: 6px; right: 28px; width: 220px; background: no-repeat center / contain; pointer-events: none; } /* co theo chiều cao băng, không bị cắt */
.tgl-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tgl-kpi { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; border: 1px solid var(--tk-b); border-radius: 14px; background: var(--tk-bg); }
.tgl-kpi-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--tk) 13%, var(--surface)); color: var(--tk); }
.tgl-kpi b { display: block; font-size: 22px; font-weight: 800; line-height: 1.15; color: var(--tk); }
.tgl-kpi small { font-size: 13px; color: var(--ink-soft); }
.tgl-kpi.is-blue { --tk: #1d4ed8; --tk-bg: color-mix(in srgb, #3b82f6 6%, var(--surface)); --tk-b: color-mix(in srgb, #3b82f6 20%, var(--border-soft)); }
.tgl-kpi.is-green { --tk: #15803d; --tk-bg: color-mix(in srgb, #22c55e 7%, var(--surface)); --tk-b: color-mix(in srgb, #22c55e 22%, var(--border-soft)); }
.tgl-kpi.is-sky { --tk: #0369a1; --tk-bg: color-mix(in srgb, #0ea5e9 6%, var(--surface)); --tk-b: color-mix(in srgb, #0ea5e9 20%, var(--border-soft)); }
.tgl-kpi.is-violet { --tk: #6d28d9; --tk-bg: color-mix(in srgb, #8b5cf6 6%, var(--surface)); --tk-b: color-mix(in srgb, #8b5cf6 20%, var(--border-soft)); }
.tgl-kpi.is-red { --tk: #be123c; --tk-bg: color-mix(in srgb, #f43f5e 6%, var(--surface)); --tk-b: color-mix(in srgb, #f43f5e 20%, var(--border-soft)); }
.tgl-kpi.is-orange { --tk: #c2410c; --tk-bg: color-mix(in srgb, #f97316 6%, var(--surface)); --tk-b: color-mix(in srgb, #f97316 20%, var(--border-soft)); }
.tgl-card { padding: 6px 0 0; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.tgl-tablewrap { overflow-x: auto; }
.tgl-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tgl-table th { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; font-weight: 600; text-align: left; white-space: nowrap; color: var(--ink-soft); }
.tgl-table td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); color: var(--ink); vertical-align: middle; }
.tgl-table tbody tr { transition: background-color .2s; }
.tgl-table tbody tr:hover { background: #f4f8fe; }
.tgl-table .tgl-mark { width: 28px; padding-right: 0; }
.tgl-mark.is-done { color: #16a34a; }
.tgl-name { padding: 0; border: 0; background: transparent; font: inherit; font-weight: 600; text-align: left; color: var(--ink); cursor: pointer; }
.tgl-name:hover { color: var(--primary-600); }
.tgl-name small { font-weight: 500; color: var(--ink-soft); }
.tgl-proj { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.tgl-proj i { flex: none; width: 7px; height: 7px; border-radius: 50%; }
.tgl-avs { display: inline-flex; align-items: center; }
.tgl-avs .tgl-av { width: 26px; height: 26px; margin-right: -6px; border: 2px solid var(--surface); font-size: 11px; }
.tgl-more { display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin-left: 8px; padding: 0 4px; border-radius: 99px; background: var(--bg); font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.tgl-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 14px; font-size: 13px; color: var(--ink-soft); }
.tgl-pager { display: flex; align-items: center; gap: 6px; }
.tgl-pg { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background-color .2s, border-color .2s; }
.tgl-pg:hover:not([disabled]):not(.is-on) { background: var(--bg); }
.tgl-pg.is-on { border-color: #3b82f6; background: #3b82f6; color: #fff; }
.tgl-pg[disabled] { cursor: not-allowed; opacity: .45; }
.tgl-gap { padding: 0 2px; color: var(--ink-soft); }
@media (max-width: 1100px) { .tgl-art { width: 160px; } .tgl-hero { padding-right: 180px; } }
@media (max-width: 760px) { .tgl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tgl-art { display: none; } .tgl-hero { padding-right: 18px; } }
@media (prefers-reduced-motion: reduce) { .tgl-table tbody tr, .tgl-pg { transition: none; } }
.tgl-span .tcmp-mode { height: 30px; padding: 0 14px; font-size: 13px; }
@media (max-width: 640px) { .tgl-hero-txt h2 { font-size: 19px; } .tgl-hero-ic { width: 52px; height: 52px; border-radius: 14px; } .tgl-htxt h1 { font-size: 19px; } }
/* Góp ý 12/11: băng không viền, ô icon nền tông nhạt (đậm hơn nền băng chút), chữ nhẹ hơn; trang Hoàn thành = xanh dương */
.tgl-hic.is-blue, .tgl-hero.is-blue { --tl: #2563eb; --tl-bg: color-mix(in srgb, #3b82f6 8%, var(--surface)); --tl-b: color-mix(in srgb, #3b82f6 20%, var(--border-soft)); }
.tgl-hero { border: 0; }
.tgl-hero-ic { width: 60px; height: 60px; border-radius: 16px; background: color-mix(in srgb, var(--tl) 14%, var(--surface)); box-shadow: none; }
.tgl-hero-txt h2 { font-size: 21px; font-weight: 600; }
.tgl-hero-txt p { font-size: 13.5px; }
.tgl-kpi-ic { background: color-mix(in srgb, var(--tk) 11%, var(--surface)); }
.tgl-kpi b { font-weight: 600; }
/* Nền icon pha từ màu TƯƠI của tông (không pha từ màu chữ đậm -> bị xám xỉn), chủ dự án góp ý 12/11 */
.tgl-kpi.is-blue { --tk-h: #3b82f6; } .tgl-kpi.is-green { --tk-h: #22c55e; } .tgl-kpi.is-sky { --tk-h: #0ea5e9; }
.tgl-kpi.is-violet { --tk-h: #8b5cf6; } .tgl-kpi.is-red { --tk-h: #f43f5e; } .tgl-kpi.is-orange { --tk-h: #f97316; }
.tgl-kpi-ic { background: color-mix(in srgb, var(--tk-h, #3b82f6) 16%, var(--surface)); }
.tgl-hic.is-blue, .tgl-hero.is-blue { --tl-h: #3b82f6; } .tgl-hic.is-violet, .tgl-hero.is-violet { --tl-h: #8b5cf6; }
.tgl-hic.is-red, .tgl-hero.is-red { --tl-h: #f43f5e; } .tgl-hic.is-green, .tgl-hero.is-green { --tl-h: #22c55e; }
.tgl-hic, .tgl-hero-ic { background: color-mix(in srgb, var(--tl-h, #3b82f6) 16%, var(--surface)); }
/* GĐ2: Việc quá hạn (hồng đỏ) + Việc chờ duyệt (tím) */
.tgl-hic.is-red, .tgl-hero.is-red { --tl: #e11d48; --tl-bg: color-mix(in srgb, #f43f5e 8%, var(--surface)); --tl-b: color-mix(in srgb, #f43f5e 20%, var(--border-soft)); }
.tgl-hic.is-violet, .tgl-hero.is-violet { --tl: #7c3aed; --tl-bg: color-mix(in srgb, #8b5cf6 8%, var(--surface)); --tl-b: color-mix(in srgb, #8b5cf6 20%, var(--border-soft)); }
.tgl-mark.is-overdue { color: #e11d48; }
.tgl-mark.is-review { color: #7c3aed; }
.tgl-late { font-size: 13.5px; font-weight: 600; white-space: nowrap; color: #e11d48; }
.tgl-table .priority-pill { white-space: nowrap; }
/* Trang Quá hạn / Chờ duyệt: ô tick + thanh Nhắc phía trên bảng */
.tgl-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 6px 14px 10px; font-size: 13px; color: var(--ink-soft); }
.tgl-bar > span { flex: 1; min-width: 0; }
.tgl-bar.is-sel b { color: var(--ink); font-weight: 600; }
.tgl-bar .tgl-remind { margin-left: auto; height: 34px; }
.tgl-chk { width: 16px; height: 16px; margin: 0; accent-color: #3b82f6; cursor: pointer; }
.tgl-table tbody tr.is-sel { background: color-mix(in srgb, #3b82f6 6%, var(--surface)); }
.tgl-art { opacity: .68; } /* chủ dự án chốt 12/11: hình băng mờ nhẹ để chữ nổi */
/* GĐ3: Việc đúng hạn (xanh lá) + nút phễu lọc + hàng lọc */
.tgl-hic.is-green, .tgl-hero.is-green { --tl: #16a34a; --tl-bg: color-mix(in srgb, #22c55e 8%, var(--surface)); --tl-b: color-mix(in srgb, #22c55e 20%, var(--border-soft)); }
.tgl-mark.is-ontime { color: #16a34a; }
.tgl-due { white-space: nowrap; }
.tgl-left { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.tgl-left.is-soon { color: #c2410c; font-weight: 600; }
.tgl-fbtn { position: relative; border: 1px solid var(--border); background: var(--surface); }
.tgl-fbtn.is-on { border-color: color-mix(in srgb, #3b82f6 50%, var(--border)); background: color-mix(in srgb, #3b82f6 8%, var(--surface)); color: #2563eb; }
.tgl-fbadge { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: #3b82f6; font-size: 11px; font-weight: 700; color: #fff; }
.tgl-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 14px; width: 100%; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); }
.tgl-filters label { display: flex; flex-direction: column; gap: 4px; min-width: 180px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.tgl-filters .form-control { height: 36px; font-size: 13.5px; }
@media (max-width: 640px) { .tgl-filters label { flex: 1 1 100%; min-width: 0; } }
/* Điện thoại: mỗi dòng thành 1 thẻ gọn (tên việc trên cùng, các ô còn lại xếp hàng dưới), không cuộn ngang */
@media (max-width: 640px) {
  .tgl-table { min-width: 0; }
  .tgl-table thead { display: none; }
  .tgl-table tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
  .tgl-table tbody td { padding: 0; border: 0; }
  .tgl-table tbody td.tgl-mark { width: auto; }
  .tgl-table tbody td:nth-child(2) { flex: 1 1 calc(100% - 40px); min-width: 0; }
  .tgl-table tbody td:nth-child(n+3) { font-size: 13px; }
  .tgl-tools { width: 100%; }
}
/* Icon 3D của chủ dự án (ic-*.png) trong ô bên trái băng — thay icon nét */
.tgl-hero-ic img { display: block; width: 36px; height: 36px; object-fit: contain; opacity: .68; }
/* Băng 1 hàng có chip (ảnh mẫu 12/11): hình minh họa bên trái cạnh chữ, 4 ô số thành chip trong băng */
.tgl-hero { display: flex; align-items: center; gap: 18px; min-height: 0; padding: 14px 18px; }
.tgl-hero-main { display: flex; align-items: center; gap: 14px; flex: 0 1 auto; min-width: 250px; }
.tgl-art { position: static; display: block; flex: none; width: 88px; height: 70px; transform: none; }
.tgl-hero-txt h2 { font-size: 18px; font-weight: 600; color: var(--ink); }
.tgl-hero-n { margin-right: 2px; font-size: 26px; font-weight: 700; line-height: 1; color: var(--tl); }
.tgl-hero-txt p { margin-top: 3px; font-size: 12.5px; }
.tgl-hero-sep { flex: none; align-self: stretch; width: 1px; margin: 4px 0; background: var(--tl-b); }
.tgl-hero .tgl-kpis { flex: 1 1 auto; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.tgl-hero .tgl-kpi { gap: 10px; padding: 8px 10px; border-color: color-mix(in srgb, var(--tk-h, #3b82f6) 16%, transparent); background: color-mix(in srgb, var(--surface) 72%, transparent); }
.tgl-hero .tgl-kpi-ic { width: 34px; height: 34px; border-radius: 10px; }
.tgl-hero .tgl-kpi b { font-size: 18px; }
.tgl-hero .tgl-kpi small { display: block; overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 1200px) { .tgl-hero { flex-wrap: wrap; } .tgl-hero-sep { display: none; } .tgl-hero .tgl-kpis { flex: 1 1 100%; } }
@media (max-width: 640px) { .tgl-hero .tgl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tgl-art { width: 64px; height: 52px; } .tgl-hero-main { min-width: 0; } }
.tgl-hero .tgl-kpi { padding: 8px 9px; gap: 8px; }
.tgl-hero .tgl-kpi-ic { width: 30px; height: 30px; border-radius: 9px; }
.tgl-hero .tgl-kpi > span:last-child { min-width: 0; }
.tgl-hero .tgl-kpi small { display: -webkit-box; line-height: 1.25; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } /* nhãn dài xuống 2 dòng, không cắt chữ */
.tgl-hero-main { flex: 0 1 370px; } /* đủ cho tiêu đề 1 dòng; chip chia phần còn lại */
/* Chủ dự án chốt 12/11: băng chia đôi 5 / 5 — trái hình + tiêu đề, phải 4 chip */
.tgl-hero-main, .tgl-hero .tgl-kpis { flex: 1 1 0; min-width: 0; }
@media (max-width: 1200px) { .tgl-hero-main, .tgl-hero .tgl-kpis { flex: 1 1 100%; } }
/* Nửa phải hẹp (laptop) thì 4 chip xếp 2×2 để nhãn đọc đủ; màn rộng vẫn 4 chip 1 hàng */
.tgl-hero { container-type: inline-size; }
@container (max-width: 1150px) { .tgl-hero .tgl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .tgl-hero .tgl-kpi small { -webkit-line-clamp: 1; } }
/* Chủ dự án chốt 12/11: băng chia 3 / 7 (trái hình + tiêu đề, phải 4 chip); chip chỉ xếp 2×2 khi băng rất hẹp */
.tgl-hero-main { flex: 3 1 0; }
.tgl-hero .tgl-kpis { flex: 7 1 0; }
@container (max-width: 1150px) { .tgl-hero .tgl-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tgl-hero .tgl-kpi small { -webkit-line-clamp: 2; } }
@container (max-width: 860px) { .tgl-hero .tgl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .tgl-hero-main, .tgl-hero .tgl-kpis { flex: 1 1 100%; } }
/* Chủ dự án chốt 12/11: băng chia 4 / 6 */
.tgl-hero-main { flex: 4 1 0; }
.tgl-hero .tgl-kpis { flex: 6 1 0; }
@media (max-width: 1200px) { .tgl-hero-main, .tgl-hero .tgl-kpis { flex: 1 1 100%; } }
/* Chủ dự án chốt 12/11: băng đệm 14px đều, khoảng cách 15px */
.tgl-hero { gap: 15px; padding: 14px; }
.tgl-hero .tgl-kpis { gap: 15px; }

/* Trang Kỹ năng AI làm lại theo ảnh mẫu 12/11/2026 (ai.js renderSkillsPage / skCardHTML) */
.skp-head { align-items: flex-start; }
.skp-head h1 { margin: 0; }
.skp-head-text p { margin: 4px 0 0; font-size: 14.5px; color: var(--ink-soft); }
.skp-count { display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border-radius: 12px; background: color-mix(in srgb, #64748b 9%, var(--surface)); font-size: 14px; font-weight: 600; color: var(--ink); }
.skp-new { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; }
.skp-hero { display: flex; align-items: center; gap: 22px; margin: 14px 0 16px; padding: 14px 26px 14px 18px; border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border-soft)); border-radius: 18px; background: linear-gradient(100deg, color-mix(in srgb, #38bdf8 9%, var(--surface)), color-mix(in srgb, #60a5fa 6%, var(--surface))); } /* 17/11/2026: tím -> xanh nhẹ theo chủ dự án */
.skp-hero-img { flex: none; width: 160px; height: 116px; object-fit: contain; }
.skp-hero-txt { flex: 1 1 0; min-width: 0; }
.skp-hero-txt h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--ink); }
.skp-hero-txt p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.skp-hero-sep { flex: none; align-self: stretch; width: 1px; margin: 8px 0; background: color-mix(in srgb, var(--primary) 20%, var(--border-soft)); }
.skp-hero-list { display: grid; gap: 12px; flex: 0 0 auto; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink); }
.skp-hero-list li { display: flex; align-items: center; gap: 10px; }
.skp-hero-ok { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 7px; background: color-mix(in srgb, #22c55e 18%, var(--surface)); color: #16a34a; }
.skp-toolbar { margin: 4px 0 16px; }
.skp-toolbar .skp-chip-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, #64748b 12%, var(--surface)); font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.skp-toolbar .mp-tab.is-on .skp-chip-n { background: var(--surface); color: var(--primary-600); }
.skp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.skp-card { gap: 14px; padding: 18px 20px; border-color: var(--border-soft); border-radius: 18px; }
.skp-card-top { display: flex; align-items: flex-start; gap: 14px; }
.skp-card-top .auto-switch { flex: none; margin-top: 4px; }
.skp-ico { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 16px; background: color-mix(in srgb, var(--sk) 13%, var(--surface)); color: var(--sk); }
.skp-ico.is-blue { --sk: #3b82f6; } .skp-ico.is-violet { --sk: #8b5cf6; } .skp-ico.is-orange { --sk: #f59e0b; } .skp-ico.is-green { --sk: #22c55e; } .skp-ico.is-sky { --sk: #0ea5e9; }
.skp-card-txt { flex: 1 1 0; min-width: 0; }
.skp-card-txt h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 6px; font-size: 17px; font-weight: 700; color: var(--ink); }
.skp-card .skp-desc { display: -webkit-box; margin: 0; overflow: hidden; font-size: 14px; line-height: 1.55; color: var(--ink-soft); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.skp-card .skp-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: auto; }
.skp-card .skp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: color-mix(in srgb, #64748b 7%, var(--surface)); font-size: 13.5px; color: var(--ink-soft); }
.skp-card .skp-pill b { font-weight: 600; color: var(--ink); }
.skp-offtag { padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, #64748b 12%, var(--surface)); font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.skp-used { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13.5px; color: var(--ink-soft); }
.skp-used svg { color: #8b5cf6; }
.skp-used b { font-weight: 700; color: var(--ink); }
.skp-card .skp-card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.skp-card .skp-use { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 22px; }
.skp-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background-color .2s, border-color .2s; }
.skp-btn:hover { background: var(--bg); }
.skp-btn.is-icon { justify-content: center; width: 42px; padding: 0; }
@media (max-width: 1100px) { .skp-hero-sep, .skp-hero-list { display: none; } }
@media (max-width: 900px) { .skp-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .skp-hero { flex-direction: column; align-items: flex-start; padding: 14px; } .skp-hero-img { width: 120px; height: 88px; } .skp-card .skp-use, .skp-btn { height: 38px; } }
@media (prefers-reduced-motion: reduce) { .skp-btn { transition: none; } }
.skp-toolbar.tmg-tools .search-field { flex: 0 1 280px; }
.skp-toolbar .tmg-sel { flex: 0 0 auto; }
.skp-card .skp-card-foot { justify-content: flex-start; padding-top: 0; border-top: 0; }
.skp-card .skp-card-foot .skp-use { margin-left: 0; }
/* Góp ý 12/11: băng — vạch ngắn + mờ, ảnh 0.68, chữ giữa / lợi ích phải = 6 / 4 */
.skp-hero-img { opacity: .68; }
.skp-hero-txt { flex: 6 1 0; }
.skp-hero-list { flex: 4 1 0; min-width: 0; }
.skp-hero-sep { margin: 26px 0; background: color-mix(in srgb, var(--primary) 14%, transparent); }
/* Thẻ: nền chuyển từ màu nhạt của icon sang trắng; icon Font Awesome bản viền */
.skp-card.is-blue { --sk: #3b82f6; } .skp-card.is-violet { --sk: #8b5cf6; } .skp-card.is-orange { --sk: #f59e0b; } .skp-card.is-green { --sk: #22c55e; } .skp-card.is-sky { --sk: #0ea5e9; }
.skp-card { border-color: color-mix(in srgb, var(--sk, #3b82f6) 14%, var(--border-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--sk, #3b82f6) 8%, var(--surface)) 0%, var(--surface) 58%); }
.skp-card .skp-ico { background: color-mix(in srgb, var(--sk, #3b82f6) 14%, var(--surface)); color: var(--sk, #3b82f6); }
.skp-card .skp-ico i { font-size: 24px; }
.skp-card .skp-pill i, .skp-used i { font-size: 14px; }
.skp-used i { color: #8b5cf6; }
.skp-card .skp-use i, .skp-btn i { font-size: 15px; }
.skp-dots { font-size: 20px; line-height: 1; letter-spacing: -1px; }
.skp-tpl-ico i { font-size: 16px; }
/* Góp ý 12/11 (2): nền thẻ tông nhạt 6% → trắng 38% → 100%; ô Phạm vi chữ mảnh, nền đậm hơn nền thẻ chút; mẫu mỗi loại 1 màu */
.skp-card.is-rose, .skp-tpl-card.is-rose { --sk: #f43f5e; }
.skp-tpl-card.is-blue { --sk: #3b82f6; } .skp-tpl-card.is-orange { --sk: #f59e0b; } .skp-tpl-card.is-green { --sk: #22c55e; } .skp-tpl-card.is-violet { --sk: #8b5cf6; }
.skp-card { background: linear-gradient(135deg, color-mix(in srgb, var(--sk, #3b82f6) 9%, var(--surface)) 6%, var(--surface) 38%, var(--surface) 100%); }
.skp-card .skp-pill { background: color-mix(in srgb, var(--sk, #64748b) 6%, var(--surface)); }
.skp-card .skp-pill b { font-weight: 400; color: var(--ink-soft); }
.skp-tpl-card[class*=" is-"] { border-color: color-mix(in srgb, var(--sk) 30%, var(--border-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--sk) 7%, var(--surface)) 6%, var(--surface) 60%); }
.skp-tpl-card[class*=" is-"] .skp-tpl-ico { background: color-mix(in srgb, var(--sk) 14%, var(--surface)); color: var(--sk); }
.skp-tpl-card[class*=" is-"]:hover:not([disabled]) { border-color: color-mix(in srgb, var(--sk) 55%, var(--border-soft)); }
.skp-card .skp-pill { font-weight: 400; }

/* Hộp Tạo / sửa kỹ năng AI theo ảnh mẫu 12/11/2026 (ai.js renderAiSkillsModal khi aiSkillEdit) */
.ai-skills-box .mhx-acts { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ai-skills-box .mhx-acts:empty { display: none; }
.ai-skills-box .mhx-acts .btn-primary { display: inline-flex; align-items: center; gap: 6px; }
.ai-skills-box.is-form .mhx-head > label.icon-btn { display: none; } /* đang soạn: Hủy thay nút đóng (như ảnh mẫu) */
.ai-skills-box.is-form .ais-form-foot { display: none; }
.ais-form { display: flex; flex-direction: column; gap: 12px; }
.ais-card { padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.ais-card-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.ais-card .ais-row + .ais-row { margin-top: 12px; }
.ais-fic { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, #3b82f6 10%, var(--surface)); color: #2563eb; }
.ais-fic i { font-size: 16px; }
.ais-radios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ais-radio { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.ais-radio input { margin-top: 3px; accent-color: #3b82f6; }
.ais-radio > span { display: flex; flex-direction: column; min-width: 0; }
.ais-radio b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ais-radio small { font-size: 12px; color: var(--ink-soft); }
.ais-status { display: flex; align-items: center; gap: 12px; }
.ais-status > div { flex: 1; min-width: 0; }
.ais-status b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.ais-status small { font-size: 12.5px; color: var(--ink-soft); }
.ais-status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, #22c55e 12%, var(--surface)); font-size: 12.5px; font-weight: 600; color: #15803d; }
.ais-status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ais-status-pill.is-off { background: color-mix(in srgb, #64748b 10%, var(--surface)); color: var(--ink-soft); }
.ais-adv { display: flex; align-items: center; gap: 12px; width: 100%; font: inherit; text-align: left; cursor: pointer; transition: border-color .2s; }
.ais-adv:hover { border-color: color-mix(in srgb, #3b82f6 35%, var(--border-soft)); }
.ais-adv-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ais-adv-txt b { font-size: 14px; color: var(--ink); }
.ais-adv-txt small { font-size: 12.5px; color: var(--ink-soft); }
.ais-adv-chev { color: var(--ink-soft); }
.ais-adv-soon { margin: -4px 0 0; padding: 10px 14px; border: 1px dashed var(--border); border-radius: 12px; background: var(--bg); font-size: 13px; color: var(--ink-soft); }
.ais-side { display: flex; flex-direction: column; gap: 12px; }
.ais-guide { position: relative; padding: 14px 16px; border: 1px solid color-mix(in srgb, #8b5cf6 18%, var(--border-soft)); border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, #8b5cf6 9%, var(--surface)) 6%, var(--surface) 70%); }
.ais-guide-bot { position: absolute; top: 10px; right: 12px; width: 64px; height: 64px; object-fit: contain; opacity: .9; }
.ais-guide .ais-side-title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; padding-right: 70px; font-size: 16px; }
.ais-guide > p { margin: 0 0 12px; padding-right: 70px; font-size: 12.5px; color: var(--ink-soft); }
.ais-guide-card { padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.ais-guide-card > b { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; color: var(--ink); }
.ais-guide-card > b i { color: #8b5cf6; }
.ais-guide-card ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ais-guide-card li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--ink); }
.ais-guide-card li.is-empty, .ais-guide-card li.is-more { color: var(--ink-soft); }
.ais-step-n { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px; background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); font-size: 11.5px; font-weight: 700; color: #7c3aed; }
.ais-try { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; font-size: 15px; }
.ais-try-note { display: flex; gap: 6px; margin: -4px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.ais-try-note i { margin-top: 2px; }
.ais-warn { padding: 12px 14px; border: 1px solid color-mix(in srgb, #f59e0b 28%, var(--border-soft)); border-radius: 14px; background: color-mix(in srgb, #f59e0b 7%, var(--surface)); }
.ais-warn h5 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14.5px; font-weight: 700; color: #b45309; }
.ais-warn ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ais-warn li { display: flex; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--ink); }
.ais-warn li i { margin-top: 2px; color: #d97706; }
@media (max-width: 760px) { .ais-radios { grid-template-columns: minmax(0, 1fr); } .ai-skills-box .mhx-acts { margin-left: 0; width: 100%; justify-content: flex-end; } }
@media (prefers-reduced-motion: reduce) { .ais-adv { transition: none; } }
.ais-form .ais-radios > :first-child { grid-column: auto; } /* 3 lựa chọn cùng 1 hàng (kiểu cũ cho dòng đầu chiếm cả hàng) */
.ais-form .ais-radio input { margin-top: 3px; }
@media (max-width: 760px) { .ais-form .ais-radios { grid-template-columns: minmax(0, 1fr); } }
.ais-adv-chev { display: grid; place-items: center; flex: none; width: 28px; height: 28px; transition: transform .2s ease; }
.ais-adv-chev svg { display: block; }
.ais-adv-chev.is-open { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .ais-adv-chev { transition: none; } }
/* Góp ý 12/11 (GĐ2): rê thẻ theo màu thẻ; khung bước nền tím nhạt; đầu hộp soạn gọn; radio tâm trắng; Xem hướng dẫn / Lưu ý chữ nhỏ hơn */
.skp-card:hover { border-color: color-mix(in srgb, var(--sk, #3b82f6) 40%, var(--border-soft)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--sk, #3b82f6) 22%, transparent), 0 8px 22px color-mix(in srgb, var(--sk, #3b82f6) 12%, transparent); }
.skp-tpl-card[class*=" is-"]:hover:not([disabled]) { box-shadow: 0 6px 18px color-mix(in srgb, var(--sk) 12%, transparent); }
.ais-guide-card { border-color: color-mix(in srgb, #8b5cf6 16%, var(--border-soft)); background: color-mix(in srgb, #8b5cf6 6%, var(--surface)); }
.ais-step-n { background: var(--surface); }
.ai-skills-box.is-form .mhx-head { gap: 14px; padding: 25px; }
.ai-skills-box.is-form .mhx-ico { width: 46px; height: 46px; border-radius: 14px; }
.ai-skills-box.is-form .mhx-ico svg { width: 22px; height: 22px; }
.ai-skills-box.is-form .mhx-text h2 { font-size: 18px; }
.ai-skills-box.is-form .mhx-text p { margin-top: 2px; font-size: 12.5px; }
.ais-form .ais-radio input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; border: 1.5px solid var(--border); border-radius: 50%; background: var(--surface); appearance: none; -webkit-appearance: none; cursor: pointer; transition: border-color .2s, border-width .2s; }
.ais-form .ais-radio input:checked { border: 5px solid #3b82f6; background: #fff; }
.ais-form .ais-radio input:focus-visible { outline: 2px solid color-mix(in srgb, #3b82f6 45%, transparent); outline-offset: 2px; }
.ais-guide .ais-side-title i { color: #8b5cf6; }
.ais-guide .ais-side-title { font-size: 15px; }
.ais-guide > p { font-size: 11.5px; }
.ais-guide-card > b { font-size: 13px; }
.ais-guide-card li { font-size: 12px; }
.ais-warn h5 { font-size: 13.5px; }
.ais-warn li { font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .ais-form .ais-radio input { transition: none; } }
/* Góp ý 12/11: mẫu rê chuột theo màu mẫu; chỉ dòng tiêu đề của khung bước / Lưu ý có nền, nội dung nền trắng */
.skp-tpl-card[class*=" is-"]:hover:not([disabled]) { background: linear-gradient(135deg, color-mix(in srgb, var(--sk) 12%, var(--surface)) 6%, var(--surface) 70%); }
.ais-guide-card { padding: 0 0 10px; overflow: hidden; border-color: var(--border-soft); background: var(--surface); }
.ais-guide-card > b { margin: 0 0 10px; padding: 9px 14px; background: color-mix(in srgb, #8b5cf6 8%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, #8b5cf6 14%, var(--border-soft)); }
.ais-guide-card ol { padding: 0 14px; }
.ais-step-n { background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); }
.ais-warn { padding: 0 0 10px; overflow: hidden; background: var(--surface); }
.ais-warn h5 { margin: 0 0 10px; padding: 9px 14px; background: color-mix(in srgb, #f59e0b 9%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, #f59e0b 20%, var(--border-soft)); }
.ais-warn ul { padding: 0 14px; }
.skp-tpl-card[class*=" is-"]:focus-visible { border-color: color-mix(in srgb, var(--sk) 55%, var(--border-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--sk) 12%, var(--surface)) 6%, var(--surface) 70%); }
.skp-tpl-card[class*=" is-"]:hover .skp-tpl-plus { color: var(--sk); }

/* Khối Tùy chọn nâng cao của hộp soạn kỹ năng (ảnh mẫu 12/11/2026, ai.js aiSkillAdvHTML) */
.ais-adv-body { display: flex; flex-direction: column; gap: 10px; margin-top: -4px; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); }
.ais-adv-h { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.ais-adv-h:first-child { margin-top: 0; }
.ais-adv-h .ais-fic { width: 30px; height: 30px; border-radius: 9px; }
.ais-adv-h .ais-fic i { font-size: 14px; }
.ais-info { display: inline-grid; place-items: center; color: var(--ink-soft); cursor: help; }
.ais-info i { font-size: 13px; }
.ais-src { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding-left: 40px; }
.ais-chk { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; color: var(--ink); cursor: pointer; transition: border-color .2s, background-color .2s; }
.ais-chk:has(input:checked) { border-color: color-mix(in srgb, #3b82f6 40%, var(--border)); background: color-mix(in srgb, #3b82f6 5%, var(--surface)); }
.ais-chk input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: #3b82f6; }
.ais-chk span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ais-chk.is-lock { cursor: default; opacity: .85; }
.ais-fmt { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-left: 40px; }
.ais-fmt-card { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .2s, background-color .2s; }
.ais-fmt-card:has(input:checked) { border-color: #3b82f6; background: color-mix(in srgb, #3b82f6 7%, var(--surface)); box-shadow: 0 0 0 1px color-mix(in srgb, #3b82f6 25%, transparent); }
.ais-fmt-card input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; border: 1.5px solid var(--border); border-radius: 50%; background: var(--surface); appearance: none; -webkit-appearance: none; cursor: pointer; }
.ais-fmt-card input:checked { border: 5px solid #3b82f6; }
.ais-fmt-card span { display: flex; flex-direction: column; min-width: 0; }
.ais-fmt-card b { font-size: 13px; font-weight: 600; color: var(--ink); }
.ais-fmt-card small { font-size: 11.5px; line-height: 1.35; color: var(--ink-soft); }
.ais-acts { display: grid; gap: 2px; margin: 0; padding: 0 0 0 40px; list-style: none; }
.ais-acts li { display: grid; grid-template-columns: 22px minmax(0, 180px) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed var(--border-soft); }
.ais-acts li:last-child { border-bottom: 0; }
.ais-act-ic { color: var(--ink-soft); }
.ais-act-ic i { font-size: 14px; }
.ais-acts b { font-size: 13px; font-weight: 600; color: var(--ink); }
.ais-acts small { font-size: 12px; color: var(--ink-soft); }
.ais-acts .auto-switch input:disabled + span { opacity: .75; cursor: not-allowed; }
.ais-adv-note { display: flex; gap: 6px; margin: 0; padding-left: 40px; font-size: 12px; color: var(--ink-soft); }
.ais-adv-note i { margin-top: 2px; }
.ais-adv-body > .ais-input-wrap { margin-left: 40px; }
.ais-rules { min-height: 84px; }
@media (max-width: 900px) { .ais-src { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ais-fmt { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ais-src, .ais-fmt, .ais-acts, .ais-adv-note { padding-left: 0; } .ais-adv-body > .ais-input-wrap { margin-left: 0; } .ais-src { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ais-acts li { grid-template-columns: 22px minmax(0, 1fr) auto; } .ais-acts small { grid-column: 2 / 3; } }
@media (prefers-reduced-motion: reduce) { .ais-chk, .ais-fmt-card { transition: none; } }
.ais-src { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.ais-chk span { overflow: visible; white-space: normal; line-height: 1.3; }
.ais-fmt { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.ais-src { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* 9 nguồn = 3 × 3 cân đối */
.ais-fmt { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* 4 định dạng = 2 × 2 */
@media (max-width: 640px) { .ais-src { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ais-fmt { grid-template-columns: minmax(0, 1fr); } }
/* Góp ý 12/11: khung Nâng cao bao cả tiêu đề (có nền) + nội dung, mở / đóng mượt; ô Công việc đậm không xám; hộp rộng hơn; vạch đứt trên / dưới danh sách hành động */
.modal-box.ai-skills-box.is-form { max-width: 1200px; }
.ais-adv-box { overflow: hidden; border: 1px solid var(--border-soft); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.ais-adv-box .ais-adv { padding: 12px 16px; border: 0; border-radius: 0; background: color-mix(in srgb, #3b82f6 5%, var(--surface)); box-shadow: none; transition: background-color .2s; }
.ais-adv-box .ais-adv:hover { background: color-mix(in srgb, #3b82f6 9%, var(--surface)); }
.ais-adv-box.is-open .ais-adv { border-bottom: 1px solid var(--border-soft); }
.ais-adv-box .ais-adv-body { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.ais-chk.is-lock { opacity: 1; cursor: default; }
.ais-chk.is-lock span { font-weight: 600; }
.ais-acts li:first-child { border-top: 1px dashed var(--border-soft); }
.ais-acts li:last-child { border-bottom: 1px dashed var(--border-soft); }
/* Cột phải khi mở Tùy chọn nâng cao: Xem trước phản hồi (ví dụ minh họa) + Gợi ý tối ưu — ẩn khi khối Nâng cao đóng */
.ais-adv-side { display: none; flex-direction: column; gap: 12px; }
.ai-skills-box:has(.ais-adv-box.is-open) .ais-adv-side { display: flex; }
.ais-pvout, .ais-opt { overflow: hidden; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); }
.ais-pvout h5, .ais-opt h5 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 14px; font-size: 13.5px; font-weight: 700; }
.ais-pvout h5 { border-bottom: 1px solid color-mix(in srgb, #3b82f6 16%, var(--border-soft)); background: color-mix(in srgb, #3b82f6 7%, var(--surface)); color: #1d4ed8; }
.ais-pvout h5 small { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--ink-soft); }
.ais-opt h5 { border-bottom: 1px solid color-mix(in srgb, #8b5cf6 16%, var(--border-soft)); background: color-mix(in srgb, #8b5cf6 8%, var(--surface)); color: #6d28d9; }
.ais-pvout > p, .ais-pvout > ul, .ais-pvout > table { margin: 10px 14px; font-size: 12px; line-height: 1.5; color: var(--ink); }
.ais-pvout > ul { display: grid; gap: 6px; padding-left: 16px; }
.ais-pv-table { width: calc(100% - 28px); border-collapse: collapse; }
.ais-pv-table th, .ais-pv-table td { padding: 5px 6px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; font-size: 11.5px; }
.ais-pv-table th { font-weight: 600; color: var(--ink-soft); }
.ais-opt ul { display: grid; gap: 6px; margin: 10px 14px; padding: 0; list-style: none; }
.ais-opt li { display: flex; gap: 8px; font-size: 12px; line-height: 1.45; color: var(--ink); }
.ais-opt li i { margin-top: 2px; color: #3b82f6; }
.ais-opt-ok { margin: 10px 14px; font-size: 12px; color: #15803d; }
/* Nút Tạo Skill cùng cỡ ô số kỹ năng bên cạnh (chủ dự án chốt 12/11) */
.skp-head .skp-count, .skp-head .skp-new { box-sizing: border-box; height: 40px; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 600; }
/* Chuyển động 0.2s khi rê chuột trên trang Kỹ năng AI + hộp soạn (chủ dự án yêu cầu 12/11) */
.skp-card, .skp-tpl-card, .skp-btn, .skp-card .skp-use, .skp-new, .skp-chip-x,
.ais-chk, .ais-fmt-card, .ais-radio, .ais-adv-box .ais-adv, .ais-acts li, .ais-try, .ai-skills-box .mhx-acts button {
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease, transform .2s ease;
}
.skp-card:hover { transform: translateY(-2px); }
.skp-tpl-card:hover:not([disabled]) { transform: translateY(-1px); }
.ais-chk:hover { border-color: color-mix(in srgb, #3b82f6 45%, var(--border)); }
.ais-fmt-card:hover { border-color: color-mix(in srgb, #3b82f6 45%, var(--border)); }
.ais-acts li:hover { background: color-mix(in srgb, #3b82f6 4%, var(--surface)); }
.ais-radio:hover b { color: #2563eb; }
@media (prefers-reduced-motion: reduce) {
  .skp-card, .skp-tpl-card, .skp-btn, .skp-card .skp-use, .skp-new, .skp-chip-x,
  .ais-chk, .ais-fmt-card, .ais-radio, .ais-adv-box .ais-adv, .ais-acts li, .ais-try, .ai-skills-box .mhx-acts button { transition: none; }
  .skp-card:hover, .skp-tpl-card:hover:not([disabled]) { transform: none; }
}

/* =====================================================
   TRANG "DỰ ÁN" DẠNG THẺ (ảnh mẫu 11/2026, projects.js pc*)
   5 ô số · hàng lọc · mỗi dự án 1 hàng thu / mở (chip số việc, tiến độ, hoạt động gần đây)
   ===================================================== */
body:has(#view-projects.is-active .pjc-page) .page-content { background: linear-gradient(180deg, #eef3f9, #f4f7fb 320px); }
.pjc-page { container: pjcpage / inline-size; display: flex; flex-direction: column; gap: 16px; }
.pjc-page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 0; }
.pjc-page-head .pl-page-title p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.pjc-page-head .btn-primary { height: var(--toolbar-h); box-sizing: border-box; }
.pjc-view-toggle { box-sizing: border-box; align-items: center; height: var(--toolbar-h); padding: 3px; border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); background: var(--primary-50); border-radius: 12px; }
.pjc-view-toggle .member-layout-btn { height: calc(var(--toolbar-h) - 8px); width: 34px; border-radius: 9px; }
.pjc-view-toggle .member-layout-btn.is-on { background: var(--surface); color: var(--primary-600); box-shadow: var(--shadow-sm); }

/* 5 ô số: nền pastel nhạt + viền cùng tông; ô trạng thái bấm để lọc */
.pjc-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.pjc-kpi {
  --pc-c: var(--primary); --pc-ink: var(--primary-600);
  display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; font: inherit; text-align: left; color: var(--ink);
  background: color-mix(in srgb, var(--pc-c) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pc-c) 22%, transparent);
  border-radius: 16px; box-shadow: var(--shadow-sm); transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
button.pjc-kpi { cursor: pointer; }
button.pjc-kpi:hover { background: color-mix(in srgb, var(--pc-c) 12%, var(--surface)); }
.pjc-kpi.is-on { border-color: var(--pc-c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-c) 18%, transparent); }
.pjc-kpi.is-green { --pc-c: #34d399; --pc-ink: #059669; }
.pjc-kpi.is-orange { --pc-c: #fb923c; --pc-ink: #c2410c; }
.pjc-kpi.is-red { --pc-c: #fb7185; --pc-ink: #e11d48; }
.pjc-kpi.is-purple { --pc-c: #a78bfa; --pc-ink: #7c3aed; }
.pjc-kpi-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--pc-ink); background: color-mix(in srgb, var(--pc-c) 18%, var(--surface)); }
.pjc-kpi-main { display: flex; flex-direction: column; min-width: 0; }
.pjc-kpi-main b { font-size: 24px; line-height: 1.15; font-weight: 800; color: var(--pc-ink); font-variant-numeric: tabular-nums; }
.pjc-kpi-main span { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Hàng lọc: dùng khung .tmg-tools của trang Nhóm; ô tìm giãn hết phần còn lại */
.pjc-tools .search-field { flex: 1 1 260px; }
.pjc-tools .tmg-sel { flex: 0 1 220px; width: 220px; }

/* Mỗi dự án 1 hàng; mở ra thì thêm khối chi tiết */
.pjc-list { display: flex; flex-direction: column; gap: 12px; }
.pjc-row { background: linear-gradient(90deg, var(--surface) 0%, color-mix(in srgb, var(--primary) 6%, var(--surface)) 24%); border: 1px solid var(--border-soft); border-radius: 16px; box-shadow: var(--shadow-sm); transition: border-color 0.2s, box-shadow 0.2s; }
.pjc-row:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.pjc-row.is-open { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06); }
.pjc-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) 190px 128px 112px 40px 32px 32px; align-items: center; gap: 12px; padding: 12px 16px; min-height: 44px; }
.pjc-caret, .pjc-dots { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background-color 0.2s; }
.pjc-caret:hover, .pjc-dots:hover, .pjc-dots[aria-expanded="true"] { background: var(--bg); color: var(--ink); }
.pjc-caret svg { transition: transform 0.2s; }
.pjc-row.is-open .pjc-caret svg { transform: rotate(180deg); }
.pjc-dots { width: 32px; height: 32px; border: 1px solid var(--border-soft); }
.pjc-folder { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--pjc-color); background: color-mix(in srgb, var(--pjc-color) 14%, var(--surface)); }
.pjc-title { display: flex; flex-direction: column; min-width: 0; }
.pjc-name { font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pjc-name:hover { color: var(--primary-600); }
.pjc-desc { margin-top: 2px; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pjc-avatars .avatar { width: 28px; height: 28px; font-size: 11px; border: 2px solid var(--surface); }
.pjc-add-people { display: inline-grid; place-items: center; box-sizing: border-box; min-width: 28px; height: 28px; margin-left: 6px; padding: 0 7px; border: 1px dashed #cbd5e1; border-radius: var(--radius-pill); background: #f1f5f9; font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background-color 0.2s, border-color 0.2s; }
.pjc-add-people:hover { background: #e2e8f0; border-color: #94a3b8; }
.pjc-no-people { font-size: 12.5px; color: var(--muted); }
.pjc-status { justify-self: start; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pjc-status.is-orange { color: #c2410c; background: #fff4e8; border-color: #fed7aa; }
.pjc-status.is-red { color: #e11d48; background: #fff1f3; border-color: #fecdd3; }
.pjc-status.is-green { color: #059669; background: #ecfdf5; border-color: #a7f3d0; }
.pjc-status.is-gray { color: var(--ink-soft); background: var(--bg); border-color: var(--border); }
.pjc-due { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pjc-lead { position: relative; display: inline-flex; }
/* Vương miện vàng góc trên phải ảnh: nhận ra ngay đây là trưởng nhóm */
.pjc-crown { position: absolute; top: -8px; right: 0; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #fef3c7; color: #d97706; border: 1.5px solid var(--surface); box-shadow: var(--shadow-sm); }
.pjc-av { display: inline-flex; border-radius: 50%; }
.pjc-avatars .pjc-av + .pjc-av { margin-left: -5px; }
.pjc-av:focus-visible, .pjc-lead:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 50%; }
.pjc-lead .avatar { width: 30px; height: 30px; font-size: 11px; }
.pjc-progress, .pjc-prog-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pjc-progress b, .pjc-prog-line b { min-width: 38px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.pjc-row .progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, #10b981); }
.pjc-menu-wrap { position: relative; justify-self: end; }
.pjc-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); }
.pjc-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color 0.2s; }
.pjc-menu-item svg { color: var(--ink-soft); }
.pjc-menu-item:hover, .pjc-menu-item:focus-visible { background: var(--bg); }
.pjc-menu-item.is-danger, .pjc-menu-item.is-danger svg { color: #e11d48; }
.pjc-menu-item.is-danger:hover { background: #fff1f3; }
.pjc-menu-sep { height: 1px; margin: 4px 6px; background: var(--border-soft); }
.pjc-menu-note { margin: 0; padding: 8px 10px; max-width: 220px; font-size: 12.5px; color: var(--ink-soft); }
.pjc-name.is-archived { cursor: default; color: var(--ink-soft); }
.pjc-name.is-archived:hover { color: var(--ink-soft); }

.pjc-detail { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px 10px; margin: 0 10px 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 14px; }
.pjc-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pjc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--primary-600); background: var(--primary-50); white-space: nowrap; }
.pjc-chip.is-purple { color: #7c3aed; background: #f5f3ff; }
.pjc-chip.is-red { color: #e11d48; background: #fff1f3; }
.pjc-block-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.pjc-prog-block, .pjc-people-block { min-width: 0; padding-left: 16px; border-left: 1px solid var(--border-soft); }
.pjc-stack { flex: 1; display: flex; height: 8px; min-width: 0; overflow: hidden; border-radius: var(--radius-pill); background: var(--border-soft); }
.pjc-stack-seg { height: 100%; }
.pjc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12px; color: var(--ink-soft); }
.pjc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.pjc-legend i { width: 8px; height: 8px; border-radius: 50%; }
.pjc-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pjc-acts { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 10px 0 0 10px; border-top: 1px solid var(--border-soft); }
.pjc-acts .pjc-block-label { margin-bottom: 0; }
.pjc-act-list { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pjc-act-item { display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; font-size: 13px; color: var(--ink); }
.pjc-act-item svg { flex: none; color: var(--primary-600); }
.pjc-act-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pjc-act-time { flex: none; color: var(--ink-soft); white-space: nowrap; }
.pjc-act-note { font-size: 13px; color: var(--ink-soft); }

/* Ô chú thích riêng (projects.js pcTipShow): hiện ngay dưới phần tử, thay title của trình duyệt */
.pjc-tip { position: fixed; z-index: 1000; max-width: 280px; padding: 7px 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); font-size: 12.5px; line-height: 1.45; color: var(--ink); pointer-events: none; opacity: 0; transform: translateY(-3px); transition: opacity 0.15s, transform 0.15s; white-space: pre-line; }
.pjc-tip.is-on { opacity: 1; transform: none; }
.pjc-tip.is-rich { width: 320px; max-width: calc(100vw - 16px); padding: 12px 14px; white-space: normal; border-radius: 14px; }
.pjc-tip-head { display: flex; align-items: center; gap: 8px; padding-bottom: 9px; margin-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.pjc-tip-head svg { flex: none; color: var(--primary-600); }
.pjc-tip-head b { flex: 1; min-width: 0; font-size: 13.5px; }
.pjc-tip-head span { flex: none; font-size: 12px; color: var(--ink-soft); }
.pjc-tip-list { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.pjc-tip-list li { display: flex; align-items: flex-start; gap: 9px; }
.pjc-tip-list .avatar { flex: none; width: 24px; height: 24px; font-size: 10px; }
.pjc-collapse, .pjc-collapse > * { transition-duration: 0.2s; }
.pjc-tip-list div { min-width: 0; flex: 1; }
.pjc-tip-who { font-weight: 600; font-size: 12.5px; }
.pjc-tip-at { margin-left: 6px; font-size: 11.5px; color: var(--ink-soft); }
.pjc-tip-list p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pjc-tip-more { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--ink-soft); }
.pjc-act-item { cursor: default; padding: 3px 8px; margin-left: -8px; border-radius: 8px; transition: background-color 0.2s; }
.pjc-act-item:hover, .pjc-act-item:focus-visible { background: var(--primary-50); outline: none; }

/* Hẹp dần: bớt cột trước khi phải bẻ chữ */
@container pjcpage (max-width: 1100px) {
  /* 5 ô số: hàng trên 3 ô, hàng dưới 2 ô rộng hơn — không để trống chỗ */
  .pjc-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .pjc-kpi { grid-column: span 2; }
  .pjc-kpi:nth-child(n+4) { grid-column: span 3; }
  /* Hàng lọc: ô tìm 1 hàng, 3 ô chọn chia đều hàng dưới */
  .pjc-tools .search-field { flex: 1 1 100%; }
  .pjc-tools .tmg-sel { flex: 1 1 0; width: auto; }
  .pjc-head { grid-template-columns: 40px minmax(0, 1fr) 140px auto 32px 32px; }
  .pjc-head .pjc-due, .pjc-head .pjc-lead { display: none; }
  .pjc-head .pjc-no-people { display: none; }
  .pjc-detail { grid-template-columns: 1fr; }
  .pjc-prog-block, .pjc-people-block { padding-left: 0; border-left: 0; }
}
@container pjcpage (max-width: 640px) {
  .pjc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pjc-kpi, .pjc-kpi:nth-child(n+4) { grid-column: auto; }
  .pjc-kpi:last-child { grid-column: 1 / -1; }
  .pjc-head { grid-template-columns: minmax(0, 1fr) auto 32px 32px; gap: 8px; padding: 10px 12px; }
  .pjc-folder { display: none; }
  .pjc-progress { grid-column: 1 / -1; grid-row: 2; }
  .pjc-detail { grid-template-columns: 1fr; margin: 0 12px 12px; }
  .pjc-act-list { flex-direction: column; align-items: stretch; gap: 8px; }
  .pjc-tools .tmg-sel, .pjc-tools .search-field { flex: 1 1 100%; width: auto; }
  .pjc-tools .search-field { order: -1; }
  .pjc-kpi { gap: 10px; padding: 12px; }
  .pjc-kpi-ic { width: 36px; height: 36px; }
  .pjc-kpi-main span { white-space: normal; line-height: 1.3; }
}
@media (prefers-reduced-motion: reduce) {
  .pjc-kpi, .pjc-row, .pjc-caret, .pjc-caret svg, .pjc-dots, .pjc-menu-item, .pjc-add-people, .pjc-tip, .pjc-act-item { transition: none; }
}

/* Hộp Thêm / Sửa dự án: 2 ô ngày cùng hàng */
.pjf-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Trang Dự án › dạng Danh sách: dùng chung đầu trang + ô số + hàng lọc của dạng thẻ; ô tìm công việc (có thẻ) giãn như ô tìm dự án */
.pjc-tools .search-field.ts-box { flex: 1 1 260px; width: auto; max-width: none; min-height: 40px; height: auto; border-radius: 13px; }
.pjc-page.is-list .pjc-list-body > .pl-card:last-child { margin-bottom: 0; }

/* =====================================================
   HỘP TẠO DỰ ÁN MỚI (ảnh mẫu 11/2026, projects.js ap*): 1 màn, mẫu theo lĩnh vực + thông tin + xem trước + màu + quyền
   Chủ dự án 14/11/2026: nội dung gọn đều, khung gần vuông (rộng 880px) như ảnh mẫu, KHÔNG có thanh cuộn ở màn máy tính, 4 góc bo 8px.
   ===================================================== */
.npj-box { width: min(880px, calc(100vw - 32px)); max-width: 880px; max-height: calc(100vh - 24px); border-radius: 8px; overflow: hidden; container: npj / inline-size; }
.npj-head { padding: 12px 20px; background: linear-gradient(180deg, #f3f8fd, var(--surface)); border-bottom: 1px solid var(--border-soft); }
.npj-head-ico { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 10px; color: var(--primary-600); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.npj-head-ico svg { width: 24px; height: 24px; }
.npj-head h2 { font-size: 17px; }
.npj-head p { font-size: 12.5px; }
.npj-body { display: flex; flex-direction: column; gap: 14px; padding: 14px 20px; overflow-y: auto; }
.npj-box .modal-foot { padding: 10px 20px; }
.npj-box .modal-foot .btn-primary, .npj-box .modal-foot .btn-secondary { box-sizing: border-box; height: 36px; min-height: 36px; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; }
.npj-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.npj-sec h3 svg { width: 16px; height: 16px; color: var(--primary-600); }
.npj-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.npj-sec-head h3 { margin-bottom: 8px; }
.npj-link { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--primary-600); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background-color 0.2s; }
.npj-link:hover { background: var(--primary-50); }
.npj-link[aria-expanded="true"] svg { transform: rotate(90deg); }
.npj-link svg { transition: transform 0.2s; }

/* Thẻ mẫu: hàng thu gọn 4 thẻ; xem tất cả 5 thẻ / hàng, không cuộn riêng */
.npj-tpls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.npj-tpls.is-all { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.npj-tpls.is-all .npj-tpl { padding: 8px 10px; column-gap: 8px; }
.npj-tpl {
  --tc: var(--primary);
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; row-gap: 1px; align-items: center;
  min-width: 0; padding: 9px 12px; text-align: left; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.npj-tpl:hover { border-color: color-mix(in srgb, var(--tc) 45%, var(--border)); background: color-mix(in srgb, var(--tc) 4%, var(--surface)); }
.npj-tpl.is-on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent); }
.npj-tpl:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.npj-tpl-ic { grid-row: 1 / span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, var(--surface)); }
.npj-tpl-ic svg { width: 16px; height: 16px; }
.npj-tpl b { min-width: 0; padding-right: 18px; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npj-tpl small { min-width: 0; font-size: 11.5px; color: var(--ink-soft); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Hàng mẫu thu gọn: thẻ dọc như ảnh mẫu (biểu tượng trên, tên xuống dòng được) — kho Xem tất cả giữ thẻ ngang gọn */
.npj-tpls:not(.is-all) .npj-tpl { grid-template-columns: minmax(0, 1fr); align-content: start; row-gap: 2px; padding: 9px 10px; }
.npj-tpls:not(.is-all) .npj-tpl-ic { grid-row: auto; margin-bottom: 4px; }
.npj-tpls:not(.is-all) .npj-tpl b { white-space: normal; padding-right: 0; line-height: 1.3; }
.npj-tpls:not(.is-all) .npj-tpl small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.npj-tpls.is-all .npj-tpl b { white-space: normal; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.npj-tpl-check { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); color: #fff; }
.npj-tpl-check svg { width: 10px; height: 10px; }
.npj-tpl-tag { display: none; }
.npj-tpl.is-saved { border-style: dashed; }
.npj-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.npj-inds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.npj-ind { height: 28px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; transition: border-color 0.2s, background-color 0.2s, color 0.2s; }
.npj-ind:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--primary-50); }
.npj-ind.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); font-weight: 600; }

/* Dải thông tin mẫu đang chọn + danh sách việc */
.npj-tpl-info { margin-top: 8px; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--tc) 28%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--tc) 6%, var(--surface)); }
.npj-tpl-sum { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); }
.npj-tpl-sum > svg { flex: none; width: 15px; height: 15px; color: var(--tc); }
.npj-tpl-sum > span { flex: 1; min-width: 0; }
.npj-tpl-sum .npj-link { flex: none; }
.npj-collapse, .npj-collapse > * { transition-duration: 0.2s; }
.npj-tpl-tasks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid color-mix(in srgb, var(--tc) 20%, transparent); list-style: none; }
.npj-tpl-tasks li { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 12px; }
.npj-day { flex: none; min-width: 64px; font-size: 11.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.npj-tpl-tasks b { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npj-tpl-tasks small { flex: none; font-size: 11.5px; color: var(--ink-soft); }

/* Thông tin + xem trước */
.npj-info { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.npj-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.npj-box .form-field { margin: 0; }
.npj-box .form-field > label, .npj-box .ep-label { margin-bottom: 4px; font-size: 12.5px; }
.npj-count-box { position: relative; }
.npj-count-box .form-control { height: 40px; padding-right: 60px; font-size: 14px; }
.npj-count-box .pjf-count { top: 50%; bottom: auto; transform: translateY(-50%); }
#modal-add-project.modal-overlay .npj-box .pjf-desc textarea { min-height: calc(4.2em + 24px); height: calc(4.2em + 24px); padding: 7px 12px 17px; line-height: 1.4; font-size: 13.5px; } /* đúng 3 dòng chữ */
.npj-box .pjf-count { font-size: 11px; }
.npj-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; }
.npj-box .pjf-select .form-control { height: 40px; padding-left: 44px; font-size: 13.5px; }
.npj-box .pjf-select-av { left: 10px; }
/* Ô Người quản lý: biểu tượng người màu xanh luôn ở đầu ô, sau đó ảnh người được chọn rồi tên */
.npj-mgr-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 1; display: grid; place-items: center; color: var(--primary-600); pointer-events: none; }
.npj-box .npj-mgr .pjf-select-av { left: 36px; }
.npj-box .npj-mgr .form-control { padding-left: 68px; }
.npj-box .pjf-select-av .pjf-av { width: 24px; height: 24px; font-size: 10px; }
.npj-dates { display: flex; align-items: center; gap: 8px; }
/* Ô ngày: biểu tượng lịch xanh bên trái; nút lịch gốc của trình duyệt phủ trong suốt cả ô nên bấm đâu cũng mở lịch */
.npj-date { position: relative; flex: 1; min-width: 0; display: flex; }
.npj-date-ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--primary-600); pointer-events: none; z-index: 1; }
.npj-dates .form-control { position: relative; flex: 1; width: 100%; min-width: 0; height: 40px; padding-left: 36px; font-size: 13.5px; }
.npj-dates input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.npj-dash { flex: none; color: var(--ink-soft); }
.npj-preview { --pc: var(--primary); padding: 10px; border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); border-radius: 10px; background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), var(--surface)); }
.npj-preview h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.npj-preview h4 svg { width: 14px; height: 14px; color: var(--primary-600); }
.npj-pv-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); }
.npj-pv-card::after { content: ""; position: absolute; top: -30px; right: -30px; width: 76px; height: 76px; border-radius: 50%; background: color-mix(in srgb, var(--pc) 16%, transparent); pointer-events: none; }
.npj-pv-ico { --pc: var(--primary); flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; color: var(--pc); background: color-mix(in srgb, var(--pc) 15%, var(--surface)); transition: color 0.2s, background-color 0.2s; }
.npj-pv-ico svg { width: 20px; height: 20px; }
.npj-pv-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.npj-pv-main b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npj-pv-main b.is-empty { color: var(--ink-soft); }
.npj-pv-main > span:not(.npj-pv-bar) { font-size: 12px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.npj-pv-bar { display: block; width: 120px; max-width: 100%; height: 6px; margin-top: 4px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--pc) 18%, var(--border-soft)); }
.npj-pv-meta { display: flex; flex-direction: column; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.npj-pv-meta li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink); }
.npj-pv-meta svg { flex: none; width: 13px; height: 13px; color: var(--ink-soft); }

/* Màu + quyền */
.npj-bottom { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); gap: 16px; align-items: start; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.npj-bottom .ep-label { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.npj-bottom .ep-label svg { width: 14px; height: 14px; color: var(--primary-600); }
.npj-color-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.npj-color .pjf-swatches { margin-top: 0; gap: 8px; }
/* Ô màu: vuông bo nhẹ, cao bằng ô mã màu (30px), cùng 1 đường giữa */
.npj-color-row { align-items: center; }
#modal-add-project .npj-color .pjf-swatches { margin: 0; align-items: center; }
#modal-add-project .npj-color .ep-swatch { flex: none; width: 30px; height: 30px; margin: 0; border-radius: 7px; }
.npj-color .ep-swatch.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.npj-hex { box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.npj-hex:hover, .npj-hex[aria-expanded="true"] { border-color: var(--primary); background: var(--primary-50); }
.npj-hex i { width: 14px; height: 14px; border-radius: 50%; background: var(--primary); }
.npj-hex { cursor: default; }
/* Thanh màu 7 sắc kéo ngang (đỏ → cam → vàng → lục → lam → chàm → tím), núm tròn trắng */
.npj-hue { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 12px; margin: 10px 0 2px; border-radius: var(--radius-pill); cursor: pointer;
  background: linear-gradient(90deg, hsl(0 80% 55%), hsl(60 80% 50%), hsl(120 70% 42%), hsl(180 75% 42%), hsl(240 75% 58%), hsl(300 70% 55%), hsl(359 80% 55%)); }
.npj-hue::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--surface); box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25), 0 2px 6px rgba(15, 23, 42, 0.25); }
.npj-hue::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--surface); box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25), 0 2px 6px rgba(15, 23, 42, 0.25); }
.npj-hue:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.npj-vis-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.npj-vis-cards .ep-vis-card { flex-direction: row; align-items: flex-start; gap: 7px; min-width: 0; padding: 7px 9px; border-radius: 10px; }
.npj-vis-cards .ep-vis-ico { flex: none; color: var(--primary-600); }
.npj-vis-cards .ep-vis-ico svg { width: 16px; height: 16px; }
.npj-vis-cards .ep-vis-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.npj-vis-cards .ep-vis-card b { font-size: 13px; }
.npj-vis-cards .ep-vis-card small { font-size: 11px; line-height: 1.35; }

@container npj (max-width: 760px) {
  .npj-tpls, .npj-tpls.is-all { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .npj-info { grid-template-columns: minmax(0, 1fr); }
  .npj-bottom { grid-template-columns: minmax(0, 1fr); }
}
@container npj (max-width: 560px) {
  .npj-tpl-tasks, .npj-row2, .npj-vis-cards { grid-template-columns: minmax(0, 1fr); }
  /* Hàng mẫu thu gọn: dải vuốt ngang, thẻ hẹp */
  .npj-tpls:not(.is-all) { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .npj-tpls:not(.is-all) .npj-tpl { flex: 0 0 180px; scroll-snap-align: start; }
  .npj-inds { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .npj-ind { flex: none; }
  .npj-head, .npj-body { padding-left: 16px; padding-right: 16px; }
  .npj-tpl-sum { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .npj-tpl, .npj-link, .npj-link svg, .npj-ind, .npj-hex, .npj-pv-ico { transition: none; }
}

/* =====================================================
   EXTENSION — tiện ích tính năng mở rộng (Gói & thanh toán, settings.js ext*)
   Chủ dự án 15/11/2026: dải trên màu vàng gold nhạt dần xuống trắng; khung bên trong nền trắng, bố cục như ảnh mẫu
   (bảng 6 cột bên trái + Tóm tắt thanh toán bên phải), mô tả ngắn 1 dòng, hiện đủ mọi tiện ích (kể cả gói đã có) mà không phải cuộn.
   ===================================================== */
.ext-card { --gold: #C8922B; --gold-ink: #8A5B0E; --gold-line: #EBD39B;
  padding: 0; overflow: hidden; border: 1px solid var(--gold-line); border-radius: 16px;
  background: linear-gradient(180deg, #FCEFC9 0px, #FFF8E8 52px, #FFFDF8 96px, #FFFFFF 150px); box-shadow: 0 6px 20px rgba(200, 146, 43, 0.08); }
.ext-band { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 36px; align-items: center; gap: 14px; width: 100%; padding: 16px 20px;
  border: 0; background: transparent; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.ext-band:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; border-radius: 16px; }
.ext-ic { display: grid; place-items: center; color: #B8821F; }
.ext-band-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ext-title { font-size: 20px; font-weight: 800; line-height: 1.2; background: linear-gradient(90deg, #A86B12, #D9A441); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ext-band-text small { font-size: 13px; color: var(--ink-soft); }
.ext-info { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.85); border: 1px solid var(--gold-line); font-size: 12.5px; color: var(--gold-ink); white-space: nowrap; }
.ext-info svg { flex: none; }
.ext-chev { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--gold-ink); background: rgba(255, 255, 255, 0.85); border: 1px solid var(--gold-line); transition: background-color 0.2s; }
.ext-band:hover .ext-chev { background: #FFF4D6; }
.ext-chev svg { transition: transform 0.2s; }
.ext-card.is-open .ext-chev svg { transform: rotate(180deg); }
.ext-collapse, .ext-collapse > * { transition-duration: 0.2s; }

/* Khung bên trong nền trắng: bảng (trái) + Tóm tắt thanh toán (phải) */
.ext-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; padding: 2px 16px 16px; }
.ext-table-wrap { min-width: 0; overflow-x: auto; background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; }
.ext-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.ext-table thead th:nth-child(1) { width: auto; }
.ext-table thead th:nth-child(2) { width: 230px; }
.ext-table thead th:nth-child(3) { width: 92px; }
.ext-table thead th:nth-child(4) { width: 62px; }
.ext-table thead th:nth-child(5) { width: 84px; }
.ext-table thead th:nth-child(6) { width: 100px; }
.ext-table thead th { padding: 10px 12px; background: #F8FAFC; border-bottom: 1px solid var(--border-soft); font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--ink-soft); text-align: left; white-space: normal; vertical-align: bottom; }
.ext-table td, .ext-table tbody th { padding: 6px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; text-align: left; font-weight: 400; }
.ext-table tbody tr:last-child td, .ext-table tbody tr:last-child th { border-bottom: 0; }
.ext-row { transition: background-color 0.2s; }
.ext-row:hover { background: #F6F9FC; }
.ext-row.is-sel { background: #F0F8FF; }
.ext-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ext-name b { min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-row-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--gold-ink); background: #FFF4D6; }
.ext-row.is-active .ext-row-ic, .ext-row.is-included .ext-row-ic { color: #047857; background: #DFF5EA; }
.ext-row.is-included { background: #F7FCF9; }
.ext-row.is-coming_soon { color: var(--ink-soft); }
.ext-row.is-coming_soon .ext-row-ic { color: var(--ink-soft); background: var(--bg); }
.ext-dash { color: var(--muted); }
.ext-tag.is-inc { background: #E6F7EE; color: #047857; border-color: #BFE8D2; }
.ext-tag.is-soon { background: var(--bg); color: var(--ink-soft); border-color: var(--border); }
.ext-desc { color: var(--ink-soft); }
.ext-desc span { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ext-num b { font-weight: 700; }
.ext-num small { display: block; font-size: 11px; color: var(--ink-soft); }
.ext-seat { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 7px; background: #fff; font-weight: 600; }
.ext-pick { text-align: right !important; white-space: nowrap; }
.ext-switch { position: relative; width: 40px; height: 22px; padding: 0; border: 0; border-radius: var(--radius-pill); background: #D7DEE8; cursor: pointer; transition: background-color 0.2s; }
.ext-switch i { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25); transition: transform 0.2s; }
.ext-switch.is-on { background: var(--primary); }
.ext-switch.is-on i { transform: translateX(18px); }
.ext-switch:disabled { opacity: 0.5; cursor: not-allowed; }
.ext-switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ext-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--radius-pill); border: 1px solid transparent; font: inherit; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ext-tag.is-on { background: #E6F7EE; color: #047857; border-color: #BFE8D2; }
.ext-tag.is-wait { background: #FFF4E5; color: #B45309; border-color: #FCD9A8; cursor: pointer; }
.ext-none { padding: 16px 12px !important; color: var(--ink-soft); text-align: center !important; }

.ext-sum { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px 28px; align-items: start; padding: 16px 18px; background: #fff; border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05); }
.ext-sum h4 { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); }
/* Tóm tắt thanh toán nằm DƯỚI bảng (chủ dự án 15/11/2026): trái = thông tin (gói, giá gói, Extension đã chọn, kỳ), phải = tổng + nút */
.ext-sum-info { display: flex; flex-direction: column; gap: 9px; min-width: 0; max-width: 460px; }
.ext-sum-pay { display: flex; flex-direction: column; gap: 9px; padding-left: 28px; border-left: 1px solid var(--border-soft); }
.ext-sum-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-soft); }
.ext-sum-row > span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }
.ext-plan-chip { padding: 2px 9px; border-radius: var(--radius-pill); background: var(--primary-50); color: var(--primary-600) !important; font-size: 11.5px; font-weight: 700; }
.ext-plan-chip.is-standard { background: #E6F7F4; color: #0F766E !important; }
.ext-plan-chip.is-business { background: #F3EEFF; color: #6D28D9 !important; }
.ext-plan-chip.is-free { background: #ECFDF5; color: #15803D !important; }
.ext-cycle { align-self: flex-start; }
.ext-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13.5px; font-weight: 700; }
.ext-total b { font-size: 20px; font-weight: 800; color: var(--primary-600); font-variant-numeric: tabular-nums; }
.ext-sub, .ext-note { margin: -4px 0 0; font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
.ext-note { margin: 0; padding: 7px 9px; border-radius: 8px; background: #FFF7E6; color: #92400E; }
/* Đơn tiện ích đang chờ thanh toán (quay lại trang sau khi tạo đơn): ghi rõ đơn + Hủy; nút chính thành Tiếp tục thanh toán */
.ext-pend { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border: 1px solid #FDE7B0; border-radius: 10px; background: #FFFBEB; font-size: 12.5px; line-height: 1.45; color: #92400E; }
.ext-pend > svg { flex: none; }
.ext-pend > span { flex: 1; min-width: 0; }
.ext-pend b { color: #78350F; }
.ext-pend .pl-link-btn { flex: none; }
.ext-pay { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; border-radius: 10px; font-weight: 700; }
.ext-clear { align-self: center; }
.ext-safe { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; font-size: 12px; color: var(--ink-soft); }
.pb-sum-row.is-addon span { color: #8A5B0E; }

/* Hẹp dần: tóm tắt xuống dưới bảng, bỏ ghi chú ở dải trên */
.ext-card { container: extc / inline-size; }
@container extc (max-width: 900px) {
  .ext-sum { grid-template-columns: minmax(0, 1fr); }
  .ext-sum-pay { padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--border-soft); }
  .ext-info { display: none; }
  .ext-band { grid-template-columns: auto minmax(0, 1fr) 36px; }
}
@container extc (max-width: 600px) {
  .ext-band { padding: 14px; }
  .ext-table thead th:nth-child(2), .ext-desc { display: none; }
  .ext-table thead th:nth-child(1) { width: auto; }
  .ext-body { padding: 2px 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .ext-chev, .ext-chev svg, .ext-row, .ext-switch, .ext-switch i { transition: none; }
}

/* =====================================================
   CUỘC HỌP (Đợt A1a, meetings.js mtg*; ảnh mẫu chủ dự án duyệt 15/11/2026)
   Nền trang xanh xám nhạt, thẻ trắng nổi; nhóm Sắp tới xanh lá / Chờ biên bản cam / Đã họp tím nhạt.
   ===================================================== */
#view-meetings { --mtg-blue: #0781fe; --mtg-blue-50: #e8f2ff; --mtg-green: #059669; --mtg-green-50: #e9f9f1; --mtg-orange: #c2620a; --mtg-orange-50: #fff4e6;
  --mtg-violet: #6d4fd8; --mtg-violet-50: #f2eefe; --mtg-gray-50: #f2f4f8; --mtg-line: #e7ebf3; }
body:has(#view-meetings.is-active) .page-content { padding: 14px 16px 28px 20px; }
.mtg-page { display: flex; flex-direction: column; gap: 14px; min-width: 0; container: mtgp / inline-size; }
.mtg-page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mtg-page-ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--mtg-blue-50, #e8f2ff); color: var(--mtg-blue, #0781fe); }
.mtg-page-title { flex: 1 1 260px; min-width: 0; }
.mtg-page-title h1, .mtg-page-title h2 { margin: 0; font-size: clamp(19px, 1.6vw, 22px); font-weight: 800; color: var(--ink); }
.mtg-page-title p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.mtg-search { display: flex; align-items: center; gap: 8px; flex: 0 1 340px; min-width: 200px; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--muted); }
.mtg-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); }
.mtg-search:focus-within { border-color: var(--mtg-blue, #0781fe); box-shadow: 0 0 0 3px rgba(7, 129, 254, .12); }
.mtg-new, .mtg-page .btn-primary, .mtg-modal-box .btn-primary { display: inline-flex; align-items: center; gap: 7px; }
.mtg-bar { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--mtg-line, #e7ebf3); }
.mtg-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mtg-tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; transition: color .2s, border-color .2s, background-color .2s; border-radius: 10px 10px 0 0; }
.mtg-tab:hover { background: var(--mtg-gray-50, #f2f4f8); }
.mtg-tab.is-active { color: var(--mtg-blue, #0781fe); border-bottom-color: var(--mtg-blue, #0781fe); }
.mtg-tab-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--mtg-blue-50, #e8f2ff); color: var(--mtg-blue, #0781fe); font-size: 11.5px; font-weight: 700; }
.mtg-tab-n.is-warn { background: #ffe8ec; color: #e11d48; }
.mtg-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mtg-filter { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--ink-soft); }
.mtg-filter select { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.mtg-filter:focus-within { border-color: var(--mtg-blue, #0781fe); }
.mtg-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.mtg-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--mtg-line, #e7ebf3); border-radius: 18px; background: #fff; box-shadow: 0 6px 20px rgba(86, 100, 170, .06); }
.mtg-loading { padding: 40px 12px; text-align: center; color: var(--ink-soft); }

/* Lịch tháng nhỏ bên trái */
.mtg-cal { padding: 14px; border: 1px solid var(--mtg-line, #e7ebf3); border-radius: 18px; background: #fff; box-shadow: 0 6px 20px rgba(86, 100, 170, .06); }
.mtg-cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.mtg-cal-head b { flex: 1; font-size: 14.5px; color: var(--ink); }
.mtg-cal-nav { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); cursor: pointer; transition: background-color .2s; }
.mtg-cal-nav:hover { background: var(--mtg-gray-50, #f2f4f8); }
.mtg-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mtg-cal-wd { padding: 4px 0; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.mtg-cal-cell { position: relative; height: 32px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; transition: background-color .2s; }
.mtg-cal-cell.is-pad { cursor: default; }
.mtg-cal-cell:not(.is-pad):hover { background: var(--mtg-gray-50, #f2f4f8); }
.mtg-cal-cell.has-mtg::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--mtg-blue, #0781fe); }
.mtg-cal-cell.is-today { color: var(--mtg-blue, #0781fe); font-weight: 700; }
.mtg-cal-cell.is-picked { background: var(--mtg-blue, #0781fe) !important; color: #fff; font-weight: 700; }
.mtg-cal-cell.is-picked::after { background: #fff; }
.mtg-cal-day { margin-top: 12px; padding: 10px; border-radius: 12px; background: var(--mtg-blue-50, #e8f2ff); }
.mtg-cal-day-head { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; }
.mtg-cal-day-head span { color: var(--ink-soft); font-size: 12.5px; }
.mtg-cal-count { margin: 2px 0 8px; font-size: 12.5px; color: var(--ink-soft); }
.mtg-cal-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; margin-top: 4px; border: 1px solid var(--mtg-line, #e7ebf3); border-radius: 10px; background: #fff; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; transition: background-color .2s; }
.mtg-cal-item:hover { background: #f7f9fd; }
.mtg-cal-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--mtg-green, #059669); }
.mtg-cal-item.is-pending_minutes .mtg-cal-dot { background: var(--mtg-orange, #c2620a); }
.mtg-cal-item.is-done .mtg-cal-dot { background: var(--mtg-violet, #6d4fd8); }
.mtg-cal-hm { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mtg-cal-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.mtg-cal-clear { margin-top: 8px; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--mtg-blue, #0781fe); cursor: pointer; }

/* Nhóm + dòng cuộc họp */
.mtg-group { border-radius: 14px; overflow: hidden; border: 1px solid var(--mtg-line, #e7ebf3); }
.mtg-group-head { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 14px; font-size: 14px; font-weight: 700; }
.mtg-group.is-green .mtg-group-head { background: var(--mtg-green-50, #e9f9f1); color: #047857; }
.mtg-group.is-orange .mtg-group-head { background: var(--mtg-orange-50, #fff4e6); color: #b45309; }
.mtg-group.is-violet .mtg-group-head { background: var(--mtg-violet-50, #f2eefe); color: #5b3fc4; }
.mtg-group.is-gray .mtg-group-head { background: var(--mtg-gray-50, #f2f4f8); color: var(--ink-soft); }
.mtg-rows { display: flex; flex-direction: column; }
.mtg-row { display: grid; grid-template-columns: 40px minmax(0, 1.5fr) minmax(260px, 1.2fr) 130px 128px; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--mtg-line, #e7ebf3); background: #fff; cursor: pointer; transition: background-color .2s; }
.mtg-row:first-child { border-top: 0; }
.mtg-row:hover { background: #f7f9fd; }
.mtg-row:focus-visible, .mtg-prow:focus-visible { outline: 2px solid var(--mtg-blue, #0781fe); outline-offset: -2px; }
.mtg-row-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--mtg-blue-50, #e8f2ff); color: var(--mtg-blue, #0781fe); }
.mtg-row.is-pending_minutes .mtg-row-ic, .mtg-row.is-done .mtg-row-ic { background: var(--mtg-violet-50, #f2eefe); color: var(--mtg-violet, #6d4fd8); }
.mtg-row.is-cancelled { opacity: .72; }
.mtg-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mtg-row-title { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.mtg-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-lock, .mtg-rep { display: inline-flex; color: var(--muted); }
.mtg-row-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-soft); }
.mtg-row-sub span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.mtg-row-time { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mtg-row-time svg { flex: none; color: var(--ink-soft); }
.mtg-row-state { display: flex; }
.mtg-row-act { display: flex; justify-content: flex-end; }
.mtg-row-act .btn-sm, .mtg-row-act .mtg-join { white-space: nowrap; }
.mtg-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.mtg-chip.tone-blue { background: var(--mtg-blue-50, #e8f2ff); color: #0670e0; }
.mtg-chip.tone-green { background: #e6f7ee; color: #047857; }
.mtg-chip.tone-teal { background: #e3f6f3; color: #0f766e; }
.mtg-chip.tone-orange { background: #fff1e0; color: #b45309; }
.mtg-chip.tone-violet { background: #f1ecfe; color: #5b3fc4; }
.mtg-chip.tone-rose { background: #ffeef1; color: #e11d48; }
.mtg-chip.tone-gray { background: var(--mtg-gray-50, #f2f4f8); color: var(--ink-soft); }
.mtg-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 42px 16px; text-align: center; color: var(--ink-soft); }
.mtg-empty.is-sm { padding: 28px 12px; }
.mtg-empty h3 { margin: 4px 0 0; font-size: 16px; color: var(--ink); }
.mtg-empty p { margin: 0 0 6px; max-width: 460px; font-size: 13.5px; }
.mtg-empty-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--mtg-blue-50, #e8f2ff); color: var(--mtg-blue, #0781fe); }

/* Chi tiết cuộc họp */
.mtg-crumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }
.mtg-crumb button { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; border: 0; border-radius: 6px; background: none; font: inherit; color: var(--ink-soft); cursor: pointer; }
.mtg-crumb button:hover { color: var(--mtg-blue, #0781fe); }
.mtg-crumb > span:last-child { color: var(--ink); font-weight: 600; }
.mtg-d-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border: 1px solid var(--mtg-line, #e7ebf3); border-radius: 18px; background: #fff; box-shadow: 0 6px 20px rgba(86, 100, 170, .06); }
.mtg-d-title { flex: 1 1 320px; min-width: 0; }
.mtg-d-title h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-size: clamp(19px, 1.7vw, 23px); font-weight: 800; color: var(--ink); }
.mtg-d-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.mtg-d-meta span { display: inline-flex; align-items: center; gap: 6px; }
.mtg-d-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.mtg-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: default; }
button.mtg-pill { cursor: pointer; transition: background-color .2s; }
.mtg-pill.is-blue { background: var(--mtg-blue-50, #e8f2ff); color: #0670e0; border-color: #cfe2fd; }
button.mtg-pill.is-blue:hover { background: #d9eaff; }
.mtg-pill.is-violet { background: #f1ecfe; color: #5b3fc4; border-color: #e1d7fd; }
.mtg-pill.is-gray { background: var(--mtg-gray-50, #f2f4f8); color: var(--ink-soft); }
.mtg-d-org { display: flex; flex-direction: column; gap: 4px; }
.mtg-d-org small { font-size: 12px; color: var(--ink-soft); }
.mtg-d-org span { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; }
.mtg-d-org .avatar { width: 28px; height: 28px; font-size: 11px; }
.mtg-d-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mtg-join { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.mtg-more { position: relative; }
.mtg-more-btn { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.mtg-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(15, 23, 42, .14); }
.mtg-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .2s; }
.mtg-menu-item:hover { background: var(--mtg-gray-50, #f2f4f8); }
.mtg-menu-item.is-danger { color: #e11d48; }
.mtg-menu-item.is-danger:hover { background: #fff1f3; }
.mtg-rsvp, .mtg-ended { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; }
.mtg-rsvp { background: var(--mtg-blue-50, #e8f2ff); border: 1px solid #cfe2fd; color: var(--ink); }
.mtg-rsvp > span { flex: 1 1 220px; font-weight: 600; }
.mtg-rsvp button { display: inline-flex; align-items: center; gap: 6px; }
.mtg-rsvp [data-resp="declined"][aria-pressed="true"] { background: #ffeef1; border-color: #fecdd6; color: #e11d48; }
.mtg-ended { background: var(--mtg-orange-50, #fff4e6); border: 1px solid #fde1bd; color: #92400e; }
.mtg-ended > span { flex: 1 1 280px; }
.mtg-ended.is-cancel { background: var(--mtg-gray-50, #f2f4f8); border-color: var(--border); color: var(--ink-soft); }
.mtg-d-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--mtg-line, #e7ebf3); overflow-x: auto; scrollbar-width: none; }
.mtg-d-tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; transition: color .2s, border-color .2s; }
.mtg-d-tab.is-active { color: var(--mtg-blue, #0781fe); border-bottom-color: var(--mtg-blue, #0781fe); }
.mtg-d-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.mtg-d-one { max-width: 920px; }
.mtg-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px; border: 1px solid var(--mtg-line, #e7ebf3); border-radius: 18px; background: #fff; box-shadow: 0 6px 20px rgba(86, 100, 170, .05); }
.mtg-card-head { display: flex; align-items: center; gap: 10px; }
.mtg-card-head h2 { flex: 1; display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.mtg-card-head h2 svg { color: var(--mtg-blue, #0781fe); }
.mtg-card-n { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.mtg-muted { color: var(--ink-soft); }
.mtg-pad { margin: 0; padding: 4px 0; font-size: 13px; }
.mtg-info { display: flex; flex-direction: column; gap: 10px; }
.mtg-info-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 13.5px; }
.mtg-info-row > span { color: var(--ink-soft); }
.mtg-link { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mtg-link a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mtg-blue, #0781fe); }
.mtg-prep { white-space: pre-wrap; }
.mtg-agenda { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.mtg-agenda li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; font-size: 13.5px; transition: background-color .2s; }
.mtg-agenda li:hover { background: #f7f9fd; }
.mtg-agenda label { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.mtg-agenda input { flex: none; width: 16px; height: 16px; accent-color: var(--mtg-blue, #0781fe); }
.mtg-ag-no { color: var(--muted); font-variant-numeric: tabular-nums; }
.mtg-agenda .is-done .mtg-ag-t { text-decoration: line-through; color: var(--muted); }
.mtg-ag-min { color: var(--ink-soft); font-size: 12.5px; white-space: nowrap; }
.mtg-ag-del { width: 26px; height: 26px; }
.mtg-ag-add { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 6px; }
.mtg-ag-add input, .mtg-tk-pick input { height: 34px; padding: 0 10px; border: 1px dashed #c9d6ea; border-radius: 10px; font: inherit; font-size: 13px; background: #fbfcff; }
.mtg-ag-add input:focus, .mtg-tk-pick input:focus { outline: 0; border-style: solid; border-color: var(--mtg-blue, #0781fe); background: #fff; }
.mtg-pcount { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mtg-pc { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; font-size: 12px; }
.mtg-pc b { font-size: 20px; line-height: 1.1; }
.mtg-pc.is-yes { background: #e6f7ee; color: #047857; }
.mtg-pc.is-no { background: #ffeef1; color: #e11d48; }
.mtg-pc.is-wait { background: #f1ecfe; color: #5b3fc4; }
.mtg-people { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.mtg-people li { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.mtg-people .avatar { width: 32px; height: 32px; font-size: 12px; flex: none; }
.mtg-pp-name { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.mtg-pp-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-pp-name small { font-size: 12px; color: var(--ink-soft); }
.mtg-more-link, .mtg-add-link { display: inline-flex; align-items: center; gap: 5px; align-self: center; padding: 4px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--mtg-blue, #0781fe); cursor: pointer; transition: background-color .2s; }
.mtg-more-link:hover, .mtg-add-link:hover { background: var(--mtg-blue-50, #e8f2ff); }
.mtg-series { position: relative; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0 0 0 4px; list-style: none; }
.mtg-series li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.mtg-series button { padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.mtg-series button:hover { color: var(--mtg-blue, #0781fe); }
.mtg-sr-dot { flex: none; width: 12px; height: 12px; border: 2px solid #c9d6ea; border-radius: 50%; background: #fff; }
.mtg-series li.is-cur .mtg-sr-dot { border-color: var(--mtg-blue, #0781fe); background: var(--mtg-blue, #0781fe); box-shadow: 0 0 0 3px #d9eaff; }
.mtg-series li.is-none { color: var(--muted); }
.mtg-tasks { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.mtg-tasks li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 8px; padding: 7px 2px; border-top: 1px solid var(--mtg-line, #e7ebf3); font-size: 13px; }
.mtg-tasks li:first-child { border-top: 0; }
.mtg-tk-st { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.mtg-tk-st.st-doing { background: #38bdf8; }
.mtg-tk-st.st-review { background: #f59e0b; }
.mtg-tk-st.st-done { background: #10b981; }
.mtg-tk-name { min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-tk-name:hover { color: var(--mtg-blue, #0781fe); }
.mtg-tasks li.is-done .mtg-tk-name { color: var(--muted); text-decoration: line-through; }
.mtg-tk-src { margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: #f1ecfe; color: #5b3fc4; font-size: 11px; }
.mtg-tk-av .avatar { width: 22px; height: 22px; font-size: 9px; }
.mtg-tk-due { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mtg-tk-due.is-late { color: #e11d48; }
.mtg-tk-x { width: 24px; height: 24px; }
.mtg-tk-pick { display: flex; flex-direction: column; gap: 6px; }
.mtg-tk-opts { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.mtg-tk-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 10px; border: 0; border-top: 1px solid var(--mtg-line, #e7ebf3); background: #fff; font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: background-color .2s; }
.mtg-tk-opt:first-child { border-top: 0; }
.mtg-tk-opt:hover { background: #f7f9fd; }
.mtg-tk-opt small { color: var(--ink-soft); font-size: 11.5px; }
.mtg-notes .jodit-container { border-radius: 12px !important; }
.mtg-notes-view { font-size: 13.5px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.mtg-conflict { padding: 10px; border: 1px solid #fde1bd; border-radius: 12px; background: var(--mtg-orange-50, #fff4e6); font-size: 13px; color: #92400e; }
.mtg-conflict p { margin: 0 0 6px; }
.mtg-conflict textarea { width: 100%; margin-bottom: 6px; border: 1px solid #fde1bd; border-radius: 8px; padding: 6px; font: inherit; font-size: 12.5px; resize: vertical; }

/* Hộp Tạo / Sửa cuộc họp: 2 cột như ảnh mẫu */
.modal-box.mtg-modal-box { width: min(1060px, 100%); max-width: 1060px; max-height: min(92vh, 900px); }
#modal-meeting .modal-head { padding: 16px 22px; }
#modal-meeting .modal-head .icon-btn { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink-soft); }
#modal-meeting .modal-head .icon-btn:hover { background: var(--bg); color: var(--ink); box-shadow: none; }
/* Nút nhỏ (xóa mục, bỏ gắn, sao chép): nền trong, rê chuột mới tô nhẹ — không dùng nút đỏ đặc */
.mtg-x { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s; }
.mtg-x:hover { background: #ffeef1; color: #e11d48; }
.mtg-link .mtg-x:hover, .mtg-tb-list .mtg-x:hover { background: #e8f2ff; color: #0670e0; }
/* Ô chọn kiểu thẻ (shared.js enhanceSelect thay <select> bằng .cselect-btn) */
.mtg-filter .cselect-btn { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 13.5px; color: var(--ink); }
.mtg-filter .cselect-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-field .cselect-btn { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 13.5px; color: var(--ink); }
.mtg-field .cselect-btn:focus-visible { outline: 0; border-color: #0781fe; box-shadow: 0 0 0 3px rgba(7, 129, 254, .12); }
.mtg-field .cselect-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-modal-head { display: flex; align-items: center; gap: 12px; }
.mtg-modal-head > div { flex: 1; min-width: 0; }
.mtg-modal-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.mtg-modal-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.mtg-modal-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #e8f2ff; color: #0781fe; }
.mtg-modal-body { padding: 0; overflow-y: auto; }
.mtg-fcols { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.mtg-fcol { display: flex; flex-direction: column; gap: 0; padding: 6px 22px 16px; min-width: 0; }
.mtg-fcol.is-right { border-left: 1px solid #e7ebf3; }
.mtg-fsec { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid #edf1f6; }
.mtg-fsec:last-child { border-bottom: 0; }
.mtg-fsec h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.mtg-fsec h3 .mtg-card-n { margin-left: auto; padding: 2px 9px; border-radius: 999px; background: #f2f4f8; }
.mtg-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mtg-field > label { font-size: 13px; font-weight: 600; color: var(--ink); }
.mtg-field input, .mtg-field select, .mtg-fsec textarea, .mtg-tpick input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font: inherit; font-size: 13.5px; color: var(--ink); }
.mtg-fsec textarea { height: auto; padding: 10px 12px; resize: vertical; }
.mtg-field input:focus, .mtg-field select:focus, .mtg-fsec textarea:focus, .mtg-tpick input:focus { outline: 0; border-color: #0781fe; box-shadow: 0 0 0 3px rgba(7, 129, 254, .12); }
.mtg-field [aria-invalid="true"] { border-color: #fb7185; }
.mtg-count-wrap { position: relative; }
.mtg-count-wrap input { padding-right: 64px; }
.mtg-count { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); }
.mtg-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mtg-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mtg-err { margin: 2px 0 0; font-size: 12.5px; color: #e11d48; }
.mtg-err-form { margin: 0 22px 12px; padding: 8px 12px; border-radius: 10px; background: #fff1f3; }
.mtg-hint { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); }
.mtg-hint svg { flex: none; margin-top: 2px; }
.mtg-linktypes { display: flex; flex-wrap: wrap; gap: 8px; }
.mtg-lt { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.mtg-lt:hover { background: #f7f9fd; }
.mtg-lt.is-on { border-color: #0781fe; background: #e8f2ff; color: #0670e0; }
.mtg-pick { position: relative; }
.mtg-pick-in { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--muted); }
.mtg-pick-in:focus-within { border-color: #0781fe; box-shadow: 0 0 0 3px rgba(7, 129, 254, .12); }
.mtg-pick-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); }
.mtg-pick-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(15, 23, 42, .14); }
.mtg-pick-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: background-color .2s; }
.mtg-pick-opt:hover { background: #f2f6fd; }
.mtg-pick-opt > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.mtg-pick-opt small { font-size: 12px; color: var(--ink-soft); }
.mtg-pick-opt .avatar { width: 28px; height: 28px; font-size: 11px; flex: none; }
.mtg-pick-team { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #f1ecfe; color: #5b3fc4; flex: none; }
.mtg-att { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px solid #edf1f6; border-radius: 12px; background: #f8fafd; min-height: 52px; }
.mtg-att-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; border: 1px solid #e3e9f3; border-radius: 999px; background: #fff; font-size: 12.5px; font-weight: 600; }
.mtg-att-chip .avatar { width: 22px; height: 22px; font-size: 9px; }
.mtg-att-chip small { padding: 0 6px; border-radius: 999px; background: #e8f2ff; color: #0670e0; font-size: 11px; }
.mtg-att-chip button, .mtg-tchip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.mtg-att-chip button:hover, .mtg-tchip button:hover { background: #ffeef1; color: #e11d48; }
.mtg-tpick { position: relative; display: flex; flex-direction: column; gap: 6px; }
.mtg-tchips { display: flex; flex-wrap: wrap; gap: 4px; }
.mtg-tchip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 4px 2px 8px; border-radius: 8px; background: #e8f2ff; color: #0670e0; font-size: 12px; font-weight: 600; }
.mtg-f-agenda { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mtg-f-agenda li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 72px 28px; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid #e7ebf3; border-radius: 10px; }
.mtg-f-agenda input { height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 13.5px; }
.mtg-f-agenda input:focus { outline: 0; background: #f2f6fd; }
.mtg-f-ag-add { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border: 1px dashed #b9cbe6; border-radius: 10px; background: #f6f9ff; font: inherit; font-size: 13px; font-weight: 600; color: #0670e0; cursor: pointer; transition: background-color .2s; }
.mtg-f-ag-add:hover { background: #e8f2ff; }
.mtg-modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid #e7ebf3; }
.mtg-foot-note { flex: 1; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); }
.mtg-modal-foot .btn-secondary, .mtg-modal-foot .btn-primary { min-width: 96px; height: 40px; justify-content: center; }

/* Tab Cuộc họp của dự án */
.page-view:has(input[id$="-meetings"]:checked) .toolbar :is(.search-field, .tf-wrap, .tb-add-task) { display: none; }
.mtg-proj { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding: 16px 18px; border: 1px solid #e7ebf3; border-radius: 18px; background: #fff; box-shadow: 0 6px 20px rgba(86, 100, 170, .06); }
.mtg-proj-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mtg-proj-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mtg-pp { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid #e3e9f3; border-radius: 12px; background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.mtg-pp:hover { background: #f7f9fd; }
.mtg-pp.is-on { border-color: #0781fe; background: #0781fe; color: #fff; }
.mtg-pp.is-on .mtg-tab-n { background: rgba(255, 255, 255, .25); color: #fff; }
.mtg-proj-list { display: flex; flex-direction: column; gap: 8px; }
.mtg-pg-head { margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.mtg-prow { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid #e7ebf3; border-radius: 14px; background: #fff; cursor: pointer; transition: background-color .2s, border-color .2s; }
.mtg-prow:hover { background: #f7f9fd; border-color: #d6e3f5; }
.mtg-pdate { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 12px; background: #f2f6fd; line-height: 1.2; }
.mtg-pdate small { font-size: 11.5px; color: var(--ink-soft); }
.mtg-pdate b { font-size: 15px; color: var(--ink); }
.mtg-prow-av .avatar { width: 26px; height: 26px; font-size: 10px; }

/* Popup công việc: nút + khối cuộc họp */
.dq-tools .dq-tool-text { display: inline-flex; flex-direction: row; align-items: center; white-space: nowrap; height: 32px; }
.dq-tool-text { width: auto !important; gap: 6px; padding: 0 10px !important; font-size: 13px; font-weight: 600; color: #0670e0; background: #e8f2ff; border-radius: 10px; }
.dq-tool-text:hover { background: #d9eaff; }
.mtg-src { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; padding: 9px 12px; border: 1px solid #e1d7fd; border-radius: 12px; background: #f6f2ff; font-size: 13px; color: #5b3fc4; }
.mtg-src > span { flex: 1; min-width: 0; }
.mtg-src button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #5b3fc4; cursor: pointer; }
.mtg-tblock { display: flex; flex-direction: column; gap: 8px; }
.mtg-tb-head { display: flex; align-items: center; gap: 8px; }
.mtg-tb-head .section-title-v2 { flex: 1; display: inline-flex; align-items: center; gap: 6px; }
.mtg-tb-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border: 1px solid #e7ebf3; border-radius: 12px; }
.mtg-tb-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid #e7ebf3; }
.mtg-tb-list li:first-child { border-top: 0; }
.mtg-tb-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #e8f2ff; color: #0781fe; flex: none; }
.mtg-tb-main { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.mtg-tb-main b { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-tb-main small { font-size: 12px; color: var(--ink-soft); }
.mtg-tb-main:hover b { color: #0781fe; }

/* Hẹp dần: giảm cột trước khi bẻ chữ */
@container mtgp (max-width: 1080px) {
  .mtg-row { grid-template-columns: 40px minmax(0, 1fr) 128px 120px; }
  .mtg-row-time { grid-column: 2; grid-row: 2; font-size: 12.5px; }
  .mtg-row-state { grid-row: 1 / span 2; grid-column: 3; }
  .mtg-row-act { grid-row: 1 / span 2; grid-column: 4; }
  .mtg-row-ic { grid-row: 1 / span 2; }
  .mtg-d-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container mtgp (max-width: 820px) {
  .mtg-layout { grid-template-columns: minmax(0, 1fr); }
  .mtg-side { order: 2; }
  .mtg-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtg-d-grid { grid-template-columns: minmax(0, 1fr); }
}
@container mtgp (max-width: 560px) {
  .mtg-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px 10px; padding: 10px; }
  .mtg-row-ic { width: 36px; height: 36px; }
  .mtg-row-state { grid-column: 3; grid-row: 1; }
  .mtg-row-act { grid-column: 2 / span 2; grid-row: 3; justify-content: flex-start; }
  .mtg-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mtg-filter { height: 38px; padding: 0 8px 0 10px; }
  .mtg-search { flex: 1 1 100%; }
  .mtg-info-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 860px) {
  .mtg-fcols { grid-template-columns: minmax(0, 1fr); }
  .mtg-fcol.is-right { border-left: 0; border-top: 1px solid #e7ebf3; }
  .mtg-prow { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .mtg-prow-av { display: none; }
}
@media (max-width: 560px) {
  .mtg-row3, .mtg-row2 { grid-template-columns: minmax(0, 1fr); }
  .mtg-fcol { padding: 4px 14px 12px; }
  .mtg-modal-foot { flex-wrap: wrap; padding: 12px 14px; }
  .mtg-foot-note { flex-basis: 100%; }
  .mtg-modal-foot .btn-secondary, .mtg-modal-foot .btn-primary { flex: 1; }
  .dq-tool-text span { display: none; }
  .mtg-prow { grid-template-columns: 48px minmax(0, 1fr); }
  .mtg-prow .mtg-row-state { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .mtg-tab, .mtg-row, .mtg-cal-cell, .mtg-lt, .mtg-pp, .mtg-prow, .mtg-menu-item, .mtg-pick-opt { transition: none; }
}

/* Tab Lịch của dự án: dòng cuộc họp (meetings.js mtgCalendarLinesHTML) — tím nhạt, có máy quay, khác dòng hạn công việc */
.cal-mtg-line { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; margin: 0 0 3px; padding: 3px 6px; border: 1px solid #e1d7fd; border-radius: 7px; background: #f6f2ff; font: inherit; font-size: 11.5px; color: #5b3fc4; text-align: left; cursor: pointer; transition: background-color .2s; }
.cal-mtg-line:hover { background: #ece4ff; }
.cal-mtg-line svg { flex: none; }
.cal-mtg-hm { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-mtg-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-mtg-line.is-done, .cal-mtg-line.is-pending_minutes { opacity: .75; }
@media (prefers-reduced-motion: reduce) { .cal-mtg-line { transition: none; } }

/* Cuộc họp: thẻ công việc chia 2 phần (Mang ra họp / Cần chú ý trong dự án), chip lý do; chip "Về công việc" trong hộp Tạo */
.mtg-sub { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--ink-soft); }
.mtg-tk-name .mtg-why { margin-left: 6px; padding: 1px 7px; font-size: 11px; }
.mtg-from-task { display: flex; align-items: center; gap: 7px; margin: 0; padding: 8px 12px; border: 1px solid #cfe2fd; border-radius: 10px; background: #e8f2ff; font-size: 13px; color: #0670e0; }
.mtg-from-task span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================
   CHI TIẾT CUỘC HỌP — chép theo 6 ảnh mẫu chủ dự án (16/11/2026), đo trên ảnh 1536 × 1024; chữ + khoảng cách gọn (padding dọc nhỏ).
   Ghi đè khối chi tiết cũ (cùng tên lớp) bằng tiền tố .mtg-detail.
   ===================================================== */
.mtg-detail { --mb: #1683fb; --mb-50: #e8f1ff; --mline: #e8edf5; --mtext: #0f172a; --msoft: #475569; --mmuted: #64748b; gap: 12px; }
.mtg-detail .mtg-crumb { gap: 7px; font-size: 12.5px; color: var(--mmuted); }
.mtg-detail .mtg-crumb button { display: inline-flex; align-items: center; gap: 5px; padding: 0; font-size: 12.5px; color: var(--mmuted); }
.mtg-detail .mtg-crumb button.is-proj { color: #1677ff; font-weight: 600; }
.mtg-detail .mtg-crumb-sep { color: #94a3b8; }
.mtg-detail .mtg-crumb-cur { color: var(--mtext); font-weight: 600; }

/* Nút chung của trang chi tiết */
.mtg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid #dfe5ee; border-radius: 10px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: var(--mtext, #0f172a); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.mtg-btn:hover { background: #f6f8fc; }
.mtg-btn:focus-visible { outline: 2px solid #1683fb; outline-offset: 2px; }
.mtg-btn.is-icon { width: 36px; padding: 0; }
.mtg-btn.is-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.mtg-btn.is-sm.is-icon { width: 30px; padding: 0; }
.mtg-btn.is-lg { height: 42px; padding: 0 22px; font-size: 14px; }
.mtg-btn.is-primary { border-color: #1683fb; background: #1683fb; color: #fff; box-shadow: 0 4px 12px rgba(22, 131, 251, .22); }
.mtg-btn.is-primary:hover { background: #0b74e8; }
.mtg-btn.is-blue-ghost { border-color: #c9ddfb; color: #1677ff; }
.mtg-btn.is-blue-ghost:hover { background: #f2f7ff; }
.mtg-btn.is-orange { border-color: #f97316; background: #f97316; color: #fff; }
.mtg-btn.is-orange:hover { background: #ea660c; }
.mtg-btn.is-orange-ghost { border-color: #fdc89a; color: #ea580c; }
.mtg-btn.is-orange-ghost:hover { background: #fff6ee; }
.mtg-soft { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 0; border-radius: 8px; background: #eaf3ff; font: inherit; font-size: 11.5px; font-weight: 600; color: #1677ff; cursor: pointer; transition: background-color .2s; align-self: flex-start; }
.mtg-soft:hover { background: #dbeafe; }
.mtg-av { --s: 26px; flex: none; display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); font-size: calc(var(--s) * .38); font-weight: 700; line-height: 1; }
.mtg-av img { width: 100%; height: 100%; object-fit: cover; }
.mtg-av.is-more { background: #eef2f7; color: var(--msoft); }
.mtg-avs { display: inline-flex; }
.mtg-avs .mtg-av { margin-left: -4px; box-shadow: 0 0 0 2px #fff; }
.mtg-avs .mtg-av:first-child { margin-left: 0; }

/* Thẻ đầu trang */
.mtg-detail .mtg-d-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; gap: 0 16px; padding: 16px 20px; border: 1px solid var(--mline); border-radius: 16px; background: #fff; box-shadow: 0 4px 18px rgba(86, 100, 170, .05); }
.mtg-detail .mtg-d-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: #e6f0ff; color: #1677ff; }
.mtg-detail .mtg-d-title h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; font-size: 23px; line-height: 1.25; font-weight: 800; color: var(--mtext); }
.mtg-detail .mtg-d-title h1 .mtg-chip { padding: 2px 9px; border-radius: 7px; font-size: 11.5px; }
.mtg-detail .mtg-d-title h1 .mtg-chip svg { display: none; }
.mtg-detail .mtg-d-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 5px 0 0; font-size: 12.5px; color: var(--mmuted); }
.mtg-detail .mtg-d-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.mtg-detail .mtg-d-rep svg { color: #f97316; }
.mtg-detail .mtg-d-dot { color: #94a3b8; }
.mtg-detail .mtg-d-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.mtg-detail .mtg-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border: 0; border-radius: 7px; font: inherit; font-size: 11.5px; font-weight: 700; }
.mtg-detail .mtg-pill.is-blue { background: #e3eeff; color: #1d6fe0; }
.mtg-detail .mtg-pill.is-violet { background: #efe9ff; color: #6d4fd8; }
.mtg-detail .mtg-pill.is-gray { background: #eef1f5; color: var(--msoft); }
.mtg-detail .mtg-d-org { display: flex; flex-direction: row; align-items: center; gap: 9px; padding-right: 16px; border-right: 1px solid var(--mline); }
.mtg-detail .mtg-d-org > span:not(.mtg-av) { display: flex; flex-direction: column; gap: 1px; }
.mtg-detail .mtg-d-org small { display: block; font-size: 10.5px; color: var(--mmuted); }
.mtg-detail .mtg-d-org b { display: block; font-size: 13px; color: var(--mtext); }
.mtg-detail .mtg-d-acts { display: flex; align-items: center; gap: 8px; }
.mtg-detail .mtg-join-main { height: 38px; padding: 0 16px; font-size: 13.5px; }
.mtg-detail .mtg-d-acts .mtg-btn:not(.is-primary) { height: 38px; }
.mtg-detail .mtg-d-acts .mtg-btn.is-icon { width: 38px; }
.mtg-d-place { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 10px; background: #e8f1ff; font-size: 13px; font-weight: 600; color: #1677ff; }

/* Thẻ trả lời tham dự (người được mời) */
.mtg-detail .mtg-rsvp { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border: 1px solid #e1e7f6; border-radius: 14px; background: linear-gradient(90deg, #f1f5ff, #f6f1ff); font-size: 13px; }
.mtg-rsvp-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e6e1ff; color: #6d4fd8; }
.mtg-rsvp-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mtg-rsvp-t b { font-size: 14.5px; color: var(--mtext); }
.mtg-rsvp-t small { font-size: 12px; color: var(--mmuted); }
.mtg-btn.mtg-yes { height: 36px; padding: 0 18px; border-color: #c9eed6; background: #e8f9ef; color: #15803d; }
.mtg-btn.mtg-yes:hover, .mtg-btn.mtg-yes.is-on { background: #d7f4e2; }
.mtg-btn.mtg-yes.is-on { border-color: #16a34a; }
.mtg-btn.mtg-no { height: 36px; padding: 0 18px; border-color: #fbcbd3; background: #ffeef1; color: #e11d48; }
.mtg-btn.mtg-no:hover, .mtg-btn.mtg-no.is-on { background: #ffdde3; }
.mtg-btn.mtg-no.is-on { border-color: #e11d48; }

/* Hàng tab */
.mtg-detail .mtg-d-tabs { gap: 2px; padding: 0 10px; border: 1px solid var(--mline); border-radius: 14px; background: #fff; }
.mtg-detail .mtg-d-tab { gap: 6px; height: 44px; padding: 0 14px; border-bottom-width: 2px; font-size: 12.5px; font-weight: 500; color: #334155; }
.mtg-detail .mtg-d-tab.is-active { color: #1677ff; font-weight: 600; border-bottom-color: #1677ff; background: linear-gradient(180deg, transparent 60%, #f3f8ff); }
.mtg-detail .mtg-d-tab svg { color: #6d4fd8; }
.mtg-biz { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; background: #efe9ff; font-size: 10.5px; font-weight: 700; color: #6d4fd8; }

/* Dải "đã kết thúc" + dải họp định kỳ */
/* Hết giờ họp: tông xanh dịu (chủ dự án 16/11/2026: cam không hợp) */
.mtg-detail .mtg-ended { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid #d9e6fb; border-radius: 14px; background: linear-gradient(90deg, #f1f7ff, #f5f3ff); font-size: 13px; }
.mtg-detail .mtg-ended b { flex: 1; min-width: 0; font-size: 14px; color: #2457b8; }
.mtg-detail .mtg-ended .mtg-ended-ic { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #1683fb; color: #fff; }
.mtg-detail .mtg-ended.is-cancel { border-color: var(--mline); background: #f4f6f9; }
.mtg-detail .mtg-ended.is-cancel b { color: var(--msoft); }
.mtg-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 16px; border: 1px solid var(--mline); border-radius: 14px; background: #fff; }
.mtg-strip-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e8f1ff; color: #1677ff; }
.mtg-strip b { font-size: 14px; color: var(--mtext); }
.mtg-strip-m { flex: 1; display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; color: var(--mmuted); }
.mtg-strip .mtg-chip { border-radius: 7px; font-size: 11.5px; }

/* Lưới thẻ tab Thông tin */
.mtg-detail .mtg-d-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.mtg-detail .mtg-d-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 14px; align-items: stretch; }
.mtg-detail .mtg-d-row2.is-ended { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.mtg-detail .mtg-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 18px; border: 1px solid var(--mline); border-radius: 16px; background: #fff; box-shadow: 0 4px 18px rgba(86, 100, 170, .04); }
.mtg-detail .mtg-card-head { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.mtg-detail .mtg-card-head h2 { flex: 1; display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; font-weight: 700; color: var(--mtext); }
.mtg-detail .mtg-card-n { font-size: 11.5px; color: var(--mmuted); white-space: nowrap; }
.mtg-detail .mtg-muted { color: var(--mmuted); }
.mtg-detail .mtg-pad { margin: 0; padding: 2px 0; font-size: 12px; }
.mtg-detail .mtg-more-link { align-self: flex-end; display: inline-flex; align-items: center; gap: 5px; padding: 2px 4px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 700; color: #1677ff; cursor: pointer; margin-top: auto; }

/* Thẻ Thông tin */
.mtg-detail .mtg-info { display: flex; flex-direction: column; gap: 9px; }
.mtg-detail .mtg-info-row { display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 0; font-size: 12.5px; }
.mtg-detail .mtg-info-row > span { color: var(--mmuted); }
.mtg-detail .mtg-info-row > div { min-width: 0; color: var(--mtext); }
.mtg-detail .mtg-info-row b { font-weight: 500; }
.mtg-lnk { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #1677ff; text-decoration: none; cursor: pointer; }
.mtg-lnk span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-lnk svg { flex: none; }
.mtg-lnk:hover { text-decoration: underline; }
.mtg-detail .mtg-prep { display: flex; flex-direction: column; gap: 5px; padding-top: 10px; border-top: 1px solid var(--mline); }
.mtg-detail .mtg-prep h3 { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--mtext); }
.mtg-detail .mtg-prep p { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--mmuted); }

/* Thẻ Chương trình (gọn) */
.mtg-ag-prog { display: flex; align-items: center; gap: 10px; }
.mtg-ag-prog .mtg-ag-bar { flex: 1; }
.mtg-detail .mtg-ag-bar { height: 7px; border-radius: 999px; background: #e7ecf3; overflow: hidden; }
.mtg-detail .mtg-ag-bar i { display: block; height: 100%; border-radius: 999px; background: #22c55e; transition: width .2s; }
.mtg-detail .mtg-agenda { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.mtg-detail .mtg-agenda li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #eef2f7; font-size: 12.5px; }
.mtg-detail .mtg-agenda label { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.mtg-detail .mtg-agenda .mtg-ag-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mtext); }
.mtg-detail .mtg-agenda .is-done .mtg-ag-t, .mtg-detail .mtg-agenda .is-done .mtg-ag-min { text-decoration: line-through; color: #94a3b8; }
.mtg-detail .mtg-ag-min { font-size: 12px; color: var(--mmuted); white-space: nowrap; }
.mtg-cb { appearance: none; -webkit-appearance: none; flex: none; display: grid; place-items: center; width: 16px !important; height: 16px !important; margin: 0; border: 1.5px solid #cbd5e1; border-radius: 4px; background: #fff; cursor: pointer; transition: background-color .2s, border-color .2s; }
.mtg-cb.is-lg { width: 20px !important; height: 20px !important; border-radius: 5px; }
.mtg-cb:checked { border-color: #1683fb; background: #1683fb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 75% no-repeat; }
.mtg-detail .is-ended .mtg-cb:checked, .mtg-detail .mtg-card.is-agenda .mtg-cb:checked { border-color: #1683fb; }
.mtg-cb:disabled { cursor: default; }
.mtg-cb:focus-visible { outline: 2px solid #1683fb; outline-offset: 2px; }
.mtg-detail .mtg-ag-add { display: grid; grid-template-columns: minmax(0, 1fr) 62px auto auto; gap: 6px; }
.mtg-detail .mtg-ag-add input { height: 32px; padding: 0 9px; border: 1px solid #dfe5ee; border-radius: 8px; font: inherit; font-size: 12.5px; }

/* Thẻ Người tham dự (gọn) */
.mtg-detail .mtg-pcount { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mtg-detail .mtg-pc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; padding: 7px 4px; border-radius: 10px; font-size: 11.5px; }
.mtg-detail .mtg-pc span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-detail .mtg-pc b { font-size: 19px; font-weight: 800; line-height: 1.2; color: inherit; }
.mtg-detail .mtg-pc.is-yes { background: #e7f8ee; color: #15803d; }
.mtg-detail .mtg-pc.is-no { background: #ffeef1; color: #e11d48; }
.mtg-detail .mtg-pc.is-wait { background: #efeaff; color: #6d28d9; }
.mtg-detail .mtg-people { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.mtg-detail .mtg-people li { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid #eef2f7; }
.mtg-detail .mtg-pp-name { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mtg-detail .mtg-pp-name b { font-size: 12.5px; color: var(--mtext); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtg-detail .mtg-pp-name small { font-size: 10.5px; color: var(--mmuted); }
.mtg-detail .mtg-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 7px; font-size: 11px; font-weight: 600; }
.mtg-detail .mtg-chip.tone-green { background: #e7f8ee; color: #15803d; }
.mtg-detail .mtg-chip.tone-rose { background: #ffeef1; color: #e11d48; }
.mtg-detail .mtg-chip.tone-violet { background: #efeaff; color: #6d28d9; }
.mtg-detail .mtg-chip.tone-blue { background: #e3eeff; color: #1d6fe0; }
.mtg-detail .mtg-chip.tone-orange { background: #ffedd5; color: #ea580c; }

/* Thẻ Công việc liên quan */
/* Tối đa 5 dòng (mỗi dòng ~43px), còn lại cuộn; thanh cuộn mảnh, mờ */
.mtg-detail .mtg-tasks { display: flex; flex-direction: column; max-height: 216px; margin: 0; padding: 0 4px 0 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .35) transparent; }
.mtg-detail .mtg-tasks::-webkit-scrollbar { width: 5px; }
.mtg-detail .mtg-tasks::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(148, 163, 184, .35); }
.mtg-detail .mtg-tasks::-webkit-scrollbar-track { background: transparent; }
.mtg-detail .mtg-tasks li { flex: none; }
/* Ghi chú chung ở tab Thông tin: trình soạn giãn hết chiều cao thẻ, cao bằng thẻ Công việc liên quan (5 dòng) */
.mtg-detail .mtg-d-row2 > .mtg-card.is-notes { min-height: 0; }
.mtg-detail .mtg-d-row2 .mtg-notes { display: flex; flex: 1; flex-direction: column; min-height: 216px; }
.mtg-detail .mtg-d-row2 .mtg-notes .jodit-container { display: flex; flex: 1; flex-direction: column; }
.mtg-detail .mtg-d-row2 .mtg-notes .jodit-workplace { flex: 1; }
.mtg-detail .mtg-d-row2 .mtg-notes .jodit-wysiwyg { min-height: 100%; }
.mtg-detail .mtg-tasks li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto 44px 18px; align-items: center; gap: 10px; padding: 8px 0; border: 0; border-bottom: 1px solid #eef2f7; font-size: 12px; }
.mtg-detail .mtg-tasks li:last-child { border-bottom: 0; }
.mtg-detail .mtg-tk-cb { display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 1.5px solid #cbd5e1; border-radius: 4px; background: #fff; color: #fff; cursor: pointer; transition: background-color .2s, border-color .2s; }
.mtg-detail .mtg-tk-cb:not(:disabled):not(.is-on):hover { border-color: #22c55e; background: #f0fdf4; }
.mtg-detail .mtg-tk-cb:disabled { cursor: default; opacity: .55; }
.mtg-detail .mtg-tk-cb:focus-visible { outline: 2px solid #1683fb; outline-offset: 2px; }
.mtg-detail .mtg-tk-cb.is-review { border-color: #f59e0b; background: radial-gradient(circle, #f59e0b 0 3px, #fffbeb 3.5px); }
.mtg-detail .mtg-tk-cb.is-on { border-color: #22c55e; background: #22c55e; }
.mtg-detail .mtg-tk-name { min-width: 0; padding: 0; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--mtext); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.mtg-detail .mtg-tk-name:hover { color: #1677ff; }
.mtg-pri { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.mtg-pri.is-high { background: #ffecef; color: #e11d48; }
.mtg-pri.is-mid { background: #e3eeff; color: #1d6fe0; }
.mtg-pri.is-low { background: #e7f8ee; color: #15803d; }
.mtg-detail .mtg-tk-due { font-size: 11.5px; color: var(--mmuted); text-align: right; }
.mtg-detail .mtg-tk-due.is-late { color: #e11d48; }
.mtg-detail .mtg-tk-x { width: 18px; height: 18px; }
.mtg-detail .mtg-tasks li:not(:hover) .mtg-x.mtg-tk-x { opacity: 0; }
.mtg-detail .mtg-tasks li .mtg-x.mtg-tk-x:focus-visible { opacity: 1; }
.mtg-detail .mtg-tk-pick input { height: 32px; font-size: 12.5px; }

/* Thẻ Ghi chú chung (gọn) */
.mtg-notes-tools { display: inline-flex; align-items: center; gap: 10px; }
.mtg-notes-saved { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--msoft); }
.mtg-notes-saved i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.mtg-notes-saved.is-green { font-weight: 700; color: #16a34a; }
.mtg-notes-saved.is-empty { display: none; }
.mtg-detail .mtg-notes .jodit-container { border: 1px solid #e2e8f0 !important; border-radius: 12px !important; }
.mtg-detail .mtg-notes .jodit-toolbar__box { border-radius: 12px 12px 0 0 !important; background: #fff !important; }
.mtg-detail .mtg-notes .jodit-wysiwyg { font-size: 12.5px !important; line-height: 1.6; }
.mtg-notes-foot { margin: 0; font-size: 11px; color: var(--mmuted); }
.mtg-vsep { width: 1px; height: 22px; background: var(--mline); }
.mtg-collab { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--mmuted); }
.mtg-collab svg { color: #6d4fd8; }
.mtg-detail .mtg-card.is-full .mtg-notes .jodit-wysiwyg { font-size: 13.5px !important; }
.mtg-detail .mtg-conflict { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 12px 14px; border: 1px solid #fcd2a7; border-radius: 12px; background: #fff3e8; font-size: 12px; color: #9a3412; }
.mtg-conflict-ic { color: #f59e0b; }
.mtg-detail .mtg-conflict b { display: block; font-size: 13.5px; color: #ea580c; }
.mtg-detail .mtg-conflict p { margin: 2px 0 8px; color: var(--msoft); }
.mtg-conflict-box { padding: 8px 12px; border: 1px solid #f1e4d6; border-radius: 8px; background: #fff; color: var(--mtext); }
.mtg-conflict-box small { display: block; margin-bottom: 4px; font-size: 11px; color: var(--mmuted); }

/* Các lần họp định kỳ: thẻ ngang */
.mtg-occ { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mtg-occ-i { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 1px solid var(--mline); border-radius: 12px; background: #fff; font: inherit; text-align: left; cursor: pointer; transition: background-color .2s, border-color .2s; }
.mtg-occ-i:hover { background: #f7f9fd; }
.mtg-occ-i.is-cur { border-color: #9cc5fb; background: #f3f8ff; }
.mtg-occ-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #f1f4f9; color: var(--mmuted); }
.mtg-occ-i.is-cur .mtg-occ-ic { background: #e3eeff; color: #1677ff; }
.mtg-occ-t { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.mtg-occ-t b { font-size: 12.5px; color: var(--mtext); }
.mtg-occ-t small { font-size: 11.5px; color: var(--mmuted); }
.mtg-occ-i .mtg-chip svg { display: none; }

/* Tab Chương trình họp */
.mtg-agt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.53fr); gap: 14px; align-items: start; }
.mtg-detail .mtg-agt { position: relative; gap: 12px; padding: 18px 20px; overflow: hidden; }
.mtg-agt-head { position: relative; display: flex; align-items: center; gap: 14px; min-height: 100px; padding-right: 160px; }
.mtg-agt-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #efeaff; color: #6d4fd8; }
.mtg-agt-head h2 { margin: 0; font-size: 22px; font-weight: 800; color: var(--mtext); }
.mtg-agt-head p { margin: 4px 0 0; font-size: 12px; color: var(--mmuted); }
/* Hình nền thẻ Chương trình họp (chủ dự án 16/11/2026: ảnh chỉ là nền, mờ 0.68) — góc trên phải, sau tiêu đề */
.mtg-detail .mtg-agt::before { content: ""; position: absolute; top: 8px; right: 20px; width: 140px; height: 112px; background: url("../img/cuochop/agenda.webp") no-repeat right top / contain; opacity: .68; pointer-events: none; z-index: 0; }
.mtg-detail .mtg-agt > * { position: relative; z-index: 1; }
.mtg-agt-prog { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; padding: 10px 18px; border: 1px solid var(--mline); border-radius: 12px; background: #fff; font-size: 12px; color: var(--mmuted); }
.mtg-agt-prog b { font-size: 13.5px; color: var(--mtext); }
.mtg-agt-prog .mtg-ag-bar { flex: 1; max-width: 400px; height: 8px; }
.mtg-agis { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mtg-agi { position: relative; display: grid; grid-template-columns: 16px 20px minmax(0, 1fr) auto 28px; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--mline); border-radius: 12px; background: #fff; transition: background-color .2s, border-color .2s, opacity .2s; }
.mtg-agi.is-done { border-color: #d6f1df; background: #f1fbf4; }
.mtg-agi.is-drag { opacity: .45; }
.mtg-agi.is-over-top { box-shadow: 0 -2px 0 #1683fb; }
.mtg-agi.is-over-bot { box-shadow: 0 2px 0 #1683fb; }
.mtg-agi-h { display: grid; place-items: center; color: #94a3b8; cursor: grab; }
.mtg-agi-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mtg-agi-t b { font-size: 14px; font-weight: 700; color: var(--mtext); }
.mtg-agi-t small { font-size: 11.5px; color: var(--mmuted); }
.mtg-agi.is-done .mtg-agi-t b, .mtg-agi.is-done .mtg-agi-t small { text-decoration: line-through; color: #94a3b8; }
.mtg-agi-min { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 12px; border: 1px solid var(--mline); border-radius: 999px; background: #f7f9fc; font-size: 12px; color: var(--msoft); white-space: nowrap; }
.mtg-agi.is-done .mtg-agi-min { border-color: #c9eed6; background: #e3f7ea; color: #15803d; }
.mtg-agi.is-edit { display: block; }
.mtg-agi-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 64px auto auto; gap: 6px; }
.mtg-agi-form input { height: 32px; padding: 0 9px; border: 1px solid #dfe5ee; border-radius: 8px; font: inherit; font-size: 12.5px; }
.mtg-agt-sub { margin: 4px 0 0; font-size: 13.5px; font-weight: 700; color: var(--mtext); }
.mtg-agt-add { display: grid; grid-template-columns: 16px minmax(0, 1fr) 16px 64px auto auto; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--mline); border-radius: 12px; background: #fff; color: var(--mmuted); }
.mtg-agt-add input { height: 36px; padding: 0 12px; border: 1px solid #dfe5ee; border-radius: 9px; font: inherit; font-size: 12.5px; color: var(--mtext); }
.mtg-agt-add input:focus, .mtg-agi-form input:focus, .mtg-detail .mtg-ag-add input:focus { outline: 0; border-color: #1683fb; box-shadow: 0 0 0 3px rgba(22, 131, 251, .12); }
.mtg-agt-add .mtg-btn { height: 36px; }
.mtg-agt-total { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-radius: 12px; background: linear-gradient(100deg, #f3efff, #f7f9fe 55%, #f1f5ff); font-size: 14px; color: var(--msoft); }
.mtg-agt-total b { color: var(--mtext); font-weight: 800; }
.mtg-agt-total b.is-green { color: #16a34a; }
.mtg-agt-side { display: flex; flex-direction: column; gap: 14px; }
.mtg-h-ic { gap: 10px !important; }
.mtg-h-tile { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; }
.mtg-h-tile.is-violet { background: #efeaff; color: #6d4fd8; }
.mtg-h-tile.is-yellow { background: #fff6d6; color: #d99a06; }
.mtg-ovs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mtg-ov { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; }
.mtg-ov-ic { display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 2px; border-radius: 50%; background: #fff; }
.mtg-ov small { font-size: 11.5px; }
.mtg-ov b { font-size: 18px; font-weight: 800; }
.mtg-ov.is-green { background: #ecfbf2; color: #16a34a; }
.mtg-ov.is-blue { background: #eaf3ff; color: #1677ff; }
.mtg-ov.is-violet { background: #f2eeff; color: #6d4fd8; }
.mtg-donut { display: flex; align-items: center; gap: 14px; }
.mtg-donut svg { flex: none; }
.mtg-donut-n { font-size: 22px; font-weight: 800; fill: var(--mtext); }
.mtg-donut-u { font-size: 11px; fill: var(--mmuted); }
.mtg-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.mtg-legend li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.mtg-legend i { width: 9px; height: 9px; border-radius: 50%; }
.mtg-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mtext); }
.mtg-legend em { font-style: normal; color: var(--mmuted); white-space: nowrap; }
.mtg-tips { background: linear-gradient(180deg, #fbfaff, #fff) !important; }
.mtg-tips ul { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--mtext); }
.mtg-tips li { display: flex; align-items: flex-start; gap: 10px; }
.mtg-tips li > span { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #efeaff; color: #6d4fd8; }

/* Tab Người tham dự */
.mtg-pst-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mtg-pst { padding: 8px; border: 1px solid var(--mline); border-radius: 16px; background: #fff; }
.mtg-pst-in { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; padding: 10px 14px; border-radius: 12px; overflow: hidden; }
.mtg-pst-in::after { content: ""; position: absolute; right: -10px; bottom: -14px; width: 160px; height: 50px; border-radius: 50% 50% 0 0; background: currentColor; opacity: .08; transform: skewX(-20deg); }
.mtg-pst-ic { grid-row: 1 / span 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #fff; }
.mtg-pst-in b { font-size: 13.5px; }
.mtg-pst-in strong { font-size: 24px; font-weight: 800; line-height: 1.15; }
.mtg-pst-in small { font-size: 11.5px; color: var(--mmuted); }
.mtg-pst.is-yes .mtg-pst-in { background: #ecfbf2; color: #15803d; }
.mtg-pst.is-no .mtg-pst-in { background: #fff0f2; color: #e11d48; }
.mtg-pst.is-wait .mtg-pst-in { background: #f2eeff; color: #6d28d9; }
.mtg-pst-in b, .mtg-pst-in strong { position: relative; z-index: 1; }
.mtg-fps { display: flex; flex-wrap: wrap; gap: 8px; }
.mtg-fp { height: 30px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color .2s, background-color .2s; }
.mtg-fp.is-blue { background: #e3eeff; color: #1d6fe0; }
.mtg-fp.is-green { background: #e7f8ee; color: #15803d; }
.mtg-fp.is-rose { background: #ffeef1; color: #e11d48; }
.mtg-fp.is-violet { background: #efeaff; color: #6d28d9; }
.mtg-fp.is-on { border-color: currentColor; }
.mtg-detail .mtg-plist { padding: 14px 18px; }
.mtg-prows { display: flex; flex-direction: column; margin: 0; padding: 0 12px; border: 1px solid var(--mline); border-radius: 12px; list-style: none; }
.mtg-prows li { display: grid; grid-template-columns: 34px minmax(160px, 1.2fr) minmax(110px, .9fr) minmax(150px, 1fr) 120px 28px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eef2f7; }
.mtg-prows li:last-child { border-bottom: 0; }
.mtg-prows .mtg-pp-name b { font-size: 13.5px; }
.mtg-prows .mtg-pp-name small { font-size: 11.5px; }
.mtg-prows .mtg-chip { height: 26px; padding: 0 12px; border-radius: 999px; font-size: 12px; }
.mtg-pr-at { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--mmuted); }

/* Tab Biên bản AI / Việc phát sinh (gói Business) */
.mtg-ai-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.52fr); gap: 14px; align-items: stretch; }
.mtg-detail .mtg-ai { gap: 14px; padding: 18px 22px; }
.mtg-ai-top { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 10px; align-items: center; }
/* Hình nền thẻ AI Meeting: nửa phải phần trên (cột 270px để trống cho nền), mờ 0.68 */
.mtg-detail .mtg-ai { position: relative; overflow: hidden; }
.mtg-detail .mtg-ai::before { content: ""; position: absolute; top: -34px; right: -26px; width: 480px; height: 480px; background: url("../img/cuochop/ai-meeting.webp") no-repeat center / contain; opacity: .68; pointer-events: none; z-index: 0; }
.mtg-detail .mtg-ai > * { position: relative; z-index: 1; }
.mtg-biz-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; background: #efe9ff; font-size: 12px; font-weight: 600; color: #6d4fd8; }
.mtg-ai-main h2 { margin: 10px 0 6px; font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--mtext); }
.mtg-grad { background: linear-gradient(90deg, #6d4fd8, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mtg-ai-main > p { max-width: 440px; margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--msoft); }
.mtg-ai-feats { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.mtg-ai-feats li { display: flex; align-items: center; gap: 12px; }
.mtg-ai-fic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #d6e4fb; border-radius: 9px; background: #f5f9ff; color: #1677ff; }
.mtg-ai-fic em { font-style: normal; font-size: 9px; font-weight: 800; }
.mtg-ai-feats b { display: block; font-size: 13px; color: var(--mtext); }
.mtg-ai-feats small { font-size: 11.5px; color: var(--mmuted); }

.mtg-ai-bottom { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; padding-top: 14px; border-top: 1px solid var(--mline); }
.mtg-cmp table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mtg-cmp th { padding: 6px 8px; font-size: 11.5px; font-weight: 600; color: var(--mmuted); text-align: center; }
.mtg-cmp th:first-child { font-size: 15px; font-weight: 700; color: var(--mtext); text-align: left; }
.mtg-cmp th.is-cur { border-radius: 8px 8px 0 0; background: #f4f6f9; }
.mtg-cmp th.is-biz { border-radius: 8px 8px 0 0; background: #efe9ff; color: #6d4fd8; }
.mtg-cmp th.is-biz svg { display: inline; vertical-align: -2px; margin-right: 4px; }
.mtg-cmp td { padding: 7px 8px; border-top: 1px solid #eef2f7; color: var(--mtext); }
.mtg-cmp td.is-cur, .mtg-cmp td.is-biz { width: 96px; text-align: center; color: var(--mmuted); }
.mtg-cmp td.is-cur { background: #fafbfc; }
.mtg-cmp td.is-biz { background: #faf8ff; }
.mtg-ok { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #22c55e; color: #fff; }
.mtg-upg { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.mtg-upg h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 700; color: var(--mtext); }
.mtg-upg h3 svg { color: #f59e0b; }
.mtg-upg p { margin: 0; font-size: 12px; line-height: 1.55; color: var(--mmuted); }
.mtg-upg .mtg-btn { align-self: stretch; }
.mtg-upg .mtg-chip { align-self: flex-start; }
.mtg-detail .mtg-fu { gap: 10px; padding: 18px 20px; }
.mtg-fu-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 10px; background: #f3f0ff; color: #6d4fd8; }
.mtg-fu-pill b { font-size: 15px; color: var(--mtext); }
.mtg-fu > p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--msoft); }
.mtg-fu-demo { position: relative; flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 380px; padding: 14px 16px; border: 1px solid var(--mline); border-radius: 14px; background: linear-gradient(180deg, #fafbff, #f4f6fd); }
.mtg-fu-demo > b { margin-bottom: 4px; font-size: 13px; color: var(--msoft); }
.mtg-fu-demo small { font-weight: 400; color: var(--mmuted); }
.mtg-fu-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) 22px 40px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eceff6; font-size: 12px; color: #94a3b8; opacity: .8; }
.mtg-fu-row em { font-style: normal; text-align: right; }
.mtg-fu-lock { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(340px, 86%); padding: 18px 16px; border: 1px solid #ebe7fb; border-radius: 14px; background: rgba(255, 255, 255, .92); text-align: center; box-shadow: 0 8px 24px rgba(86, 100, 170, .1); }
.mtg-fu-lock > span { display: grid; place-items: center; width: 40px; height: 40px; margin-top: -38px; border-radius: 50%; background: #fff; color: #6d4fd8; box-shadow: 0 4px 12px rgba(109, 79, 216, .18); }
.mtg-fu-lock b { font-size: 14px; color: var(--mtext); }
.mtg-fu-lock small { font-size: 12px; color: var(--mmuted); }

/* Chờ tải */
.mtg-skel { display: flex; flex-direction: column; gap: 12px; }
.mtg-skel-head { height: 100px; border-radius: 16px; background: #eef2f7; }
.mtg-skel-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mtg-skel-row div { height: 240px; border-radius: 16px; background: #eef2f7; }

/* Hẹp dần (container mtgp của .mtg-page) */
@container mtgp (max-width: 1100px) {
  .mtg-detail .mtg-d-head { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .mtg-detail .mtg-d-acts { grid-column: 2 / span 2; justify-self: start; margin-top: 10px; }
  .mtg-detail .mtg-d-org { border-right: 0; padding-right: 0; }
  .mtg-detail .mtg-d-row3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtg-detail .mtg-d-row2 { grid-template-columns: minmax(0, 1fr); }
  .mtg-agt-grid, .mtg-ai-grid { grid-template-columns: minmax(0, 1fr); }
  .mtg-occ { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtg-prows li { grid-template-columns: 34px minmax(0, 1fr) auto auto 28px; }
  .mtg-pr-at { display: none; }
}
@container mtgp (max-width: 720px) {
  .mtg-detail .mtg-d-row3, .mtg-pst-row, .mtg-ai-bottom, .mtg-ai-top { grid-template-columns: minmax(0, 1fr); }
  .mtg-detail .mtg-d-head { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .mtg-detail .mtg-d-ic, .mtg-detail .mtg-d-org, .mtg-detail .mtg-d-edit, .mtg-detail .mtg-agt::before, .mtg-detail .mtg-ai::before { display: none; }
  .mtg-detail .mtg-d-acts { grid-column: 1; width: 100%; margin-top: 12px; }
  .mtg-detail .mtg-join-main { flex: 1; }
  .mtg-detail .mtg-d-title h1 { font-size: 20px; }
  .mtg-detail .mtg-d-tabs { padding: 0 2px; border-radius: 0; border-width: 1px 0; overflow-x: auto; }
  .mtg-detail .mtg-rsvp { flex-wrap: wrap; }
  .mtg-detail .mtg-rsvp-t { flex-basis: calc(100% - 54px); }
  .mtg-detail .mtg-rsvp .mtg-btn { flex: 1; }
  .mtg-detail .mtg-ended { flex-wrap: wrap; }
  .mtg-detail .mtg-ended b { flex-basis: calc(100% - 34px); }
  .mtg-occ { grid-template-columns: minmax(0, 1fr); }
  .mtg-agt-head { padding-right: 0; min-height: 0; }
  .mtg-agi { grid-template-columns: 20px minmax(0, 1fr) 28px; }
  .mtg-agi-h { display: none; }
  .mtg-agi-min { grid-column: 2; justify-self: start; }
  .mtg-agt-add { grid-template-columns: minmax(0, 1fr) 64px auto; }
  .mtg-agt-add > .mtg-agi-h, .mtg-agt-add > svg, .mtg-agt-add > .mtg-muted { display: none; }
  .mtg-agi-form { grid-template-columns: minmax(0, 1fr); }
  .mtg-detail .mtg-tasks li { grid-template-columns: 16px minmax(0, 1fr) auto 40px; }
  .mtg-detail .mtg-tasks .mtg-tk-av, .mtg-detail .mtg-tasks li > .mtg-tk-x { display: none; }
  .mtg-prows li { grid-template-columns: 34px minmax(0, 1fr) auto 28px; }
  .mtg-prows li > span:nth-child(5):empty { display: none; }
  .mtg-detail .mtg-crumb-cur, .mtg-detail .mtg-crumb-sep:has(+ .mtg-crumb-cur) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mtg-btn, .mtg-soft, .mtg-cb, .mtg-occ-i, .mtg-agi, .mtg-fp, .mtg-detail .mtg-ag-bar i { transition: none; }
}

/* Cài đặt › Không gian làm việc › Từ điển giọng nói (settings.js wsVoiceCardHTML) */
.ws-voice { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.ws-voice .ws-field-hint { margin: 0; }
.ws-voice-terms { min-height: 96px; resize: vertical; font-family: inherit; }
.ws-voice-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Thời gian mục chương trình sửa tại chỗ (meetings.js mtgMinHTML) */
button.mtg-ag-min.is-btn, button.mtg-agi-min.is-btn { font: inherit; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
button.mtg-ag-min.is-btn { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border: 1px solid transparent; border-radius: 6px; background: none; font-size: 12px; color: var(--mmuted, #64748b); }
button.mtg-ag-min.is-btn:hover, button.mtg-agi-min.is-btn:hover { border-color: #c9ddfb; background: #f2f7ff; color: #1677ff; }
button.mtg-agi-min.is-btn { font-size: 12px; }
.mtg-ag-min.is-empty, .mtg-agi-min.is-empty { border-style: dashed !important; border-color: #cfd8e6 !important; background: transparent !important; color: #94a3b8; }
.mtg-ag-min.is-editing, .mtg-agi-min.is-editing { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; }
.mtg-min-in, .mtg-agenda input.mtg-min-in { width: 56px; height: 26px; padding: 0 6px; border: 1px solid #1683fb; border-radius: 7px; font: inherit; font-size: 12.5px; text-align: right; box-shadow: 0 0 0 3px rgba(22, 131, 251, .12); outline: 0; }
.mtg-ag-min.is-editing small, .mtg-agi-min.is-editing small { font-size: 11.5px; color: var(--mmuted, #64748b); }

/* =====================================================
   BIÊN BẢN AI CỦA CUỘC HỌP (Đợt A2 + bố cục ảnh mẫu 16/11/2026, meetings.js mtgMinutesTabHTML)
   Cột trái "Nguồn dữ liệu cho AI" ~37% + cột phải thẻ "Biên bản AI"; thẻ trắng viền mảnh, nhấn tím cho phần AI, xanh cho thao tác.
   ===================================================== */
.mtg-mn-lead { margin: 0; font-size: 13px; line-height: 1.55; color: var(--msoft, #475569); }
.mtg-mn-ta { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #dfe5ee; border-radius: 12px; background: #fff; font: inherit; font-size: 13px; line-height: 1.55; color: var(--mtext, #0f172a); resize: vertical; transition: border-color .2s, box-shadow .2s; }
.mtg-mn-ta:focus, .mtg-mn-in:focus { outline: 0; border-color: #1683fb; box-shadow: 0 0 0 3px rgba(22, 131, 251, .12); }
.mtg-mn-field { margin: 0; }
.mtg-mn-field.has-error .mtg-mn-ta { border-color: var(--danger, #fb7185); background: var(--danger-50, #fff1f3); }
.mtg-mn-ta[readonly] { background: #f8fafc; color: var(--mmuted, #64748b); }
.mtg-mn-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.mtg-mn-foot small { margin-right: auto; font-size: 12px; color: var(--mmuted, #64748b); }
.mtg-mn-foot .set-spinner { border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }
.mtg-mn-in { box-sizing: border-box; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid #dfe5ee; border-radius: 9px; background: #fff; font: inherit; font-size: 13px; color: var(--mtext, #0f172a); transition: border-color .2s, box-shadow .2s; }
textarea.mtg-mn-in { height: auto; padding: 8px 10px; }
.mtg-mn-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mtg-mn-list li { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 6px; align-items: center; }
.mtg-mn-list.is-actions li { grid-template-columns: minmax(0, 1fr) 130px 132px 140px 30px; }
.mtg-mn-del { border-color: transparent; color: #94a3b8; }
.mtg-mn-del:hover { background: #fff1f3; color: var(--danger, #fb7185); }
.mtg-mn-add { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 8px; padding: 4px 8px; border: 1px dashed #cfd8e6; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #1677ff; cursor: pointer; transition: background-color .2s, border-color .2s; }
.mtg-mn-add:hover { border-color: #9cc3fb; background: #f2f7ff; }
.mtg-detail .mtg-mn-empty { align-items: center; gap: 6px; padding: 34px 20px; text-align: center; }
.mtg-mn-empty-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #f3effe; color: #7c3aed; }
.mtg-mn-empty b { font-size: 15px; color: var(--mtext, #0f172a); }
.mtg-mn-empty p { max-width: 460px; margin: 0; font-size: 13px; line-height: 1.55; color: var(--mmuted, #64748b); }

/* Bố cục 2 cột */
.mtg-mn2 { display: grid; grid-template-columns: minmax(0, 37fr) minmax(0, 63fr); gap: 14px; align-items: start; }
.mtg-mn2.is-full { grid-template-columns: minmax(0, 1fr); }
.mtg-mn2-side { display: grid; gap: 12px; min-width: 0; }

/* Cột trái: Nguồn dữ liệu cho AI */
.mtg-detail .mtg-aisrc { gap: 10px; padding: 16px; }
.mtg-src-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 2px; }
.mtg-src-spark { flex: none; color: #7c5cf6; }
.mtg-src-top h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--mtext, #0f172a); }
.mtg-src-top p { margin: 3px 0 0; font-size: 12.5px; color: var(--mmuted, #64748b); }
.mtg-src-item { border: 1px solid var(--mline, #e8edf5); border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.mtg-src-item.is-open { border-color: #dce6f5; box-shadow: 0 2px 10px rgba(86, 100, 170, .04); }
.mtg-src-h { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 14px; background: none; font: inherit; text-align: left; cursor: pointer; transition: background-color .2s; }
.mtg-src-h:hover { background: #f8fafd; }
.mtg-src-h:focus-visible { outline: 2px solid #1683fb; outline-offset: -2px; }
.mtg-src-ic { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #eef4ff; color: #1683fb; }
.mtg-src-t { display: grid; flex: 1; gap: 2px; min-width: 0; }
.mtg-src-t b { font-size: 14px; color: var(--mtext, #0f172a); }
.mtg-src-t small { font-size: 12px; line-height: 1.4; color: var(--mmuted, #64748b); }
.mtg-src-chev { display: grid; flex: none; place-items: center; color: #64748b; transform: rotate(0deg); transition: transform .2s; }
.mtg-src-item.is-open .mtg-src-chev { transform: rotate(180deg); }
.mtg-src-soon { flex: none; padding: 2px 9px; border-radius: 999px; background: #f1f5f9; font-size: 11.5px; font-weight: 600; color: #64748b; }
.mtg-src-b > div { display: grid; gap: 8px; padding: 0 14px; }
.mtg-src-item.is-open .mtg-src-b > div { padding-bottom: 14px; }
.mtg-src-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--mline, #e8edf5); border-radius: 12px; background: #fbfcfe; }
.mtg-src-play { display: grid; flex: none; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: #e3efff; color: #1683fb; cursor: pointer; transition: background-color .2s; }
.mtg-src-play:hover { background: #d3e5ff; }
.mtg-src-play.is-wait { cursor: default; }
.mtg-src-fn { display: grid; flex: 1; gap: 3px; min-width: 0; }
.mtg-src-fn b { overflow: hidden; font-size: 13px; color: var(--mtext, #0f172a); white-space: nowrap; text-overflow: ellipsis; }
.mtg-src-fn small { font-size: 12px; color: var(--mmuted, #64748b); }
.mtg-src-ok { display: inline-flex; flex: none; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: #e7f8ee; font-size: 11.5px; font-weight: 600; color: #15803d; white-space: nowrap; }
.mtg-src-more { position: relative; flex: none; }
.mtg-src-more .mtg-btn.is-icon { border-color: transparent; background: none; }
.mtg-src-more .mtg-menu, .mtg-mnd-vis .mtg-menu { min-width: 190px; }
.mtg-src-more label.mtg-menu-item { cursor: pointer; }
.mtg-src-bar { display: block; height: 6px; overflow: hidden; border-radius: 99px; background: #e8eef7; }
.mtg-src-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38bdf8, #1683fb); transition: width .2s; }
.mtg-src-drop { display: grid; justify-items: center; gap: 4px; padding: 18px 12px; border: 1.5px dashed #cfdbec; border-radius: 12px; background: #fbfcfe; color: #1683fb; text-align: center; cursor: pointer; transition: background-color .2s, border-color .2s; }
.mtg-src-drop:hover, .mtg-src-drop.is-over { border-color: #8cbcf8; background: #f2f7ff; }
.mtg-src-drop b { font-size: 13px; font-weight: 600; color: var(--mtext, #0f172a); }
.mtg-src-drop small { font-size: 12px; color: var(--mmuted, #64748b); }
.mtg-src-use { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--msoft, #475569); cursor: pointer; }
.mtg-src-use input { width: 15px; height: 15px; margin: 0; accent-color: #1683fb; }
.mtg-src-err { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 12.5px; color: var(--danger-600, #e11d48); }
.mtg-src-note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--mmuted, #64748b); }
.mtg-src-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.mtg-src-tools label.mtg-soft { cursor: pointer; }
.mtg-src-tools .is-disabled { opacity: .55; pointer-events: none; }
.mtg-detail .mtg-src-ta { min-height: 110px; max-height: 260px; padding: 9px 11px; background: #fbfcfe; font-size: 12.5px; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, .4) transparent; }
.mtg-src-count { justify-self: end; font-size: 11.5px; color: var(--mmuted, #64748b); }
.mtg-detail .mtg-btn.mtg-src-go { width: 100%; height: 44px; margin-top: 4px; border-radius: 12px; font-size: 14px; }
.mtg-src-status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid; border-radius: 12px; font-size: 12.5px; font-weight: 600; }
.mtg-src-status.is-ok { border-color: #d3f1df; background: #effbf4; color: #15803d; }
.mtg-src-status.is-busy { border-color: #d6e6fb; background: #f2f7ff; color: #1677ff; }
.mtg-src-status.is-busy .set-spinner { border-color: #cfe2fb; border-top-color: #1683fb; }
.mtg-detail .mtg-tipc { gap: 6px; padding: 14px 16px; }
.mtg-tipc h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; color: var(--mtext, #0f172a); }
.mtg-tipc h3 span { display: grid; color: #f59e0b; }
.mtg-tipc ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; list-style: disc; font-size: 12.5px; line-height: 1.6; color: var(--msoft, #475569); }
.mtg-detail .mtg-usec { flex-direction: row; align-items: center; gap: 10px; padding: 12px 16px; border-color: #e7defc; background: linear-gradient(90deg, #f8f5ff, #fbfaff); font-size: 13px; color: #6d28d9; }
.mtg-usec-ic { display: grid; color: #7c5cf6; }
.mtg-usec b { font-weight: 700; }
.mtg-usec > span:nth-child(2) { flex: 1; }
.mtg-usec-i { display: grid; color: #8b7cf6; cursor: help; }

/* Cột phải: thẻ Biên bản AI */
.mtg-detail .mtg-mnd { gap: 12px; padding: 16px; }
.mtg-mnd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mtg-mnd-ic { display: grid; flex: none; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #eef4ff; color: #1683fb; }
.mtg-mnd-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--mtext, #0f172a); }
.mtg-mnd-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 999px; background: #f1ecff; font-size: 12px; font-weight: 600; color: #6d28d9; }
.mtg-mnd-chip.is-final { background: #e7f8ee; color: #15803d; }
.mtg-mnd-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.mtg-mnd-vis { position: relative; }
.mtg-mnd-vis .mtg-menu.is-wide { min-width: 270px; }
.mtg-mnd-vis .mtg-menu-item { align-items: flex-start; }
.mtg-mnd-vis .mtg-menu-item span { display: grid; gap: 2px; }
.mtg-mnd-vis .mtg-menu-item small { font-size: 11.5px; color: var(--mmuted, #64748b); }
.mtg-mnd-vis .mtg-menu-item.is-on { background: #f2f7ff; color: #1677ff; }
.mtg-mnd-sec { border: 1px solid var(--mline, #e8edf5); border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.mtg-mnd-sec.is-editing { border-color: #b9d4fb; box-shadow: 0 0 0 3px rgba(22, 131, 251, .07); }
.mtg-mnd-sh { display: flex; align-items: center; gap: 10px; padding: 11px 14px 6px; }
.mtg-mnd-sic { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #eef4ff; color: #1683fb; }
.mtg-mnd-sh h3 { flex: 1; margin: 0; font-size: 15px; font-weight: 700; color: var(--mtext, #0f172a); }
.mtg-mnd-pen { display: inline-flex; align-items: center; gap: 5px; height: 30px; min-width: 30px; justify-content: center; padding: 0 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: #64748b; cursor: pointer; transition: background-color .2s, color .2s; }
.mtg-mnd-pen:hover { background: #f1f5f9; color: #1677ff; }
.mtg-mnd-pen.is-on { background: #eaf3ff; color: #1677ff; }
.mtg-mnd-pen:focus-visible { outline: 2px solid #1683fb; outline-offset: 2px; }
.mtg-mnd-body { padding: 2px 16px 14px; }
.mtg-mnd-none { margin: 0; font-size: 13px; color: #94a3b8; }
.mtg-mnd-hint { display: block; margin-top: 4px; font-size: 11.5px; color: var(--mmuted, #64748b); }
.mtg-mnd-ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; list-style: disc; font-size: 13px; line-height: 1.6; color: #334155; }
.mtg-mnd-checks { display: grid; margin: 0; padding: 0; list-style: none; }
.mtg-mnd-checks li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-top: 1px solid #eef2f7; font-size: 13px; line-height: 1.5; color: #334155; }
.mtg-mnd-checks li:first-child { border-top: 0; padding-top: 2px; }
.mtg-mnd-ck { display: grid; flex: none; place-items: center; width: 17px; height: 17px; margin-top: 1px; border-radius: 4px; background: #22c55e; color: #fff; }
.mtg-mnd-tbl { display: grid; font-size: 13px; }
.mtg-mnd-tr { display: grid; grid-template-columns: 22px minmax(0, 1.7fr) minmax(0, 1.25fr) 84px minmax(0, 0.95fr); gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid #eef2f7; color: #334155; }
.mtg-mnd-tr:last-child { border-bottom: 0; }
.mtg-mnd-tr.is-head { padding: 7px 6px; border: 0; border-radius: 8px; background: #f5f7fb; font-size: 12px; font-weight: 600; color: var(--mmuted, #64748b); }
.mtg-mnd-tr.is-done .mtg-mnd-tt { color: #94a3b8; text-decoration: line-through; }
.mtg-mnd-tt { min-width: 0; overflow-wrap: anywhere; }
.mtg-detail .mtg-mnd-tt .mtg-fu-name { font-weight: 500; }
.mtg-mnd-ghost { display: block; width: 16px; height: 16px; border: 1.5px solid #dbe2ec; border-radius: 4px; background: #f8fafc; }
.mtg-mnd-who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.mtg-mnd-who > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mtg-mnd-due { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 7px; background: #f1f5f9; font-size: 12px; font-weight: 600; color: #475569; white-space: nowrap; }
.mtg-mnd-due.is-late { background: #fff1f3; color: #e11d48; }
.mtg-mnd-proj { display: inline-block; max-width: 100%; overflow: hidden; padding: 3px 9px; border-radius: 7px; background: #eaf3ff; font-size: 12px; font-weight: 600; color: #1677ff; white-space: nowrap; text-overflow: ellipsis; vertical-align: middle; }
.mtg-mnd-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 14px; border-radius: 12px; background: #f6f8fb; font-size: 12.5px; color: var(--mmuted, #64748b); }
.mtg-mnd-src { display: inline-flex; align-items: center; gap: 6px; color: var(--msoft, #475569); }
.mtg-mnd-biz { padding: 2px 10px; border-radius: 999px; background: #efe9ff; font-size: 12px; font-weight: 600; color: #6d28d9; }
.mtg-mnd-empty { display: grid; justify-items: center; gap: 6px; padding: 54px 20px; border: 1.5px dashed #dfe6f1; border-radius: 14px; text-align: center; }
.mtg-mnd-empty > span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #f3effe; color: #7c3aed; }
.mtg-mnd-empty b { font-size: 15px; color: var(--mtext, #0f172a); }
.mtg-mnd-empty p { max-width: 420px; margin: 0; font-size: 13px; line-height: 1.55; color: var(--mmuted, #64748b); }
.mtg-mnd-skel { display: grid; gap: 12px; padding: 10px 2px; }
.mtg-mnd-skel i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #eef2f7 25%, #f6f8fb 50%, #eef2f7 75%); background-size: 200% 100%; animation: npSkel 1.4s linear infinite; }
.mtg-mnd-skel i:nth-child(2n) { width: 78%; }
.mtg-mnd-skel i:nth-child(3n) { width: 62%; }
@media (prefers-reduced-motion: reduce) { .mtg-mnd-skel i { animation: none; } .mtg-src-chev { transition: none; } }

@container mtgp (max-width: 1000px) {
  .mtg-mn2 { grid-template-columns: minmax(0, 1fr); }
  .mtg-mn-list.is-actions li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; }
  .mtg-mn-list.is-actions li > .mtg-mn-del { grid-column: 3; grid-row: 1; }
  .mtg-mn-list.is-actions li > .mtg-mn-in:first-child { grid-column: 1 / 3; }
}
@container mtgp (max-width: 620px) {
  .mtg-mn-list.is-actions li { grid-template-columns: minmax(0, 1fr) 30px; }
  /* Tên việc + nút xóa cùng hàng đầu; người phụ trách, hạn, dự án xuống hàng riêng */
  .mtg-mn-list.is-actions li > .mtg-mn-del { grid-column: 2; grid-row: 1; }
  .mtg-mn-list.is-actions li > :not(.mtg-mn-del):not(:first-child) { grid-column: 1 / -1; }
  .mtg-mn-list.is-actions li > .mtg-mn-in:first-child { grid-column: 1; }
  .mtg-mnd-acts { margin-left: 0; width: 100%; }
  .mtg-mnd-tr.is-head { display: none; }
  .mtg-mnd-tr { grid-template-columns: 22px minmax(0, 1fr) auto; row-gap: 6px; }
  .mtg-mnd-tr > :nth-child(2), .mtg-mnd-tr > :nth-child(3) { grid-column: 2 / -1; } /* tên việc + người phụ trách trải cả hàng */
  .mtg-mnd-tr > :nth-child(4) { grid-column: 2; }
  .mtg-mnd-tr > :nth-child(5) { grid-column: 3; justify-self: end; }
}

/* Việc phát sinh (Đợt A3, meetings.js mtgFollowupTabHTML): tạo việc từ biên bản + tiến độ + việc lần trước chưa xong */
.mtg-fu-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.mtg-fu-make { grid-column: 1 / -1; }
/* Không có thẻ "Việc chưa xong từ các lần trước" thì thẻ Tiến độ trải hết chiều ngang */
.mtg-fu-prog:last-child { grid-column: 1 / -1; }
.mtg-detail .mtg-fu-make .mtg-card-head h2 svg { color: #7c3aed; }
.mtg-fu-go { align-self: flex-start; }
.mtg-fu-make-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mtg-fu-make-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 160px 140px 190px; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid #eef2f7; border-radius: 12px; background: #fbfcfe; }
.mtg-fu-make-list li.is-made { grid-template-columns: 24px minmax(0, 1fr) auto; background: #fff; }
.mtg-fu-cbw { display: grid; place-items: center; cursor: pointer; }
.mtg-fu-cb { width: 16px; height: 16px; accent-color: #1683fb; cursor: pointer; }
.mtg-fu-title { min-width: 0; font-size: 13px; font-weight: 600; color: var(--mtext, #0f172a); overflow-wrap: anywhere; }
.mtg-fu-in[aria-invalid="true"] { border-color: var(--danger, #fb7185); background: var(--danger-50, #fff1f3); }
.mtg-fu-ok { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e6f7ee; color: #047857; }
.mtg-fu-name { min-width: 0; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--mtext, #0f172a); text-align: left; cursor: pointer; overflow-wrap: anywhere; transition: color .2s; }
.mtg-fu-name:hover { color: #1677ff; }
.mtg-fu-st { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; background: var(--b); color: color-mix(in srgb, var(--c) 72%, #0f172a); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.mtg-fu-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mtg-fu-err { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 12.5px; color: var(--danger-600, #e11d48); }
.mtg-fu-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mtg-fu-tile { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #e6eefb; border-radius: 12px; background: #f6faff; }
.mtg-fu-tile b { font-size: 22px; line-height: 1.1; color: var(--mtext, #0f172a); }
.mtg-fu-tile small { font-size: 12px; color: var(--mmuted, #64748b); }
.mtg-fu-tile.is-green { border-color: #d3f1df; background: #f1fbf5; }
.mtg-fu-tile.is-green b { color: #047857; }
.mtg-fu-tile.is-red { border-color: #ffd9df; background: #fff5f6; }
.mtg-fu-tile.is-red b { color: #e11d48; }
.mtg-fu-bar { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.mtg-fu-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38bdf8, #1683fb); transition: width .2s; }
.mtg-fu-pct { margin: -2px 0 0; font-size: 12px; color: var(--mmuted, #64748b); }
.mtg-fu-list { display: grid; margin: 0; padding: 0; list-style: none; }
.mtg-fu-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid #eef2f7; font-size: 13px; }
.mtg-fu-list li:first-child { border-top: 0; }
.mtg-fu-list li.is-done .mtg-fu-name { color: var(--mmuted, #64748b); text-decoration: line-through; }
.mtg-fu-carry .mtg-fu-list li { grid-template-columns: minmax(0, 1fr) auto auto 84px auto; }
.mtg-fu-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--msoft, #475569); white-space: nowrap; }
.mtg-fu-due { font-size: 12px; color: var(--mmuted, #64748b); text-align: right; }
.mtg-fu-due.is-late { color: #e11d48; font-weight: 600; }
.mtg-fu-from { padding: 2px 8px; border: 1px solid #e5e9f2; border-radius: 999px; background: #fff; font: inherit; font-size: 11.5px; color: var(--msoft, #475569); white-space: nowrap; cursor: pointer; transition: background-color .2s; }
.mtg-fu-from:hover { background: #f2f7ff; }

@container mtgp (max-width: 1000px) {
  .mtg-fu-grid { grid-template-columns: minmax(0, 1fr); }
  .mtg-fu-make-list li { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr); }
  .mtg-fu-make-list li > .mtg-fu-in { grid-column: 2 / -1; }
}
@container mtgp (max-width: 620px) {
  .mtg-fu-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtg-fu-make-list li { grid-template-columns: 24px minmax(0, 1fr); }
  .mtg-fu-make-list li.is-made { grid-template-columns: 24px minmax(0, 1fr); }
  .mtg-fu-make-list li.is-made > .mtg-fu-chips { grid-column: 2; }
  .mtg-fu-list li, .mtg-fu-carry .mtg-fu-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .mtg-fu-list li > .mtg-fu-name { grid-column: 1 / -1; }
}

/* Khung trắng của thanh tab chế độ xem bao cả nút < / > (projects.js projectViewBarHTML: .pv-bar > .pv-frame > [< khay >]).
   Khay bên trong chỉ còn việc cuộn ngang: bỏ nền / viền / bóng / đệm của khay cũ, khung .pv-frame nhận các kiểu đó. */
.pv-bar .pv-frame {
  display: flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%;
  box-sizing: border-box; height: var(--toolbar-h); padding: 2px;
  border: 1px solid rgba(226, 232, 240, 0.9); border-radius: var(--radius-sm); background: var(--surface);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.pv-bar .pv-frame .view-tabs { flex: 0 1 auto; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }

/* ---------- Hộp mời nâng gói (settings.js moPopupNangCap) — theo ảnh mẫu 16/11/2026 ----------
   .is-pro: nền trắng + quầng xanh lá / vàng bên phải, điểm nhấn xanh lá → vàng (dùng cho cả Standard).
   .is-business: nền hồng nhạt → xanh băng, điểm nhấn hồng → tím → xanh. Nằm trên mọi hộp thoại khác (bấm từ trong hộp Tính năng). */
#modal-upg { z-index: 75; }
body:has(#modal-upg-toggle:checked) #modal-upg { visibility: visible; opacity: 1; transition: opacity 0.3s ease, visibility 0s linear 0s; }
body:has(#modal-upg-toggle:checked) #modal-upg .modal-box { transform: scale(1); opacity: 1; }
.upg-box {
  --upg-a: #22c55e; --upg-b: #facc15; --upg-ink: #15803d; --upg-ico-bg: #ecfdf3; --upg-ico: #16a34a;
  position: relative; display: block; width: min(820px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 30px 36px 22px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .7);
  background: radial-gradient(ellipse 55% 70% at 78% 38%, rgba(187, 247, 208, .55), rgba(254, 249, 195, .35) 45%, transparent 72%), #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .22);
  scrollbar-width: thin;
}
.upg-box.is-business {
  --upg-a: #f472b6; --upg-b: #60a5fa; --upg-ink: #db2777; --upg-ico-bg: #fdf2f8; --upg-ico: #db2777;
  background: radial-gradient(ellipse 50% 45% at 8% 0%, rgba(251, 207, 232, .7), transparent 70%),
    radial-gradient(ellipse 55% 60% at 100% 100%, rgba(191, 219, 254, .75), transparent 70%), linear-gradient(135deg, #fff5fa, #f8faff 55%, #eef5ff);
}
.upg-x { position: absolute; top: 18px; right: 18px; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background .2s, color .2s; }
.upg-x:hover { background: rgba(15, 23, 42, .06); color: var(--ink); }
.upg-box:focus { outline: none; }
.upg-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.upg-main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.upg-brand { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; }
.upg-brand img { width: 30px; height: 30px; object-fit: contain; }
.upg-brand b { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.upg-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: 999px; font-size: 15px; font-weight: 600;
  background: #fef3c7; color: #92400e; }
.upg-chip svg { color: #d97706; }
.is-business .upg-chip { height: 36px; padding: 0 18px; background: #fce7f3; color: #be185d; border: 1px solid #fbcfe8; }
.is-business .upg-chip svg { color: #db2777; }
.upg-main h2 { margin: 14px 0 10px; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.18; font-weight: 800; color: #1e293b; letter-spacing: -.02em; }
.upg-name { font-style: normal; background: linear-gradient(90deg, var(--upg-a), var(--upg-b)); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.is-pro .upg-name { background-image: linear-gradient(90deg, #16a34a 10%, #a3c614 60%, #eab308); }
:is(.is-business, .is-standard) .upg-main h2 { font-size: clamp(24px, 3vw, 31px); }
:is(.is-business, .is-standard) .upg-name { display: block; width: fit-content; }
.is-business .upg-name { background-image: linear-gradient(90deg, #ec4899, #a855f7 60%, #6366f1); }
.upg-sub { margin: 0 0 18px; max-width: 34em; font-size: 15px; line-height: 1.5; color: #475569; }
.upg-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.upg-list li { display: flex; align-items: center; gap: 16px; font-size: 16px; font-weight: 500; color: #1e293b; }
.upg-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 42px; border-radius: 11px;
  background: var(--upg-ico-bg); color: var(--upg-ico); }
.upg-art { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-width: 0; padding-top: 34px; }
.upg-img { display: block; width: 100%; max-width: 380px; height: auto; margin: 0 auto; }
.upg-fit { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; border: 1px solid rgba(187, 247, 208, .9);
  background: linear-gradient(90deg, #ecfdf3, #fefce8); }
.upg-fit b { font-size: 16px; font-weight: 600; line-height: 1.35; color: #14532d; }
.upg-fit-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: #d1fae5; color: #15803d; }
:is(.is-business, .is-standard) .upg-fit { gap: 16px; padding: 16px 20px; border-color: #dbeafe; background: rgba(219, 234, 254, .6); }
:is(.is-business, .is-standard) .upg-fit b { font-weight: 500; color: #1e293b; }
:is(.is-business, .is-standard) .upg-fit-ico { width: 46px; height: 46px; border-radius: 0; padding-right: 16px; box-sizing: content-box; background: none; color: #2563eb; border-right: 1px solid #bfdbfe; }
:is(.is-business, .is-standard) .upg-fit-ico svg { width: 30px; height: 30px; }
.upg-foot { display: flex; align-items: flex-start; justify-content: center; gap: 28px; margin-top: 22px; padding-top: 22px; border-top: 1px solid rgba(148, 163, 184, .28); }
.upg-later { flex: 0 1 260px; height: 52px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; font-size: 17px; font-weight: 600; color: #334155; cursor: pointer;
  transition: background .2s, border-color .2s; }
.upg-later:hover { background: #f1f5f9; border-color: #94a3b8; }
.upg-go-wrap { flex: 0 1 420px; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.upg-go { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 52px; padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer;
  font-size: 17px; font-weight: 700; color: #fff; background: linear-gradient(90deg, #22c55e, #4ec36a 55%, #facc15); box-shadow: 0 10px 24px rgba(34, 197, 94, .28);
  transition: filter .2s, box-shadow .2s; }
.is-business .upg-go { background: linear-gradient(90deg, #f472b6, #c084fc 55%, #60a5fa); box-shadow: 0 10px 24px rgba(192, 132, 252, .3); }
.upg-go:hover { filter: brightness(1.04) saturate(1.05); }
.upg-go:focus-visible, .upg-later:focus-visible, .upg-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.upg-go-wrap small { font-size: 13.5px; color: #64748b; text-align: center; }
/* Nhãn gói bấm được (Cài đặt › Tính năng, Workload) + nút xem gói ở trang Báo cáo bị khóa */
.auto-switch[data-action="plan-upsell"] { cursor: pointer; }
.rep-lock-act { margin-top: 14px; } /* nút Xem gói trong khung trống của mục Báo cáo bị khóa */
@media (max-width: 720px) {
  .upg-box { padding: 22px 18px 18px; }
  .upg-grid { grid-template-columns: 1fr; gap: 14px; }
  .upg-art { padding-top: 0; }
  .upg-img { display: none; }
  .upg-foot { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .upg-later, .upg-go-wrap { flex: none; width: 100%; }
  .upg-later, .upg-go { height: 46px; font-size: 16px; }
  .upg-list li { font-size: 15px; }
  .upg-ico { width: 38px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .upg-x, .upg-later, .upg-go { transition: none; } }
/* Nhãn tên gói cạnh tính năng bị khóa (shared.js planTagHTML) — mẫu 17/11/2026: viên thuốc trong suốt, viền + vương miện chuyển màu */
.plan-tag {
  /* Pro xanh lá → vàng, Standard bạc hà → xanh băng; Business xanh nước chính 6 phần + hồng phụ 4 phần (giữ màu chính tới 30%
     rồi chuyển dần -> điểm giữa ~60%) — chủ dự án chốt 17/11/2026 */
  --pt-in: linear-gradient(90deg, #ecfdf3, #fff 55%, #fff4dc); --pt-line: linear-gradient(90deg, #86efac, #fcd34d); --pt-ico: linear-gradient(135deg, #4ade80, #eab308);
  display: inline-flex; align-items: center; gap: 4px; height: 20px; margin-left: 6px; padding: 0 8px 0 6px; vertical-align: middle;
  border: 1px solid transparent; border-radius: 999px; background: var(--pt-in) padding-box, var(--pt-line) border-box;
  font: inherit; font-size: 11.5px; font-weight: 700; line-height: 1; color: #1f2937; white-space: nowrap; letter-spacing: 0;
}
.plan-tag.is-business { --pt-in: linear-gradient(90deg, #dff3fe 30%, #fce7f3); --pt-line: linear-gradient(90deg, #38bdf8 30%, #f472b6); --pt-ico: linear-gradient(135deg, #0ea5e9 30%, #ec4899); color: #0c4a6e; }
.plan-tag.is-free { --pt-in: linear-gradient(90deg, #f1f5f9, #f8fafc); --pt-line: linear-gradient(90deg, #cbd5e1, #e2e8f0); --pt-ico: linear-gradient(135deg, #94a3b8, #cbd5e1); color: #475569; }
.plan-tag.is-standard { --pt-in: linear-gradient(90deg, #ecfdf8, #fff 55%, #e9f7ff); --pt-line: linear-gradient(90deg, #99f6e4, #bae6fd); --pt-ico: linear-gradient(135deg, #14b8a6, #38bdf8); color: #134e4a; }
.plan-tag-ico { flex: none; width: 13px; height: 13px; background: var(--pt-ico);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8l4 4 4-6 4 6 4-4-1.5 10h-13L4 8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8l4 4 4-6 4 6 4-4-1.5 10h-13L4 8z'/%3E%3C/svg%3E") center / contain no-repeat; }
button.plan-tag { cursor: pointer; transition: filter .2s; }
button.plan-tag:hover { filter: brightness(.97) saturate(1.2); }
button.plan-tag:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Công tắc của tính năng khóa vì gói: ô tích bị disabled nuốt cú bấm -> cho cú bấm rơi xuống nhãn để mở hộp mời nâng gói */
[data-action="plan-upsell"] > input:disabled { pointer-events: none; }
.auto-switch[data-action="plan-upsell"] input:disabled + span { opacity: .6; cursor: pointer; }
.pv-row.is-plan-locked .pv-option-icon { opacity: .6; }
/* Hộp mời nâng gói — Standard (mẫu 17/11/2026): nền trắng quầng vàng trên + xanh dương phải, điểm nhấn vàng → xanh dương */
.upg-box.is-standard {
  --upg-ico-bg: linear-gradient(135deg, #fef3c7, #e0f2fe); --upg-ico: #f59e0b;
  background: radial-gradient(ellipse 45% 40% at 40% 0%, rgba(253, 230, 138, .55), transparent 70%),
    radial-gradient(ellipse 50% 60% at 100% 55%, rgba(191, 219, 254, .7), transparent 70%), linear-gradient(135deg, #fffdf6, #fff 45%, #f3f8ff);
}
.is-standard .upg-chip { height: 36px; padding: 0 16px; background: linear-gradient(90deg, #fde68a, #dbeafe); color: #78350f; border: 1px solid #fcd34d; }
.is-standard .upg-chip svg { color: #d97706; }
.is-standard .upg-name { background-image: linear-gradient(90deg, #f59e0b, #fbbf24 35%, #60a5fa 70%, #3b82f6); }
.is-standard .upg-fit { border-color: #fde68a; background: linear-gradient(90deg, rgba(254, 243, 199, .75), rgba(219, 234, 254, .75)); }
.is-standard .upg-fit-ico { color: #d97706; border-right-color: #fcd34d; }
.is-standard .upg-go { background: linear-gradient(90deg, #fbbf24, #fcd34d 25%, #93c5fd 65%, #3b82f6); box-shadow: 0 10px 24px rgba(96, 165, 250, .3); text-shadow: 0 1px 2px rgba(120, 53, 15, .3); }

/* ---------- Bảng chọn tính năng lần đầu (settings.js renderFeaturesModal) — ảnh mẫu 17/11/2026 ----------
   Đầu hộp: ảnh + tên workspace; giữa: cột trái (tiêu đề, lọc nhóm + tìm, lưới 4 cột thẻ công tắc) + khung phải giới thiệu Pro & Business;
   chân: số đã chọn + nút. Chỉ cột trái cuộn; thẻ khóa vì gói: nhãn vương miện, bấm = hộp mời nâng gói. */
#features-modal-box { width: min(1500px, calc(100vw - 40px)); height: auto; max-height: calc(100vh - 32px); background: radial-gradient(ellipse 60% 50% at 100% 0%, rgba(224, 231, 255, .6), transparent 70%), linear-gradient(180deg, #f5f9ff, #fbfdff 40%, #fff); }
.fp-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 22px 32px 0; }
.fp-ws-av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; overflow: hidden; border-radius: 12px;
  background: linear-gradient(135deg, #60a5fa, #8b5cf6); color: #fff; font-size: 17px; font-weight: 800; box-shadow: 0 6px 16px rgba(99, 102, 241, .25); }
.fp-ws-av img { width: 100%; height: 100%; object-fit: cover; }
.fp-ws { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fp-ws b { font-size: 18px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-ws small { font-size: 13.5px; color: var(--ink-soft); }
.fp-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; padding: 18px 32px 20px; }
.fp-main.no-aside { grid-template-columns: minmax(0, 1fr); }
.fp-left { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.fp-left h2 { margin: 0 0 6px; font-size: clamp(20px, 1.8vw, 26px); font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.fp-intro { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-soft); }
.fp-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 14px; }
/* Lọc nhóm + ô tìm: cùng kiểu thanh công cụ trang Nhóm (.tmg-tools): cao 40px, bo 13px, viền mảnh; rê = viền xanh nhạt + nền xanh rất nhạt,
   đang chọn / đang gõ = viền xanh + vòng sáng 3px, biểu tượng chuyển xanh; chuyển động 0,2s (chủ dự án 17/11/2026) */
.fp-cats { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.fp-cat { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); transition: border-color .2s, background-color .2s, box-shadow .2s, color .2s; }
.fp-cat svg { color: var(--ink-soft); transition: color .2s; }
.fp-cat small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.fp-cat:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background-color: var(--primary-50); }
.fp-cat.is-on { border-color: var(--primary); background-color: var(--surface); color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.fp-cat.is-on svg { color: var(--primary-600); }
.fp-cat.is-on small { color: var(--primary-600); }
.fp-cat:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.fp-search { display: flex; align-items: center; gap: 9px; width: 280px; max-width: 100%; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface);
  color: var(--ink-soft); box-shadow: inset 0 1px 3px rgba(15, 23, 42, .08); transition: border-color .2s, background-color .2s, box-shadow .2s; }
.fp-search svg { transition: color .2s; }
.fp-search:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: #f8fbff; }
.fp-search:focus-within { border-color: var(--primary); background: var(--surface); box-shadow: inset 0 1px 3px rgba(15, 23, 42, .08), 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.fp-search:focus-within svg { color: var(--primary-600); }
.fp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; color: var(--ink); }
/* Khung cuộn: cao CỐ ĐỊNH 5 hàng thẻ (60px + khe 12px) — lọc nhóm ít tính năng thì hộp không co lại; màn thấp thì co theo flex. Thanh cuộn: kiểu chung (cuối file). */
.fp-scroll { flex: 0 1 auto; min-height: 0; height: calc(5 * 60px + 4 * 12px + 6px); overflow-y: auto; overflow-x: hidden; padding: 2px 8px 4px 2px; scrollbar-width: thin; }
.fp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fp-empty { grid-column: 1 / -1; margin: 12px 0; text-align: center; color: var(--ink-soft); }
.fp-card { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 60px; padding: 6px 14px 6px 16px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .03); transition: background .2s, border-color .2s; }
.fp-card:hover { background: #f6f9fd; }
.fp-card.is-on { border-color: #dbeafe; background: #eff6ff; }
.fp-card.is-on:hover { background: #e6f0fe; }
.fp-ico { flex: none; }
.fp-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.fp-name { min-width: 0; line-height: 1.3; font-size: 14px; font-weight: 600; color: var(--ink); }
.fp-card .plan-tag { margin-left: 0; flex: none; height: 18px; padding: 0 6px 0 5px; gap: 3px; font-size: 10.5px; }
.fp-card .plan-tag-ico { width: 11px; height: 11px; }
.fp-card.is-locked .fp-name { color: var(--ink-soft); font-weight: 500; }
.fp-sw { position: relative; flex: none; width: 38px; height: 22px; margin-left: auto; }
.fp-sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fp-sw span { position: absolute; inset: 0; border-radius: 999px; background: #dbe3ee; transition: background .2s; pointer-events: none; }
.fp-sw span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: transform .2s; }
.fp-sw input:checked + span { background: var(--primary-600); }
.fp-sw input:checked + span::before { transform: translateX(16px); }
.fp-sw input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Ô khóa vì gói không nhận bấm: cú bấm rơi xuống thẻ (data-action plan-upsell) để mở hộp mời nâng gói */
.fp-card.is-locked .fp-sw input { pointer-events: none; }
.fp-card.is-locked .fp-sw span { background: #e5eaf1; }
.fp-aside { min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 28px 24px 24px; border: 1px solid #e4e7fb; border-radius: 22px;
  background: radial-gradient(ellipse 70% 40% at 50% 15%, rgba(255, 255, 255, .9), transparent 70%), linear-gradient(165deg, #e3f0ff 0%, #e8f1ff 50%, #fdeef6 100%); border-color: #dbe7fb; }
.fp-aside-img { display: block; width: 100%; height: auto; max-height: 215px; margin: 0 auto; object-fit: contain; }
.fp-aside h3 { margin: 6px 0 0; font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; color: #1e293b; }
.fp-pro { background: linear-gradient(90deg, #22c55e, #84cc16); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fp-biz { background: linear-gradient(90deg, #a855f7, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fp-perks { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 0; padding: 0; list-style: none; }
.fp-perks li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #334155; }
.fp-perks svg { flex: none; color: #22c55e; }
.fp-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 32px 16px; border-top: 1px solid var(--border-soft, #e8eef6); background: #fff; }
.fp-count { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 12px; background: #f1f6fd; font-size: 14.5px; color: var(--ink); }
.fp-count-ic { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%; background: var(--primary-600); color: #fff; }
.fp-acts { display: flex; gap: 12px; }
.fp-acts .btn-primary, .fp-acts .btn-secondary { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 22px; border-radius: 12px; font-size: 14.5px; }
@media (max-width: 1180px) { .fp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fp-main { grid-template-columns: minmax(0, 1fr) 270px; } .fp-aside h3 { font-size: 20px; } }
@media (max-width: 920px) { .fp-main { grid-template-columns: minmax(0, 1fr); } .fp-aside { display: none; } }
@media (max-width: 700px) {
  .fp-head { padding: 14px 16px 0; }
  .fp-main { padding: 10px 16px 10px; }
  .fp-scroll { height: calc(5 * 60px + 4 * 10px + 6px); }
  .fp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fp-bar { flex-direction: column; align-items: stretch; }
  .fp-search { width: 100%; }
  .fp-cats { display: grid; grid-template-columns: repeat(4, auto); }
  .fp-cat { justify-content: center; padding: 0 10px; }
  .fp-foot { flex-wrap: wrap; padding: 10px 16px 12px; }
  .fp-count { width: 100%; justify-content: center; }
  .fp-acts { width: 100%; }
  .fp-acts .btn-primary, .fp-acts .btn-secondary { flex: 1; justify-content: center; padding: 0 14px; }
}
@media (max-width: 480px) {
  .fp-grid { grid-template-columns: 1fr; }
  .fp-cats { grid-template-columns: 1fr 1fr; }

  .fp-acts .btn-primary, .fp-acts .btn-secondary { white-space: nowrap; font-size: 14.5px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .fp-card, .fp-cat, .fp-sw span, .fp-sw span::before { transition: none; } }

/* Workload chỉ xem theo gói: nhãn cạnh tiêu đề + khung trắng khi rê (reports.js wlPlanChipHTML) — mẫu chủ dự án 17/11/2026 */
.wl-page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.wl-plan-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid #cfe6fb; border-radius: 999px;
  background: #eaf5ff; color: #1d4ed8; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: default; transition: border-color .2s, background-color .2s; }
.wl-plan-chip > svg { flex: none; color: #2563eb; }
.wl-plan-chip:hover, .wl-plan-chip:focus-visible { border-color: #93c5fd; background: #dff0ff; outline: none; }
.wl-plan-pop { position: absolute; z-index: 30; left: calc(100% + 10px); top: -10px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: max-content; max-width: 420px;
  padding: 12px 34px 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
  font-size: 13.5px; font-weight: 400; line-height: 1.55; color: var(--ink); white-space: normal; cursor: auto;
  opacity: 0; visibility: hidden; transform: translateX(-4px); transition: opacity .2s, transform .2s, visibility 0s linear .2s; }
.wl-plan-pop > span { white-space: nowrap; }
/* Cầu nối vô hình giữa nhãn và khung để rê chuột sang khung không bị tắt giữa chừng */
.wl-plan-pop::before { content: ""; position: absolute; right: 100%; top: 0; bottom: 0; width: 12px; }
.wl-plan-chip:hover .wl-plan-pop, .wl-plan-chip:focus-within .wl-plan-pop { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .2s, visibility 0s; }
.wl-plan-chip.is-closed .wl-plan-pop { opacity: 0; visibility: hidden; transform: translateX(-4px); }
.wl-plan-x { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; transition: background-color .2s, color .2s; }
.wl-plan-x:hover { background: #f1f5f9; color: var(--ink); }
.wl-plan-x svg { width: 13px; height: 13px; }
.wl-plan-go { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: #1d4ed8; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wl-plan-go:hover { color: var(--primary-600); }
.wl-plan-go:focus-visible, .wl-plan-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Hẹp (điện thoại / tab dự án sát mép phải): khung xổ xuống dưới nhãn thay vì sang phải */
@media (max-width: 760px) {
  .wl-plan-pop { left: auto; right: 0; top: calc(100% + 8px); transform: translateY(-4px); max-width: min(320px, calc(100vw - 40px)); }
  .wl-plan-pop > span { white-space: normal; }
  .wl-plan-pop::before { right: 0; left: 0; top: -10px; bottom: auto; width: auto; height: 10px; }
  .wl-plan-chip:hover .wl-plan-pop, .wl-plan-chip:focus-within .wl-plan-pop { transform: translateY(0); }
  .wl-plan-chip.is-closed .wl-plan-pop { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) { .wl-plan-chip, .wl-plan-pop, .wl-plan-x { transition: none; } }

/* ---------- Thanh cuộn chung cả ứng dụng (chủ dự án 17/11/2026) ----------
   Mọi khung cuộn: thanh mảnh, xám mờ; chuột KHÔNG ở trong khung thì ẩn hẳn, rê vào khung thì hiện dần 0,2s.
   --tm-sb không kế thừa (inherits: false) nên chỉ khung đang được rê mới hiện thanh, khung con bên trong vẫn ẩn tới khi rê tới nó.
   scrollbar-color dùng !important để đè ~100 chỗ tự định màu thanh cuộn riêng trước đây (đồng bộ 1 kiểu); chỗ đang ẩn thanh
   (scrollbar-width: none, ví dụ khay tab trượt ngang) giữ nguyên vì không đụng scrollbar-width của chỗ đó.
   transition đặt trong :where() (độ ưu tiên 0) để không đè chuyển động sẵn có của từng phần tử. */
@property --tm-sb { syntax: "<color>"; inherits: false; initial-value: rgba(148, 163, 184, 0); }
:where(*) { transition: --tm-sb .2s ease; }
* { scrollbar-color: var(--tm-sb) transparent !important; }
:where(*):hover, :where(*):focus-within { --tm-sb: rgba(148, 163, 184, .55); }
/* Thanh cuộn ngoài cùng của trang (html / body): mảnh, xanh chủ đạo 68% luôn hiện; rê vào thanh = xanh chủ đạo 100%, kéo = xanh đậm.
   Dùng ::-webkit-scrollbar (đặt được màu khi rê). Chrome CHỈ dùng ::-webkit-scrollbar khi scrollbar-color VÀ scrollbar-width đều auto
   -> đặt lại cả 2 (dòng html { scrollbar-width: thin } đầu file từng làm Chrome vẽ thanh mặc định xám đen). Firefox dùng scrollbar-color. */
html, body { scrollbar-color: auto !important; scrollbar-width: auto !important; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-corner, body::-webkit-scrollbar-corner { background: transparent; }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb { border-radius: 999px; background: color-mix(in srgb, var(--primary) 68%, transparent); }
html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover { background: var(--primary); }
html::-webkit-scrollbar-thumb:active, body::-webkit-scrollbar-thumb:active { background: var(--primary-600); }
/* 2 mũi tên trên / dưới (chủ dự án muốn giữ): tam giác xanh vẽ bằng SVG, rê vào đậm hơn; thanh ngang không cần mũi tên */
html::-webkit-scrollbar-button:single-button, body::-webkit-scrollbar-button:single-button { display: block; width: 6px; height: 12px; background-color: transparent; background-repeat: no-repeat; background-position: center; background-size: 8px 8px; }
html::-webkit-scrollbar-button:vertical:decrement, body::-webkit-scrollbar-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2.5 8.5 7.5h-7z' fill='%2338bdf8'/%3E%3C/svg%3E"); }
html::-webkit-scrollbar-button:vertical:increment, body::-webkit-scrollbar-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 7.5 1.5 2.5h7z' fill='%2338bdf8'/%3E%3C/svg%3E"); }
html::-webkit-scrollbar-button:vertical:decrement:hover, body::-webkit-scrollbar-button:vertical:decrement:hover { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 2.5 8.5 7.5h-7z' fill='%230284c7'/%3E%3C/svg%3E"); }
html::-webkit-scrollbar-button:vertical:increment:hover, body::-webkit-scrollbar-button:vertical:increment:hover { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 7.5 1.5 2.5h7z' fill='%230284c7'/%3E%3C/svg%3E"); }
html::-webkit-scrollbar-button:horizontal, body::-webkit-scrollbar-button:horizontal { display: none; }
@supports not selector(::-webkit-scrollbar) { html, body { scrollbar-width: thin !important; scrollbar-color: color-mix(in srgb, var(--primary) 68%, transparent) transparent !important; } }
/* Safari (chưa hỗ trợ scrollbar-color): cùng kiểu bằng ::-webkit-scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--tm-sb); }
@media (prefers-reduced-motion: reduce) { :where(*) { transition: none; } }

/* ---------- Hộp Tạo / Sửa nhóm (assignee.js renderTeamModal, .tmf-box) — ảnh mẫu 17/11/2026 ---------- */
#team-modal-box.tmf-box { width: min(620px, calc(100vw - 32px)); max-width: none; padding: 0; border-radius: 22px; overflow: hidden; }
.tmf-box .tmf-head { display: flex; align-items: center; gap: 14px; margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--border-soft, #e8eef6);
  background: radial-gradient(ellipse 45% 120% at 100% 100%, #dbeefe, transparent 70%), linear-gradient(120deg, var(--surface) 45%, #eef7ff); }
.tmf-head-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 16px; background: #e0f2fe; color: var(--primary-600); }
.tmf-head-txt { flex: 1; min-width: 0; }
.tmf-head-txt h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.tmf-head-txt p { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }
.tmf-head .icon-btn { align-self: flex-start; }
.tmf-box .modal-body { padding: 18px 22px 6px; }
.tmf-box .form-field > label { font-size: 15px; font-weight: 700; color: var(--ink); }
.tmf-req { color: var(--danger); }
.tmf-opt { font-size: 13px; font-weight: 400; color: var(--muted); }
.tmf-box .form-control { border-radius: 12px; }
.tmf-name-row { display: flex; align-items: center; gap: 12px; }
.tmf-name-row .form-control { flex: 1; min-width: 0; height: 46px; }
.tmf-av { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 18px; font-weight: 800;
  background: color-mix(in srgb, var(--tc, var(--primary)) 30%, var(--surface)); color: color-mix(in srgb, var(--tc, var(--primary)) 70%, #0f172a); transition: background-color .2s, color .2s; }
.tmf-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tmf-sw { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; cursor: pointer; background: color-mix(in srgb, var(--sw) 72%, var(--surface));
  transition: box-shadow .2s, transform .2s; }
.tmf-sw:hover { transform: translateY(-1px); box-shadow: 0 4px 10px color-mix(in srgb, var(--sw) 35%, transparent); }
.tmf-sw.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sw); }
.tmf-sw:focus-visible, .tmf-custom-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.tmf-custom-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; margin-left: auto; padding: 0 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; transition: border-color .2s, background-color .2s; }
.tmf-custom-btn:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--primary-50); }
.tmf-custom-btn.is-on { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }
.tmf-custom > div { padding-top: 12px; }
.tmf-leader { display: flex; width: 100%; }
.tmf-leader .tmg-select { width: 100%; height: 46px; padding-left: 40px; border-radius: 12px; font-size: 14.5px; }
.tmf-hint { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.tmf-hint svg { flex: none; color: var(--muted); }
.tmf-box .modal-foot { padding: 14px 22px 18px; border-top: 1px solid var(--border-soft, #e8eef6); }
.tmf-box .modal-foot .btn-primary, .tmf-box .modal-foot .btn-secondary { height: 42px; min-width: 96px; justify-content: center; border-radius: 12px; font-size: 15px; }
.tmf-box .modal-foot .btn-primary { min-width: 150px; }
@media (max-width: 560px) {
  .tmf-box .tmf-head { padding: 14px 16px; }
  .tmf-head-ic { width: 44px; height: 44px; border-radius: 13px; }
  .tmf-head-txt h2 { font-size: 19px; }
  .tmf-box .modal-body { padding: 14px 16px 4px; }
  .tmf-custom-btn { margin-left: 0; }
  .tmf-box .modal-foot { padding: 12px 16px 14px; }
}
@media (prefers-reduced-motion: reduce) { .tmf-sw, .tmf-custom-btn, .tmf-av { transition: none; } }

/* ---------- Thanh tìm / lọc trang Cuộc họp + Tự động hóa: cùng kiểu thanh công cụ trang Nhóm (.tmg-tools) — 17/11/2026 ----------
   Cao 40px, bo 13px; ô tìm bóng lõm nhẹ. Rê = viền xanh nhạt + nền xanh rất nhạt; đang gõ / đang mở / đang chọn = viền xanh
   + vòng sáng 3px, biểu tượng chuyển xanh; mọi thay đổi chuyển 0,2s. */
.mtg-search, .auto-search .search-field, .mtg-filter, .auto-toolbar .chip {
  height: 40px; border-radius: 13px; transition: border-color .2s, background-color .2s, box-shadow .2s, color .2s;
}
.mtg-search > svg, .mtg-filter > svg, .auto-search .search-field > svg { transition: color .2s; }
.mtg-search, .auto-search .search-field { box-sizing: border-box; background: var(--surface); box-shadow: inset 0 1px 3px rgba(15, 23, 42, .08); }
.mtg-search:hover, .auto-search .search-field:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: #f8fbff; }
.mtg-search:focus-within, .auto-search .search-field:focus-within {
  border-color: var(--primary); background: var(--surface); box-shadow: inset 0 1px 3px rgba(15, 23, 42, .08), 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
.mtg-search:focus-within > svg, .auto-search .search-field:focus-within > svg { color: var(--primary-600); }
.mtg-filter:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background-color: var(--primary-50); }
.mtg-filter:focus-within, .mtg-filter:has(.cselect-btn.is-open) {
  border-color: var(--primary); background-color: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
.mtg-filter:focus-within > svg, .mtg-filter:has(.cselect-btn.is-open) > svg { color: var(--primary-600); }
.mtg-filter .cselect-btn:hover { background: transparent; }
/* Ô lọc nhanh của Tự động hóa (Tất cả / Đang bật / Đã tắt / Chưa chạy): cùng hình ô lọc trang Nhóm */
.auto-toolbar .chip { padding: 0 14px; font-size: 13.5px; color: var(--ink-soft); }
.auto-toolbar .chip:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background-color: var(--primary-50); }
.auto-toolbar .chip.is-on { border-color: var(--primary); background-color: var(--surface); color: var(--primary-600); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
/* Nút trên 2 thanh: cao 40px bo 13px, rê nút chính sáng lên + bóng xanh như nút Tạo nhóm */
.mtg-page-head .mtg-new, .auto-toolbar .btn-primary, .auto-toolbar .btn-secondary { height: 40px; border-radius: 13px; transition: background-color .2s, border-color .2s, box-shadow .2s, filter .2s; }
.mtg-page-head .mtg-new:hover:not(:disabled), .auto-toolbar .btn-primary:hover:not(:disabled) { background: var(--primary); filter: brightness(1.06); box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 30%, transparent); }
.mtg-page-head .mtg-new:active, .auto-toolbar .btn-primary:active { background: var(--primary-600); filter: none; box-shadow: var(--shadow-sm); }
@media (prefers-reduced-motion: reduce) {
  .mtg-search, .auto-search .search-field, .mtg-filter, .auto-toolbar .chip, .mtg-page-head .mtg-new, .auto-toolbar .btn-primary, .auto-toolbar .btn-secondary { transition: none; }
}
