/* Quản lý Trung tâm — giao diện (làm mới 05/11/2026)
   Ý tưởng "bìa hồ sơ": gáy hồ sơ màu mực chàm (thanh bên), trang giấy (nội dung), mục đang mở là tab hồ sơ nối liền với trang,
   con dấu đỏ cho thương hiệu và số việc cần làm. Chữ: Inter cho giao diện (dày đặc, số thẳng hàng), Lora cho tên trang.
   Mật độ gọn: chữ 14px, ô 32px, dòng bảng thấp; điện thoại: ô nhập 16px (iPhone không phóng to khi chạm). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("/fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/lora-var.woff") format("woff"); }

:root {
  /* Gáy hồ sơ (thanh bên) */
  --spine: #1d2a4d;
  --spine-2: #26355f;
  --spine-ink: #dfe4f1;
  --spine-muted: #8f9bbd;
  /* Trang giấy */
  --paper: #f2f3f6;
  --paper-2: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #1b2130;
  --ink-2: #474f66;
  --muted: #697088;
  --line: #d9dde6;
  --line-2: #e8eaf0;
  /* Mực dấu (chính) và dấu đỏ */
  --primary: #2b47a3;
  --primary-hover: #223a88;
  --primary-soft: #e9edf9;
  --seal: #c23a2e;
  --seal-soft: #fbeae8;
  --danger: #b42a20;
  --danger-soft: #fbeae8;
  --amber: #91600f;
  --amber-soft: #fbf1dc;
  --blue: #255da6;
  --blue-soft: #e6eefa;
  --ok: #1e7a4c;
  --ok-soft: #e2f3e9;
  --grey-soft: #eef0f4;
  /* Vai trò màu (giao diện sáng / tối dùng chung tên, khác giá trị — 05/11/2026) */
  --on-accent: #ffffff;          /* chữ trên nền màu chính, đỏ, xanh, vàng */
  --ink-strong: #1d2a4d;         /* số liệu lớn, mã, tiêu đề nhỏ màu mực chàm */
  --line-strong: #c5cbd8;
  --line-dash: #b8bfcf;
  --placeholder: #8a91a5;
  --strong-fill: #1d2a4d;        /* nền đậm của nhãn, bước đang làm (sáng: mực chàm; tối: mực dấu sáng) */
  --on-strong: #ffffff;
  --input-line: #d2d6e0;
  --faint: #a3a9ba;
  --row-hover: #f6f7fb;
  --row-selected: #edf0fb;
  --primary-line: #c3cdec;
  --danger-line: #ecc8c4;
  --danger-faint: #fff9f8;
  --danger-ink: #7c1d16;
  --amber-ink: #6a4309;
  --blue-ink: #1b3f70;
  --ok-ink: #165536;
  --warm-soft: #fffdf6;
  --warm-line: #e3d6b0;
  --ai-soft: #fff8e1;
  --ai-line: #e2b84f;
  --violet: #7a3e9d;
  --violet-soft: #faf6fc;
  --violet-soft-2: #f3e8f7;
  --violet-line: #c9b6d6;
  --bubble-mine: #e1e7f8;
  --bubble-mine-line: #c9d3f0;
  --file-bg: rgba(255, 255, 255, .7);
  --code-bg: rgba(255, 255, 255, .6);
  --toast-bg: #1b2130;
  --overlay: rgba(17, 23, 42, .42);
  --shadow-soft: rgba(22, 30, 54, .1);
  --shadow-deep: rgba(17, 23, 42, .24);
  --focus-ring: rgba(43, 71, 163, .14);
  --danger-ring: rgba(180, 42, 32, .14);
  --selection: rgba(43, 71, 163, .18);
  color-scheme: light;
  /* Tên cũ, giữ để các phần khác dùng chung */
  --bg: var(--paper);
  --cover: var(--spine);
  --cover-2: var(--spine-2);
  --cover-ink: var(--spine-ink);
  --cover-muted: var(--spine-muted);
  --gold: var(--seal);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(22, 30, 54, 0.06), 0 6px 20px rgba(22, 30, 54, 0.08);
  --font: "Inter", "Segoe UI", "Roboto", "Noto Sans", Arial, sans-serif;
  --font-title: "Lora", "Georgia", "Times New Roman", serif;
  --sidebar-w: 228px;
  --sel-w: 40px;
  --code-w: 96px;
  --ctl-h: 32px;
}

/* ---------------- Giao diện tối (05/11/2026): "hồ sơ dưới đèn bàn" ----------------
   Gáy hồ sơ tối hơn trang để mục đang mở vẫn là tab nối liền với trang; mực dấu sáng lên thành xanh nhạt,
   chữ trên nền màu đổi sang mực tối. Chỉ áp dụng trên màn hình — in ấn luôn dùng bảng màu sáng. */
@media screen {
  :root[data-theme="dark"] {
    --spine: #0d1222;
    --spine-2: #182039;
    --spine-ink: #c9d0e4;
    --spine-muted: #7a85a6;
    --paper: #151a25;
    --paper-2: #1a202c;
    --surface: #1c2230;
    --surface-2: #222938;
    --ink: #e6e9f0;
    --ink-2: #bac0cf;
    --muted: #8f96aa;
    --line: #323a4e;
    --line-2: #282f41;
    --primary: #8fa5f4;
    --primary-hover: #a9bbf8;
    --primary-soft: #232c4c;
    --seal: #c23a2e;             /* số trên menu: chữ trắng trên đỏ vẫn đủ tương phản */
    --seal-soft: #3a2024;
    --danger: #f08b81;
    --danger-soft: #3a2023;
    --amber: #e2b257;
    --amber-soft: #352b17;
    --blue: #82b2f0;
    --blue-soft: #1b2a42;
    --ok: #6bcb98;
    --ok-soft: #173126;
    --grey-soft: #272e3e;
    --on-accent: #0e1326;
    --ink-strong: #eceff6;
    --line-strong: #4a5470;
    --line-dash: #4d5770;
    --placeholder: #7d859b;
    --strong-fill: #8fa5f4;
    --on-strong: #0e1326;
    --input-line: #465069;
    --faint: #626a80;
    --row-hover: #222a3a;
    --row-selected: #26304f;
    --primary-line: #3c4a80;
    --danger-line: #5b3034;
    --danger-faint: #271b1e;
    --danger-ink: #f5b8b0;
    --amber-ink: #edcd8a;
    --blue-ink: #b0cdf3;
    --ok-ink: #a3dec0;
    --warm-soft: #211e17;
    --warm-line: #4a4230;
    --ai-soft: #2e2814;
    --ai-line: #8a6d22;
    --violet: #c6a0e2;
    --violet-soft: #271f31;
    --violet-soft-2: #32263f;
    --violet-line: #54436a;
    --bubble-mine: #25315a;
    --bubble-mine-line: #354380;
    --file-bg: rgba(255, 255, 255, .05);
    --code-bg: rgba(255, 255, 255, .08);
    --toast-bg: #2b3450;
    --overlay: rgba(3, 6, 14, .62);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-soft: rgba(0, 0, 0, .35);
    --shadow-deep: rgba(0, 0, 0, .55);
    --focus-ring: rgba(143, 165, 244, .26);
    --danger-ring: rgba(240, 139, 129, .24);
    --selection: rgba(143, 165, 244, .3);
    color-scheme: dark;
  }
}

/* ---------------- Màu giao diện của đơn vị (Cài đặt hệ thống, 08/11/2026) ----------------
   theme-boot.js đặt các biến --u-* (tính bằng public/js/colors-core.js) lên :root và thêm thuộc tính data-colors khi giao diện
   đang hiện (sáng / tối) có màu riêng. Khung xem trước ở trang Cài đặt dùng cùng cách (.color-preview). Chỉ trên màn hình. */
