/* LSR Control — bảng điều khiển tối, bố cục lấy từ synapse-vault (16/11/2026), đã gọt bớt trang trí
   (unslop 16/11): không logo nhiều màu, không ô vuông màu trước tiêu đề, không góc nhấn, không nhãn in hoa,
   không quầng sáng / vòng nhấp nháy trên bản đồ. Màu chỉ còn ở bản đồ; mọi khung khác dùng dải xám.
   Phông: Be Vietnam Pro + IBM Plex Mono (SIL OFL 1.1), tự lưu ở /tinh/phong (CSP không cho tải ngoài);
   khối @font-face do tests/tao_phong_css.py sinh ra. */
/*PHONG*/
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("phong/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("phong/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("phong/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("phong/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; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("phong/be-vietnam-pro-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url("phong/be-vietnam-pro-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url("phong/be-vietnam-pro-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url("phong/be-vietnam-pro-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("phong/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: 500; font-display: swap; src: url("phong/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: 600; font-display: swap; src: url("phong/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: 700; font-display: swap; src: url("phong/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: "Plex Mono"; font-weight: 400; font-display: swap; src: url("phong/ibm-plex-mono-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: "Plex Mono"; font-weight: 500; font-display: swap; src: url("phong/ibm-plex-mono-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: "Plex Mono"; font-weight: 600; font-display: swap; src: url("phong/ibm-plex-mono-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: "Plex Mono"; font-weight: 400; font-display: swap; src: url("phong/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-weight: 500; font-display: swap; src: url("phong/ibm-plex-mono-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-display: swap; src: url("phong/ibm-plex-mono-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("phong/ibm-plex-mono-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: "Plex Mono"; font-weight: 500; font-display: swap; src: url("phong/ibm-plex-mono-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: "Plex Mono"; font-weight: 600; font-display: swap; src: url("phong/ibm-plex-mono-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; }
/*HET-PHONG*/

/* Màu: một dải xám than gần trung tính, ba vai chữ (text / muted / faint), một điểm nhấn ngà cho mục đang
   chọn và đường đi. Màu theo loại chỉ dùng trên bản đồ và chấm nhỏ cạnh tên, không tô khung, nút hay nhãn. */
:root {
  color-scheme: dark;
  --bg: #0b0c0e;
  --stage: #08090b;
  --panel: #111316;
  --panel-2: #181a1e;
  --line: #22252a;
  --line-2: #30343a;
  --text: #e6e7ea;
  --muted: #a6aab3;
  --faint: #858a94;
  --ivory: #f3ecd8;          /* mục đang chọn, đường đi, nút chính */
  --ok: #8fcf98; --warn: #d9b45f; --bad: #e0828c;
  /* màu loại thực thể (cùng bảng màu với canvas trong trang.js) */
  --t-he_thong: #6aa8ff;
  --t-don_vi: #f49ad8;
  --t-agent: #7ee08a;
  --t-bang: #3fd0c0;
  --t-kpi: #f2c14e;
  --t-quy_trinh: #ff9f5a;
  --t-su_kien: #ff7f8f;
  --f-ui: "Be Vietnam Pro", system-ui, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 8px;                  /* ô */
  --r-c: 6px;                /* nút, ô nhập */
  --ease: cubic-bezier(.2, 0, 0, 1);
  /* tên cũ, trang quản trị / đăng nhập còn dùng */
  --chu: var(--text); --chu-phu: var(--muted); --chu-mo: var(--faint); --ke: var(--line); --ke-2: var(--line-2);
  --o: var(--panel); --o-2: var(--panel-2); --o-3: #1f2226; --nen: var(--bg); --nhan: var(--ivory);
  --tot: var(--ok); --canh: var(--warn); --loi: var(--bad);
}

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); }
body { margin: 0; font-family: var(--f-ui); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--ivory); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ivory); outline-offset: 2px; }
::selection { background: #3b3a33; color: #fff; }
.an { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
.mo, .empty { color: var(--faint); font-size: 14px; }

.app {
  max-width: 1680px; margin: 0 auto; display: grid; gap: 16px;
  padding-block: 16px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ───────── đầu trang ───────── */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.brand { display: grid; gap: 2px; min-width: 0; }
.brand h1 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.brand p { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tuoi { display: inline-flex; align-items: center; gap: 8px; }
.cham-tuoi { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.cham-tuoi.tuoi-moi { background: var(--ok); }
.cham-tuoi.tuoi-cu { background: var(--warn); }
.stats { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-right: auto; }
.stats div { display: grid; }
.stats dd { order: -1; font-family: var(--f-mono); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats .warn dt::after, .stats .bad dt::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; background: var(--warn); }
.stats .bad dt::after { background: var(--bad); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 100%; }
.actions .nguoi { margin-left: auto; }
.search { position: relative; flex: 1 1 380px; max-width: 460px; }
.search input { width: 100%; background: var(--stage); border: 1px solid var(--line-2); border-radius: var(--r-c); padding: 6px 44px 6px 32px; font-size: 14px; height: 32px; }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: 2px solid var(--ivory); outline-offset: -1px; border-color: var(--ivory); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
/* gợi ý khi gõ: người phụ trách + mục khớp, bấm hoặc ↑ ↓ Enter */
.goi-y { position: absolute; left: 0; top: calc(100% + 4px); width: 420px; max-width: calc(100vw - 32px); max-height: min(60vh, 440px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-c); padding: 4px; z-index: 6; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.goi-y[hidden] { display: none; }
.gy-nhom { font-size: 12px; color: var(--faint); padding: 8px 8px 4px; }
.gy-dong { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.gy-dong:hover, .gy-dong[aria-selected="true"] { background: var(--panel-2); }
.gy-cham { width: 8px; height: 8px; border-radius: 50%; background: var(--c); grid-column: 1; }
.gy-ten { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.gy-loai { grid-column: 3; font-size: 12px; color: var(--muted); white-space: nowrap; }
.gy-doan { grid-column: 2 / 4; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gy-chan { font-size: 13px; color: var(--faint); padding: 8px; }
.gy-them { grid-column: 1 / 4; font-size: 13px; color: var(--muted); }
.gy-dong:hover .gy-them, .gy-dong[aria-selected="true"] .gy-them { color: var(--text); }
.search .count { position: absolute; right: 10px; top: 16px; transform: translateY(-50%); font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); pointer-events: none; }
.nguoi { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding-left: 8px; }

.btn, .nut {
  display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-c);
  height: 32px; padding: 0 12px; font-size: 14px; line-height: 1; cursor: pointer; white-space: nowrap; color: var(--text);
  text-decoration: none; transition: border-color .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover, .nut:hover { border-color: var(--muted); }
.btn:active, .nut:active { transform: scale(.98); }
.btn.primary, .nut-chinh { background: var(--ivory); color: #15130d; border-color: var(--ivory); font-weight: 500; }
.btn.primary:hover, .nut-chinh:hover { background: #fffaf0; color: #15130d; }
.btn.ghost { background: transparent; }
.btn[aria-pressed="true"], .btn[aria-expanded="true"] { border-color: var(--ivory); color: var(--ivory); }
.btn:disabled, .nut:disabled { opacity: .45; cursor: not-allowed; }
.nut-xoa:hover { border-color: var(--bad); color: var(--bad); }
/* thao tác không lùi lại được (xoá, thu hồi, gỡ, chạy bằng root, tắt / khởi động lại): chữ đỏ nhạt, viền đỏ khi rê */
.nut-nguy { color: var(--bad); }
.nut-nguy:hover, .nut-nguy:focus-visible { border-color: var(--bad); }

.bao-loi, .bao-tin { border-radius: var(--r-c); padding: 8px 12px; font-size: 14px; }
.bao-loi { border: 1px solid #4a3f22; background: #17150e; color: #e6c983; }
.bao-tin { border: 1px solid var(--line-2); background: var(--panel-2); }

/* ───────── ô ───────── */
.panel, .o { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; display: flex; flex-direction: column; }
.phead, .o-dau { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line); min-height: 48px; }
.plabel, .o h2 { font-size: 14px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.sp { margin-left: auto; }
.pmeta, .o-meta, .o-phu { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--faint); }
.o-meta { margin-left: auto; }
.o-than { padding: 16px; }
.o-chan { padding: 8px max(16px, calc(100% - 88ch)) 8px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-c); overflow: hidden; }
.seg button { background: transparent; border: 0; height: 28px; padding: 0 10px; font-size: 13px; color: var(--muted); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }
select.mini { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-c); font-size: 13px; height: 30px; padding: 0 8px; }
.phead .btn { height: 30px; font-size: 13px; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.chk input { accent-color: var(--ivory); margin: 0; }

/* ───────── bản đồ + cột phải ───────── */
.main { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 16px; }
.stage { position: relative; height: clamp(440px, 70vh, 780px); background: var(--stage); overflow: hidden; touch-action: none; border-bottom-left-radius: var(--r); border-bottom-right-radius: var(--r); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.stage canvas.tro { cursor: pointer; }
.stage canvas:active { cursor: grabbing; }

.legend { position: absolute; left: 12px; top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-c); padding: 4px; display: grid; gap: 0; max-height: calc(100% - 72px); overflow: auto; min-width: 180px; max-width: 260px; }
.legend > button { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 8px; align-items: center; background: transparent; border: 0; border-radius: 4px; height: 28px; padding: 0 8px; text-align: left; cursor: pointer; font-size: 13px; color: var(--text); }
.legend > button:hover { background: var(--panel-2); }
.legend > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.legend .n { font-family: var(--f-mono); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.legend > button.off { color: var(--faint); }
.legend > button.off .dot { opacity: .25; }
.legend .lh { font-size: 13px; color: var(--faint); padding: 4px 8px; display: flex; justify-content: space-between; gap: 8px; }
.legend .lh button { all: unset; cursor: pointer; color: var(--muted); }
.legend .lh button:hover { color: var(--text); }
.legend .lh button:focus-visible { outline: 2px solid var(--ivory); }
.legend.collapsed { min-width: 0; }
.legend.collapsed .lh button + button { display: none; }
/* nhắc khi lăn chuột trên bản đồ mà không giữ Ctrl: trang vẫn cuộn, bản đồ không tự thu nhỏ */
.nhac-lan { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); margin: 0; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-c); font-size: 13px; color: var(--text); pointer-events: none; white-space: nowrap; z-index: 2; }
.legend.collapsed > button, .legend.collapsed .dong-chu { display: none; }
.legend .dong-chu { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 4px; padding: 8px 8px 4px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.35; }
.legend .vet { height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--t-agent), transparent); }

.zoomctl { position: absolute; right: 12px; bottom: 12px; display: grid; gap: 4px; }
.zoomctl button { width: 32px; height: 32px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-c); cursor: pointer; font-family: var(--f-mono); font-size: 15px; color: var(--muted); transition: border-color .15s var(--ease), color .15s var(--ease); }
.zoomctl button:hover { border-color: var(--muted); color: var(--text); }

.settings { position: absolute; right: 12px; top: 12px; width: 252px; max-width: calc(100% - 24px); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-c); padding: 12px; display: grid; gap: 8px; z-index: 3; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.settings label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.settings label span { display: flex; justify-content: space-between; }
.settings label output { font-family: var(--f-mono); font-size: 12px; color: var(--text); }
.settings input[type=range] { width: 100%; accent-color: var(--ivory); }
.settings .chk { display: flex; }
.settings h4 { font-size: 13px; color: var(--faint); font-weight: 500; }
.settings h4 + label { margin-top: -4px; }
.settings .btn { justify-self: start; margin-top: 4px; }

.tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-c); padding: 8px 10px; font-size: 13px; max-width: 280px; z-index: 4; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.tip b { display: block; font-weight: 500; line-height: 1.35; }
.tip span { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }

/* ───────── mục đang chọn ───────── */
.inspector { min-height: 300px; }
.insp-scroll { position: absolute; inset: 0; overflow: auto; padding: 16px; display: grid; gap: 16px; align-content: start; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.insp-top { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; height: 24px; padding: 0 8px; border-radius: 4px; background: var(--panel-2); color: var(--muted); }
.tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tag.canh { color: var(--warn); }
.tag.manh { color: var(--text); }
.tag.loi { color: var(--bad); }
.inspector h2 { font-size: 20px; line-height: 1.3; font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; }
.phu-de { color: var(--muted); font-size: 14px; margin-top: -12px; }
.props { font-size: 13px; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.props dt { color: var(--faint); }
.props dt[title] { cursor: help; }
.props dd { color: var(--text); overflow-wrap: anywhere; }
.props .fm { grid-column: 1 / -1; color: var(--faint); }
.sua-but { background: none; border: 0; padding: 0; color: var(--faint); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.sua-but:hover { color: var(--ivory); }
.sua-nhanh { display: grid; gap: 8px; }
.sn-hang { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
#sn-gia-tri { grid-column: 1 / -1; grid-row: 2; }
.sn-hang select, .sn-hang input, .sn-hang textarea { width: 100%; min-width: 0; }
.sn-hang textarea { background: var(--stage); border: 1px solid var(--line-2); border-radius: var(--r-c); padding: 6px 10px; font: inherit; font-size: 14px; color: var(--text); resize: vertical; }
.sn-hang input[type="date"] { background: var(--stage); border: 1px solid var(--line-2); border-radius: var(--r-c); height: 32px; padding: 0 10px; font-size: 14px; color: var(--text); }
.sn-tin { font-size: 13px; color: var(--faint); }
.sn-tin.loi { color: var(--warn); }
.excerpt { color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
/* địa chỉ web của mục đang chọn: hàng nút "Mở" ngay dưới tên + link ngay trong ô giá trị */
.duong-dan { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.duong-dan[hidden] { display: none; }
.duong-dan-nhan { color: var(--faint); font-size: 13px; margin-right: 2px; }
.lk-mo { height: 28px; font-size: 13px; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 26px; }
.lk-mo::after { content: " ↗"; color: var(--faint); }
.lk-mo:hover::after { color: var(--text); }
a.lk-ngoai { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a.lk-ngoai:hover { color: var(--ivory); text-decoration-color: var(--ivory); }
.sec h3 { margin: 0 0 4px; font-size: 13px; color: var(--faint); font-weight: 500; display: flex; justify-content: space-between; gap: 8px; }
.sec h3 span + span { font-family: var(--f-mono); font-size: 12px; }
.sua-nhanh { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-c); }
.linklist { display: grid; gap: 0; }
.linklist button, .carelist button {
  width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  background: transparent; border: 0; border-radius: 4px; height: 28px; padding: 0 8px; text-align: left; cursor: pointer; font-size: 14px;
  transition: background-color .12s var(--ease);
}
.linklist button:hover, .carelist button:hover { background: var(--panel-2); }
.linklist .dot, .carelist .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); justify-self: center; }
.linklist .t, .carelist .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linklist .d, .carelist .d { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pathbox { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 8px; }
.pathbox input[type=text] { width: 100%; background: var(--stage); border: 1px solid var(--line-2); border-radius: var(--r-c); height: 32px; padding: 0 10px; font-size: 14px; }
.chain { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chain button { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 4px; height: 24px; padding: 0 8px; font-size: 13px; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.chain button i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.chain .ar { color: var(--ivory); font-family: var(--f-mono); font-size: 12px; }
.pathres { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

/* ───────── hàng dưới ───────── */
/* hàng dưới: ba ô danh sách ngang nhau, ô việc cần xử lý chạy hết bề ngang, mỗi nhóm việc một cột */
.lower { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.lower > .panel.rong { grid-column: 1 / -1; }
#ve-sinh { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 32px; }
.vs-nhom { display: grid; gap: 8px; align-content: start; min-width: 0; }
#mo-coi .carelist { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 32px; }
.pbody { padding: 12px 16px 16px; display: grid; gap: 12px; align-content: start; }
.bars { display: grid; gap: 0; margin-inline: -8px; }
.bars button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 72px minmax(20px, auto); gap: 12px; align-items: center; background: transparent; border: 0; border-radius: 4px; height: 28px; padding: 0 8px; cursor: pointer; text-align: left; transition: background-color .12s var(--ease); }
.bars button:hover { background: var(--panel-2); }
.bars .t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.bars .t span { overflow: hidden; text-overflow: ellipsis; }
.bars .track { height: 4px; background: var(--panel-2); border-radius: 2px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--line-2); border-radius: 2px; }
.bars li:first-child .fill { background: var(--muted); }
.bars .v { font-family: var(--f-mono); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.kpis { display: flex; gap: 24px; flex-wrap: wrap; }
.kpis div { display: grid; }
.kpis b { font-family: var(--f-mono); font-weight: 500; font-size: 16px; font-variant-numeric: tabular-nums; }
.kpis span { font-size: 13px; color: var(--muted); }
.carelist { display: grid; gap: 0; max-height: 168px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; margin-inline: -8px; }
.carelist.dai { max-height: 308px; }
.subh { font-size: 13px; color: var(--faint); display: flex; justify-content: space-between; gap: 8px; }
.subh b { font-family: var(--f-mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.subh[title] { cursor: help; }
.pbody .subh ~ .subh { margin-top: 4px; }

/* ───────── danh sách ───────── */
.bang-cuon { overflow: auto; max-height: 520px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.bang { border-collapse: collapse; width: 100%; font-size: 14px; }
.bang th { position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; font-size: 13px; font-weight: 500; color: var(--faint); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bang td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.bang th:first-child, .bang td:first-child { padding-left: 16px; }
.bang th:last-child, .bang td:last-child { padding-right: 16px; }
.bang tbody tr:hover td { background: var(--panel-2); }
.bang tr:last-child td { border-bottom: 0; }
.bang tr.chon td { background: #1a1b1e; }
.bang tr.chon td:first-child { box-shadow: inset 2px 0 var(--ivory); }
.bang .ten-o { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--text); font-weight: 500; }
.bang .ten-o:hover { color: var(--ivory); }
.bang .phu-o, .phu-o { color: var(--faint); font-size: 13px; }
.bang .loai-o, .bang .tt-o { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; color: var(--muted); }
.cham { width: 6px; height: 6px; border-radius: 50%; background: var(--mau, var(--line-2)); flex: none; display: inline-block; }
.bang .tt-o.canh { color: var(--warn); }
.bang .tt-o.loi { color: var(--bad); }
.bang .chu-o, .chu-o { color: var(--muted); font-size: 13px; }
.bang .lk-cot { text-align: right; }
.lk-o { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-family: var(--f-mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.thanh { width: 64px; height: 4px; border-radius: 2px; background: var(--panel-2); overflow: hidden; flex: none; }
.thanh i { display: block; height: 100%; background: var(--line-2); border-radius: 2px; }
.lk-o b { font-weight: 400; min-width: 2ch; text-align: right; }
.m-he_thong { --mau: var(--t-he_thong); } .m-agent { --mau: var(--t-agent); } .m-bang { --mau: var(--t-bang); }
.m-don_vi { --mau: var(--t-don_vi); } .m-kpi { --mau: var(--t-kpi); } .m-quy_trinh { --mau: var(--t-quy_trinh); } .m-su_kien { --mau: var(--t-su_kien); }

.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 13px; color: var(--faint); padding: 0 4px; }
.foot kbd { font-family: var(--f-mono); font-size: 12px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; margin-right: 4px; color: var(--muted); }

/* ───────── trang quản trị + đăng nhập (dùng lại thành phần trên) ───────── */
.dau { max-width: 1680px; margin: 16px auto; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
body > .dau, body > .bao-loi, body > .bao-tin, body > .luoi { margin-left: max(16px, calc((100% - 1680px) / 2)); margin-right: max(16px, calc((100% - 1680px) / 2)); }
body > .bao-loi, body > .bao-tin { margin-bottom: 16px; }
.hieu { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; }
.dau h1 { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--text); padding-left: 16px; border-left: 1px solid var(--line-2); margin-right: auto; }
.dieu-huong { display: flex; gap: 4px; }
.dieu-huong a { font-size: 14px; color: var(--muted); text-decoration: none; height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r-c); }
.dieu-huong a:hover { color: var(--text); background: var(--panel-2); }
.dieu-huong a[aria-current="page"] { color: var(--text); background: var(--panel-2); border-color: var(--line-2); }
.luoi { display: grid; gap: 16px; padding-bottom: 32px; }
.tren { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cot-trai, .cot-phai { display: grid; gap: 16px; min-width: 0; align-content: start; }
select, input[type="text"], input[type="email"] { background: var(--stage); border: 1px solid var(--line-2); border-radius: var(--r-c); height: 32px; padding: 0 10px; font-size: 14px; color: var(--text); min-width: 0; }
select:focus, input[type="text"]:focus, input[type="email"]:focus { outline: 2px solid var(--ivory); outline-offset: -1px; border-color: var(--ivory); }
input::placeholder { color: var(--faint); }
input[type="checkbox"] { accent-color: var(--ivory); margin: 0; width: 14px; height: 14px; }
.form-them { display: grid; grid-template-columns: minmax(200px, 1.4fr) 152px minmax(160px, 1.4fr) auto; gap: 12px; align-items: end; }
.truong { display: grid; gap: 4px; min-width: 0; }
.truong > span { font-size: 13px; color: var(--faint); }
.thanh-hl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.chon-het { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-right: auto; cursor: pointer; }
.bang .o-chon { width: 40px; padding-right: 0; }
.bang-nguoi td { vertical-align: middle; }
.bang-nguoi select { width: 112px; }
.o-ghi-chu { width: 100%; min-width: 160px; }
.bang-nguoi td.chu-o { white-space: nowrap; font-variant-numeric: tabular-nums; }
section.o > .bang-cuon:has(.bang-quyen) { max-height: none; }
.bang .o-tac { white-space: nowrap; text-align: right; }
.bang .o-tac .nut + .nut { margin-left: 4px; }
.vai-o { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.vai-quan_tri { color: var(--text); }
.bang .o-giua { text-align: center; width: 84px; }
.bang-quyen td { vertical-align: middle; }
.bang-quyen .o-giua { width: 48px; padding-inline: 2px; }
.co { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.khong { color: var(--faint); }
.sap-co .ten-o { color: var(--muted); font-weight: 400; }
.nhat-ky { display: grid; max-height: 420px; overflow-y: auto; }
.nhat-ky li { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.nhat-ky li:first-child { border-top: 0; padding-top: 0; }
.nhat-ky li.mo { display: block; }
.nhat-ky .ngay { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nhat-ky b { font-weight: 500; }
.nhat-ky .phu-o { display: block; }
.trang-dang-nhap { display: grid; place-items: center; min-height: 92vh; padding: 16px; }
.khung-dang-nhap { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 32px; width: 100%; max-width: 440px; display: grid; gap: 16px; justify-items: start; }
.dn-hinh { display: block; margin-bottom: 8px; }
.dn-mo-ta { color: var(--muted); font-size: 14px; }
.khung-dang-nhap .nut-chinh { height: 40px; padding: 0 16px; }
.khung-dang-nhap h1 { font-size: 20px; line-height: 1.3; font-weight: 600; text-wrap: balance; }
.khung-dang-nhap .bao-loi { width: 100%; }

/* ───────── khai báo + duyệt ───────── */
.btn .so-cho { font-family: var(--f-mono); font-size: 12px; color: var(--ivory); font-variant-numeric: tabular-nums; }
.dieu-huong .so {font-family: var(--f-mono); font-size: 12px; color: var(--ivory); margin-left: 6px; font-variant-numeric: tabular-nums; }
.chon-loai { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; border-bottom: 1px solid var(--line); }
.chon-loai select { width: 220px; }
.dang-sua { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.dang-sua .loai-o { color: var(--faint); font-size: 13px; }
.dang-sua b { font-weight: 500; }
.form-kb { display: grid; gap: 16px; }
.form-kb .hai-cot { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.form-kb input[type="text"], .form-kb input[type="date"], .form-kb select, .form-kb textarea { width: 100%; }
input[type="date"], textarea, input[type="search"].kb-loc { background: var(--stage); border: 1px solid var(--line-2); border-radius: var(--r-c); font: inherit; font-size: 14px; color: var(--text); }
input[type="date"] { height: 32px; padding: 0 10px; color-scheme: dark; }
textarea { min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
textarea:focus, input[type="date"]:focus, .kb-loc:focus { outline: 2px solid var(--ivory); outline-offset: -1px; border-color: var(--ivory); }
.truong > span .bat-buoc { color: var(--ivory); }
.kb-nhieu { border: 1px solid var(--line); border-radius: var(--r-c); padding: 8px 12px; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.kb-nhieu legend { font-size: 13px; color: var(--faint); padding: 0 4px; }
.kb-nhieu label, .kb-ds label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.kb-lk { border: 1px solid var(--line); border-radius: var(--r-c); }
.kb-lk summary { display: flex; align-items: baseline; gap: 12px; padding: 8px 12px; cursor: pointer; font-size: 14px; list-style: none; }
.kb-lk summary::-webkit-details-marker { display: none; }
.kb-lk summary::before { content: "+"; font-family: var(--f-mono); color: var(--faint); width: 10px; }
.kb-lk[open] summary::before { content: "−"; }
.kb-lk summary .phu-o { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 12px; }
.kb-lk[open] summary { border-bottom: 1px solid var(--line); }
.kb-loc { display: block; width: calc(100% - 24px); margin: 8px 12px; height: 30px; padding: 0 10px; }
.kb-ds { max-height: 240px; overflow-y: auto; padding: 0 12px 8px; display: grid; gap: 2px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.kb-ds li { padding: 2px 0; }
.kb-gui { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.kb-gui .phu-o { flex: 1 1 260px; }
.kb-cua li { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.kb-cua li:first-child { border-top: 0; padding-top: 0; }
.kb-cua .ngay, .kb-the .ngay { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.kb-cua b, .kb-the b { font-weight: 500; }
.kb-hang { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tt-kb { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.tt-kb::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.tt-cho::before { background: var(--warn); }
.tt-duyet::before { background: var(--ok); }
.tt-tu_choi::before { background: var(--bad); }
.kb-cua form { justify-self: start; }
.kb-duyet { display: grid; }
.kb-the { display: grid; gap: 12px; padding: 16px; border-top: 1px solid var(--line); }
.kb-the:first-child { border-top: 0; }
.kb-the-dau { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; align-items: start; font-size: 14px; }
.kb-the-dau input { margin-top: 4px; }
.kb-canh { font-size: 13px; color: var(--warn); }
.kb-ly-do { font-size: 14px; color: var(--muted); border-left: 2px solid var(--line-2); padding-left: 12px; white-space: pre-wrap; }
.kb-bang { border: 1px solid var(--line); border-radius: var(--r-c); }
.kb-bang td { word-break: break-word; }
.kb-bang td:first-child { width: 28%; color: var(--muted); }
.kb-the > .kb-bang, .kb-the > .kb-canh, .kb-the > .kb-ly-do { margin-left: 26px; }
.cua-toi { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; }
.cua-toi .ct-nhan { font-weight: 500; }
.cua-toi .ct-mo { color: var(--faint); font-size: 13px; }
.cua-toi a { font-size: 13px; }
.ct-muc { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.ct-chip { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-c); font-size: 13px; cursor: pointer; }
.ct-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.ct-chip:hover { border-color: var(--muted); }
.ct-chip[aria-pressed="true"] { border-color: var(--ivory); color: var(--ivory); }
.tk-tt {display: grid; gap: 12px; font-size: 14px; }
.tk-chua summary { cursor: pointer; }
.tk-chua p { margin-top: 8px; word-break: break-word; }
.form-chan {display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; border-bottom: 1px solid var(--line); }
.form-chan input { width: 100%; }
.nhat-ky li form { margin-top: 4px; }
.thanh-hl input[name="ghi_chu"] { width: 280px; max-width: 100%; }

/* ───────── thanh điều hướng bên trái + trang nhóm ───────── */
.co-menu { padding-left: 224px; }
.menu { position: fixed; inset: 0 auto 0 0; width: 224px; overflow-y: auto; padding: 16px 8px 24px; background: var(--panel); border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; z-index: 5; }
.menu-dau { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 12px; }
.menu-hieu { font-weight: 600; font-size: 16px; color: var(--text); text-decoration: none; }
.menu-gon, .menu-mo { background: none; border: 1px solid var(--line-2); border-radius: var(--r-c); color: var(--muted); cursor: pointer; height: 28px; padding: 0 8px; font-size: 13px; }
.menu-gon:hover, .menu-mo:hover { color: var(--text); border-color: var(--muted); }
.menu-mo { display: none; position: fixed; left: 8px; top: 8px; z-index: 6; background: var(--panel); }
.menu h2 { font-size: 13px; font-weight: 500; color: var(--faint); padding: 16px 8px 4px; }
.menu ul { display: grid; gap: 2px; }
.menu li a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 4px 8px; border-radius: var(--r-c); font-size: 14px; color: var(--muted); text-decoration: none; }
.menu li a:hover { color: var(--text); background: var(--panel-2); }
.menu li a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.menu li a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 1px; background: var(--ivory); }
.menu .so { font-family: var(--f-mono); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.menu .so-cho { color: var(--ivory); }
.menu-dong .co-menu { padding-left: 0; }
.menu-dong .menu { display: none; }
.menu-dong .menu-mo { display: block; }
.menu-dong .co-menu > .dau, .menu-dong .co-menu .top { padding-left: 76px; }
.dau h1:first-child { padding-left: 0; border-left: 0; }
.loc-nhom { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.loc-nhom b { font-weight: 500; }
.nhom-tom { justify-content: flex-end; }
.nhom-so { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-right: auto; }
.nhom-so div { display: grid; }
.nhom-so dd { order: -1; font-family: var(--f-mono); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.nhom-so dt { font-size: 13px; color: var(--muted); }
.nhom-so .warn dt::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; background: var(--warn); }
.bang-nhom { min-width: 760px; }
.bang-nhom a.ten-o { text-decoration: none; display: block; }
.bang-nhom .phu-o { display: block; }
.bang-nhom .thieu { color: var(--warn); font-size: 13px; }
.bang-nhom td { vertical-align: middle; }
.bang-nhom .o-tac .nut, .nhom-tom .nut { text-decoration: none; display: inline-flex; align-items: center; }
section.o > .bang-cuon:has(.bang-nhom) { max-height: none; }
.bang-nhom .o-song { white-space: nowrap; }
/* ô ngắn (trạng thái, mức) không xuống dòng; cột người có bề ngang tối thiểu; ô hẹp lại để cột nút không bị đẩy ra ngoài khung */
.bang-nhom .o-ngan { white-space: nowrap; }
.bang-nhom .o-nguoi { min-width: 152px; max-width: 224px; }
.bang-nhom .ng { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bang-nhom .ng-cd { color: var(--faint); font-size: 13px; }
.bang-nhom .o-tac { text-align: left; }
.lk-tac { display: inline-block; padding: 4px 0; margin-right: 12px; color: var(--muted); text-decoration: none; }
.lk-tac:last-child { margin-right: 0; }
.lk-tac:hover { color: var(--text); text-decoration: underline; }
.lk-tac.co-noi { color: var(--ivory); }
.bang-nhom th, .bang-nhom td { padding-inline: 8px; }
.bang-nhom th:first-child, .bang-nhom td:first-child { padding-left: 16px; }
.bang-nhom th:last-child, .bang-nhom td:last-child { padding-right: 16px; }
.song { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.song::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); flex: none; }
.song-ok::before { background: var(--ok); }
.song-loi { color: var(--bad); }
.song-cho { color: var(--faint); }
.song-loi::before { background: var(--bad); }
.nhom-so .bad dt::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; background: var(--bad); }
.form-lenh { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.form-lenh input[type="text"] { width: 230px; }
.form-lenh select { width: 200px; }
.form-gan { display: flex; gap: 8px; align-items: center; }
/* ô xác nhận chỉ hiện khi việc đang chọn cần (lenh.js); không có JS thì luôn hiện */
.co-js .form-lenh input[name="xac_nhan"]:not(.hien) { display: none; }
details.gan > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: baseline; gap: 8px; border-radius: 4px; }
details.gan > summary::-webkit-details-marker { display: none; }
details.gan > summary::after { content: "đổi"; color: var(--faint); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
details.gan[open] > summary::after { content: "đóng"; }
details.gan[open] > summary { margin-bottom: 8px; }
.form-gan select { width: 260px; max-width: 100%; }
.bang-lenh .phu-o { display: block; }
.lenh-ra { margin: 0; padding: 12px; max-height: 420px; overflow: auto; font-family: var(--f-mono); font-size: 13px; line-height: 1.5; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.bang-lenh td { vertical-align: middle; }
.quet-may { justify-content: space-between; background: none; }
.quet-may .phu-o { flex: 1 1 320px; }
/* khai nhanh */
.kb-nhanh { display: grid; gap: 12px; }
.kb-trung { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--warn); margin-top: -8px; }
.kb-trung a { color: var(--ivory); }
.kb-them { border: 1px solid var(--line); border-radius: var(--r-c); }
.kb-them > summary { display: flex; align-items: baseline; gap: 12px; padding: 8px 12px; cursor: pointer; font-size: 14px; list-style: none; }
.kb-them > summary::-webkit-details-marker { display: none; }
.kb-them > summary::before { content: "+"; font-family: var(--f-mono); color: var(--faint); width: 10px; }
.kb-them[open] > summary::before { content: "−"; }
.kb-them[open] > summary { border-bottom: 1px solid var(--line); }
.kb-them-than { display: grid; gap: 16px; padding: 12px; }
@media (max-width: 980px) {
  .co-menu { padding-left: 0; }
  .menu { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; max-height: 44vh; }
  .menu ul { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .menu h2 { padding-top: 8px; }
  .menu-dong .co-menu > .dau, .menu-dong .co-menu .top { padding-left: 16px; }
  .menu-mo { position: static; margin: 8px; }
}
@media (max-width: 980px) { .lower { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 980px) {
  .main, .tren { grid-template-columns: minmax(0, 1fr); }
  .insp-scroll { position: static; max-height: none; }
  .form-them { grid-template-columns: minmax(0, 1fr) 152px; }
}
@media (max-width: 640px) {
  .lower { grid-template-columns: minmax(0, 1fr); }
  .stage { height: 64vh; min-height: 380px; }
  .legend { min-width: 0; max-height: 46%; }
  .stats { gap: 4px 20px; width: 100%; }
  .stats dd { font-size: 16px; }
  .actions { width: 100%; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .nguoi { padding-left: 0; }
  .form-them { grid-template-columns: minmax(0, 1fr); }
  .dau h1 { padding-left: 0; border-left: 0; flex-basis: 100%; }
  .nhat-ky li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kb-the > .kb-bang, .kb-the > .kb-canh, .kb-the > .kb-ly-do { margin-left: 0; }
  .chon-loai select { width: 100%; }
  .props { grid-template-columns: 96px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── lệnh tầng 4: chọn máy, SSH, bảng lệnh ── */
.may-chon { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.may-the { display: grid; gap: 4px; min-width: 190px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; color: inherit; text-decoration: none; }
.may-the:hover { border-color: var(--muted); }
.may-the.dang-chon { border-color: var(--text); background: var(--panel-2); }
.may-the .song { justify-self: start; }
.ma-may { display: grid; gap: 8px; border-top: 1px solid var(--line); }
.ma-may p { margin: 0; }
.noi-may { display: grid; gap: 12px; max-width: 920px; }
.noi-may p { margin: 0; }
.noi-may ol { margin: 0; padding-left: 20px; display: grid; gap: 12px; list-style: decimal; }
.noi-may li .thanh-hl { padding: 8px 0 0; border: 0; }
.noi-may li .lenh-ra { margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.bao-loi p { margin: 0; }
.bao-loi p + p { margin-top: 4px; }
.nhan-ct { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; line-height: 16px; color: var(--muted); vertical-align: 1px; }
.bang-lenh .o-ht { vertical-align: top; min-width: 200px; max-width: 300px; border-right: 1px solid var(--line); }
.bang-lenh tr.dau-nhom td { border-top: 1px solid var(--line); }
.bang-lenh .khong-xuong { white-space: nowrap; }
.bang-lenh a.lk-may { color: var(--muted); text-decoration: none; }
.bang-lenh a.lk-may:hover { color: var(--text); text-decoration: underline; }
.bang-lenh .o-ht a.ten-o { color: inherit; text-decoration: none; }
.bang-lenh .o-ht a.ten-o:hover { text-decoration: underline; }
.thanh-hl .o-khoa { flex: 1 1 360px; font-family: var(--f-mono); font-size: 13px; }
.man-hinh { max-height: 520px; overflow: auto; padding: 12px 16px; font-family: var(--f-mono); font-size: 13px; line-height: 1.5; border-bottom: 1px solid var(--line); }
.mh-lenh { margin-top: 8px; color: var(--text); overflow-wrap: anywhere; }
.mh-lenh:first-child { margin-top: 0; }
.mh-lenh .phu-o { display: inline; margin-left: 8px; font-family: var(--f-sans, inherit); }
.mh-dau { color: var(--faint); font-family: var(--f-mono); font-size: 13px; white-space: nowrap; }
.mh-ra { margin: 4px 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.mh-cho { color: var(--faint); }
.mh-nhap { flex-wrap: nowrap; border-bottom: 0; }
.mh-root b { color: var(--bad); font-weight: 500; }
.mh-nhap input[type="text"] { flex: 1 1 auto; min-width: 0; font-family: var(--f-mono); font-size: 13px; }
@media (max-width: 720px) { .mh-nhap { flex-wrap: wrap; } }

/* trang quản trị một hệ thống (/he-thong/<id>) và khối của bộ nối */
.ht-dau { justify-content: space-between; background: none; }
.ht-dau .phu-o { flex: 1 1 360px; }
.ht-nut { display: flex; flex-wrap: wrap; gap: 8px; }
.ht-nut .nut, .bang-nhom .o-tac a.nut { text-decoration: none; display: inline-flex; align-items: center; }
.bang-noi { min-width: 720px; }
.bang-noi .phu-o { display: block; }
.bang-noi .form-lenh .o-so { width: 132px; text-align: right; font-variant-numeric: tabular-nums; }
.noi-them { background: none; border-top: 1px solid var(--line); border-bottom: 0; }
.noi-them label { display: inline-flex; align-items: center; gap: 8px; }
.noi-them input[type="email"] { width: 240px; }
.noi-them input[name="xac_nhan"] { width: 240px; }
.o > p.bao-loi.o-than { margin: 16px; }

/* Trang Hệ thống: một bảng, lọc bằng thẻ (link) và ô tìm */
.the-day { display: flex; flex-wrap: wrap; gap: 4px; }
.the { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-c); color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.the:hover { color: var(--text); border-color: var(--muted); }
.the[aria-current="true"] { background: var(--ivory); border-color: var(--ivory); color: #15130d; font-weight: 500; }
.the .so { font-family: var(--f-mono); font-size: 12px; font-variant-numeric: tabular-nums; opacity: .75; }
.the-loi:not([aria-current="true"]) { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line-2)); }
.the-day-nhom { padding: 8px 16px; border-bottom: 1px solid var(--line); }
.ht-loc .ht-tim { flex: 0 1 240px; height: 28px; }
.ht-loc .ht-nut { margin-left: auto; display: flex; gap: 8px; }
.bang-ht .o-song .song { display: block; }
.bang-ht .o-lam { color: var(--text); font-size: 13px; }
.bang-ht .o-tac .nut { margin-right: 12px; }
.bang-ht tr[hidden] { display: none; }
.ht-loc .ht-tim { background: var(--stage); border: 1px solid var(--line-2); border-radius: var(--r-c); padding: 0 10px; font-size: 14px; color: var(--text); min-width: 0; }
.ht-loc .ht-tim:focus { outline: 2px solid var(--ivory); outline-offset: -1px; border-color: var(--ivory); }
/* Trang của một hệ thống: tóm tắt thông tin bản đồ và ô sửa tại chỗ */
.ht-tom { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ht-tom div { display: grid; min-width: 0; }
.ht-tom dt { font-size: 12px; color: var(--faint); }
.ht-tom dd { font-size: 14px; overflow-wrap: anywhere; }
.ht-sua { margin: 12px 16px 16px; }
.ht-sua > .form-kb { padding: 12px; }

/* ── /nghi-viec: người nghỉ việc còn tài khoản ── */
.nv-phai { margin-left: auto; }
.nv-hang { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nv-them { grid-template-columns: minmax(200px, 1.2fr) minmax(160px, 1.2fr) 152px auto; }
.nv-nguoi { border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.nv-nguoi:target { background: var(--panel-2); }
.nv-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 12px 16px; }
.nv-dau .phu-o { display: block; }
.nv-nguoi .bang-cuon { max-height: none; }
.nv-nap { cursor: pointer; }
.nv .thieu { color: var(--warn); font-size: 13px; }
@media (max-width: 760px) { .nv-them { grid-template-columns: 1fr; } }
.nv .o-tac .nv-hang { justify-content: flex-end; }
.nv-nguoi .bang { table-layout: fixed; }
.nv-nguoi .bang th:nth-child(1) { width: 18%; } .nv-nguoi .bang th:nth-child(3) { width: 20%; } .nv-nguoi .bang th:nth-child(4) { width: 18%; } .nv-nguoi .bang th:nth-child(5) { width: 96px; }
.nv-nguoi .bang td { overflow-wrap: anywhere; }

/* ───────── cơ sở dữ liệu (csdl.html, csdl_db.html) ───────── */
.cs-giai { color: var(--muted); font-size: 14px; max-width: 88ch; padding: 12px 16px 16px; }
.cs-may { font-size: 15px; font-weight: 600; padding: 16px 16px 8px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.cs-may .phu-o { font-weight: 400; }
.cs-cao { max-height: none; }
.bang-cs .cs-so, .bang-cs th.cs-so { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bang-cs .cs-rong { min-width: 280px; max-width: 72ch; }
.cs-ten { font-family: var(--f-mono); font-size: 13px; overflow-wrap: anywhere; }
.bang-cs .phu-o, .cs-dong { display: block; }
.bang-cs .cs-muc { display: flex; margin-top: 4px; }
.cs-tt { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 24px; padding: 12px 16px 16px; }
.cs-tt dt { color: var(--faint); font-size: 13px; }
.cs-tt dd { overflow-wrap: anywhere; }
.cs-cot > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.cs-cot ul { list-style: none; margin: 8px 0 4px; display: grid; gap: 2px; }
.cs-cot li .phu-o { display: inline; }

/* ── /github: tổ chức trên GitHub, chỉ đọc ──
   Một khung đầu trang (tổ chức, độ mới, thẻ chuyển phần) rồi mỗi phần một ô. Mọi bảng một dòng một mục: chi tiết phụ
   nằm ở chú thích và ở trang của từng repo. Số nào cũng là link tới danh sách tạo ra nó. */
.gh .thieu { color: var(--warn); font-size: 13px; }
.gh .bang-cuon { max-height: none; }
.gh code { font-family: var(--f-mono); font-size: 13px; }
.gh-so { font-family: var(--f-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.gh-muc { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.gh-lk { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.gh-muc:hover, .gh-lk:hover { color: var(--ivory); text-decoration: underline; }
a.song.gh-lk { color: var(--muted); display: inline-flex; }
a.song-loi.gh-lk { color: var(--bad); }
.gh a.thieu { color: var(--warn); }
.gh-loi { display: grid; gap: 4px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--warn); }

/* đầu trang + thẻ chuyển phần */
.gh-dau { border-bottom: 0; padding-bottom: 0; }
.gh-dau h2 { font-size: 16px; font-weight: 600; }
.gh-tab, .tab-day { display: flex; gap: 4px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
.gh-tab a, .tab-day a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px; color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; box-shadow: inset 0 -2px transparent; transition: color .15s var(--ease), box-shadow .15s var(--ease); }
.gh-tab a:hover, .tab-day a:hover { color: var(--text); box-shadow: inset 0 -2px var(--line-2); }
.gh-tab a[aria-current="page"] { color: var(--text); font-weight: 500; box-shadow: inset 0 -2px var(--ivory); }
.gh-tab a:focus-visible, .tab-day a:focus-visible { outline-offset: -2px; }
.gh-tab .so, .tab-day .so { font-family: var(--f-mono); font-size: 12px; font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; }

/* tổng quan: việc cần xử lý */
.gh-viec a { display: grid; grid-template-columns: 6px 3ch minmax(0, 1fr) 8px; gap: 12px; align-items: center; min-height: 40px; padding: 8px 16px; color: var(--text); text-decoration: none; border-top: 1px solid var(--line); transition: background-color .12s var(--ease); }
.gh-viec li:first-child a { border-top: 0; }
.gh-viec li:last-child a { border-radius: 0 0 var(--r) var(--r); }
.gh-viec a:hover { background: var(--panel-2); }
.gh-viec .so { font-family: var(--f-mono); font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.gh-viec .di { color: var(--faint); transition: transform .15s var(--ease), color .15s var(--ease); }
.gh-viec a:hover .di { color: var(--ivory); transform: translateX(2px); }
.m-loi { --mau: var(--bad); } .m-canh { --mau: var(--warn); } .m-nhe { --mau: var(--line-2); }

/* nhịp commit: vài con số + biểu đồ cột theo ngày, cột là link lọc */
.gh-nhip-so { display: flex; flex-wrap: wrap; gap: 4px 28px; padding: 12px 16px 0; }
.gh-nhip-so div { display: grid; }
.gh-nhip-so dd { order: -1; font-family: var(--f-mono); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.gh-nhip-so dt { font-size: 13px; color: var(--muted); }
.gh-bieu-khung { display: grid; gap: 6px; padding: 16px 16px 12px; max-width: 760px; }
.gh-bieu { display: block; width: 100%; height: 72px; border-bottom: 1px solid var(--line-2); overflow: visible; }
.gh-bieu .vung { fill: transparent; }
.gh-bieu .cot { fill: var(--faint); transition: fill .12s var(--ease); }
.gh-bieu.co-chon .cot { fill: var(--line-2); }
.gh-bieu a:hover .vung, .gh-bieu a:focus-visible .vung { fill: var(--panel-2); }
.gh-bieu a:hover .cot, .gh-bieu a.chon .cot { fill: var(--ivory); }
.gh-bieu a:focus-visible { outline: none; }
.gh-bieu a:focus-visible .cot { fill: var(--ivory); }
.gh-bieu-moc { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.gh-ngay-chon { padding: 0 16px 12px; font-size: 13px; color: var(--faint); }
.gh-het { font-size: 13px; color: var(--muted); }
.gh-het:hover { color: var(--ivory); }

/* xếp hạng: tên, thanh, số */
.gh-xep { display: grid; padding: 8px; }
.gh-xep a { display: grid; grid-template-columns: minmax(0, 1fr) 96px 4ch; gap: 12px; align-items: center; height: 32px; padding: 0 8px; border-radius: 4px; color: var(--text); text-decoration: none; font-size: 14px; transition: background-color .12s var(--ease); }
.gh-xep a:hover { background: var(--panel-2); }
.gh-xep .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh-xep .v { font-family: var(--f-mono); font-size: 13px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.gh-thanh { display: block; width: 100%; height: 4px; border-radius: 2px; background: var(--panel-2); }
.gh-xep a:hover .gh-thanh { background: var(--line); }
.gh-thanh rect { fill: var(--muted); }
.gh-thanh-o { width: 72px; }

/* bảng một dòng một mục */
.bang-gh { min-width: 0; }
.bang-gh td { vertical-align: middle; white-space: nowrap; }
.bang-gh td.gh-o-rong { white-space: normal; min-width: 160px; }
.bang-gh .phu-o { display: inline; }
.bang-gh .gh-dong { display: block; white-space: normal; max-width: 60ch; }
.bang-gh a.ten-o { display: inline; text-decoration: none; }
.bang-gh .gh-ngu { margin-left: 8px; }
.bang-gh .nhan-ct { margin-left: 8px; }
.bang-gh tr[hidden] { display: none; }
.gh-nhip { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.gh-nhip .gh-so { min-width: 3ch; text-align: right; color: var(--text); }
a.gh-nhip:hover .gh-so { color: var(--ivory); }
a.gh-nhip:hover .gh-tia rect { fill: var(--muted); }
.gh-tia { display: block; flex: none; }
.gh-tia rect { fill: var(--faint); transition: fill .12s var(--ease); }
.gh-them { color: var(--faint); font-size: 13px; white-space: nowrap; }
.gh-them:hover { color: var(--ivory); }
.gh-ve { color: var(--muted); text-decoration: none; font-size: 14px; }
.gh-ve:hover { color: var(--ivory); text-decoration: underline; }
.gh-mo-ta { padding: 12px 16px 0; color: var(--muted); font-size: 14px; max-width: 88ch; }
.gh-tom dd .phu-o { margin-left: 4px; }
.gh-tom { border-bottom: 0; }

/* gắn repo vào bản đồ ngay tại dòng */
.gh-gan > summary { display: inline-flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; border-radius: 4px; }
.gh-gan > summary::-webkit-details-marker { display: none; }
.gh-gan > summary .thieu { color: var(--faint); }
.gh-gan-nut { color: var(--ivory); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.gh-gan[open] > summary { margin-bottom: 8px; }
.gh-gan[open] .gh-gan-nut { color: var(--faint); }
.gh-gan .form-gan select { width: 240px; max-width: 100%; }
.gh-gan .phu-o { display: block; margin-top: 4px; white-space: normal; }

/* danh sách commit: gom theo ngày, mỗi commit một dòng */
.gh-loc select { max-width: 220px; }
.gh-loc .ht-tim { flex: 1 1 220px; max-width: 360px; height: 32px; background: var(--stage); border: 1px solid var(--line-2); border-radius: var(--r-c); padding: 0 10px; font-size: 14px; color: var(--text); min-width: 0; }
.gh-loc .ht-tim:focus { outline: 2px solid var(--ivory); outline-offset: -1px; border-color: var(--ivory); }
.gh-ngay { display: flex; align-items: baseline; gap: 12px; padding: 16px 16px 4px; }
.gh-ngay h3 { font-size: 13px; font-weight: 600; color: var(--text); }
.o-dau + .gh-ngay { padding-top: 12px; }
.gh-cm { display: grid; padding: 0 8px; }
.gh-cm:last-child, .gh-cm:has(+ .gh-trang) { padding-bottom: 8px; }
.gh-cm li { display: grid; grid-template-columns: 5ch minmax(10ch, 2fr) minmax(8ch, 1.6fr) minmax(0, 8fr) auto; gap: 0 12px; align-items: baseline; padding: 5px 8px; border-radius: 4px; font-size: 14px; }
.gh-cm-1repo li { grid-template-columns: 5ch minmax(8ch, 1.6fr) minmax(0, 10fr) auto; }
.gh-cm li:hover { background: var(--panel-2); }
.gh-cm a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-gio, .cm-sha { font-family: var(--f-mono); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cm-repo { color: var(--text); font-size: 13px; font-weight: 500; }
.cm-ai { color: var(--muted); font-size: 13px; }
.cm-chu { color: var(--text); }
.gh-cm .gop .cm-chu { color: var(--faint); }
.gh-cm a:hover { color: var(--ivory); text-decoration: underline; text-underline-offset: 3px; }
.cm-duoi { display: inline-flex; align-items: baseline; gap: 8px; }
.gh-trang { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); min-height: 48px; }
.gh-trang .o-phu { margin-right: auto; }
.gh-bao { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 16px 12px; padding: 8px 12px; border: 1px solid #4a3f22; border-radius: var(--r-c); background: #17150e; color: #e6c983; font-size: 14px; }
.gh-bao span { flex: 1 1 320px; }
@media (max-width: 760px) {
  .gh-cm li, .gh-cm-1repo li { grid-template-columns: 5ch minmax(0, 1fr) minmax(0, 1fr); row-gap: 2px; padding-block: 8px; }
  .gh-cm-1repo li { grid-template-columns: 5ch minmax(0, 1fr); }
  .gh-cm .cm-chu { grid-column: 1 / -1; white-space: normal; overflow-wrap: anywhere; }
  .gh-cm .cm-duoi { grid-column: 1 / -1; }
  .gh-loc select, .gh-loc .ht-tim { max-width: none; flex: 1 1 100%; }
  .gh-xep a { grid-template-columns: minmax(0, 1fr) 56px 4ch; }
}

/* ── /he-thong: một dòng một mục, gom theo loại ── */
.bang-ht { min-width: 0; }
.bang-ht td { white-space: nowrap; }
.bang-ht .phu-o { display: inline; }
.bang-ht a.ten-o { display: inline; }
.bang-ht td.ht-o-ten { white-space: normal; min-width: 30ch; max-width: 52ch; }
.bang-ht td.o-nguoi { max-width: 30ch; overflow: hidden; text-overflow: ellipsis; }
.ht-loc .ht-tim { flex: 0 1 300px; }
.bang-ht .o-song .song { display: inline-flex; margin-right: 12px; }
.bang-ht .ht-tt { color: var(--faint); font-size: 13px; }
.bang-ht .ht-tt.canh { color: var(--warn); }
.bang-ht .ht-tt.tat { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-2); }
.bang-ht .o-lam { max-width: 40ch; overflow: hidden; text-overflow: ellipsis; }
.bang-ht td.chu-o { max-width: 40ch; overflow: hidden; text-overflow: ellipsis; }
.bang-ht .ht-them { color: var(--faint); font-size: 13px; margin-left: 6px; }
.bang-ht .o-tac { text-align: right; }
.bang-ht .o-tac .nut { height: 28px; font-size: 13px; margin: 0 0 0 12px; }
.bang-ht .lk-tac { font-size: 13px; margin: 0 0 0 12px; padding: 0; }
.bang-ht tr.ht-nhom td { padding: 20px 16px 6px; background: none; border-bottom: 1px solid var(--line); }
.bang-ht tr.ht-nhom:first-child td { padding-top: 12px; }
.bang-ht tr.ht-nhom:hover td { background: none; }
.ht-nhom a { color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; }
.ht-nhom a:hover { color: var(--ivory); text-decoration: underline; text-underline-offset: 3px; }
.ht-nhom .so { margin-left: 8px; font-family: var(--f-mono); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tab-day { border-top: 1px solid var(--line); }
.ht-dau2 h2 { font-size: 16px; font-weight: 600; }
.ht-dau2 .tag { height: 22px; }
.o:target, .o:has(> :target) { border-color: var(--line-2); }
details.kb-them + .tab-day { margin-top: 8px; }
.o[id] { scroll-margin-top: 16px; }

/* ── /co-so-du-lieu: cùng khuôn với /github; trang một database hiện sẵn mọi cột ── */
.cs .cs-so, .cs th.cs-so { text-align: right; }
.cs-toan { padding-bottom: 16px; }
.cs-xep a { grid-template-columns: minmax(0, 1fr) 72px 8ch; }
.cs-xep .t .khong { font-size: 13px; margin-left: 6px; }
.bang-cs1 td.ht-o-ten { min-width: 24ch; max-width: 56ch; }
.bang-cs1 .cs-ten { overflow-wrap: anywhere; }
.bang-cs2 td { white-space: normal; vertical-align: top; }
.bang-cs2 td.cs-so { white-space: nowrap; }
.bang-cs2 .cs-o-bang { min-width: 22ch; max-width: 40ch; }
.bang-cs2 .cs-o-bang .phu-o.cs-dong { display: block; }
.bang-cs2 .cs-o-cot { line-height: 1.9; }
.cs-ld { color: var(--text); font-weight: 600; }
.cs-dem { display: inline-block; min-width: 3ch; margin-right: 8px; font-family: var(--f-mono); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.cs-c { display: inline-block; margin: 0 6px 0 0; padding: 0 6px; border-radius: 4px; background: var(--panel-2); font-family: var(--f-mono); font-size: 12px; line-height: 20px; color: var(--muted); white-space: nowrap; }
.cs-c.khoa { color: var(--text); font-weight: 600; }
.cs-c i { font-style: normal; color: var(--faint); }
.bang-cs2 tr:target td { background: #1a1b1e; }
.bang-cs2 tr:target td:first-child { box-shadow: inset 2px 0 var(--ivory); }
.bang-cs2 tr[id] { scroll-margin-top: 16px; }
.cs-ghi { padding-bottom: 12px; }
.bang-cs1 .ht-nhom .so, .bang-cs2 .ht-nhom .so { font-family: var(--f-ui); font-size: 13px; }
.bang-cs2 .cs-o-bang { min-width: 28ch; }
.may-so { border-top: 1px solid var(--line); margin-top: 8px; }
.may-so a.gh-muc { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.may-chua { padding-top: 0; }
.may-the .gh-so { color: var(--muted); }
.may-so .thieu { color: var(--warn); }
/* màn hẹp: mỗi bảng của database thành một khối dọc (tên, số dòng · dung lượng, rồi các cột chạy hết bề ngang) */
@media (max-width: 760px) {
  .bang-cs2 thead { display: none; }
  .bang-cs2, .bang-cs2 tbody, .bang-cs2 tr, .bang-cs2 td { display: block; width: auto; }
  .bang-cs2 tr[hidden] { display: none; }
  .bang-cs2 tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .bang-cs2 td, .bang-cs2 td:first-child, .bang-cs2 td:last-child { border: 0; padding: 2px 16px; }
  .bang-cs2 .cs-o-bang { min-width: 0; max-width: none; }
  .bang-cs2 td.cs-so { display: inline-block; padding-right: 0; text-align: left; }
  .bang-cs2 td.cs-so:empty { display: none; }
  .bang-cs2 td.cs-so:nth-child(2)::after { content: " dòng"; color: var(--faint); font-family: var(--f-ui); }
  .bang-cs2 tr.ht-nhom { padding: 0; }
  .bang-cs2 tr.ht-nhom td { padding: 16px 16px 6px; }
}

/* ── trang danh mục (/nhom/…): một dòng một mục ── */
.bang-dm td.ht-o-ten { white-space: nowrap; max-width: 64ch; overflow: hidden; text-overflow: ellipsis; }
.bang-dm .dm-phu { margin-left: 10px; }
.bang-dm td.dm-o { max-width: 32ch; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 13px; }
.bang-dm .lk-cot { text-align: right; }
/* bảng quyền chạy hết bề ngang */
.bang-quyen-rong .q-ten { white-space: nowrap; }
.bang-quyen-rong .o-giua { width: 88px; }
/* việc chờ: bảng so sánh không kéo hết bề ngang màn rộng */
.kb-the > .bang-cuon { max-width: 1040px; }
