:root {
  --bg: #f2f3fb;
  --card: #ffffff;
  --ink: #2b3245;
  --muted: #8b93a7;
  --line: #e9ebf4;
  --primary: #6c5ce7;
  --primary-d: #5a47d6;
  --primary-soft: #eeeafe;
  --ok: #199d6b;
  --ok-bg: #e7f7ef;
  --no: #e25b6e;
  --no-bg: #fdebee;
  --warn: #cf8a1c;
  --warn-bg: #fdf3e0;
  --info: #3d7ce0;
  --info-bg: #e9f1ff;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(40, 50, 90, .05);
  --shadow: 0 1px 2px rgba(40, 50, 90, .04), 0 10px 28px rgba(50, 55, 100, .07);
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); min-height: 100vh;
  background: linear-gradient(180deg, #f5f6fd 0%, #eceefa 100%); background-attachment: fixed;
  font-family: "Segoe UI", system-ui, Roboto, Arial, sans-serif;
  font-size: 15.5px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-d); text-decoration: none; transition: color .15s; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
code { background: var(--primary-soft); color: var(--primary-d); padding: 1px 6px; border-radius: 6px; }
button, .btn, input, select, textarea, .card, .tag, .person-row, .task, .group-card, .assignee, .tnode {
  transition: background .16s, color .16s, border-color .16s, box-shadow .18s, transform .12s;
}
.icon-sprite { display: none; }
.ico { width: 17px; height: 17px; flex: 0 0 auto; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- top bar ---------- */
.topbar {
  background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.4) blur(9px);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px;
  padding: 9px 18px; position: sticky; top: 0; z-index: 30; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.logo-img { display: block; width: 42px; height: 42px; border-radius: 9px; object-fit: contain;
  box-shadow: 0 3px 8px rgba(31, 119, 196, .28); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; max-width: 260px; }
.brand-text strong { font-size: .8rem; letter-spacing: .1px; font-weight: 700;
  background: linear-gradient(90deg, #6c5ce7, #4f8cf7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text small { color: var(--muted); font-size: .68rem; }
.hamburger { display: none; background: none; border: 1px solid var(--line);
  border-radius: 10px; font-size: 1.2rem; padding: 4px 10px; cursor: pointer; }
.topbar nav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.topbar nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px;
  color: #5a6377; font-size: .9rem; font-weight: 500; }
.topbar nav a .ico { color: #a3aabb; }
.topbar nav a.active { background: var(--primary-soft); color: var(--primary-d); font-weight: 600; }
.topbar nav a.active .ico { color: var(--primary); }
.topbar nav a:hover { background: #f1f1fc; color: var(--ink); }
.topbar nav .who { color: var(--muted); padding-left: 10px; font-size: .87rem; }
.logout-form { display: inline; margin: 0; }
button.logout { background: none; border: none; color: var(--no); cursor: pointer; padding: 7px 11px;
  border-radius: 10px; font: inherit; font-weight: 500; }
button.logout:hover { background: var(--no-bg); }

/* ---------- layout ---------- */
.container { max-width: 920px; margin: 0 auto; padding: 22px 18px 72px; }
h1 { font-size: 1.45rem; margin: 0 0 4px; letter-spacing: -.2px; }
h2.sec { font-size: 1.05rem; margin: 24px 0 10px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 1rem; margin-top: 5px; background: #fcfcfe; font-family: inherit; color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); background: #fff; }
/* checkbox/radio: tách khỏi style ô nhập (không padding/border/transition) để khỏi "nháy"/lệch khi tích */
input[type=checkbox], input[type=radio] {
  width: 16px; height: 16px; flex: 0 0 auto; margin: 0; padding: 0; border: none; border-radius: 0;
  background: none; box-shadow: none; transition: none; transform: none; vertical-align: middle;
  accent-color: var(--primary); cursor: pointer;
}
input[type=checkbox]:focus, input[type=radio]:focus {
  outline: 2px solid var(--primary-soft); outline-offset: 1px; background: none; border: none;
}
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 15px; border-radius: 10px; font-size: .93rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm); }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, #7d6ef2, #6c5ce7); border-color: #6657e0; color: #fff;
  box-shadow: 0 4px 14px rgba(108, 92, 231, .32); }
.btn.primary:hover { background: linear-gradient(180deg, #6f60e8, #5d4ed8); }
.btn.ghost { background: #fff; border-style: dashed; color: var(--muted); width: 100%; box-shadow: none; }
.btn.ghost:hover { color: var(--primary-d); border-color: var(--primary); transform: none; }
.btn.small { padding: 5px 11px; font-size: .82rem; }
.date-pick input { width: auto; margin: 0; }

/* ---------- login ---------- */
.login-card { max-width: 390px; margin: 7vh auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow); text-align: center; }
.login-card h1 { margin-bottom: 0; font-size: 1.3rem; }
.login-card form { text-align: left; margin-top: 14px; }
.login-card .btn { width: 100%; justify-content: center; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 4px; }
.login-brand svg { filter: drop-shadow(0 6px 14px rgba(108, 92, 231, .42)); }
.login-logo { width: 76px; height: 76px; border-radius: 14px; object-fit: contain;
  box-shadow: 0 6px 16px rgba(31, 119, 196, .3); }
.lb-name { font-weight: 800; letter-spacing: 1.5px; font-size: 1.15rem;
  background: linear-gradient(90deg, #6c5ce7, #4f8cf7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.alert { background: var(--no-bg); color: var(--no); padding: 10px 12px; border-radius: 10px; margin: 10px 0; }

/* ---------- entry form ---------- */
.entry-form .row { display: grid; grid-template-columns: 120px 1fr 110px; gap: 12px; }
.idle-form { margin: 14px 0 8px; display: flex; flex-direction: column; gap: 6px; align-items: center; }

/* ---------- entries list ---------- */
.entries { list-style: none; padding: 0; margin: 0; }
.entries li { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.entries li.idle { background: #fbfbf3; border-style: dashed; }
.buoi { display: inline-block; background: #eaf1ff; color: var(--primary-d); font-size: .78rem;
  font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-right: 8px; }
.act { font-weight: 600; }
.hrs { color: var(--muted); margin-left: 8px; font-size: .85rem; }
.btn-x { background: none; border: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.btn-x:hover { color: var(--no); }

/* ---------- dashboard ---------- */
.summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.summary .big { font-size: 1.6rem; font-weight: 800; color: var(--primary-d); }
.bar { height: 8px; background: #eef1f7; border-radius: 6px; margin-top: 10px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--ok); border-radius: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 12px; }
.person { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.person.done { border-left: 4px solid var(--ok); }
.person.pending { border-left: 4px solid #d8dde6; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #eaf1ff; color: var(--primary-d);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; }
.person .info { flex: 1 1 auto; min-width: 0; }
.person .name { font-weight: 600; line-height: 1.3; }
.person .role { display: inline-block; font-size: .72rem; background: #efe9ff; color: #5b3fb3; padding: 1px 7px; border-radius: 6px; margin-left: 6px; white-space: nowrap; }
.person .unit { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .status { text-align: right; flex: 0 0 96px; }
.person .status .small { display: block; white-space: nowrap; margin-top: 3px; }

/* ---------- tags ---------- */
.tag { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.no { background: #f1f3f7; color: var(--muted); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.s-cho_nhan { background: var(--warn-bg); color: var(--warn); }
.tag.s-chua_giao { background: #ececf3; color: #6a5b8a; }
.tag.s-dang_lam, .tag.s-dang_mo { background: #eaf1ff; color: var(--primary-d); }
.tag.s-tu_choi { background: #fbe9e6; color: var(--no); }
.tag.s-hoan_thanh { background: var(--ok-bg); color: var(--ok); }
.tag.s-huy, .tag.s-da_roi { background: #f1f3f7; color: var(--muted); }
.tag.s-cho_nghiem_thu { background: #fff3d6; color: #9a6a00; }
.tag.s-tam_dung { background: #fdeede; color: #a15c1e; }
.notif-bell { position: relative; }
.notif-badge { position: absolute; top: -6px; right: -8px; background: var(--no); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 8px; padding: 0 4px; }

/* chọn nhiều người */
.people-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; }
.pick { font-weight: 400; display: inline-flex; align-items: center; gap: 5px; margin: 0; }
.pick input { width: auto; margin: 0; }

/* trang chi tiết việc */
.reqs { margin: 6px 0; padding: 8px 10px; background: #f7f9fc; border-left: 3px solid var(--primary); border-radius: 6px; }
.check.small { font-size: .8rem; }
.join-form { display: inline-flex; gap: 5px; align-items: center; }
.join-form select { width: auto; margin: 0; padding: 5px 8px; }
.note-card { margin-bottom: 10px; }
.my-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: flex-start; }
.assignee-list { display: flex; flex-direction: column; gap: 6px; }
.assignee { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.assignee .nm { font-weight: 600; }
.inline-x { display: inline; }
.res-list { display: flex; flex-direction: column; gap: 8px; }
.res { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.res-head { font-weight: 600; }
.ver-history { margin: 5px 0 0 14px; border-left: 2px solid var(--line); padding-left: 10px; }
.comment-form { display: flex; gap: 6px; margin-bottom: 10px; }
.comment-form input[type=text] { flex: 1 1 auto; margin-top: 0; }
.timeline { display: flex; flex-direction: column; gap: 8px; max-height: 440px; overflow-y: auto; padding-right: 4px; }
.tl-item { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.tl-item.tl-event { background: #fafbfd; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- tasks ---------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tasklist { display: flex; flex-direction: column; gap: 10px; }
.task { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.task-main { min-width: 0; }
.task-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.task-title { font-weight: 600; }
.area { display: inline-block; font-size: .74rem; font-weight: 700; background: #e9f3ef; color: #157a4f;
  padding: 1px 8px; border-radius: 6px; }
.reason { color: var(--no); margin-top: 3px; }
.task-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; flex: 0 0 auto; }
.task-actions form { display: flex; }
.task-actions .btn { width: 100%; text-align: center; }
details.decline > summary { list-style: none; cursor: pointer; text-align: center; }
details.decline > summary::-webkit-details-marker { display: none; }
.decline-form { display: flex; gap: 6px; margin-top: 6px; }
.decline-form input { margin-top: 0; min-width: 140px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row-form label { margin-bottom: 0; flex: 1 1 200px; }
.row-form .btn { flex: 0 0 auto; }

@media (max-width: 680px) {
  .row2 { grid-template-columns: 1fr; }
  .task { flex-direction: column; }
  .task-actions { flex-direction: row; width: 100%; }
}

/* ---------- dictionary table ---------- */
table.dict { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 12px; }
table.dict th, table.dict td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.dict th { background: #f7f9fc; font-size: .82rem; color: var(--muted); }
table.dict tr.proposed { background: #fffdf6; }
table.dict td form { display: inline; }

/* ---------- dictionary ---------- */
details.create { padding: 0; margin-bottom: 14px; border: none; background: none; }
details.create > summary { list-style: none; display: inline-block; }
details.create > summary::-webkit-details-marker { display: none; }
.create-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 10px; }

.dict-list { display: flex; flex-direction: column; gap: 10px; }
.dict-item { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.dict-item.proposed { background: #fffdf6; }
.di-head { margin-bottom: 6px; }
.di-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.di-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.di-actions form { display: inline; }
details.inline-edit > summary, details.add-fb > summary { list-style: none; cursor: pointer; }
details.inline-edit > summary::-webkit-details-marker, details.add-fb > summary::-webkit-details-marker { display: none; }
.edit-form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.edit-form input[type=text] { flex: 1 1 180px; margin-top: 0; }
.edit-form select { flex: 0 0 auto; width: auto; margin-top: 0; }
.edit-form input[type=number] { width: 110px; margin-top: 0; }

.fb-list { margin: 8px 0; border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.fb { font-size: .9rem; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.fb-tag { font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 5px; flex: 0 0 auto; }
.fb-tag.fb-pending { background: var(--warn-bg); color: var(--warn); }
.fb-tag.fb-approved { background: var(--ok-bg); color: var(--ok); }
.fb-tag.fb-rejected { background: #f1f3f7; color: var(--muted); }
.fb.fb-rejected .fb-body { text-decoration: line-through; color: var(--muted); }
.fb-author { flex: 0 0 auto; }
.fb-resolve { display: inline-flex; gap: 5px; }
.btn-tiny { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 5px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.btn-tiny.ok { color: var(--ok); border-color: #bfe6d2; }
.btn-tiny.no { color: var(--no); border-color: #f0c9c1; }
details.add-fb > summary { color: var(--primary); font-size: .85rem; margin-top: 4px; }
.fb-form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fb-form input[type=text] { flex: 1 1 220px; margin-top: 0; }
.fb-form input[type=number] { width: 160px; margin-top: 0; }

/* ---------- misc additions ---------- */
.okbox { background: var(--ok-bg); color: var(--ok); padding: 10px 12px; border-radius: 9px; margin: 10px 0; }
.small-link { color: var(--muted) !important; font-size: .9rem; }
.check { font-weight: 400; display: flex; align-items: center; gap: 8px; }
.check input { width: auto; margin: 0; }
.mt { margin-top: 12px; }
.table-wrap { overflow-x: auto; }

/* chips / tags */
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2f8; color: #34465f;
  font-size: .8rem; padding: 2px 8px; border-radius: 20px; margin: 2px; }
.chip.lead { background: #efe9ff; color: #5b3fb3; font-weight: 600; }
.chip-x { display: inline; margin: 0; }
.chip-x button { background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0 0 2px; opacity: .6; }
.chip-x button:hover { opacity: 1; color: var(--no); }

/* users table */
table.users { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
table.users th, table.users td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.users th { background: #f7f9fc; font-size: .8rem; color: var(--muted); }
table.users tr.inactive { opacity: .5; }
.uname { font-weight: 600; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.row-actions form { display: inline; }
.bulk-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 12px 0; }

/* group cards */
.group-list { display: flex; flex-direction: column; gap: 10px; }
.group-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.gc-head { font-weight: 600; margin-bottom: 6px; }
.gc-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 5px 0; border-top: 1px dashed var(--line); }
.gc-label { font-size: .82rem; color: var(--muted); margin-right: 4px; min-width: 70px; }
.add-inline { display: inline-flex; gap: 4px; margin: 2px; }
.add-inline select { width: auto; margin: 0; padding: 4px 8px; font-size: .85rem; }
.search-box { width: 100%; max-width: 420px; margin: 0 0 12px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 9px; font-size: .95rem; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 14px; }
.tab-btn { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  padding: 9px 14px; font-size: .95rem; font-weight: 600; color: var(--muted); cursor: pointer; border-radius: 8px 8px 0 0; }
.tab-btn:hover { background: #f0f3f9; color: var(--ink); }
.tab-btn.active { color: var(--primary-d); border-bottom-color: var(--primary); }
.tab-count { display: inline-block; font-size: .72rem; background: #eef1f7; color: var(--muted);
  border-radius: 10px; padding: 0 7px; margin-left: 2px; }
.tab-btn.active .tab-count { background: #eaf1ff; color: var(--primary-d); }
.sub-head { font-size: .98rem; margin: 14px 0 8px; color: var(--ink); }
.gc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.gc-tools { display: inline-flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.gc-tools form.chip-x { display: inline; margin: 0; }
.gc-tools form.chip-x button { background: none; border: none; cursor: pointer; font-size: .95rem; opacity: .6; }
.gc-tools form.chip-x button:hover { opacity: 1; }
.member-rows { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.member-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 0; border-top: 1px dashed var(--line); }
.member-row .nm { font-weight: 600; min-width: 130px; }
.role-form { display: inline-flex; gap: 4px; margin: 0; }
.role-form select { width: auto; margin: 0; padding: 3px 6px; font-size: .82rem; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.summary .stat { font-size: .95rem; }
.summary .stat .big { font-size: 1.3rem; }

/* progress reports */
.prog-list { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.prog { font-size: .9rem; }
.prog .tag { margin-right: 6px; }
.pstate-dang_lam { background: #eaf1ff; color: var(--primary-d); }
.pstate-kho_khan { background: #fdeee0; color: var(--warn); }
.pstate-cho { background: #f1f3f7; color: var(--muted); }
.pstate-hoan_thanh { background: var(--ok-bg); color: var(--ok); }
.att { display: inline-block; font-size: .82rem; margin-top: 3px; margin-right: 8px; }
.prog-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.prog-form input[type=text], .prog-form select { margin-top: 0; }
.prog-form .file { font-weight: 400; font-size: .85rem; }

/* ---------- bảng theo dõi nhiều ngày ---------- */
.board-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.range-form { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; }
.range-form input[type=date] { width: auto; margin: 0; padding: 6px 8px; }
.board-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.board-filters .search-box { margin: 0; max-width: 280px; }
.board-filters select { width: auto; margin: 0; }
.legend { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; }
.legend.on { background: var(--ok); } .legend.off { background: var(--no); }
.board-rows { display: flex; flex-direction: column; gap: 4px; }
.person-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; flex-wrap: wrap; }
.pr-info { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.pr-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.daystrip { display: flex; gap: 2px; flex-wrap: wrap; max-width: 480px; }
.daycell { width: 11px; height: 14px; border-radius: 2px; background: var(--no); }
.daycell.on { background: var(--ok); }
.daycount { font-weight: 700; font-size: .85rem; min-width: 48px; text-align: right; }
.daycount.good { color: var(--ok); } .daycount.mid { color: var(--warn); } .daycount.bad { color: var(--no); }

.name-link { color: var(--ink); }
.name-link:hover { color: var(--primary-d); text-decoration: underline; }
a.who { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
a.who:hover { color: var(--primary-d); }
.who-av { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* ---------- hồ sơ cá nhân ---------- */
.profile-head { display: flex; gap: 16px; align-items: center; }
.pf-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(50,55,100,.12); }
.avatar-lg { display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-d); }
.pf-meta h2 { margin: 0 0 4px; }
.pf-bio { margin: 6px 0 0; }
.pf-edit { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.research-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.research-list li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  display: flex; justify-content: space-between; gap: 10px; box-shadow: var(--shadow-sm); }
.research-list .att { margin-right: 10px; }
.ri-actions { display: flex; gap: 5px; align-items: flex-start; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.ri-actions form { display: inline; margin: 0; }
.pager { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.diary { display: flex; flex-direction: column; gap: 8px; }
.diary-day { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; box-shadow: var(--shadow-sm); }
.diary-day.has-work { background: linear-gradient(180deg, #effaf3, #e6f7ee); border-color: #cdeede; }
.diary-day.no-work { background: linear-gradient(180deg, #fdf0f2, #fce9ec); border-color: #f6d7dc; }
.dd-date { font-weight: 700; margin-bottom: 6px; }

/* ---------- banner đăng nhập thử ---------- */
.imp-banner { position: sticky; top: 56px; z-index: 25; display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap; background: linear-gradient(90deg, #fff3d6, #ffe9c7); color: #8a5a12;
  padding: 7px 14px; font-size: .88rem; font-weight: 600; border-bottom: 1px solid #f0d9ad; }
.imp-banner .logout-form { display: inline; }

/* ---------- bảng Kanban công việc ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.kcol { background: #f3f4fb; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.kcol-head { font-weight: 700; font-size: .9rem; margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
  padding: 4px 6px; border-radius: 8px; }
.kcol-cho_nhan .kcol-head { color: var(--warn); }
.kcol-dang_lam .kcol-head { color: var(--primary-d); }
.kcol-hoan_thanh .kcol-head { color: var(--ok); }
.kc-count { font-size: .72rem; background: #fff; color: var(--muted); border-radius: 10px; padding: 0 7px; box-shadow: var(--shadow-sm); }
.kcol-empty { text-align: center; padding: 14px 0; }
.kanban-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px;
  margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.kanban-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kc-title { font-weight: 600; color: var(--ink); display: block; }
.kc-title:hover { color: var(--primary-d); }
.kc-proj { margin-top: 1px; }
.kc-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 7px 0; }
.due { font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 14px; background: #eef1f7; color: var(--muted); }
.due.overdue { background: var(--no-bg); color: var(--no); }
.due.soon { background: var(--warn-bg); color: var(--warn); }
.due.done { background: var(--ok-bg); color: var(--ok); }
.kc-actions { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.kc-actions form { display: inline; margin: 0; }

/* thanh tiến độ dự án */
.pbar { height: 7px; background: #eceefa; border-radius: 6px; overflow: hidden; margin-top: 8px; max-width: 360px; }
.pfill { height: 100%; background: linear-gradient(90deg, #7b6cf6, #4f8cf7); border-radius: 6px; }
.proj-row .pct-num { font-weight: 700; color: var(--primary-d); }

@media (max-width: 680px) { .kanban { grid-template-columns: 1fr; } }

/* ---------- cây job (2 cột) ---------- */
.task-split { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.job-tree { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.tree-root, .tnode-children { list-style: none; margin: 0; padding: 0; }
.tnode-children { margin-left: 16px; border-left: 1px dashed var(--line); padding-left: 4px; }
.tnode { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 7px; }
.tnode.active { background: #eaf1ff; }
.tnode:hover { background: #f0f3f9; }
.tnode-toggle { background: none; border: none; cursor: pointer; font-size: .8rem; width: 18px; color: var(--muted); padding: 0; }
.tnode-dot { width: 18px; text-align: center; color: var(--line); }
.tnode-link { flex: 1 1 auto; color: var(--ink); font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnode.active .tnode-link { font-weight: 600; color: var(--primary-d); }
.tnode-pct { font-size: .72rem; color: var(--muted); flex: 0 0 auto; }
.job-panel { min-width: 0; }
.panel-title { font-size: 1.2rem; margin: 0 0 8px; }
.subjob-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 5px; }
.subjob-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.subjob-list li a { font-weight: 600; }

/* ---------- mobile ---------- */
@media (max-width: 680px) {
  .task-split { grid-template-columns: 1fr; }
  .job-tree { position: static; max-height: 280px; }
  .hamburger { display: block; margin-left: auto; }
  .topbar nav { display: none; flex-direction: column; align-items: stretch; width: 100%; gap: 2px; }
  .topbar nav.open { display: flex; }
  .topbar nav a, .topbar nav .who { padding: 10px 8px; }
  .entry-form .row { grid-template-columns: 1fr 1fr; }
  .entry-form .col-act { grid-column: 1 / -1; }
}

/* ---------- trang cá nhân: lời mời + lịch sử ---------- */
.badge-no { display: inline-block; min-width: 20px; text-align: center; padding: 1px 8px;
  border-radius: 20px; background: var(--no); color: #fff; font-size: .8rem; font-weight: 700; }
.task.invite { border-color: #f3c9b9; background: linear-gradient(0deg, #fffaf6, var(--card)); }
.inline-form { display: flex; }
.btn.ok { background: var(--ok-bg); border-color: #bfe6d2; color: var(--ok); font-weight: 700; }
.btn.ok:hover { background: #d7f0e3; }
.btn.no { background: var(--no); border-color: #d94f63; color: #fff; font-weight: 700; }
.btn.no:hover { background: #d2495c; }
.btn.no-out { background: #fff; border-color: #ecc1c7; color: var(--no); font-weight: 700; }
.btn.no-out:hover { background: var(--no-bg); }

.hist-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chip-tab { padding: 5px 14px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-weight: 600; font-size: .85rem; text-decoration: none; }
.chip-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.hist-custom { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.hist-custom input { width: auto; }
.hist-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.hpill { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 20px;
  background: #f1f3f7; color: var(--muted); }
.hpill.ok { background: var(--ok-bg); color: var(--ok); }
.hpill.no { background: var(--no-bg); color: var(--no); }
.hpill.warn { background: var(--warn-bg); color: var(--warn); }
table.hist { width: 100%; border-collapse: collapse; }
table.hist th, table.hist td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.hist th { font-size: .78rem; color: var(--muted); font-weight: 700; }
.nowrap { white-space: nowrap; }
.acc-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }

/* ---------- Cá nhân: intro, liên kết nhanh, tài liệu ---------- */
.intro { margin: 2px 0 14px; line-height: 1.5; }
.quicklinks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.qlink { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--card); color: var(--primary-d); font-size: .85rem;
  font-weight: 600; text-decoration: none; }
.qlink:hover { background: #f3f1ff; }
.qlink.mine { padding-right: 6px; }
.qlink.mine a { text-decoration: none; color: var(--primary-d); }
.qlink.add { cursor: pointer; color: var(--muted); border-style: dashed; }
.qlink-add { position: relative; }
.qlink-add summary { list-style: none; }
.qlink-add summary::-webkit-details-marker { display: none; }
.inline-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.inline-add input, .inline-add select { width: auto; }

.doc-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.doc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.doc-name { font-weight: 600; }

/* ---------- thông báo (dashboard) ---------- */
.note-read { display: inline-block; margin-left: 8px; }
.note-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.note { display: flex; justify-content: space-between; gap: 10px; align-items: center; text-decoration: none;
  color: var(--ink); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.note:hover { background: #f7f7fc; }
.note.unread { border-left: 4px solid var(--primary); background: #f6f4ff; font-weight: 600; }
.note-text { min-width: 0; }

/* ---------- hủy / tạm dừng việc ---------- */
.cancel-info { margin: 8px 0; padding: 8px 12px; border-radius: 8px; font-size: .88rem; line-height: 1.45; }
.cancel-info.no { background: var(--no-bg); border: 1px solid #f0c4cb; }
.cancel-info.warn { background: var(--warn-bg); border: 1px solid #f0d9a8; }

/* ---------- lọc + tương tác bảng tin ---------- */
.forum-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 14px; }
.chip-mini { padding: 4px 11px; border-radius: 20px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-size: .8rem; font-weight: 600; text-decoration: none; }
.chip-mini.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.post-actions { display: flex; gap: 8px; align-items: center; margin: 8px 0 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.react { background: none; border: none; cursor: pointer; color: var(--muted); font-weight: 600; font-size: .86rem;
  padding: 4px 8px; border-radius: 7px; }
.react:hover { background: #f2f2f8; }
.react.on { color: var(--primary-d); }
.shared-box { border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 8px; padding: 8px 12px; margin: 6px 0; background: #fafafe; }
.cmt-col { flex: 1 1 auto; min-width: 0; }
.cmt-tools { display: flex; gap: 10px; align-items: center; margin: 2px 0 4px 4px; }
.link-mini { color: var(--muted); font-size: .8rem; font-weight: 600; cursor: pointer; }
.reply-d summary { list-style: none; } .reply-d summary::-webkit-details-marker { display: none; }
.comment.reply { margin-top: 6px; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 16px 0; }

/* ---------- trao đổi & góp ý (bảng tin) ---------- */
.compose { margin: 6px 0 16px; }
.compose .card { margin-top: 8px; }
.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.post-card.announce { border-color: #f3c9b9; border-left: 4px solid #ef9a8a; background: linear-gradient(0deg, #fffaf6, var(--card)); }
.note-box { padding: 9px 12px; border: 1px dashed var(--line); border-radius: 8px; background: #fafafe; margin: 6px 0 14px; }
.post-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-meta { display: flex; flex-direction: column; line-height: 1.25; margin-right: auto; }
.post-author { font-weight: 700; }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; display: inline-flex;
  align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary-d);
  font-weight: 700; text-transform: uppercase; }
.avatar-sm.sm { width: 26px; height: 26px; font-size: .8rem; }
.post-del { margin-left: 4px; }
.post-title { font-weight: 700; font-size: 1.05rem; margin: 8px 0 2px; }
.post-body { margin: 6px 0 4px; white-space: pre-wrap; line-height: 1.5; }
.comments { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.cmt-count { margin-bottom: 8px; }
.comment { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.cmt-bubble { background: #f4f5f9; border-radius: 12px; padding: 7px 12px; flex: 1 1 auto; min-width: 0; }
.cmt-author { font-weight: 700; font-size: .9rem; }
.cmt-body { white-space: pre-wrap; line-height: 1.45; }
.comment-form { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.comment-form input[type=text] { flex: 1 1 auto; margin-top: 0; }

/* ---------- mức độ quan trọng (priority) ---------- */
.me-tabs { margin-top: 6px; }
.task.prio-3 { border-left: 4px solid #ef9a8a; }
.task.prio-1 { border-left: 4px solid #d6dbe6; }
.kanban-card.prio-3 { border-left: 4px solid #ef9a8a; }
.kanban-card.prio-1 { border-left: 4px solid #d6dbe6; }
.tag.prio-tag-3 { background: #fdece7; color: #d2603f; }
.tag.prio-tag-1 { background: #eef1f6; color: var(--muted); }

/* ---------- Chuyển quyền vai trò ---------- */
.role-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.role-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.role-act { display: flex; align-items: center; gap: 6px; }
.pending-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0;
  padding: 8px 12px; background: var(--warn-bg); border: 1px solid #f0d9a8; border-radius: 8px;
  color: var(--warn); font-size: .86rem; font-weight: 600; }
.pending-banner .inline-form { margin-left: auto; }
