/* design.css — Hệ thiết kế QLVB (chép từ AIeReport) theo DESIGN SYSTEM CỤC DỰ TRỮ NHÀ NƯỚC v2.0
   (skill design-system-cuc-dtnn; token gốc ở ds-tokens.css nạp trước tệp này).
   Đỏ tương tác #BD0616 · nền trang #F8F7F7 · card trắng r12 viền #EAECF0 · font Inter · sidebar 300/72.
   Tên biến cũ của bộ mockup Viettel (--primary-*, --gray-*, --c-primary…) GIỮ NGUYÊN TÊN để mọi màn
   không phải sửa, nhưng nay trỏ về token DS. */

:root {
  /* ---- Thang đỏ cũ → brand/* của DS ---- */
  --primary-000: var(--ds-brand-95); --primary-100: var(--ds-brand-90); --primary-200: var(--ds-brand-70);
  --primary-300: var(--ds-brand-60); --primary-400: var(--ds-brand-50); --primary-500: var(--ds-brand-50);
  --primary-600: var(--ds-brand-40); --primary-700: var(--ds-brand-30); --primary-800: var(--ds-brand-20);
  --primary-900: var(--ds-brand-10);
  /* ---- Thang xám cũ → warmgray/* ---- */
  --gray-100: var(--ds-warmgray-97); --gray-200: var(--ds-warmgray-95); --gray-300: var(--ds-border-subtle);
  --gray-400: var(--ds-warmgray-80); --gray-500: var(--ds-warmgray-70); --gray-600: var(--ds-warmgray-60);
  --gray-700: var(--ds-warmgray-50); --gray-800: var(--ds-warmgray-30); --gray-900: var(--ds-warmgray-10);
  /* ---- Ngữ nghĩa ---- */
  --warning-300: var(--ds-warning-70); --warning-500: var(--ds-warning-50); --warning-bg: var(--ds-warning-95);
  --success-500: var(--ds-success-60); --success-600: var(--ds-success-50); --success-bg: var(--ds-success-95);
  --error-500: var(--ds-danger-40); --error-600: var(--ds-danger-30); --error-bg: var(--ds-danger-95);
  /* Info (Figma 27/10): ramp xanh dương riêng info/* — "thông tin / đang xử lý" dùng màu này (trước là teal vì Info trùng đỏ). */
  --info-300: var(--ds-info-70); --info-500: var(--ds-info-50); --info-600: var(--ds-info-40); --info-bg: var(--ds-info-95);

  /* brand / primary = interactive/primary */
  --c-primary: var(--ds-interactive-primary); --c-primary-hover: var(--ds-interactive-primary-hover);
  --c-primary-active: var(--ds-interactive-primary-active);
  --c-primary-bg: var(--ds-brand-95); --c-primary-bg-h: var(--ds-brand-90);
  /* tông chữ thương hiệu cũ (tiêu đề, breadcrumb) — DS: tiêu đề màu text/primary, đỏ chỉ cho tương tác */
  --navy: var(--ds-text-brand);

  /* số đo khung (03 §1): sidebar 300/72, hàng breadcrumb 50 */
  --header-h: 50px; --sidebar-w: var(--ds-sidebar-w); --sidebar-w-collapsed: var(--ds-sidebar-w-collapsed);

  /* text */
  --text: var(--ds-text-primary); --text-heading: var(--ds-text-primary); --text-secondary: var(--ds-text-secondary);
  --text-tertiary: var(--ds-warmgray-45); --text-disabled: var(--ds-text-disabled);
  --text-muted: var(--ds-warmgray-45);
  /* surfaces */
  --bg: var(--ds-surface-default); --bg-container: var(--ds-surface-default); --bg-elevated: var(--ds-surface-container-low);
  --bg-layout: var(--ds-page-bg); --bg-spotlight: var(--ds-surface-container);
  --border: var(--ds-border-subtle); --border-secondary: var(--ds-border-subtle); --border-strong: var(--ds-input-border-default);

  /* status (chữ trạng thái) */
  --st-neutral: var(--ds-text-secondary); --st-info: var(--ds-support-info); --st-primary: var(--ds-text-link);
  --st-warning: var(--ds-warning-40); --st-success: var(--ds-success-40); --st-muted: var(--ds-text-secondary);
  --st-error: var(--ds-danger-40); --st-softred: var(--ds-danger-50);

  /* priority */
  --prio-low: var(--ds-warmgray-60); --prio-normal: var(--ds-support-info); --prio-high: var(--ds-warning-50); --prio-urgent: var(--ds-danger-40);

  /* radius (01 §4): r4 tag/checkbox · r6 tab/tree · r8 control · r12 card/bảng/popup */
  --r-sm: var(--ds-radius-xs); --r-md: var(--ds-radius-md); --r-lg: var(--ds-radius-lg); --r-xl: var(--ds-radius-lg);
  /* elevation 1–4 của DS */
  --sh-1: var(--ds-shadow-1-sm); --sh-2: var(--ds-shadow-2-md); --sh-3: var(--ds-shadow-3-lg); --sh-4: var(--ds-shadow-4-xl);
  --ease: cubic-bezier(.4,0,.2,1); --ease-out: cubic-bezier(0,0,.2,1);
  --font: var(--ds-font-family);
  --font-heading: var(--ds-font-family);
  /* vòng focus DS: 2px focus/ring cách control 2px */
  --ring: 0 0 0 2px var(--ds-surface-default), 0 0 0 4px var(--ds-focus-ring);

  /* density (comfortable default) */
  --row-py: 14px; --row-gap: 8px; --side-py: 8px;
}
:root[data-density="compact"] { --row-py: 9px; --row-gap: 4px; --side-py: 6px; }
/* DS chưa phát hành dark mode (06 Q5) — bỏ khối :root[data-theme="dark"] / data-palette="vivid" của bộ cũ. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text);
  background: var(--bg-layout); -webkit-font-smoothing: antialiased;
}
#root { height: 100%; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--c-primary-bg-h); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-tertiary) 35%, transparent); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text-tertiary) 55%, transparent); background-clip: padding-box; }

h1,h2,h3,h4 { font-family: var(--font-heading); color: var(--text-heading); margin: 0; }

/* ===================== SHELL — DS Cục DTNN v2.0 (03 §1 App shell) =====================
   ┌ Sidebar 300 | 72 ┬ Cột chính (đệm 12/20) ─────────────────────────────────────────┐
   │ logo + huân chương│ hàng breadcrumb 50 ──────────── trợ giúp · chuông 24 · avatar 36 │
   │ ô chọn phân hệ    │ ↕ 4                                                              │
   │ thẻ menu          │ card nội dung r12 viền #EAECF0 (main.css: .aio-body > *)          │
   │ nút thu gọn tròn  │                                                                  │
   Nền trang #F8F7F7. Bỏ header gradient cam–đỏ cao 72 của bộ mockup cũ (logo nay ở sidebar).
   Bám đúng giá trị của hệ thống Họp không giấy tờ C.DTNN (ec-shell.css) để hai hệ thống giống nhau.
   Màu hard-code của DS (06 Q7 — Sidebar/Website): thẻ menu #FFF5EE, ô chọn phân hệ gradient
   #FD5F2F→#F73714 — gom thành biến --sb-* ở đây, không dùng ở nơi khác. */
:root {
  --sb-card-bg: rgba(255, 245, 238, .96);   /* #FFF5EE */
  --sb-card-line: #FDE4D6;
  --sb-dot: #E2D1CA;
  --sb-switch: linear-gradient(180deg, #FD5F2F 0%, #F73714 100%);
  --sb-switch-hover: linear-gradient(180deg, #F2522A 0%, #E42F10 100%);
  --sb-hover: rgba(0, 0, 0, .04);
}
.shell { display: flex; height: 100vh; overflow: hidden; background: var(--ds-page-bg); }

/* ---------- SIDEBAR (Sidebar/Website — Expand 300 · Collab 72) ---------- */
.ds-sidebar {
  width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; position: relative; z-index: 40;
  background: var(--ds-brand-40) url('/ds/sidebar-bg.jpg') top center / 100% 100% no-repeat;
  transition: width .2s var(--ease);
}
.nav-collapsed .ds-sidebar { width: var(--sidebar-w-collapsed); }

/* Khối logo: cụm logo Cục + Huân chương căn giữa, dưới là cơ quan (nhỏ) và tên đơn vị (đậm) */
.ds-sb-brand { flex: none; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 16px 24px 12px; }
.ds-sb-brand .ds-logo-full { height: 72px; width: auto; }
.ds-sb-brand .ds-logo-mini { display: none; width: 40px; height: 40px; object-fit: contain; }
.ds-bt { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.ds-bt .b1 { font-size: 12px; line-height: 17px; font-weight: 600; color: var(--ds-brand-40); text-transform: uppercase; }
.ds-bt .b2 { font-size: 16px; line-height: 21px; font-weight: 700; color: var(--ds-brand-20); text-transform: uppercase; text-wrap: balance; }
.nav-collapsed .ds-sb-brand { padding: 16px 0 12px; }
.nav-collapsed .ds-sb-brand .ds-logo-full, .nav-collapsed .ds-bt { display: none; }
.nav-collapsed .ds-sb-brand .ds-logo-mini { display: block; }

/* Ô chọn phân hệ (module switcher DS 260×48, r8, chữ trắng 16 SemiBold, ⇄ cuối ô) */
.ds-sb-head { flex: none; padding: 4px 20px 8px; }
.nav-collapsed .ds-sb-head { padding: 4px 4px 8px; }  /* thu gọn: ô phân hệ 64×48 chỉ còn ⇄ */
.ds-navsel { position: relative; }
.ds-navsel-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 48px; padding: 0 12px 0 16px;
  border: 0; border-radius: var(--ds-radius-md); background: var(--sb-switch); color: var(--ds-text-white);
  font-size: 16px; line-height: 24px; font-weight: 600; text-align: left; box-shadow: var(--ds-shadow-1-sm);
}
.ds-navsel-btn[aria-haspopup] { cursor: pointer; }
.ds-navsel-btn:not([aria-haspopup]) { cursor: default; }
.ds-navsel-btn[aria-haspopup]:hover, .ds-navsel-btn.open { background: var(--sb-switch-hover); }
.ds-navsel-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.ds-navsel-btn .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-navsel-btn .nschev { flex: none; }
.nav-collapsed .ds-navsel-btn { justify-content: center; padding: 0; }
.nav-collapsed .ds-navsel-btn .lbl { display: none; }
/* Bảng "Chọn phân hệ" (DS D1, Figma 27/10): 260 rộng, nền trắng, r12, bóng level 3, cuộn khi dài; mỗi dòng = Phân hệ
   item 244×54: chấm 6 · ô icon 36 r8 tô gradient · tên 16 Medium. Rê nền container-low; đang chọn nền brand/95 + chấm đỏ.
   Thu gọn 72: bảng mở sang phải sidebar, căn đỉnh với ô ⇄. */
.ds-navsel-menu {
  position: absolute; top: calc(100% + 8px); left: 0; width: 260px; max-height: 666px; overflow-y: auto; z-index: 60; padding: 8px;
  background: var(--ds-surface-default); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-3-lg);
}
.nav-collapsed .ds-navsel-menu { top: 0; left: calc(100% + 12px); }
.ds-navsel-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 54px; padding: 0 8px; border: 0; background: none;
  border-radius: var(--ds-radius-md); font-size: 16px; line-height: 24px; font-weight: 500; color: var(--ds-text-primary);
  text-align: left; white-space: nowrap;
}
.ds-navsel-opt + .ds-navsel-opt { margin-top: 2px; }
.ds-navsel-opt .ph-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.ds-navsel-opt .nsi {
  flex: none; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--ds-radius-md);
  color: var(--ds-text-white); background: linear-gradient(180deg, var(--ds-brand-60) 0%, var(--ds-brand-50) 100%);
  box-shadow: var(--ds-shadow-1-sm);
}
.ds-navsel-opt.ph-quan-tri .nsi { background: linear-gradient(180deg, var(--ds-info-60) 0%, var(--ds-info-40) 100%); }
.ds-navsel-opt .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ds-navsel-opt:hover { background: var(--ds-surface-container-low); }
.ds-navsel-opt:focus-visible { outline: none; box-shadow: var(--ring); }
.ds-navsel-opt.active { background: var(--ds-brand-95); font-weight: 600; }
.ds-navsel-opt.active .ph-dot { background: var(--ds-interactive-primary); }

