@import url("/static/fonts/fonts.css");
/* Theme: AIFusionX "Automation examples" – lilac field, glass cards, black pill buttons, IBM Plex uppercase labels, purple accent. */
:root {
  --navy: #0a0a0a;
  --navy-dark: #000;
  --accent: #6904f2;
  --accent-soft: rgba(105, 4, 242, .1);
  --red: #c62828;
  --bg: #eeebf2;
  --card: rgba(255, 255, 255, .8);
  --text: #000;
  --muted: rgba(0, 0, 0, .6);
  --line: rgba(0, 0, 0, .1);
  --ok: #1d8a52;
  --warn: #e0630b;
  --err: #d0312d;
  --blue: #6904f2;
  --radius: 20px;
  --sans: "Be Vietnam Pro", "Instrument Sans", system-ui, "Segoe UI", sans-serif;
  --label: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* sidebar layout */
body.with-sidebar { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: 0 0 240px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { display: block; padding: 18px 28px 6px; }
.sidebar .logo img { width: 100%; display: block; }
.sidebar .app-name { text-align: center; font-weight: 700; color: var(--navy-dark); font-size: 13px; padding: 0 12px 14px; border-bottom: 1px solid var(--line); line-height: 1.35; }
.sidebar .app-name span { font-weight: 400; color: var(--muted); font-size: 11px; }
.sidebar nav { display: flex; flex-direction: column; padding: 10px; gap: 2px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.sidebar nav a .ic { width: 18px; text-align: center; color: var(--navy); font-size: 14px; }
.sidebar nav a:hover { background: #eef2ff; text-decoration: none; }
.sidebar nav a.active { background: var(--navy); color: #fff; }
.sidebar nav a.active .ic { color: #fff; }
.sidebar nav a .badge { margin-left: auto; }
.sidebar .nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px 12px 4px; }
.sidebar .who { padding: 12px 14px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar .who .name { font-weight: 700; color: var(--navy-dark); }
.sidebar .who .role { color: var(--muted); font-size: 12px; }
.content { flex: 1; min-width: 0; padding: 20px 24px; }
@media (max-width: 800px) {
  body.with-sidebar { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .sidebar .logo { padding: 10px 0 0; }
  .sidebar .logo img { max-width: 160px; margin: 0 auto; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
}
.badge { display: inline-block; min-width: 20px; padding: 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; text-align: center; }
.badge.red { background: var(--red); color: #fff; }
.badge.grey { background: #e5e7eb; color: #374151; }
.badge.blue { background: #e3f2fd; color: #0d47a1; }
.badge.green { background: #e8f5e9; color: #1b5e20; }
.badge.orange { background: #fff3e0; color: #e65100; }
.badge.navy { background: var(--navy); color: #fff; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; color: var(--navy-dark); }
.page-head .sub { color: var(--muted); font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 12px; color: var(--navy-dark); display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: 1fr 1fr; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .grid.c2, .grid.c3, .grid.c6 { grid-template-columns: 1fr 1fr; } }

.stat { text-align: center; padding: 14px 8px; }
.stat .n { font-size: 26px; font-weight: 700; color: var(--navy); }
.stat .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.link:hover { background: #f7f9ff; text-decoration: none; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: #fafbfd; }
tr:hover td { background: #fafbff; }
td.num, th.num { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

.btn { display: inline-block; border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: 7px 14px; border-radius: 7px; font-size: 13px; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--navy-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: #eef2ff; }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.warn { background: var(--warn); border-color: var(--warn); }
.btn.err { background: var(--err); border-color: var(--err); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

form.inline { display: inline; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=email], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd6e2; border-radius: 7px; font-size: 14px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c5d3ff; border-color: var(--navy); }
textarea { min-height: 70px; resize: vertical; max-width: 100%; }
.field { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid > * { min-width: 0; }  /* long content must not widen a column past its panel */
.form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters .field { margin: 0; min-width: 150px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: #e8f5e9; border-color: #a5d6a7; color: #1b5e20; }
.flash.err { background: #ffebee; border-color: #ef9a9a; color: #b71c1c; }

/* stage progress */
.stages { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 16px; }
.stage { border: 2px solid var(--line); border-radius: 9px; padding: 10px; background: #fff; position: relative; }
.stage .no { font-size: 11px; color: var(--muted); font-weight: 700; }
.stage .nm { font-weight: 700; font-size: 13px; margin: 2px 0 4px; color: var(--navy-dark); }
.stage .st { font-size: 12px; color: var(--muted); }
/* create-project screen: two balanced columns inside one form */
.newp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.newp-col { min-width: 0; }
.newp > .newp-col:last-child { display: flex; flex-direction: column; gap: 16px; }
.newp > .newp-col:last-child > .card { margin-bottom: 0; }
.newp-actions { display: flex; gap: 8px; margin-top: 4px; }
.newp .pp-opt, .newp .svc-opt { font-size: 14px; }
.newp .hint, .newp label .muted { font-size: 12px; }
.newp .btn { font-size: 14px; }
.client-pick { display: flex; gap: 8px; }
.client-pick select { flex: 1; min-width: 0; }
.client-pick .btn { white-space: nowrap; }
.newp-root { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.newp-root code { font-family: inherit; font-size: 14px; background: none; padding: 0; color: var(--text); }
.newp-folders { list-style: none; margin: 8px 0 8px 10px; padding: 0 0 0 14px; border-left: 1px solid #cfd6e2;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 14px; }
.newp-folders li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.newp-folders li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .newp { grid-template-columns: 1fr; } }

/* mã OTP */
.otp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.otp-card { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.otp-head { display: flex; align-items: center; gap: 10px; }
.otp-ava { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; display: grid; place-items: center; }
.otp-title { flex: 1; min-width: 0; }
.otp-title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otp-get { align-self: stretch; }
.otp-reveal { border: 1px solid #c5d3ff; background: #f7f9ff; border-radius: 10px; padding: 10px 12px; }
.otp-code { font-size: 34px; font-weight: 700; letter-spacing: 4px; color: var(--navy-dark); font-variant-numeric: tabular-nums; text-align: center; }
.otp-bar { height: 5px; border-radius: 999px; background: #e3e8f5; overflow: hidden; margin: 6px 0 8px; }
.otp-bar span { display: block; height: 100%; width: 100%; background: var(--navy); transition: width 1s linear; }
.otp-bar span.low { background: var(--err); }
.otp-actions { display: flex; gap: 6px; align-items: center; }
.otp-left { margin-left: auto; }
.otp-grants { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; }
.otp-loglink { margin-left: auto; }
.qr-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.qr-tab { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--text); }
.qr-tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.qr-drop { display: grid; place-items: center; text-align: center; min-height: 140px; border: 2px dashed #b8c4e0; border-radius: 10px; padding: 16px;
  color: var(--muted); cursor: pointer; background: #fafbff; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.qr-drop:hover, .qr-drop.over, .qr-drop:focus { border-color: var(--navy); color: var(--navy); outline: none; }
#qr-video { width: 100%; max-height: 320px; border-radius: 10px; background: #000; }
.qr-result { margin-top: 12px; border: 1px solid #a5d6a7; background: #f6fbf4; border-radius: 10px; padding: 10px 12px; }
.qr-ok { font-weight: 700; color: var(--ok); margin-bottom: 4px; }
.qr-code { font-size: 18px; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.otp-del { margin-top: 16px; max-width: 520px; }

/* địa điểm triển khai */
.loc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.loc-grid > * { min-width: 0; }
.loc-grid .full { grid-column: 1 / -1; }
.loc-grid select[disabled] { background: #f5f6f9; color: var(--muted); }
@media (max-width: 600px) { .loc-grid { grid-template-columns: 1fr; } }

/* money input: 100,000,000 VNĐ */
.money-wrap { position: relative; display: flex; align-items: center; }
.money-wrap .money-input { padding-right: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.money-wrap span { position: absolute; right: 10px; font-size: 13px; color: var(--muted); pointer-events: none; }

/* people picker (phụ trách) */
.pp-list { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; max-height: 168px; overflow-y: auto; background: #fff; }
.pp-opt { display: flex; align-items: center; gap: 8px; padding: 4px 2px; margin: 0; cursor: pointer; font-size: 14px; font-weight: 400;
  color: var(--text); text-transform: none; letter-spacing: 0; border-radius: 6px; }
.pp-opt:hover { background: #f3f6ff; }
.pp-opt input { flex: none; margin: 0; }
.pp-ava { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #e3e8f5; color: var(--navy); font-size: 11px; font-weight: 700;
  display: grid; place-items: center; }
.pp-opt input:checked + .pp-ava { background: var(--navy); color: #fff; }
.pp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-role { flex: 0 1 auto; min-width: 0; max-width: 50%; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* project tabs */
.ptabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 0 0 14px; position: sticky; top: 0; z-index: 5; background: var(--bg);
  overflow-x: auto; }
.ptab { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 16px; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.ptab:hover { color: var(--navy); background: #eef2ff; border-radius: 8px 8px 0 0; }
.ptab.on { color: var(--navy); border-bottom-color: var(--navy); }
.tabpane[hidden] { display: none; }

/* tasks: parent (stage) / children (default steps + ad-hoc items) */
.tk, .tk-kids { list-style: none; margin: 0; padding: 0; }
.tk > li { border-bottom: 1px solid var(--line); }
.tk > li:last-child { border-bottom: 0; }
.tk-parent > summary { list-style: none; }
.tk-parent > summary::-webkit-details-marker { display: none; }
.tk-prow { display: flex; align-items: center; gap: 10px; padding: 9px 4px; cursor: pointer; border-radius: 6px; }
.tk-prow:hover { background: #f7f9ff; }
.tk-parent[open] > summary .caret { transform: rotate(90deg); }
.tk-pdot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  border: 2px solid #cfd6e2; color: var(--muted); background: #fff; }
.tk-parent.is-done .tk-pdot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tk-parent.is-active .tk-pdot { background: var(--navy); border-color: var(--navy); color: #fff; }
.tk-parent.is-active.is-late .tk-pdot { background: var(--err); border-color: var(--err); }
.tk-ptitle { flex: 1; min-width: 0; font-weight: 700; color: var(--navy-dark); }
.tk-parent.is-pending .tk-ptitle { color: var(--muted); font-weight: 600; }
.tk-due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tk-due.late { color: var(--err); font-weight: 700; }
.tk-due.warn { color: var(--warn); }
.tk-count { font-size: 12px; color: var(--muted); min-width: 34px; text-align: right; }
.tk-kids { margin: 0 0 8px 20px; border-left: 2px solid #e1e6f0; }
.tk-row { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 14px; min-height: 34px; position: relative; font-size: 13.5px; }
.tk-row::before { content: ""; position: absolute; left: 0; top: 50%; width: 9px; border-top: 2px solid #e1e6f0; }
.tk-row:hover { background: #fafbff; }
.tk-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #cfd6e2; display: grid; place-items: center; font-size: 10px; color: #fff; background: #fff; }
.tk-row.is-done .tk-dot { background: var(--ok); border-color: var(--ok); }
.tk-row.is-cur .tk-dot { border-color: var(--navy); color: var(--navy); font-size: 11px; }
.tk-check { flex: none; width: 18px; height: 18px; border-radius: 4px; border: 2px solid #b8c1d1; background: #fff; cursor: pointer; padding: 0;
  color: #fff; font-size: 11px; font-weight: 700; line-height: 14px; }
.tk-check:hover { border-color: var(--ok); }
.tk-row.is-item.is-done .tk-check { background: var(--ok); border-color: var(--ok); }
.tk-name { flex: 1 1 140px; min-width: 110px; overflow-wrap: anywhere; }
.tk-row.is-cur .tk-name { font-weight: 700; color: var(--navy); }
.tk-row.is-todo .tk-name, .tk-row.is-todo .tk-who { color: #9aa3b2; }
.tk-row.is-item.is-done .tk-name { text-decoration: line-through; color: var(--muted); }
.tk-row.is-item.is-late .tk-name { color: var(--err); }
.tk-note { color: var(--muted); font-size: 12px; }
.tk-who { flex: 0 1 130px; min-width: 60px; font-size: 12px; color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-info { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); justify-content: flex-end; flex-wrap: wrap; }
.tk-act { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tk-act input[type=date], .tk-act select { width: auto; padding: 3px 6px; font-size: 12px; }
.tk-ret { color: var(--warn); font-size: 11.5px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-del { color: #b0b7c3; }
.tk-row.is-add .linkbtn { font-weight: 600; font-size: 12.5px; }
@media (max-width: 700px) { .tk-who { display: none; } }

/* file-type icons */
.ficon { position: relative; flex: none; display: inline-grid; place-items: end center; width: 26px; height: 32px; border-radius: 3px 8px 3px 3px;
  background: #fff; border: 1.5px solid var(--fc, #9aa5b8); vertical-align: middle; box-sizing: border-box; }
.ficon::before { content: ""; position: absolute; top: -1.5px; right: -1.5px; width: 9px; height: 9px; background: linear-gradient(225deg, #f3f5f9 50%, var(--fc, #9aa5b8) 50%);
  border-radius: 0 6px 0 2px; }
.ficon > span { display: block; width: calc(100% + 3px); margin: 0 -1.5px -1.5px; background: var(--fc, #9aa5b8); color: #fff; font-size: 8.5px; font-weight: 800;
  letter-spacing: .2px; text-align: center; line-height: 12px; border-radius: 0 0 3px 3px; font-family: "Segoe UI", Arial, sans-serif; }
.ft-pdf { --fc: #d93025; } .ft-doc { --fc: #2b5797; } .ft-xls { --fc: #1e7e45; } .ft-ppt { --fc: #d24726; }
.ft-cad { --fc: #7b3fb8; } .ft-img { --fc: #0f8b8d; } .ft-zip { --fc: #b7791f; } .ft-gis { --fc: #2f855a; }
.ft-vid { --fc: #c2185b; } .ft-txt { --fc: #6b7280; } .ft-other { --fc: #8a94a6; }
.ftypes-legend { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.ftypes-legend .ficon { transform: scale(.7); margin: -4px -3px; }

/* folder tree */
.fold-ico { flex: none; vertical-align: middle; }
.fold-ico .fold-back { fill: #e0a800; }
.fold-ico .fold-front { fill: #fbc02d; }
.fold-ico.is-open .fold-front { fill: #ffd54f; transform: skewX(-12deg) translate(2px, 1px); transform-origin: bottom; }
.tree-tools { display: flex; gap: 6px; margin-bottom: 10px; }
.tree-tools input { flex: 1; }
.ftree, .ftree ul { list-style: none; margin: 0; padding: 0; }
.ftree .tbranch { padding-left: 14px; }
.ftree .tbranch > li { position: relative; padding-left: 16px; }
.ftree .tbranch > li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid #cfd6e2; }
.ftree .tbranch > li:last-child::before { bottom: auto; height: 19px; }
.ftree .tbranch > li::after { content: ""; position: absolute; left: 0; top: 19px; width: 12px; border-top: 1px solid #cfd6e2; }
.trow { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; min-height: 30px; }
.trow.is-folder { font-weight: 600; cursor: pointer; }
.trow.is-folder:hover, .trow.is-file:hover { background: #f3f6ff; }
.trow.is-current .tname { color: var(--navy); }
.trow .tname { color: var(--navy-dark); word-break: break-word; }
.trow .tlabel { color: var(--muted); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.trow .tcount { font-size: 11px; font-weight: 700; background: var(--navy); color: #fff; border-radius: 999px; padding: 1px 7px; }
.trow .tcount.zero { background: #e5e7eb; color: #6b7280; }
.trow .topen { font-weight: 700; color: var(--muted); padding: 0 4px; }
.trow .topen:hover { color: var(--navy); text-decoration: none; }
details.tfolder > summary { list-style: none; }
details.tfolder > summary::-webkit-details-marker { display: none; }
.caret { width: 0; height: 0; border-left: 5px solid #8a94a6; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .15s; flex: none; }
details.tfolder[open] > summary .caret { transform: rotate(90deg); }
.fold-opened { display: none; } .fold-closed { display: inline-flex; }
details.tfolder[open] > summary .fold-opened { display: inline-flex; }
details.tfolder[open] > summary .fold-closed { display: none; }
.trow.is-file { font-weight: 400; align-items: flex-start; }
.trow.is-file.is-final { background: #f4fbf2; }
.tfile { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; padding-top: 1px; }
.tfile .tname { font-weight: 600; overflow-wrap: anywhere; }
.tmeta { font-size: 11.5px; color: var(--muted); }
.tstar { background: none; border: 0; cursor: pointer; font-size: 17px; color: #b8c1d1; padding: 0 2px; line-height: 1; }
.tstar:hover, .tstar.on { color: #f4b400; }
.froot > .trow { font-size: 14px; }

/* project members */
.member-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.member { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.member img, .member .ava { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.member .ava { display: grid; place-items: center; background: #e3e8f5; color: var(--navy); font-weight: 700; }
.member-body { flex: 1; min-width: 0; font-size: 13px; }
.member-add { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.member-add select { flex: 1; min-width: 220px; }
.member-add .hint { flex-basis: 100%; }

/* Google Drive settings */
.drive-steps { display: flex; flex-direction: column; gap: 10px; }
.drive-step { display: flex; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.drive-step.done { border-color: #a5d6a7; background: #f6fbf4; }
.drive-step.bad { border-color: #ef9a9a; background: #fff6f6; }
.drive-step .num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: #e3e8f5; color: var(--navy); }
.drive-step.done .num { background: var(--ok); color: #fff; }
.drive-step .body { flex: 1; min-width: 0; }
.drive-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.drive-row input[type=text] { flex: 1; min-width: 240px; }
.drive-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.drive-modes label { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  cursor: pointer; font-weight: 400; color: var(--text); font-size: 13px; margin: 0; }
.drive-modes label.on { border-color: var(--navy); background: #f3f6ff; }
@media (max-width: 800px) { .drive-modes { grid-template-columns: 1fr; } }
.check-table { width: auto; margin-top: 6px; }
.check-table td { padding: 3px 12px 3px 0; border: 0; }

/* stage deadline + work items */
.rm-due { font-size: 12px; margin-top: 6px; color: var(--muted); }
.rm-due.late, .rm-due.late summary { color: var(--err); font-weight: 600; }
.rm-due summary { cursor: pointer; list-style: none; color: var(--navy); }
.rm-due summary::-webkit-details-marker { display: none; }
.rm-due-form { display: flex; flex-direction: column; gap: 4px; align-items: center; margin-top: 4px; }
.rm-due-form input[type=date] { width: 132px; padding: 4px 6px; font-size: 12px; }
.items-stage { margin-bottom: 12px; }
.items-head { font-weight: 700; font-size: 13px; color: var(--navy-dark); margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: #fff; }
.item.late { border-color: #ef9a9a; background: #fff5f5; }
.item.done { background: #f6f7f9; }
.item.done .item-title { text-decoration: line-through; color: var(--muted); }
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 600; }
.item-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #b8c1d1; background: #fff; cursor: pointer; color: #fff; font-weight: 700; padding: 0; line-height: 18px; }
.item-check:hover { border-color: var(--ok); }
.item.done .item-check { background: var(--ok); border-color: var(--ok); }
dialog.item-dialog { border: 0; border-radius: 14px; padding: 20px 22px; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.item-dialog::backdrop { background: rgba(15, 25, 50, .45); }

/* users & RBAC */
.assign-card { border-color: #c5d3ff; background: #f7f9ff; }
.assign-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.assign-row .field { margin-bottom: 6px; }
.assign-row .btn { white-space: nowrap; }
.assign-row textarea { min-height: 42px; }
table.users tr.row-invited td { background: #f5f8ff; }
table.users tr.row-denied td { background: #fff5f5; }
.table-wrap { overflow-x: auto; }
.table-wrap table.users { min-width: 900px; }
.tabs-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tabs-row .tab { padding: 7px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 13px; }
.tabs-row .tab:hover { text-decoration: none; background: #eef2ff; }
.tabs-row .tab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tabs-row .tab.warn:not(.on) { border-color: #ffb74d; }
table.users td { vertical-align: middle; }
table.users tr.row-warn td { background: #fffaf0; }
table.users tr.row-off td { opacity: .6; }
.who-cell { display: flex; gap: 10px; align-items: center; }
.who-cell img, .who-cell .ava { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.who-cell .ava { display: grid; place-items: center; background: #e3e8f5; color: var(--navy); font-weight: 700; }
.rbac-form { display: flex; gap: 8px; align-items: center; }
.rbac-form select { width: auto; min-width: 170px; padding: 5px 8px; }
.row-actions { display: flex; gap: 14px; margin-top: 4px; align-items: flex-start; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--navy); font-size: 12px; cursor: pointer; font-family: inherit; }
.linkbtn:hover { text-decoration: underline; }
details.inline-edit > summary { list-style: none; }
details.inline-edit > summary::-webkit-details-marker { display: none; }

/* roadmap: each stage is a point, connected by arrows */
.roadmap-wrap { overflow-x: auto; }
.roadmap { display: flex; min-width: 760px; padding: 6px 0 2px; }
.rm-step { flex: 1 1 0; position: relative; text-align: center; padding: 0 8px; color: var(--text); }
.rm-step:hover { text-decoration: none; }
.rm-step:hover .rm-name { text-decoration: underline; }
.rm-dot { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; font-weight: 700; font-size: 16px;
  border: 3px solid #cfd6e2; background: #fff; color: var(--muted); position: relative; z-index: 1; }
.rm-conn { position: absolute; top: 20px; left: calc(50% + 28px); right: calc(-50% + 28px); height: 3px; background: #cfd6e2; border-radius: 2px; }
.rm-conn::after { content: ""; position: absolute; right: -3px; top: -6px; border-left: 11px solid #cfd6e2; border-top: 7.5px solid transparent; border-bottom: 7.5px solid transparent; }
.rm-conn.done { background: var(--ok); }
.rm-conn.done::after { border-left-color: var(--ok); }
.rm-no { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.rm-name { font-weight: 700; color: var(--navy-dark); font-size: 13px; margin: 2px 0 4px; line-height: 1.3; }
.rm-meta { font-size: 12px; color: var(--muted); line-height: 1.45; }
.rm-step.done .rm-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.rm-step.active .rm-dot { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 6px #dfe6ff; }
.rm-step.active .rm-meta b { color: var(--navy); }
.rm-step.active.late .rm-dot { background: var(--err); border-color: var(--err); box-shadow: 0 0 0 6px #ffcdd2; }
.rm-step.pending .rm-name { color: var(--muted); }
a.rm-dot:hover { text-decoration: none; filter: brightness(1.08); }
.rm-step { display: flex; flex-direction: column; }
.rm-files { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; }
.rm-files form { margin: 0; }
.rm-upload { cursor: pointer; white-space: nowrap; }
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .detail-cols { grid-template-columns: 1fr; } }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 20px; }
.info-grid label { margin-bottom: 2px; }
.info-grid .wide { grid-column: 1 / -1; }
.form-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.c4 .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .info-grid, .form-grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stages.c3 { grid-template-columns: 1fr 1fr; } }
.stage.done { border-color: #a5d6a7; background: #f1f8e9; }
.stage.active { border-color: var(--navy); background: #eef2ff; box-shadow: 0 0 0 3px #dfe6ff; }
.stage.pending { opacity: .75; }
.stage.overdue { border-color: var(--err); }

.steps { display: flex; gap: 4px; margin: 10px 0; flex-wrap: wrap; }
.step { padding: 5px 10px; border-radius: 999px; font-size: 12px; background: #eef0f4; color: var(--muted); }
.step.cur { background: var(--navy); color: #fff; font-weight: 600; }
.step.done { background: #e8f5e9; color: #1b5e20; }

.task-box { border: 1px solid #c5d3ff; background: #f7f9ff; border-radius: 9px; padding: 12px; margin-bottom: 10px; }
.task-box .t { font-weight: 700; color: var(--navy-dark); }
.task-box .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: end; }
.task-box .actions .field { margin: 0; flex: 1; min-width: 180px; }
.overdue-txt { color: var(--err); font-weight: 600; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(8, minmax(170px, 1fr)); gap: 10px; overflow-x: auto; }
.kcol { background: #e9edf5; border-radius: 9px; padding: 8px; min-height: 200px; }
.kcol h3 { font-size: 12px; text-transform: uppercase; margin: 4px 4px 8px; color: var(--navy-dark); display: flex; justify-content: space-between; }
.kcard { background: #fff; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--line); font-size: 13px; }
.kcard .c { font-weight: 700; color: var(--navy); }
.kcard .n { margin: 2px 0; }
.kcard .m { color: var(--muted); font-size: 12px; }

/* documents */
.folder { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.folder > summary { padding: 8px 12px; cursor: pointer; font-weight: 600; background: #fafbfd; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.folder > summary .k { font-family: Consolas, monospace; font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.folder table { font-size: 13px; }
.folder .empty { padding: 8px 12px; color: var(--muted); font-size: 12px; }
.tree { font-family: Consolas, monospace; font-size: 12px; white-space: pre; background: #fafbfd; padding: 10px; border-radius: 8px; border: 1px solid var(--line); overflow: auto; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0 6px 14px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy); }
.timeline .when { color: var(--muted); font-size: 12px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy) 0%, #2d55b8 100%); }
.login-box { background: #fff; padding: 28px; border-radius: 14px; width: 360px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
/* login page (ChatGPT-style) */
body.auth-page { background: #f3f5f9; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 24px; padding: 36px 40px 28px; box-shadow: 0 12px 48px rgba(20, 30, 60, .12); text-align: center; }
.auth-logo { width: 96px; display: block; margin: 0 auto 8px; }
.auth-title { font-size: 28px; font-weight: 500; margin: 4px 0 8px; color: #111; }
.auth-sub { color: #444; font-size: 15px; margin: 0 0 24px; line-height: 1.45; }
.auth-flash { text-align: left; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 56px; border: 1px solid #d9d9e3; border-radius: 999px;
  background: #fff; color: #111; font-size: 17px; font-weight: 500; text-decoration: none; transition: background .15s; }
.auth-btn:hover { background: #f4f5f7; text-decoration: none; }
.auth-or { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: #666; font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid #e3e3e8; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .auth-input { width: 100%; height: 54px; border: 1px solid #d9d9e3; border-radius: 999px; padding: 0 22px; font-size: 16px; font-family: inherit; background: #fff; }
.auth-form .auth-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px #dfe6ff; }
.auth-submit { height: 56px; border: 0; border-radius: 999px; background: #0d0d0d; color: #fff; font-size: 17px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.auth-submit:hover { background: #2b2b2b; }
.auth-foot { color: #888; font-size: 12px; margin: 20px 0 0; }
@media (max-width: 480px) { .auth-card { padding: 28px 20px 22px; border-radius: 18px; } }
.login-box .logo { display: block; width: 180px; margin: 0 auto 6px; }
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #fff; color: #1f2937; border-color: #cfd6e2; padding: 10px; font-size: 14px; }
.btn.google:hover { background: #f5f7fb; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 6px 0 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-box .sub { color: var(--muted); margin-bottom: 18px; font-size: 13px; text-align: center; }
details.box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; background: #fff; }
details.box summary { cursor: pointer; font-weight: 600; color: var(--navy-dark); }
.hint { font-size: 12px; color: var(--muted); }
.tag-role { font-size: 11px; background: #eef2ff; color: var(--navy); padding: 2px 7px; border-radius: 999px; }

/* ======================================================================== AIFusionX theme overrides */
.page-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.page-bg .ax-slab { opacity: .5; }
.page-bg .ax-slab.s1 { right: -40px; top: -180px; }
.page-bg .ax-slab.s2 { left: 58%; top: 55%; }
.page-bg .ax-slab.s3 { left: 22%; top: 70%; }
a { color: var(--text); }
a:hover { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent-soft); }

/* sidebar */
.sidebar { background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-right: 1px solid var(--line); }
.sidebar .app-name { color: var(--text); font-weight: 500; font-size: 14px; border-bottom-color: var(--line); }
.sidebar .app-name span { font-family: var(--label); letter-spacing: .3px; }
.sidebar nav { padding: 12px; gap: 3px; }
.sidebar nav a { border-radius: 999px; padding: 10px 16px; font-weight: 400; font-size: 14px; color: var(--text); }
.sidebar nav a .ic { color: var(--text); }
.sidebar nav a:hover { background: rgba(0, 0, 0, .05); color: var(--text); }
.sidebar nav a.active { background: var(--navy); color: #fff; }
.sidebar nav a.active .ic { color: #fff; }
.sidebar .nav-sep { font-family: var(--label); letter-spacing: 1px; font-size: 11px; padding: 16px 16px 6px; }
.sidebar .who { border-top-color: var(--line); }
.sidebar .who .name { color: var(--text); font-weight: 500; }
.content { padding: 28px 32px 40px; }

/* page head: big title like "See what's possible" */
.page-head { margin-bottom: 26px; align-items: flex-end; }
.page-head h1 { font-size: 40px; line-height: 1.08; font-weight: 500; letter-spacing: -.02em; color: var(--text); }
.page-head h1 .badge { vertical-align: middle; font-size: 11px; }
.page-head .sub { color: var(--text); font-size: 15px; line-height: 1.5; margin-top: 8px; max-width: 900px; }

/* glass cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px 28px; margin-bottom: 20px;
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.card h2 { font-size: 20px; line-height: 28px; font-weight: 500; color: var(--text); margin: 0 0 16px; }
.card h2 .small, .card h2 .muted { font-weight: 400; }
.grid { gap: 20px; }

/* stat tiles */
.stat { text-align: left; padding: 22px 24px; }
.stat .n { font-size: 40px; line-height: 1; font-weight: 500; letter-spacing: -.02em; color: var(--text); }
.stat .l { font-family: var(--label); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: 10px; }
.stat.link { transition: transform .2s, box-shadow .2s; }
.stat.link:hover { background: var(--card); transform: translateY(-3px); box-shadow: 0 18px 40px rgba(40, 50, 120, .12); }

/* labels, tags */
label { font-family: var(--label); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 400; margin-bottom: 6px; }
.badge { font-family: var(--label); font-weight: 400; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; padding: 4px 11px; border-radius: 20px;
  background: #fff; color: var(--text); box-shadow: 0 2px 2px rgba(0, 0, 0, .01); }
.badge.grey { background: #fff; color: var(--text); }
.badge.navy { background: var(--navy); color: #fff; }
.badge.red { background: var(--err); color: #fff; }
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge.green { background: #e3f5ea; color: #13673c; }
.badge.orange { background: #fff0e3; color: #a4480a; }
.tag-role { font-family: var(--label); font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; background: var(--accent-soft); color: var(--accent); padding: 3px 9px; }

/* pill buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; border: 1px solid var(--navy); background: var(--navy);
  color: #fff; font-family: var(--sans); font-weight: 500; font-size: 14px; padding: 11px 22px; line-height: 1.1; letter-spacing: -.01em; transition: background .2s, color .2s; }
.btn:hover { background: #262626; color: #fff; text-decoration: none; }
.btn.secondary { background: #fff; color: var(--text); border-color: var(--line); }
.btn.secondary:hover { background: #f4f2f8; color: var(--text); }
.btn.ok { background: var(--accent); border-color: var(--accent); }
.btn.ok:hover { background: #5503c7; }
.btn.warn { background: #fff; color: var(--warn); border-color: rgba(224, 99, 11, .4); }
.btn.warn:hover { background: #fff5ec; color: var(--warn); }
.btn.err { background: var(--err); border-color: var(--err); }
.btn.sm { padding: 7px 14px; font-size: 12.5px; }
.linkbtn { color: var(--accent); font-family: var(--sans); }

/* inputs */
input[type=text], input[type=password], input[type=date], input[type=number], input[type=email], select, textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; font-family: var(--sans); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

/* tables */
th, td { padding: 12px 12px; border-bottom: 1px solid var(--line); }
th { font-family: var(--label); font-size: 11px; font-weight: 400; letter-spacing: 1px; color: var(--muted); background: transparent; }
tr:hover td { background: rgba(255, 255, 255, .6); }

/* flash */
.flash { border-radius: 16px; padding: 12px 18px; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.flash.ok { background: rgba(255, 255, 255, .85); border-color: var(--line); color: var(--accent); }
.flash.err { background: rgba(255, 240, 240, .9); border-color: rgba(208, 49, 45, .25); color: #a3221f; }
.overdue-txt { color: var(--err); font-weight: 500; }
.flash.peer-ro { background: rgba(240, 233, 255, .9); border-color: rgba(105, 4, 242, .25); color: #3d0a8a; }
.pk-peer { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }

/* project tabs */
.ptabs { gap: 6px; border-bottom: 0; background: transparent; padding: 6px 0; margin-bottom: 16px; }
.ptab { border: 1px solid var(--line); border-radius: 999px; margin: 0; padding: 9px 18px; background: rgba(255, 255, 255, .7); color: var(--text); font-weight: 500; }
.ptab:hover { background: #fff; color: var(--text); border-radius: 999px; }
.ptab.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.ptab.on .badge { background: #fff; color: var(--text); }

/* roadmap */
.rm-dot { border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 500; }
.rm-conn, .rm-conn::after { background: rgba(0, 0, 0, .15); }
.rm-conn::after { background: none; border-left-color: rgba(0, 0, 0, .25); }
.rm-conn.done { background: var(--navy); }
.rm-conn.done::after { border-left-color: var(--navy); }
.rm-no { font-family: var(--label); font-weight: 400; letter-spacing: 1px; }
.rm-name { color: var(--text); font-weight: 500; font-size: 14px; }
.rm-step.done .rm-dot { background: var(--navy); border-color: var(--navy); }
.rm-step.active .rm-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.rm-step.active .rm-meta b { color: var(--accent); }
.rm-step.active.late .rm-dot { box-shadow: 0 0 0 6px rgba(208, 49, 45, .15); }
.rm-due summary { color: var(--accent); }

/* task tree */
.tk-prow:hover, .tk-row:hover { background: rgba(255, 255, 255, .7); }
.tk-pdot { border: 1px solid var(--line); font-weight: 500; }
.tk-parent.is-done .tk-pdot { background: var(--navy); border-color: var(--navy); }
.tk-parent.is-active .tk-pdot { background: var(--accent); border-color: var(--accent); }
.tk-ptitle { color: var(--text); font-weight: 500; font-size: 15px; }
.tk-kids, .tk-row::before { border-color: var(--line); }
.tk-row.is-done .tk-dot { background: var(--navy); border-color: var(--navy); }
.tk-row.is-cur .tk-dot { border-color: var(--accent); color: var(--accent); }
.tk-row.is-cur .tk-name { color: var(--accent); font-weight: 500; }
.tk-row.is-item.is-done .tk-check { background: var(--navy); border-color: var(--navy); }
.tk-count, .tk-due { font-family: var(--label); letter-spacing: .5px; }

/* kanban */
.kcol { background: rgba(255, 255, 255, .45); border: 1px solid var(--line); border-radius: 20px; padding: 12px; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.kcol h3 { font-family: var(--label); font-weight: 400; letter-spacing: 1px; color: var(--text); font-size: 11px; }
.kcard { background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; transition: transform .2s, box-shadow .2s; }
.kcard:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(40, 50, 120, .12); }
.kcard .c { font-family: var(--label); font-size: 11px; letter-spacing: 1px; color: var(--muted); font-weight: 400; }
.kcard .n { font-weight: 500; font-size: 14px; margin: 4px 0; }

/* tree / folders / timeline / misc */
.trow .tname { color: var(--text); }
.trow.is-current .tname { color: var(--accent); }
.trow .tcount { background: var(--navy); font-family: var(--label); font-weight: 400; }
.trow.is-folder:hover, .trow.is-file:hover { background: rgba(255, 255, 255, .7); }
.timeline li::before { background: var(--accent); }
.tree { background: rgba(255, 255, 255, .7); border-radius: 14px; border-color: var(--line); }
.tabs-row .tab { border-radius: 999px; padding: 8px 16px; background: rgba(255, 255, 255, .7); border-color: var(--line); }
.tabs-row .tab:hover { background: #fff; }
.tabs-row .tab.on { background: var(--navy); border-color: var(--navy); }
.member, .item, .drive-step, details.box, .folder { border-radius: 16px; border-color: var(--line); background: rgba(255, 255, 255, .7); }
.member .ava, .who-cell .ava, .drive-step .num { background: var(--accent-soft); color: var(--accent); }
.drive-step.done .num { background: var(--navy); }
.drive-modes label { text-transform: none; letter-spacing: 0; font-family: var(--sans); border-radius: 14px; }
.drive-modes label.on { border-color: var(--navy); background: #fff; }
.assign-card { border-color: rgba(105, 4, 242, .25); background: rgba(255, 255, 255, .85); }
.task-box { border-color: var(--line); background: rgba(255, 255, 255, .7); border-radius: 16px; }
.step.cur { background: var(--accent); }
.stage.active { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
dialog.item-dialog { border-radius: 24px; }
.info-grid label { margin-bottom: 4px; }
details.box summary, .items-head, .task-box .t { color: var(--text); font-weight: 500; }

/* fixes after review */
label.btn { font-family: var(--sans); font-size: 12.5px; letter-spacing: -.01em; text-transform: none; margin: 0; }
label.btn.secondary { color: var(--text); }
.sidebar { background: #fff; }
.sidebar .logo { padding: 18px 30px 8px; }
body.auth-page { background: var(--bg); }
body.auth-page .page-bg .ax-slab { opacity: .85; }
.auth-card { background: rgba(255, 255, 255, .82); border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 30px 70px rgba(40, 50, 120, .14); border-radius: 28px; }
.auth-logo { border-radius: 14px; }
.auth-title { font-weight: 500; letter-spacing: -.02em; font-size: 32px; }
.auth-sub { color: var(--text); }
.auth-or { font-family: var(--label); letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }
.auth-form .auth-input { border-color: var(--line); font-family: var(--sans); }
.auth-form .auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-btn, .auth-submit { font-family: var(--sans); font-weight: 500; }
.auth-btn { border-color: var(--line); }
.badge { white-space: nowrap; }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 13px; color: var(--text); }
input[type=search], input[type=url], input[type=tel] { width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px;
  font-family: var(--sans); background: #fff; }

/* multi-role picker (templates/_roles.html) */
.role-pick { position: relative; display: inline-block; min-width: 190px; max-width: 100%; }
.role-pick > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; padding: 9px 30px 9px 13px; background: #fff;
  font-size: 13.5px; line-height: 1.35; position: relative; }
.role-pick > summary::-webkit-details-marker { display: none; }
.role-pick > summary::after { content: ""; position: absolute; right: 12px; top: 50%; margin-top: -3px; border: 5px solid transparent; border-top-color: var(--muted); }
.role-pick[open] > summary { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.role-pick-menu { position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); min-width: 240px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 8px; box-shadow: 0 18px 40px rgba(40, 50, 120, .16); display: flex; flex-direction: column; gap: 2px; }
.role-pick-menu label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; margin: 0; cursor: pointer; }
.role-pick-menu label:hover { background: #f4f2f8; }
.rbac-form { flex-wrap: wrap; }
.role-pick-menu { position: static; margin-top: 6px; box-shadow: 0 8px 20px rgba(40, 50, 120, .10); }
.role-pick[open] { width: 100%; }

/* icon buttons with hover tooltip (roadmap actions) */
.uic { width: 18px; height: 18px; flex: none; }
.rm-actions { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 6px; }
.rm-actions form { margin: 0; }
.ibtn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; padding: 0; list-style: none; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.ibtn::-webkit-details-marker { display: none; }
.ibtn:hover { background: var(--navy); border-color: var(--navy); color: #fff; text-decoration: none; transform: translateY(-1px); }
.ibtn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.ibtn.primary:hover { background: var(--accent); border-color: var(--accent); }
.ibtn.late { border-color: rgba(208, 49, 45, .45); color: var(--err); }
.ibtn-n { position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff;
  font: 500 10.5px/18px var(--label); text-align: center; box-shadow: 0 0 0 2px #fff; }
.ibtn .uic + .uic { display: none; }
.ibtn.busy { pointer-events: none; }
.ibtn.busy .uic:first-of-type { display: none; }
.ibtn.busy .uic + .uic { display: block; animation: ibtn-spin .8s linear infinite; }
@keyframes ibtn-spin { to { transform: rotate(360deg); } }
[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px); z-index: 20;
  background: var(--navy); color: #fff; font: 400 12px/1.35 var(--sans); letter-spacing: 0; text-transform: none; white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; pointer-events: none; opacity: 0; transition: opacity .15s, transform .15s; }
[data-tip]:hover::after, [data-tip]:focus-visible::after, .ibtn.busy::after { opacity: 1; transform: translate(-50%, 0); }
.ibtn-pop { position: relative; display: inline-block; }
.ibtn-pop[open] > summary { background: var(--navy); border-color: var(--navy); color: #fff; }
.ibtn-pop[open] > summary::after { opacity: 0; }
.ibtn-pop .rm-due-form { position: absolute; z-index: 25; bottom: calc(100% + 8px); right: 50%; transform: translateX(50%); background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 10px; box-shadow: 0 18px 40px rgba(40, 50, 120, .16); width: 170px; }
.rm-due { font-family: var(--label); font-size: 11px; letter-spacing: .5px; }
.roadmap-wrap { padding-top: 34px; margin-top: -34px; padding-bottom: 150px; margin-bottom: -150px; pointer-events: none; }
.roadmap-wrap > .roadmap { pointer-events: auto; }
.rm-actions { gap: 5px; }
.rm-actions .ibtn { width: 34px; height: 34px; }
.rm-actions .uic { width: 17px; height: 17px; }
.rm-step:first-child [data-tip]::after { left: 0; transform: translate(0, 4px); }
.rm-step:first-child [data-tip]:hover::after, .rm-step:first-child .ibtn.busy::after { transform: translate(0, 0); }
.rm-step:last-child [data-tip]::after { left: auto; right: 0; transform: translate(0, 4px); }
.rm-step:last-child [data-tip]:hover::after, .rm-step:last-child .ibtn.busy::after { transform: translate(0, 0); }

/* upload requirement of a workflow step */
.tk-row.tk-req { flex-wrap: wrap; gap: 6px; font-size: 12.5px; padding: 2px 8px 8px 46px; min-height: 0; }
.tk-row.tk-req::before { display: none; }
.tk-row.tk-req:hover { background: none; }
.tk-req-l { color: var(--muted); }
.tk-row.tk-req.is-cur .tk-req-l { color: var(--text); font-weight: 500; }
.tk-dv { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 4px 3px 10px; border: 1px solid var(--line); background: #fff; }
.tk-dv.ok { color: #13673c; border-color: rgba(19, 103, 60, .3); background: #effaf3; }
.tk-dv.miss { color: var(--err); border-color: rgba(208, 49, 45, .3); background: #fff5f5; }
.tk-dv form { margin: 0; }
label.tk-up { display: inline-block; margin: 0; cursor: pointer; font-family: var(--sans); font-size: 11.5px; font-weight: 500; text-transform: none;
  letter-spacing: 0; color: #fff; background: var(--navy); border-radius: 999px; padding: 4px 10px; line-height: 1.2; }
label.tk-up:hover { background: var(--accent); }
label.tk-up.busy { opacity: .6; pointer-events: none; }
.tk-dv:not(:has(form)) { padding-right: 10px; }
.tk-act button[disabled] { opacity: .45; cursor: not-allowed; }

/* roadmap with parallel stages: one column per level, stages of a level stacked */
.rm-col { flex: 1 1 0; position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rm-col > .rm-step { flex: 0 0 auto; }
.rm-col > .rm-conn { top: 20px; left: calc(50% + 28px); right: calc(-50% + 28px); }
.rm-col.multi { border: 1px dashed rgba(105, 4, 242, .35); border-radius: 18px; padding: 22px 0 10px; margin: -22px 4px 0; background: rgba(105, 4, 242, .03); }
.rm-col.multi > .rm-conn { top: 42px; }
.rm-par { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font: 500 10.5px/1 var(--label); letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); white-space: nowrap; }
.roadmap.par { padding-top: 26px; }
.rm-col:first-child [data-tip]::after { left: 0; transform: translate(0, 4px); }
.rm-col:first-child [data-tip]:hover::after, .rm-col:first-child .ibtn.busy::after { transform: translate(0, 0); }
.rm-col:last-child [data-tip]::after { left: auto; right: 0; transform: translate(0, 4px); }
.rm-col:last-child [data-tip]:hover::after, .rm-col:last-child .ibtn.busy::after { transform: translate(0, 0); }
.rm-col:not(:first-child):not(:last-child) .rm-step [data-tip]::after { left: 50%; right: auto; transform: translate(-50%, 4px); }
.rm-col:not(:first-child):not(:last-child) .rm-step [data-tip]:hover::after { transform: translate(-50%, 0); }

/* conditional branches */
.tk-br { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #fff4e5; color: #a4480a; margin-left: 4px; font-weight: 400; }
.tk-br.on { background: #fff4e5; font-weight: 500; }
.tk-row.is-skip .tk-name, .tk-row.is-skip .tk-who { color: #b0b6c3; text-decoration: line-through; }
.tk-parent.is-skipped > summary { opacity: .55; }
.rm-step.skipped .rm-dot { background: #f1f1f4; color: var(--muted); border-style: dashed; }
.rm-step.skipped .rm-name { color: var(--muted); text-decoration: line-through; }

/* a task run once per branch of a decision "theo loại hồ sơ" */
.tk-set { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #e9f0ff; color: #23408e; margin-left: 4px; font-weight: 500; }
/* project page: apply the latest version of the workflow template */
.wf-refresh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 10px; border-radius: 12px; background: #fff4e5; color: #a4480a; }
/* review / approve: the files handed in by the tasks before */
.tk-rv { display: block !important; background: #f6f2ff; border-radius: 12px; margin: 2px 0 6px 28px; padding: 10px 14px; }
.tk-rv[hidden] { display: none !important; }
.tk-rv-h { font-size: 13px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.tk-rv-f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px 0; border-top: 1px solid rgba(105, 4, 242, .1); font-size: 13.5px; }
.tk-rv-f svg { width: 18px; height: 18px; flex: none; }
.tk-rv-f a { font-weight: 500; }
.tk-rv-f .tmeta { flex-basis: 100%; margin-left: 24px; font-size: 12px; color: var(--muted, #777); }
.tk-rv-btn { margin-right: 6px; }
/* Xem trước file (static/preview.js) */
.pv-dlg { width: min(1200px, 96vw); height: 92vh; max-height: 92vh; padding: 0; border: 0; border-radius: 18px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.pv-dlg[open] { display: flex; flex-direction: column; }
.pv-dlg::backdrop { background: rgba(20, 16, 40, .55); }
.pv-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.pv-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-x { border: 0; background: #f1eef7; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; }
.pv-x:hover { background: #1d1b26; color: #fff; }
.pv-body { position: relative; flex: 1; background: #f4f2f8; }
.pv-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.pv-wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted, #777); }
@media (max-width: 640px) { .pv-dlg { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; } .pv-new { display: none; } }
/* task list: the tasks of one service grouped under its heading; skipped tasks folded at the end */
.tk-grp { margin-top: 8px; gap: 8px; background: #eef2ff; border-radius: 10px; color: #23408e; font-size: 13.5px; }
.tk-grp.all-done { background: #ecf7ef; color: #1e6b3a; }
.tk-grp-i { width: 20px; text-align: center; }
.tk-grp-t { font-size: 12px; color: var(--muted, #777); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.tk-grp .tk-count { margin-left: auto; font-size: 12px; }
.tk-row.in-grp { margin-left: 22px; border-left: 2px solid #d5ddf5; }
.tk-rv.in-grp, .tk-req.in-grp { margin-left: 22px; }
ul:not(.show-skip) > .skip-tail { display: none !important; }
.tk-skiph { margin-top: 6px; }
.tk-skiph .linkbtn { color: var(--muted, #777); font-size: 12.5px; }
.show-skip .tk-skip-arrow { display: inline-block; transform: rotate(180deg); }

/* ===== Task list as aligned columns: Việc | Người thực hiện | Hạn | Trạng thái (phương án B, 07/10/2026) ===== */
.tk-row.tk-grid { display: grid; grid-template-columns: 22px minmax(0, 1fr) 168px 124px 236px; column-gap: 12px; align-items: center; }
.tk-row.tk-grid[hidden] { display: none !important; }
.tk-colh { min-height: 0; padding-top: 6px; padding-bottom: 4px; font-size: 11px; color: var(--muted); font-family: var(--label, inherit);
  letter-spacing: .5px; text-transform: uppercase; border-bottom: 1px solid var(--line, #e5e7eb); }
.tk-colh::before { display: none; }
.tk-colh:hover { background: none; }
.tk-colh > span:last-child { text-align: right; }
.tk-grid .tk-name { min-width: 0; }
.tk-row.is-todo .tk-name { color: #8a93a6; font-weight: 400; }
.tk-row.is-done .tk-name { color: #4b5563; }
.tk-note { color: #a0a7b5; font-size: 11px; cursor: help; }
.tk-c-who, .tk-c-due { min-width: 0; font-size: 12.5px; color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row.is-todo .tk-c-who, .tk-row.is-todo .tk-c-due { color: #9aa3b2; }
.tk-c-st { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; min-width: 0; font-size: 12px; color: var(--muted); }
.tk-c-st .tk-act { justify-content: flex-end; }
.tk-ok { color: #3f8f5b; white-space: nowrap; }
.tk-cell-f { margin: 0; min-width: 0; }
.tk-row .tk-cell, .kb-card .tk-cell { width: 100%; min-width: 0; height: 30px; padding: 3px 6px; font-size: 12.5px; color: inherit; background: transparent; border: 1px solid transparent;
  border-radius: 8px; cursor: pointer; box-shadow: none; }
.tk-row .tk-cell:hover, .tk-row .tk-cell:focus, .kb-card .tk-cell:hover, .kb-card .tk-cell:focus { border-color: #d6dbe6; background: #fff; }
.tk-row select.tk-cell, .kb-card select.tk-cell { text-overflow: ellipsis; }
.tk-row input.tk-cell[type=date][value=""]:not(:focus):not(:hover), .kb-card input.tk-cell[type=date][value=""]:not(:focus):not(:hover) { color: #c3c8d2; }
.tk-row input.tk-cell.late, .kb-card input.tk-cell.late { color: var(--err); font-weight: 600; }
.tk-retbtn { color: var(--warn, #c2410c); font-size: 12px; }
.tk-grp { display: flex; align-items: center; gap: 10px; }
.tk-grp-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tk-prog { flex: 0 0 90px; height: 4px; border-radius: 2px; background: rgba(35, 64, 142, .12); overflow: hidden; margin-left: auto; }
.tk-prog > i { display: block; height: 100%; background: currentColor; }
.tk-grp .tk-count { margin-left: 0; }
.tk-svc { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #fff4e5; color: #a4480a; white-space: nowrap; cursor: help; }
.tk-row.in-grp { margin-left: 12px; }
.tk-rv.in-grp, .tk-req.in-grp { margin-left: 12px; }
@media (max-width: 860px) {
  .tk-row.tk-grid { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 150px) 112px; grid-template-areas: "d n w u" ". s s s"; row-gap: 4px; }
  .tk-grid > .tk-dot, .tk-grid > form.inline { grid-area: d; } .tk-grid > .tk-name { grid-area: n; }
  .tk-grid > .tk-c-who { grid-area: w; } .tk-grid > .tk-c-due { grid-area: u; } .tk-grid > .tk-c-st { grid-area: s; justify-content: flex-start; }
  .tk-colh { display: none !important; }
}
@media (max-width: 560px) {
  .tk-row.tk-grid { grid-template-columns: 22px minmax(0, 1fr) 112px; grid-template-areas: "d n n" ". w u" ". s s"; }
}

/* ===== Công việc = Kanban theo giai đoạn (Tiến độ gộp vào; 07/10/2026) ===== */
.kb-sub { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.kb-scroll { overflow-x: auto; overflow-y: visible; scrollbar-width: none; cursor: grab; }  /* own bar hidden: see .kb-hscroll */
.kb-scroll::-webkit-scrollbar { display: none; }
.kb-scroll.dragging { cursor: grabbing; user-select: none; }
.kb-scroll .kb-card, .kb-scroll .kb-h { cursor: auto; }
.kb-hscroll { position: sticky; bottom: 0; z-index: 15; height: 16px; overflow-x: auto; overflow-y: hidden; margin-top: 6px;
  background: rgba(255, 255, 255, .9); border-radius: 8px; }
.kb-hscroll[hidden] { display: none; }
.kb-hscroll > div { height: 1px; }
.kb { display: flex; gap: 12px; align-items: flex-start; width: max-content; min-width: 100%; padding: 2px 2px 4px; }
.kb-col { flex: 0 0 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 16px;
  background: #f5f6fa; border: 1px solid #eceef4; }
.kb-col.is-active { background: #f6f2ff; border-color: #d9c9fb; }
.kb-col.is-late { border-color: #f3b4b4; }
.kb-col.is-done, .kb-col.is-skipped { flex-basis: 240px; }
.kb-col.is-skipped { opacity: .6; }
.kb-h { display: flex; flex-direction: column; gap: 4px; padding: 2px 2px 6px; border-bottom: 1px solid #e6e8ef; }
.kb-h1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kb-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: #fff; border: 2px solid #c9cfdb; color: #6b7280; }
.kb-col.is-active .kb-dot { background: var(--accent, #6904F2); border-color: var(--accent, #6904F2); color: #fff; }
.kb-col.is-done .kb-dot { background: var(--navy, #1f2a5a); border-color: var(--navy, #1f2a5a); color: #fff; }
.kb-col.is-active.is-late .kb-dot { background: var(--err); border-color: var(--err); }
.kb-name { font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-par { color: #a0a7b5; font-size: 12px; cursor: help; }
.kb-count { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--label, inherit); }
.kb-h2 { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.kb-warn { color: var(--warn, #c2410c); }
.kb-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-start; margin-top: 2px; }
.kb-sdue { font-size: 12px; color: #4b5563; margin-right: auto; }
.kb-sdue.late { color: var(--err); font-weight: 600; }
.kb-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kb-card { background: #fff; border: 1px solid #e3e7f0; border-radius: 12px; padding: 9px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kb-card.is-cur { border-left: 3px solid var(--accent, #6904F2); }
.kb-card.is-cur.is-late { border-left-color: var(--err); }
.kb-card.is-mine { box-shadow: 0 0 0 1px rgba(105, 4, 242, .25); }
.kb-card.is-todo { background: transparent; border-style: dashed; }
.kb-card.is-todo .kb-tn { color: #7d8597; font-weight: 400; }
.kb-t { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.kb-tn { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.kb-dotsm { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: #c9cfdb; }
.kb-card.is-cur .kb-dotsm { background: var(--accent, #6904F2); }
.kb-card.is-cur.is-late .kb-dotsm { background: var(--err); }
.kb-m { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: #4b5563; }
.kb-m .kb-who { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-m .kb-duef { flex: 0 0 122px; }
.kb-due { flex: none; white-space: nowrap; }
.kb-due.late { color: var(--err); font-weight: 600; }
.kb-kind { font-size: 11px; color: #a0a7b5; margin-left: auto; }
.kb-s { font-size: 11.5px; color: #9aa3b2; }
.kb-req { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; }
.kb-a:empty { display: none; }
.kb-a .tk-act, .kb-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-start; }
.kb-card .tk-rv { margin: 0; padding: 8px 10px; font-size: 12px; }
.kb-card .tk-rv-btn { font-size: 11.5px; padding: 3px 8px; }
.kb-empty { font-size: 12.5px; color: #9aa3b2; text-align: center; padding: 10px 0; }
.kb-done { font-size: 12.5px; }
.kb-done > summary { cursor: pointer; color: #3f8f5b; font-weight: 600; list-style: none; padding: 4px 2px; }
.kb-done > summary::-webkit-details-marker { display: none; }
.kb-done ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.kb-done li { display: flex; align-items: center; gap: 6px; min-width: 0; color: #4b5563; }
.kb-ck { color: #3f8f5b; flex: none; width: 18px; text-align: center; }
.kb-dn { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-dd { flex: none; color: #9aa3b2; font-size: 11.5px; }
.tk-check.on { background: var(--navy, #1f2a5a); border-color: var(--navy, #1f2a5a); }
.kb-skip { font-size: 11.5px; color: #a0a7b5; }
.kb-add { align-self: flex-start; font-size: 12.5px; font-weight: 600; }
.kb-card .tk-row, .kb-card .tk-cell-f { min-width: 0; }
@media (max-width: 700px) { .kb-col, .kb-col.is-done, .kb-col.is-skipped { flex-basis: 84vw; } }

/* Kanban con theo dịch vụ: a stage running one set per service holds one sub-column per service */
.kb-col.has-subs { flex: 0 0 auto; max-width: none; }
.kb-subs { display: flex; gap: 8px; align-items: flex-start; }
.kb-subcol { flex: 0 0 256px; min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 8px; border-radius: 12px;
  background: rgba(255, 255, 255, .55); border: 1px solid #e6e0f7; }
.kb-subcol.is-common { background: transparent; border-style: dashed; border-color: #d9dce6; }
.kb-subcol.all-done { opacity: .75; }
.kb-subh { display: flex; align-items: flex-start; gap: 6px; padding: 0 2px 5px; border-bottom: 1px solid #ece8f8; cursor: default; }
.kb-subn { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 600; color: #23408e; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kb-subcol.is-common .kb-subn { color: #6b7280; }
.kb-subcol .kb-card { padding: 8px 9px; }
@media (max-width: 700px) { .kb-subcol { flex-basis: 78vw; } }
.kb-duepop { display: inline-block; position: relative; }
.kb-duepop > summary { list-style: none; cursor: pointer; }
.kb-duepop > summary::-webkit-details-marker { display: none; }
.kb-duepop > summary:hover { color: var(--accent, #6904F2); text-decoration: underline; }
.kb-duepop[open] .rm-due-form { position: absolute; z-index: 20; top: 100%; left: 0; margin-top: 4px; display: flex; gap: 6px; align-items: center;
  background: #fff; border: 1px solid #e3e7f0; border-radius: 12px; padding: 8px; box-shadow: 0 8px 24px rgba(20, 20, 60, .12); white-space: nowrap; }
.kb-h2 .kb-sdue { font-size: 12px; color: #4b5563; margin: 0; }

/* Trợ lý AI: chat + the flow of the agent (question -> thinking -> MCP tools -> answer) */
.ai-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ai-agent-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .6); }
.ai-agent-dot { width: 10px; height: 10px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 4px rgba(34, 160, 107, .15); }
.ai-log { height: min(62vh, 640px); overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 22px; }
.ai-empty { margin: auto; text-align: center; color: var(--muted, #777); }
.ai-empty-ic { font-size: 34px; }
.ai-sugs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 640px; }
.ai-sug { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer; font: inherit; font-size: 13.5px; }
.ai-sug:hover { border-color: var(--accent, #6904F2); color: var(--accent, #6904F2); }
.ai-turn { display: flex; flex-direction: column; gap: 10px; }
.ai-q { align-self: flex-end; max-width: 78%; background: #1d1b26; color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; }
.ai-who { display: block; font-size: 11px; opacity: .7; margin-bottom: 2px; }
.ai-flow { position: relative; margin-left: 10px; padding-left: 18px; border-left: 2px dashed rgba(105, 4, 242, .3); display: flex; flex-direction: column; gap: 6px; }
.ai-node { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; padding: 6px 12px; border-radius: 12px;
  background: #f4f1fb; border: 1px solid rgba(105, 4, 242, .12); width: fit-content; max-width: 100%; }
.ai-node .ai-dot { position: absolute; left: -26px; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--accent, #6904F2); }
.ai-node.agent .ai-dot { background: var(--accent, #6904F2); }
.ai-node.tool { background: #fff7ec; border-color: rgba(224, 99, 11, .25); }
.ai-node.tool .ai-dot { border-color: #e0630b; }
.ai-node.tool.ok .ai-dot { background: #22a06b; border-color: #22a06b; }
.ai-node.tool.bad .ai-dot { background: #c62828; border-color: #c62828; }
.ai-node.done { background: #ecf7ef; border-color: rgba(34, 160, 107, .3); }
.ai-node.done .ai-dot { background: #22a06b; border-color: #22a06b; }
.ai-node.think { background: #f6f6f8; color: #555; }
.ai-node.think details { max-width: 640px; }
.ai-node.think summary { cursor: pointer; }
.ai-think { white-space: pre-wrap; font-size: 12.5px; color: #666; margin-top: 6px; max-height: 220px; overflow: auto; }
.ai-nt { font-weight: 600; }
.ai-node code, .ai-args code { font-size: 12px; background: rgba(0, 0, 0, .05); padding: 1px 6px; border-radius: 6px; }
.ai-res { color: #555; font-size: 12.5px; }
.ai-node.bad .ai-res { color: #c62828; }
.ai-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(105, 4, 242, .25); border-top-color: var(--accent, #6904F2); animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-a { max-width: 92%; line-height: 1.6; }
.ai-a:empty { display: none; }
.ai-a p { margin: 0 0 8px; }
.ai-a ul, .ai-a ol { margin: 0 0 8px; padding-left: 22px; }
.ai-a li.sub { margin-left: 18px; }
.ai-a h3, .ai-a h4, .ai-a h5 { margin: 10px 0 6px; }
.ai-a pre { background: #f4f2f8; padding: 10px 12px; border-radius: 10px; overflow: auto; }
.ai-tbl { overflow-x: auto; margin: 0 0 10px; }
.ai-tbl table { border-collapse: collapse; font-size: 13px; }
.ai-tbl th, .ai-tbl td { border: 1px solid var(--line); padding: 5px 10px; text-align: left; vertical-align: top; }
.ai-tbl th { background: #f4f2f8; }
.ai-form { display: flex; gap: 10px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .7); }
.ai-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 180px; border-radius: 14px; padding: 10px 14px; font: inherit; }
.ai-mcp-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.ai-token-new { display: flex; gap: 8px; }
.ai-token-new input { flex: 1; }
.ai-token-show { margin-top: 12px; padding: 12px; border-radius: 12px; background: #fff7ec; border: 1px solid rgba(224, 99, 11, .25); }
.ai-token-show input { width: 100%; font-family: monospace; }
.ai-snip { white-space: pre-wrap; word-break: break-all; background: #1d1b26; color: #e8e6f0; padding: 10px 12px; border-radius: 10px; font-size: 12px; margin: 0; }
.ai-tools { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
@media (max-width: 860px) { .ai-mcp-grid { grid-template-columns: 1fr; } .ai-q { max-width: 92%; } }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .form-grid.c3 { grid-template-columns: 1fr; } }

/* floating ✨ Trợ lý AI (every page) + the chat in embed mode */
.ai-fab { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  font-size: 24px; color: #fff; background: linear-gradient(135deg, #6904F2, #3b82f6); box-shadow: 0 10px 28px rgba(105, 4, 242, .4); transition: transform .15s; }
.ai-fab:hover { transform: scale(1.07); }
.ai-fab.on { transform: rotate(-12deg) scale(.95); }
.ai-pop { position: fixed; right: 22px; bottom: 90px; z-index: 91; width: min(440px, calc(100vw - 32px)); height: min(680px, calc(100vh - 120px));
  border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 24px 60px rgba(20, 16, 40, .35); border: 1px solid var(--line); }
.ai-pop[hidden] { display: none; }
.ai-pop iframe { width: 100%; height: 100%; border: 0; display: block; }
.ai-pop-x { position: absolute; top: 9px; right: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #f1eef7; cursor: pointer; }
.ai-pop-x:hover { background: #1d1b26; color: #fff; }
body.embed { margin: 0; background: #fff; }
body.embed .ai-card { border-radius: 0; margin: 0; border: 0; box-shadow: none; height: 100vh; }
body.embed .ai-log { height: auto; flex: 1; min-height: 0; padding: 14px; }
body.embed .ai-agent-bar { padding: 10px 50px 10px 14px; flex-wrap: wrap; row-gap: 2px; }
body.embed .ai-agent-bar .muted { font-size: 11px; }
body.embed .ai-q { max-width: 90%; }
body.embed .ai-a { max-width: 100%; }
@media (max-width: 640px) { .ai-pop { right: 8px; left: 8px; width: auto; bottom: 84px; height: calc(100vh - 100px); } .ai-fab { right: 14px; bottom: 14px; } }
.ai-tok { display: inline-flex; gap: 10px; font-size: 12.5px; color: #3d6b4f; }
.ai-tok b { font-weight: 600; }

/* several people on one task, with their share */
.kb-ppl { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 2px; }
.kb-pp { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: #f1eef7; color: #3a3550; white-space: nowrap; }
.kb-pp b { font-weight: 600; color: var(--accent, #6904F2); }
.kb-pp.lead { background: #e9e0fb; }
.kb-pbtn { border: 1px dashed rgba(105, 4, 242, .45); background: #fff; color: var(--accent, #6904F2); border-radius: 999px; padding: 1px 10px; font-size: 12px; line-height: 20px; cursor: pointer; font-weight: 500; }
.kb-pbtn:hover { border-color: var(--accent, #6904F2); }
.ppl-dlg { width: min(520px, 94vw); border: 0; border-radius: 18px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.ppl-dlg::backdrop { background: rgba(20, 16, 40, .45); }
.ppl-head, .ppl-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 28px 64px; gap: 8px; align-items: center; }
.ppl-row { margin-bottom: 6px; }
.ppl-row select { min-width: 0; }
.ppl-pct { display: flex; align-items: center; gap: 4px; }
.ppl-pct input { width: 64px; text-align: right; }
.ppl-role { font-size: 12px; color: var(--muted, #777); }
.ppl-row:first-child .ppl-role { color: var(--accent, #6904F2); font-weight: 600; }
.ppl-tools { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.ppl-total { margin-left: auto; font-weight: 600; color: #1e6b3a; }
.ppl-total.bad { color: #c62828; }
.ppl-acts { display: flex; gap: 8px; margin-top: 16px; }

/* Thời gian làm việc */
.tl-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; align-items: end; }
.tl-go { display: flex; gap: 8px; }
.tl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tl-kpi { background: rgba(255, 255, 255, .8); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.tl-kpi span { font-size: 12px; color: var(--muted, #777); }
.tl-kpi b { font-size: 22px; }
.tl-kpi small { font-size: 12px; color: var(--muted, #777); }
.tl-wrap { overflow-x: auto; }
.tl-table td { vertical-align: top; }
.tl-table tr.is-open td { background: #fffaf2; }
.tl-pp { display: inline-block; font-size: 12px; padding: 1px 8px; margin: 0 4px 3px 0; border-radius: 999px; background: #f1eef7; white-space: nowrap; }
.tl-pp b { color: var(--accent, #6904F2); font-weight: 600; }
.tl-h { min-width: 170px; white-space: nowrap; }
.tl-bar { display: inline-block; width: 70px; height: 8px; border-radius: 99px; background: #eee9f7; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.tl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #6904F2, #3b82f6); border-radius: 99px; }

/* Thời gian làm việc: charts (single series = blue slot 1; faster / slower = blue / red, validated) */
.ch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .ch-grid { grid-template-columns: 1fr; } }
.ch-card h2 { margin-bottom: 2px; }
.ch-sub { margin: 0 0 14px; font-size: 12.5px; color: #52514e; }
.ch-hbar, .ch-div { display: flex; flex-direction: column; gap: 2px; }
.ch-row { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 4px 6px; border-radius: 8px; outline: none; }
.ch-row:hover, .ch-row:focus-visible { background: rgba(42, 120, 214, .07); }
.ch-lab { font-size: 13px; color: #0b0b0b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-val { font-size: 12.5px; color: #0b0b0b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-val small { color: #898781; }
.ch-track { height: 14px; display: block; }
.ch-track i { display: block; height: 100%; min-width: 2px; background: #2a78d6; border-radius: 0 4px 4px 0; }
.ch-dtrack { display: grid; grid-template-columns: 1fr 1px 1fr; height: 14px; align-items: stretch; }
.ch-half { display: flex; }
.ch-half.l { justify-content: flex-end; }
.ch-half i { display: block; height: 100%; min-width: 2px; }
.ch-half i.fast { background: #2a78d6; border-radius: 4px 0 0 4px; }
.ch-half i.slow { background: #e34948; border-radius: 0 4px 4px 0; }
.ch-mid { background: #c3c2b7; }
.ch-legend { display: flex; gap: 16px; font-size: 12.5px; color: #52514e; margin: -6px 0 8px; }
.ch-legend .sw { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.ch-legend .sw.fast { background: #2a78d6; }
.ch-legend .sw.slow { background: #e34948; }
.ch-cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; align-items: end; height: 190px; padding-top: 6px; border-bottom: 1px solid #c3c2b7; }
.ch-col { display: flex; flex-direction: column; align-items: center; height: 100%; outline: none; border-radius: 6px 6px 0 0; }
.ch-col:hover, .ch-col:focus-visible { background: rgba(42, 120, 214, .07); }
.ch-cv { font-size: 12px; color: #0b0b0b; height: 16px; font-variant-numeric: tabular-nums; }
.ch-cbar { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.ch-cbar i { display: block; width: min(24px, 70%); background: #2a78d6; border-radius: 4px 4px 0 0; min-height: 0; }
.ch-x { font-size: 10.5px; color: #898781; padding-top: 4px; transform: translateY(100%); margin-top: -12px; white-space: nowrap; }
.ch-cols { margin-bottom: 22px; }
.ch-tip { position: fixed; z-index: 120; max-width: 340px; background: #0b0b0b; color: #fff; font-size: 12.5px; line-height: 1.45; padding: 7px 10px; border-radius: 8px; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
@media (max-width: 640px) { .ch-grid { grid-template-columns: 1fr; } .ch-row { grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) auto; } }

.ch-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px 24px; }
.ch-stage { border-top: 1px solid #e1e0d9; padding-top: 10px; }
.ch-stage-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.ch-row.top1 .ch-lab { font-weight: 600; }
.ch-crown { color: #2a78d6; font-size: 10px; vertical-align: 1px; }
body.tl-loading .tl-kpis, body.tl-loading .ch-grid, body.tl-loading .ch-card, body.tl-loading .card:not(.tl-filters) { opacity: .45; transition: opacity .15s; }

/* Nhóm giai đoạn */
.ph-row { display: grid; grid-template-columns: 28px minmax(180px, 320px) minmax(0, 1fr) auto auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.ph-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #f1eef7; font-size: 12px; }
.ph-used { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phase-cards .l { font-size: 13px; }

/* ---- Tổng quan (dashboard) ---- */
.db-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.db-hero h1 { margin: 2px 0 6px; font-size: 30px; }
.db-date { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent, #6904F2); font-weight: 600; }
.db-lead { margin: 0; color: #52514e; font-size: 15px; }
.db-lead a { color: inherit; }
.db-red { color: #c62828; }
.db-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.db-kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 16px; border-radius: 20px; background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(11, 11, 11, .08); box-shadow: 0 6px 24px rgba(40, 20, 90, .06); color: inherit; text-decoration: none; overflow: hidden; transition: transform .15s, box-shadow .15s; }
a.db-kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(40, 20, 90, .12); text-decoration: none; }
.db-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 6px; }
.db-ic svg { width: 22px; height: 22px; }
.db-ic.sm { width: 32px; height: 32px; margin: 0; flex: none; }
.db-ic.sm svg { width: 18px; height: 18px; }
.db-ic.violet { background: #efe6fe; color: #6904F2; }
.db-ic.blue { background: #e3eefc; color: #1c5cab; }
.db-ic.green { background: #e4f5e4; color: #0a7a0a; }
.db-ic.teal { background: #e0f4ee; color: #127a55; }
.db-ic.red { background: #fde8e8; color: #c62828; }
.db-kl { font-size: 13px; color: #52514e; }
.db-kv { font-size: 30px; line-height: 1.15; font-weight: 600; color: #0b0b0b; }
.db-ks { font-size: 12.5px; color: #898781; min-height: 18px; }
.db-up { color: #006300; font-weight: 600; }
.db-chip { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #f1eef7; color: #3a3550; white-space: nowrap; font-weight: 500; }
.db-chip.red { background: #fde8e8; color: #b42318; }
.db-chip.amber { background: #fff3d6; color: #8a5a00; }
.db-spark { display: flex; align-items: flex-end; gap: 3px; height: 30px; margin-top: 2px; }
.db-spark i { flex: 1; min-height: 2px; background: #d9d7e4; border-radius: 3px 3px 0 0; }
.db-spark i.cur { background: #2a78d6; }
.db-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.db-h h2 { margin-bottom: 12px; }
.db-flow-card { margin-bottom: 16px; }
.db-flow { display: flex; overflow-x: auto; padding-bottom: 4px; }
.db-step { position: relative; flex: 1 1 0; min-width: 150px; display: flex; flex-direction: column; gap: 4px; padding: 14px 26px 14px 30px; color: inherit; text-decoration: none;
  background: linear-gradient(135deg, #f3ebff, #e9f1fd); clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%); margin-right: -6px; transition: filter .15s; }
.db-step:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 16px 50%); border-radius: 0 14px 14px 0; margin-right: 0; }
.db-step:first-child:last-child { clip-path: none; border-radius: 14px; }
.db-flow-out { margin-top: 10px; }
.db-step:first-child { clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); padding-left: 18px; border-radius: 14px 0 0 14px; }
.db-step:hover { filter: brightness(.96); text-decoration: none; }
.db-step.empty { opacity: .6; }
.db-step.side { flex: 0 0 120px; min-width: 120px; background: #fbf3e4; }
.db-step.side.done { background: #e9f5ea; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 16px 50%); border-radius: 0 14px 14px 0; margin-right: 0; }
.db-step-no { font-size: 11px; color: var(--accent, #6904F2); font-weight: 700; letter-spacing: .05em; }
.db-step-name { font-size: 13px; font-weight: 600; color: #0b0b0b; line-height: 1.25; min-height: 32px; }
.db-step-n { font-size: 26px; font-weight: 600; line-height: 1.1; }
.db-step-n small { font-size: 12px; font-weight: 400; color: #898781; }
.db-step-bar { height: 4px; border-radius: 99px; background: rgba(105, 4, 242, .1); overflow: hidden; }
.db-step-bar i { display: block; height: 100%; background: var(--accent, #6904F2); border-radius: 99px; }
.db-step-codes { display: flex; flex-wrap: wrap; gap: 3px; min-height: 20px; }
.db-step-codes span { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .85); color: #3a3550; }
.db-step-foot { font-size: 12px; color: #52514e; min-height: 18px; }
.db-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.db-grid > .card { margin: 0; }
.db-list { list-style: none; margin: 0; padding: 0; }
.db-li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 8px; border-radius: 12px; color: inherit; text-decoration: none; }
.db-li:hover { background: rgba(105, 4, 242, .05); text-decoration: none; }
.db-li-main { display: flex; flex-direction: column; min-width: 0; }
.db-li-main b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-li-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-dot { width: 9px; height: 9px; border-radius: 50%; background: #c3c2b7; }
.db-dot.red { background: #d03b3b; }
.db-dot.amber { background: #fab219; }
.db-empty { padding: 26px 10px; text-align: center; color: #52514e; font-size: 14px; }
.db-overdue { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: #fdf1f1; color: #7a1c1c; margin-bottom: 12px; }
.db-overdue a { color: inherit; font-weight: 600; }
.db-cal { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.db-cal li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; }
.db-cal-d { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: #efe6fe; color: #4b0bb0; height: 50px; }
.db-cal-d b { font-size: 18px; line-height: 1; }
.db-cal-d small { font-size: 11px; }
.db-cal-body { min-width: 0; }
.db-cal-l { font-size: 12px; font-weight: 600; color: #52514e; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.db-cal-i { display: block; font-size: 13.5px; color: #0b0b0b; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-cal-i:hover { color: var(--accent, #6904F2); }
.db-legend { display: flex; gap: 16px; font-size: 12.5px; color: #52514e; margin: -4px 0 10px; }
.db-legend .sw { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.db-legend .sw.ok { background: #2a78d6; }
.db-legend .sw.late { background: #e34948; }
.db-load { display: flex; flex-direction: column; gap: 8px; }
.db-load-row { display: grid; grid-template-columns: 28px minmax(80px, 30%) minmax(0, 1fr) 28px; gap: 10px; align-items: center; }
.db-av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #efe6fe; color: #4b0bb0; font-weight: 600; font-size: 13px; }
.db-load-n { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-load-bar { display: flex; gap: 2px; height: 12px; }
.db-load-bar i { display: block; height: 100%; }
.db-load-bar i.ok { background: #2a78d6; }
.db-load-bar i.late { background: #e34948; }
.db-load-bar i:last-child { border-radius: 0 4px 4px 0; }
.db-load-v { text-align: right; font-variant-numeric: tabular-nums; }
.db-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.db-feed li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; font-size: 13.5px; }
.db-fi { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #f1eef7; font-size: 14px; }
@media (max-width: 1100px) { .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .db-kpis, .db-grid { grid-template-columns: 1fr; } .db-hero h1 { font-size: 24px; } }

/* ---- Sơ đồ tổ chức ---- */
.org-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.org-tools input[type=search] { width: 200px; }
.org-zoom { display: inline-flex; align-items: center; gap: 4px; }
.org-zoom span { min-width: 44px; text-align: center; font-size: 12.5px; color: #52514e; font-variant-numeric: tabular-nums; }
.org-shell { position: relative; }
.org-wrap { overflow: auto; max-height: calc(100vh - 190px); min-height: 420px; border-radius: 20px; background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(11, 11, 11, .07); cursor: grab; padding: 26px 20px 30px; }
.org-wrap.panning { cursor: grabbing; user-select: none; }
.org-canvas { width: max-content; min-width: 100%; }
.org-blank { padding: 60px 20px; text-align: center; color: #52514e; }
.org-tree, .org-tree ul { display: flex; justify-content: center; list-style: none; margin: 0; padding: 0; position: relative; }
.org-tree ul { padding-top: 22px; }
.org-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 9px 0; }
.org-tree > li { padding-top: 0; }
.org-tree li::before, .org-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid #cfc3ea; }
.org-tree li::after { right: auto; left: 50%; border-left: 2px solid #cfc3ea; }
.org-tree > li::before, .org-tree > li::after { display: none; }
.org-tree li:only-child::before { display: none; }
.org-tree li:only-child::after { border-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0 none; }
.org-tree li:last-child::before { border-right: 2px solid #cfc3ea; border-radius: 0 10px 0 0; }
.org-tree li:first-child::after { border-radius: 10px 0 0 0; }
.org-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid #cfc3ea; }
.org-tree li.folded > ul { display: none; }
.org-unit { position: relative; width: 236px; background: #fff; border-radius: 18px; border: 1px solid rgba(11, 11, 11, .08); border-top: 4px solid var(--c, #6904F2);
  box-shadow: 0 8px 24px rgba(40, 20, 90, .08); padding: 0 0 12px; cursor: default; transition: box-shadow .15s, transform .15s; }
.org-unit:hover { box-shadow: 0 12px 30px rgba(40, 20, 90, .14); }
.org-unit-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px 8px;
  background: color-mix(in srgb, var(--c, #6904F2) 7%, #fff); border-radius: 14px 14px 0 0; }
.org-unit-name { font-weight: 700; font-size: 14px; color: color-mix(in srgb, var(--c, #6904F2) 75%, #000); line-height: 1.25; }
.org-unit-n { font-size: 11.5px; color: #52514e; white-space: nowrap; }
.org-head, .org-p { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; font: inherit; color: inherit;
  cursor: pointer; border-radius: 12px; }
.org-head { padding: 12px 14px 8px; }
.org-p { padding: 5px 8px; }
.org-head:hover, .org-p:hover { background: rgba(105, 4, 242, .06); }
.org-p-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.org-p-t b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-head .org-p-t b { font-size: 14.5px; }
.org-p-t small { font-size: 11.5px; color: #6f6d68; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-head .org-p-t small { color: color-mix(in srgb, var(--c, #6904F2) 70%, #000); font-weight: 600; }
.org-av { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; font-size: 11px; font-weight: 700;
  background: hsl(var(--h, 260) 70% 93%); color: hsl(var(--h, 260) 45% 32%); }
.org-av.lg { width: 44px; height: 44px; font-size: 15px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c, #6904F2); }
.org-av.xl { width: 64px; height: 64px; font-size: 22px; }
.org-mems { padding: 2px 6px 0; display: flex; flex-direction: column; }
.org-head + .org-mems { border-top: 1px dashed rgba(11, 11, 11, .1); margin: 0 8px; padding: 6px 0 0; }
.org-mems.long:not(.open) .org-p:nth-of-type(n+6) { display: none; }
.org-more { border: 0; background: none; color: var(--accent, #6904F2); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 8px; text-align: left; }
.org-none { padding: 12px 14px 2px; font-size: 12.5px; color: #898781; }
.org-fold { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; border: 1px solid #cfc3ea;
  background: #fff; color: #4b0bb0; font-size: 13px; line-height: 1; cursor: pointer; z-index: 2; padding: 0; }
.org-tree li.folded > .org-unit { box-shadow: 4px 4px 0 -1px #fff, 4px 4px 0 0 #d9d2ee, 0 8px 24px rgba(40, 20, 90, .08); }
.org-wrap.searching [data-p]:not(.hit) { opacity: .35; }
.org-wrap [data-p].hit { background: #fff3c4; box-shadow: 0 0 0 2px #fab219; }
/* editing */
.org-editbar, .org-ubar, .org-loose { display: none; }
.org-shell.editing .org-editbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px; border-radius: 14px;
  background: #efe6fe; color: #3a1d78; font-size: 13px; }
.org-shell.editing .org-ubar { display: flex; justify-content: center; gap: 4px; margin: 8px 10px 0; padding-top: 8px; border-top: 1px dashed rgba(11, 11, 11, .1); }
.org-ubar button { border: 1px solid rgba(11, 11, 11, .12); background: #fff; border-radius: 8px; width: 30px; height: 26px; cursor: pointer; font-size: 13px; padding: 0; }
.org-shell.editing .org-ubar { flex-wrap: wrap; }
.org-ubar select { height: 26px; font-size: 12px; padding: 0 6px; border-radius: 8px; max-width: 150px; }
.org-tag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 14px 6px; font-size: 11.5px; }
.org-tag small { color: #52514e; }
.org-warn, .warn-red { color: #b42318 !important; font-weight: 600; }
.assign-table select { min-width: 220px; }
.assign-table td { vertical-align: top; }
.org-ubar button:hover { background: #efe6fe; }
.org-shell.editing .org-unit-h { cursor: move; }
.org-shell.editing .org-p, .org-shell.editing .org-head { cursor: grab; }
.org-shell.editing .org-loose { display: block; margin-top: 14px; padding: 14px 16px; border-radius: 18px; border: 2px dashed #d9d2ee; background: rgba(255, 255, 255, .7); }
.org-loose-h { font-weight: 600; margin-bottom: 8px; }
.org-loose-l { display: flex; flex-wrap: wrap; gap: 6px; }
.org-loose-l .org-p { width: 210px; background: #fff; border: 1px solid rgba(11, 11, 11, .08); }
.org-rootdrop { display: none; padding: 6px 12px; border: 2px dashed #b9a6ea; border-radius: 10px; font-size: 12.5px; }
.org-shell.drag-u .org-rootdrop { display: inline-block; }
.dragging { opacity: .45; }
.drop-on { outline: 3px solid var(--accent, #6904F2); outline-offset: 3px; }
.org-loose.drop-on { background: #f6f0ff; }
/* dialog */
.org-dlg { width: min(460px, 94vw); }
.org-pd-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.org-pd-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.org-pd-stats div { background: #f6f3fc; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.org-pd-stats b { font-size: 22px; line-height: 1.1; }
.org-pd-stats span { font-size: 12px; color: #52514e; }
#org-pd-info div { margin-bottom: 3px; }
.org-pd-lh { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: #52514e; text-transform: uppercase; letter-spacing: .04em; }
.org-pd-lead { display: block; font-size: 13px; padding: 3px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-pd-form { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(11, 11, 11, .08); display: flex; flex-direction: column; gap: 10px; }
.org-chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.org-pd-acts { display: flex; gap: 8px; margin-top: 12px; }
@media print {
  .sidebar, .org-tools, .org-editbar, .org-loose, .org-ubar, .org-fold, .ai-fab, .flash { display: none !important; }
  .org-wrap { max-height: none; overflow: visible; border: 0; background: none; padding: 0; }
  .org-unit { box-shadow: none; break-inside: avoid; }
  .org-wrap.searching [data-p]:not(.hit) { opacity: 1; }
}

/* Hồ sơ: Kanban theo nhóm giai đoạn */
.pk-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pk-views { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); }
.pk-views a { padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--text); text-decoration: none; white-space: nowrap; }
.pk-views a.on { background: #0b0b0b; color: #fff; }
.pk-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.pk-board .kcol { flex: 0 0 272px; min-height: 240px; }
.pk-board .kcol.pk-stopped { background: rgba(255, 243, 224, .7); }
.pk-board .kcol.pk-archived { background: rgba(232, 245, 233, .7); }
.pk-card { display: block; color: inherit; text-decoration: none; margin-bottom: 10px; }
.pk-card:hover { text-decoration: none; }
.pk-card.late { border-left: 4px solid #e34948; }
.pk-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pk-val { font-size: 12px; font-weight: 600; color: #1c5cab; white-space: nowrap; }
.pk-svc { margin: 6px 0 2px; }
.pk-stages { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 2px; }
.pk-who { margin-top: 8px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-empty { padding: 18px 6px; text-align: center; font-size: 12.5px; color: var(--muted); }

.db-step.end { background: linear-gradient(135deg, #e6f4e8, #eef7ef); }
.db-step.end .db-step-bar i { background: #127a55; }
.db-step.end .db-step-no { color: #127a55; }

/* ---- Giao việc (adhoc) ---- */
.ah-filter { margin-left: auto; display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); }
.ah-filter a { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text); text-decoration: none; }
.ah-filter a.on { background: #0b0b0b; color: #fff; }
.ah-list { padding: 6px 0; }
.ah-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px 20px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.ah-item:last-child { border-bottom: 0; }
.ah-item.st-submitted { border-left-color: #fab219; background: rgba(255, 243, 214, .35); }
.ah-item.late { border-left-color: #e34948; }
.ah-item.st-done, .ah-item.st-cancelled { opacity: .75; }
.ah-item:target { box-shadow: inset 0 0 0 2px var(--accent, #6904F2); }
.ah-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.ah-st { font-size: 11.5px; padding: 1px 9px; border-radius: 999px; background: #e3eefc; color: #1c5cab; font-weight: 600; }
.ah-st.st-submitted { background: #fff3d6; color: #8a5a00; }
.ah-st.st-done { background: #e4f5e4; color: #0a7a0a; }
.ah-st.st-cancelled { background: #eee; color: #666; }
.ah-desc { margin: 4px 0; font-size: 13.5px; white-space: pre-line; }
.ah-meta { margin-top: 4px; }
.ah-note { margin-top: 6px; font-size: 13px; padding: 6px 10px; border-radius: 10px; background: #f6f3fc; }
.ah-note.fb { background: #fdf1f1; }
.ah-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 260px; }
.ah-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ah-form input[type=text] { width: 220px; }
.ah-need { outline: 2px solid #e34948; }
.ah-empty { padding: 30px 20px; text-align: center; color: var(--muted); }
.ah-people { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; margin-top: 6px; background: #fff; }
.ah-unit { font-size: 11.5px; font-weight: 700; color: var(--accent, #6904F2); text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 2px; }
.ah-person { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13.5px; text-transform: none; letter-spacing: 0; cursor: pointer; }
.ah-person[hidden] { display: none; }
@media (max-width: 760px) { .ah-item { grid-template-columns: 1fr; } .ah-acts { align-items: stretch; min-width: 0; } .ah-form input[type=text] { width: 100%; } }

/* file yêu cầu của bước: một dòng, kèm danh sách file đã tải; kéo thả nhiều file */
.kb-req { flex-direction: column; align-items: stretch; gap: 6px; }
.tk-dvr { border-radius: 12px; padding: 2px; }
.tk-dvr.drag-on { outline: 2px dashed var(--accent, #6904F2); background: rgba(105, 4, 242, .05); }
.tk-files { list-style: none; margin: 4px 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-files li { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-files li::before { content: "📄 "; }

.db-grid > .db-wide { grid-column: 1 / -1; }
.db-wide .db-load { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); column-gap: 32px; row-gap: 8px; }
.sl-pages { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }

.kb-done li:has(.kb-done-req) { flex-wrap: wrap; }
.kb-done-req { flex: 0 0 calc(100% - 18px); max-width: calc(100% - 18px); min-width: 0; box-sizing: border-box; margin: 4px 0 6px 18px; }

/* nút thêm trên thẻ việc: chỉ biểu tượng (chữ nằm ở title / aria-label) */
label.tk-up.icon { width: 24px; height: 24px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; font-size: 13px; line-height: 1; }
.kb-pbtn { min-width: 26px; text-align: center; }

/* Công việc: kiểu xem "Giai đoạn hiện tại" — chỉ cột đang làm, giãn hết chiều ngang */
.kb-views { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); }
.kb-views button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--text); white-space: nowrap; }
.kb-views button.on { background: #0b0b0b; color: #fff; }
.kb-focusbar { display: none; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.kb-wrap.focus .kb-focusbar { display: flex; }
.kb-fpill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text); }
.kb-fpill:hover { border-color: var(--accent, #6904F2); }
.kb-fpill.on { background: var(--accent, #6904F2); border-color: var(--accent, #6904F2); color: #fff; }
.kb-fdot { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #efe6fe; color: #4b0bb0; font-size: 11px; font-weight: 700; }
.kb-fpill.is-done .kb-fdot { background: #e4f5e4; color: #0a7a0a; }
.kb-fpill.is-active .kb-fdot { background: #fff3d6; color: #8a5a00; }
.kb-fpill.is-skipped { opacity: .55; }
.kb-fpill.on .kb-fdot { background: rgba(255, 255, 255, .25); color: #fff; }
.kb-farrow { color: var(--muted); font-size: 12px; }
.kb-wrap.focus .kb-col:not(.in-focus) { display: none; }
.kb-wrap.focus .kb-col.in-focus { flex: 1 1 0; min-width: 340px; }
.kb-wrap.focus .kb-col.in-focus .kb-subcol { flex: 1 1 0; min-width: 260px; }

.kb-wrap > h2 { flex-wrap: wrap; row-gap: 8px; }
.kb-fpill { white-space: nowrap; }
@media (max-width: 700px) { .kb-wrap.focus .kb-col.in-focus { min-width: 0; } .kb-views button { padding: 5px 9px; } }
.kb-vshort { display: none; }
@media (max-width: 480px) { .kb-vlong { display: none; } .kb-vshort { display: inline; } }

/* thẻ việc: nút xử lý (Duyệt / Ký, Trình…) dồn sang phải, Trả về đứng trước nút chính */
.kb-a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kb-stale { flex-basis: 100%; margin-top: 6px; padding: 6px 8px; border-radius: 10px; background: #fff3e6; color: #8a4b00; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kb-a > .kb-act { margin-left: auto; justify-content: flex-end; }
.kb-a > .muted { margin-left: auto; }
.kb-act .tk-retbtn, .kb-act button[value="return_stage"] { order: -1; }

/* Trả về: cùng kiểu nút với nút chính, màu đỏ */
.btn.danger, .btn.danger.tk-retbtn { background: #d92d20; border-color: #d92d20; color: #fff; }
.btn.danger:hover { background: #b42318; border-color: #b42318; color: #fff; }

/* tên người trên thẻ việc = nút mở hộp Người thực hiện (một hoặc nhiều người + %) */
.kb-pick { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 3px 8px; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }
.kb-pick:hover { border-color: var(--accent, #6904F2); }
.kb-pick-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kb-pick-c { color: var(--muted); font-size: 10px; }

/* các ô file yêu cầu rộng bằng nhau (hết chiều ngang), nút tải / thêm thẳng hàng bên phải */
.kb-req .tk-dvr > .tk-dv { display: flex; width: 100%; box-sizing: border-box; min-height: 32px; }
.kb-req .tk-dvr > .tk-dv > form { margin-left: auto; flex: none; }
.kb-req .tk-dvr > .tk-dv:not(:has(form)) { padding-right: 12px; }
.kb-req .tk-files { margin-left: 14px; }

@media (max-width: 520px) {
  .ppl-dlg { padding: 16px 14px; }
  .ppl-head { display: none; }
  .ppl-row { grid-template-columns: minmax(0, 1fr) 72px 24px; }
  .ppl-row select { grid-column: 1 / -1; }
  .ppl-row .ppl-role { grid-column: 1; grid-row: 2; }
}

/* chọn người thực hiện: danh sách tích chọn thả xuống ngay dưới tên người */
.ppl-pop { position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 16px); background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(30, 20, 70, .18); padding: 8px; }
.ppl-pop-h { font-size: 12px; color: var(--muted); padding: 4px 6px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-pop-list { max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.ppl-opt { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 9px; min-height: 32px; }
.ppl-opt:hover { background: #f6f3fc; }
.ppl-opt.on { background: #f1eafe; }
.ppl-opt label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0;
  font-size: 13.5px; font-family: var(--sans); color: var(--text); }
.ppl-opt label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-opt input[type=checkbox] { width: 16px; height: 16px; flex: none; accent-color: var(--accent, #6904F2); }
.ppl-tag { font-size: 10.5px; color: var(--accent, #6904F2); font-weight: 600; white-space: nowrap; }
.ppl-lead { font-size: 14px; color: #b0a6cc; }
.ppl-opt .ppl-pct { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.ppl-opt .ppl-pct input { width: 52px; padding: 3px 6px; font-size: 12.5px; text-align: right; }
.ppl-pop-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 6px 2px; }
.ppl-pop-foot .btn { margin-left: auto; }
.ppl-pop-foot .ppl-total { font-size: 12px; color: var(--muted); }
.ppl-pop-foot .ppl-total.bad { color: #d92d20; font-weight: 600; }
.ppl-total.shake { animation: ppl-shake .35s; }
@keyframes ppl-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* hạn của việc ở góc trên bên phải thẻ (cùng dòng tên việc) */
.kb-t .kb-tdue { margin-left: auto; flex: none; display: inline-flex; align-items: center; }
.kb-t .kb-tdue:empty { display: none; }
.kb-t .kb-tdue .kb-duef { flex: none; width: 132px; margin: -3px 0; }
.kb-m:not(:has(*)) { display: none; }

/* Thông tin chung: thu gọn / mở rộng */
.info-fold { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.info-chev { display: inline-block; font-size: 14px; color: var(--muted); transition: transform .15s; }
#info.folded .info-chev { transform: rotate(-90deg); }
.info-sum { display: none; font-weight: 400; font-size: 13px; margin-left: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
#info.folded .info-sum { display: inline; }
#info.folded #info-view, #info.folded #info-form { display: none !important; }
#info.folded > h2 { margin-bottom: 0; }
@media (max-width: 700px) { #info.folded .info-sum { display: none; } }

/* còn x ngày / quá hạn x ngày bên cạnh hạn của việc */
.kb-tdue { gap: 6px; }
.kb-left { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.kb-left.ok { background: #e4f5e4; color: #0a7a0a; }
.kb-left.today { background: #fff3d6; color: #8a5a00; }
.kb-left.late { background: #fde8e8; color: #b42318; }

/* Tổng quan · Công việc của tôi: xử lý ngay trên dòng */
.db-list .db-li { grid-template-columns: 10px minmax(0, 1fr) auto; }
.db-list .db-li:hover { background: rgba(105, 4, 242, .04); }
.db-li-main { color: inherit; text-decoration: none; }
.db-li-main:hover b { color: var(--accent, #6904F2); }
.db-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.db-acts form { margin: 0; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .db-list .db-li { grid-template-columns: 10px minmax(0, 1fr); } .db-acts { grid-column: 2; justify-content: flex-start; } }

/* Công việc của tôi: gom theo hồ sơ, tên việc đầy đủ, nút xử lý ở dòng dưới */
.db-work { display: flex; flex-direction: column; gap: 2px; }
.db-work .db-grp { display: flex; align-items: center; gap: 8px; margin: 12px 0 2px; padding: 0 4px; font-size: 12.5px; color: #52514e; }
.db-work .db-grp:first-child { margin-top: 0; }
.db-work .db-grp a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.db-work .db-grp a:hover { color: var(--accent, #6904F2); }
.db-work .db-grp b { color: var(--accent, #6904F2); }
.db-item { padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(11, 11, 11, .07); background: rgba(255, 255, 255, .7); }
.db-item + .db-item { margin-top: 4px; }
.db-row1 { display: flex; align-items: flex-start; gap: 10px; }
.db-row1 .db-dot { margin-top: 6px; flex: none; }
.db-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; color: #0b0b0b; text-decoration: none; line-height: 1.35; }
.db-name:hover { color: var(--accent, #6904F2); }
.db-row1 .db-chip { flex: none; }
.db-item .db-meta { margin: 2px 0 0 19px; }
.db-item .db-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; margin: 8px 0 0 19px; }
.db-item .db-acts form { margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }

.db-item .db-req { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 19px; font-size: 12px; }

/* Tổng quan: các ô file yêu cầu rộng bằng nhau, nút tải / thêm thẳng hàng bên phải */
.db-item .db-req { flex-direction: column; align-items: stretch; max-width: 460px; }
.db-item .db-req > .tk-dv { display: flex; width: 100%; box-sizing: border-box; min-height: 32px; }
.db-item .db-req > .tk-dv > form { margin-left: auto; flex: none; }
.db-item .db-req > .tk-dv:not(:has(form)) { padding-right: 12px; }

/* Công việc của tôi: hạn ở dòng thông tin dưới tên việc (tên việc dùng hết chiều ngang) */
.db-item .db-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.db-item .db-meta .db-chip { font-size: 11.5px; }
.db-chip.green { background: #e4f5e4; color: #0a7a0a; }

/* nội dung đã thực hiện: ô nhập mở ngay dưới nút Hoàn thành; hiện lại trong danh sách Đã xong */
.need-desc { flex-basis: 100%; width: 100%; margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.need-desc textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 10px; }
.need-desc textarea.need-desc-bad { outline: 2px solid #e34948; }
.need-desc-acts { display: flex; gap: 10px; align-items: center; }
.kb-dnote { flex-basis: 100%; margin: 2px 0 4px 18px; font-size: 12px; color: #52514e; white-space: pre-line; }
.kb-done li:has(.kb-dnote) { flex-wrap: wrap; }
form.inline:has(.need-desc) { display: flex; flex-wrap: wrap; flex-basis: 100%; }

/* tên việc không bị ô hạn bóp: tên luôn có chỗ (≥ 140px), cột hẹp thì hạn xuống dòng dưới tên */
.kb-card .kb-t { flex-wrap: wrap; row-gap: 4px; }
.kb-card .kb-t .kb-tn { flex: 1 1 140px; min-width: 0; overflow-wrap: break-word; word-break: normal; }
.kb-card .kb-t .kb-tdue { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* ===== Hồ sơ: số liệu, bộ lọc gọn, Kanban có màu ===== */
.pk-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.pk-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(11, 11, 11, .07); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.pk-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(40, 20, 90, .1); text-decoration: none; }
.pk-stat b { font-size: 22px; font-weight: 600; line-height: 1.15; }
.pk-stat span { font-size: 12px; color: #6f6d68; }
.pk-stat.on { border-color: var(--accent, #6904F2); box-shadow: 0 0 0 2px rgba(105, 4, 242, .15); }
.pk-stat.warn b { color: #d92d20; }
.pk-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 12px; border-radius: 16px;
  background: rgba(255, 255, 255, .8); border: 1px solid rgba(11, 11, 11, .07); }
.pk-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); text-transform: none; letter-spacing: 0; margin: 0; font-family: var(--sans); }
.pk-search input { border: 0; background: none; padding: 9px 0; flex: 1; min-width: 0; font-size: 14px; outline: none; box-shadow: none; }
.pk-sel { border-radius: 999px; padding: 8px 32px 8px 14px; font-size: 13px; max-width: 240px; background-color: #fff; }
.pk-more { position: relative; }
.pk-more summary { list-style: none; cursor: pointer; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; white-space: nowrap; }
.pk-more summary::-webkit-details-marker { display: none; }
.pk-more[open] summary { border-color: var(--accent, #6904F2); }
.pk-more-grid { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(560px, 90vw); display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(30, 20, 70, .16); }
.pk-more-grid .pk-sel { max-width: none; width: 100%; }
.pk-clear { font-size: 13px; color: #b42318; text-decoration: none; white-space: nowrap; }
.pk-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.pk-col { flex: 0 0 292px; width: 292px; min-width: 0; display: flex; flex-direction: column; border-radius: 18px;
  background: color-mix(in srgb, var(--c) 6%, rgba(255, 255, 255, .55)); border: 1px solid color-mix(in srgb, var(--c) 18%, transparent); }
.pk-colh { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 3px solid var(--c); border-radius: 18px 18px 0 0;
  background: color-mix(in srgb, var(--c) 10%, #fff); }
.pk-coln { font-weight: 700; font-size: 13px; color: color-mix(in srgb, var(--c) 80%, #000); text-transform: uppercase; letter-spacing: .04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pk-cnt { flex: none; min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--c);
  color: #fff; font-size: 11.5px; font-weight: 700; }
.pk-colv { margin-left: auto; font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--c) 70%, #000); white-space: nowrap; }
.pk-colb { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.pk-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 10px; border: 2px dashed color-mix(in srgb, var(--c) 25%, transparent);
  border-radius: 14px; color: #8a8792; font-size: 12.5px; }
.pk-empty span { font-size: 20px; color: color-mix(in srgb, var(--c) 50%, #ccc); }
.pk-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 12px 16px; border-radius: 14px; background: #fff;
  border: 1px solid rgba(11, 11, 11, .07); color: inherit; text-decoration: none; overflow: hidden; min-width: 0;
  box-shadow: 0 2px 8px rgba(30, 20, 70, .05); transition: transform .15s, box-shadow .15s; }
.pk-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.pk-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(30, 20, 70, .12); text-decoration: none; }
.pk-card.late::before { background: #e34948; }
.pk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pk-code { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: color-mix(in srgb, var(--c) 75%, #000); background: color-mix(in srgb, var(--c) 10%, #fff);
  padding: 2px 8px; border-radius: 6px; }
.pk-val { font-size: 12.5px; font-weight: 700; color: #1c5cab; white-space: nowrap; }
.pk-name { font-weight: 600; font-size: 14.5px; line-height: 1.35; color: #0b0b0b; overflow-wrap: anywhere; }
.pk-client { font-size: 12.5px; color: #52514e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-svcs { display: flex; flex-wrap: wrap; gap: 4px; }
.pk-svc { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: #2f3b72; max-width: 100%; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.pk-svc.more { background: #f1eef7; color: #4b0bb0; font-weight: 600; }
.pk-stages { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px dashed rgba(11, 11, 11, .1); }
.pk-stage { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; min-width: 0; }
.pk-sno { flex: none; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--c); padding: 1px 6px; border-radius: 5px; }
.pk-sname { flex: 1; min-width: 0; color: #3a3550; }
.pk-due { flex: none; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.pk-due.ok { background: #e4f5e4; color: #0a7a0a; }
.pk-due.today { background: #fff3d6; color: #8a5a00; }
.pk-due.late { background: #fde8e8; color: #b42318; }
.pk-par { font-size: 11px; color: #2a78d6; }
.pk-stopnote { font-size: 12px; color: #8a5a00; background: #fff3d6; padding: 4px 8px; border-radius: 8px; }
.pk-prog { height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, #eee); overflow: hidden; margin-top: 2px; }
.pk-prog i { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.pk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pk-avs { display: inline-flex; }
.pk-av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 9.5px; font-weight: 700; margin-left: -6px;
  background: hsl(var(--h, 260) 70% 90%); color: hsl(var(--h, 260) 45% 30%); box-shadow: 0 0 0 2px #fff; }
.pk-av:first-child { margin-left: 0; }
.pk-av.more { background: #f1eef7; color: #4b0bb0; }
.pk-ns { font-size: 11px; color: #8a8792; white-space: nowrap; }
@media (max-width: 900px) { .pk-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pk-more-grid { grid-template-columns: 1fr; } .pk-col { flex-basis: 84vw; width: 84vw; } }

/* Việc của tôi: tab lọc, danh sách dùng chung với Tổng quan, dòng thời gian đã xử lý */
.mw-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.mw-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 130px; padding: 10px 16px; border-radius: 16px; cursor: pointer;
  background: rgba(255, 255, 255, .8); border: 1px solid rgba(11, 11, 11, .07); font: inherit; color: inherit; text-align: left; transition: transform .15s; }
.mw-tab:hover { transform: translateY(-2px); }
.mw-tab b { font-size: 22px; line-height: 1.1; font-weight: 600; }
.mw-tab span { font-size: 12px; color: #6f6d68; }
.mw-tab.late b { color: #d92d20; }
.mw-tab.on { border-color: var(--accent, #6904F2); box-shadow: 0 0 0 2px rgba(105, 4, 242, .15); background: #fff; }
.mw-card { padding-top: 18px; }
.mw-feed { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.mw-feed::before { content: ""; position: absolute; left: 20px; top: 6px; bottom: 6px; width: 2px; background: #ece8f5; }
.mw-ev { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.mw-ic { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 14px; font-weight: 700;
  background: #f1eef7; color: #4b0bb0; box-shadow: 0 0 0 3px #fff; }
.mw-ev.ok .mw-ic { background: #e4f5e4; color: #0a7a0a; }
.mw-ev.bad .mw-ic { background: #fde8e8; color: #b42318; }
.mw-ev.info .mw-ic { background: #e3eefc; color: #1c5cab; }
.mw-evb { min-width: 0; font-size: 13.5px; }
.mw-code { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--accent, #6904F2); background: #f1eafe; padding: 1px 7px; border-radius: 6px; text-decoration: none; }
.mw-res { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-left: 4px; background: #f1eef7; color: #4b4560; white-space: nowrap; }
.mw-res.ok { background: #e4f5e4; color: #0a7a0a; }
.mw-res.bad { background: #fde8e8; color: #b42318; }
.mw-res.info { background: #e3eefc; color: #1c5cab; }
.mw-cmt { margin: 3px 0; color: #3a3550; font-style: italic; white-space: pre-line; }

/* Tổng quan gộp Việc của tôi: cột trái Công việc của tôi, cột phải Lịch đến hạn + Đã xử lý gần đây */
.db-grid.db-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.db-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.db-side > .card { margin: 0; }
.db-main .mw-tabs .mw-tab { min-width: 0; flex: 1 1 110px; padding: 8px 12px; }
.db-main .mw-tabs .mw-tab b { font-size: 19px; }
@media (max-width: 1100px) { .db-grid.db-main { grid-template-columns: 1fr; } }
.db-main { margin-bottom: 16px; }
.db-load-card { margin-bottom: 16px; }
.db-load-card .db-load { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); column-gap: 32px; row-gap: 8px; }
.db-mwtabs .mw-tabs { margin-bottom: 16px; }
.db-mwtabs .mw-tab { flex: 1 1 150px; }

/* Tổng quan: 3 nhóm ô — Hồ sơ / Công việc hồ sơ của tôi / Công việc adhoc */
.db-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.db-panels.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.db-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 20px; background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(11, 11, 11, .07); border-top: 4px solid var(--c); box-shadow: 0 6px 24px rgba(40, 20, 90, .06); }
.db-ph { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: color-mix(in srgb, var(--c) 80%, #000); }
.db-pi { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: color-mix(in srgb, var(--c) 12%, #fff); font-size: 14px; }
.db-pi svg { width: 16px; height: 16px; }
.db-pl { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.db-pl:hover { color: var(--c); }
.db-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.db-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 12px; border-radius: 14px; background: #fff;
  border: 1px solid rgba(11, 11, 11, .07); font: inherit; color: inherit; text-align: left; text-decoration: none; cursor: pointer; min-width: 0;
  transition: transform .15s, box-shadow .15s, border-color .15s; }
.db-cell:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(40, 20, 90, .08); text-decoration: none; }
.db-cell b { font-size: 22px; line-height: 1.15; font-weight: 600; color: #0b0b0b; }
.db-cell span { font-size: 12px; color: #6f6d68; line-height: 1.3; }
.db-cell em { font-style: normal; font-size: 11px; color: #006300; font-weight: 600; }
.db-cell.late b { color: #d92d20; }
.db-cell.soon b { color: #b06a00; }
.db-cell.on { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent); }
.db-pf { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; font-size: 12.5px; color: #52514e; }
.db-pf .db-spark { width: 110px; height: 26px; margin: 0; }
.mw-reset { margin-left: auto; font-size: 12.5px; color: var(--accent, #6904F2); }
@media (max-width: 1100px) { .db-panels, .db-panels.two { grid-template-columns: 1fr; } }

/* nền "striped waves" (static/waves.js): dải sợi uốn sóng trên nền sáng; có WebGL thì ẩn các khối kính cũ */
.bg-waves { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
html.has-waves .page-bg .ax-slab { display: none; }

/* Cấu hình · bot Zalo / Telegram, lịch tự động; Trợ lý AI · kết nối */
.bot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.bot-box { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); }
.bot-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.cron-tbl td { vertical-align: top; }
.cron-tbl tr.off td { opacity: .55; }
.cron-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.cl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-code { font: 600 20px/1 ui-monospace, Consolas, monospace; letter-spacing: .08em; padding: 6px 12px; border-radius: 10px; background: #f1eafe; color: #4b0bb0; }
.cl-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) { .bot-grid { grid-template-columns: 1fr; } }

/* Lịch sử chat bot (/chatlog) */
.chl-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.chl-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .78); border: 1px solid var(--line); }
.chl-stat b { font-size: 22px; line-height: 1.1; }
.chl-stat span:last-child { font-size: 12px; color: var(--muted); }
.chl-stat .chl-ic { font-size: 18px; }
.chl-stat.bad b { color: #d4362f; }
.chl-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.chl-filter select, .chl-filter input { width: auto; min-width: 150px; }
.chl-filter input[type=search] { flex: 1; min-width: 180px; }
.chl-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; min-height: 420px; }
.chl-list { display: flex; flex-direction: column; gap: 6px; max-height: 640px; overflow-y: auto; padding-right: 4px; }
.chl-conv { display: block; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); color: inherit; text-decoration: none; }
.chl-conv:hover { border-color: #c9b2f7; }
.chl-conv.on { border-color: var(--accent); background: #f4edff; box-shadow: 0 0 0 2px rgba(105, 4, 242, .12); }
.chl-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chl-prev { margin-top: 4px; font-size: 13px; color: #4a4560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chl-unl { color: #c46a00; }
.chl-thread { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: rgba(250, 248, 255, .85); min-width: 0; }
.chl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.chl-msgs { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px; max-height: 600px; overflow-y: auto; }
.chl-day { align-self: center; font-size: 12px; color: var(--muted); padding: 2px 10px; border-radius: 99px; background: rgba(0, 0, 0, .05); margin: 6px 0; }
.chl-msg { display: flex; flex-direction: column; max-width: 78%; }
.chl-msg.in { align-self: flex-start; align-items: flex-start; }
.chl-msg.out { align-self: flex-end; align-items: flex-end; }
.chl-bub { white-space: pre-wrap; word-break: break-word; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.chl-msg.in .chl-bub { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chl-msg.out .chl-bub { background: #ece0ff; border-bottom-right-radius: 4px; }
.chl-msg.k-notify .chl-bub, .chl-msg.k-cron .chl-bub { background: #e3f1ff; }
.chl-msg.k-system .chl-bub { background: #f1eff6; color: #4a4560; }
.chl-msg.k-error .chl-bub, .chl-msg.fail .chl-bub { background: #fde8e7; }
.chl-msg.in.k-command .chl-bub, .chl-msg.in.k-link .chl-bub { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.chl-meta { font-size: 11px; color: var(--muted); margin-top: 2px; padding: 0 4px; }
@media (max-width: 1100px) { .chl-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .chl-wrap { grid-template-columns: 1fr; } .chl-list { max-height: 260px; } .chl-msg { max-width: 92%; } }
.chl-health { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.chl-hbox { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .78); min-width: 260px; flex: 1; }
.chl-hbox.ok { border-left: 4px solid #2f9e5b; }
.chl-hbox.err { border-left: 4px solid #d4362f; }
.chl-hbox.off { border-left: 4px solid #b9b4c8; }
.chl-herr { color: #b42318; }

/* file yêu cầu trong thẻ việc / "Đã xong": luôn nằm gọn trong cột hẹp (tên dài xuống dòng, nút ⊕ không bị cắt, tên file rút gọn) */
.kb-req, .kb-req .tk-dvr { min-width: 0; max-width: 100%; box-sizing: border-box; }
.kb-req .tk-dvr > .tk-dv { min-width: 0; max-width: 100%; overflow-wrap: anywhere; line-height: 1.3; }
.kb-req .tk-files { min-width: 0; }
.kb-req .tk-files li { max-width: 100%; }

/* Lịch sử chat bot · nhóm Zalo / Telegram */
.chl-gname { display: flex; gap: 6px; align-items: center; }
.chl-gname input { min-width: 180px; padding: 4px 8px; }
.chl-gsend { display: inline-block; margin-right: 6px; }
.chl-gsend[open] form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; min-width: 260px; }
.chl-grp { color: #2a78d6; }
.np-mode { display: flex; flex-direction: column; gap: 4px; }
/* tab Tài liệu: tải file vào từng thư mục */
.trow .tup { margin: 0 0 0 4px; flex: none; }
.tnode.tk-drop.drag-on > details > summary { outline: 2px dashed var(--accent, #6904F2); border-radius: 10px; background: rgba(105, 4, 242, .05); }
/* chọn người: nhóm theo phòng / đơn vị, lãnh đạo lên trước */
.pp-group { position: sticky; top: -4px; z-index: 1; margin: 2px -8px 0; padding: 6px 10px 3px; background: #f6f3fd; font-size: 11.5px;
  font-weight: 600; letter-spacing: .02em; color: #5b4a86; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-group:first-child { margin-top: -4px; }
.pp-opt.is-lead .pp-name { font-weight: 600; }
.pp-star { color: #d39b00; font-size: 12px; }
.pp-list:has(.pp-group) { max-height: 260px; }

/* Logo xoay 3D quanh trục dọc: mỗi 5 giây một vòng (~1,2 s xoay, còn lại đứng yên) — menu bên trái + trang đăng nhập */
@keyframes logo-spin3d {
  0%, 76% { transform: perspective(700px) rotateY(0deg); }
  100% { transform: perspective(700px) rotateY(360deg); }
}
.sidebar .logo img, .auth-logo { animation: logo-spin3d 5s cubic-bezier(.45, .05, .35, 1) infinite; transform-origin: 50% 50%; will-change: transform; }
.row-actions .user-del { margin-right: 4px; }

/* Việc "Tự động" (tasks/T06): ⚙ trên thẻ, đang chạy, lỗi + Chạy lại */
.kb-gear { color: #0b7a75; font-weight: 700; }
.kb-auto, .db-auto { margin: 6px 0 2px; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.kb-auto.run, .db-auto.run { background: rgba(11, 122, 117, .10); color: #0b5f5a; }
.kb-auto.err, .db-auto.err { background: rgba(198, 40, 40, .10); color: #b71c1c; border: 1px solid rgba(198, 40, 40, .28); }
/* việc giao theo bộ phân giải (T06 D): thẻ nhóm ghi danh sách người được giao, ai đã xử lý */
.kb-grp { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; font-size: 12px; line-height: 1.4; }
.kb-gp { padding: 2px 8px; border-radius: 999px; background: rgba(105, 4, 242, .08); color: #4b0ab5; }
.kb-gp.done { background: rgba(11, 122, 117, .12); color: #0b5f5a; font-weight: 600; }
.kb-gp.closed { background: rgba(0, 0, 0, .05); color: #777; text-decoration: line-through; }
.db-auto.err { margin-bottom: 6px; }
