/* =====================================================================
   Văn phòng số NOC2 — giao diện
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-xs); }
.i { width: 18px; height: 18px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }

/* ---------- Khung ứng dụng ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-width: 0; outline: none; }

/* ---------- Thanh bên ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px 12px;
  overflow-y: auto;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-text strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.brand-text span { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.3; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500;
}
.nav-item:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav-item .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav-item[aria-current="page"] .count { color: var(--brand-ink); }
.nav-item .count.count-hot { color: #fff; background: var(--seal); border-radius: 999px; padding: 0 7px; line-height: 19px; }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px 21px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav-sub .nav-item { height: 32px; font-size: 13px; }
.side-label { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 20px 10px 8px; }
.nav-dept .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 0 3px var(--dc-soft); flex: none; margin: 0 4px; }
.nav-dept[aria-current="page"] { background: var(--dc-soft); color: var(--dc-ink); }
.nav-dept[aria-current="page"] .count { color: var(--dc-ink); }
.side-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.sample-note { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; line-height: 1.4; color: var(--warn); background: var(--warn-soft); border-radius: var(--r-sm); padding: 8px 10px; }
.sample-note .i { width: 14px; height: 14px; margin-top: 1px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.me-text { min-width: 0; line-height: 1.3; }
.me-text strong { display: block; font-size: 13px; font-weight: 600; }
.me-text span { display: block; font-size: 12px; color: var(--ink-3); }
.me .btn-icon { margin-left: auto; }

/* ---------- Thanh trên ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--top-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar .menu-btn { display: none; }
.search-btn {
  display: flex; align-items: center; gap: 10px;
  width: min(440px, 100%); height: 38px; padding: 0 8px 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink-3);
  text-align: left;
}
.search-btn:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line-2)); }
.search-btn span:not(.kbd) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-btn .kbd { flex: none; }
.kbd {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px;
  padding: 0 5px; line-height: 18px; background: var(--surface-2);
  font-family: var(--font-ui);
}
.top-spacer { flex: 1; }
.shift {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 6px; height: 38px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
.shift-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.shift-ic.night { background: var(--brand-soft); color: var(--brand-ink); }
.shift-ic .i { width: 16px; height: 16px; }
.shift b { color: var(--ink); font-weight: 600; }
.shift .clock { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 62px; }
.bell { position: relative; }
.bell .badge { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--seal); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--paper); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--ink) 25%, var(--line-2)); text-decoration: none; }
.btn .i { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--seal); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); border-color: transparent; color: var(--ink); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-icon {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: var(--r-sm);
  color: var(--ink-2);
}
.btn-icon:hover { background: var(--sunken); color: var(--ink); }
.btn-icon.sm { width: 32px; height: 32px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-split { display: inline-flex; }
.btn-split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 9px; border-left-color: color-mix(in srgb, var(--on-brand) 30%, var(--brand)); }

/* ---------- Thẻ nhỏ: phòng ban, dấu khẩn, mức độ, trạng thái, avatar ---------- */
.dtag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px 0 7px;
  border-radius: 999px; background: var(--dc-soft); color: var(--dc-ink);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.dtag i { width: 7px; height: 7px; border-radius: 50%; background: var(--dc); }
.dtag em { font-style: normal; font-weight: 500; opacity: .8; }
.dtag-bgd { background: var(--brand-soft); color: var(--brand-ink); padding: 0 8px; }

/* Dấu độ khẩn / độ mật: mô phỏng con dấu mực đỏ đóng trên văn bản giấy */
.stamp {
  display: inline-flex; align-items: center;
  font-family: var(--font-doc); font-weight: 700; font-size: 12px; line-height: 1.3;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: var(--seal);
  padding: 1px 7px 0;
  border: 1.5px solid currentColor; border-radius: 3px;
  outline: 1px solid currentColor; outline-offset: 2px;
  background: color-mix(in srgb, var(--seal) 5%, transparent);
  transform: rotate(-4deg);
  margin: 3px 4px;
}
.stamp-sec { transform: rotate(3deg); }
.stamp-sm { font-size: 10px; padding: 0 5px; outline-offset: 1.5px; border-width: 1.25px; margin: 2px 3px; }