/* Thẻ menu (Sidemenu DS: nền #FFF5EE, r8, đệm 12/8) — chỉ thẻ này co lại + cuộn khi menu dài */
.ds-sb-card {
  flex: 0 1 auto; min-height: 0; margin: 4px 20px 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--sb-card-bg); border-radius: var(--ds-radius-md); box-shadow: inset 0 0 0 1px var(--sb-card-line), var(--ds-shadow-1-sm);
}
.ds-sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 8px; }
.ds-sb-scroll::-webkit-scrollbar { width: 6px; }
.ds-sb-scroll::-webkit-scrollbar-thumb { background: var(--ds-warmgray-80); border-radius: 999px; }
.nav-collapsed .ds-sb-card { margin: 4px 4px 0; }
.nav-collapsed .ds-sb-scroll { padding: 8px; }

/* Main menu (nhóm): icon 20 + chữ đầu câu 14 Medium (user chốt 27/10, như Họp), › bên phải (xoay xuống khi mở), cao 44. Nhóm KHÔNG tô đỏ. */
.ds-grp-head {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; background: none;
  border-radius: var(--ds-radius-md); color: var(--ds-text-primary); font-size: 14px; line-height: 21px; font-weight: 500;
  text-align: left; cursor: pointer;
}
.ds-grp + .ds-grp { margin-top: 2px; }
.ds-grp-head:hover { background: var(--sb-hover); }
.ds-grp-head:focus-visible { outline: none; box-shadow: var(--ring); }
.ds-grp-head .gi { flex: none; width: 20px; height: 20px; display: inline-grid; place-items: center; }
.ds-grp-head .gl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-grp-head .gchev { flex: none; transition: transform .2s var(--ease); }
.ds-grp-head.open .gchev { transform: rotate(90deg); }
/* Thu gọn 72 (Sidemenu Mini): chỉ icon nhóm trong ô 48×44; rê nền nhạt; nhóm chứa màn đang mở = ô vuông đỏ đặc */
.nav-collapsed .ds-grp-head { justify-content: center; width: 48px; height: 44px; min-height: 44px; padding: 0; }
.nav-collapsed .ds-grp-head .gl, .nav-collapsed .ds-grp-head .gchev { display: none; }
.nav-collapsed .ds-grp + .ds-grp { margin-top: 4px; }
.nav-collapsed .ds-grp-head.is-chon { background: var(--ds-button-primary-filled-bg); color: var(--ds-button-primary-filled-text); }
.nav-collapsed .ds-grp-head.is-chon:hover { background: var(--ds-button-primary-filled-bg-hover); }

/* Submenu (mục): thụt 16, chấm tròn 6 thay icon, cao 36, chữ 14 Medium (27/10); đang chọn = nền đỏ đặc, chữ + chấm trắng */
.ds-grp-items { margin: 2px 0 4px 16px; }
/* Sidemenu flyout (thu gọn + rê icon nhóm): 240 rộng, cách mép sidebar 8, căn đỉnh với icon; tiêu đề = tên nhóm
   14 SemiBold màu primary; mục là Submenu cấp 2 (chấm tròn); dài quá thì cuộn (JS đặt top + max-height). */
.ds-grp-items.ds-flyout {
  position: fixed; left: calc(var(--sidebar-w-collapsed) + 8px); width: 240px; margin: 0; z-index: 80; overflow-y: auto;
  padding: 4px 12px 12px; background: var(--ds-surface-default); border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-3-lg);
}
.ds-fly-title { padding: 12px 0 8px; font-size: 14px; line-height: 21px; font-weight: 600; color: var(--ds-text-brand); }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 12px; margin-bottom: 2px;
  border: 0; background: none; border-radius: var(--ds-radius-md); color: var(--ds-text-primary);
  font-size: 14px; line-height: 21px; font-weight: 500; text-align: left; white-space: nowrap; position: relative;
  transition: background .12s, color .12s;
}
.nav-item::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--sb-dot); }
.nav-item:hover { background: var(--sb-hover); color: var(--ds-text-primary); }
.nav-item:focus-visible { outline: none; box-shadow: var(--ring); }
.nav-item.active { background: var(--ds-button-primary-filled-bg); color: var(--ds-button-primary-filled-text); }
.nav-item.active::before { background: currentColor; }
.nav-item.active:hover { background: var(--ds-button-primary-filled-bg-hover); color: var(--ds-button-primary-filled-text); }
.nav-item-ic { display: none; flex: none; width: 20px; height: 20px; place-items: center; color: var(--ds-icon-secondary); }
.nav-item-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Số đếm = Badge Count Neutral; trên mục đang chọn: nền trắng chữ đỏ */
.nav-badge {
  flex: none; min-width: 20px; padding: 2px 6px; border-radius: 999px; text-align: center;
  background: var(--ds-badge-neutral-bg); color: var(--ds-badge-neutral-text); font-size: 12px; line-height: 16px; font-weight: 600;
}
.nav-item.active .nav-badge { background: var(--ds-surface-default); color: var(--ds-interactive-primary); }
/* Mục cha xổ danh sách trạng thái con (Cần tôi xử lý / Đang theo dõi) — mở ra vẫn không tô đỏ */
.nav-parent { cursor: pointer; }
.nav-parent .ni-caret { flex: none; display: grid; place-items: center; color: var(--ds-text-primary); transition: transform .2s var(--ease); }
.nav-parent.expanded .ni-caret { transform: rotate(90deg); }
.nav-children { overflow: hidden; max-height: 0; transition: max-height .25s ease; margin-left: 16px; }
.nav-children.open { max-height: 900px; }
.nav-item.depth-1 { font-size: 14px; line-height: 21px; }
.nav-item.depth-1::before { width: 4px; height: 4px; }

/* Nút thu gọn tròn ở đáy */
.ds-sb-foot { flex: none; margin-top: auto; display: flex; justify-content: center; padding: 16px 0 20px; }
.ds-collapse {
  width: 28px; height: 28px; border-radius: 50%; border: 0; display: inline-grid; place-items: center; cursor: pointer;
  background: var(--ds-surface-default); color: var(--ds-icon-interactive); box-shadow: var(--ds-shadow-2-md);
}
.ds-collapse:hover { background: var(--ds-brand-95); }
.ds-collapse:focus-visible { outline: none; box-shadow: var(--ring); }
.ds-collapse .aio-ic { transition: transform .2s var(--ease); }
.nav-collapsed .ds-collapse .aio-ic { transform: rotate(180deg); }

