:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #131720;
  --muted: #5f6878;
  --line: #e2e5ea;
  --accent: #1849a9;
  --accent-ink: #ffffff;
  --accent-soft: #e7edfa;
  --ok: #10703f;
  --ok-soft: #e3f3ea;
  --warn: #975400;
  --warn-soft: #fcf0dc;
  --bad: #b42318;
  --bad-soft: #fdeceb;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 6%);
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --surface: #171a20;
    --surface-2: #1f232b;
    --text: #e7e9ee;
    --muted: #9aa2b1;
    --line: #2a2f39;
    --accent: #7aa2ff;
    --accent-ink: #0b1220;
    --accent-soft: #1b2741;
    --ok: #4cc38a;
    --ok-soft: #13271d;
    --warn: #f0b354;
    --warn-soft: #2b2112;
    --bad: #ff7b72;
    --bad-soft: #2c1615;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 16px; }
p { margin: 0; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9em; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
small { font-size: 12.5px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }

/* ---------- Khung ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

header.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; letter-spacing: .02em; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.logo.big { width: 52px; height: 52px; border-radius: 15px; }
.logo.big .ic { width: 28px; height: 28px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; border: 2px solid transparent; }
.avatar.on { border-color: var(--accent); }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); display: flex; flex-direction: column; gap: 14px; }
main.wide { max-width: 1080px; }

nav.tabs-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(var(--n), 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
nav.tabs-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 550; }
nav.tabs-bar a.on { color: var(--accent); }
nav.tabs-bar .ic { width: 22px; height: 22px; }
@media (min-width: 900px) {
  nav.tabs-bar { left: 50%; transform: translateX(-50%); bottom: 14px; width: min(560px, calc(100% - 32px)); height: 60px; padding: 0; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 24px rgb(16 24 40 / 12%); }
}

/* ---------- Thành phần ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.link-card { color: inherit; transition: border-color .15s; }
.link-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.note { background: var(--accent-soft); color: var(--text); border-radius: 10px; padding: 10px 12px; border: 0; box-shadow: none; }
.note.warn { background: var(--warn-soft); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.card.note { display: block; }
.card.note .block { margin-top: 4px; }
.skeleton div { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton div:nth-child(1) { width: 40%; } .skeleton div:nth-child(2) { width: 85%; } .skeleton div:nth-child(3) { width: 65%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; border: 1px dashed var(--line); border-radius: var(--radius); }

.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap-s { gap: 6px; } .gap-m { gap: 14px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.block { display: block; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.danger-text { color: var(--bad) !important; }
.warn-text { color: var(--warn); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.chip .ic { width: 14px; height: 14px; vertical-align: -2px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: center; transition: filter .15s, transform .05s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn.xl { min-height: 52px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--accent-ink) transparent var(--accent-ink) transparent; animation: spin .7s linear infinite; }
.btn.ghost.busy::after { border-color: var(--accent) transparent var(--accent) transparent; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ic { width: 17px; height: 17px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 14px; margin-bottom: -6px; }
.hello h1 { font-size: 24px; }
.hello p { font-size: 13.5px; }

/* ---------- Chấm công ---------- */
.att h2 { font-size: 17px; }
.att-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0; }
.att-times div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.att-times span { display: block; color: var(--muted); font-size: 12px; }
.att-times strong { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.done-line { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.timeline-wrap summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 4px 0; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline li > b { font-variant-numeric: tabular-nums; min-width: 44px; }
.timeline li > div { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.timeline li small { color: var(--muted); }
.timeline li.rejected > b, .timeline li.rejected span { text-decoration: line-through; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stats.card { padding: 12px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.warn strong { color: var(--warn); }
.stat.bad strong { color: var(--bad); }

.list { padding: 4px 0; gap: 0; }
.list-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.list > .list-row:first-child, .list > p + .list-row { border-top: 0; }
.list-row:hover:not(:disabled):not(.static) { background: var(--surface-2); }
.list-row:disabled { cursor: default; }
.list-row.static { cursor: default; flex-wrap: wrap; }
.list-row .day { font-weight: 650; min-width: 56px; font-variant-numeric: tabular-nums; }
.dept-block .list { border: 1px solid var(--line); border-radius: 12px; padding: 0; }
.dept-block .list-row { padding: 10px 12px; }

/* ---------- Đội nhóm ---------- */
.segmented { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.segmented a { flex: 1; text-align: center; padding: 8px 6px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: var(--bad); color: #fff; font-style: normal; font-size: 11px; line-height: 18px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { flex: 1 1 220px; }
.sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.sums div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.sums span { font-size: 12px; color: var(--muted); }
.sums b { font-size: 17px; font-variant-numeric: tabular-nums; }
.missing { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.inline-check input { width: 17px; height: 17px; accent-color: var(--accent); }

.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap .table { min-width: 620px; }
.table td:first-child b { white-space: nowrap; }
.table th, .table td { padding: 10px 12px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
.table thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: 12.5px; background: var(--surface-2); white-space: nowrap; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table td.center, .table th.center { text-align: center; }
.matrix th { text-align: center; vertical-align: top; min-width: 96px; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--surface); text-align: left; min-width: 210px; z-index: 1; }
.matrix thead th:first-child { background: var(--surface-2); }
.matrix tr.group td { background: var(--surface-2); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.matrix input { width: 18px; height: 18px; accent-color: var(--accent); }

.report-view { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0; }
.report-view div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.report-view .full { grid-column: 1 / -1; }
.report-view dt { font-size: 12px; color: var(--muted); }
.report-view dd { margin: 0; font-weight: 550; white-space: pre-wrap; word-break: break-word; }

/* ---------- Form ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field em { color: var(--bad); font-style: normal; margin-left: 2px; }
.field.toggle { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
.field.toggle span { color: var(--text); font-weight: 500; font-size: 14.5px; }
.field.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.field.full { grid-column: 1 / -1; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); width: 100%;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type=checkbox] { width: auto; min-height: 0; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input-sm, .toolbar input, .toolbar select { min-height: 38px; padding: 6px 10px; width: auto; }
.hint { color: var(--muted); min-height: 0; }
.hint:empty { display: none; }
.hint.bad { color: var(--bad); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.sub-actions { padding-top: 4px; border-top: 1px dashed var(--line); }
.status-line { font-size: 13.5px; }

.tiles { display: grid; gap: 10px; }
.tile { flex-direction: row; align-items: center; gap: 14px; color: inherit; }
.tile b { display: block; }
.tile small { display: block; color: var(--muted); }
.tile > span:nth-child(2) { flex: 1; }
.tile-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }

.field-row { gap: 10px; }
.field-row-head { display: flex; justify-content: space-between; align-items: center; margin: -6px -6px 0 0; }
.title-input { font-size: 17px; font-weight: 650; border-color: transparent; padding-left: 0; background: transparent; }
.title-input:hover { border-color: var(--line); padding-left: 12px; }
.ip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ip-list .chip { font-family: ui-monospace, Consolas, monospace; font-weight: 500; }
.ip-list button { border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 0 0 2px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: inline-grid; place-items: center; width: 42px; height: 38px; border-radius: 10px; border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.days input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.days input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

.kv { margin: 0; display: flex; flex-direction: column; }
.kv div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.kv div:first-child { border-top: 0; }
.kv dt { color: var(--muted); font-size: 13.5px; }
.kv dd { margin: 0; word-break: break-word; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.kv dd small.block { flex-basis: 100%; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.log, pre.secret { margin: 0; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font: 13px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.profile { flex-direction: row; align-items: center; gap: 14px; }

/* ---------- Sheet ---------- */
dialog.sheet {
  width: min(560px, 100%); max-height: min(88vh, 900px); margin: auto auto 0; padding: 0;
  border: 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -8px 40px rgb(0 0 0 / 20%); overflow: auto;
}
dialog.sheet.wide { width: min(780px, 100%); }
dialog.sheet::backdrop { background: rgb(10 14 22 / 45%); }
dialog.sheet[open] { animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 18px; } }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 12px 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-body { padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 20px);
  max-width: min(92vw, 480px); padding: 11px 16px; border-radius: 12px; background: #1c2230; color: #fff;
  font-size: 14px; font-weight: 550; box-shadow: 0 8px 28px rgb(0 0 0 / 25%); opacity: 0; pointer-events: none; transition: .2s; z-index: 100;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); }
#toast.warn { background: #6b4300; }

/* ---------- Đăng nhập ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); padding: 24px; gap: 14px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 4px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 420px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
  .att-times strong { font-size: 19px; }
  .kv div { grid-template-columns: 110px 1fr; }
}

/* Danh sách mạng Wi-Fi của một địa điểm */
.nets { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; }
.net { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line); }
.net:first-child { border-top: 0; }
.net.pending { background: var(--warn-soft); }
.net.off .net-main code { text-decoration: line-through; opacity: .7; }
.net-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; flex: 1 1 260px; }
.net-main small.block { flex-basis: 100%; }
.card.note.warn { background: var(--warn-soft); }

/* Thanh bản xem thử */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 8px 16px; background: var(--warn-soft); color: var(--text); font-size: 13.5px; border-bottom: 1px solid var(--line); }
.demo-bar label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.demo-bar select { width: auto; min-height: 34px; padding: 4px 10px; font-size: 13.5px; }

/* =================== BLUE HRM =================== */
.only-narrow { display: none; }
@media (max-width: 760px) { .only-wide { display: none !important; } .only-narrow { display: flex; } }
img.avatar { object-fit: cover; padding: 0; background: var(--surface-2); }
.avatar.lg { width: 64px; height: 64px; font-size: 21px; }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; flex: none; }
.avatar-btn:disabled { cursor: default; }
.avatar-btn:not(:disabled):hover .avatar { outline: 2px solid var(--accent); outline-offset: 2px; }
.progress { display: inline-block; width: 72px; height: 7px; border-radius: 9px; background: var(--surface-2); overflow: hidden; vertical-align: middle; flex: none; }
.progress > span { display: block; height: 100%; border-radius: 9px; background: var(--warn); }
.progress.accent > span { background: var(--accent); }
.progress.ok > span { background: var(--ok); }
.badge { font-style: normal; }
.btn .badge { margin-left: 2px; }

.prof-head { gap: 12px; }
.prof-top { display: flex; gap: 14px; align-items: flex-start; }
.prof-top h1 { font-size: 21px; }
.prof-top p { margin: 2px 0 6px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.facts div { background: var(--surface-2); border-radius: 11px; padding: 8px 11px; min-width: 0; }
.facts span { display: block; font-size: 12px; color: var(--muted); }
.facts b { font-size: 14.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prof-top { flex-wrap: wrap; } }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; align-items: start; }
.cols2 > .card { min-width: 0; }
.form-sec { margin: 6px 0 -2px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.history-box summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.history-box .grid2 { margin-top: 10px; }
.pre { white-space: pre-wrap; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.plain li { padding: 7px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.plain li:first-child { border-top: 0; }
.li-end { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.sec-title { margin: 6px 0 -4px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 12.5px; }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px 4px; }
.doc-row { align-items: flex-start; }
.doc-row b { font-weight: 600; font-size: 14.5px; }
em.req { font-style: normal; font-size: 11.5px; color: var(--accent); font-weight: 600; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; padding: 3px 9px; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 12.5px; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .ic { width: 15px; height: 15px; }
.doc-acts select { width: auto; min-height: 34px; font-size: 13px; padding: 4px 8px; }
.list-row.off { opacity: .6; }

.contracts { display: flex; flex-direction: column; gap: 12px; }
.contract { display: flex; flex-direction: column; gap: 4px; }
.contract.sub { margin-top: 8px; padding: 10px 0 0 14px; border-top: 1px dashed var(--line); }
.contract.cancelled .mono, .contract.ended .mono { color: var(--muted); }

.htimeline { list-style: none; margin: 0; padding: 0; }
.htimeline li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.htimeline li:first-child { border-top: 0; }
.hdate { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13.5px; }
.htimeline li.decision b, .htimeline li.join b { color: var(--accent); }

/* Module */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.mod h3 { font-size: 16px; }
.mod.not-ready { opacity: .72; }
.state-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; align-self: flex-start; }
.state-seg button { border: 0; background: var(--surface); color: var(--muted); font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 14px; cursor: pointer; border-left: 1px solid var(--line); }
.state-seg button:first-child { border-left: 0; }
.state-seg button:hover { background: var(--surface-2); }
.state-seg button[aria-pressed="true"].on { background: var(--ok); color: #fff; }
.state-seg button[aria-pressed="true"].test { background: var(--warn); color: #fff; }
.state-seg button[aria-pressed="true"].off { background: var(--text); color: var(--bg); }
.state-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mod-conf summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--accent); }
.mod-conf .form { margin-top: 10px; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cf-rows { display: flex; flex-direction: column; gap: 8px; }
.cf-row { display: grid; grid-template-columns: 1.3fr .7fr 1.3fr auto; gap: 6px; align-items: center; }
.cf-row input, .cf-row select { min-height: 38px; padding: 6px 10px; }
@media (max-width: 560px) { .cf-row { grid-template-columns: 1fr 1fr auto; } .cf-row [data-cf=options] { grid-column: 1 / -1; } }
.nucleus { font-size: 13.5px; }

/* Sơ đồ tổ chức */
.org { overflow-x: auto; }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding-left: 22px; }
.org-tree { padding-left: 0; }
.org-tree ul li { position: relative; }
.org-tree ul li::before { content: ''; position: absolute; left: -14px; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.org-tree ul li::after { content: ''; position: absolute; left: -14px; top: 24px; width: 12px; border-top: 1px solid var(--line); }
.org-tree ul li:last-child::before { bottom: auto; height: 24px; }
.org-node { display: inline-flex; flex-direction: column; margin: 5px 0; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); min-width: 180px; }
.org-node small { color: var(--muted); }
.org-node:hover { border-color: var(--accent); }

/* Dashboard */
.home-hr { display: flex; flex-direction: column; gap: 14px; }
.dash { display: flex; flex-direction: column; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; color: var(--text); min-width: 0; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi b { font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.2; }
.kpi small { color: var(--muted); font-size: 12px; }
a.kpi:hover { border-color: var(--accent); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(0, 120px) 1fr 34px; gap: 8px; align-items: center; font-size: 13px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hb-track { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 6px; background: var(--accent); min-width: 2px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.cols-chart { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; height: 170px; align-items: end; padding-top: 6px; }
.cc-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; min-width: 0; }
.cc-col b { font-size: 13px; font-variant-numeric: tabular-nums; }
.cc-bar { width: 70%; max-width: 38px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); }
.cc-col.now .cc-bar { background: var(--accent); }
.cc-col small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.cc-delta { display: flex; gap: 4px; min-height: 15px; }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--bad); font-weight: 600; }
.tasks { gap: 6px; }
.task { border-top: 1px solid var(--line); padding: 6px 0; }
.task summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; padding: 4px 0; }
.task summary::-webkit-details-marker { display: none; }
.task .badge { background: var(--warn); }
.task-link { display: flex; justify-content: space-between; align-items: center; color: var(--text); font-weight: 600; padding: 8px 0; border-top: 1px solid var(--line); }
.task-link .badge { background: var(--bad); }
.segmented { overflow-x: auto; scrollbar-width: none; }
.segmented a { white-space: nowrap; flex: 1 0 auto; padding: 8px 10px; }