.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.sev small { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.sev-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.sev-bars b { width: 3px; border-radius: 1px; background: var(--line-2); }
.sev-1 .sev-bars b.on { background: var(--sev-1); }
.sev-2 .sev-bars b.on { background: var(--sev-2); }
.sev-3 .sev-bars b.on { background: var(--sev-3); }
.sev-4 .sev-bars b.on { background: var(--sev-4); }

.st {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.st .i { width: 13px; height: 13px; }
.st-new { background: var(--brand-soft); color: var(--brand-ink); }
.st-wait { background: var(--warn-soft); color: var(--warn); }
.st-work { background: var(--surface); color: var(--brand-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, var(--line)); }
.st-done { background: var(--ok-soft); color: var(--ok); }
.st-draft { background: var(--sunken); color: var(--ink-2); }
.st-late { background: var(--seal-soft); color: var(--seal); }

.due { font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.due-ok { color: var(--ink-3); font-weight: 500; }
.due-soon { color: var(--warn); }
.due-late { color: var(--seal); }
.due-done { color: var(--ok); font-weight: 500; }

.av {
  --h: 210;
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 30%);
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
[data-theme="dark"] .av { background: hsl(var(--h) 35% 24%); color: hsl(var(--h) 70% 82%); }
.av-sm { width: 26px; height: 26px; font-size: 10.5px; }
.av-lg { width: 44px; height: 44px; font-size: 15px; }
.av-sys { background: var(--sunken); color: var(--ink-2); }
.av-sys .i { width: 15px; height: 15px; }

/* ---------- Khối nội dung ---------- */
.page { padding: 28px 32px 48px; max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { color: var(--ink-2); margin-top: 4px; max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.panel-head h2 { font-size: 15px; font-weight: 700; }
.panel-head .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.panel-body { padding: 0 18px 16px; }
.link-more { font-size: 13px; font-weight: 600; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty .i { width: 28px; height: 28px; color: var(--ink-3); margin-bottom: 8px; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---------- Tab ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 12px; color: var(--ink-2); font-weight: 600; white-space: nowrap;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.tab .count { font-size: 12px; color: var(--ink-3); font-weight: 600; background: var(--sunken); border-radius: 999px; padding: 0 7px; line-height: 19px; font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .count { background: var(--brand-soft); color: var(--brand-ink); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken); border-radius: var(--r-sm); }
.seg button, .seg label { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"], .seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg label { padding: 0; }
.seg label span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 5px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.seg .i { width: 15px; height: 15px; }

/* =====================================================================
   TỔNG QUAN
   ===================================================================== */
.greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 4px 0 24px; }
.greet-date { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: 6px; }
.greet h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; }
.greet-sum { margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 64ch; }
.greet-sum strong { color: var(--ink); font-weight: 600; }
.greet-sum a { font-weight: 600; }

.dash { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Vòng luồng văn bản */
.flow-panel { position: relative; overflow: hidden; }
.flow-wrap { position: relative; padding: 0 10px 6px; }
.flow-svg { display: block; width: 100%; height: auto; max-height: 560px; }
.flow-svg .ring { fill: none; stroke: var(--line); }
.flow-svg .ring-net { fill: none; stroke: var(--line-2); stroke-width: 1.25; stroke-dasharray: 2 6; stroke-linecap: round; }
.flow-svg .spoke { stroke: var(--dc); stroke-opacity: .32; stroke-linecap: round; transition: stroke-opacity .2s; }
.flow-svg .node circle.body { fill: var(--dc-soft); stroke: var(--dc); stroke-width: 2; transition: transform .2s; }
.flow-svg .node { cursor: pointer; }
.flow-svg .node:hover .spoke, .flow-svg .node:focus-visible .spoke { stroke-opacity: .8; }
.flow-svg .node:focus { outline: none; }
.flow-svg .node:focus-visible circle.body { stroke-width: 3.5; }
.flow-svg .node-count { font-family: var(--font-ui); font-size: 17px; font-weight: 700; fill: var(--ink); text-anchor: middle; dominant-baseline: central; font-variant-numeric: tabular-nums; }
.flow-svg .node-code { font-family: var(--font-ui); font-size: 14px; font-weight: 700; fill: var(--ink); }
.flow-svg .node-area { font-family: var(--font-ui); font-size: 12px; fill: var(--ink-3); }
.flow-svg .late-badge circle { fill: var(--seal); stroke: var(--surface); stroke-width: 2; }
.flow-svg .late-badge text { fill: #fff; font-size: 10.5px; font-weight: 700; text-anchor: middle; dominant-baseline: central; font-family: var(--font-ui); }
.flow-svg .hub-c { fill: var(--brand); }
.flow-svg .hub-halo { fill: var(--brand); opacity: .1; }
.flow-svg .hub-t1 { fill: var(--on-brand); font-family: var(--font-ui); font-size: 19px; font-weight: 800; text-anchor: middle; letter-spacing: .02em; }
.flow-svg .hub-t2 { fill: color-mix(in srgb, var(--on-brand) 82%, var(--brand)); font-family: var(--font-ui); font-size: 11px; font-weight: 500; text-anchor: middle; }
.flow-svg .packet { fill: var(--dc); stroke: var(--surface); stroke-width: 2; }
.flow-svg .packet.urgent { fill: var(--seal); }
.flow-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 18px 16px; font-size: 12.5px; color: var(--ink-2); }
.flow-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-2); }
.lg-dot.red { background: var(--seal); }
.lg-line { width: 22px; height: 0; border-top: 4px solid var(--line-2); border-radius: 2px; }
.flow-tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-sm); padding: 8px 10px; font-size: 12.5px; line-height: 1.45;
  box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
  white-space: nowrap;
}
.flow-tip.on { opacity: 1; transform: none; }
.flow-tip b { font-weight: 700; }

/* Danh sách việc cần xử lý */
.tasks { list-style: none; margin: 0; padding: 0 8px 8px; }
.task { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 10px; border-radius: var(--r-md); color: inherit; }
.task:hover { background: var(--surface-2); text-decoration: none; }
.task + .task { border-top: 1px solid var(--line); }
.task:hover + .task { border-top-color: transparent; }
.task-no { font-family: var(--font-doc); font-weight: 700; font-size: 14px; color: var(--ink); display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }
.task-title { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task .due { align-self: center; }

.inc-mini { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 11px 10px; border-radius: var(--r-md); color: inherit; }
.inc-mini:hover { background: var(--surface-2); text-decoration: none; }
.inc-mini + .inc-mini { border-top: 1px solid var(--line); }
.inc-mini .t { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inc-mini .m { grid-column: 2; font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; align-items: center; }
.inc-mini .sev { grid-row: 1 / span 2; }
.inc-mini .timer { grid-row: 1 / span 2; grid-column: 3; }
.timer { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.timer .i { width: 14px; height: 14px; color: var(--ink-3); }
.timer.hot { color: var(--seal); }
.timer.hot .i { color: var(--seal); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--seal); flex: none; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--seal); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }

/* Dải phòng ban */
.dept-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ds-col { padding: 16px 18px 18px; border-left: 1px solid var(--line); color: inherit; position: relative; }
.ds-col:first-child { border-left: 0; }
.ds-col::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--dc); }
.ds-col:hover { background: var(--surface-2); text-decoration: none; }
.ds-col:first-child:hover { border-bottom-left-radius: var(--r-lg); border-top-left-radius: var(--r-lg); }
.ds-col:last-child:hover { border-bottom-right-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.ds-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ds-head .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--dc-soft); color: var(--dc-ink); }
.ds-head .ic .i { width: 16px; height: 16px; }
.ds-head strong { font-size: 14px; font-weight: 700; display: block; line-height: 1.2; }
.ds-head span { font-size: 11.5px; color: var(--ink-3); display: block; line-height: 1.2; }
.ds-rows { display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.ds-rows div { display: flex; justify-content: space-between; gap: 8px; }
.ds-rows b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ds-rows .late b { color: var(--seal); }
.meter { display: flex; gap: 2px; height: 6px; margin-top: 12px; }
.meter i { border-radius: 3px; background: var(--dc); min-width: 2px; }
.meter i + i { background: var(--sunken); }
.meter-cap { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }

/* Bảng tin hoạt động */
.feed { list-style: none; margin: 0; padding: 0 18px 12px; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 9px 0; }
.feed li + li { border-top: 1px dashed var(--line); }
.feed p { font-size: 13px; color: var(--ink-2); }
.feed p b { color: var(--ink); font-weight: 600; }
.feed time { font-size: 12px; color: var(--ink-3); }

.recent { width: 100%; border-collapse: collapse; }
.recent td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.recent tr:first-child td { border-top: 0; }
.recent tr { cursor: pointer; }
.recent tr:hover td { background: var(--surface-2); }
.recent td:first-child { padding-left: 18px; }
.recent td:last-child { padding-right: 18px; text-align: right; white-space: nowrap; }
.recent .so { font-family: var(--font-doc); font-weight: 700; font-size: 14px; white-space: nowrap; }
.recent .tt { color: var(--ink-2); max-width: 0; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =====================================================================
   CÔNG VĂN — danh sách + khung đọc
   ===================================================================== */
.cv { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); height: calc(100vh - var(--top-h)); }
.cv-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.cv-list-head { padding: 18px 18px 0; }
.cv-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.cv-title h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.cv-tools { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px 0 11px; border-radius: 999px;
  border: 1px dashed var(--line-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; background: var(--surface);
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip .i { width: 14px; height: 14px; }
.chip.on { border-style: solid; border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); background: var(--brand-soft); color: var(--brand-ink); }
.chip-x { margin-left: 2px; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; }
.chip-x:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.cv-search { position: relative; flex: 1 1 160px; min-width: 140px; }
.cv-search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }
.cv-search input { width: 100%; height: 30px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 0 12px 0 31px; font-size: 13px; }
.cv-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); background: var(--surface); }
.list-count { padding: 8px 18px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.doc-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.doc-row {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 13px 18px 13px 22px; border-bottom: 1px solid var(--line);
  color: inherit; cursor: pointer;
}
.doc-row::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--dc); opacity: .9; }
.doc-row:hover { background: var(--surface-2); }
.doc-row[aria-selected="true"] { background: color-mix(in srgb, var(--brand-soft) 70%, var(--surface)); }
.doc-row[aria-selected="true"]::after { content: ""; position: absolute; inset: 0; box-shadow: inset -3px 0 0 var(--brand); pointer-events: none; }
.doc-row:focus-visible { outline-offset: -2px; border-radius: 0; }
.dr-1 { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.dr-no { font-family: var(--font-doc); font-weight: 700; font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-den { font-size: 11.5px; font-weight: 600; color: var(--ink-3); background: var(--sunken); border-radius: 4px; padding: 0 5px; line-height: 18px; font-variant-numeric: tabular-nums; flex: none; }
.dr-time { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
.dr-title { margin: 3px 0 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-row.unread .dr-title { color: var(--ink); font-weight: 600; }
.doc-row.unread .dr-no::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 7px; vertical-align: middle; }
.dr-3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.dr-3 .from { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.dr-3 .due, .dr-3 .st { margin-left: auto; }

.reader { min-width: 0; overflow-y: auto; background: var(--paper); position: relative; }
.reader-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--ink-2); padding: 40px; }
.reader-empty .art { width: 180px; margin: 0 auto 18px; }
.reader-empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.reader-bar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 28px; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.reader-bar .back { display: none; }
.reader-bar .grow { flex: 1; }
.reader-in { padding: 24px 28px 60px; max-width: 980px; margin: 0 auto; }
.dh-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.dh-type { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-right: 4px; }
.dh-no { font-family: var(--font-doc); font-size: 30px; font-weight: 700; letter-spacing: -0.005em; line-height: 1.15; color: var(--ink); }
.dh-no.none { color: var(--ink-3); font-style: italic; font-weight: 400; }
.dh-title { font-size: 20px; font-weight: 600; line-height: 1.4; margin-top: 8px; max-width: 62ch; letter-spacing: -0.01em; }
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 24px; margin: 22px 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.meta dt { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.meta dd { margin: 0; font-weight: 600; font-size: 13.5px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.meta dd.n { font-variant-numeric: tabular-nums; }

/* Thanh tiến trình luồng xử lý — các bước có thứ tự thật nên được đánh số */
.steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: s; }
.steps li { position: relative; padding-top: 34px; text-align: center; font-size: 12.5px; color: var(--ink-3); counter-increment: s; }
.steps li::before {
  content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line-2); font-weight: 700; font-size: 12px; color: var(--ink-3); z-index: 1;
}
.steps li::after { content: ""; position: absolute; top: 12px; left: calc(-50% + 17px); right: calc(50% + 17px); height: 2px; background: var(--line-2); border-radius: 2px; }
.steps li:first-child::after { display: none; }
.steps li b { display: block; font-weight: 600; color: var(--ink-2); font-size: 13px; }
.steps li.done::before { content: "✓"; background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.steps li.done::after, .steps li.cur::after { background: var(--brand); }
.steps li.cur::before { border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 4px var(--brand-soft); }
.steps li.cur b { color: var(--ink); }
.steps li.done b { color: var(--ink); }

.subtabs { margin-bottom: 18px; }

/* Văn bản giấy — trình bày theo thể thức văn bản hành chính */
.paper {
  position: relative;
  max-width: 780px; margin: 0 auto;
  background: var(--doc-paper); color: var(--doc-ink);
  font-family: var(--font-doc); font-size: 15.5px; line-height: 1.5;
  padding: 46px 58px 54px;
  border-radius: 2px;
  box-shadow: var(--shadow-paper);
}
.paper::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 96%, rgb(0 0 0 / .025)); }
.ph { display: grid; grid-template-columns: 1fr 1.25fr; gap: 18px; text-align: center; font-size: 13px; line-height: 1.35; }
.ph-org span { display: block; text-transform: uppercase; }
.ph-org b { display: block; text-transform: uppercase; }
.ph-nat b { display: block; text-transform: uppercase; font-size: 13px; }
.ph-nat strong { display: block; font-size: 14.5px; font-weight: 700; }
.ph .rule { display: block; width: 36%; height: 1px; background: currentColor; margin: 3px auto 0; }
.ph-nat .rule { width: 58%; }
.ph-no { margin-top: 10px; font-size: 14px; }
.ph-vv { font-size: 13px; margin: 4px auto 0; max-width: 32ch; }
.ph-date { margin-top: 10px; font-style: italic; font-size: 14.5px; }
.ph-stamps { margin-top: 8px; display: flex; justify-content: center; gap: 6px; }
.ph-stamps .stamp { font-size: 13px; }
.p-title { text-align: center; font-weight: 700; text-transform: uppercase; margin-top: 26px; font-size: 16px; }
.p-title + .p-sub { text-align: center; font-weight: 700; font-size: 15px; margin-top: 2px; }
.p-to { text-align: center; margin: 24px 0 14px; }
.p-body p { text-indent: 2.2em; text-align: justify; margin: 0 0 9px; hyphens: auto; }
.pf { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 26px; align-items: start; }
.p-recv { font-size: 12.5px; line-height: 1.45; }
.p-recv b { font-style: italic; font-size: 13.5px; display: block; }
.p-recv div::before { content: "- "; }
.p-sign { text-align: center; font-weight: 700; font-size: 14.5px; }
.p-sign span { display: block; text-transform: uppercase; }
.esign {
  display: inline-block; text-align: left; margin: 12px auto 12px;
  border: 1.5px solid var(--esign); color: var(--esign); border-radius: 3px;
  padding: 6px 10px 6px 30px; position: relative;
  font-family: var(--font-ui); font-size: 11px; line-height: 1.45; font-weight: 500;
  background: color-mix(in srgb, var(--esign) 6%, transparent);
}
.esign .i { position: absolute; left: 8px; top: 8px; width: 15px; height: 15px; }
.esign.pending { border-style: dashed; color: #6b7280; border-color: #9aa3b2; background: none; }
.p-sign .name { text-transform: none; font-size: 15px; }
.paper-note { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 12px; }

/* Dòng thời gian luân chuyển */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .av { box-shadow: 0 0 0 4px var(--paper); position: relative; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; }
.tl-head strong { font-weight: 600; }
.tl-head time { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-act { color: var(--ink-2); margin-top: -2px; }
.tl-note { margin-top: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink-2); font-size: 13.5px; }

.files { display: grid; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.file-ext { width: 38px; height: 44px; flex: none; position: relative; background: var(--sunken); border-radius: 4px 9px 4px 4px; display: grid; place-items: end center; padding-bottom: 5px; font-size: 9.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .03em; }
.file-ext::before { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 10px 10px 0; border-color: transparent var(--line-2) transparent transparent; border-top-right-radius: 4px; }
.file-row .nm { font-weight: 600; font-size: 13.5px; word-break: break-word; }
.file-row .sz { font-size: 12px; color: var(--ink-3); }
.file-row .btn-icon { margin-left: auto; }

.comments { display: grid; gap: 14px; }
.cmt { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.cmt-b { background: var(--surface); border: 1px solid var(--line); border-radius: 4px var(--r-lg) var(--r-lg) var(--r-lg); padding: 10px 14px; }
.cmt-b header { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.cmt-b header strong { font-weight: 600; font-size: 13px; }
.cmt-b header time { font-size: 12px; color: var(--ink-3); }
.cmt-b p { color: var(--ink-2); font-size: 13.5px; }
.cmt-form { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; margin-top: 4px; }
.cmt-form textarea { min-height: 76px; }
.cmt-form .row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; font-size: 12px; color: var(--ink-3); }

/* =====================================================================
   SỰ VỤ ĐIỆN
   ===================================================================== */
.board { display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--sunken); border-radius: var(--r-lg); padding: 10px; min-height: 240px; transition: background-color .15s, box-shadow .15s; }
.col.drop { background: var(--brand-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-size: 13.5px; }
.col-head .count { font-size: 12px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.col-head .hint { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.col-body { display: grid; gap: 8px; }
.inc {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 12px 11px; box-shadow: var(--shadow-1); cursor: grab; color: inherit; position: relative;
}
.inc:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.inc.dragging { opacity: .45; }
.inc.s1 { box-shadow: inset 3px 0 0 var(--sev-1), var(--shadow-1); }
.inc.s2 { box-shadow: inset 3px 0 0 var(--sev-2), var(--shadow-1); }
.inc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inc-id { font-size: 12px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.inc-title { font-weight: 600; font-size: 14px; line-height: 1.4; margin: 6px 0 6px; }
.inc-area { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-3); }
.inc-area .i { width: 13px; height: 13px; }
.inc-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.inc-foot .timer { margin-left: auto; font-size: 12.5px; }
.inc-foot .upd { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--ink-3); }
.inc-foot .upd .i { width: 13px; height: 13px; }
.inc-list { width: 100%; border-collapse: collapse; }
.inc-list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.inc-list td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.inc-list tr.r { cursor: pointer; }
.inc-list tr.r:hover td { background: var(--surface-2); }
.inc-list .t { font-weight: 600; }

.incd-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.incd-head .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.incd-head h2 { font-size: 20px; font-weight: 700; line-height: 1.35; margin: 10px 0 0; letter-spacing: -0.015em; }
.incd-clock { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.incd-clock .big { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.incd-clock .big.hot { color: var(--seal); }
.incd-clock span { font-size: 12.5px; color: var(--ink-3); }
.incd-body { padding: 18px 24px 28px; display: grid; gap: 22px; }
.incd-body h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.svc { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 6px; background: var(--sunken); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.notice .no { font-family: var(--font-doc); font-weight: 700; font-size: 15px; }
.notice .to { font-size: 12.5px; color: var(--ink-2); }
.notice time { margin-left: auto; font-size: 12px; color: var(--ink-3); }

/* =====================================================================
   SỔ VĂN THƯ
   ===================================================================== */
.vt { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; align-items: start; }
.ledger-wrap { overflow-x: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.ledger { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.ledger th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 10px 12px; background: var(--surface-2); border-bottom: 3px double var(--line-2); white-space: nowrap; }
.ledger td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger th + th, .ledger td + td { border-left: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
/* lề đỏ kép như sổ đăng ký giấy */
.ledger .no { border-right: 3px double color-mix(in srgb, var(--seal) 45%, transparent); text-align: right; font-family: var(--font-doc); font-weight: 700; font-size: 15px; width: 64px; font-variant-numeric: tabular-nums; }
.ledger th.no { font-family: var(--font-ui); font-size: 12px; }
.ledger .so { font-family: var(--font-doc); font-weight: 700; font-size: 14px; white-space: nowrap; }
.ledger .dt { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ledger .tt { min-width: 220px; }
.ledger .from { min-width: 110px; max-width: 150px; }
.ledger .sub { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.ledger .sub .stamp { margin-left: 0; }
.ledger .sub.sig { color: var(--ink-2); }
.ledger tr.r { cursor: pointer; }
.ledger tr.r:hover td { background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }
.ledger tr.fresh td { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); } to { background: transparent; } }
.ledger .sig { font-family: var(--font-doc); font-style: italic; color: var(--ink-2); white-space: nowrap; }

.issue { padding: 18px; }
.issue h2 { font-size: 15px; font-weight: 700; }
.issue > p { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.issue-no { margin: 18px 0 16px; padding: 18px 16px; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-md); text-align: center; }
.issue-no small { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.issue-no .big { font-family: var(--font-doc); font-weight: 700; font-size: 30px; white-space: nowrap; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.issue-no .big em { font-style: normal; color: var(--dc-ink); }
.issue .field + .field { margin-top: 12px; }
.issue .btn-primary { width: 100%; margin-top: 16px; }
.issue-hist { border-top: 1px solid var(--line); padding: 14px 18px; }
.issue-hist h3 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.issue-hist li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; font-size: 12.5px; color: var(--ink-2); }
.issue-hist li b { font-family: var(--font-doc); font-size: 14px; color: var(--ink); white-space: nowrap; }
.issue-hist ul { list-style: none; margin: 0; padding: 0; }

/* =====================================================================
   KHO LƯU TRỮ
   ===================================================================== */
.kho { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.facets { position: sticky; top: calc(var(--top-h) + 20px); display: grid; gap: 18px; }
.facet h3 { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; padding: 0 8px; }
.facet button { display: flex; align-items: center; gap: 9px; width: 100%; height: 32px; padding: 0 8px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); text-align: left; }
.facet button:hover { background: var(--sunken); color: var(--ink); }
.facet button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.facet button .c { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.facet button .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); }
.facet button .i { width: 15px; height: 15px; color: var(--ink-3); }
.kho-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs .i { width: 14px; height: 14px; }
.dropzone {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; margin-bottom: 18px;
  border: 1.5px dashed var(--line-2); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink-2); font-size: 13.5px;
  transition: border-color .15s, background-color .15s;
}
.dropzone .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.dropzone strong { color: var(--ink); display: block; }
.dropzone .btn { margin-left: auto; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }
.ftile { display: flex; flex-direction: column; text-align: left; color: inherit; border-radius: var(--r-md); padding: 8px; margin: -8px; }
.ftile:hover { background: var(--surface); box-shadow: var(--shadow-2); }
.thumb { position: relative; aspect-ratio: 4 / 4.6; border-radius: var(--r-md); background: var(--sunken); display: grid; place-items: center; overflow: hidden; }
.thumb .pg {
  width: 62%; height: 78%; background: var(--doc-paper); border-radius: 2px;
  box-shadow: 0 1px 2px rgb(15 27 52 / .1), 0 8px 18px -10px rgb(15 27 52 / .35);
  position: relative; padding: 14% 12% 0;
  clip-path: polygon(0 0, 80% 0, 100% 14%, 100% 100%, 0 100%);
}
.thumb .pg::after { content: ""; position: absolute; top: 0; right: 0; width: 20%; height: 14%; background: linear-gradient(225deg, transparent 50%, #d9dee8 50%); }
.thumb .pg i { display: block; height: 3px; border-radius: 2px; background: #dfe4ec; margin-bottom: 6%; }
.thumb .pg i:first-child { width: 55%; margin: 0 auto 10%; background: #c9d0dc; }
.thumb .pg i:nth-child(3n) { width: 70%; }
.thumb.scan .pg { filter: grayscale(.3) contrast(.95); transform: rotate(-1.5deg); }
.thumb .ext { position: absolute; left: 10px; bottom: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 4px; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-1); }
.thumb .dd { position: absolute; right: 10px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 0 2px var(--surface); }
.ftile .nm { font-weight: 600; font-size: 13px; line-height: 1.4; margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ftile .mt { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.file-table { width: 100%; border-collapse: collapse; }
.file-table td, .file-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; text-align: left; }
.file-table th { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.file-table tr.r { cursor: pointer; }
.file-table tr.r:hover td { background: var(--surface-2); }

/* =====================================================================
   PHÒNG BAN
   ===================================================================== */
.dhero { position: relative; overflow: hidden; border-radius: var(--r-xl); background: var(--dc-soft); padding: 30px 32px 26px; margin-bottom: 22px; }
/* sóng tín hiệu lan từ góc phải, cùng màu phòng */
.dhero::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 60%); pointer-events: none;
  background: repeating-radial-gradient(circle at 100% 0%, transparent 0 34px, color-mix(in srgb, var(--dc) 28%, transparent) 34px 35.5px);
  -webkit-mask-image: linear-gradient(to left, #000 20%, transparent 95%); mask-image: linear-gradient(to left, #000 20%, transparent 95%);
}
.dhero-code { font-size: 64px; font-weight: 800; letter-spacing: -0.04em; line-height: .95; color: var(--dc-ink); display: flex; align-items: center; gap: 16px; }
.dhero-code .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--dc); color: #fff; display: grid; place-items: center; }
.dhero-code .ic .i { width: 26px; height: 26px; }
.dhero h1 { font-size: 20px; font-weight: 700; margin-top: 12px; }
.dhero p { color: var(--ink-2); margin-top: 2px; }
.dstats { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 22px; position: relative; z-index: 1; }
.dstats div { display: flex; flex-direction: column; }
.dstats b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.dstats span { font-size: 12.5px; color: var(--ink-2); }
.dstats .late b { color: var(--seal); }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 16px 18px 18px; }
.member { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.member strong { display: block; font-size: 13.5px; font-weight: 600; }
.member span { font-size: 12px; color: var(--ink-3); }
.mini-list .doc-row { border-radius: 0; }
.mini-list .doc-row:last-child { border-bottom: 0; }

/* =====================================================================
   HỘP THOẠI, POPOVER, BẢNG LỆNH, TOAST
   ===================================================================== */
.scrim { position: fixed; inset: 0; z-index: 100; background: rgb(9 16 32 / .38); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .18s; }
[data-theme="dark"] .scrim { background: rgb(0 0 0 / .55); }
.scrim.in { opacity: 1; }
.dialog { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; transform: translateY(8px) scale(.985); transition: transform .18s; border: 1px solid var(--line); }
.scrim.in .dialog { transform: none; }
.dialog-lg { width: min(860px, 100%); }
.dialog-xl { width: min(1080px, 100%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 17px; font-weight: 700; }
.dialog-body { padding: 20px 24px; overflow-y: auto; }
.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid var(--line); }
.dialog-foot .left { margin-right: auto; font-size: 12.5px; color: var(--ink-3); }
.scrim-drawer { place-items: stretch end; padding: 0; }
.dialog-drawer { width: min(620px, 100vw); height: 100vh; max-height: 100vh; border-radius: var(--r-xl) 0 0 var(--r-xl); transform: translateX(24px); border-right: 0; }
.dialog-drawer .dialog-body { padding: 0; }
.scrim-palette { place-items: start center; padding-top: 12vh; }
.dialog-palette { width: min(660px, 100%); overflow: hidden; }
.dialog-palette .dialog-body { padding: 0; }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.pal-in .i { width: 20px; height: 20px; color: var(--ink-3); }
.pal-in input { flex: 1; height: 58px; border: 0; background: none; font-size: 17px; }
.pal-res { max-height: 420px; overflow-y: auto; padding: 8px; }
.pal-group { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 10px 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink); }
.pal-item[aria-selected="true"] { background: var(--brand-soft); }
.pal-item .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--sunken); color: var(--ink-2); flex: none; }
.pal-item .ic .i { width: 16px; height: 16px; }
.pal-item .tx { min-width: 0; flex: 1; }
.pal-item .tx b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .tx b.doc { font-family: var(--font-doc); font-size: 15px; }
.pal-item .tx span { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item mark { background: color-mix(in srgb, var(--warn) 25%, transparent); color: inherit; border-radius: 2px; }
.pal-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); background: var(--surface-2); flex-wrap: wrap; }
.pal-foot span { display: inline-flex; gap: 6px; align-items: center; }

.popover { position: fixed; z-index: 90; min-width: 240px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 6px; opacity: 0; transform: translateY(-4px); transition: opacity .12s, transform .12s; }
.popover.in { opacity: 1; transform: none; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); text-align: left; font-size: 13.5px; color: var(--ink); }
.menu-item:hover, .menu-item:focus-visible { background: var(--sunken); text-decoration: none; outline: none; }
.menu-item .i { color: var(--ink-3); }
.menu-item .tx { flex: 1; }
.menu-item .tx span { display: block; font-size: 12px; color: var(--ink-3); }
.menu-item .kbd { margin-left: auto; }
.menu-item[aria-checked="true"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: auto; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-check { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; }
.menu-check:hover { background: var(--sunken); }
.menu-check input { accent-color: var(--brand); width: 15px; height: 15px; margin: 0; }
.notif { width: 380px; padding: 0; }
.notif header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif header h3 { font-size: 14px; font-weight: 700; }
.notif ul { list-style: none; margin: 0; padding: 6px; max-height: 420px; overflow-y: auto; }
.notif a { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 9px 8px; border-radius: var(--r-sm); color: var(--ink); }
.notif a:hover { background: var(--sunken); text-decoration: none; }
.notif .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); color: var(--ink-2); }
.notif .ic.alert { background: var(--seal-soft); color: var(--seal); }
.notif .ic .i { width: 16px; height: 16px; }
.notif p { font-size: 13px; line-height: 1.45; }
.notif a.unread p { font-weight: 600; }
.notif time { font-size: 12px; color: var(--ink-3); }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--paper); padding: 11px 16px 11px 13px; border-radius: var(--r-md); box-shadow: var(--shadow-pop); font-size: 13.5px; font-weight: 500; animation: toastIn .22s ease-out; max-width: min(520px, calc(100vw - 32px)); }
.toast .i { color: #6EE7A0; }
[data-theme="dark"] .toast .i { color: var(--ok); }
.toast-warn .i { color: #FFB4A8; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Biểu mẫu ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .field .lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.field .req { color: var(--seal); }
.input, .field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="date"], .field input[type="datetime-local"], .field select, .field textarea, textarea.input {
  width: 100%; min-height: 38px; padding: 8px 11px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea, textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, textarea.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.field input.mono-doc { font-family: var(--font-doc); font-size: 15px; font-weight: 700; }
.field.invalid input, .field.invalid textarea { border-color: var(--seal); }
.field .err { display: none; font-size: 12px; color: var(--seal); margin-top: 5px; }
.field.invalid .err { display: block; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--surface); }
.pick button i { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); }
.pick button[aria-pressed="true"] { background: var(--dc-soft); border-color: var(--dc); color: var(--dc-ink); }
.pick button:disabled { opacity: .4; cursor: not-allowed; }
.seg-urg input:checked + span.u-hot { color: var(--seal); }
.sev-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sev-pick label { cursor: pointer; position: relative; }
.sev-pick input { position: absolute; opacity: 0; }
.sev-pick label > span { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--r-md); font-size: 12px; color: var(--ink-3); }
.sev-pick label > span .sev { font-size: 13px; }
.sev-pick input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface-2); }
.sev-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.drop-in { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 22px; text-align: center; color: var(--ink-2); font-size: 13px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop-in.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-in .ic { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); }
.drop-in strong { color: var(--ink); display: block; margin-bottom: 2px; }
.drop-file { display: flex; align-items: center; gap: 10px; text-align: left; }
.drop-file .nm { font-weight: 600; color: var(--ink); word-break: break-word; }
.reading { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--brand-ink); margin-top: 10px; justify-content: center; }
.reading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.prefilled { animation: prefill 1.6s ease-out; }
@keyframes prefill { from { background: color-mix(in srgb, var(--warn) 22%, var(--surface)); } }
.keys { display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; font-size: 13.5px; }
.keys dt { color: var(--ink-2); }
.keys dd { margin: 0; display: flex; gap: 4px; justify-content: flex-end; }