/* ---------- CỘT CHÍNH: hàng breadcrumb 50 + card nội dung (đệm 12/20) ---------- */
.main-col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 0 20px 12px; }
.topstrip { height: 50px; flex: none; display: flex; align-items: center; gap: 12px; position: relative; z-index: 50; }
/* Breadcrumbs (D5): chữ 16 text/secondary, phân cách "/", mục cuối text/Brand Medium */
.crumb { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 24px; color: var(--ds-text-secondary); }
.crumb-tenant, .crumb-mod { color: var(--ds-text-secondary); white-space: nowrap; }
.crumb-sep { flex: none; color: var(--ds-text-secondary); }
.crumb-cur { color: var(--ds-text-brand); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tiện ích phải: Button Icon 40 không nền, icon 24 icon/interactive; avatar 36 */
.hdr-tools { flex: none; display: flex; align-items: center; gap: 12px; }
.hdr-icon {
  width: 40px; height: 40px; flex: none; position: relative; display: grid; place-items: center; border: 0; padding: 0;
  border-radius: var(--ds-radius-md); background: transparent; color: var(--ds-icon-interactive); cursor: pointer;
}
.hdr-icon:hover { background: var(--ds-button-neutral-ghost-bg-hover); }
.hdr-icon:focus-visible { outline: none; box-shadow: var(--ring); }
/* Số chưa đọc = Badge Count Danger, nằm gọn trong hàng 50 */
.hdr-icon .bell-count {
  position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--ds-badge-danger-bg); color: var(--ds-badge-danger-text); font-size: 12px; line-height: 20px; font-weight: 600;
  text-align: center; box-shadow: 0 0 0 1.5px var(--ds-page-bg);
}
.me-menu-wrap { position: relative; }
.me-chip { display: inline-grid; place-items: center; padding: 2px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; }
.me-chip:hover { background: var(--ds-surface-container); }
.me-chip:focus-visible { outline: none; box-shadow: var(--ring); }
/* Avatar DS (C5) Type Text: tròn, nền surface/container, chữ interactive/primary */
.me-chip .avatar, .me-menu-head .avatar {
  width: 36px; height: 36px; font-size: 14px; font-weight: 600; background: var(--ds-surface-container); color: var(--ds-icon-interactive);
}
.me-menu {
  position: absolute; top: 46px; right: 0; min-width: 260px; z-index: 60; padding: 4px;
  background: var(--ds-surface-default); color: var(--ds-text-primary); border: 1px solid var(--ds-border-subtle);
  border-radius: var(--ds-radius-md); box-shadow: var(--ds-shadow-3-lg);
}
.me-menu-head { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--ds-border-subtle); margin-bottom: 4px; }
.me-menu-name { display: block; font-size: 14px; font-weight: 600; color: var(--ds-text-primary); }
.me-menu-sub { display: block; font-size: 12px; color: var(--ds-text-secondary); }
.me-menu-item {
  display: flex; width: 100%; align-items: center; gap: 8px; height: 44px; padding: 10px 12px; border: 0; background: none;
  border-radius: var(--ds-radius-md); text-align: left; color: var(--ds-text-primary); font-size: 14px; font-weight: 500;
}
.me-menu-item:hover { background: var(--ds-surface-container-low); }
.me-menu-item .mi-ic { color: var(--ds-icon-secondary); display: grid; place-items: center; }

.work { flex: 1; display: flex; overflow: hidden; min-height: 0; }
/* ===================== SIDEBAR ===================== */
.side { width: 288px; flex-shrink: 0; background: var(--bg-container); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 10px 8px 24px; }
.side-section { margin-bottom: 20px; }
.side-h { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-tertiary);
  padding: 4px 10px; }
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.side-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 8px; border: 0; background: transparent;
  border-radius: var(--r-md); color: var(--text-secondary); font-size: 14px; font-weight: 500; text-align: left; transition: all .12s var(--ease); }
.side-item:hover { background: var(--bg-layout); color: var(--text-heading); }
.side-item.active { background: var(--c-primary-bg); color: var(--c-primary-active); font-weight: 600; }
.side-item.active .side-ic { color: var(--c-primary); }
.side-ic { color: var(--text-tertiary); flex-shrink: 0; }
.side-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-count { font-size: 12px; color: var(--text-tertiary); background: var(--bg-spotlight); border-radius: 999px; padding: 1px 8px; min-width: 22px; text-align: center; font-weight: 600; }
.side-item.active .side-count { background: color-mix(in srgb, var(--c-primary) 18%, transparent); color: var(--c-primary-active); }

.side-tree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.side-tree li { list-style: none; }
.tree-node { display: flex; align-items: center; gap: 2px; border-radius: var(--r-md); }
.tree-node.active, .tree-node.child.active { background: var(--c-primary-bg); }
.tree-caret { border: 0; background: transparent; color: var(--text-tertiary); padding: 6px 2px 6px 6px; display: grid; place-items: center; border-radius: 4px; }
.tree-caret:hover { color: var(--text-heading); }
.tree-label-btn, .tree-node.child { flex: 1; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; background: transparent;
  color: var(--text-secondary); font-size: 12px; font-weight: 500; text-align: left; border-radius: var(--r-md); transition: all .12s; min-width: 0; }
.tree-label-btn:hover { color: var(--text-heading); }
.tree-node.active .tree-label-btn, .tree-node.child.active { color: var(--c-primary-active); font-weight: 600; }
.tree-ic { color: var(--text-tertiary); flex-shrink: 0; }
.tree-node.active .tree-ic { color: var(--c-primary); }
.tree-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-children { list-style: none; margin: 2px 0 4px; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 4px; }
.tree-node.child { width: 100%; padding-left: 10px; padding-right: 0; }
.tree-node.child:hover { background: var(--bg-layout); }

/* ===================== CONTENT ===================== */
.content { flex: 1; overflow-y: auto; padding: 20px 24px 60px; min-width: 0; min-height: 0; }
/* Page header (DS 03 §2 — màn mẫu "Danh sách tài sản"): tiêu đề 24 Bold text/primary + dòng phụ 12 Regular
   cách 4 bên trái; ô tìm 300×40 + cụm nút cao 40 (gap 12) dồn PHẢI cùng hàng, rớt dòng vẫn căn phải. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head-l { flex: 1 1 320px; min-width: 0; }
.page-title { font-size: 24px; font-weight: 700; line-height: 1.3; color: var(--ds-text-primary); }
.page-sub { display: block; margin-top: 4px; font-size: 12px; line-height: 16.8px; color: var(--ds-text-secondary); }
.page-head-r { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-left: auto; }

/* Nhóm nút chuyển chế độ = Tab group Type Button (DS D6): khung r8 đệm 2, nút 32 r6 → cao 36 */
.seg { display: flex; background: var(--ds-surface-container); border-radius: var(--ds-radius-md); padding: 2px; gap: 2px; }
.seg-btn { height: 32px; border: 0; background: transparent; color: var(--ds-tab-inactive); padding: 0 12px; border-radius: var(--ds-radius-sm);
  display: grid; place-items: center; font-size: 14px; font-weight: 500; transition: all .13s; }
.seg-btn:hover { color: var(--text-heading); }
.seg-btn.on { background: var(--bg-container); color: var(--c-primary); box-shadow: var(--sh-1); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* Chip Filter (DS C4): cao 32, pad 4/12, chữ 14 Medium; Selected = nền brand/95 viền brand/60 */
.chip { height: 32px; border: 1px solid var(--ds-chip-default-border); background: var(--ds-surface-default); color: var(--ds-chip-default-text);
  font-size: 14px; padding: 4px 12px; border-radius: 999px; transition: all .13s; font-weight: 500; white-space: nowrap; }
.chip:hover { background: var(--ds-chip-hover-bg); }
.chip.on { background: var(--ds-chip-selected-bg); border-color: var(--ds-chip-selected-border); color: var(--ds-chip-selected-text); }

/* ===================== BUTTONS / TAGS ===================== */
/* Button (DS A1): Default 40 (pad 10/16) · Small 36 (pad 8/16) · r8 · gap 6 · icon 20 · chữ 14 SemiBold.
   .btn-primary = Primary (mỗi vùng 1 nút) · .btn-default = Neutral Outlined · .btn-outline = Secondary ·
   .btn-ghost/.btn-text = Neutral Ghost · Disable (mọi type) nền button/disabled-bg chữ button/disabled-text. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: var(--ds-radius-md);
  font-size: 14px; line-height: 21px; font-weight: 600; padding: 0 16px; border: 1px solid transparent; transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap; cursor: pointer; text-decoration: none; }
.btn .aio-ic svg { width: 20px; height: 20px; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; border-radius: var(--ds-radius-md); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--ds-button-primary-filled-bg); color: var(--ds-button-primary-filled-text); }
.btn-primary:hover { background: var(--ds-button-primary-filled-bg-hover); }
.btn-primary:active { background: var(--ds-button-primary-filled-bg-active); }
.btn-default { background: var(--ds-surface-default); color: var(--ds-button-neutral-outlined-text); border-color: var(--ds-button-neutral-outlined-border); }
.btn-default:hover { background: var(--ds-button-neutral-outlined-bg-hover); color: var(--ds-interactive-secondary-hover); border-color: var(--ds-interactive-secondary-hover); }
.btn-default:active { background: var(--ds-button-neutral-outlined-bg-active); color: var(--ds-interactive-secondary-active); border-color: var(--ds-interactive-secondary-active); }
.btn-text { background: transparent; color: var(--ds-button-neutral-ghost-text); }
.btn-text:hover { background: var(--ds-button-neutral-ghost-bg-hover); color: var(--ds-interactive-secondary-hover); }
.btn:disabled, .btn.is-disabled { background: var(--ds-button-disabled-bg); color: var(--ds-button-disabled-text); border-color: transparent;
  cursor: not-allowed; pointer-events: none; box-shadow: none; }
.btn-text:disabled, .btn-text.is-disabled { background: transparent; }
/* Button Icon (DS A2) Neutral Ghost 36 */
.icon-btn { width: 36px; height: 36px; border: 0; background: transparent; color: var(--ds-icon-primary); border-radius: var(--ds-radius-md);
  display: grid; place-items: center; transition: background .13s; }
.icon-btn:hover { background: var(--ds-button-neutral-ghost-bg-hover); color: var(--ds-icon-primary); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }

.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--ds-radius-xs); white-space: nowrap; line-height: 1.3; }
.prio-badge { display: inline-grid; place-items: center; }
.src-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary);
  background: var(--ds-tag-neutral-bg); border: 1px solid var(--ds-tag-neutral-border); border-radius: var(--ds-radius-xs); padding: 2px 8px; }

/* Avatar DS (C5) Type Text: tròn, nền surface/container, chữ interactive/primary */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--ds-surface-container); color: var(--ds-icon-interactive);
  font-weight: 600; flex-shrink: 0; line-height: 1; }
.avatar.more { background: var(--bg-spotlight); color: var(--text-secondary); }
.avatar-stack { display: inline-flex; align-items: center; }

.progress-wrap { display: inline-flex; align-items: center; gap: 8px; }
.progress-track { flex: 1; background: var(--bg-spotlight); border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; height: 100%; border-radius: 999px; background: var(--ds-interactive-primary); transition: width .5s var(--ease); }
.progress-label { font-size: 12px; font-weight: 600; min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }

/* tone helpers */
.tone-error { color: var(--st-error); } .tone-warning { color: var(--st-warning); }
.tone-success { color: var(--st-success); } .tone-muted { color: var(--text-tertiary); }
.tone-primary { color: var(--st-primary); } .tone-neutral { color: var(--text-secondary); }

