/* ============================================================
   Bảng điều hành công việc — hệ thống giao diện
   Phông: Be Vietnam Pro (tự lưu trong /fonts, không gọi dịch vụ ngoài)
   ============================================================ */
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url(/fonts/be-vietnam-pro-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url(/fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url(/fonts/be-vietnam-pro-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url(/fonts/be-vietnam-pro-vietnamese-500-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url(/fonts/be-vietnam-pro-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url(/fonts/be-vietnam-pro-vietnamese-600-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url(/fonts/be-vietnam-pro-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url(/fonts/be-vietnam-pro-vietnamese-700-normal.woff2) format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }

/* ---------- Màu và kích thước ---------- */
:root {
  color-scheme: light;
  --canvas: #f4f6fb; --surface: #ffffff; --surface-2: #f8f9fc; --raised: #ffffff;
  --ink: #0f1a2e; --ink-2: #364258; --muted: #5f6c84; --faint: #8f9bb0;
  --line: #e3e8f1; --line-2: #edf0f6; --line-strong: #cfd7e5;
  --brand: #2257e6; --brand-hover: #1a47c4; --brand-ink: #1b46b8; --brand-soft: #eaf0ff; --brand-line: #c7d6ff; --on-brand: #ffffff;
  --nav-bg: #0b1a3e; --nav-ink: #b9c5e0; --nav-strong: #ffffff; --nav-hover: rgba(255,255,255,.07); --nav-active: rgba(255,255,255,.12); --nav-line: rgba(255,255,255,.10);
  --danger: #d92d20; --danger-soft: #feefed; --danger-ink: #b42318;
  --warn: #e07a07; --warn-soft: #fff3e1; --warn-ink: #a85a00;
  --ok: #12a05c; --ok-soft: #e6f7ee; --ok-ink: #0b7a45;
  --neutral-soft: #eff2f8; --neutral-ink: #4b5770;
  --c-done: #12a05c; --c-doing: #2257e6; --c-unconfirmed: #8c9bb8; --c-todo: #cdd6e6; --c-other: #eb9b1f;
  --shadow-1: 0 1px 2px rgba(15, 26, 46, .05);
  --shadow-2: 0 8px 24px rgba(15, 26, 46, .10);
  --shadow-3: -12px 0 40px rgba(15, 26, 46, .18);
  --focus: 0 0 0 3px rgba(34, 87, 230, .28);
  --av-s: 70%; --av-bg-l: 90%; --av-ink-l: 30%;
  --r-lg: 14px; --r-md: 10px; --r-sm: 8px;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #090f1c; --surface: #111a2c; --surface-2: #0d1525; --raised: #16213a;
    --ink: #e9eff9; --ink-2: #c3cee2; --muted: #8e9db8; --faint: #66748f;
    --line: #1f2b43; --line-2: #18233a; --line-strong: #2d3b58;
    --brand: #5d8bff; --brand-hover: #82a5ff; --brand-ink: #9db9ff; --brand-soft: #15244d; --brand-line: #26396f; --on-brand: #081230;
    --nav-bg: #070d1b; --nav-ink: #93a2c0; --nav-line: rgba(255,255,255,.07);
    --danger: #ff6f66; --danger-soft: #3a1618; --danger-ink: #ff9d96;
    --warn: #f5a524; --warn-soft: #382a0e; --warn-ink: #f7c36d;
    --ok: #3dd68c; --ok-soft: #0f2e20; --ok-ink: #72e4b0;
    --neutral-soft: #1a2640; --neutral-ink: #a4b2cc;
    --c-done: #3dd68c; --c-doing: #5d8bff; --c-unconfirmed: #6b7b99; --c-todo: #34425f; --c-other: #f5a524;
    --shadow-1: 0 1px 2px rgba(0,0,0,.35); --shadow-2: 0 10px 30px rgba(0,0,0,.45); --shadow-3: -12px 0 40px rgba(0,0,0,.55);
    --focus: 0 0 0 3px rgba(93, 139, 255, .35);
    --av-s: 45%; --av-bg-l: 24%; --av-ink-l: 78%;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #090f1c; --surface: #111a2c; --surface-2: #0d1525; --raised: #16213a;
  --ink: #e9eff9; --ink-2: #c3cee2; --muted: #8e9db8; --faint: #66748f;
  --line: #1f2b43; --line-2: #18233a; --line-strong: #2d3b58;
  --brand: #5d8bff; --brand-hover: #82a5ff; --brand-ink: #9db9ff; --brand-soft: #15244d; --brand-line: #26396f; --on-brand: #081230;
  --nav-bg: #070d1b; --nav-ink: #93a2c0; --nav-line: rgba(255,255,255,.07);
  --danger: #ff6f66; --danger-soft: #3a1618; --danger-ink: #ff9d96;
  --warn: #f5a524; --warn-soft: #382a0e; --warn-ink: #f7c36d;
  --ok: #3dd68c; --ok-soft: #0f2e20; --ok-ink: #72e4b0;
  --neutral-soft: #1a2640; --neutral-ink: #a4b2cc;
  --c-done: #3dd68c; --c-doing: #5d8bff; --c-unconfirmed: #6b7b99; --c-todo: #34425f; --c-other: #f5a524;
  --shadow-1: 0 1px 2px rgba(0,0,0,.35); --shadow-2: 0 10px 30px rgba(0,0,0,.45); --shadow-3: -12px 0 40px rgba(0,0,0,.55);
  --focus: 0 0 0 3px rgba(93, 139, 255, .35);
  --av-s: 45%; --av-bg-l: 24%; --av-ink-l: 78%;
}

/* ---------- Nền tảng ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); }
:focus-visible { outline: 0; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Khung ứng dụng ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.main-col { min-width: 0; display: flex; flex-direction: column; }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 18px 14px 14px; background: var(--nav-bg); color: var(--nav-ink); z-index: 40; }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 0; }
.mark { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; background: linear-gradient(145deg, #3d73ff, #1b45c9); color: #fff; box-shadow: 0 4px 14px rgba(34, 87, 230, .45); }
.mark svg { width: 22px; height: 22px; }
.brand h1 { font-size: 15px; line-height: 1.3; font-weight: 650; color: var(--nav-strong); letter-spacing: -.005em; }
.brand p { font-size: 12px; color: var(--nav-ink); opacity: .85; margin-top: 2px; }

.nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--nav-ink); text-decoration: none; font-weight: 500; position: relative; }
.nav-item:hover { background: var(--nav-hover); color: var(--nav-strong); }
.nav-item[aria-current="page"] { background: var(--nav-active); color: var(--nav-strong); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #6f9bff; }
.nav-item:focus-visible { box-shadow: inset 0 0 0 2px #8fb0ff; }
.nav-item .count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 650; line-height: 20px; text-align: center; }
.nav-item .count.warn { background: var(--warn); }

.side-foot { margin-top: auto; border-top: 1px solid var(--nav-line); padding-top: 14px; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.me > div { min-width: 0; flex: 1; line-height: 1.3; }
.me b { display: block; font-size: 13.5px; color: var(--nav-strong); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { font-size: 12px; opacity: .8; }
.sidebar .icon-btn { color: var(--nav-ink); }
.sidebar .icon-btn:hover { background: var(--nav-hover); color: var(--nav-strong); }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 32px; background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; max-width: 440px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; width: 17px; height: 17px; }
.search input { width: 100%; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 11.5px var(--font); color: var(--faint); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 6px; background: var(--surface); pointer-events: none; }
.search input:focus ~ kbd { display: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.only-mobile { display: none; }

.live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; box-shadow: var(--shadow-1); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.live.ok i { animation: pulse 2.4s ease-out infinite; }
.live.stale i { background: var(--warn); }
.live.off i { background: var(--danger); }
.live b { font-weight: 600; color: var(--ink); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }

main { width: 100%; max-width: 1480px; margin: 0 auto; padding: 28px 32px 64px; }
main:focus { outline: none; }
.banner, .notice { margin: 20px 32px 0; padding: 11px 16px; border-radius: var(--r-md); font-size: 13.5px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.banner { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.notice { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn-ink); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin-bottom: 20px; }
.page-head h2 { font-size: 24px; line-height: 1.25; font-weight: 650; letter-spacing: -.015em; }
.page-head p { color: var(--muted); margin-top: 3px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Thẻ ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 20px 22px; min-width: 0; }
.ph { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.panel h3, .ph h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -.005em; }
.ph small, .panel h3 small { color: var(--muted); font-size: 13px; font-weight: 400; }
.ph a { font-size: 13px; font-weight: 550; text-decoration: none; }
.ph a:hover { text-decoration: underline; }
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid:first-child { margin-top: 0; }
.g-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack-v > * + * { margin-top: 16px; }
.empty { padding: 28px 8px; color: var(--muted); text-align: center; }
.empty .ic { width: 28px; height: 28px; display: block; margin: 0 auto 8px; color: var(--faint); }
@media (max-width: 1100px) { .g-7-5, .g-2-1 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Tổng quan: khối đầu ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; }
.ring-card { display: flex; align-items: center; gap: 22px; background: linear-gradient(160deg, var(--surface) 0%, var(--brand-soft) 160%); }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .trk { stroke: var(--line); }
.ring .val { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .7, .2, 1); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.ring b span { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.ring b i { font-style: normal; }
.ring-card h3 { font-size: 13.5px; color: var(--muted); font-weight: 550; }
.ring-card .big { font-size: 15px; margin-top: 4px; line-height: 1.5; }
.ring-card .big strong { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.ring-card .legend-v { margin-top: 12px; display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); }
.legend-v i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); text-align: left; color: inherit; font: inherit; width: 100%; }
.stat .si { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--neutral-soft); color: var(--neutral-ink); }
.stat .si .ic { width: 19px; height: 19px; }
.stat.danger .si { background: var(--danger-soft); color: var(--danger); }
.stat.warn .si { background: var(--warn-soft); color: var(--warn); }
.stat.brand .si { background: var(--brand-soft); color: var(--brand); }
.stat .sl { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .sv { display: block; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin-top: 1px; }
.stat.danger .sv { color: var(--danger); }
.stat.warn .sv { color: var(--warn-ink); }
.stat .sh { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.click { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stat.click:hover { border-color: var(--brand-line); box-shadow: var(--shadow-2); transform: translateY(-1px); }
@media (max-width: 1100px) { .hero { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .stats { gap: 10px; } .stat { padding: 14px; flex-direction: column; gap: 10px; } .ring-card { flex-direction: column; align-items: flex-start; } }

/* ---------- Danh sách cảnh báo ---------- */
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.alert-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 16px; gap: 0 12px; align-items: center; padding: 10px 10px; margin: 0 -10px; border-radius: var(--r-md); cursor: pointer; }
.alert-item:hover { background: var(--surface-2); }
.alert-item.static { cursor: default; grid-template-columns: 34px minmax(0, 1fr) auto; }
.alert-item.static:hover { background: transparent; }
.a-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--neutral-ink); }
.a-ic .ic { width: 17px; height: 17px; }
.alert-item.danger .a-ic { background: var(--danger-soft); color: var(--danger); }
.alert-item.warn .a-ic { background: var(--warn-soft); color: var(--warn); }
.alert-item .t { font-weight: 600; overflow-wrap: anywhere; line-height: 1.4; }
.alert-item .t .id { color: var(--muted); font-weight: 500; margin-right: 6px; font-variant-numeric: tabular-nums; }
.alert-item .s { font-size: 12.5px; color: var(--muted); margin-top: 1px; overflow-wrap: anywhere; }
.alert-item > .ic { color: var(--faint); width: 16px; height: 16px; }
@media (max-width: 560px) { .alert-item { grid-template-columns: 34px minmax(0, 1fr) 14px; } .alert-item > .tag { display: none; } .alert-item.static { grid-template-columns: 34px minmax(0, 1fr); } }

.changes { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.changes::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.changes li { position: relative; padding: 6px 8px 6px 24px; cursor: pointer; border-radius: var(--r-sm); font-size: 13.5px; }
.changes li:hover { background: var(--surface-2); }
.changes li::before { content: ""; position: absolute; left: 3px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--surface); }
.changes time { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Nhãn, huy hiệu ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; background: var(--neutral-soft); color: var(--neutral-ink); white-space: nowrap; }
.tag.danger { background: var(--danger-soft); color: var(--danger-ink); }
.tag.warn { background: var(--warn-soft); color: var(--warn-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok-ink); }
.tag.blue { background: var(--brand-soft); color: var(--brand-ink); }
.tag.sdot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.tag.plain { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); font-weight: 500; }

.avatar { --h: 215; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; font-size: 11px; font-weight: 650; letter-spacing: .02em; background: hsl(var(--h) var(--av-s) var(--av-bg-l)); color: hsl(var(--h) 55% var(--av-ink-l)); }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.none { background: transparent; border: 1.5px dashed var(--line-strong); color: var(--faint); }
.who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.who > span:last-child { min-width: 0; }
.who b { font-weight: 550; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .avatar { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- Dải thời hạn ---------- */
.strip-wrap { overflow-x: auto; padding-bottom: 4px; }
.strip { display: grid; grid-template-columns: repeat(29, minmax(24px, 1fr)); min-width: 760px; align-items: end; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; }
.sday { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 168px; position: relative; padding-bottom: 26px; border-left: 1px solid var(--line-2); }
.sday:first-child { border-left: 0; }
.sday.we { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--line-2) 5px 6px); }
.sday.today { background: var(--brand-soft); border-left: 1px solid var(--brand-line); border-right: 1px solid var(--brand-line); }
.sday .lbl { position: absolute; bottom: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.sday.today .lbl { color: var(--on-brand); background: var(--brand); border-radius: 999px; padding: 1px 8px; font-weight: 650; bottom: 4px; }
.dots { display: flex; flex-direction: column-reverse; gap: 4px; align-items: center; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 0; padding: 0; background: var(--brand); box-shadow: 0 0 0 2px var(--surface-2); transition: transform .12s; }
.sday.today .dot { box-shadow: 0 0 0 2px var(--brand-soft); }
.dot.danger { background: var(--danger); } .dot.warn { background: var(--warn); } .dot.done { background: var(--ok); opacity: .5; }
.dot:hover, .dot:focus-visible { transform: scale(1.35); }
.dots .more { font-size: 11px; color: var(--muted); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: -0.5px; }
.legend i.sq { border-radius: 3px; }

/* ---------- Biểu đồ ---------- */
.axis-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 74px; gap: 12px; align-items: center; padding: 7px 0; }
.axis-row > span:first-child { font-weight: 550; color: var(--ink-2); }
.stack { display: flex; height: 12px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.stack i { display: block; height: 100%; }
.stack i + i { margin-left: 1px; }
.c-done { background: var(--c-done); } .c-doing { background: var(--c-doing); } .c-unconfirmed { background: var(--c-unconfirmed); } .c-todo { background: var(--c-todo); } .c-other { background: var(--c-other); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex: none; }
.donut text { fill: var(--ink); font-weight: 700; font-family: var(--font); }
.key { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; }
.key li { display: flex; align-items: center; gap: 9px; padding: 5px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.key li:first-child { border-top: 0; }
.key i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.key b { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; font-weight: 650; }

/* ---------- Thanh công cụ, bộ lọc ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--neutral-soft); border-radius: var(--r-md); max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 550; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.seg button em { font-style: normal; font-size: 11.5px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--muted); font-weight: 600; }
.seg button[aria-pressed="true"] em { background: var(--brand-soft); color: var(--brand-ink); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; min-width: 0; }
.field select { min-width: 140px; max-width: 200px; }

.search-inline { position: relative; }
.search-inline .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; pointer-events: none; }
.search-inline { flex: 0 1 300px; min-width: 220px; }
.search-inline input { width: 100%; }
input[type=search] { -webkit-appearance: none; appearance: none; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input[type=search], .search-inline input[type=search] { padding-left: 38px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { padding: 6px 13px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chip:hover { border-color: var(--brand-line); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); font-weight: 600; }

/* ---------- Ô nhập, nút ---------- */
input:not([type=checkbox]), select, textarea { height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); min-width: 0; transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
select { padding-right: 30px; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238f9bb0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:not([type=checkbox]):hover, select:hover, textarea:hover { border-color: var(--faint); }
input:not([type=checkbox]):focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: var(--focus); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 550; color: var(--ink); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 1px 2px rgba(34, 87, 230, .35); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.link { border-color: transparent; background: transparent; color: var(--brand-ink); padding: 0 8px; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--neutral-soft); color: var(--ink); }
.topbar .icon-btn { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-1); }

/* ---------- Bảng ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.panel .table-wrap { border: 0; box-shadow: none; border-radius: 0; background: transparent; margin: 0 -22px -20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 12px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line-2); }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
thead th { border-top: 0; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 600; font-size: 12.5px; color: var(--muted); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
thead th button { background: none; border: 0; padding: 0; font-weight: 600; font-size: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
thead th button:hover { color: var(--ink); }
thead th[aria-sort="ascending"], thead th[aria-sort="descending"] { color: var(--brand-ink); }
.sort-ind { width: 12px; height: 12px; }
tbody tr[data-open], tbody tr[data-person] { cursor: pointer; }
tbody tr[data-open]:hover, tbody tr[data-person]:hover { background: var(--surface-2); }
tbody tr[data-sev="danger"] td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tbody tr[data-sev="warn"] td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tbody tr:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); border-radius: 0; }
td.c-id { white-space: nowrap; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
td.c-title { min-width: 240px; max-width: 520px; }
td.c-title .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; color: var(--ink); line-height: 1.45; }
td .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
td.c-due { white-space: nowrap; }
.pbar { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.pbar .bar { flex: 1; height: 6px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.pbar .bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.pbar.done .bar i { background: var(--ok); }
.pbar .num { font-size: 12.5px; font-weight: 600; color: var(--ink-2); min-width: 34px; text-align: right; }
.load { display: flex; align-items: center; gap: 10px; }
.load .bar { width: 120px; height: 8px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.load .bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.load.heavy .bar i { background: var(--warn); }
.load .num { font-weight: 600; min-width: 30px; }
.result-count { font-size: 13px; color: var(--muted); padding: 0 2px 10px; }
.zero { color: var(--faint); }
td .empty { padding: 36px 8px; }
@media (max-width: 1560px) { .c-hide-md { display: none; } }
@media (max-width: 640px) { .c-hide-sm { display: none; } th, td { padding: 10px; } }

/* ---------- Số liệu tóm tắt nhỏ (trang Cảnh báo) ---------- */
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.mini { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.mini .si { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--neutral-ink); flex: none; }
.mini.danger .si { background: var(--danger-soft); color: var(--danger); }
.mini.warn .si { background: var(--warn-soft); color: var(--warn); }
.mini b { font-size: 22px; line-height: 1.1; font-weight: 700; display: block; letter-spacing: -.01em; }
.mini span { font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) { .mini-stats { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Biểu mẫu cấu hình ---------- */
.cfg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.form { display: grid; gap: 16px; min-width: 0; }
.form .panel { display: grid; gap: 16px; }
.form .panel > h3 { margin: 0; }
.form .panel > .lead { color: var(--muted); font-size: 13px; margin-top: -10px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 550; color: var(--ink-2); font-size: 13.5px; }
.form label small { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: -2px; }
.form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; align-items: end; }
.switches { display: grid; gap: 2px; }
.form label.switch { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 2px; font-weight: 500; border-top: 1px solid var(--line-2); cursor: pointer; }
.form label.switch:first-child { border-top: 0; }
.switch input { -webkit-appearance: none; appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 0; box-shadow: var(--focus); }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.msg { font-size: 13.5px; }
.msg.ok { color: var(--ok-ink); } .msg.err { color: var(--danger-ink); }
dl.kv { display: grid; grid-template-columns: 138px minmax(0, 1fr); gap: 9px 14px; font-size: 13.5px; }
dl.kv dt { color: var(--muted); } dl.kv dd { overflow-wrap: anywhere; font-weight: 500; }
.quality { margin: 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 6px; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn-ink); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); font-size: 13.5px; }
@media (max-width: 1100px) { .cfg-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Ngăn chi tiết ---------- */
.scrim { position: fixed; inset: 0; background: rgba(8, 14, 28, .5); backdrop-filter: blur(2px); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 51; box-shadow: var(--shadow-3); overflow-y: auto; border-left: 1px solid var(--line); animation: slide-in .22s cubic-bezier(.2, .7, .2, 1); }
@keyframes slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 20px 24px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer header p { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.drawer h2 { font-size: 18px; line-height: 1.4; font-weight: 650; overflow-wrap: anywhere; margin-top: 3px; letter-spacing: -.01em; }
.drawer .x { flex: none; }
.drawer .body { padding: 18px 24px 48px; }
.drawer .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.drawer h3 { font-size: 13px; font-weight: 650; color: var(--muted); margin: 24px 0 10px; }
.drawer .alert-list { gap: 8px; }
.drawer .alert-item.static { margin: 0; padding: 10px 12px; border: 1px solid var(--line); }
.note { white-space: pre-line; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; line-height: 1.6; }
.drawer dl.kv { padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md); grid-template-columns: 150px minmax(0, 1fr); }

/* ---------- Thông báo nổi ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(480px, calc(100% - 28px)); pointer-events: none; }
.toast div { display: flex; gap: 10px; align-items: flex-start; background: #0f1a2e; color: #f1f5fc; padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-2); font-size: 13.5px; animation: toast-in .25s cubic-bezier(.2, .7, .2, 1); }
.toast .ic { color: #7ea5ff; margin-top: 1px; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Đang tải ---------- */
.skel { background: linear-gradient(90deg, var(--line-2) 25%, var(--line) 37%, var(--line-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-lg); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skel-row { display: grid; gap: 16px; margin-top: 16px; }
.skel-row.two { grid-template-columns: 5fr 7fr; }
.skel-row.cards { grid-template-columns: repeat(4, 1fr); }

/* ---------- Màn hình điều hướng nhỏ ---------- */
.nav-scrim { position: fixed; inset: 0; background: rgba(8, 14, 28, .55); z-index: 39; }
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .7, .2, 1); box-shadow: var(--shadow-2); }
  .sidebar.open { transform: none; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  main { padding: 20px 16px 56px; }
  .banner, .notice { margin: 14px 16px 0; }
  .page-head h2 { font-size: 21px; }
  .nav-item[aria-current="page"]::before { left: -14px; }
}
@media (max-width: 640px) {
  .live .hide-sm { display: none; }
  .search kbd { display: none; }
  .panel { padding: 16px; }
  .panel .table-wrap { margin: 0 -16px -16px; }
  .filters { padding: 12px; }
  .field { flex: 1 1 calc(50% - 10px); }
  .field select { width: 100%; max-width: none; }
  .drawer header, .drawer .body { padding-left: 18px; padding-right: 18px; }
  dl.kv, .drawer dl.kv { grid-template-columns: 112px minmax(0, 1fr); }
}

/* ---------- Đăng nhập ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.login-art { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #1b3b92 0%, #0b1a3e 55%, #070f26 100%); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-art .brand { padding: 0; }
.login-art h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.2; font-weight: 700; letter-spacing: -.02em; max-width: 14em; }
.login-art p { color: #b9c5e0; margin-top: 14px; max-width: 30em; font-size: 15px; }
.login-art .art { width: 100%; max-width: 520px; height: auto; opacity: .95; }
.login-form-wrap { display: grid; place-items: center; padding: 32px 24px; }
.login-box { width: min(380px, 100%); display: grid; gap: 24px; }
.login-box h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.login-box form { display: grid; gap: 16px; }
.login-box label { display: grid; gap: 6px; font-weight: 550; font-size: 13.5px; color: var(--ink-2); }
.login-box input { height: 44px; }
.login-box .btn { height: 44px; font-size: 15px; }
.login-box .foot { font-size: 12.5px; color: var(--muted); }
@media (max-width: 860px) { .login-page { grid-template-columns: minmax(0, 1fr); } .login-art { display: none; } }

td.c-due .tag { margin-top: 3px; }

/* Bảng công việc trên điện thoại: mỗi dòng thành một thẻ gọn */
@media (max-width: 640px) {
  table.tasks, table.tasks tbody { display: block; }
  table.tasks thead { display: none; }
  table.tasks tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line-2); }
  table.tasks tr:first-child { border-top: 0; }
  table.tasks td { display: block; padding: 0; border: 0; box-shadow: none !important; }
  table.tasks td.c-id { grid-column: 1; grid-row: 1; }
  table.tasks td.c-status { grid-column: 2; grid-row: 1; justify-self: start; }
  table.tasks td.c-due { grid-column: 3; grid-row: 1 / span 2; text-align: right; align-self: start; }
  table.tasks td.c-title { grid-column: 1 / 3; grid-row: 2; min-width: 0; max-width: none; }
  table.tasks td.c-hide-sm, table.tasks td.c-hide-md { display: none; }
  table.tasks td.c-who { grid-column: 1 / -1; grid-row: 3; }
  table.tasks tr[data-sev="danger"] { box-shadow: inset 3px 0 0 var(--danger); }
  table.tasks tr[data-sev="warn"] { box-shadow: inset 3px 0 0 var(--warn); }
  table.tasks tr td[colspan] { grid-column: 1 / -1; }
}

/* ============================================================
   Dashboard: màu sinh động, biểu đồ SVG
   ============================================================ */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.chart { display: block; width: 100%; height: auto; font-family: var(--font); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .tk { font-size: 10.5px; fill: var(--faint); }
.chart .vl { font-size: 12.5px; font-weight: 700; fill: var(--ink); }
.chart .vl.zero { fill: var(--faint); font-weight: 500; }
.chart .xl { font-size: 11.5px; fill: var(--ink-2); font-weight: 500; }
.chart .xl.bad { fill: var(--danger-ink); font-weight: 700; font-size: 11px; }
.chart .gl-line { stroke: var(--line-2); stroke-width: 1; }
.chart .gl-line.base { stroke: var(--line-strong); }
.chart .hit { fill: transparent; }
.chart .col { cursor: pointer; outline: none; }
.chart .col:hover .hit, .chart .col:focus-visible .hit { fill: var(--brand-soft); }
.chart-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.chart-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* Truy cập nhanh */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.qchip { --t: var(--brand); display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 7px;  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 550; transition: transform .15s, box-shadow .15s, border-color .15s; }
.qchip:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--t) 45%, var(--line)); }
.qchip .ql { margin-right: auto; white-space: nowrap; }
.qchip .qi { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--t) 16%, transparent); color: var(--t); }
.qchip .qi .ic { width: 15px; height: 15px; }
.qchip b { min-width: 26px; text-align: center; padding: 1px 9px; border-radius: 999px; background: var(--t); color: #fff; font-size: 13px; font-weight: 700; }
.qchip.zero { opacity: .62; } .qchip.zero b { background: var(--neutral-soft); color: var(--muted); }
.qchip.danger { --t: #e0344f; } .qchip.warn { --t: #e8820c; } .qchip.violet { --t: #7650f0; } .qchip.blue { --t: #2c63ee; }
.qchip.slate { --t: #52607a; } .qchip.cyan { --t: #0c93b6; } .qchip.amber { --t: #b8860b; } .qchip.green { --t: #0f9f6b; }

/* Thẻ số liệu nền gradient */
.ktiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kt { --g1: #5b3fe0; --g2: #8d5cff; position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l ic" "v v" "h h" "b b"; align-items: center; gap: 2px 8px; padding: 16px 18px 18px; border: 0; border-radius: var(--r-lg); color: #fff; text-align: left; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 10px 24px -12px var(--g1); transition: transform .16s, box-shadow .16s; font: inherit; }
.kt::after { content: ""; position: absolute; right: -34px; bottom: -44px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.28), rgba(255,255,255,0) 70%); pointer-events: none; }
.kt:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -12px var(--g1); }
.kt-ic { grid-area: ic; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.2); }
.kt-ic .ic { width: 18px; height: 18px; }
.kt-l { grid-area: l; font-size: 13.5px; font-weight: 550; opacity: .95; }
.kt-v { grid-area: v; font-size: 36px; line-height: 1.1; font-weight: 750; letter-spacing: -.025em; margin-top: 6px; }
.kt-h { grid-area: h; font-size: 12.5px; opacity: .92; }
.kt-bar { grid-area: b; display: flex; height: 6px; margin-top: 12px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; position: relative; z-index: 1; }
.kt-bar i { display: block; height: 100%; background: rgba(255,255,255,.95); }
.kt-bar i.k-b { background: rgba(255,255,255,.6); } .kt-bar i.k-c { background: rgba(255,255,255,.3); }
.kt.violet { --g1: #5a3de0; --g2: #8f5eff; }
.kt.green { --g1: #07875f; --g2: #17b57e; }
.kt.blue { --g1: #1c52de; --g2: #1a9be4; }
.kt.amber { --g1: #b74704; --g2: #e07f0a; }
.kt.coral { --g1: #d0213a; --g2: #ee4f78; }

/* Lưới 12 cột */
.dgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: stretch; }
.s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s7 { grid-column: span 7; }
@media (max-width: 1280px) { .ktiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .s4 { grid-column: span 6; } .s5, .s7 { grid-column: span 12; }
  .dgrid > .s4:last-child:nth-child(odd) { grid-column: span 12; }
}
@media (max-width: 700px) {
  .ktiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kt:first-child { grid-column: 1 / -1; }
  .kt-v { font-size: 30px; }
  .s4, .s5, .s7 { grid-column: span 12; }
  .quick { display: flex; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 16px; padding: 4px 16px 8px; scrollbar-width: none; }
  .quick::-webkit-scrollbar { display: none; }
  .qchip { flex: none; }
}

/* Đồng hồ tiến độ */
.gauge { max-width: 340px; margin: 0 auto; }
.gauge .g-trk { stroke: var(--line); }
.gauge .g-knob { fill: #fff; stroke: #18c28a; stroke-width: 3; }
.gauge .gv { font-size: 40px; font-weight: 750; fill: var(--ink); letter-spacing: -.02em; }
.gauge .gp { font-size: 18px; font-weight: 600; fill: var(--muted); }
.gauge .gl { font-size: 11.5px; fill: var(--muted); }
.gauge .g-val { animation: gdraw 1s cubic-bezier(.2, .7, .2, 1); }
@keyframes gdraw { from { stroke-dasharray: 0 100; } }
.mini3 { margin-top: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.mini3 span { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 8px 4px; font-size: 12px; color: var(--muted); }
.mini3 b { display: block; font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.panel.s4 .donut-wrap { flex-direction: column; align-items: stretch; gap: 14px; }
.panel.s4 .donut { width: 190px; height: 190px; margin: 0 auto; }
.donut-wrap .donut .dn { font-size: 28px; font-weight: 750; fill: var(--ink); }
.donut-wrap .donut .dl { font-size: 11px; fill: var(--muted); font-weight: 400; }
.key li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.key li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.key li b { margin-left: auto; font-weight: 700; }
.key li em { font-style: normal; color: var(--muted); font-size: 12px; min-width: 34px; text-align: right; }

/* Thanh ngang: mức ưu tiên */
.hbars { display: grid; gap: 10px; margin-bottom: 14px; }
.hb { display: grid; grid-template-columns: 86px minmax(0, 1fr) 62px; gap: 12px; align-items: center; padding: 7px 8px; margin: 0 -8px; background: none; border: 0; border-radius: var(--r-sm); text-align: left; }
.hb[data-go]:hover { background: var(--surface-2); }
.hb .n { font-size: 13px; font-weight: 550; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb .tr { height: 12px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.hb .tr i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5fc6ff, #6a5cff); }
.hb .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.hb .v small { margin-left: 5px; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.hb.k-khan .tr i { background: linear-gradient(90deg, #ff8585, #e32b50); }
.hb.k-cao .tr i { background: linear-gradient(90deg, #ffcb52, #ff8a1f); }
.hb.k-plan .tr i { background: linear-gradient(90deg, #52b0ff, #2c63ee); }
.hb.k-periodic .tr i { background: linear-gradient(90deg, #4fe0d0, #14a8c8); }
.hb.k-need .tr i { background: linear-gradient(90deg, #b39cff, #7348ee); }
.hb.k-other .tr i, .hb.k-none .tr i { background: linear-gradient(90deg, #d3dcec, #9aa9c6); }

/* Khối lượng chuyên viên */
.wl { display: grid; gap: 10px; }
.wl-row { display: grid; grid-template-columns: 30px minmax(110px, 190px) minmax(0, 1fr) 40px; gap: 12px; align-items: center; padding: 6px 8px; margin: 0 -8px; background: none; border: 0; border-radius: var(--r-sm); text-align: left; }
.wl-row:hover { background: var(--surface-2); }
.wl-name { font-weight: 550; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-bar { display: flex; height: 14px; background: var(--neutral-soft); border-radius: 999px; overflow: hidden; }
.wl-bar i { display: block; height: 100%; }
.wl-bar .b-ok { background: linear-gradient(90deg, #52b0ff, #2c63ee); } .wl-bar .b-soon { background: linear-gradient(90deg, #ffcb52, #ff8a1f); } .wl-bar .b-over { background: linear-gradient(90deg, #ff8585, #e32b50); }
.wl-n { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.wl-n em { font-style: normal; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 4px; border-radius: 50%; background: var(--warn-soft); color: var(--warn-ink); font-size: 11px; font-weight: 700; }
@media (max-width: 520px) { .wl-row { grid-template-columns: 30px minmax(0, 1fr) 36px; } .wl-bar { grid-column: 2 / -1; grid-row: 2; } .wl-n { grid-row: 1; grid-column: 3; } }

/* Mốc sắp tới */
.ms-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ms { --t: var(--brand); display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: var(--r-md); border: 1px solid var(--line-2); cursor: pointer; transition: border-color .15s, background .15s; }
.ms:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--t) 40%, var(--line)); }
.ms.danger { --t: var(--danger); } .ms.warn { --t: var(--warn); }
.ms .when { display: grid; place-items: center; align-content: center; height: 52px; border-radius: 10px; background: color-mix(in srgb, var(--t) 14%, transparent); color: var(--t); text-align: center; line-height: 1.2; }
.ms .when b { font-size: 15px; font-weight: 700; }
.ms .when small { font-size: 10.5px; font-weight: 550; }
.ms .what b { display: block; font-size: 13.5px; font-weight: 600; }
.ms .what small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { .gauge .g-val { animation: none; } .kt, .qchip { transition: none; } }

/* Lịch sử thay đổi: cuộn khi nhiều nội dung */
.changes-scroll { max-height: 360px; overflow-y: auto; overscroll-behavior: contain; margin: 0 -10px 0 -4px; padding: 0 10px 4px 4px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.changes-scroll::-webkit-scrollbar { width: 8px; }
.changes-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.changes-scroll::-webkit-scrollbar-thumb:hover { background: var(--faint); }
.changes-scroll:focus-visible { box-shadow: var(--focus); border-radius: var(--r-sm); }
.ch-day { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 0 6px 4px; background: var(--surface); font-size: 12px; font-weight: 650; color: var(--muted); }
.ch-day em { font-style: normal; font-weight: 600; font-size: 11px; padding: 0 7px; border-radius: 999px; background: var(--neutral-soft); color: var(--neutral-ink); }
.changes-scroll .changes { margin-bottom: 6px; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--neutral-soft); color: var(--ink-2); padding: 2px 7px; border-radius: 6px; }
.notice .btn { flex: none; }

/* Công việc của tôi */
.ktiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .ktiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .ktiles.four .kt:first-child { grid-column: auto; } }
.page-head .actions .field { min-width: 220px; }
.panel.mine-list { margin-top: 16px; }
.panel.mine-list .toolbar { margin-bottom: 12px; }

/* Truy cập hệ thống */
.kt.static { cursor: default; } .kt.static:hover { transform: none; box-shadow: 0 10px 24px -12px var(--g1); }
.kt-v small { font-size: 18px; font-weight: 600; opacity: .8; margin-left: 2px; }
.log-scroll { max-height: 420px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line-2); border-radius: var(--r-md); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.log-scroll:focus-visible { box-shadow: var(--focus); }
table.log { width: 100%; border-collapse: collapse; }
table.log thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
.ph select { height: 34px; max-width: 280px; }
.who small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