.side-scrim { display: none; }

/* =====================================================================
   ĐÁP ỨNG MÀN HÌNH
   ===================================================================== */
@media (max-width: 1280px) {
  .dept-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ds-col:nth-child(4) { border-left: 0; }
  .ds-col:nth-child(n+4) { border-top: 1px solid var(--line); }
  .ds-col:hover { border-radius: 0 !important; }
}
@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .vt { grid-template-columns: minmax(0, 1fr); }
  .cv { grid-template-columns: minmax(0, 1fr); }
  .reader { position: fixed; inset: 0; z-index: 60; transform: translateX(100%); transition: transform .22s ease; visibility: hidden; }
  .cv.has-sel .reader { transform: none; visibility: visible; }
  .reader-bar .back { display: inline-grid; }
  .shift .lbl { display: none; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-pop); z-index: 80; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgb(9 16 32 / .35); }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 0 12px; gap: 6px; }
  .shift { display: none; }
  .kho { grid-template-columns: minmax(0, 1fr); }
  .facets { position: static; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .board { grid-template-columns: repeat(4, minmax(270px, 84vw)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .col { scroll-snap-align: start; }
}
@media (max-width: 720px) {
  .page { padding: 20px 16px 40px; }
  .greet h1 { font-size: 27px; }
  .greet-sum { font-size: 15px; }
  .dept-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-col:nth-child(4) { border-left: 1px solid var(--line); }
  .ds-col:nth-child(odd) { border-left: 0; }
  .ds-col:nth-child(n+3) { border-top: 1px solid var(--line); }
  .search-btn span, .search-btn .kbd { display: none; }
  .search-btn { width: 38px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .new-label { display: none; }
  .reader-bar { padding: 10px 16px; }
  .reader-in { padding: 18px 16px 48px; }
  .dh-no { font-size: 24px; }
  .dh-title { font-size: 17px; }
  .paper { padding: 26px 18px 32px; font-size: 14px; }
  .ph { grid-template-columns: 1fr; gap: 10px; }
  .pf { grid-template-columns: 1fr; }
  .p-recv { order: 2; }
  .steps li { font-size: 11px; }
  .steps li b { font-size: 11.5px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .sev-pick { grid-template-columns: repeat(2, 1fr); }
  .dialog-body { padding: 16px; }
  .dialog-head { padding: 14px 14px 12px 16px; }
  .dialog-foot { padding: 12px 16px 14px; flex-wrap: wrap; }
  .dialog-foot .left { width: 100%; }
  .scrim { padding: 10px; }
  .dhero { padding: 22px 20px; }
  .dhero-code { font-size: 44px; }
  .dhero-code .ic { width: 40px; height: 40px; border-radius: 12px; }
  .dstats { gap: 20px; }
  .dropzone { flex-wrap: wrap; }
  .dropzone .btn { margin-left: 0; }
  .notif { width: calc(100vw - 24px); }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .incd-head, .incd-body { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  .sidebar, .topbar, .reader-bar, .cv-list, .subtabs, .meta, .steps, .dh-top, .dh-no, .dh-title, .toasts { display: none !important; }
  .app, .cv { display: block; height: auto; }
  .reader { position: static; overflow: visible; background: #fff; }
  .paper { box-shadow: none; max-width: none; padding: 0; }
  body { background: #fff; }
}

/* =====================================================================
   ĐĂNG NHẬP
   ===================================================================== */
.app[hidden] { display: none; }
/* Bố cục: trái là bảng điều độ (vòng các phòng quanh Trung tâm), phải là biểu mẫu */
.auth { --side: #0A1F4D; --side-2: #10306F; --side-ink: #E8EEFB; --side-ink-2: #A9B8DA; --side-line: rgb(255 255 255 / .12);
  min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); background: var(--paper); }
.auth-solo { grid-template-columns: 1fr; }
.auth-side { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 8px; padding: 32px 48px 26px;
  color: var(--side-ink); background:
    radial-gradient(circle at 50% 46%, rgb(79 134 247 / .22), transparent 58%),
    linear-gradient(160deg, var(--side-2), var(--side) 62%); }
/* lưới chấm mờ như màn hình giám sát */
.auth-side::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgb(255 255 255 / .09) 1px, transparent 1.2px); background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 75%); }
.auth-side > * { position: relative; }
.auth-side::before { position: absolute; }
.as-brand { display: flex; align-items: center; gap: 12px; }
.as-brand .brand-mark { width: 40px; height: 40px; }
.as-brand strong { display: block; font-size: 15.5px; font-weight: 700; color: #fff; }
.as-brand span { display: block; font-size: 12.5px; color: var(--side-ink-2); }
.as-stage { position: relative; min-height: 180px; margin: 8px 0 16px; }
/* Hình co giãn vừa khung còn trống, không bao giờ đè lên chữ bên dưới */
.orbit { position: absolute; inset: 0; width: 100%; height: 100%; max-height: 520px; margin: auto; }
.orb-ring { fill: none; stroke: rgb(255 255 255 / .16); stroke-width: 1; stroke-dasharray: 2 6; }
.orb-ring-in { stroke-dasharray: none; stroke: rgb(255 255 255 / .08); }
.orb-spokes line { stroke: rgb(255 255 255 / .10); stroke-width: 1; }
.orb-node .orb-dot { fill: var(--dc); stroke: var(--side); stroke-width: 4; }
.orb-node .orb-halo { fill: var(--dc); opacity: 0; transform-box: fill-box; transform-origin: center; }
.orb-node.hit .orb-halo { animation: orb-hit 1.1s ease-out; }
.orb-label { fill: var(--side-ink); font: 600 13px var(--font-ui); letter-spacing: .01em; }
.orb-node, .orb-label { transition: opacity .2s; }
.orbit.has-focus .orb-node:not(.focus), .orbit.has-focus .orb-label:not(.focus) { opacity: .28; }
.orb-node.focus .orb-dot { stroke: #fff; stroke-width: 3; }
.orb-core { fill: #fff; filter: drop-shadow(0 6px 18px rgb(0 0 0 / .35)); }
.orb-core-t { fill: #0A1F4D; font: 700 19px var(--font-doc); letter-spacing: .02em; }
.orb-pkt { fill: #fff; opacity: 0; filter: drop-shadow(0 0 6px rgb(255 255 255 / .8)); }
/* Một lần mở đầu: các phòng hiện dần quanh Trung tâm */
.orb-node, .orb-label { animation: orb-in .6s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(.25s + var(--i) * .09s); }
.orb-node { transform-box: fill-box; }
.no-intro .orb-node, .no-intro .orb-label, .no-intro .as-copy { animation: none; }
@keyframes orb-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes orb-hit { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }
.as-copy { max-width: 560px; animation: orb-in .7s .15s backwards; }
.as-copy h2 { font: 700 clamp(26px, 2.4vw, 34px)/1.22 var(--font-doc); color: #fff; letter-spacing: -.005em; text-wrap: balance; }
.as-copy p { margin-top: 12px; font-size: 14.5px; line-height: 1.6; color: var(--side-ink-2); max-width: 44ch; }
.as-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--side-line); font-size: 12.5px; color: var(--side-ink-2); }
.as-shift { display: inline-flex; align-items: center; gap: 7px; }
.as-shift svg { width: 15px; height: 15px; }
.as-shift b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 4px; }

.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 24px; }
.auth-pane { width: min(380px, 100%); }
.auth-pane.auth-wide { width: min(460px, 100%); }
.auth h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; color: var(--ink); }
.auth-sub { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin-bottom: 22px; }
.auth form { display: grid; gap: 16px; }
.auth .field input, .auth .field select { min-height: 46px; font-size: 15px; border-radius: var(--r-md); background: var(--surface); }
.lbl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.lbl-row label { margin-bottom: 0 !important; }
.lbl-link { font-size: 12.5px; font-weight: 600; color: var(--brand-ink); }
.lbl-link:hover { text-decoration: underline; }
.lbl-note { font-size: 12px; color: var(--ink-3); }
.pw { position: relative; }
.pw input { padding-right: 46px !important; }
.pw-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--ink-3); }
.pw-eye:hover { background: var(--sunken); color: var(--ink); }
.pw-eye.on { color: var(--brand-ink); }
.pw-eye svg { width: 18px; height: 18px; }
.caps[hidden] { display: none; }
.caps { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--warn); }
.caps svg { width: 14px; height: 14px; }
.auth-btn { width: 100%; height: 46px; font-size: 15px; border-radius: var(--r-md); }
.auth-btn.is-busy::before { content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.auth-msg { font-size: 13px; margin: -4px 0 0; }
.auth-msg:empty { display: none; }
.auth-msg.err { color: var(--seal); }
.auth-msg.ok { color: var(--ok); }
.auth-alt { margin-top: 18px; font-size: 13.5px; color: var(--ink-2); text-align: center; }
.auth-alt button { font-weight: 600; color: var(--brand-ink); }
.auth-alt button:hover { text-decoration: underline; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 18px -6px; padding: 4px 8px 4px 4px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.auth-back:hover { background: var(--sunken); color: var(--ink); }
.auth-back svg { width: 16px; height: 16px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; align-items: center; }
.auth-links button { color: var(--brand-ink); font-weight: 600; }
.auth-links button:hover { text-decoration: underline; }
.auth-foot { font-size: 12px; color: var(--ink-3); text-align: center; }

/* Ô dùng thử: lối vào phụ, nổi bật vừa đủ để người mới thấy */
.demo-tile { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 28px; padding: 14px 16px; text-align: left;
  border: 1px dashed color-mix(in srgb, var(--brand) 45%, var(--line-2)); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); color: var(--ink); transition: border-color .15s, background .15s, transform .15s; }
.demo-tile:hover { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.demo-tile:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dt-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--brand); color: var(--on-brand); }
.dt-ic svg { width: 19px; height: 19px; }
.dt-tx b { display: block; font-size: 14.5px; font-weight: 600; }
.dt-tx small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.dt-go { flex: none; margin-left: auto; color: var(--brand-ink); transition: transform .15s; }
.dt-go svg { width: 18px; height: 18px; }
.demo-tile:hover .dt-go { transform: translateX(3px); }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-side { position: relative; height: auto; grid-template-rows: auto auto; gap: 18px; padding: 22px 20px 24px; }
  .as-stage, .as-foot { display: none; }
  .as-copy h2 { font-size: 23px; }
  .as-copy p { font-size: 13.5px; margin-top: 8px; }
  .auth-main { justify-content: flex-start; padding: 28px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .orb-node, .orb-label, .as-copy { animation: none; }
}
.auth-loading { display: flex; align-items: center; gap: 10px; color: var(--ink-2); justify-content: center; padding: 18px 0; }
.auth-loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand); border-right-color: transparent; animation: spin .8s linear infinite; }