/* ===================== TASK LIST ===================== */
.list-head { display: grid; grid-template-columns: 1fr 128px 168px 116px 116px 34px; gap: 10px; align-items: center;
  padding: 4px 14px 6px; }
.lh-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 4px 0;
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-tertiary); transition: color .12s; }
.lh-btn:hover { color: var(--text-secondary); }
.lh-btn.sorted { color: var(--c-primary-active); }
.lh-arrow { opacity: 0; color: var(--text-disabled); transition: opacity .12s; }
.lh-btn:hover .lh-arrow { opacity: .6; }
.lh-arrow.on { opacity: 1; color: var(--c-primary); }

/* unread / read */
.task-row.unread .tr-title { font-weight: 700; color: var(--text-heading); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary); flex-shrink: 0; }

/* filter panel */
.filter-panel { background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; box-shadow: var(--sh-1); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.ffield { display: flex; flex-direction: column; gap: 4px; }
.ffield-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.ffield .input { width: 100%; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a929d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 30px; cursor: pointer; }
.filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-secondary); }
.filter-result { font-size: 12px; color: var(--text-secondary); margin-right: auto; }
.filter-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 2px; font-size: 12px; font-weight: 700; color: #fff; background: var(--c-primary); border-radius: 999px; }
.btn.on-filter { border-color: var(--c-primary); color: var(--c-primary-active); }

/* pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pg-info { font-size: 12px; color: var(--text-secondary); }
.pg-info b { color: var(--text-heading); font-variant-numeric: tabular-nums; }
.pg-controls { display: flex; align-items: center; gap: 4px; }
.pg-size { height: 34px; padding: 0 28px 0 10px; font-size: 12px; }
.pg-btn { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--border-strong); background: var(--bg-container); color: var(--text-secondary);
  border-radius: var(--r-md); font-size: 14px; font-weight: 600; display: grid; place-items: center; transition: all .12s; font-variant-numeric: tabular-nums; }
.pg-btn:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary-active); }
.pg-btn.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-ellipsis { color: var(--text-tertiary); padding: 0 2px; }

/* crumb link */
.crumb-link { color: var(--text-secondary); text-decoration: none; }
.crumb-link:hover { color: var(--c-primary-active); }

/* ===================== DETAIL PAGE (bản tách riêng) ===================== */
.detail-page { max-width: none; }
.dp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 6px; }
.dp-head-main { min-width: 0; flex: 1; }
.dp-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dp-title { font-size: 24px; font-weight: 600; line-height: 1.3; color: var(--text-heading); text-wrap: pretty; }
.dp-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.dp-tabs { padding: 0; margin: 16px 0 0; border-bottom: 1px solid var(--border); }
.dp-grid { display: grid; grid-template-columns: 1fr 280px; gap: 26px; padding: 22px 0; }
.dp-col-main { min-width: 0; }
.dp-col-meta { display: flex; flex-direction: column; gap: 16px; background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; height: fit-content; box-shadow: var(--sh-1); }
.dp-pad { padding: 22px 0; max-width: 760px; }
.dp-stub { margin-top: 18px; padding: 20px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--bg-layout);
  color: var(--text-tertiary); font-size: 14px; font-style: italic; text-align: center; }