@media screen {
  :root[data-colors], .color-preview[data-colors] {
    --paper: var(--u-paper);
    --paper-2: var(--u-paper-2);
    --surface: var(--u-surface);
    --surface-2: var(--u-surface-2);
    --ink: var(--u-ink);
    --ink-2: var(--u-ink-2);
    --muted: var(--u-muted);
    --placeholder: var(--u-placeholder);
    --faint: var(--u-faint);
    --line: var(--u-line);
    --line-2: var(--u-line-2);
    --line-strong: var(--u-line-strong);
    --line-dash: var(--u-line-dash);
    --input-line: var(--u-input-line);
    --grey-soft: var(--u-grey-soft);
    --ink-strong: var(--u-ink-strong);
    --toast-bg: var(--u-toast-bg);
    --primary: var(--u-primary);
    --primary-hover: var(--u-primary-hover);
    --primary-soft: var(--u-primary-soft);
    --primary-line: var(--u-primary-line);
    --row-hover: var(--u-row-hover);
    --row-selected: var(--u-row-selected);
    --bubble-mine: var(--u-bubble-mine);
    --bubble-mine-line: var(--u-bubble-mine-line);
    --focus-ring: var(--u-focus-ring);
    --selection: var(--u-selection);
    --strong-fill: var(--u-strong-fill);
    --on-accent: var(--u-on-accent);
    --on-strong: var(--u-on-strong);
    --spine: var(--u-spine);
    --spine-2: var(--u-spine-2);
    --spine-ink: var(--u-spine-ink);
    --spine-muted: var(--u-spine-muted);
    --bg: var(--u-paper);
    --cover: var(--u-spine);
    --cover-2: var(--u-spine-2);
    --cover-ink: var(--u-spine-ink);
    --cover-muted: var(--u-spine-muted);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11" 1, "ss01" 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
.num, td.num, .tabnum { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { display: grid; place-items: center; height: 100vh; height: 100dvh; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------------- Con dấu (thương hiệu) ---------------- */
.seal-mark { flex: none; display: block; }

/* ---------------- Đăng nhập: trang thị thực ---------------- */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(300px, 460px) 1fr;
  background: var(--paper);
}
.login-cover {
  position: relative; overflow: hidden;
  background-color: var(--spine);
  /* Vân bảo an kiểu trang hộ chiếu: các vòng sóng mảnh, rất nhạt */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='1'%3E%3Cpath d='M0 120 Q30 90 60 120 T120 120 T180 120 T240 120'/%3E%3Cpath d='M0 132 Q30 102 60 132 T120 132 T180 132 T240 132'/%3E%3Cpath d='M0 108 Q30 78 60 108 T120 108 T180 108 T240 108'/%3E%3Ccircle cx='120' cy='120' r='96'/%3E%3Ccircle cx='120' cy='120' r='72'/%3E%3Ccircle cx='0' cy='0' r='72'/%3E%3Ccircle cx='240' cy='240' r='72'/%3E%3Ccircle cx='240' cy='0' r='48'/%3E%3Ccircle cx='0' cy='240' r='48'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--spine-ink);
  padding: 40px 40px 32px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.login-cover .brand { font-size: 15px; font-weight: 600; display: flex; gap: 12px; align-items: center; color: #fff; }
.login-cover h1 { font-family: var(--font-title); font-size: 30px; line-height: 1.22; font-weight: 600; margin: 0 0 14px; color: #fff; max-width: 15em; }
.login-cover p { color: var(--spine-muted); margin: 0; max-width: 34ch; }
.login-cover .foil { display: none; }
/* Dấu "đã duyệt" lớn, nghiêng — chỉ trang trí ở màn hình đăng nhập */
.login-cover::after {
  content: ""; position: absolute; right: -54px; bottom: 74px; width: 200px; height: 200px; border-radius: 50%;
  border: 3px solid rgba(194, 58, 46, .55); box-shadow: inset 0 0 0 7px var(--spine), inset 0 0 0 9px rgba(194, 58, 46, .45);
  transform: rotate(-14deg); pointer-events: none;
}
.login-main { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { font-family: var(--font-title); font-size: 24px; margin: 0 0 6px; font-weight: 600; }
.login-card .hint { color: var(--muted); margin: 0 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; height: 40px; }
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login-cover { padding: 22px 18px 20px; gap: 16px; }
  .login-cover h1 { font-size: 21px; margin-bottom: 6px; }
  .login-cover p { font-size: 13px; }
  .login-cover::after { width: 120px; height: 120px; right: -36px; bottom: auto; top: -30px; }
  .login-cover > div:last-child { display: none; }
}

/* ---------------- Khung ứng dụng: gáy hồ sơ + trang ---------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  background: var(--spine);
  color: var(--spine-ink);
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  z-index: 40;
}
:is(.sidebar, .pv-sidebar) .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 16px 16px 14px 16px;
  font-weight: 600; font-size: 14.5px; color: #fff; line-height: 1.25;
}
:is(.sidebar, .pv-sidebar) .brand > div { font-family: var(--font-title); font-size: 15.5px; letter-spacing: .005em; min-width: 0; }
:is(.sidebar, .pv-sidebar) .brand small { display: block; font-family: var(--font); font-weight: 400; color: var(--spine-muted); font-size: 12px; margin-top: 1px; letter-spacing: 0; }
.nav { padding: 4px 0 12px 10px; display: flex; flex-direction: column; flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group + .nav-group { margin-top: 10px; }
.nav-group-label { font-size: 11.5px; color: var(--spine-muted); padding: 6px 12px 3px; font-weight: 500; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 8px 0 0 8px;
  color: var(--spine-ink); text-decoration: none; font-size: 13.5px;
  position: relative;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .78; }
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
/* Mục đang mở: tab hồ sơ nối liền với trang giấy */
.nav a[aria-current="page"] { background: var(--paper); color: var(--ink); font-weight: 600; }
.nav a[aria-current="page"] svg { opacity: 1; color: var(--primary); }
.nav a[aria-current="page"]::before, .nav a[aria-current="page"]::after {
  content: ""; position: absolute; right: 0; width: 10px; height: 10px; background: transparent; pointer-events: none;
}
.nav a[aria-current="page"]::before { top: -10px; border-bottom-right-radius: 10px; box-shadow: 4px 4px 0 4px var(--paper); }
.nav a[aria-current="page"]::after { bottom: -10px; border-top-right-radius: 10px; box-shadow: 4px -4px 0 4px var(--paper); }

/* Tài khoản đang dùng: một dòng gọn, bấm mở các việc của tài khoản */
.sidebar .me { position: relative; padding: 10px 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; }
.me-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: transparent; border: 0; color: var(--spine-ink); padding: 6px; border-radius: 8px; cursor: pointer;
}
.me-toggle:hover, .me-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, 0.07); }
.me-toggle .me-ini {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--spine-ink); color: var(--spine); font-weight: 600; font-size: 12px;
}
.me-toggle .me-text { flex: 1; min-width: 0; }
.sidebar .me strong { display: block; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .me .me-role { display: block; color: var(--spine-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-toggle svg { width: 16px; height: 16px; flex: none; opacity: .7; transition: transform .15s ease; }
.me-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.sidebar .me .row { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.sidebar .me .row[hidden] { display: none !important; }
.sidebar .me .row button {
  background: transparent; border: 0; color: var(--spine-ink); text-align: left;
  border-radius: 6px; padding: 6px 10px 6px 46px; font-size: 13px; cursor: pointer;
}
.sidebar .me .row button:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 20px 26px 44px; max-width: 100%; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; }
  .shell.nav-open .sidebar { transform: translateX(0); box-shadow: 0 0 0 100vmax rgba(15, 20, 38, 0.4); }
  .nav { padding-right: 10px; }
  .nav a { border-radius: 8px; }
  .nav a[aria-current="page"]::before, .nav a[aria-current="page"]::after { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px;
    background: var(--spine); color: #fff; padding: 8px 12px; position: sticky; top: 0; z-index: 30;
  }
  .topbar button { background: transparent; border: 0; color: #fff; padding: 6px; cursor: pointer; display: grid; }
  .topbar .t { font-weight: 600; font-family: var(--font-title); font-size: 15.5px; }
  .content { padding: 14px 12px 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------- Tiêu đề trang ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-family: var(--font-title); font-size: 23px; line-height: 1.2; font-weight: 600; margin: 0; letter-spacing: -0.005em; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 78ch; font-size: 13px; }
.page-head .actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.page-head > div { min-width: 0; max-width: 100%; }
.page-head .actions > .tabs { min-width: 0; }
@media (max-width: 600px) { .page-head h1 { font-size: 20px; } }

/* ---------------- Nút ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--ctl-h); padding: 0 12px;
  border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 13.5px;
  text-decoration: none;
}
.btn:hover { background: var(--paper-2); border-color: var(--line-strong); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--grey-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12.5px; gap: 4px; border-radius: 6px; }
.btn.xs svg { width: 13px; height: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--on-accent) var(--on-accent) transparent transparent; animation: spin .7s linear infinite;
}
.btn:not(.primary).busy::after { border-color: var(--primary) var(--primary) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { background: transparent; border: 0; padding: 5px; border-radius: 6px; cursor: pointer; color: var(--ink-2); display: inline-grid; }
.icon-btn:hover { background: var(--grey-soft); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------------- Biểu mẫu ---------------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field label.is-req::after, .field .label.is-req::after { content: '*'; color: var(--danger); margin-left: 3px; }
.field .help { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12.5px; color: var(--danger); }
.input, select.input, textarea.input {
  height: var(--ctl-h); padding: 0 10px;
  border: 1px solid var(--input-line); border-radius: 7px; background: var(--surface);
  width: 100%; min-width: 0; font-size: 13.5px;
}
textarea.input { height: auto; min-height: 72px; padding: 7px 10px; resize: vertical; line-height: 1.45; }
select.input { padding-right: 28px; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.input[readonly] { background: var(--surface-2); }
.input:disabled { background: var(--grey-soft); color: var(--muted); cursor: not-allowed; }
.input:disabled::placeholder { color: transparent; }
.input::placeholder { color: var(--placeholder); }
.has-error .input { border-color: var(--danger); }
.has-error .input:focus { box-shadow: 0 0 0 3px var(--danger-ring); }
/* Điện thoại: ô nhập 16px — iPhone không tự phóng to khi chạm vào ô */
@media (max-width: 900px) {
  .input, select.input, textarea.input { font-size: 16px; }
  .input, select.input { height: 38px; }
  .btn { height: 36px; }
  .btn.sm { height: 32px; }
}
.grid { display: grid; gap: 12px 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
}
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.section-title {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  margin: 20px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
form > .section-title:first-child, .drawer-body > .section-title:first-child { margin-top: 0; }

/* Danh sách dòng lặp (trường học, kinh nghiệm, gia đình) */
.repeat { display: flex; flex-direction: column; gap: 8px; }
.repeat-row { display: grid; gap: 8px; align-items: start; }
.repeat-row .icon-btn { margin-top: 4px; }
.repeat-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
/* Trường học: Bậc học | Tên trường | Học từ | Học đến (mọi chương trình) */
.rr-school { grid-template-columns: 140px minmax(0, 1.35fr) minmax(0, 1fr) 96px 96px 34px; }
.rr-work { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 96px 96px 34px; }
/* Gia đình: 2 dòng cho mỗi người — Quan hệ | Họ tên | Năm sinh, rồi Nghề nghiệp | Nơi ở hiện tại */
.rr-family {
  grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) 96px 34px;
  grid-template-areas: "rel name name year del" "job job home home .";
  row-gap: 6px;
}
.rr-family > :nth-child(1) { grid-area: rel; }
.rr-family > :nth-child(2) { grid-area: name; }
.rr-family > :nth-child(3) { grid-area: year; }
.rr-family > :nth-child(4) { grid-area: job; }
.rr-family > :nth-child(5) { grid-area: home; }
.rr-family > :nth-child(6) { grid-area: live; }
.rr-family > :nth-child(7) { grid-area: hlth; }
.rr-family > :nth-child(8) { grid-area: del; }
.repeat-row.rr-family { padding: 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
.repeat-head.rr-family { padding: 0 9px; row-gap: 2px; }
.repeat-head { display: grid; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
@media (max-width: 700px) {
  .rr-school { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; grid-template-areas: "lv lv del" "nm nm ." "mj mj ." "fr to ."; }
  .rr-school > :nth-child(1) { grid-area: lv; }
  .rr-school > :nth-child(2) { grid-area: nm; }
  .rr-school > :nth-child(3) { grid-area: mj; }
  .rr-school > :nth-child(4) { grid-area: fr; }
  .rr-school > :nth-child(5) { grid-area: to; }
  .rr-school > :nth-child(6) { grid-area: del; }
  .rr-school > .field[data-key$="major"]::before, .rr-school > .field[data-key$="from_ym"]::before, .rr-school > .field[data-key$="to_ym"]::before { display: block; margin-bottom: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .rr-school > .field[data-key$="major"]::before { content: 'Chuyên ngành'; }
  .rr-school > .field[data-key$="from_ym"]::before { content: 'Học từ'; }
  .rr-school > .field[data-key$="to_ym"]::before { content: 'Học đến'; }
  .rr-family { grid-template-columns: minmax(0, 1fr) 88px 34px; grid-template-areas: "rel year del" "name name ." "job job ." "home home ."; }
  .rr-work { grid-template-columns: 1fr 1fr 34px; }
  .rr-work > :first-child { grid-column: 1 / 3; }
  .repeat-head { display: none; }
}

/* Ảnh thẻ */
.photo-box { display: flex; gap: 14px; align-items: flex-start; }
.photo-frame {
  width: 96px; height: 128px; border-radius: 6px; border: 1px dashed var(--line-dash); background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; flex: none;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ---------------- Thẻ, bộ lọc ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 14px 16px; }
/* Bộ lọc: một dải gọn, nhãn nhỏ phía trên ô */
.filters {
  display: grid; gap: 8px 10px; padding: 10px 12px; margin-bottom: 12px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  align-items: end; background: var(--paper-2);
}
.filters .field > label { font-size: 12px; font-weight: 500; color: var(--muted); }
.filters .wide { grid-column: span 2; }
.filters .end { display: flex; gap: 6px; align-items: end; }
@media (max-width: 600px) { .filters .wide { grid-column: auto; } }
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.range span { color: var(--muted); }

/* ---------------- Bảng ---------------- */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line-2);
}
.table-tools .count { color: var(--muted); font-size: 13px; }
.table-tools .count strong { color: var(--ink); }
.table-tools .spacer { flex: 1; }
.table-scroll { overflow: auto; max-height: calc(100vh - 250px); max-height: calc(100dvh - 250px); min-height: 160px; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 100%; font-size: 13.5px; }
table.data th, table.data td {
  text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line-2);
  vertical-align: top; background: var(--surface);
}
table.data th {
  position: sticky; top: 0; z-index: 2;
  background: var(--paper-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap; border-bottom: 1px solid var(--line); padding-top: 7px; padding-bottom: 7px;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data th .arrow { display: inline-block; width: 10px; margin-left: 4px; color: var(--primary); }
table.data tbody tr:hover td { background: var(--row-hover); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.selected td { background: var(--row-selected); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data .sticky { position: sticky; z-index: 1; }
table.data th.sticky { z-index: 3; }
table.data .st-sel { left: 0; width: var(--sel-w); min-width: var(--sel-w); }
table.data .st-code { left: var(--code-left, 0); width: var(--code-w); min-width: var(--code-w); }
table.data .st-name { left: var(--name-left, var(--code-w)); min-width: 170px; box-shadow: 1px 0 0 var(--line); }
table.data td.muted { color: var(--muted); }
.cell-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.cell-list li { line-height: 1.35; }
.cell-list .k { color: var(--muted); font-size: 12.5px; margin-right: 4px; }
.cell-sub { color: var(--muted); font-size: 12.5px; }
.thumb { width: 30px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--grey-soft); display: block; border: 1px solid var(--line-2); }
.thumb.empty { display: grid; place-items: center; color: var(--faint); }
.thumb.empty svg { width: 16px; height: 16px; }
/* Mã ứng viên / số chứng từ: như số hồ sơ đóng trên bìa */
.code { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--primary); white-space: nowrap; letter-spacing: .01em; }
.empty-state { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.loading-row td { color: var(--muted); }
.row-actions { display: flex; gap: 4px; flex-wrap: nowrap; }
.pager { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line-2); flex-wrap: wrap; font-size: 13px; }
.pager .info { color: var(--muted); }
.pager .spacer { flex: 1; }
.pager select { height: 28px; width: auto; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages button { min-width: 28px; height: 28px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; }
.pager .pages button[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
.pager .pages button[disabled] { opacity: .5; cursor: default; }

/* Menu chọn cột */
.popover {
  position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); padding: 6px; min-width: 220px; max-height: 360px; overflow: auto;
}
.popover .check { display: flex; padding: 5px 6px; border-radius: 5px; }
.popover .check:hover { background: var(--surface-2); }

/* ---------------- Nhãn trạng thái ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--grey-soft); color: var(--ink-2);
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.dark { background: var(--strong-fill); color: var(--on-strong); }
.tag.dark::before { background: #ff8b7e; opacity: 1; }
.tag.plain::before { display: none; }

/* Dải "con dấu" 8 loại giấy tờ */
.stamps { display: flex; gap: 4px; align-items: center; }
.stamp {
  width: 32px; height: 24px; border-radius: 4px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  border: 1.5px dashed var(--line-dash); color: var(--muted); background: transparent;
  font-variant-numeric: tabular-nums;
}
.stamp.s-ok { border: 1.5px solid var(--ok); color: var(--on-accent); background: var(--ok); }
.stamp.s-warn { border: 1.5px solid var(--amber); color: var(--amber); background: var(--amber-soft); }
.stamps .tally { margin-left: 8px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stamps .tally small { color: var(--muted); font-weight: 400; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend .stamp { width: 26px; height: 20px; font-size: 10px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }

/* ---------------- Ngăn kéo / hộp thoại ---------------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 80; display: flex; justify-content: flex-end; }
.overlay.center { justify-content: center; align-items: center; padding: 16px; overflow-y: auto; }
.drawer {
  width: min(820px, 100%); height: 100%; background: var(--surface);
  display: flex; flex-direction: column; box-shadow: -10px 0 34px var(--shadow-deep);
  animation: slidein .18s ease-out;
}
.drawer.narrow { width: min(560px, 100%); }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head, .modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 18px 12px; border-bottom: 1px solid var(--line-2);
}
.drawer-head h2, .modal-head h2 { margin: 0; font-family: var(--font-title); font-size: 19px; line-height: 1.25; font-weight: 600; }
.drawer-head .sub, .modal-head .sub { color: var(--muted); margin-top: 3px; font-size: 12.5px; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 18px 26px; }
.drawer-foot, .modal-foot {
  display: flex; justify-content: flex-end; gap: 6px; padding: 10px 18px;
  border-top: 1px solid var(--line-2); background: var(--paper-2); flex-wrap: wrap;
}
.drawer-foot .left { margin-right: auto; display: flex; gap: 6px; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); background: var(--surface); border-radius: 12px;
  display: flex; flex-direction: column; box-shadow: 0 24px 60px var(--shadow-deep); margin: auto;
}
.modal.wide { width: min(1080px, 100%); }
.modal-body { padding: 14px 18px; overflow: auto; }
.modal-body p { margin: 0 0 10px; }

/* Thẻ hộ chiếu (thông tin nhận diện chỉ đọc) */
.idcard {
  display: grid; grid-template-columns: 88px 1fr; gap: 14px;
  padding: 12px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line-2); margin-bottom: 16px;
}
.idcard .photo-frame { width: 88px; height: 117px; border-style: solid; }
.idcard h3 { margin: 0; font-family: var(--font-title); font-size: 18px; font-weight: 600; }
.idcard .code { font-size: 13px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 16px; margin-top: 8px; }
.kv div { min-width: 0; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-block { margin-top: 12px; }
.kv-block h4 { font-size: 12px; color: var(--muted); margin: 0 0 4px; font-weight: 600; }
@media (max-width: 560px) { .idcard { grid-template-columns: 1fr; } }

/* Dòng thời gian (ghi chú, lịch sử) */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line-2); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.timeline .meta { font-size: 12px; color: var(--muted); }
.timeline .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.timeline .empty { color: var(--muted); border: 0; padding-left: 0; }
.timeline .empty::before { display: none; }

/* Bảng giấy tờ trong ngăn kéo */
.doc-grid { display: flex; flex-direction: column; gap: 6px; }
.doc-row { display: grid; grid-template-columns: 210px 150px 130px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 8px; }
.doc-row .name { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.doc-head { display: grid; grid-template-columns: 210px 150px 130px minmax(0, 1fr); gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 10px; }
@media (max-width: 760px) {
  .doc-row { grid-template-columns: 1fr 1fr; }
  .doc-row .name { grid-column: 1 / -1; }
  .doc-row > :last-child { grid-column: 1 / -1; }
  .doc-head { display: none; }
}

/* ---------------- Thông báo ---------------- */
.toasts { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 6px; width: max-content; max-width: min(520px, calc(100vw - 24px)); }
.toast {
  background: var(--toast-bg); color: #fff; border-radius: 9px; padding: 10px 13px; box-shadow: var(--shadow); font-size: 13.5px;
  display: flex; gap: 10px; align-items: flex-start; animation: toastin .18s ease-out;
}
.toast.ok { background: #18563b; }
.toast.err { background: #8f2219; }
.toast.warn { background: #6c4709; }
.toast .x { margin-left: auto; background: transparent; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0 2px; font-size: 16px; line-height: 1; }
@keyframes toastin { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

.alert { border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.alert.err { background: var(--danger-soft); color: var(--danger-ink); }
.alert.warn { background: var(--amber-soft); color: var(--amber-ink); }
.alert.info { background: var(--blue-soft); color: var(--blue-ink); }
.handover-note { margin: 6px 0 0; padding: 7px 10px; font-size: 13px; }
.alert.ok { background: var(--ok-soft); color: var(--ok-ink); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert > svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* ---------------- Dashboard ---------------- */
/* Chỉ số: một dải sổ cái chia ô (không phải các thẻ rời); đường chia vẽ bằng bóng 1px — số ô bao nhiêu cũng gọn */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--surface); padding: 12px 16px 13px; min-width: 0; box-shadow: -1px 0 0 var(--line-2), 0 -1px 0 var(--line-2); }
.stat .label { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 3px; line-height: 1.1; color: var(--ink); letter-spacing: -0.01em; }
.stat .note { color: var(--muted); font-size: 12px; margin-top: 3px; }
a.stat { text-decoration: none; color: inherit; }
a.stat:hover { background: var(--paper-2); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat .value { font-size: 22px; } }
/* Hai biểu đồ tròn cạnh nhau để so sánh; tin tuyển dụng / tuyển sinh mới nhất ở dưới */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 1200px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-jobs .joblist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 22px; }
@media (max-width: 1000px) { .dash-jobs .joblist { grid-template-columns: 1fr; } }
.dash-adm { margin-top: 12px; }
.dash-adm .adm-majors, .dash-adm .adm-sch { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card h2 { font-family: var(--font-title); font-size: 16.5px; margin: 0 0 3px; font-weight: 600; }
.card .card-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.pie-wrap { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; }
@media (max-width: 620px) { .pie-wrap { grid-template-columns: 1fr; justify-items: center; } }
.pie-wrap svg { width: 200px; height: 200px; }
.pie-legend { width: 100%; border-collapse: collapse; }
.pie-legend td { padding: 2px 4px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.pie-legend td.num { text-align: right; white-space: nowrap; }
.pie-legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; vertical-align: -1px; margin-right: 8px; }
.pie-legend tr.zero td { color: var(--muted); }
.joblist { list-style: none; margin: 0; padding: 0; }
.joblist li { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.joblist li:last-child { border-bottom: 0; }
.joblist a { font-weight: 600; text-decoration: none; color: var(--ink); }
.joblist a:hover { color: var(--primary); }
.joblist .meta { color: var(--muted); font-size: 12.5px; }

/* ---------------- Lịch tuyển dụng ---------------- */
.tabs { display: inline-flex; background: var(--grey-soft); border-radius: 8px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-weight: 500; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px var(--shadow-soft); }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.cal-head h2 { margin: 0 8px 0 0; font-size: 16px; font-weight: 600; min-width: 140px; }
.cal-head .spacer { flex: 1; }
table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.cal th { font-size: 12.5px; color: var(--ink-2); font-weight: 600; padding: 8px; background: var(--paper-2); border-bottom: 1px solid var(--line); text-align: left; }
table.cal td { height: 112px; vertical-align: top; border: 1px solid var(--line-2); padding: 6px; }
table.cal td.out { background: var(--surface-2); }
table.cal td.out .d { color: var(--faint); }
table.cal td.today { box-shadow: inset 0 0 0 2px var(--gold); }
table.cal .d { font-size: 12.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
table.cal .ev {
  display: block; width: 100%; text-align: left; margin-top: 4px; padding: 4px 6px; border-radius: 4px; border: 0; cursor: pointer;
  background: var(--primary-soft); color: var(--ink-strong); font-size: 12px; line-height: 1.3;
  border-left: 3px solid var(--primary);
}
table.cal .ev.adm { background: var(--blue-soft); color: var(--blue-ink); border-left-color: var(--blue); }
table.cal .ev.closed { background: var(--grey-soft); color: var(--muted); border-left-color: var(--faint); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.cal-legend .check { display: inline-flex; align-items: center; gap: 6px; }
.cal-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.cal-key.adm { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.cal-note { margin: 0; padding: 8px 14px 0; }
.cal-list .cal-li { gap: 6px; align-items: center; text-align: left; height: auto; min-height: 26px; white-space: normal; }
table.cal .ev b { display: block; font-variant-numeric: tabular-nums; }
table.cal .ev span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-list { display: none; }
@media (max-width: 760px) {
  table.cal { display: none; }
  .cal-list { display: block; list-style: none; margin: 0; padding: 0 14px 10px; }
  .cal-list li { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
  .cal-list .d { font-weight: 600; color: var(--ink-strong); }
}
.job-detail dl { display: grid; grid-template-columns: 200px 1fr; gap: 0; margin: 0; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.job-detail dt, .job-detail dd { padding: 8px 12px; border-bottom: 1px solid var(--line-2); margin: 0; }
.job-detail dt { background: var(--surface-2); font-weight: 600; color: var(--ink-2); font-size: 13px; }
.job-detail dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.job-detail dl > :nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 600px) { .job-detail dl { grid-template-columns: 1fr; } .job-detail dt { border-bottom: 0; padding-bottom: 2px; } }

/* ---------------- Nhập Excel ---------------- */
.steps { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.steps span { padding: 4px 10px; border-radius: 12px; background: var(--grey-soft); color: var(--muted); font-size: 12.5px; }
.steps span.on { background: var(--strong-fill); color: var(--on-strong); }
.dropzone {
  border: 1.5px dashed var(--line-dash); border-radius: 8px; padding: 28px; text-align: center; background: var(--surface-2);
  cursor: pointer;
}
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone strong { display: block; margin-bottom: 4px; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.summary-chips .chip { padding: 6px 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); }
.summary-chips .chip b { font-variant-numeric: tabular-nums; }
.issue-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.issue-table th, .issue-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.issue-table th { background: var(--paper-2); font-weight: 600; color: var(--ink-2); position: sticky; top: 0; }
.issue-scroll { max-height: 260px; overflow: auto; border: 1px solid var(--line-2); border-radius: 6px; margin-bottom: 14px; }
.mode-choice { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mode-choice label { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.mode-choice label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.mode-choice label.disabled { opacity: .55; cursor: not-allowed; }
.mode-choice small { display: block; color: var(--muted); }

/* ---------------- Tài khoản ---------------- */
.pw-box { background: var(--cover); color: #fff; border-radius: 8px; padding: 14px 16px; margin: 8px 0 4px; }
.pw-box code { font-size: 20px; letter-spacing: .06em; font-weight: 600; color: #ffd9d4; user-select: all; font-family: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; }
.chip-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--ink-strong); }
.chip-check input { accent-color: var(--primary); }
.diff { font-size: 12.5px; }
.diff .f { font-weight: 600; color: var(--ink-2); }
.diff del { color: var(--danger); text-decoration: line-through; }
.diff ins { color: var(--ok); text-decoration: none; }

/* Màn hình hẹp: chỉ cố định cột mã để còn chỗ cho dữ liệu khi cuộn ngang */
@media (max-width: 700px) {
  table.data .st-name { position: static; box-shadow: none; min-width: 140px; }
  table.data .st-code { box-shadow: 1px 0 0 var(--line); }
  .table-scroll { max-height: none; }
}

/* Ô mật khẩu có nút con mắt hiện/ẩn */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-toggle {
  position: absolute; top: 50%; right: 3px; transform: translateY(-50%);
  width: 34px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); background: var(--grey-soft); }
.pw-toggle[aria-pressed="true"] { color: var(--primary); }
.pw-toggle svg { width: 18px; height: 18px; }
/* Ẩn nút hiện mật khẩu riêng của Edge để không bị hai con mắt */
.pw-wrap input::-ms-reveal, .pw-wrap input::-ms-clear { display: none; }

/* Danh sách ứng viên đăng ký của đơn hàng */
.reg-box { margin-top: 18px; }
.reg-count { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.reg-status { display: flex; align-items: center; gap: 10px; margin: -2px 0 10px; }
.meter { flex: 0 0 160px; height: 8px; border-radius: 999px; background: var(--grey-soft); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.meter.full > span { background: var(--amber); }
.reg-empty { padding: 14px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); font-size: 13.5px; }
.reg-table { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 7px; }
.reg-table table.data th { position: static; }
.reg-table tr:last-child td { border-bottom: 0; }
.reg-notes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reg-notes .tag { font-size: 11.5px; }
.modal.mid { width: min(760px, 100%); }
.pick-info { margin: 8px 0 10px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pick-info.full { color: var(--amber); font-weight: 600; }
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: 7px; }
.pick-row .who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pick-row > :last-child { flex: none; }
@media (max-width: 560px) { .meter { flex-basis: 100px; } }
@media (max-width: 600px) {
  .reg-table { border: 0; overflow: visible; }
  .reg-table table, .reg-table tbody, .reg-table tr, .reg-table td { display: block; width: 100%; }
  .reg-table thead { display: none; }
  .reg-table tr { border: 1px solid var(--line-2); border-radius: 7px; padding: 8px 10px; margin-bottom: 8px; }
  .reg-table table.data td, .reg-table table.data tbody tr:hover td { border: 0; padding: 2px 0; background: transparent; }
  .reg-table td.stt { display: none; }
  .reg-table td.act { padding-top: 6px; }
}

/* Hồ sơ mở rộng cho chương trình Nhật Bản: chỉ hiện khi biểu mẫu ở chế độ jp-mode */
form:not(.jp-mode) .jp-only { display: none !important; }
.jp-wrap { margin-top: 22px; padding: 4px 14px 14px; border: 1px solid var(--warm-line); border-radius: 9px; background: var(--warm-soft); }
.jp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 0 2px; color: var(--ink-strong); }
.jp-head span { font-size: 12.5px; color: var(--muted); }
.jp-wrap .repeat-row.rr-jprel { background: var(--surface); }
form.jp-mode .rr-family { grid-template-columns: 145px minmax(0, 1fr) minmax(0, 1fr) 96px 34px; grid-template-areas: "rel name name year del" "job job home home ." "live hlth hlth hlth ."; }
form.jp-mode .rr-work {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 96px 96px 34px;
  grid-template-areas: "co po fr to del" "sal desc desc desc ."; row-gap: 6px;
}
form.jp-mode .rr-work > :nth-child(1) { grid-area: co; }
form.jp-mode .rr-work > :nth-child(2) { grid-area: po; }
form.jp-mode .rr-work > :nth-child(3) { grid-area: fr; }
form.jp-mode .rr-work > :nth-child(4) { grid-area: to; }
form.jp-mode .rr-work > :nth-child(5) { grid-area: sal; }
form.jp-mode .rr-work > :nth-child(6) { grid-area: desc; }
form.jp-mode .rr-work > :nth-child(7) { grid-area: del; }
form.jp-mode .repeat-row.rr-work { padding: 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); }
form.jp-mode .repeat-head.rr-work { padding: 0 9px; row-gap: 2px; }
.rr-travel { grid-template-columns: 96px 96px minmax(0, 1fr) minmax(0, 1fr) 34px; }
.rr-surgery { grid-template-columns: minmax(0, 1fr) 120px 34px; }
.rr-jprel {
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 34px;
  grid-template-areas: "rel name name stat del" "home home note note ."; row-gap: 6px;
}
.rr-jprel > :nth-child(1) { grid-area: rel; }
.rr-jprel > :nth-child(2) { grid-area: name; }
.rr-jprel > :nth-child(3) { grid-area: stat; }
.rr-jprel > :nth-child(4) { grid-area: home; }
.rr-jprel > :nth-child(5) { grid-area: note; }
.rr-jprel > :nth-child(6) { grid-area: del; }
.repeat-row.rr-jprel { padding: 8px; border: 1px solid var(--line-2); border-radius: 6px; }
.repeat-head.rr-jprel { padding: 0 9px; row-gap: 2px; }
@media (max-width: 700px) {
  .jp-wrap { padding: 4px 10px 12px; }
  form.jp-mode .rr-family { grid-template-columns: minmax(0, 1fr) 88px 34px; grid-template-areas: "rel year del" "name name ." "job job ." "home home ." "live live ." "hlth hlth ."; }
  form.jp-mode .rr-work { grid-template-columns: 1fr 1fr 34px; grid-template-areas: "co co del" "po po ." "fr to ." "sal sal ." "desc desc ."; }
  .rr-travel { grid-template-columns: 1fr 1fr 34px; }
  .rr-travel > :nth-child(3), .rr-travel > :nth-child(4) { grid-column: 1 / 3; }
  .rr-jprel { grid-template-columns: 1fr 1fr 34px; grid-template-areas: "rel rel del" "name name ." "stat stat ." "home home ." "note note ."; }
  .rr-surgery { grid-template-columns: minmax(0, 1fr) 100px 34px; }
}
.jp-card { margin-top: 12px; border: 1px solid var(--warm-line); border-radius: 8px; background: var(--warm-soft); padding: 8px 12px 10px; }
.jp-card > summary { cursor: pointer; font-weight: 600; color: var(--ink-strong); font-size: 13.5px; padding: 2px 0 6px; }
.jp-card .kv { margin-top: 4px; }
.chip-check.disabled { opacity: .45; cursor: not-allowed; border-style: dashed; }
.chip-check.disabled input { cursor: not-allowed; }
.chip-check .chip-sub { color: var(--muted); font-size: 12px; }

/* Bản quyền */
.license-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 9px 24px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.license-bar svg { width: 16px; height: 16px; flex: none; }
.license-bar span { flex: 1 1 320px; }
.license-bar a { font-weight: 600; color: inherit; text-decoration: underline; white-space: nowrap; }
.license-bar.err { background: var(--danger-soft); color: var(--danger-ink); }
.license-bar.warn { background: var(--amber-soft); color: var(--amber-ink); }
.license-bar.info { background: var(--blue-soft); color: var(--blue-ink); }
.license-page { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.license-head { display: flex; align-items: center; gap: 10px; }
.license-msg { margin: 10px 0 0; }
.license-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.license-ai { margin-top: 16px; }
.license-renew { margin-bottom: 16px; }
.license-renew .section-title { display: flex; align-items: center; gap: 8px; }
.license-renew .section-title svg { width: 18px; height: 18px; flex: none; color: var(--primary); }
.renew-plans { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.renew-plan { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.renew-plan:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.renew-plan input { margin-top: 3px; flex: none; }
.renew-pay { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.renew-qr { width: 220px; max-width: 100%; flex: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; }
.renew-qr svg { display: block; width: 100%; height: auto; }
.renew-pay > div:last-child { flex: 1 1 280px; min-width: 0; }
.renew-bank { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; }
.renew-bank dt { color: var(--muted, #667085); }
.renew-bank dd { margin: 0; overflow-wrap: anywhere; }
.renew-wait::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-right: 8px; vertical-align: middle; animation: kn-pulse 1.2s ease-in-out infinite; }
.install-id { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 6px; }
.install-id code { font-size: 22px; font-weight: 700; letter-spacing: .08em; color: var(--ink-strong); background: var(--grey-soft); padding: 6px 12px; border-radius: 7px; user-select: all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.license-page .help { font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; }
@media (max-width: 760px) {
  .license-grid { grid-template-columns: 1fr; }
  .license-bar { padding: 9px 14px; }
  .install-id code { font-size: 18px; }
}

/* Sao lưu dữ liệu */
.backup-page { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.backup-page > .alert { margin-bottom: 0; }
.backup-fresh { align-items: center; justify-content: space-between; flex-wrap: wrap; }
.backup-fresh > div { flex: 1 1 320px; }
.backup-table { max-height: none; min-height: 0; }
.backup-tips ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.backup-tips code { font-size: 12.5px; background: var(--grey-soft); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.btn.danger-solid:hover:not(:disabled) { filter: brightness(.94); }
.btn.danger-solid:disabled { opacity: .5; cursor: not-allowed; }
.restore-pick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.restore-pick .input { flex: 1 1 260px; min-width: 0; padding-top: 6px; }
.restore-upload .help { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
table.restore-cmp { margin: 12px 0; }
table.restore-cmp th[scope=row] { font-weight: 500; color: var(--muted); }
.restore-warn ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
@media (min-width: 1001px) { .dash-jobs .joblist li { border-bottom: 0; } }

/* ---------------- Quên mật khẩu, mã khôi phục ---------------- */
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--primary-hover); }
.login-card .forgot-link { display: block; margin: 14px auto 0; }
.forgot-help { margin: 14px 0 0; font-size: 13px; line-height: 1.55; }
.forgot-help svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.forgot-help code { font-size: 12px; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.recovery-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 4px 0 14px; padding: 14px 18px 14px 40px; background: var(--grey-soft); border-radius: 8px; }
.recovery-codes li { color: var(--muted); }
.recovery-codes code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; font-weight: 700; letter-spacing: .06em; color: var(--ink-strong); user-select: all; }
@media (max-width: 480px) { .recovery-codes { grid-template-columns: 1fr; } }
.recovery-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.recovery-notes { margin: 0 0 14px; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.recovery-notes li { margin-bottom: 4px; }
/* Dải nhắc (cùng kiểu dải thông báo bản quyền) */
.notice-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 9px 24px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.notice-bar svg { width: 16px; height: 16px; flex: none; }
.notice-bar span { flex: 1 1 320px; }
.notice-bar a { font-weight: 600; color: inherit; text-decoration: underline; white-space: nowrap; }
.notice-bar.warn { background: var(--amber-soft); color: var(--amber-ink); }
@media (max-width: 900px) { .notice-bar { padding: 9px 14px; } }
.notice-bar .bar-x { background: transparent; border: 0; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; opacity: .7; }
.notice-bar .bar-x:hover { opacity: 1; }
.sidebar .me .row { flex-wrap: wrap; }

/* Số chưa đọc trên menu */
.nav-label { flex: 1; min-width: 0; }
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--gold); color: #ffffff; font-size: 11.5px; font-weight: 700;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.topbar button { position: relative; }
.topbar button svg { width: 22px; height: 22px; }
.nav-badge.top { position: absolute; top: -2px; right: -6px; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 4px; }

/* ---------------- Ảnh đại diện chữ ---------------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 14px; letter-spacing: .02em;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar svg { width: 20px; height: 20px; }
.avatar.sm svg { width: 16px; height: 16px; }

/* ---------------- Danh sách chọn người ---------------- */
.picker { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.picker-tools { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); }
.picker-tools.one { grid-template-columns: 1fr; }
@media (max-width: 520px) { .picker-tools { grid-template-columns: 1fr; } }
.picker-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.picker-list.tall { max-height: min(420px, 55vh); }
.modal-body > .picker-list { border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; text-align: left; }
.picker-row:last-child { border-bottom: 0; }
.picker-row:hover { background: var(--surface-2); }
.picker-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.picker-row.as-btn { background: var(--surface); border: 0; border-bottom: 1px solid var(--line-2); width: 100%; font: inherit; }
.picker-row.as-btn:hover { background: var(--primary-soft); }
.picker-row.marked { background: var(--danger-soft); }
.picker-row.marked .pr-main > span:first-child { text-decoration: line-through; }
div.picker-row { cursor: default; }
.pr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.picker-group { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 1; }
.picker-foot { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-top: 1px solid var(--line-2); background: var(--surface-2); flex-wrap: wrap; }
.picker-foot .spacer { flex: 1; }
.picker-empty { padding: 16px 12px; text-align: center; }

/* ---------------- Chat nội bộ ---------------- */
.chat {
  display: grid; grid-template-columns: 320px minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; min-height: 420px;
}
.chat-side { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: var(--surface); }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 10px; flex-wrap: wrap; }
.chat-side-head h1 { font-size: 18px; font-weight: 600; margin: 0; }
.chat-side-head .actions { display: flex; gap: 6px; }
.chat-search { padding: 0 14px 10px; border-bottom: 1px solid var(--line-2); }
.chat-list { flex: 1; overflow-y: auto; min-height: 0; }
.chat-item {
  display: flex; gap: 10px; align-items: center; width: 100%;
  padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--primary-soft); }
.ci-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ci-top, .ci-bottom { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.ci-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ci-last { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item.unread .ci-last { color: var(--ink); font-weight: 600; }
.chat-item.unread .ci-time { color: var(--primary); font-weight: 600; }
.ci-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: var(--on-accent); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.chat-empty { padding: 28px 18px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.chat-empty strong { color: var(--ink); }

.chat-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper-2); }
.chat-placeholder { margin: auto; padding: 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 360px; }
.chat-placeholder svg { width: 44px; height: 44px; color: var(--faint); }
.chat-placeholder strong { color: var(--ink); font-size: 15px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-head h2 { margin: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-main { flex: 1; min-width: 0; }
.chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; min-height: 0; padding: 14px 18px 8px; display: flex; flex-direction: column; gap: 3px; }
.chat-more { align-self: center; margin-bottom: 8px; }
.msg-day { align-self: center; margin: 12px 0 6px; }
.msg-day span { background: var(--grey-soft); color: var(--ink-2); font-size: 12px; padding: 3px 10px; border-radius: 10px; }
.msg-system { align-self: center; text-align: center; color: var(--muted); font-size: 12.5px; margin: 6px 0; max-width: 80%; }
.msg-system .msg-time { margin-left: 6px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 78%; margin-top: 6px; }
.msg.cont { margin-top: 0; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av-space { width: 30px; flex: none; }
.msg-col { display: flex; flex-direction: column; min-width: 0; }
.msg.mine .msg-col { align-items: flex-end; }
.msg-name { font-size: 12px; color: var(--muted); margin: 0 0 2px 10px; }
.bubble {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px 14px 14px 4px;
  padding: 7px 11px 5px; overflow-wrap: anywhere; box-shadow: 0 1px 1px var(--shadow-soft);
}
.msg.cont.theirs .bubble { border-top-left-radius: 6px; }
.msg.mine .bubble { background: var(--bubble-mine); border-color: var(--bubble-mine-line); border-radius: 14px 14px 4px 14px; }
.msg.cont.mine .bubble { border-top-right-radius: 6px; }
.msg-text { white-space: pre-wrap; }
.bubble a { color: var(--blue); }
.msg-time { display: inline-block; font-size: 11px; color: var(--muted); margin-left: 8px; vertical-align: -1px; white-space: nowrap; float: right; margin-top: 3px; }
.msg-seen { align-self: flex-end; font-size: 11.5px; color: var(--muted); margin: 2px 2px 0; }
.chat-composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-composer textarea.input.chat-input { min-height: 40px; height: 40px; max-height: 150px; resize: none; line-height: 1.4; padding: 9px 14px; border-radius: 20px; }
.chat-send { height: 40px; width: 44px; padding: 0; justify-content: center; border-radius: 20px; flex: none; }
.chat-send svg { width: 18px; height: 18px; }
@media (max-width: 900px) {
  .chat { grid-template-columns: minmax(0, 1fr); }
  .chat-side { border-right: 0; }
  .chat.show-thread .chat-side { display: none; }
  .chat:not(.show-thread) .chat-thread { display: none; }
  .chat-back { display: inline-grid; margin-left: -6px; }
  .msg { max-width: 88%; }
  .chat-msgs { padding: 10px 10px 6px; }
  .chat-head { padding: 8px 10px; }
  .chat-composer { padding: 8px 10px; }
}

/* ---------------- Công việc ---------------- */
.task-tabs { margin-bottom: 12px; }
.task-tabs .tabs { flex-wrap: wrap; }
.tab-badge { margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #ffffff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; vertical-align: 1px; }
.task-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-filters .wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .task-filters { grid-template-columns: minmax(0, 1fr); } }
.seg-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; border-right: 1px solid var(--line-2); background: transparent; padding: 0 11px; height: 34px; cursor: pointer; font-weight: 500; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--on-accent); }
.seg .n { font-size: 11.5px; font-variant-numeric: tabular-nums; background: var(--grey-soft); color: var(--ink-2); border-radius: 8px; padding: 0 6px; line-height: 17px; }
.seg button[aria-pressed="true"] .n { background: rgba(255, 255, 255, .22); color: var(--on-accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; color: var(--ink-2); }
.chip svg { width: 15px; height: 15px; }
.chip.danger { color: var(--danger); border-color: var(--danger-line); }
.chip[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.task-list { display: flex; flex-direction: column; min-height: 120px; }
.task-list.loading { opacity: .55; }
.task-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 120px 150px 110px; gap: 12px; align-items: center;
  width: 100%; padding: 11px 16px 11px 13px; border: 0; border-bottom: 1px solid var(--line-2); border-left: 3px solid transparent;
  background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.task-item:hover { background: var(--row-hover); }
.task-item:last-child { border-bottom: 0; }
.task-item.unseen { border-left-color: var(--gold); background: var(--warm-soft); }
.task-item.st-green .ti-title, .task-item.st-red .ti-title { color: var(--muted); }
.task-item.st-red .ti-title { text-decoration: line-through; }
.ti-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ti-title { font-weight: 600; overflow-wrap: anywhere; }
.ti-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ti-cmt { display: inline-flex; align-items: center; gap: 3px; }
.ti-cmt svg { width: 13px; height: 13px; }
.ti-status, .ti-pri { display: flex; }
.ti-status { justify-content: flex-end; }
.dot-new { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 8px; background: var(--gold); color: #ffffff; font-size: 11px; font-weight: 700; line-height: 17px; vertical-align: 1px; }
.due { display: inline-flex; flex-direction: column; line-height: 1.25; }
.due small { font-size: 12px; color: var(--muted); }
.due.none { color: var(--muted); font-size: 13px; }
.due.over { color: var(--danger); font-weight: 600; }
.due.over small { color: var(--danger); }
.due.today, .due.today small { color: var(--amber); font-weight: 600; }
.due.soon small { color: var(--amber); }
@media (max-width: 760px) {
  .task-item { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main status" "due pri"; row-gap: 6px; }
  .ti-main { grid-area: main; }
  .ti-status { grid-area: status; align-self: start; }
  .ti-due { grid-area: due; }
  .ti-pri { grid-area: pri; justify-content: flex-end; }
  .due { flex-direction: row; gap: 6px; align-items: baseline; }
}
.task-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.task-tags .due { flex-direction: row; gap: 6px; align-items: baseline; padding-left: 4px; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; margin-bottom: 4px; }
.task-desc { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 10px 12px; }
.task-timeline .ev-line { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.task-timeline .ev-line .tag { height: 20px; font-size: 12px; }
.task-timeline .body.comment { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; margin-top: 5px; }
.task-timeline li.ev-comment.mine .body.comment { background: var(--primary-soft); border-color: var(--primary-line); }
.task-timeline li.ev-status .body { color: var(--ink-2); font-style: italic; }
.task-timeline li.ev-comment::before { border-color: var(--blue); }
.task-timeline li.ev-status::before { border-color: var(--gold); }
.task-timeline li.ev-edit::before { border-color: var(--muted); }
.ev-old { text-decoration: line-through; color: var(--muted); }
.ev-new { font-weight: 600; }
.task-comment { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.due-quick { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
@media (max-width: 600px) {
  .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
  .seg button { flex: none; }
}

/* ---------------- Ảnh trong chat ---------------- */
.chat-attach { width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; color: var(--primary); }
.chat-attach svg { width: 22px; height: 22px; }
.chat-attach[disabled] { opacity: .45; cursor: not-allowed; }
.chat-tray { display: flex; gap: 8px; align-items: center; padding: 10px 14px 0; background: var(--surface); border-top: 1px solid var(--line); overflow-x: auto; }
.chat-tray:not([hidden]) + .chat-composer { border-top: 0; }
.tray-item { position: relative; width: 64px; height: 64px; flex: none; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--grey-soft); }
.tray-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray-item.busy img { opacity: .55; }
.tray-item.err { outline: 2px solid var(--danger); outline-offset: -2px; }
.tray-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .62); color: #fff; font-size: 14px; line-height: 20px; padding: 0; cursor: pointer; }
.tray-note { color: var(--muted); font-size: 12.5px; white-space: nowrap; padding-left: 4px; }
.bubble.has-img { padding: 4px 4px 4px; }
.bubble.has-img .msg-text { display: block; padding: 5px 7px 0; }
.bubble.has-img > .msg-time { float: none; display: block; text-align: right; margin: 0; padding: 3px 6px 1px 0; }
.msg-img { display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; border-radius: 11px; overflow: hidden; max-width: 100%; }
.msg-img img { display: block; max-width: 100%; height: auto; border-radius: 11px; background: var(--grey-soft); }
.msg-img.broken { display: inline-flex; gap: 6px; align-items: center; padding: 10px 12px; color: var(--muted); cursor: default; }
.msg-img.broken svg { width: 18px; height: 18px; }
.msg.sending .msg-img img { max-width: 160px; max-height: 160px; opacity: .55; }
.msg.sending .msg-time { float: none; display: block; text-align: right; }
.chat-thread.drop { outline: 3px dashed var(--primary); outline-offset: -8px; }
.chat-thread.drop .chat-msgs { opacity: .6; }
.img-viewer { position: fixed; inset: 0; z-index: 120; background: rgba(12, 16, 30, .94); display: flex; flex-direction: column; }
.iv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #fff; }
.iv-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.iv-meta strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-meta span { color: #b8bfd0; font-size: 12.5px; }
.iv-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: rgba(255, 255, 255, .13); color: #fff; text-decoration: none; cursor: pointer; font: inherit; }
.iv-btn:hover { background: rgba(255, 255, 255, .22); }
.iv-btn svg { width: 18px; height: 18px; }
.iv-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 12px 12px; }
.iv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.iv-caption { color: var(--spine-ink); text-align: center; padding: 0 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 25vh; overflow-y: auto; }
@media (max-width: 600px) { .iv-btn span { display: none; } .chat-tray { padding: 8px 10px 0; } }

/* Tệp PDF, Word, Excel trong chat */
.doc-badge {
  width: 40px; height: 48px; flex: none; border-radius: 6px; display: inline-grid; place-items: end center; padding-bottom: 6px;
  color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; position: relative; background: #697088;
  clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}
.doc-badge::after { content: ""; position: absolute; top: 0; right: 0; width: 28%; height: 22%; background: rgba(255, 255, 255, .35); }
.doc-badge.pdf { background: #c8372d; }
.doc-badge.word { background: #2b5fb4; }
.doc-badge.excel { background: #1e7a4c; }
.bubble.has-file { padding: 6px 6px 4px; min-width: 240px; max-width: 360px; }
.bubble.has-file .msg-text { display: block; padding: 6px 4px 0; }
.bubble.has-file > .msg-time { float: none; display: block; text-align: right; margin: 0; padding: 3px 4px 1px 0; }
.msg-file { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 9px; background: var(--file-bg); border: 1px solid var(--line-2); }
.msg.mine .msg-file { background: var(--file-bg); border-color: var(--bubble-mine-line); }
.mf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mf-name { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; line-height: 1.3; }
a.mf-name:hover { color: var(--primary); text-decoration: underline; }
.mf-meta { font-size: 12px; color: var(--muted); }
.mf-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.mf-actions .btn svg { width: 14px; height: 14px; }
.msg.sending .msg-file { opacity: .6; }
.tray-doc { position: relative; display: flex; align-items: center; gap: 8px; flex: none; width: 220px; height: 64px; padding: 6px 26px 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.tray-doc .doc-badge { width: 32px; height: 40px; font-size: 9.5px; padding-bottom: 5px; }
.tray-doc.err { outline: 2px solid var(--danger); outline-offset: -2px; }
.td-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.td-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-size { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-doc .tray-x { top: 4px; right: 4px; }
@media (max-width: 600px) { .bubble.has-file { min-width: 0; max-width: 100%; } .tray-doc { width: 190px; } }

/* ---------------- Nhắc việc, lịch hẹn ---------------- */
.toast .toast-link { color: #fff; font-weight: 700; text-decoration: underline; margin-left: 4px; }
.toast svg { width: 15px; height: 15px; vertical-align: -2px; }
.rem-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; max-width: 1000px; }
@media (max-width: 760px) { .rem-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rem-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; color: var(--ink-2); font-size: 13px; display: flex; flex-direction: column; }
.rem-stat strong { font-size: 24px; font-weight: 600; color: var(--ink-strong); font-variant-numeric: tabular-nums; line-height: 1.15; }
.rem-stat.red strong { color: var(--danger); }
.rem-stat.amber strong { color: var(--amber); }
.rem-body { display: flex; flex-direction: column; gap: 12px; max-width: 1000px; }
.rem-day { padding: 12px 14px; }
.rem-day h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 6px; }
.rem-day.over h2 { color: var(--danger); }
.rem-day.today { border-color: var(--primary-line); box-shadow: 0 0 0 2px var(--primary-soft); }
.rem-count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--grey-soft); color: var(--ink-2); font-size: 12px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.rem-day.over .rem-count { background: var(--danger-soft); color: var(--danger); }
.rem-empty { padding: 4px 0 2px; }
.rem-item { display: grid; grid-template-columns: 30px 84px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.rem-day h2 + .rem-item, .rem-day p + .rem-item { border-top: 0; }
.rem-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.rem-ic svg { width: 16px; height: 16px; }
.rem-item.k-task .rem-ic { background: var(--blue-soft); color: var(--blue); }
.rem-item.k-interview .rem-ic, .rem-item.k-admission_deadline .rem-ic, .rem-item.k-admission_interview .rem-ic { background: var(--amber-soft); color: var(--amber); }
.rem-item.k-passport .rem-ic { background: var(--violet-soft-2); color: var(--violet); }
.rem-item.overdue .rem-ic { background: var(--danger-soft); color: var(--danger); }
.rem-item.done { opacity: .7; }
.rem-time { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.rem-item.overdue .rem-time { color: var(--danger); }
.rem-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rem-title { font-weight: 600; overflow-wrap: anywhere; }
.rem-title a { color: var(--ink); text-decoration: none; }
.rem-title a:hover { color: var(--primary); text-decoration: underline; }
.rem-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.rem-kind { font-weight: 600; color: var(--ink-2); }
.rem-day.done summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
@media (max-width: 640px) {
  .rem-item { grid-template-columns: 30px minmax(0, 1fr); grid-template-areas: "ic time" "ic main" ". act"; row-gap: 2px; }
  .rem-ic { grid-area: ic; align-self: start; }
  .rem-time { grid-area: time; }
  .rem-main { grid-area: main; }
  .rem-item > .row-actions { grid-area: act; }
}
.appt-box { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); }
.appt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.appt-list { display: flex; flex-direction: column; gap: 4px; }
.appt-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line-2); }
.appt-row:first-child { border-top: 0; }
.appt-when { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; white-space: nowrap; }
.appt-when svg { width: 15px; height: 15px; color: var(--primary); }
.appt-row.overdue .appt-when { color: var(--danger); }
.appt-row.done { opacity: .65; }
.appt-row.done .appt-main > span:first-child { text-decoration: line-through; }
.appt-main { min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 560px) { .appt-row { grid-template-columns: 1fr; } }
.cand-pick { position: relative; }
.cand-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 260px; overflow-y: auto; }
.cand-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line-2); background: transparent; text-align: left; cursor: pointer; font: inherit; }
.cand-row:hover { background: var(--primary-soft); }
.cand-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 36px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--primary-soft); }

/* ---------------- Trợ lý AI ---------------- */
.ai-page { max-width: 1100px; display: flex; flex-direction: column; gap: 12px; }
.ai-page .page-head { margin-bottom: 4px; }
.ai-page .section-title { margin: 10px 0 0; }
.ai-page .section-title input[type="month"] { width: auto; height: 32px; }
.ai-master { font-size: 15px; margin-bottom: 10px; }
.ai-master + div .alert { margin-bottom: 0; }
.ai-providers { display: flex; flex-direction: column; gap: 10px; }
.ai-prov { padding: 12px 16px 14px; }
.ai-prov-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ai-prov-head .spacer { flex: 1; }
.ai-prov-name strong { font-size: 15px; }
.ai-pos { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--grey-soft); color: var(--ink-2); white-space: nowrap; }
.ai-pos.main { background: var(--strong-fill); color: var(--on-strong); }
.ai-prov-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.ai-test { font-size: 13px; color: var(--muted); flex: 1; min-width: 200px; }
.ai-test.ok { color: var(--ok); font-weight: 600; }
.ai-test.err { color: var(--danger); }
.ai-grid { align-items: start; }
.ai-grid h2 { font-size: 15px; margin: 0 0 8px; }
.ai-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ai-privacy svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.ai-usage h2 { font-size: 14px; margin: 6px 0 6px; }
.ai-usage table.data th, .ai-store table.data th { position: static; }
.ai-btn svg { color: var(--violet); }
.ai-post { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .ai-post { grid-template-columns: 1fr; } }
.ai-opts { display: flex; flex-direction: column; gap: 12px; }
.ai-opts .seg { flex-wrap: wrap; }
.ai-note { display: flex; gap: 4px; align-items: center; margin: 0; }
.ai-note svg { width: 15px; height: 15px; flex: none; }
.ai-result { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
textarea.input.ai-out { min-height: 340px; font-size: 14px; line-height: 1.55; }
.ai-result-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-result-bar .spacer { flex: 1; }
.ai-meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ai-meta.err { color: var(--danger); }
.ai-warn { margin: 0; font-size: 13px; }

/* ---------------- AI tạo ảnh, video (31/10/2026) ---------------- */
.aim .ai-opts .ai-opts { gap: 12px; }
.aim .ai-note svg { color: var(--violet); }
.aim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; align-items: start; }
.aim-grid:empty { display: none; }
.aim-empty { margin: 0; padding: 28px 12px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.aim-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.aim-card.st-done { border-color: var(--ok); }
.aim-media { position: relative; width: 100%; max-height: 420px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.aim-media img, .aim-media video { width: 100%; height: 100%; object-fit: contain; display: block; background: #111; }
.aim-wait, .aim-fail { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; text-align: center; font-size: 13px; color: var(--ink-2); }
.aim-fail { color: var(--danger); overflow-wrap: anywhere; }
.aim-fail svg { width: 20px; height: 20px; }
.aim-wait .spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--primary); border-color: var(--primary) var(--primary) transparent transparent; animation: spin .8s linear infinite; }
.aim-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); padding: 8px 10px 0; }
.aim-exp { color: var(--ink-2); }
.aim-acts { display: flex; gap: 6px; padding: 8px 10px 10px; flex-wrap: wrap; }
.aim-store { margin: 0; font-size: 13px; }
.aim-store svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ai-media-models { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.ai-media-store { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

/* ---------------- Đăng ký online (28/10/2026) ---------------- */
.tabs button .n { margin-left: 6px; font-size: 11.5px; background: var(--gold); color: #fff; border-radius: 8px; padding: 0 6px; line-height: 17px; display: inline-block; font-variant-numeric: tabular-nums; }
.filters .su-status-field { grid-column: 1 / -1; }
.su-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.su-item { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 12px 14px; cursor: pointer; border: 1px solid var(--line); }
.su-item:hover { border-color: var(--primary); }
.su-item.st-new { border-left: 3px solid var(--blue); }
.su-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.su-name { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.su-sub { color: var(--ink-2); overflow-wrap: anywhere; }
.su-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.su-more { display: flex; justify-content: center; margin: 10px 0; }
.su-status { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.su-msg { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.su-dups { margin-top: 14px; }
.su-dups ul { margin: 6px 0; padding-left: 18px; }
.su-dups li { margin: 4px 0; }
.su-dups li .btn { margin-left: 6px; }
.su-consent { margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.su-consent summary { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.su-consent summary svg { width: 15px; height: 15px; }
.su-consent p { white-space: pre-wrap; background: var(--surface-2); padding: 8px 10px; border-radius: var(--radius-sm); }
.su-forms-head { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; margin: 12px 0; flex-wrap: wrap; }
.su-base { font-size: 13px; background: var(--grey-soft); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.su-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.su-form { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.su-form-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.su-form-head strong { font-size: 15px; overflow-wrap: anywhere; }
.su-form-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); }
.su-form-meta svg { width: 14px; height: 14px; vertical-align: -2px; }
.su-progs { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-static { font-size: 12px; background: var(--primary-soft); color: var(--primary); border-radius: 10px; padding: 1px 8px; }
.su-url code { display: block; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 4px 8px; overflow-wrap: anywhere; user-select: all; }
.su-url.su-center code { text-align: center; margin: 10px auto 0; max-width: 460px; }
.su-form-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.su-qr { width: min(300px, 80vw); margin: 0 auto; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.su-qr svg { display: block; width: 100%; height: auto; }
.su-center { text-align: center; }
.su-consent-preview { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; margin: 0; white-space: pre-wrap; }
.su-prog-checks { flex-direction: column; gap: 6px; }
@media (max-width: 640px) {
  .su-item { flex-direction: column; align-items: stretch; }
  .su-side { flex-direction: row; align-items: center; justify-content: flex-start; }
}

/* Tờ in mã QR (chỉ hiện khi in) */
.print-sheet { display: none; }
@media print {
  body.printing > *:not(.print-sheet) { display: none !important; }
  body.printing { background: #fff; }
  .print-sheet { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18mm 14mm; font-family: var(--font); color: #000; }
  .print-sheet .ps-org { font-size: 16pt; font-weight: 700; letter-spacing: .02em; margin-bottom: 6mm; color: var(--spine); }
  .print-sheet h1 { font-size: 24pt; margin: 0 0 4mm; }
  .print-sheet .ps-intro { font-size: 12pt; max-width: 150mm; margin: 0 0 6mm; }
  .print-sheet .ps-qr { width: 110mm; }
  .print-sheet .ps-qr svg { display: block; width: 100%; height: auto; }
  .print-sheet .ps-cta { font-size: 15pt; font-weight: 600; margin: 6mm 0 2mm; }
  .print-sheet .ps-url { font-size: 11pt; font-family: monospace; }
  .print-sheet .ps-contact { font-size: 12pt; margin-top: 5mm; }
}

/* ---------------- Bản scan giấy tờ ---------------- */
.scan-box { margin-top: 14px; }
.scan-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.scan-bar select { width: auto; min-width: 200px; height: 32px; }
.scan-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.chip .n { font-size: 11.5px; background: var(--grey-soft); color: var(--ink-2); border-radius: 8px; padding: 0 6px; line-height: 17px; }
.chip[aria-pressed="true"] .n { background: rgba(255, 255, 255, .25); color: var(--on-accent); }
.scan-chips .chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
.scan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 8px; }
.scan-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px; background: var(--surface); }
.scan-thumb { width: 64px; height: 64px; border: 1px solid var(--line-2); border-radius: 5px; padding: 0; background: var(--surface-2); cursor: zoom-in; overflow: hidden; display: grid; place-items: center; grid-row: span 2; }
.scan-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-thumb.pdf { cursor: pointer; }
.scan-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scan-info .tag { align-self: flex-start; }
.scan-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.scan-actions .btn.xs { height: 26px; }
.scan-empty { color: var(--muted); font-size: 13px; padding: 6px 0; grid-column: 1 / -1; }
.scan-count { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 11.5px; padding: 0 6px; height: 20px; display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; cursor: pointer; color: var(--ink-2); }
.scan-count svg { width: 12px; height: 12px; }

/* ---------------- AI đọc CCCD / hộ chiếu ---------------- */
.idr-note { display: flex; gap: 10px; align-items: flex-start; }
.idr-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.idr-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
@media (max-width: 640px) { .idr-slots { grid-template-columns: 1fr; } }
.idr-slot { display: flex; flex-direction: column; gap: 6px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px; }
.idr-frame { height: 150px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.idr-frame > svg { width: 52px; height: 52px; }
.idr-frame img { max-width: 100%; max-height: 150px; object-fit: contain; }
.idr-agree { align-items: flex-start; margin-bottom: 10px; }
.idr-agree input { margin-top: 2px; }
.idr-agree.need { color: var(--danger); font-weight: 600; }
.idr-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.idr-result { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.idr-doc { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.idr-table td { vertical-align: top; }
.idr-table tr.idr-diff td { background: var(--amber-soft); }
.idr-warn { color: var(--amber); }
.idr-save { align-items: flex-start; }
.idr-apply { display: flex; justify-content: flex-end; }
/* Đọc ảnh tuyển dụng / tuyển sinh (01/11/2026) */
.pr-bar { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border: 1px dashed var(--violet-line); border-radius: var(--radius); background: var(--violet-soft); }
.pr-bar > svg { width: 22px; height: 22px; flex: none; color: var(--violet); }
.pr-bar > div { flex: 1; min-width: 0; }
.pr-drop { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px; margin: 12px 0; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); }
.pr-drop > svg { width: 28px; height: 28px; flex: none; color: var(--faint); }
.pr-drop > div { flex: 1; min-width: 200px; }
.pr-drop.over { border-color: var(--violet); background: var(--violet-soft); }
.pr-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pr-thumb { position: relative; height: 140px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; display: grid; place-items: center; }
.pr-thumb img { max-width: 100%; max-height: 140px; object-fit: contain; }
.pr-thumb .icon-btn { position: absolute; top: 4px; right: 4px; background: var(--surface); }
.pr-val { white-space: pre-wrap; max-height: 9.5em; overflow: auto; overflow-wrap: anywhere; }
@media (max-width: 700px) { .pr-bar { flex-wrap: wrap; } .pr-bar .btn { width: 100%; justify-content: center; } }
/* Đọc ảnh hồ sơ ứng viên (01/11/2026) */
.ai-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cr-sensitive { align-items: flex-start; margin-bottom: 10px; font-size: 13px; }
.cr-sensitive input { margin-top: 2px; flex: none; }
.cr-list { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.cr-row { align-items: flex-start; overflow-wrap: anywhere; }
.cr-row input { margin-top: 2px; flex: none; }
.repeat-row.ai-filled-row, .repeat-row.rr-family.ai-filled-row { background: var(--ai-soft); border-radius: 6px; box-shadow: 0 0 0 4px var(--ai-soft); }
.input.ai-filled, .ai-filled.input { background: var(--ai-soft); border-color: var(--ai-line); }
.ai-sub { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; }
.ai-ack, .kn-ack { align-items: flex-start; background: var(--amber-soft); padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; }
.ai-ack input, .kn-ack input { margin-top: 2px; flex: none; }

/* ---------------- CV tiếng Nhật / tiếng Hàn (Đợt 3) ---------------- */
.cvf-top { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.cvf-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cvf-ai { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.cvf-ai-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cvf-ai-head svg { width: 17px; height: 17px; color: var(--primary); }
.cvf-ai p { margin: 0; }
.cvf-ai .check { align-items: flex-start; }
.cvf-ai .check input { margin-top: 3px; flex: none; }
.cvf-opts { display: flex; flex-direction: column; gap: 8px; }
.cvf-list { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.cvf-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line-2); align-items: start; }
.cvf-row:first-child { border-top: 0; }
.cvf-row.missing { background: var(--danger-faint); }
.cvf-row.missing .input { border-color: var(--danger-line); }
.cvf-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cvf-vi { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cvf-dst { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cvf-dst .input { width: 100%; }
.cvf-dst textarea.input { resize: vertical; min-height: 54px; }
.cvf-sens { font-size: 11px; height: 18px; }
.cvf-foot-note { margin-top: 14px; }
@media (max-width: 640px) { .cvf-row { grid-template-columns: 1fr; gap: 6px; } }

/* ---------------- Báo cáo KPI (Đợt 3) ---------------- */
.rp-filters .help { max-width: 260px; }
.rp-period { margin: -4px 0 12px; color: var(--ink-2); font-weight: 500; }
.rp-body { transition: opacity .15s; }
.rp-body.loading { opacity: .55; pointer-events: none; }
.stats.rp-stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .stats.rp-stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .stats.rp-stats.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stats.rp-stats, .stats.rp-stats.five { grid-template-columns: 1fr; } }
.rp-stats .delta.up { color: var(--ok); }
.rp-stats .delta.down { color: var(--danger); }
.rp-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.rp-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1200px) { .rp-grid, .rp-grid.two { grid-template-columns: 1fr; } }
.rp-grid > .card, .rp-body > .card { margin: 0; }
.rp-body > .card { margin-bottom: 12px; }
.rp-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.rp-card-head h2 { margin-bottom: 2px; }
.rp-table td.num, .rp-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-table tfoot td { font-weight: 600; border-top: 2px solid var(--line); background: var(--surface-2); }
.rp-table tr.zero td { color: var(--muted); }
.rp-rate > div { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; }
.rp-mini { width: 56px; height: 6px; border-radius: 3px; background: var(--grey-soft); overflow: hidden; display: inline-block; }
.rp-mini span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.rp-target { min-width: 92px; }
.rp-progress { height: 5px; border-radius: 3px; background: var(--grey-soft); margin: 4px 0 2px auto; width: 80px; overflow: hidden; }
.rp-progress span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.rp-progress span.done { background: var(--ok); }
.rp-defs { margin-top: 4px; }
/* Báo cáo hồ sơ (29/10/2026): chỉ tiêu ngay trên thẻ số liệu (KPI của nhân viên hồ sơ); dòng tài chính trong bảng giấy tờ */
.rp-stat-target { margin-top: 6px; }
.rp-stat-target .rp-progress { margin: 4px 0 0; width: 100%; max-width: 180px; }
.rp-table tr.rp-fin td { border-top: 1px dashed var(--line); }
.rp-table tr.rp-fin + tr.rp-fin td { border-top: 0; }
.rp-targets td.rp-na { text-align: center; vertical-align: middle; color: var(--muted); }
.rp-stack { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.rp-stack > .card { margin: 0; }
.rp-zero { margin: 10px 0 0; }
.rp-funnel { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.rp-frow { display: grid; grid-template-columns: minmax(120px, 0.9fr) minmax(0, 1.4fr) 82px; gap: 10px; align-items: center; }
.rp-flabel { font-size: 13px; color: var(--ink-2); }
.rp-fbar { height: 14px; background: var(--grey-soft); border-radius: 4px; overflow: hidden; }
.rp-fbar span { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; }
.rp-fval { text-align: right; font-variant-numeric: tabular-nums; display: flex; gap: 6px; justify-content: flex-end; align-items: baseline; }
.rp-fval span { color: var(--muted); font-size: 12px; }
.rp-lost { margin-top: 14px; color: var(--muted); font-size: 13px; }
@media (max-width: 520px) { .rp-frow { grid-template-columns: 1fr 72px; } .rp-fbar { grid-column: 1 / -1; grid-row: 2; } }
.rp-targets-head { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.rp-targets-head .field { margin: 0; }
.rp-tin { width: 96px; text-align: right; margin-left: auto; }
.rp-tfield { margin: 0; align-items: flex-end; }
.rp-tfield.has-error .rp-tin { border-color: var(--danger); background: var(--danger-soft); }

/* Biểu đồ đường */
.viz-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin: 8px 0 4px; }
.viz-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend .key, .viz-tip .key { width: 14px; height: 2px; border-radius: 1px; display: inline-block; }
.viz-box { width: 100%; min-height: 260px; }
.viz-line { display: block; max-width: 100%; height: auto; overflow: visible; }
.viz-line .grid { stroke: var(--line-2); stroke-width: 1; }
.viz-line .axis { stroke: var(--line); stroke-width: 1; }
.viz-line .tick { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.viz-line .end-label { fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.viz-line .dot { stroke: var(--surface); stroke-width: 2; }
.viz-line .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-line .hit { cursor: crosshair; outline: none; }
.viz-line .hit:focus-visible { stroke: var(--primary); stroke-width: 1.5; }
.viz-tip { position: fixed; z-index: 95; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; min-width: 150px; }
.viz-tip-title { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.6; }
.viz-tip-row b { font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

/* ---------------- Xác thực 2 lớp ---------------- */
.otp-input { font-size: 20px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.otp-remember { align-items: flex-start; font-size: 13px; color: var(--ink-2); margin: 0 0 16px; }
.otp-remember input { margin-top: 2px; flex: none; }
.otp-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.otp-help { margin-top: 14px; }
.otp-card { max-width: 460px; }
.otp-setup { display: flex; flex-direction: column; gap: 14px; }
.otp-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.otp-qr-row { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 14px; align-items: start; }
.otp-qr { width: 172px; height: 172px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.otp-qr svg { width: 100%; height: 100%; display: block; }
.otp-qr-side p { margin: 0 0 8px; }
.otp-secret { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; font-weight: 700; letter-spacing: .08em; padding: 6px 8px; background: var(--grey-soft); border-radius: 6px; user-select: all; overflow-wrap: anywhere; margin-bottom: 8px; }
@media (max-width: 480px) { .otp-qr-row { grid-template-columns: 1fr; justify-items: center; } }
.otp-codes p { margin: 0 0 8px; }
.otp-codes .check { margin-top: 10px; }
.otp-done { margin-top: 12px; display: flex; justify-content: flex-end; }
.otp-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.otp-devices { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 6px; }
.otp-devices li { padding: 8px 10px; background: var(--surface-2); border-radius: 6px; }
.otp-devices .tag { margin-left: 8px; }
.otp-policy { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.warn-text { color: var(--amber); }

/* ---------------- Đối tác ---------------- */
.pt-stats .rem-stat { text-align: left; font: inherit; cursor: pointer; }
.pt-stats .rem-stat:hover { border-color: var(--primary); }
.pt-progs { max-width: 260px; white-space: normal; }
.pt-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.pt-kpis > div { border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; color: var(--ink-2); display: flex; flex-direction: column; }
.pt-kpis strong { font-size: 20px; font-weight: 600; color: var(--ink-strong); line-height: 1.2; }
.pt-links { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.pt-note-form { border: 1px dashed var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 8px; }
.pt-note-form .end { display: flex; justify-content: flex-end; }
.pt-notes { display: grid; gap: 8px; }
.pt-note { border-left: 3px solid var(--line); padding: 4px 0 4px 10px; }
.pt-note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.pt-note-head .btn { margin-left: auto; }
.pt-note-body { white-space: pre-wrap; margin-top: 2px; }
@media (max-width: 720px) { .pt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------- Sau xuất cảnh ---------------- */
.ac-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: none; }
.ac-stats .rem-stat { text-align: left; font: inherit; cursor: pointer; }
.ac-stats .rem-stat:hover { border-color: var(--primary); }
@media (max-width: 1100px) { .ac-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .ac-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ac-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ac-job { max-width: 240px; white-space: normal; }
.ac-overdue { color: var(--danger); font-weight: 600; }
.ac-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ac-head .btn { margin-left: auto; }
.ac-quick { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.ac-issue { align-items: flex-start; }
.ac-save { display: flex; justify-content: flex-end; margin-top: 10px; }
.ac-flags { display: flex; flex-direction: column; gap: 8px; padding-top: 22px; }
.pt-note.issue { border-left-color: var(--danger); }

/* ---------------- Thông báo đẩy, cài ứng dụng ---------------- */
.push-panel { display: grid; gap: 18px; }
.push-sec h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.push-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.push-kinds { display: grid; gap: 6px; margin-top: 6px; }
.push-kinds .check { align-items: flex-start; }
.push-kinds .check input { margin-top: 2px; flex: none; }
.push-dev { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.push-dev > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.push-dev > div { flex: 1; min-width: 0; }
.push-dev .tag { margin-left: 6px; }

/* ---------------- Đào tạo ngoại ngữ ---------------- */
.tr-tabs { margin-bottom: 14px; }
.tr-tabs .tabs { flex-wrap: wrap; }
.empty-note { padding: 14px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; background: var(--surface-2); }
.tr-ok { color: var(--ok); font-weight: 500; }
.tr-warn { color: var(--amber); font-weight: 500; font-size: 12.5px; }
.tr-rate { font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-rate.ok { color: var(--ok); }
.tr-rate.warn { color: var(--amber); }
.tr-rate.bad { color: var(--danger); }
.tr-prog { display: flex; flex-direction: column; gap: 3px; min-width: 110px; }
.tr-bar { height: 6px; border-radius: 3px; background: var(--grey-soft); overflow: hidden; }
.tr-bar span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.tr-clip { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Buổi học hôm nay */
.tr-today { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.tr-today-head { margin-bottom: 8px; }
.tr-today-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tr-today-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: start; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); }
.tr-today-card.done { background: var(--ok-soft); border-color: transparent; }
.tr-today-time { font-weight: 600; color: var(--ink-strong); font-size: 15px; grid-row: span 2; padding-top: 1px; }
.tr-today-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-today-card .btn { grid-column: 2; justify-self: start; margin-top: 4px; }
.tr-unmarked-box { margin-top: 10px; }
.tr-unmarked-box summary { cursor: pointer; color: var(--amber); font-weight: 600; }
.tr-unmarked { margin-top: 6px; }
.tr-unmarked-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line-2); }
.tr-unmarked-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ngăn lớp học */
.tr-info { margin-bottom: 12px; }
.tr-info summary { cursor: pointer; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.tr-pane-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tr-roster { display: flex; flex-direction: column; }
.tr-roster-row { display: grid; grid-template-columns: 36px minmax(170px, 1fr) minmax(0, auto) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.tr-roster-row:first-child { border-top: 0; }
.tr-roster-row.off { opacity: .7; }
.tr-roster-row .thumb { width: 36px; height: 48px; }
.tr-roster-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tr-roster-side { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: flex-end; max-width: 380px; }
.tr-sessions { display: flex; flex-direction: column; }
.tr-session { display: grid; grid-template-columns: 28px 92px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 7px 6px; border-top: 1px solid var(--line-2); }
.tr-session:first-child { border-top: 0; }
.tr-session-n { color: var(--muted); text-align: right; font-size: 12.5px; }
.tr-session-when { display: flex; flex-direction: column; }
.tr-session-main { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
.tr-session.today { background: var(--blue-soft); border-radius: 6px; }
.tr-session.cancelled .tr-session-when strong { text-decoration: line-through; color: var(--muted); }
.tr-session.done .tr-session-n { color: var(--ok); }
@media (max-width: 640px) {
  .tr-roster-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .tr-roster-side { grid-column: 2 / -1; justify-content: flex-start; max-width: none; }
  .tr-session { grid-template-columns: 24px 84px minmax(0, 1fr); }
  .tr-session-state, .tr-session .row-actions { grid-column: 3; }
  .tr-unmarked-row { grid-template-columns: 1fr auto; }
  .tr-unmarked-name { grid-column: 1; grid-row: 2; }
}

/* Lịch tuần khi mở lớp */
.tr-sched { display: flex; flex-direction: column; gap: 8px; }
.tr-days button { min-width: 44px; justify-content: center; }
.tr-slots { display: flex; flex-direction: column; gap: 6px; }
.tr-slot { display: grid; grid-template-columns: 80px 120px auto 120px; gap: 8px; align-items: center; }
.tr-slot-day { font-weight: 600; color: var(--ink-2); }
.tr-preview { margin: 4px 0 8px; padding: 8px 12px; border-radius: 6px; background: var(--primary-soft); color: var(--ink-strong); font-size: 13px; }
@media (max-width: 520px) { .tr-slot { grid-template-columns: 70px minmax(0, 1fr) auto minmax(0, 1fr); } }

/* Phiếu điểm danh */
.att-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.att-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.att-count { display: inline-flex; gap: 4px; align-items: baseline; font-size: 12.5px; color: var(--ink-2); background: var(--grey-soft); border-radius: 10px; padding: 1px 8px; }
.att-count.att-present strong { color: var(--ok); }
.att-count.att-late strong { color: var(--amber); }
.att-count.att-excused strong { color: var(--blue); }
.att-count.att-absent strong { color: var(--danger); }
.att-count.att-none { background: var(--amber-soft); }
.att-list { display: flex; flex-direction: column; margin-bottom: 12px; }
.att-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.att-row:first-child { border-top: 0; }
.att-row .thumb { width: 36px; height: 48px; }
.att-name { display: flex; flex-direction: column; min-width: 0; }
.att-name strong { overflow: hidden; text-overflow: ellipsis; }
.att-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.att-seg button { border: 0; border-right: 1px solid var(--line-2); background: transparent; height: 38px; min-width: 56px; padding: 0 8px; cursor: pointer; font-weight: 500; color: var(--ink-2); font-size: 13px; }
.att-seg button:last-child { border-right: 0; }
.att-seg button:disabled { cursor: default; }
.att-seg button:not(:disabled):hover { background: var(--surface-2); }
.att-seg button.att-present[aria-checked="true"] { background: var(--ok); color: var(--on-accent); }
.att-seg button.att-late[aria-checked="true"] { background: var(--amber); color: var(--on-accent); }
.att-seg button.att-excused[aria-checked="true"] { background: var(--blue); color: var(--on-accent); }
.att-seg button.att-absent[aria-checked="true"] { background: var(--danger); color: var(--on-accent); }
.att-note { grid-column: 2 / -1; height: 32px; }
@media (max-width: 520px) {
  .att-row { grid-template-columns: 36px minmax(0, 1fr); }
  .att-seg { grid-column: 1 / -1; width: 100%; }
  .att-seg button { flex: 1; min-width: 0; height: 42px; }
  .att-note { grid-column: 1 / -1; }
}

/* Ngoại ngữ và lớp học của ứng viên */
.tr-box { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); }
.tr-box-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.tr-langs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tr-langs li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tr-langs li strong { min-width: 90px; }
.tr-noclass { margin-top: 6px; }
.tr-enrolls { margin-top: 8px; display: flex; flex-direction: column; }
.tr-enroll { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line-2); align-items: center; }
.tr-enroll-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; align-items: flex-start; }
.tr-enroll-side { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; justify-content: flex-end; max-width: 300px; }
.tr-lang-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.tr-lang-row { position: relative; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 44px 4px 12px; }
.tr-lang-del { position: absolute; top: 8px; right: 6px; }
.tr-pick-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; max-height: 52vh; overflow: auto; }
.tr-pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line-2); align-items: center; }
.tr-pick:first-child { border-top: 0; }
.tr-pick-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tr-pick-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tr-cand { display: grid; grid-template-columns: auto 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line-2); cursor: pointer; }
.tr-cand:first-child { border-top: 0; }
.tr-cand.off { opacity: .6; cursor: default; }
.tr-cand input { width: 16px; height: 16px; accent-color: var(--primary); }
.tr-cand-main { display: flex; flex-direction: column; min-width: 0; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tr-chips .cand-chip { height: 32px; }
@media (max-width: 560px) {
  .tr-enroll, .tr-pick { grid-template-columns: 1fr; }
  .tr-enroll-side, .tr-pick-side { justify-content: flex-start; align-items: flex-start; max-width: none; }
  .tr-cand { grid-template-columns: auto 34px minmax(0, 1fr); }
  .tr-cand .tag { grid-column: 3; justify-self: start; }
}

/* Danh mục ngôn ngữ */
.tr-lang-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tr-lang-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.tr-lang-card.off { opacity: .7; }
.tr-lang-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-lang-card-head .btn { margin-left: auto; }
.tr-chiplist { display: flex; flex-wrap: wrap; gap: 4px; }
.tr-kv { margin-top: 4px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tr-sched-cell { min-width: 150px; }
.tr-days { align-self: flex-start; }
.tr-slot { grid-template-columns: 80px 132px 12px 132px; justify-content: start; }
.tr-class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tr-class-card { text-align: left; font: inherit; cursor: pointer; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; color: inherit; }
.tr-class-card:hover { border-color: var(--primary); }
.tr-class-card.off { opacity: .7; }
.tr-class-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.att-extra { margin-top: 4px; }
@media (max-width: 520px) { .tr-slot { grid-template-columns: 64px minmax(0, 1fr) 10px minmax(0, 1fr); } }
.tr-sched { margin-bottom: 12px; }

/* ---------------- Đào tạo, Đợt B: kiểm tra, nhận xét, kỳ thi, báo cáo ---------------- */
.tr-warn-tag { display: inline-flex; align-items: center; gap: 3px; }
.tr-warn-tag svg, .tr-enroll-side .tag svg { width: 12px; height: 12px; }
.tr-rate-cell { display: flex; flex-direction: column; gap: 2px; }
/* Danh sách bài kiểm tra */
.tt-list { display: flex; flex-direction: column; }
.tt-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(120px, auto) auto; gap: 10px; align-items: center; padding: 8px 4px; border-top: 1px solid var(--line-2); }
.tt-row:first-child { border-top: 0; }
.tt-row.future { opacity: .8; }
.tt-date { display: flex; flex-direction: column; line-height: 1.25; }
.tt-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tt-stat { display: flex; flex-direction: column; gap: 1px; align-items: flex-end; text-align: right; }
.tt-score { display: inline-flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.tt-score .tag { margin-left: 2px; }
.tt-parts { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); }
.tt-part { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 8px; align-items: end; }
.tt-part .field { margin: 0; }
@media (max-width: 640px) {
  .tt-row { grid-template-columns: 46px minmax(0, 1fr); }
  .tt-stat { grid-column: 2; align-items: flex-start; text-align: left; }
  .tt-row .row-actions { grid-column: 2; }
}
/* Phiếu nhập điểm */
.sc-list { display: flex; flex-direction: column; margin-bottom: 12px; }
.sc-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.sc-row:first-child { border-top: 0; }
.sc-row .thumb { width: 36px; height: 48px; }
.sc-parts { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.sc-part { display: flex; flex-direction: column; gap: 1px; font-size: 12px; max-width: 110px; }
.sc-part .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-in { width: 76px; height: 38px; text-align: center; font-size: 15px; }
.sc-total { font-weight: 600; color: var(--ink-strong); padding-bottom: 9px; min-width: 44px; }
.sc-absent { font-size: 13px; white-space: nowrap; }
.sc-note { grid-column: 2 / -1; height: 32px; }
.sc-err { grid-column: 2 / -1; color: var(--danger); font-size: 12.5px; }
@media (max-width: 560px) {
  .sc-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .sc-parts { grid-column: 1 / -1; }
  .sc-absent { grid-column: 3; grid-row: 1; }
  .sc-note, .sc-err { grid-column: 1 / -1; }
  .sc-part { flex: 1 1 0; min-width: 0; max-width: none; }
  .sc-in { width: 100%; }
}
/* Học viên trong lớp */
.st-head { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 12px; }
.st-head .thumb { width: 54px; height: 72px; }
.st-head > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-scores { display: flex; flex-direction: column; }
.st-score { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line-2); }
.st-score:first-child { border-top: 0; }
.st-score-main { display: flex; flex-direction: column; min-width: 0; }
.st-cm-form { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px; }
@media (max-width: 560px) { .st-cm-form { grid-template-columns: 1fr; } }
.st-cm { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; margin-top: 8px; background: var(--surface-2); }
.st-cm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-cm-head .icon-btn { margin-left: auto; }
.st-cm-body { margin-top: 4px; white-space: pre-wrap; }
.st-att { display: flex; flex-wrap: wrap; gap: 4px; }
.st-att-day { display: inline-flex; flex-direction: column; align-items: center; min-width: 44px; padding: 3px 4px; border-radius: 6px; font-size: 11.5px; background: var(--grey-soft); color: var(--ink-2); }
.st-att-day strong { font-size: 13px; }
.st-att-day.att-present { background: var(--ok-soft); }
.st-att-day.att-present strong { color: var(--ok); }
.st-att-day.att-late { background: var(--amber-soft); }
.st-att-day.att-late strong { color: var(--amber); }
.st-att-day.att-excused { background: var(--blue-soft); }
.st-att-day.att-excused strong { color: var(--blue); }
.st-att-day.att-absent { background: var(--danger-soft, #fde8e8); }
.st-att-day.att-absent strong { color: var(--danger); }
/* Hồ sơ ứng viên: điểm, nhận xét, kỳ thi */
.tr-enroll-tests, .tr-enroll-cm { font-size: 12.5px; color: var(--ink-2); }
.tr-enroll-cm { font-style: italic; }
.tr-enroll-cm .tag { font-style: normal; }
.tr-exams { list-style: none; margin: 8px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.tr-exams li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.tr-exams li > svg { width: 14px; height: 14px; color: var(--gold); }
/* Kỳ thi */
.ex-levels { gap: 6px; }
.check.chip { border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px 3px 6px; background: var(--surface); font-size: 13px; }
.check.chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.tr-pick-side select.sm { height: 32px; width: auto; min-width: 110px; }
/* Cài đặt cảnh báo */
.tr-settings { margin-top: 14px; padding: 12px 14px; }
.tr-settings h3 { margin: 0 0 4px; font-size: 15px; }
.grid.g2.tight { gap: 8px; }
/* Báo cáo đào tạo */
.rp-tabs { margin-bottom: 10px; }
.stats.rp-stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1400px) { .stats.rp-stats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .stats.rp-stats.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stats.rp-stats.six { grid-template-columns: 1fr; } }
/* Hồ sơ dừng (10/11/2026): KPI tuyển sinh 7 ô (có đăng ký online), KPI hồ sơ 3 × 3; hàng "Hồ sơ dừng" trong bảng bước hồ sơ */
.stats.rp-stats.seven { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 1400px) { .stats.rp-stats.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .stats.rp-stats.seven { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stats.rp-stats.nine { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .stats.rp-stats.nine { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stats.rp-stats.seven, .stats.rp-stats.nine { grid-template-columns: repeat(2, minmax(0, 1fr)); } } /* điện thoại: 2 cột cho gọn */
.rp-fsep { font-size: 12px; font-weight: 600; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }
.rp-frow.stop .rp-fbar span { background: var(--danger); }
.rp-lost-stop { margin-top: 4px; color: var(--danger-ink); }
.rp-table td.rp-stop-n { color: var(--danger-ink); font-weight: 600; }
.dossier-stop strong { display: block; }
/* Lần xử lý hồ sơ (10/11/2026 chiều): các lần trước kèm kết quả, lý do; nhãn "Lần 2" ở danh sách */
.dossier-attempts { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; background: var(--surface-2); }
.dossier-attempts .da-head { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.dossier-attempts ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dossier-attempts li { padding-left: 10px; border-left: 3px solid var(--danger-line); }
.dossier-attempts li.current { border-left-color: var(--primary); }
.dossier-attempts .da-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.dossier-attempts .da-reason { font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.dossier-reopen { margin-top: 2px; }
.ds-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.attempt-chip { font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 10px; border: 1px solid var(--primary-line); color: var(--primary); white-space: nowrap; }
.timeline li.voided .body { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.timeline li.voided .body + .body { text-decoration: none; }
.rp-trend-table { margin-top: 8px; }
.rp-trend-table summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
.rp-body .table-scroll { min-height: 0; }
/* CV tiếng nước ngoài: 5 ngôn ngữ */
.cvf-langs button { height: 32px; padding: 0 10px; font-size: 13px; }
@media (max-width: 640px) {
  .cvf-langs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .cvf-langs button { justify-content: center; text-align: center; height: auto; min-height: 38px; padding: 6px 8px; line-height: 1.25; border-bottom: 1px solid var(--line-2); }
  .cvf-langs button:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------------- Kết nối AI cá nhân (01/11/2026) ---------------- */
.kn-card { margin-bottom: 14px; }
.kn-card h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0 0 6px; }
.kn-card h2 svg { width: 18px; height: 18px; color: var(--violet); }
.kn-copy { display: flex; gap: 8px; align-items: center; }
.kn-copy .input { flex: 1; min-width: 0; }
.kn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px 20px; margin: 12px 0 4px; }
.kn-steps h3, .kn-sub { font-size: 14px; margin: 0 0 6px; }
.kn-sub { margin-top: 14px; }
.kn-steps ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; line-height: 1.5; }
.kn-privacy { margin: 12px 0 0; font-size: 13px; }
.kn-privacy svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.kn-consent { max-width: 620px; }
.kn-app { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.kn-app strong { font-size: 17px; }
.kn-app-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.kn-app-icon svg { width: 22px; height: 22px; }
.kn-perms { list-style: none; padding: 0; margin: 10px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.kn-perms li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.kn-perms svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--primary); }
.kn-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.kn-actions.start { justify-content: flex-start; margin: 6px 0; }
.btn.kn-chatgpt { background: #0d0d0d; color: #fff; border-color: #0d0d0d; font-weight: 600; }
.btn.kn-chatgpt:hover { background: #2a2a2a; }
.btn.kn-grok-btn { background: #111; color: #fff; border-color: #111; font-weight: 600; letter-spacing: .01em; }
.btn.kn-grok-btn:hover { background: #333; }
.kn-device { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
.kn-steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.kn-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 28px; font-weight: 700; letter-spacing: .18em; padding: 10px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); align-self: flex-start; user-select: all; }
.kn-wait::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-right: 8px; vertical-align: middle; animation: kn-pulse 1.2s ease-in-out infinite; }
@keyframes kn-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .kn-wait::before { animation: none; } }
.kn-card .table-scroll, .ai-grid .table-scroll { min-height: 0; }
/* ChatGPT: chọn cách đăng nhập (02/11/2026), ô dán địa chỉ khi chạy local */
.kn-methods { display: flex; flex-direction: column; gap: 6px; }
.kn-methods .check { align-items: flex-start; }
.kn-methods input { margin-top: 3px; flex: none; }
.kn-paste { margin: 0; }
.kn-paste .kn-copy .input { min-width: 0; }
/* Claude Code, Grok Build: MCP riêng (02/11/2026) */
.kn-code-card .kn-steps li .kn-copy, .kn-grokb-card .kn-steps li .kn-copy { margin-top: 6px; }
.kn-code-card .kn-steps li > .btn, .kn-grokb-card .kn-steps li > .btn { margin: 4px 0; }
.kn-grokb-card > .kn-steps { margin: 4px 0 12px; }
.kn-lan { margin: 12px 0; padding-top: 12px; border-top: 1px solid var(--line, #e5e7eb); }
.kn-lan-form { max-width: 440px; margin: 6px 0; }
.kn-lan-form .field { margin-top: 8px; }
.kn-lan-result .alert { margin: 8px 0; }
.kn-lan ol > li { margin-bottom: 8px; }
.kn-reauth { margin: 14px 0 4px; max-width: 420px; }
.kn-reauth .field { margin-top: 8px; }
/* Mã API OpenAI cá nhân (03/11/2026) */
.kn-okey-card > .kn-steps { margin: 10px 0 12px; }
.kn-okey-form { max-width: 520px; }
.kn-okey-form .kn-actions { justify-content: flex-start; margin-top: 8px; }
.kn-okey-status { margin: 10px 0; }
.kn-okey-status .kn-actions { justify-content: flex-start; margin-top: 8px; }

/* Phân hệ Tài chính (04/11/2026) */
.fin-box { margin-top: 6px; }
.fin-box .section-title, .fin-sched .section-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fin-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 8px 0 10px; }
.fin-tile { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); min-width: 0; }
.fin-tile .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.fin-tile .value { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; }
.fin-tile .note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.fin-tile.warn .value { color: var(--amber); }
.fin-tile.bad .value, .fin-bad-text { color: var(--danger); }
.stat.fin-bad .value { color: var(--danger); }
.stat .value.fin-value { font-size: 22px; }
.fin-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.fin-sub { margin: 12px 0 4px; font-size: 13px; color: var(--ink-2); }
table.fin-table td.num, table.fin-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.fin-table td { vertical-align: top; }
table.fin-edit td { padding: 4px; }
table.fin-edit .input { min-width: 0; }
table.fin-edit td:nth-child(2) .input { min-width: 170px; }
table.fin-edit td:nth-child(3) .input { min-width: 120px; }
.fin-cancelled { margin-top: 6px; font-size: 13px; color: var(--muted); }
.fin-srcs { display: grid; gap: 6px; margin-bottom: 10px; }
.fin-fx { margin-top: 10px; }
.fin-fx summary { cursor: pointer; color: var(--ink-2); font-size: 13px; margin-bottom: 8px; }
.fin-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fin-inline { display: flex; gap: 6px; align-items: center; }
.fin-inline .input { max-width: 320px; }
.fin-allocs { margin: 4px 0; padding-left: 18px; }
.fin-sumline { margin: 4px 2px 8px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fin-month { margin-bottom: 14px; }
.err-text { color: var(--danger); }
.fin-sched { margin-top: 10px; }
.fin-clip svg { width: 14px; height: 14px; vertical-align: -2px; }
.fin-box table.fin-table td:first-child, .fin-sched table.fin-table td:nth-child(2) { min-width: 150px; }
.modal-foot .fin-foot-left { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; }
/* Đợt 2 tài chính */
a.stat.dash-fin { text-decoration: none; color: inherit; }
a.stat.dash-fin .value { font-size: 22px; font-variant-numeric: tabular-nums; }
/* Phân hệ Tài chính Đợt 2 (04/11/2026) */
.tabs.fin-tabs { display: flex; flex-wrap: nowrap; width: 100%; max-width: 100%; margin: 0 0 14px; background: transparent; padding: 0; border-radius: 0; gap: 0; border-bottom: 1px solid var(--line); }
.tabs.fin-tabs button { border-radius: 0; padding: 8px 12px 9px; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.tabs.fin-tabs button[aria-selected="true"] { background: transparent; box-shadow: none; color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs.fin-subtabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 0 0 12px; }
.fin-qr-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 12px 0 6px; }
.fin-qr { flex: none; width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.fin-qr svg { width: 100%; height: 100%; display: block; }
.fin-qr-wrap .kv { flex: 1 1 260px; }
.fin-bank-row { align-items: end; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.fin-bank-end { display: flex; gap: 8px; align-items: center; padding-bottom: 6px; }
.fin-caps table.fin-table .input { max-width: 150px; }
.fin-desc { max-width: 420px; overflow-wrap: anywhere; font-size: 13px; }
.fin-cap { margin: 4px 0 8px; }
/* Phân hệ Tài chính Đợt 3 (04/11/2026) */
.fin-bank-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 2fr) minmax(0, 1fr) auto; }
@media (max-width: 760px) { .fin-bank-row { grid-template-columns: 1fr; } }
.fin-url { font-size: 12.5px; overflow-wrap: anywhere; background: var(--grey-soft); padding: 4px 6px; border-radius: 5px; }
.fin-payos { margin-top: 12px; }
.fin-cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; margin: 6px 0 4px; max-height: 220px; overflow: auto; }
.fin-inv .input { min-width: 0; }
.fin-connect .fin-inline .input { max-width: none; flex: 1; }
.fin-gl table.fin-table td:first-child { width: 62%; }

/* Kết nối ngoài — khóa API, Javis OS (05/11/2026) */
.ext-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ext-steps { margin: 6px 0 10px; padding-left: 20px; line-height: 1.75; }
.ext-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--grey-soft); padding: 1px 6px; border-radius: 4px; word-break: break-all; }
.ext-pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--grey-soft); padding: 10px 12px; border-radius: var(--radius-sm); white-space: pre-wrap; word-break: break-all; margin: 6px 0; }
.ext-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.ext-acts { display: flex; gap: 4px; flex-wrap: wrap; }
.ext-chips { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.ext-ack { align-items: flex-start; line-height: 1.45; }
.ext-ack input { margin-top: 2px; flex: none; }
.ext-copy { display: flex; gap: 8px; align-items: center; }
.ext-copy .input { flex: 1; min-width: 0; }
.ext-secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
table.ext-table tr.muted td { color: var(--muted); }
.danger-text { color: var(--danger); }
@media (max-width: 640px) { .ext-copy { flex-wrap: wrap; } }
/* Kết nối ngoài Đợt B: Zalo Bot, Telegram; Kết nối chat của nhân viên */
.ext-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; }
.ext-grid > * { min-width: 0; }
.ext-bot .field { margin-bottom: 10px; }
.ext-cmds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 4px 16px; margin: 8px 0; font-size: 13.5px; }
.ext-log summary { cursor: pointer; }
.cl-panel { display: grid; gap: 12px; }
.cl-card { display: grid; gap: 8px; }
.cl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-head svg { width: 18px; height: 18px; flex: none; color: var(--primary); }
.cl-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cl-code { display: grid; gap: 8px; }
.cl-digits { font-size: 34px; font-weight: 700; letter-spacing: .28em; font-variant-numeric: tabular-nums; color: var(--primary); }
.cl-prefs { display: grid; gap: 6px; border-top: 1px solid var(--line-2); padding-top: 8px; }
.cl-prefs > .btn { justify-self: start; }
.cl-checks { display: grid; gap: 4px; }
.cl-quiet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-time { width: 72px; text-align: center; }
/* Zalo OA (Đợt C) */
.zoa-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; display: grid; gap: 8px; }
.zoa-box .appt-head .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.zoa-line { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.zoa-msgs { margin: 0; }
.zoa-msgs li.zoa-in .body { color: var(--ink); font-weight: 500; }
.zoa-reply { display: grid; gap: 6px; }
.zoa-reply .row-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.zoa-url { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.zoa-map-row { margin-bottom: 8px; }
.zoa-map-ctl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.zoa-params td { vertical-align: top; }
.zoa-skip { margin: 4px 0 0; padding-left: 18px; max-height: 200px; overflow: auto; }
@media (max-width: 640px) { .zoa-map-ctl { grid-template-columns: minmax(0, 1fr); } }

/* ---------------- Giao diện mới (05/11/2026): tinh chỉnh chung ---------------- */
.license-bar, .notice-bar { padding: 7px 26px; font-size: 13px; }
@media (max-width: 900px) { .license-bar, .notice-bar { padding: 7px 12px; font-size: 12.5px; } }
/* Hộp thoại cao trên điện thoại: không mất đầu / chân hộp thoại sau thanh công cụ của trình duyệt */
@media (max-width: 600px) {
  .overlay.center { padding: 8px; align-items: flex-start; }
  .modal { max-height: calc(100dvh - 16px); }
  .drawer-head, .modal-head { padding: 12px 14px 10px; }
  .drawer-body { padding: 14px 14px 22px; }
  .modal-body { padding: 12px 14px; }
  .drawer-foot, .modal-foot { padding: 8px 14px; }
}


/* ---------------- Cài đặt hệ thống (05/11/2026): logo, tên đơn vị, giao diện ---------------- */
.brand-logo { display: block; flex: none; width: auto; object-fit: contain; border-radius: 7px; }
.brand-logo.on-light { background: #fff; padding: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.brand .brand-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.login-cover .brand .brand-name { -webkit-line-clamp: 3; }

.settings-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.settings-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.settings-page .field { max-width: 520px; }
.settings-preview { position: sticky; top: 14px; }
.pv-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 12px 0 6px; }
.pv-sidebar { background: var(--spine); border-radius: 9px; }
.pv-sidebar .brand { padding: 14px; }
.pv-tab {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; max-width: 100%;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-2); box-shadow: inset 0 -1px 0 var(--line);
}
.pv-tab > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pv-fav { width: 16px; height: 16px; object-fit: contain; flex: none; }
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-now { display: flex; gap: 8px; flex: none; }
.logo-stage { width: 88px; height: 72px; border-radius: 9px; background: var(--spine); display: grid; place-items: center; }
.logo-stage.light { background: #f2f3f6; box-shadow: inset 0 0 0 1px #d9dde6; }
.logo-side { display: flex; flex-direction: column; gap: 8px; min-width: min(200px, 100%); flex: 1; }
.set-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
form.card .set-actions { margin-top: 14px; }
.opt-row { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.opt-row legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.opt-row .check { align-items: flex-start; }
.opt-row .check input { margin-top: 2px; flex: none; }
.name-fields { margin: 10px 0 12px 23px; display: flex; flex-direction: column; gap: 6px; }
.name-suggest { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.name-suggest .chip { height: 28px; font-size: 12.5px; padding: 0 10px; }
.muted-field { opacity: .55; }
.theme-mine { margin: 10px 0 0; }
@media (max-width: 1040px) {
  .settings-page { grid-template-columns: minmax(0, 1fr); }
  .settings-preview { position: static; }
}
@media (max-width: 640px) { .name-fields { margin-left: 0; } }

/* Chọn giao diện: thẻ có hình thu nhỏ (gáy hồ sơ + trang) */
.theme-opts { display: grid; gap: 8px; }
.theme-opts.row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.theme-opt {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer;
}
.theme-opt:hover { border-color: var(--line-strong); }
.theme-opt:has(input:checked) { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-soft); }
.theme-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-opt input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.theme-opt-text { display: flex; flex-direction: column; min-width: 0; }
.theme-opt-text span { font-size: 12.5px; color: var(--muted); }
.theme-opt:has(input:checked) .theme-opt-text span { color: var(--ink-2); }
.theme-swatch { width: 48px; height: 34px; border-radius: 6px; display: flex; overflow: hidden; flex: none; box-shadow: 0 0 0 1px var(--line); }
.theme-swatch .sw-spine { width: 12px; flex: none; }
.theme-swatch .sw-page { flex: 1; padding: 6px 5px; display: flex; flex-direction: column; gap: 4px; }
.theme-swatch .sw-page i { display: block; height: 3px; border-radius: 2px; }
.theme-swatch .sw-page i:nth-child(1) { width: 62%; }
.theme-swatch .sw-page i:nth-child(2) { width: 88%; }
.theme-swatch .sw-page i:nth-child(3) { width: 48%; }
.t-light .sw-spine { background: #1d2a4d; }
.t-light .sw-page { background: #f2f3f6; }
.t-light .sw-page i { background: #c9cede; }
.t-light .sw-page i:nth-child(1) { background: #2b47a3; }
.t-dark .sw-spine { background: #0d1222; }
.t-dark .sw-page { background: #1c2230; }
.t-dark .sw-page i { background: #3b4459; }
.t-dark .sw-page i:nth-child(1) { background: #8fa5f4; }
.t-auto .sw-spine { background: linear-gradient(135deg, #1d2a4d 50%, #0d1222 50%); }
.t-auto .sw-page { background: linear-gradient(135deg, #f2f3f6 50%, #1c2230 50%); }
.t-auto .sw-page i { background: #8a93a8; }

::selection { background: var(--selection); }

/* ---------------- Cài đặt hệ thống: màu giao diện (08/11/2026) ---------------- */
.cp-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-preset { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 500; }
.cp-preset:hover { border-color: var(--line-strong); }
.cp-preset[aria-pressed="true"] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--primary-soft); }
.cp-preset:disabled { cursor: not-allowed; opacity: .6; }
.cp-chips { display: inline-flex; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.cp-chips i { width: 9px; height: 22px; display: block; }
.cp-modes button.has-err::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); display: inline-block; }
.cp-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 18px; margin-top: 14px; align-items: start; }
.cp-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cp-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 3px 10px; align-items: center; }
.cp-label { font-weight: 600; font-size: 13px; }
.cp-inputs { display: flex; gap: 6px; align-items: center; }
.cp-swatch { width: 42px; height: var(--ctl-h); padding: 2px; border: 1px solid var(--input-line); border-radius: 6px; background: var(--surface); cursor: pointer; flex: none; }
.cp-swatch:disabled { cursor: not-allowed; }
.cp-hex.input { width: 104px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.cp-hex.bad { border-color: var(--danger); }
.cp-hint, .cp-msg { grid-column: 2; }
.cp-msg:empty { display: none; }
.cp-msg.err { color: var(--danger-ink); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.cp-suggest { gap: 6px; }
.cp-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.cp-status { margin: 12px 0 0; }
/* Khung mẫu: dùng biến màu thật (--paper, --surface, --primary…) đặt riêng trên khung */
.color-preview { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); min-height: 214px; font-size: 12px; color: var(--ink); background: var(--paper); }
.cpv-side { background: var(--spine); color: var(--spine-ink); padding: 10px 0 10px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cpv-side b { color: var(--spine-muted); font-weight: 600; font-size: 10.5px; padding: 0 6px 4px; }
.cpv-side span { padding: 5px 6px; border-radius: 6px 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpv-side span.on { background: var(--paper); color: var(--ink); font-weight: 600; }
.cpv-page { padding: 10px; min-width: 0; }
.cpv-title { font-family: var(--font-title); font-size: 14px; color: var(--ink-strong); margin-bottom: 6px; }
.cpv-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.cpv-text { font-weight: 600; }
.cpv-muted { color: var(--muted); }
.cpv-muted a { color: var(--primary); }
.cpv-row { display: flex; justify-content: space-between; gap: 6px; padding: 4px 6px; border-radius: 5px; border-top: 1px solid var(--line-2); }
.cpv-row.sel { background: var(--row-selected); border-top-color: transparent; }
.cpv-actions { display: flex; gap: 5px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.cpv-input { flex: 1 1 80px; border: 1px solid var(--input-line); border-radius: 5px; padding: 3px 6px; color: var(--placeholder); background: var(--surface); min-width: 0; }
.cpv-btn { background: var(--primary); color: var(--on-accent); border-radius: 5px; padding: 3px 10px; font-weight: 600; }
.cpv-btn2 { border: 1px solid var(--line-strong); border-radius: 5px; padding: 3px 8px; color: var(--ink); background: var(--surface); }
@media (max-width: 960px) { .cp-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .cp-row { grid-template-columns: minmax(0, 1fr); }
  .cp-hint, .cp-msg { grid-column: 1; }
}