/* ---------- Dùng thử với dữ liệu mẫu ---------- */
.persona-list { display: grid; gap: 10px; }
.persona { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s, transform .15s; }
.persona:not([data-dept]) { --dc: var(--brand); }
.persona:hover { border-color: color-mix(in srgb, var(--dc) 55%, var(--line)); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.persona:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.persona-ic { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: color-mix(in srgb, var(--dc) 14%, var(--surface)); color: color-mix(in srgb, var(--dc) 75%, var(--ink)); }
.persona-ic svg { width: 19px; height: 19px; }
.persona-tx { min-width: 0; }
.persona b { display: block; font-size: 14.5px; font-weight: 600; }
.persona small { display: block; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.persona small.persona-who { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--ink-3); }
.persona-who svg { width: 13px; height: 13px; flex: none; }
.persona-go { flex: none; margin-left: auto; color: var(--ink-3); opacity: .5; transition: transform .15s, opacity .15s, color .15s; }
.persona-go svg { width: 18px; height: 18px; }
.persona:hover .persona-go, .persona:focus-visible .persona-go { opacity: 1; color: var(--dc); transform: translateX(3px); }
.demo-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding: 7px 24px; font-size: 13px; line-height: 1.4;
  background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.demo-bar .tx { flex: 1 1 280px; }
.demo-bar button { font-size: 13px; font-weight: 600; color: var(--brand-ink); padding: 2px 0; }
.demo-bar button:hover { text-decoration: underline; }
.menu-item[aria-current="true"] { background: var(--brand-soft); }
@media (max-width: 720px) { .demo-bar { padding: 7px 16px; } }

/* ---------- Chỉ xem, điện báo ---------- */
.view-only { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 10px 14px; border-radius: var(--r-md);
  background: var(--sunken); color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.view-only svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--ink-3); }
.notice time { margin-left: auto; }
.notice .btn-icon { flex: none; }
.notice-text { white-space: pre-wrap; font: 13.5px/1.55 var(--font-ui); background: var(--sunken); border-radius: var(--r-md); padding: 12px 14px; max-height: 320px; overflow: auto; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.seg button:disabled { opacity: .55; cursor: not-allowed; }