@media (max-width: 1100px) { .dp-grid { grid-template-columns: 1fr; } }
.task-list { background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.task-list.flush { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.task-list.card { background: var(--bg-container); }
.task-row { display: grid; grid-template-columns: 1fr 128px 168px 116px 116px 34px; gap: 10px; align-items: center;
  padding: var(--row-py) 14px; border-bottom: 1px solid var(--border-secondary); transition: background .12s; cursor: pointer; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--bg-elevated); }
.task-list.flush .task-row { background: var(--bg-container); border-bottom: 1px solid var(--border-secondary); }
.tr-main { min-width: 0; }
.tr-titleline { display: flex; align-items: center; gap: 8px; }
.tr-title { font-size: 14px; font-weight: 500; color: var(--text-heading); line-height: 1.35; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tr-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.tr-code { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.tr-doc { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--st-primary);
  background: var(--c-primary-bg); border-radius: 4px; padding: 1px 8px; white-space: nowrap; }
.tr-assignee { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-unit { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tr-unit-name { font-size: 12px; color: var(--text-heading); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-unit-sub { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-due { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; }
.tr-kebab { width: 30px; height: 30px; }
.tr-progress { display: flex; }

/* ===================== KANBAN ===================== */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 280px; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kan-col { background: var(--bg-layout); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: 100%; }
.kan-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px; border-bottom: 1px solid var(--border); }
.kan-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kan-title { font-size: 14px; font-weight: 600; color: var(--text-heading); flex: 1; }
.kan-count { font-size: 12px; font-weight: 700; color: var(--text-tertiary); background: var(--bg-spotlight); border-radius: 999px; padding: 1px 8px; }
.kan-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.kan-card { background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; box-shadow: var(--sh-1); cursor: pointer; transition: box-shadow .15s, transform .1s; }
.kan-card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.kan-card-top { display: flex; align-items: center; justify-content: space-between; min-height: 18px; }
.kan-overdue { color: var(--st-error); }
.kan-card-title { font-size: 14px; font-weight: 500; color: var(--text-heading); line-height: 1.4; margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kan-card-doc { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--st-primary); margin-bottom: 8px; white-space: nowrap; overflow: hidden; }
.kan-card-doc span, .kan-card-doc { text-overflow: ellipsis; }
.kan-card-foot { display: flex; align-items: center; gap: 8px; }
.kan-card-due { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; margin-left: auto; }
.kan-empty { text-align: center; color: var(--text-disabled); padding: 14px; font-size: 14px; }

/* ===================== EMPTY / SKELETON ===================== */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 20px; gap: 10px;
  background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); }
.empty-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--bg-layout); color: var(--text-tertiary); display: grid; place-items: center; margin-bottom: 4px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-heading); }
.empty-desc { font-size: 14px; color: var(--text-secondary); max-width: 380px; line-height: 1.55; }
.empty-state .btn { margin-top: 6px; }
.skel-list { background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.skel-row { display: flex; align-items: center; gap: 14px; padding: 16px 14px; border-bottom: 1px solid var(--border-secondary); }
.skel { background: linear-gradient(90deg, var(--bg-spotlight) 25%, var(--bg-elevated) 37%, var(--bg-spotlight) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
.skel-dot { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; }
.skel-line { height: 13px; flex: 1; }
.skel-pill { height: 22px; width: 100px; border-radius: 999px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ===================== DOC LIST ===================== */
.doc-list { background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.doc-list-head { display: grid; grid-template-columns: 1fr 150px 200px 120px 90px; gap: 14px; padding: 8px 16px; background: var(--bg-layout);
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-tertiary); border-bottom: 1px solid var(--border); }
.doc-row { display: grid; grid-template-columns: 1fr 150px 200px 120px 90px; gap: 14px; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--border-secondary); cursor: pointer; transition: background .12s; }
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: var(--bg-elevated); }
.doc-row-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.doc-type-chip { font-size: 12px; font-weight: 700; color: var(--navy); background: color-mix(in srgb, var(--navy) 9%, transparent); border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
:root[data-theme="dark"] .doc-type-chip { color: var(--c-primary); background: var(--c-primary-bg); }
.doc-type-chip.lg { font-size: 12px; padding: 4px 12px; }
.doc-code { font-size: 14px; font-weight: 700; color: var(--text-heading); font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-code.lg { font-size: 16px; }
.doc-row-sub { font-size: 14px; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-col-level { display: flex; flex-direction: column; gap: 4px; }
.doc-level { font-size: 12px; color: var(--text-heading); font-weight: 500; }
.doc-date { font-size: 12px; color: var(--text-tertiary); }
.dl-col-prog { display: flex; flex-direction: column; gap: 6px; }
.doc-agg-status { display: flex; }
.dl-col-deadline { font-size: 12px; font-weight: 600; }
.dl-col-count { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.doc-count-num { font-weight: 700; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.doc-count-overdue { display: inline-flex; align-items: center; gap: 4px; color: var(--st-error); font-weight: 600; font-size: 12px; }

/* ===================== DOC DETAIL ===================== */
.doc-detail { max-width: 1080px; }
.doc-detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* Liên kết "‹ Quay lại…" = Text button DS: 14 Medium text/secondary, rê chuột đậm lên */
.back-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--ds-text-secondary);
  font-size: 14px; padding: 4px 0; margin-bottom: 12px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.back-link:hover { color: var(--ds-text-primary); }
.doc-hero { display: flex; gap: 24px; background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 22px 24px; box-shadow: var(--sh-1); }
:root[data-theme="dark"] .doc-hero { background: linear-gradient(180deg, var(--bg-elevated), var(--bg-container)); }
.doc-hero-main { flex: 1; min-width: 0; }
.doc-hero-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.doc-level-chip { font-size: 12px; font-weight: 600; color: var(--st-warning); background: color-mix(in srgb, var(--st-warning) 13%, transparent); border-radius: 999px; padding: 2px 10px; }
.qlvb-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--st-info); background: color-mix(in srgb, var(--st-info) 13%, transparent); border-radius: 999px; padding: 2px 8px; }
.doc-hero-title { font-size: 22px; font-weight: 600; line-height: 1.35; color: var(--text-heading); margin-bottom: 14px; text-wrap: pretty; }
.doc-hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.doc-hero-meta span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.doc-hero-meta span svg { color: var(--text-tertiary); }
.doc-hero-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.doc-file { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-primary-active); background: var(--c-primary-bg);
  border: 1px solid transparent; border-radius: var(--r-md); padding: 8px 12px; font-weight: 500; }
.doc-file:hover { border-color: var(--c-primary); }
.doc-hero-side { flex-shrink: 0; display: flex; align-items: center; }
.doc-agg-ring { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring { position: relative; display: grid; place-items: center; }
.ring-num { position: absolute; font-size: 22px; font-weight: 700; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.ring-pct { font-size: 12px; font-weight: 600; color: var(--text-tertiary); }
.doc-agg-caption { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }

.doc-stats { display: flex; align-items: center; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 10px; background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 16px 12px 12px; flex: 1; min-width: 150px; }
.stat-ic { width: 34px; height: 34px; border-radius: var(--r-md); display: grid; place-items: center; }
.stat-ic.tone-neutral { color: var(--text-secondary); background: var(--bg-spotlight); }
.stat-ic.tone-success { color: var(--st-success); background: color-mix(in srgb, var(--st-success) 13%, transparent); }
.stat-ic.tone-primary { color: var(--st-primary); background: color-mix(in srgb, var(--st-primary) 13%, transparent); }
.stat-ic.tone-error { color: var(--st-error); background: color-mix(in srgb, var(--st-error) 13%, transparent); }
.stat-body { display: flex; flex-direction: column; line-height: 1.1; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.doc-stats-spacer { flex: 1; min-width: 0; }
.doc-deadline-box { background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px 16px; }
.ddl-label { font-size: 12px; color: var(--text-tertiary); margin-bottom: 4px; }
.ddl-value { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ddl-rel { font-size: 12px; font-weight: 500; }

.doc-tasks-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.doc-tasks-h { font-size: 16px; font-weight: 600; white-space: nowrap; }
.doc-tasks-actions { display: flex; gap: 8px; }

/* sections */
.sections { display: flex; flex-direction: column; gap: 12px; }
.sec-group { background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.sec-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; transition: background .12s; }
.sec-head:hover { background: var(--bg-elevated); }
.sec-caret { border: 0; background: transparent; color: var(--text-tertiary); display: grid; place-items: center; padding: 0; }
.sec-num { font-size: 14px; font-weight: 700; color: var(--c-primary-active); min-width: 26px; }
.sec-title { font-size: 14px; font-weight: 600; color: var(--text-heading); }
.sec-spacer { flex: 1; }
.sec-count { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.sec-content { border-top: 1px solid var(--border-secondary); }
.subsec { border-top: 1px solid var(--border-secondary); }
.subsec:first-child { border-top: 0; }
.subsec-head { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 30px; background: var(--bg-layout); }
.subsec-num { font-size: 12px; font-weight: 700; color: var(--text-secondary); min-width: 30px; }
.subsec-title { font-size: 14px; font-weight: 600; color: var(--text-heading); }
.subsec-count { font-size: 12px; color: var(--text-tertiary); }
.sec-empty { padding: 14px 16px; font-size: 12px; color: var(--text-tertiary); font-style: italic; }
.sec-content .task-row { padding-left: 30px; }
.subsec .task-row { padding-left: 30px; }

/* toolbar hint khi mở bộ lọc */
.toolbar-hint { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.toolbar-hint svg { color: var(--c-primary); }

/* hàng nhiệm vụ trong văn bản — expand báo cáo + nhiệm vụ con */
.doctask { border-bottom: 1px solid var(--border-secondary); }
.doctask:last-child { border-bottom: 0; }
.doctask-row { border-bottom: 0 !important; }
.doctask.open .doctask-row { background: var(--bg-elevated); }
.dt-caret { border: 0; background: transparent; color: var(--text-tertiary); display: grid; place-items: center; padding: 0; width: 18px; height: 18px; margin-left: -2px; border-radius: 4px; flex-shrink: 0; }
.dt-caret:hover { color: var(--c-primary); background: var(--c-primary-bg); }
.dt-caret-spacer { width: 16px; flex-shrink: 0; }
.dt-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); background: var(--bg-spotlight); border-radius: 4px; padding: 1px 8px; }
.dt-tag.report { color: var(--st-info); background: color-mix(in srgb, var(--st-info) 12%, transparent); }
.tr-kebab2 { width: 34px; }
.doctask-exp { padding: 4px 16px 16px 48px; background: var(--bg-elevated); display: flex; flex-direction: column; gap: 14px; }
.dt-report { background: var(--bg-container); border: 1px solid var(--border); border-left: 3px solid var(--st-info); border-radius: var(--r-md); padding: 12px 14px; }
.dt-report-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--st-info); margin-bottom: 6px; }
.dt-report-text { font-size: 14px; line-height: 1.6; color: var(--text); margin: 0; }
.dt-report-file { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; font-weight: 500; color: var(--c-primary-active);
  background: var(--c-primary-bg); border: 1px solid transparent; border-radius: var(--r-md); padding: 6px 12px; }
.dt-report-file:hover { border-color: var(--c-primary); }
.dt-report-size { color: var(--text-tertiary); font-weight: 400; }
.dt-subs { display: flex; flex-direction: column; gap: 2px; }
.dt-subs-h { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.dt-sub { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-container); border: 1px solid var(--border-secondary); border-radius: var(--r-md); margin-bottom: 4px; }
.dt-sub-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dt-sub-title { font-size: 14px; color: var(--text-heading); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-sub-spacer { flex: 1; }
.dt-sub-due { font-size: 12px; font-weight: 500; white-space: nowrap; min-width: 78px; text-align: right; }

/* ===================== DRAWER ===================== */
.drawer-scrim { position: fixed; inset: 0; background: rgba(15,23,38,.42); z-index: 60; display: flex; justify-content: flex-end;
  animation: scrim-in .2s var(--ease); }
.drawer-scrim.closing { animation: scrim-out .2s var(--ease) forwards; }
@keyframes scrim-in { from { opacity: 0; } } @keyframes scrim-out { to { opacity: 0; } }
.drawer { width: min(620px, 64vw); background: var(--bg); height: 100%; display: flex; flex-direction: column; box-shadow: var(--sh-4);
  animation: drawer-in .25s var(--ease); }
.drawer.closing { animation: drawer-out .2s var(--ease) forwards; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: .4; } } @keyframes drawer-out { to { transform: translateX(40px); opacity: 0; } }
.drawer-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
.drawer-head-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer-head-actions { display: flex; gap: 2px; }
.drawer-title { font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--text-heading); margin-bottom: 12px; text-wrap: pretty; }
.drawer-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--border); }
.drawer-tab { border: 0; background: transparent; color: var(--text-secondary); font-size: 14px; font-weight: 500; padding: 12px 10px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .13s; }
.drawer-tab:hover { color: var(--text-heading); }
.drawer-tab.active { color: var(--c-primary-active); border-bottom-color: var(--c-primary); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; }
.drawer-grid { display: grid; grid-template-columns: 1fr 240px; }
.drawer-col-main { padding: 18px 22px; border-right: 1px solid var(--border); min-width: 0; }
.drawer-col-meta { padding: 18px 18px; display: flex; flex-direction: column; gap: 16px; background: var(--bg-elevated); }
.d-block { margin-bottom: 22px; } .d-block:last-child { margin-bottom: 0; }
.d-h { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.d-h-sub { font-size: 12px; color: var(--text-tertiary); background: var(--bg-spotlight); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; text-transform: none; }
.d-desc { font-size: 14px; line-height: 1.65; color: var(--text); }
.d-muted { font-size: 14px; color: var(--text-tertiary); font-style: italic; }
.d-pad { padding: 20px 22px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); }
.checklist li.done .ck-text { color: var(--text-tertiary); text-decoration: line-through; }
.ck-box { width: 18px; height: 18px; border: 1.5px solid var(--border-strong); border-radius: 4px; flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; color: #fff; }
button.ck-box { background: var(--bg-container); cursor: pointer; padding: 0; transition: border-color .12s; }
button.ck-box:hover:not(:disabled) { border-color: var(--c-primary); }
button.ck-box:disabled { cursor: default; }
.ck-del { display: grid; place-items: center; width: 22px; height: 22px; margin-left: auto; flex-shrink: 0; border: none; background: transparent; border-radius: var(--r-sm); color: var(--text-tertiary); cursor: pointer; opacity: 0; transition: opacity .12s, color .12s, background .12s; }
.checklist li:hover .ck-del, .ck-del:focus-visible { opacity: 1; }
.ck-del:hover { color: var(--st-error); background: var(--st-error-bg, rgba(195,67,67,.1)); }
.ck-add { display: flex; gap: 8px; margin-top: 12px; }
.ck-add .input { flex: 1; }
.dt-report-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.meta-units { display: flex; flex-direction: column; gap: 4px; }
.ck-text { line-height: 1.45; }
.attach-list { display: flex; flex-direction: column; gap: 8px; }
.attach { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-layout); border: 1px solid var(--border); border-radius: var(--r-md); }
.attach-ic { color: var(--text-tertiary); }
.attach-name { flex: 1; font-size: 14px; color: var(--text-heading); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { font-size: 12px; color: var(--text-tertiary); }
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-tertiary); font-weight: 600; }
.meta-value { font-size: 14px; color: var(--text-heading); padding-left: 20px; }
.meta-user { display: inline-flex; align-items: center; gap: 8px; }
.ext-card { margin-left: 20px; background: color-mix(in srgb, var(--st-warning) 8%, transparent); border: 1px solid color-mix(in srgb, var(--st-warning) 28%, transparent); border-radius: var(--r-md); padding: 8px 10px; }
.ext-line { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-heading); }
.ext-status { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--st-warning); }
.ext-reason { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.prog-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.prog-summary-label { font-size: 12px; color: var(--text-secondary); }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { display: flex; gap: 12px; padding-bottom: 18px; position: relative; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.timeline.compact .tl-item:not(:last-child)::before { left: 5px; top: 14px; }
.tl-marker { flex-shrink: 0; z-index: 1; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; z-index: 1; }
.tl-body { flex: 1; min-width: 0; }
.tl-head { font-size: 14px; color: var(--text); }
.tl-pct { font-weight: 700; color: var(--c-primary-active); }
.tl-note { font-size: 14px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.tl-time { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; font-variant-numeric: tabular-nums; }
.comment-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.cmt { display: flex; gap: 12px; }
.cmt-body { flex: 1; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; }
.cmt-head b { font-size: 14px; color: var(--text-heading); }
.cmt-time { font-size: 12px; color: var(--text-tertiary); }
.cmt-text { font-size: 14px; color: var(--text); line-height: 1.55; margin-top: 4px; }
.cmt-compose { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
/* Textinput (DS B1) Size 36: pad 8/12, r8, viền input/border-default #6B7280 → rê #4F607D → focus viền đỏ + vòng 2px;
   chữ 14 input/text, gợi ý input/placeholder; khoá: nền input/bg-disabled, viền input/border-disabled. */
.input { flex: 1; width: 100%; height: 36px; border: 1px solid var(--ds-input-border-default); border-radius: var(--ds-radius-md); padding: 0 12px;
  font-size: 14px; font-family: inherit; background: var(--ds-input-bg); color: var(--ds-input-text); outline: none; transition: border-color .12s, box-shadow .12s; }
.input:hover:not(:disabled):not([readonly]) { border-color: var(--ds-input-border-hover); }
.input:focus { border-color: var(--ds-input-border-focus); box-shadow: var(--ring); }
.input:disabled, .input[readonly] { background: var(--ds-input-bg-disabled); border-color: var(--ds-input-border-disabled); color: var(--ds-text-disabled); }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; border-top: 1px solid var(--border); background: var(--bg-container); }
.drawer-foot-right { display: flex; gap: 8px; }

/* ===================== TOAST ===================== */
.toast { position: fixed; top: 16px; right: 20px; z-index: 80; display: flex; align-items: center; gap: 12px; width: 380px; max-width: calc(100vw - 32px);
  background: var(--ds-toast-neutral-bg); color: var(--ds-toast-text); padding: 16px; border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-3-lg);
  font-size: 14px; font-weight: 500; animation: toast-in .25s var(--ease); }
.toast svg { color: currentColor; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }

/* focus visible (R-026) */
/* Focus DS: vòng 2px focus/ring cách control 2px */
:focus-visible { outline: 2px solid var(--ds-focus-ring); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 1180px) { .drawer-grid { grid-template-columns: 1fr; } .drawer-col-main { border-right: 0; } .list-head .lh-assignee, .tr-assignee .tr-unit { display: none; } }

/* ===================== MODAL (dùng chung) ===================== */
/* Popup (DS E3 — ảnh 19-dialogs-popup): nền phủ dialog/backdrop 50% · khung r12 bóng level 4 · Top pad 16 kẻ dưới
   border/subtle, tiêu đề Title 18 SemiBold, nút đóng close-square 24 · thân pad 24 · Bot pad 16 gap 12 kẻ trên,
   nút phụ trái – nút chính phải, cao 40. Rộng theo Popup / Khung DS (Figma 27/10): 400 (xác nhận) · 600 (form 1 cột)
   · 800 (form 2 cột / tra cứu) · 1200 (bảng lớn). */
.modal-scrim { position: fixed; inset: 0; background: var(--ds-dialog-backdrop); z-index: 70; display: flex; align-items: center; justify-content: center;
  padding: 30px; animation: scrim-in .2s var(--ease); }
.modal-scrim.closing { animation: scrim-out .18s var(--ease) forwards; }
.modal { background: var(--ds-surface-default); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-4-xl); display: flex; flex-direction: column;
  max-height: calc(100vh - 60px); width: min(620px, 95vw); overflow: hidden; animation: modal-in .24s var(--ease); }
.modal.closing { animation: modal-out .18s var(--ease) forwards; }
.modal.lg { width: min(1200px, 96vw); }
.modal.md { width: min(800px, 95vw); }
.modal.sm { width: min(400px, 94vw); }
.modal.form { width: min(600px, 95vw); }
.modal.tc { width: min(800px, 95vw); }
/* cỡ tra cứu / bảng của DS (800) */
.modal.mmid { width: 92vw; max-width: 800px; }
@keyframes modal-in { from { transform: translateY(14px) scale(.985); opacity: 0; } }
@keyframes modal-out { to { transform: translateY(8px) scale(.99); opacity: 0; } }

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; background: var(--ds-surface-default); border-bottom: 1px solid var(--ds-border-subtle); flex-shrink: 0; }
.modal-head-l { min-width: 0; display: flex; align-items: center; gap: 12px; }
/* Popup/Top của DS chỉ có chữ — không có ô icon trang trí trước tiêu đề */
.modal-head-ic { display: none; }
.modal-head-txt { min-width: 0; }
.modal-title { font-size: 18px; font-weight: 600; color: var(--ds-text-primary); line-height: 23.4px; }
.modal-sub { font-size: 12px; color: var(--ds-text-secondary); margin-top: 4px; line-height: 16.8px; }
.modal-body { flex: 1; overflow-y: auto; min-height: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px; background: var(--ds-surface-default); border-top: 1px solid var(--ds-border-subtle); flex-shrink: 0; }
.modal-foot .btn { height: 40px; }
.modal-foot-l { margin-right: auto; font-size: 12px; color: var(--ds-text-secondary); display: flex; align-items: center; gap: 8px; }

/* form primitives */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Trường (DS B1): nhãn Label 14 Medium text/primary cách ô 4; dấu * support/error */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
/* Ô nhập nằm thẳng trong .field (flex cột): .input có flex:1 nên flex-basis tính theo
   trục dọc, làm ô co còn ~17px. Ghim lại để cao đúng 38px như ô trong .input-group. */
.field > .input { flex: none; }
.field.span2 { grid-column: 1 / -1; }
.field-label { font-size: 14px; line-height: 19.6px; font-weight: 500; color: var(--ds-text-primary); display: flex; align-items: center; gap: 4px; }
.req-star { color: var(--ds-support-error); font-weight: 500; }
.field-hint { font-size: 12px; color: var(--ds-text-secondary); line-height: 16.8px; }
.field-opt { font-weight: 400; color: var(--ds-text-secondary); font-size: 12px; }
textarea.input { height: auto; padding: 8px 12px; resize: vertical; min-height: 88px; font-family: inherit; line-height: 21px; width: 100%; }
.input::placeholder, textarea.input::placeholder { color: var(--ds-input-placeholder); }
/* Tiêu đề nhóm trường: Subtitle 16 SemiBold text/primary, kẻ dưới border/subtle */
.form-section-h { font-size: 16px; line-height: 21.6px; font-weight: 600; color: var(--ds-text-primary);
  margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--ds-border-subtle); display: flex; align-items: center; gap: 8px; }
.form-section-h:first-child { margin-top: 0; }

/* tag / chip input (nhãn) */
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--bg-container); padding: 4px 8px; min-height: 38px; transition: border-color .15s; }
.tag-input:focus-within { border-color: var(--c-primary); }
.tag-input input { flex: 1; min-width: 90px; border: 0; outline: none; background: transparent; font-size: 14px; color: var(--text); padding: 4px 2px; }
.tag-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--c-primary-active);
  background: var(--c-primary-bg); border-radius: var(--r-sm); padding: 4px 4px 4px 8px; }
.tag-pill button { border: 0; background: transparent; color: var(--c-primary-active); display: grid; place-items: center; padding: 1px; border-radius: 4px; opacity: .7; }
.tag-pill button:hover { opacity: 1; background: var(--c-primary-bg-h); }

/* user / unit pickers */
.picker-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-container); border: 1px solid var(--border-strong);
  border-radius: 999px; padding: 4px 8px 4px 4px; font-size: 12px; color: var(--text-heading); font-weight: 500; }
.user-chip button { border: 0; background: transparent; color: var(--text-tertiary); display: grid; place-items: center; padding: 2px; border-radius: 50%; }
.user-chip button:hover { color: var(--st-error); background: color-mix(in srgb, var(--st-error) 12%, transparent); }
.picker-empty { font-size: 12px; color: var(--text-tertiary); font-style: italic; padding: 4px 0; }

/* combobox dropdown (chọn người dùng) */
.combo { position: relative; }
.combo-pop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5; background: var(--bg-container); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--sh-3); max-height: 248px; overflow-y: auto; padding: 4px; }
.combo-opt { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; text-align: left; padding: 8px 8px; border-radius: var(--r-sm); transition: background .1s; }
.combo-opt:hover, .combo-opt.active { background: var(--bg-layout); }
.combo-opt-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.combo-opt-name { font-size: 14px; font-weight: 500; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-opt-sub { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-opt-check { margin-left: auto; color: var(--c-primary); }
.combo-none { padding: 10px; text-align: center; font-size: 12px; color: var(--text-tertiary); }

/* ===== Task modal: 2-panel grid ===== */
.ct-grid { display: grid; grid-template-columns: 1fr 472px; overflow: hidden; min-height: 0; height: min(72vh, 720px); }
.ct-form { padding: 20px 22px 26px; overflow-y: auto; min-width: 0; }
.ct-source { border-left: 1px solid var(--border); background: var(--bg-elevated); display: flex; flex-direction: column; min-width: 0; }
.ct-source-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ct-source-h { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-tertiary); display: flex; align-items: center; gap: 8px; }
.ct-source-modes { padding: 12px 16px 0; flex-shrink: 0; }
.ct-source-body { flex: 1; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }

/* document meta card (in source panel) */
.srcdoc-card { margin: 12px 16px 0; background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; flex-shrink: 0; }
.srcdoc-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.srcdoc-title { font-size: 14px; font-weight: 600; color: var(--text-heading); line-height: 1.45; text-wrap: pretty; }
.srcdoc-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.srcdoc-meta span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.srcdoc-meta span svg { color: var(--text-tertiary); }

/* PDF viewer */
.pdf-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--bg-container); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.pdf-toolbar .pdf-name { font-size: 12px; font-weight: 600; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.pdf-tool-btn { width: 28px; height: 28px; border: 1px solid var(--border-strong); background: var(--bg-container); border-radius: var(--r-sm); color: var(--text-secondary); display: grid; place-items: center; }
.pdf-tool-btn:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary-active); }
.pdf-tool-btn:disabled { opacity: .4; }
.pdf-zoom { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; }
.pdf-stage { flex: 1; overflow: auto; background: var(--bg-spotlight); padding: 18px; display: flex; justify-content: center; align-items: flex-start; min-height: 0; }
.pdf-page { background: #fff; box-shadow: var(--sh-2); width: 100%; max-width: 372px; aspect-ratio: 1 / 1.414; padding: 34px 32px; display: flex; flex-direction: column; gap: 8px;
  color: #1f2937; transform-origin: top center; transition: width .15s var(--ease); flex-shrink: 0; }
.pdf-natl { text-align: center; margin-bottom: 6px; }
.pdf-natl-a { font-size: 10px; font-weight: 700; color: #1f2937; letter-spacing: .01em; }
.pdf-natl-b { font-size: 10px; font-weight: 700; color: #1f2937; }
.pdf-natl-line { width: 116px; height: 1px; background: #1f2937; margin: 4px auto 0; }
.pdf-org { font-size: 10px; font-weight: 700; color: #ba191e; text-align: left; }
.pdf-code { font-size: 10px; color: #4b5563; text-align: left; margin-top: -4px; }
.pdf-doctype { text-align: center; margin: 12px 0 4px; }
.pdf-doctype-t { font-size: 12px; font-weight: 700; color: #ba191e; text-transform: uppercase; }
.pdf-doctype-s { font-size: 10px; color: #1f2937; margin-top: 2px; line-height: 1.4; }
.pdf-bar { height: 6px; border-radius: 2px; background: repeating-linear-gradient(90deg, #e5e7eb 0 14px, #f2f0f4 14px 22px); }
.pdf-bar.short { width: 62%; } .pdf-bar.mid { width: 84%; }
.pdf-para { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.pdf-watermark { margin-top: auto; text-align: center; font-family: 'Roboto Mono', ui-monospace, monospace; font-size: 10px; color: #9ca3af; letter-spacing: .05em; }

/* dropzone */
.dropzone { flex: 1; margin: 14px 16px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--bg-container);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 28px 22px; transition: all .15s var(--ease); cursor: pointer; }
.dropzone:hover, .dropzone.drag { border-color: var(--c-primary); background: var(--c-primary-bg); }
.dropzone-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--bg-spotlight); color: var(--c-primary); display: grid; place-items: center; }
.dropzone.drag .dropzone-ic { background: var(--bg-container); }
.dropzone-title { font-size: 14px; font-weight: 600; color: var(--text-heading); }
.dropzone-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; max-width: 240px; }
.dropzone-hint { font-size: 12px; color: var(--text-tertiary); }
.src-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 30px; color: var(--text-tertiary); }
.src-empty-ic { width: 50px; height: 50px; border-radius: 50%; background: var(--bg-spotlight); display: grid; place-items: center; color: var(--text-tertiary); }
.src-empty-t { font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.src-empty-d { font-size: 12px; color: var(--text-tertiary); max-width: 230px; line-height: 1.5; }

/* uploaded file row */
.upfile { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 12px 12px; background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-md); flex-shrink: 0; }
.upfile-ic { width: 34px; height: 40px; border-radius: 4px; background: color-mix(in srgb, var(--st-error) 12%, transparent); color: var(--st-error); display: grid; place-items: center; flex-shrink: 0; font-size: 10px; font-weight: 700; }
.upfile-txt { min-width: 0; flex: 1; }
.upfile-name { font-size: 12px; font-weight: 600; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upfile-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

/* segmented toggle (require-approval etc) */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 12px; background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-md); }
.switch-row-txt { min-width: 0; }
.switch-row-t { font-size: 14px; font-weight: 500; color: var(--text-heading); }
.switch-row-d { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; line-height: 1.4; }
.switch { width: 40px; height: 22px; border-radius: 999px; background: var(--border-strong); border: 0; padding: 2px; flex-shrink: 0; transition: background .18s var(--ease); position: relative; }
.switch.on { background: var(--c-primary); }
.switch-knob { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); display: block; transition: transform .18s var(--ease); }
.switch.on .switch-knob { transform: translateX(18px); }

/* ===== org tree picker (Chủ trì / Phối hợp) ===== */
.orgtree { display: flex; flex-direction: column; }
.orgtree-root { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-tertiary); padding: 4px 6px 8px; }
.orgtree-root svg { color: var(--text-tertiary); }
.orgtree-row { display: flex; align-items: center; gap: 2px; }
.orgtree-caret { border: 0; background: transparent; color: var(--text-tertiary); width: 22px; height: 32px; display: grid; place-items: center; border-radius: 4px; flex-shrink: 0; }
.orgtree-caret:hover { color: var(--text-heading); }
.orgtree-unit-btn { flex: 1; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; text-align: left; padding: 8px 8px; border-radius: var(--r-sm); min-width: 0; }
.orgtree-unit-btn:hover { background: var(--bg-layout); }
.orgtree-unit-btn.sel { background: var(--c-primary-bg); }
.orgtree-ic { color: var(--navy); flex-shrink: 0; }
:root[data-theme="dark"] .orgtree-ic { color: var(--c-primary); }
.orgtree-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orgtree-tag { font-size: 10px; font-weight: 700; color: var(--text-tertiary); background: var(--bg-spotlight); border-radius: 999px; padding: 1px 8px; flex-shrink: 0; }
.orgtree-check { color: var(--c-primary); flex-shrink: 0; }
.orgtree-members { display: flex; flex-direction: column; padding-left: 24px; }
.orgtree-member { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: var(--r-sm); min-width: 0; }
.orgtree-member:hover { background: var(--bg-layout); }
.orgtree-member.sel { background: var(--c-primary-bg); }
.orgtree-mtxt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; flex: 1; }
.orgtree-mname { font-size: 12px; font-weight: 500; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orgtree-msub { font-size: 12px; color: var(--text-tertiary); }

/* coop list w/ per-target due */
.coop-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.coop-common { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); }
.coop-common-txt { flex: 1; min-width: 0; }
.coop-common-t { font-size: 12px; font-weight: 500; color: var(--text-heading); }
.coop-common-d { font-size: 12px; color: var(--text-tertiary); margin-top: 1px; }
.coop-common .input[type="date"] { width: 152px; flex-shrink: 0; }
.coop-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-md); }
.coop-row-ic { width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--navy) 10%, transparent); color: var(--navy); }
:root[data-theme="dark"] .coop-row-ic { color: var(--c-primary); background: var(--c-primary-bg); }
.coop-row-txt { flex: 1; min-width: 0; }
.coop-row-name { font-size: 14px; font-weight: 500; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coop-row-sub { font-size: 12px; color: var(--text-tertiary); }
.coop-row .input[type="date"] { width: 150px; flex-shrink: 0; padding: 6px 8px; }
.coop-due-tag { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.coop-del { border: 0; background: transparent; color: var(--text-tertiary); width: 28px; height: 28px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0; }
.coop-del:hover { background: color-mix(in srgb, var(--st-error) 12%, transparent); color: var(--st-error); }

/* AI extract button */
.ai-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--r-md); font-size: 12px; font-weight: 600; padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--c-primary) 38%, transparent); background: var(--c-primary-bg); color: var(--c-primary-active); transition: all .15s var(--ease); white-space: nowrap; }
.ai-btn:hover { background: var(--c-primary-bg-h); border-color: var(--c-primary); }
.ai-btn .ai-spark { color: var(--c-primary); }

/* ===== dropdown menu (cây danh mục) ===== */
/* Dropdown menu DS (B3): r8, viền border/subtle, elevation 3; mục 40 pad 10/12 r8, icon 20, rê surface/container-low */
.menu-pop { position: fixed; z-index: 90; background: var(--ds-surface-default); border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-radius-md);
  box-shadow: var(--ds-shadow-3-lg); padding: 4px; min-width: 196px; animation: modal-in .14s var(--ease); }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: var(--ds-radius-md);
  font-size: 14px; color: var(--ds-text-primary); transition: background .1s; }
.menu-item:hover { background: var(--ds-surface-container-low); }
.menu-item svg { color: var(--ds-icon-secondary); flex-shrink: 0; width: 20px; height: 20px; }
.menu-item.danger { color: var(--st-error); }
.menu-item.danger svg { color: var(--st-error); }
.menu-item.danger:hover { background: color-mix(in srgb, var(--st-error) 9%, transparent); }
.menu-sep { height: 1px; background: var(--border-secondary); margin: 4px 6px; }
.tree-node { position: relative; }
.tree-more { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 2; border: 0; background: transparent; color: var(--text-tertiary); width: 24px; height: 24px; border-radius: 4px; display: grid; place-items: center; opacity: 0; transition: opacity .12s, background .12s, color .12s; }
.tree-node:hover .tree-more, .tree-node.child:hover .tree-more, .tree-more.open { opacity: 1; }
.tree-node:hover .side-count, .tree-node.child:hover .side-count { opacity: 0; }
.tree-more:hover { background: var(--bg-spotlight); color: var(--text-heading); }
.side-h-row { display: flex; align-items: center; justify-content: space-between; }
.side-h-add { border: 0; background: transparent; color: var(--text-tertiary); width: 24px; height: 24px; border-radius: 4px; display: grid; place-items: center; }
.side-h-add:hover { background: var(--bg-layout); color: var(--c-primary-active); }

/* ===== ACL permission editor ===== */
.acl-list { display: flex; flex-direction: column; gap: 8px; }
.acl-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-md); }
.acl-subject { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.acl-subj-ic { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0; }
.acl-subj-ic.unit { background: color-mix(in srgb, var(--navy) 10%, transparent); color: var(--navy); }
:root[data-theme="dark"] .acl-subj-ic.unit { color: var(--c-primary); background: var(--c-primary-bg); }
.acl-subj-txt { min-width: 0; }
.acl-subj-name { font-size: 14px; font-weight: 500; color: var(--text-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acl-subj-kind { font-size: 12px; color: var(--text-tertiary); }
.acl-level { display: flex; background: var(--bg-spotlight); border-radius: var(--r-sm); padding: 2px; gap: 2px; flex-shrink: 0; }
.acl-level-btn { border: 0; background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 4px; display: flex; align-items: center; gap: 4px; }
.acl-level-btn.on { background: var(--bg-container); box-shadow: var(--sh-1); }
.acl-level-btn.on[data-lv="view"] { color: var(--st-info); }
.acl-level-btn.on[data-lv="manage"] { color: var(--c-primary-active); }
.acl-del { border: 0; background: transparent; color: var(--text-tertiary); width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0; }
.acl-del:hover { background: color-mix(in srgb, var(--st-error) 12%, transparent); color: var(--st-error); }
.acl-add { display: flex; gap: 8px; align-items: stretch; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border-secondary); }
.acl-inherit { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); }
.acl-empty { text-align: center; padding: 22px; color: var(--text-tertiary); font-size: 12px; font-style: italic; border: 1px dashed var(--border-strong); border-radius: var(--r-md); }

/* confirm dialog body */
.confirm-body { padding: 20px 22px; display: flex; gap: 16px; }
.confirm-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.confirm-ic.danger { background: color-mix(in srgb, var(--st-error) 12%, transparent); color: var(--st-error); }
.confirm-ic.warn { background: color-mix(in srgb, var(--st-warning) 14%, transparent); color: var(--st-warning); }
.confirm-txt { font-size: 14px; color: var(--text); line-height: 1.6; }
.confirm-txt b { color: var(--text-heading); }
.confirm-note { margin-top: 10px; padding: 10px 12px; background: var(--bg-layout); border-radius: var(--r-md); font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
/* Button Error (DS A1): nền danger/40, rê danger/30, nhấn danger/20 — chỉ cho thao tác phá huỷ trong popup xác nhận */
.btn-danger { background: var(--ds-button-danger-filled-bg); color: var(--ds-button-danger-filled-text); }
.btn-danger:hover { background: var(--ds-button-danger-filled-bg-hover); }
.btn-danger:active { background: var(--ds-button-danger-filled-bg-active); }

@media (max-width: 920px) { .ct-grid { grid-template-columns: 1fr; height: auto; } .ct-source { border-left: 0; border-top: 1px solid var(--border); } .form-grid { grid-template-columns: 1fr; } }

/* ===================== CHI TIẾT NHIỆM VỤ — bổ sung rà soát SRS ===================== */
/* Header: cho phép xuống dòng gọn, chip nguồn co được */
.dp-head { flex-wrap: wrap; }
.dp-actions { min-width: max-content; }
.src-chip { min-width: 0; max-width: 320px; }
.src-chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbl-chip { font-size: 12px; font-weight: 500; color: var(--text-secondary); background: var(--bg-spotlight);
  border: 1px solid var(--border-secondary); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.btn-xs { height: 26px; font-size: 12px; padding: 0 10px; gap: 4px; }

/* Banner duyệt / tạm dừng */
.approve-banner, .pause-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-lg);
  margin-bottom: 20px; border: 1px solid; }
.approve-banner { background: color-mix(in srgb, var(--st-warning) 8%, transparent); border-color: color-mix(in srgb, var(--st-warning) 30%, transparent); }
.pause-banner { background: color-mix(in srgb, var(--st-muted) 9%, transparent); border-color: color-mix(in srgb, var(--st-muted) 30%, transparent); }
.ab-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.approve-banner .ab-ic { color: var(--st-warning); background: color-mix(in srgb, var(--st-warning) 16%, transparent); }
.pause-banner .ab-ic { color: var(--st-muted); background: color-mix(in srgb, var(--st-muted) 16%, transparent); }
.ab-body { flex: 1; min-width: 0; }
.ab-title { font-size: 14px; font-weight: 700; color: var(--text-heading); }
.ab-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ab-sub b { color: var(--text-heading); }
.ab-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ab-wait { font-size: 12px; color: var(--text-tertiary); font-style: italic; flex-shrink: 0; }

/* Tiêu đề khối có ghi chú + nút thêm */
.d-h { flex-wrap: wrap; }
.d-h-title { white-space: nowrap; }
.d-h-note { flex-basis: 100%; margin-top: 4px; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-tertiary); }
.d-h-add { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent;
  color: var(--c-primary-active); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.d-h-add:hover { background: var(--c-primary-bg); }

/* Nguồn nhiệm vụ (đa nguồn) */
.src-list { display: flex; flex-direction: column; gap: 6px; padding-left: 20px; }
.src-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); text-decoration: none;
  background: var(--bg-layout); border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px 10px; }
.src-row.primary { border-color: color-mix(in srgb, var(--st-primary) 35%, transparent); color: var(--st-primary); background: var(--c-primary-bg); }
.src-row:hover { border-color: var(--c-primary); }
.src-row-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-row-tag { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--st-primary); }

/* Hành động gia hạn */
.ext-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }

/* Cây giao việc xuyên đơn vị */
.deleg-tree { display: flex; flex-direction: column; gap: 0; }
.dlg-node { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-container);
  border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text-secondary); }
.dlg-root { border-left: 3px solid var(--st-primary); }
.dlg-unit { font-size: 14px; font-weight: 600; color: var(--text-heading); }
.dlg-sub { font-size: 12px; color: var(--text-tertiary); }
.dlg-branch { margin-left: 18px; padding-left: 16px; border-left: 2px solid var(--border); margin-top: 8px;
  display: flex; flex-direction: column; gap: 8px; padding-top: 2px; }
.dlg-leaf { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-layout);
  border: 1px solid var(--border-secondary); border-radius: var(--r-md); }
.dlg-leaf.sub { margin-left: 16px; }
.dlg-subunit { display: flex; flex-direction: column; gap: 8px; }
.dlg-name { font-size: 12px; font-weight: 500; color: var(--text-heading); }
.dlg-role { font-size: 12px; color: var(--text-tertiary); }
.dlg-leaf .progress-wrap, .dlg-leaf .tag { margin-left: auto; }
.dlg-node .tag { margin-left: auto; }

/* Bình luận: công cụ + trả lời */
.cmt-tools { display: flex; gap: 14px; margin-top: 6px; }
.cmt-tools button { border: 0; background: transparent; color: var(--text-tertiary); font-size: 12px; font-weight: 500; cursor: pointer; padding: 0; }
.cmt-tools button:hover { color: var(--c-primary-active); }
.cmt.reply { margin-left: 40px; }
.cmt-replyto { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary);
  background: var(--bg-layout); border-radius: var(--r-md); padding: 8px 12px; margin-bottom: 10px; }
.cmt-replyto button { margin-left: auto; border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; display: grid; place-items: center; }
.cmt-replyto button:hover { color: var(--st-error); }

/* Tệp minh chứng trong dòng thời gian */
.tl-evi { margin-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--c-primary-active);
  background: var(--c-primary-bg); border: 1px solid transparent; border-radius: var(--r-md); padding: 4px 10px; cursor: pointer; }
.file-chip:hover { border-color: var(--c-primary); }
.file-chip.evi { color: var(--st-success); background: color-mix(in srgb, var(--st-success) 11%, transparent); }
.file-chip-size { color: var(--text-tertiary); font-weight: 400; }

/* Tiến độ: nút cập nhật cạnh thanh */
.prog-summary { display: flex; align-items: center; gap: 14px; }
.prog-update-btn { margin-left: auto; }

/* ===== Chi tiết nhiệm vụ: menu "Khác" (hành động thứ cấp) ===== */
.more-wrap { position: relative; }
.dp-menu { position: absolute; top: calc(100% + 4px); right: 0; left: auto; min-width: 212px; }

/* ===== Tab Nhiệm vụ con — dùng lại lưới danh sách nhiệm vụ ===== */
.dp-subs { padding: 22px 0; }
.subs-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 32px; }
.subs-summary { font-size: 12px; color: var(--text-secondary); margin-right: auto; }
.subs-summary b { color: var(--text-heading); font-weight: 600; }

/* ===== Thẻ tệp đính kèm (trang chi tiết) ===== */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.file-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 12px; cursor: pointer;
  background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color .12s, box-shadow .12s; }
.file-card:hover { border-color: var(--c-primary); box-shadow: var(--sh-1); }
.file-card:hover .file-card-dl { color: var(--c-primary-active); }
.file-card-ic { width: 34px; height: 38px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%); }
.file-card-ic.ft-error   { background: color-mix(in srgb, var(--st-error) 13%, transparent);   color: var(--st-error); }
.file-card-ic.ft-info    { background: color-mix(in srgb, var(--st-info) 13%, transparent);    color: var(--st-info); }
.file-card-ic.ft-success { background: color-mix(in srgb, var(--st-success) 16%, transparent); color: color-mix(in srgb, var(--st-success) 78%, #000); }
.file-card-ic.ft-warning { background: color-mix(in srgb, var(--st-warning) 16%, transparent); color: color-mix(in srgb, var(--st-warning) 72%, #000); }
.file-card-ic.ft-neutral { background: var(--bg-elevated); color: var(--text-secondary); }
.file-card-body { min-width: 0; flex: 1; }
.file-card-name { display: block; font-size: 12px; font-weight: 500; color: var(--text-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card-size { display: block; font-size: 12px; color: var(--text-tertiary); margin-top: 1px; font-variant-numeric: tabular-nums; }
.file-card-dl { color: var(--text-tertiary); flex-shrink: 0; transition: color .12s; }

/* ===== Modal nghiệp vụ chi tiết (Chuyển xử lý / Báo cáo / Gia hạn / Đôn đốc) ===== */
.dm-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.dm-person { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-container); border: 1px solid var(--border); border-radius: var(--r-md); }
.dm-person-name { display: block; font-size: 14px; font-weight: 600; color: var(--text-heading); }
.dm-person-sub { display: block; font-size: 12px; color: var(--text-tertiary); margin-top: 1px; }
.dm-person-tag { margin-left: auto; font-size: 12px; color: var(--text-tertiary); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.dm-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.dm-check input { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--c-primary); flex-shrink: 0; }
.dm-check.disabled { color: var(--text-disabled); cursor: not-allowed; }
.dm-check-hint { display: block; font-size: 12px; color: var(--text-tertiary); margin-top: 2px; font-weight: 400; }
.dm-range { display: flex; align-items: center; gap: 12px; }
.dm-range input[type="range"] { flex: 1; accent-color: var(--c-primary); }
.dm-pct { font-size: 14px; font-weight: 600; color: var(--text-heading); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.dm-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dm-file-x { border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; display: grid; place-items: center; padding: 0; }
.dm-file-x:hover { color: var(--st-error); }
.field-err { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ds-support-error); margin-top: 4px; }
.dm-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--st-info) 9%, transparent); color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.dm-note svg { color: var(--st-info); flex-shrink: 0; margin-top: 2px; }
.dm-note b { color: var(--text-heading); font-weight: 600; }


