/* Trang quản trị — giao diện bảng điều khiển tối (mặc định tối; vẫn có chế độ sáng). Nạp SAU style.css. */
:root[data-theme="dark"] {
  --bg: #0b0f14; --surface: #11171e; --surface-2: #18202a; --border: #232d39; --text: #e6edf3; --muted: #8d9aa8;
  --accent: #7ee0a1; --accent-soft: #13261b; --ok: #3fd18a; --ok-soft: #0f2a1d; --warn: #f2b84b; --warn-soft: #2e2410;
  --bad: #ff6b6b; --bad-soft: #35171a; --bar: #4f8fb8; --chart: #5ab8f0; --shadow: none;
}
:root { --chart: #2f7fb5; }
/* "Theo máy" (không có data-theme, máy đang tối): cùng bộ màu tối như chọn "Tối" (05/11/2026 — trước đây chọn Theo máy bị đổi thành Tối khi tải lại) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0b0f14; --surface: #11171e; --surface-2: #18202a; --border: #232d39; --text: #e6edf3; --muted: #8d9aa8;
    --accent: #7ee0a1; --accent-soft: #13261b; --ok: #3fd18a; --ok-soft: #0f2a1d; --warn: #f2b84b; --warn-soft: #2e2410;
    --bad: #ff6b6b; --bad-soft: #35171a; --bar: #4f8fb8; --chart: #5ab8f0; --shadow: none;
  }
  :root:not([data-theme]) .topbar { background: rgba(11, 15, 20, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
  :root:not([data-theme]) .nav { background-image: linear-gradient(to left, #0b0f14 60%, transparent), linear-gradient(to left, rgba(255,255,255,.2), transparent); }
  :root:not([data-theme]) .card, :root:not([data-theme]) .kpi { background: linear-gradient(180deg, var(--surface), #0f141a); }
}
body { background: var(--bg); }
:root[data-theme="dark"] .topbar { background: rgba(11, 15, 20, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
:root[data-theme="dark"] .nav { background-image: linear-gradient(to left, #0b0f14 60%, transparent), linear-gradient(to left, rgba(255,255,255,.2), transparent); }   /* vệt "còn mục" theo nền thanh tối */
:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpi { background: linear-gradient(180deg, var(--surface), #0f141a); }
.page-head h2 { margin: 0; }

/* Dải trạng thái chung */
.bdk-trang-thai { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); margin-bottom: 16px; }
.bdk-trang-thai .tt-den { width: 18px; height: 18px; border-radius: 50%; flex: none; background: var(--ok); box-shadow: 0 0 0 6px var(--ok-soft); }
.bdk-trang-thai.warn .tt-den { background: var(--warn); box-shadow: 0 0 0 6px var(--warn-soft); }
.bdk-trang-thai.bad .tt-den { background: var(--bad); box-shadow: 0 0 0 6px var(--bad-soft); animation: nhay 1.6s ease-in-out infinite; }
.bdk-trang-thai.ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.bdk-trang-thai.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.bdk-trang-thai.bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); }
.tt-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tt-chu b { font-size: 20px; letter-spacing: -.01em; }
.tt-chu span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.tt-luc { text-align: right; font-size: 12px; color: var(--muted); }
@keyframes nhay { 50% { box-shadow: 0 0 0 10px var(--bad-soft); } }

/* Việc cần xử lý + AI */
.bdk-hai { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.bdk-hai > .card + .card { margin-top: 0; }
.viec-ds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.viec { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--muted); }
.viec.bad { border-left-color: var(--bad); } .viec.warn { border-left-color: var(--warn); }
.viec-ky { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--border); color: var(--text); margin-top: 1px; }
.viec.bad .viec-ky { background: var(--bad); color: var(--surface); } .viec.warn .viec-ky { background: var(--warn); color: #1a1405; }
.viec a, .viec > div { color: var(--text); display: flex; flex-direction: column; min-width: 0; text-decoration: none; }
.viec a:hover b { text-decoration: underline; }
.viec a span, .viec > div span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.trong { color: var(--muted); margin: 0; }
.ai-tieu-de { font-weight: 700; margin: 0 0 8px; }
.ai-ds { margin: 0 0 10px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

/* Số chính + biểu đồ nhỏ */
.bdk-kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (min-width: 1100px) { .bdk-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.bdk-kpi .kpi { display: flex; flex-direction: column; gap: 2px; }
.bdk-kpi .kpi .sub { margin-bottom: 6px; }
svg.bd-cot { display: block; width: 100%; height: auto; margin-top: auto; overflow: visible; }
svg.bd-cot .bar { fill: var(--chart); }
svg.bd-cot .bar.vuot { fill: var(--warn); }
svg.bd-cot .cham-vung { fill: transparent; }
svg.bd-cot .cot-o:hover .bar { filter: brightness(1.3); }
svg.bd-cot .day { stroke: var(--border); stroke-width: 1; }
svg.bd-cot .tham-chieu { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1; }
svg.bd-cot .tham-chieu-chu, svg.bd-cot .truc { fill: var(--muted); font-size: 9px; font-family: var(--font); }
#d1 svg.bd-cot .tham-chieu-chu, #d1 svg.bd-cot .truc { font-size: 11px; }
.web-cham { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.web-cham span { width: 14px; height: 14px; border-radius: 4px; background: var(--ok); }
.web-cham .bad { background: var(--bad); } .web-cham .muted { background: var(--border); }
.thanh { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: auto; }
.thanh span { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.thanh.warn span { background: var(--warn); } .thanh.bad span { background: var(--bad); }
.day-cham { display: flex; gap: 4px; margin-top: auto; }
.day-cham .dc { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }
.day-cham .dc i { width: 100%; max-width: 22px; height: 10px; border-radius: 3px; background: var(--ok); }
.day-cham .st-warn i { background: var(--warn); } .day-cham .st-bad i { background: var(--bad); } .day-cham .st-muted i { background: var(--border); }
.day-cham .dc b { font-size: 10px; font-weight: 500; color: var(--muted); }

/* Luồng dữ liệu: sơ đồ trên máy tính, danh sách trên điện thoại */
.luong-ds { display: none; list-style: none; margin: 0; padding: 0; }
.luong-ds li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.luong-ds li:first-child { border-top: 0; }
.luong-ds li > i { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.luong-ds li.st-chay > i { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.luong-ds li.st-tre > i { background: var(--warn); } .luong-ds li.st-loi > i { background: var(--bad); }
.luong-ds li > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
@media (max-width: 700px) {
  #luong .luong-wrap { display: none; }
  .luong-ds { display: block; }
  .bdk-hai { grid-template-columns: minmax(0, 1fr); }
  .tt-chu b { font-size: 17px; }
  .bdk-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tim-nut span, .tim-nut kbd { display: none; }
}

/* Tìm nhanh */
.tim-nut { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; margin-left: auto; }
.tim-nut:hover { color: var(--text); border-color: var(--muted); }
.tim-nut kbd { display: none; }   /* nhường chỗ cho menu; Ctrl K ghi ở title */
@media (max-width: 1440px) { .tim-nut span { display: none; } }   /* chỉ còn kính lúp */
kbd { font: 11px/1 var(--font); padding: 3px 5px; border-radius: 4px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }
dialog.tim-hop { width: min(640px, calc(100vw - 32px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
dialog.tim-hop::backdrop { background: rgba(3, 6, 10, .6); backdrop-filter: blur(2px); }
.tim-form { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.tim-form input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: 6px 0; min-width: 0; }
.tim-kq { max-height: 60vh; overflow-y: auto; padding: 6px; }
.tim-kq .nhom { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 10px 4px; }
.tim-kq a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.tim-kq a span { font-size: 12px; color: var(--muted); }
.tim-kq a.chon, .tim-kq a:hover { background: var(--accent-soft); }
.tim-kq .rong { color: var(--muted); padding: 14px 10px; }

/* Tooltip chung (data-tip) */
.tip { position: fixed; z-index: 50; pointer-events: none; max-width: 280px; padding: 6px 9px; border-radius: 6px; font-size: 12px;
  background: var(--text); color: var(--bg); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
@media (prefers-reduced-motion: reduce) { .bdk-trang-thai.bad .tt-den { animation: none; } }

/* Bản mẫu luồng công việc */
.lcv-chon { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.lcv-chip { font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.lcv-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.lcv-so-do { overflow-x: auto; margin: 0 -16px; padding: 4px 16px 8px; }
.lcv-luoi { position: relative; display: grid; grid-template-columns: 150px repeat(var(--cot), minmax(150px, 1fr)); grid-auto-rows: minmax(84px, auto); gap: 10px 26px; min-width: calc(150px + var(--cot) * 170px); }
.lcv-lan { grid-column: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-right: 8px; border-right: 2px solid var(--border); }
.lcv-lan span { font-size: 11px; color: var(--muted); }
.lcv-o { border-top: 1px dashed var(--border); }
.lcv-the { position: relative; z-index: 1; align-self: center; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 10px 36px; border-radius: 10px;
  background: var(--surface-2); border: 1.5px solid var(--border); font-size: 13px; min-height: 64px; }
.lcv-the .lcv-so { position: absolute; left: 10px; top: 10px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--border); }
.lcv-the .lcv-han { font-size: 11px; color: var(--muted); }
.lcv-the .lcv-vai-nho { display: none; font-size: 11px; color: var(--muted); }
.lcv-the.st-cho { opacity: .55; }
.lcv-the.st-xong { border-color: color-mix(in srgb, var(--ok) 60%, var(--border)); }
.lcv-the.st-xong .lcv-so { background: var(--ok); color: var(--surface); }
.lcv-the.st-dang { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lcv-the.st-dang .lcv-so { background: var(--accent); color: var(--surface); }
.lcv-the.st-tre { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.lcv-the.st-tre .lcv-so { background: var(--bad); color: var(--surface); }
svg.lcv-mui { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; color: var(--muted); }
svg.lcv-mui path { fill: none; stroke: var(--border); stroke-width: 1.6; stroke-dasharray: 5 5; color: var(--border); }
svg.lcv-mui path.nhanh-warn { stroke: color-mix(in srgb, var(--warn) 60%, var(--border)); }
svg.lcv-mui path.nhanh-bad { stroke: color-mix(in srgb, var(--bad) 60%, var(--border)); }
svg.lcv-mui path.da-di { stroke: var(--ok); stroke-dasharray: none; stroke-width: 2.5; color: var(--ok); }
.lcv-hai { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.lcv-hai > .card + .card { margin-top: 0; }
.lcv-ai { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.lcv-ai > div { display: flex; flex-direction: column; } .lcv-ai span { font-size: 12px; color: var(--muted); }
.lcv-cham { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); flex: none; }
.lcv-cham.tre { background: var(--bad); box-shadow: 0 0 0 5px var(--bad-soft); }
.lcv-hop { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 10px 0; }
.lcv-hop-dau { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--surface-2); font-weight: 700; font-size: 13px; }
.lcv-dem { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.lcv-viec { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-left: 3px solid var(--accent); }
.lcv-viec.tre { border-left-color: var(--bad); }
.lcv-viec .field input { width: 100%; }
.lcv-nut { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.lcv-zalo { background: color-mix(in srgb, #0068ff 14%, var(--surface)); border: 1px solid color-mix(in srgb, #0068ff 40%, var(--border)); border-radius: 12px 12px 12px 2px; padding: 8px 12px; margin: 10px 0; }
.lcv-zalo p { margin: 4px 0 0; font-size: 13px; }
.lcv-xong { text-align: center; padding: 18px 8px; } .lcv-xong b { color: var(--ok); font-size: 18px; }
.lcv-hops { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lcv-hops-o { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; }
.lcv-hops-o span { font-size: 12px; color: var(--muted); }
.lcv-hops-o.co { border-color: var(--accent); background: var(--accent-soft); } .lcv-hops-o.co span { color: var(--accent); }
.lcv-hops-o.tre { border-color: var(--bad); background: var(--bad-soft); } .lcv-hops-o.tre span { color: var(--bad); }
.lcv-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; max-height: 320px; overflow-y: auto; }
.lcv-log li { display: flex; gap: 10px; } .lcv-log time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.lcv-log li.chuyen span { color: var(--accent); } .lcv-log li.qua span { color: var(--bad); } .lcv-log li.xong span { color: var(--ok); font-weight: 700; }
@media (max-width: 760px) {
  .lcv-hai { grid-template-columns: minmax(0, 1fr); }
  .lcv-luoi { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .lcv-lan, .lcv-o, svg.lcv-mui { display: none; }
  .lcv-the .lcv-vai-nho { display: block; }
}

/* Trình sửa luồng */
.ls-buoc .card-head h2 { display: flex; align-items: center; gap: 8px; }
.ls-so { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 13px; background: var(--accent); color: var(--surface); }
.ls-nut-buoc { display: flex; gap: 6px; }
.ls-hai { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; margin-top: 12px; }
.ls-hai h3 { font-size: 13px; margin: 10px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ls-dong { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ls-dong input:not([type="checkbox"]), .ls-dong select { flex: 1 1 140px; min-width: 0; }
.ls-nut { border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.ls-o { padding-left: 18px; }
.ls-buoc textarea, #ls textarea { width: 100%; }
.ls-luu { position: sticky; bottom: 8px; z-index: 5; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); }
.ls-luu { padding: 10px 14px; }
.ls-luu-hang { display: flex; gap: 10px; align-items: center; }
.ls-luu-hang input { flex: 1; min-width: 0; }
#ls-loi .flash { margin: 0 0 8px; padding: 6px 10px; font-size: 13px; max-height: 96px; overflow-y: auto; }
#ls-loi .flash ul { margin: 4px 0 0; }
details.phien { border-top: 1px solid var(--border); padding: 8px 0; }
details.phien .lcv-log { margin-top: 8px; max-height: none; }
@media (max-width: 760px) { .ls-hai { grid-template-columns: minmax(0, 1fr); } }

/* Trình sửa luồng — sơ đồ kéo thả */
.ls-khung { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 16px; align-items: start; margin-top: 16px; }
.ls-khung > .card + .card, .ls-khung .card { margin-top: 0; }
.ls-panel { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; }
.ls-panel .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ls-panel .form-grid > *, .ls-panel label { min-width: 0; }
.ls-panel input:not([type=checkbox]):not([type=radio]), .ls-panel select, .ls-panel textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.ls-panel .ls-hai { grid-template-columns: minmax(0, 1fr); }
.ls-cong-cu { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ls-moi { touch-action: none; cursor: grab; }
.ls-canvas { overflow: auto; margin: 0 -16px; padding: 4px 16px 12px; }
.ls-luoi { position: relative; display: grid; grid-template-columns: 150px repeat(var(--cot), 178px); grid-auto-rows: minmax(104px, auto); column-gap: 30px; min-width: max-content; }
.ls-lan { grid-column: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-right: 10px; border-right: 2px solid var(--border); font-size: 13px; }
.ls-lan span { font-size: 11px; color: var(--muted); }
.ls-lan { position: sticky; left: -16px; z-index: 3; margin-left: -16px; padding-left: 16px; background: var(--surface); }   /* tên làn đứng yên khi cuộn ngang */
.ls-o { border-top: 1px dashed var(--border); margin: 0 -15px; transition: background .1s; }
.ls-dang-keo .ls-o { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.ls-o.toi { background: var(--accent-soft) !important; outline: 2px dashed var(--accent); outline-offset: -4px; border-radius: 10px; }
.ls-nut-sd { position: relative; z-index: 2; align-self: center; display: flex; flex-direction: column; gap: 2px; padding: 9px 22px 9px 34px; border-radius: 10px;
  background: var(--surface-2); border: 1.5px solid var(--border); font-size: 13px; min-height: 58px; cursor: grab; touch-action: none; user-select: none; }
.ls-nut-sd:hover { border-color: var(--muted); }
.ls-nut-sd:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ls-nut-sd.dau { border-color: color-mix(in srgb, var(--ok) 60%, var(--border)); }
.ls-nut-sd.chon { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ls-nut-sd.toi { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ls-nut-sd .ls-so { position: absolute; left: 9px; top: 9px; width: 18px; height: 18px; font-size: 11px; }
.ls-nut-sd .ls-phu { font-size: 11px; color: var(--muted); }
.ls-nut-sd .ls-ket { color: var(--ok); }
.ls-cong { position: absolute; right: -8px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--accent); cursor: crosshair; touch-action: none; }
.ls-cong:hover, .ls-dang-keo .ls-cong { background: var(--accent); }
svg.ls-mui { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 1; }
.ls-mui-g { pointer-events: auto; cursor: pointer; }
.ls-mui-g .ls-cham { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; }
.ls-mui-g path:not(.ls-cham) { fill: none; stroke-width: 2.2; pointer-events: none; }
.ls-n-nut { stroke: var(--accent); }
.ls-n-warn { stroke: var(--warn); }
.ls-n-bad { stroke: var(--bad); }
.ls-n-sk { stroke: var(--muted); stroke-dasharray: 6 5; }
.ls-mui-g:hover path:not(.ls-cham) { stroke-width: 3.5; filter: drop-shadow(0 0 3px var(--accent)); }
.ls-tam { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 4; }
.ls-bong { position: fixed; z-index: 200; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1.5px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-size: 13px; opacity: .92; }
.ls-dang-keo, .ls-dang-keo * { cursor: grabbing !important; }
.ls-lac { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.ls-hd { margin-bottom: 0; }
@media (max-width: 1000px) { .ls-khung { grid-template-columns: minmax(0, 1fr); } .ls-panel { position: static; max-height: none; } }
@media (max-width: 600px) { .ls-luoi { grid-template-columns: 96px repeat(var(--cot), 158px); column-gap: 22px; } .ls-lan { font-size: 12px; } .ls-lan span { display: none; } }

/* Cài đặt → Kiểm tra tự động + phiên bản (src/kiem-tra.js) */
.kt-robot > p { margin: 8px 0; }
.kt-web { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.kt-web > li { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--ok); }
.kt-web > li.warn { border-left-color: var(--warn); } .kt-web > li.bad { border-left-color: var(--bad); }
.kt-web > li > span { margin-left: 6px; }
.kt-web ul { margin: 6px 0 0; padding-left: 18px; } .kt-web li.bad { color: var(--bad); }
.kt-h3 { font-size: 15px; margin: 16px 0 8px; }
.kt-quay { display: flex; gap: 6px; align-items: center; }
.kt-quay select { min-width: 0; max-width: 280px; flex: 1; }
@media (max-width: 700px) { .kt-pb td:nth-child(1) .small { display: none; } .kt-quay { flex-wrap: wrap; } }

/* ---------- Phân quyền: bảng ô tick vai trò × chức năng ---------- */
.pq-wrap { padding: 0; overflow: hidden; }
/* thẻ không có lề → bỏ lề âm của .card .table-wrap (trước đây bảng lệch trái 16px, cột Chức năng dính mép, cột cuối bị khuất — user báo 02/11/2026) */
.pq-wrap .table-wrap.pq-bang { margin: 0; }
.pq-bang { max-height: 72vh; overflow: auto; }
.pq-bang table { border-collapse: separate; border-spacing: 0; }
.pq-bang thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); }
.pq-bang .pq-cn { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 240px; }
.pq-bang thead .pq-cn { z-index: 4; background: var(--surface-2); }
.pq-cn span { display: block; }
.pq-cn code { font-size: 11px; color: var(--muted); }
.pq-vt { font-size: 12px; text-align: center; min-width: 66px; max-width: 90px; white-space: normal; line-height: 1.25; }
.pq-o { text-align: center; }
.pq-o input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }
.pq-web td { background: var(--accent-soft); font-weight: 700; position: sticky; left: 0; }
.pq-nhom td { font-weight: 600; padding-left: 16px; color: var(--muted); }
tr.pq-rieng td { background: var(--warn-soft); }
.pq-tt { padding: 8px 16px; margin: 0; min-height: 1.5em; }
.pq-bang td, .pq-bang th { padding-top: 7px; padding-bottom: 7px; }
.pq-bang .pq-cn, .pq-web td, .pq-nhom td { padding-left: 16px; }
.pq-nhom td { padding-left: 24px; }
@media (max-width: 600px) { .pq-bang .pq-cn { min-width: 150px; max-width: 170px; } .pq-cn span { overflow-wrap: anywhere; } }   /* điện thoại: chừa chỗ cho cột ô tick */

/* Gửi tin theo từng nội dung (pages/gui_tin.js) */
.gt-web .card-head h3 { margin: 0; font-size: 15px; }
.gt-nk tr.gt-nk-canh td { background: color-mix(in srgb, var(--warn, #b7791f) 12%, transparent); }
.gt-nk-link .card-head h3 { margin: 0; font-size: 15px; } .gt-nk-link p { margin: 6px 0 0; }
.gt-dong { border-top: 1px solid var(--border); padding: 0; }
.gt-dong > summary { display: flex; align-items: center; gap: 10px; padding: 10px 2px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.gt-dong > summary::-webkit-details-marker { display: none; }
.gt-dong > summary::before { content: "▸"; color: var(--muted); } .gt-dong[open] > summary::before { content: "▾"; }
.gt-ten { display: flex; flex-direction: column; flex: 1 1 260px; min-width: 0; }
.gt-cong-tac { font-style: italic; }
.gt-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; padding: 4px 0 14px; align-items: end; }
.gt-form fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin: 0; grid-column: 1 / -1; }
.gt-form legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.gt-tt { display: flex; gap: 8px; flex-wrap: wrap; }
.gt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; font-weight: 600; }
.gt-chip.tat:has(input:checked) { background: var(--surface-2); } .gt-chip.thu:has(input:checked) { background: var(--warn-soft); border-color: var(--warn); }
.gt-chip.that:has(input:checked) { background: var(--ok-soft); border-color: var(--ok); }
.gt-nhan { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.gt-cot { display: flex; flex-direction: column; gap: 4px; }
.gt-nguoi { max-height: 220px; overflow: auto; }
.gt-hien, .gt-nut, .gt-form > .check { grid-column: 1 / -1; margin: 0; }
.gt-nut { display: flex; gap: 8px; flex-wrap: wrap; }

/* Khóa đưa lên (khoa-dua-len.js) */
.kdl-cai { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.kdl-cai > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.kdl-cai > summary .badge { margin-left: 6px; }

/* ---------- Trang đầu kiểu trang Phiếu (user duyệt 06/11/2026): tiêu đề + Cài đặt bên phải, dải nhắc, ô tìm, lưới ô thẻ theo nhóm (pages/tong_quan.js trangDau) ---------- */
.qt-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.qt-dau h1 { margin: 0; }
.qt-dau-cai { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 4px; color: var(--muted); font-size: 14px; font-weight: 500; }
.qt-dau-cai:hover { color: var(--accent); text-decoration: none; }
.qt-nhac { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 14px; }
.qt-nhac.canh { background: var(--warn-soft); border-color: transparent; }
.qt-nhac.xau { background: var(--bad-soft); border-color: transparent; }
.qt-nhac.canh b { color: var(--warn); } .qt-nhac.xau b { color: var(--bad); }
.qt-nhac > span { min-width: 0; }
.qt-nhac-y { display: block; font-size: 13px; overflow-wrap: anywhere; }
.qt-nhac-nut:hover { text-decoration: none; }
.qt-nhac-nut { flex: none; }
@media (max-width: 720px) { .qt-nhac-nut { width: 100%; justify-content: center; } }   /* điện thoại: nút làm ngay hết chiều ngang như mọi web (trang-o.css) */
.qt-tim { position: relative; display: flex; align-items: center; max-width: 620px; margin: 6px 0 14px; }
.qt-tim > .qt-svg { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.qt-tim input { width: 100%; padding-left: 36px; background: var(--surface); }
.qt-khong-thay { margin: 16px 0; }
.qt-muc { margin: 18px 0 10px; font-size: 17px; font-weight: 700; }
.qt-muc-bdk { margin-top: 30px; }
.qt-o4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.qt-o-the { position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); min-width: 0; transition: border-color .12s, box-shadow .12s; }
.qt-o-the:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(15, 23, 42, .08); text-decoration: none; }
.qt-o-the:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qt-bieu { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; }
.qt-o-chu { min-width: 0; }
.qt-o-chu b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.qt-o-chu small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 1px; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.qt-o-dem { position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: var(--surface);
  font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
@media (max-width: 900px) {
  .qt-o4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qt-o4 .qt-o-chu small { display: none; }
}
@media (max-width: 480px) {
  .qt-o-the { gap: 10px; min-height: 60px; padding: 9px 10px; }
  .qt-bieu { width: 36px; height: 36px; }
  .qt-o-chu b { font-size: 14px; }
  .qt-muc { margin: 14px 0 8px; font-size: 16px; }
}
@media (max-width: 360px) {
  .qt-o4 .qt-o-the { gap: 8px; padding: 8px; }
  .qt-o4 .qt-bieu { width: 32px; height: 32px; }
  .qt-o4 .qt-bieu .qt-svg { width: 18px; height: 18px; }
}

/* Hàng tab con gạch chân 2px màu nhấn (Cài đặt): dính dưới thanh trên, điện thoại cuộn ngang, phần đang xem tự vào giữa (qt.js) */
html:has(.qt-con) { scroll-padding-top: 116px; }
.qt-con { position: sticky; top: 58px; z-index: 15; display: flex; gap: 4px 20px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px; background: var(--bg);
  border-bottom: 1px solid var(--border); scrollbar-width: none; }
.qt-con::-webkit-scrollbar { display: none; }
.qt-con a { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 2px; color: var(--text); font-weight: 500; font-size: 15px; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.qt-con a:hover { color: var(--accent); text-decoration: none; }
.qt-con a.on { color: var(--accent); font-weight: 700; border-bottom-color: var(--accent); }
@media (max-width: 820px) { .qt-con { top: 56px; gap: 4px 14px; } .qt-con a { font-size: 14px; min-height: 40px; } html:has(.qt-con) { scroll-padding-top: 106px; } }
@media (max-width: 720px) { .qt-con { margin: 0 -12px 14px; padding: 0 12px; } }
/* Cài đặt › Zalo riêng: ID chat dài → xuống dòng, nút Bỏ nối ngay dưới */
.zr-id { display: block; word-break: break-all; color: var(--muted); font-size: 11px; margin: 2px 0 4px; }
.zr-bo { margin: 0; }
/* Bot Zalo (13/11/2026): lịch gửi, mẫu tin, ô từng bot */
.bz-lich td { vertical-align: top; }
.bz-lich .bz-tat td { opacity: .55; }
.bz-noi { font-size: 13px; line-height: 1.5; }
.bz-mau { margin-top: 4px; }
.bz-mau > summary { cursor: pointer; color: var(--accent); }
.bz-mau pre { white-space: pre-wrap; font: 12.5px/1.5 inherit; font-family: inherit; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; max-width: 460px; }
.bz-bot { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bz-bot-o { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.bz-bot-o .card-head { margin: 0; } .bz-bot-o h3 { margin: 0; font-size: 15px; }
.bz-ds { margin: 0; padding-left: 16px; } .bz-ds li { margin: 2px 0; } .bz-ds .badge { margin-left: 4px; }
/* Điện thoại: bảng lịch thành thẻ xếp dọc (Giờ + chế độ trên cùng, nội dung tin, gửi vào, hôm nay) */
@media (max-width: 720px) {
  .bz-lich thead { display: none; }
  .bz-lich, .bz-lich tbody, .bz-lich tr, .bz-lich td { display: block; width: 100%; }
  .bz-lich tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
  .bz-lich td { border: 0; padding: 2px 4px; }
  .bz-lich td:first-child { font-size: 15px; }
  .bz-mau pre { max-width: none; }
}
/* 9 mục menu (thêm Bot Zalo 13/11/2026): điện thoại 5 cột cho gọn 2 hàng */
@media (max-width: 820px) { .tabbar:has(> a:nth-child(9)) { grid-template-columns: repeat(5, 1fr); } .tabbar:has(> a:nth-child(9)) a { font-size: 10px; } }

/* Bot Zalo › Gửi thông báo (13/11/2026) */
.tb-form { display: grid; gap: 14px; max-width: 760px; min-width: 0; }
.tb-o { display: grid; gap: 6px; min-width: 0; }
.tb-o select, .tb-o textarea, .tb-o input[type=file] { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.tb-form .form-actions { flex-wrap: wrap; }
.tb-o > span:first-child { font-weight: 600; font-size: 14px; }
.tb-o textarea { width: 100%; font: inherit; line-height: 1.5; }
.tb-xem { display: grid; gap: 8px; justify-items: start; }
.tb-xem img { max-width: min(100%, 420px); border: 1px solid var(--line, #3334); border-radius: 8px; background: #fff; }
/* Gửi tin chi tiết (13/11/2026): mô tả khi nào gửi, ai sẽ nhận, bảng tổng, không gửi được */
.gt-mo-ta { padding: 2px 0 8px; font-size: 13px; } .gt-mo-ta p { margin: 0 0 4px; }
.gt-khong { color: var(--bad); font-weight: 600; }
.gt-ai-nhom { display: flex; flex-wrap: wrap; gap: 6px; }
.gt-ai-o { border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; font-size: 13px; }
.gt-ai-ds > summary { cursor: pointer; margin: 6px 0; }
.gt-ai-bang { font-size: 13px; } .gt-ai-bang td, .gt-ai-bang th { padding: 4px 8px; }
.gt-ai-ds .table-wrap { max-height: 360px; overflow: auto; }
.gt-tong td, .gt-tong th { vertical-align: top; }
/* Boss › Sơ đồ việc + dải hạn mức (17/11/2026; bs- = Boss, bz- là Bot Zalo) */
.bs-dai { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 10px 14px; margin: 0 0 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 14px; }
.bs-dai-o { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.bs-cay, .bs-cay ul { list-style: none; margin: 0; padding: 0; }
.bs-cay ul { margin-left: 14px; padding-left: 18px; border-left: 1px solid var(--border); }
.bs-cay li { position: relative; padding: 6px 0 0; }
.bs-cay ul > li::before { content: ''; position: absolute; left: -18px; top: 24px; width: 16px; border-top: 1px solid var(--border); }
.bs-nut { display: inline-block; max-width: min(560px, 100%); border: 1px solid var(--border); border-radius: 10px; padding: 7px 11px; background: var(--surface); line-height: 1.45; overflow-wrap: anywhere; }
.bs-nut-dau { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.bs-nut.nho { padding: 5px 10px; font-size: 13.5px; }
.bs-nut.goc { border-color: var(--accent); }
.bs-nut.boss { border-color: var(--accent); background: var(--accent-soft); }
.bs-nut.dang { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset; }
.bs-nut.cho { border-color: var(--warn); border-style: dashed; }
.bs-nut.loi { border-color: var(--bad); background: var(--bad-soft); }
.bs-nut.tat { opacity: .55; }
@media (max-width: 720px) { .bs-cay ul { margin-left: 6px; padding-left: 12px; } .bs-cay ul > li::before { left: -12px; width: 10px; } }
/* Đội bot (/doi-bot, 17/11/2026 — làm lại kiểu bảng điều khiển vận hành): thanh trên LIVE + vòng hạn mức; 4 cột Đội → Leader → Worker → Hồ sơ;
   ô gọn chữ máy, viền phát sáng theo trạng thái, nhãn LEADER / WORKER / BOT; đường nối SVG (qt.js). Màu chỉ từ token → sáng / tối đều đúng. */
main:has(#db-dong) { max-width: 1720px; }
/* chữ máy CHỈ cho phần ASCII (tên phiên, nhánh, số, nhãn LEADER / WORKER): font máy của nhiều máy vẽ dấu tiếng Việt lệch */
.db-mono, .db-the, .db-vong-o b, .db-tien b { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }
.db-so { font-variant-numeric: tabular-nums; }
.db-dai { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 14px 18px; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--surface)), var(--surface)); }
.db-dai-trai { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 320px; }
.db-tieu { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.db-live { font-size: 11px; font-weight: 700; letter-spacing: .12em; padding: 3px 8px 3px 20px; border-radius: 999px; position: relative; color: var(--bad); background: var(--bad-soft); }
.db-live::before { content: ''; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: currentColor; }
.db-live.on { color: var(--ok); background: var(--ok-soft); }
.db-live.on::before { animation: db-nhip 1.6s ease-in-out infinite; }
@keyframes db-nhip { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 70%, transparent); } 60% { box-shadow: 0 0 0 6px transparent; } }
.db-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.db-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: var(--muted); background: var(--bg); white-space: nowrap; }
.db-chip b { color: var(--text); font-weight: 600; font-size: 12px; }
.db-dai-vong { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.db-vong { display: flex; align-items: center; gap: 8px; }
.db-vong-o { position: relative; width: 52px; height: 52px; flex: none; }
.db-vong-o svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.db-vong-o b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 12.5px/1 ui-monospace, Menlo, Consolas, monospace; }
.db-vong circle { fill: none; stroke-width: 4.5; }
.db-vong .nen { stroke: var(--border); }
.db-vong .muc { stroke: var(--ok); stroke-linecap: round; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ok) 60%, transparent)); }
.db-vong.warn .muc { stroke: var(--warn); filter: drop-shadow(0 0 3px color-mix(in srgb, var(--warn) 60%, transparent)); }
.db-vong.bad .muc { stroke: var(--bad); filter: drop-shadow(0 0 3px color-mix(in srgb, var(--bad) 60%, transparent)); }
.db-vong > span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); line-height: 1.3; }
.db-vong small, .db-tien small { font-size: 11px; color: var(--muted); }
.db-tien { display: flex; flex-direction: column; line-height: 1.25; padding-left: 14px; border-left: 1px solid var(--border); }
.db-tien b { font-size: 20px; } .db-tien span { font-size: 12px; color: var(--muted); }
.db-dai-nut { display: flex; gap: 6px; margin-left: auto; }
.db-cham { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.db-cham.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok); } .db-cham.warn { background: var(--warn); } .db-cham.bad { background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.db-luoi { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .95fr); gap: 16px 44px; align-items: start; margin-bottom: 18px; }
.db-noi { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 0; }
.db-noi path { fill: none; stroke: color-mix(in srgb, var(--muted) 45%, transparent); stroke-width: 1.4; }
.db-noi path.goc { stroke: color-mix(in srgb, var(--accent) 55%, transparent); }
.db-noi path.dang { stroke: var(--warn); stroke-width: 2; filter: drop-shadow(0 0 3px var(--warn)); }
.db-noi path.cho { stroke: var(--warn); stroke-dasharray: 5 4; } .db-noi path.loi { stroke: var(--bad); }
.db-cot { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.db-cot-ten { margin: 0 0 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.db-cot-ten span { font-weight: 500; letter-spacing: .02em; text-transform: none; color: color-mix(in srgb, var(--muted) 75%, transparent); }
.db-goc { gap: 40px; } .db-goc .db-nut-goc:first-of-type { margin-top: 8px; }
.db-nut-goc { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.db-nut-goc b { display: block; font-size: 14px; } .db-nut-goc small { display: block; font-size: 11px; color: var(--muted); }
.db-nut-goc.boss { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 22px -8px var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); cursor: pointer; }
.db-nut-goc.boss.loi { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; }
.db-anh { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); font-size: 16px; flex: none; }
.db-o { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 10px; background: var(--surface); line-height: 1.4; overflow-wrap: anywhere;
  transition: border-color .15s, box-shadow .15s; }
.db-the { position: absolute; top: 7px; right: 9px; font-size: 9.5px; font-weight: 700; letter-spacing: .12em; color: color-mix(in srgb, var(--muted) 70%, transparent); }
.db-o-dau { display: flex; align-items: flex-start; gap: 8px; padding-right: 54px; }
.db-o-ten { font-size: 14px; line-height: 1.35; }
.db-o-phu { font-size: 12px; color: var(--muted); margin-top: 3px; padding-left: 28px; }
.db-o-tt { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0 28px; }
.db-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; flex: none; font: 700 11px/1 ui-monospace, Menlo, monospace; font-style: normal;
  color: var(--muted); border: 1.5px solid currentColor; margin-top: 1px; }
.db-ic.xong { color: var(--ok); background: var(--ok-soft); }
.db-ic.dang { color: var(--warn); background: var(--warn-soft); animation: db-xoay 2.4s linear infinite; }
.db-ic.cho { color: var(--warn); } .db-ic.loi { color: var(--bad); background: var(--bad-soft); }
@keyframes db-xoay { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .db-ic.dang, .db-live.on::before { animation: none; } }
.db-o.dang { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset, 0 0 24px -8px var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.db-o.cho { border-color: color-mix(in srgb, var(--warn) 80%, transparent); border-style: dashed; }
.db-o.loi { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
.db-o.tat { opacity: .55; }
.db-o.tat:has(details[open]) { opacity: 1; }
.db-o[data-ho-so], .db-nut-goc[data-ho-so] { cursor: pointer; }
.db-o[data-ho-so]:hover, .db-nut-goc[data-ho-so]:hover { border-color: var(--accent); }
.db-o.chon, .db-nut-goc.chon { outline: 2px solid var(--accent); outline-offset: 2px; }
.db-nut { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 28px; align-items: flex-start; }
.db-nut .btn.sm { min-height: 28px; padding: 3px 10px; font-size: 12.5px; }
.db-f { margin: 0; display: inline; }
.db-hop { margin: 8px 0 0 28px; padding-top: 8px; border-top: 1px dashed var(--border); }
.db-hop .db-nut { margin-left: 0; }
.db-xem { margin: 4px 0 0 28px; }
.db-xem > summary, .db-muc > summary { cursor: pointer; font-size: 12.5px; }
.db-xem > summary { color: var(--accent); }
.db-xem pre, .db-pre { white-space: pre-wrap; font: 12.5px/1.5 inherit; font-family: inherit; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0 0; max-height: 320px; overflow: auto; }
.db-giao { display: contents; }
.db-giao > summary { list-style: none; } .db-giao > summary::-webkit-details-marker { display: none; }
.db-giao[open] > summary { background: var(--accent-soft); border-color: var(--accent); }
.db-giao-f { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; margin: 4px 0 2px; }
.db-giao-f textarea, .db-giao-f select { width: 100%; }
.db-giao-f .btn { align-self: flex-start; }
.db-moi { border-style: dashed; background: transparent; }
.db-moi .db-nut { margin-left: 0; }
.db-panel { position: sticky; top: 120px; }
.db-hs { border: 1px solid var(--accent); border-radius: 14px; padding: 12px 14px; background: var(--surface); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent) inset, 0 0 28px -12px var(--accent); }
.db-hs-dau { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.db-hs-dau .db-anh { width: 40px; height: 40px; font-size: 20px; }
.db-muc { border-top: 1px solid var(--border); padding: 9px 0 5px; }
.db-muc > summary { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text); list-style: none; }
.db-muc > summary::-webkit-details-marker { display: none; }
.db-muc > summary::before { content: '▸'; display: inline-block; width: 14px; color: var(--accent); transition: transform .15s; }
.db-muc[open] > summary::before { transform: rotate(90deg); }
.db-muc-than { padding: 6px 0 0 14px; }
.db-muc-than p { margin: 0 0 6px; }
.db-ds { margin: 4px 0 8px; padding-left: 16px; font-size: 13px; } .db-ds li { margin: 2px 0; }
.db-ds code, .db-hs code { font-size: 12px; }
@media (max-width: 1300px) {
  .db-luoi { grid-template-columns: 140px minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px 36px; }
  .db-panel { grid-column: 2 / -1; position: static; }
}
@media (max-width: 900px) {
  .db-luoi { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 28px; }
  .db-goc { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 10px; padding-top: 0; }
  .db-goc .db-cot-ten { flex-basis: 100%; }
  .db-panel { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .db-luoi { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .db-noi { display: none; }
  .db-dai { padding: 12px; gap: 12px; } .db-dai-vong { gap: 10px 14px; } .db-tien { padding-left: 0; border-left: 0; }
  .db-dai-nut { margin-left: 0; }
  .db-vong-o, .db-vong-o svg { width: 44px; height: 44px; }
}
/* Web vận hành ops.akuba.com.vn (apps/ops, 17/11/2026): dùng chung tệp này. Lớp op-* chỉ ops dùng; thanh trên / chip / vòng dùng lại db-* của Đội bot. */
body.op main { max-width: 1720px; }
.op-luoi2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.op-luoi2 > .card { margin: 0; }
.op-ds { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.op-ds li { display: flex; gap: 8px; align-items: baseline; line-height: 1.45; }
.op-ds li .db-cham { flex: none; transform: translateY(-1px); }
.op-ds li.bad a { color: var(--bad); } .op-ds li.warn a { color: var(--text); }
.op-ds.nho { font-size: 13px; gap: 4px; }
.op-nd ul.op-ds { list-style: disc; padding-left: 18px; } .op-nd ul.op-ds li { display: list-item; }
.op-nd.xau { border-color: var(--bad); } .op-nd.chu_y { border-color: var(--warn); }
.op-mangs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.op-mang { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.op-mang:hover { border-color: var(--accent); box-shadow: 0 0 24px -10px var(--accent); text-decoration: none; }
.op-mang.loi { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; }
.op-mang-dau { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.op-mang-dau b { color: var(--text); }
.op-mo { margin-left: auto; color: var(--accent); }
.op-mang-so { font-size: 22px; font-weight: 700; margin: 8px 0 2px; }
.op-mang-phu { font-size: 13px; color: var(--muted); }
.op-hang { display: flex; flex-wrap: wrap; gap: 4px; }
.op-da-luoi { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.op-h3 { margin: 4px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.op-commit { margin: 0; padding: 0; list-style: none; font-size: 13.5px; display: flex; flex-direction: column; gap: 5px; }
.op-commit code { font-size: 12px; color: var(--accent); }
.op-may { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.op-thanh-dau { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.op-thanh-nen { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.op-thanh-nen i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.op-thanh-nen i.warn { background: var(--warn); } .op-thanh-nen i.bad { background: var(--bad); }
.op-cron tr.loi td { background: color-mix(in srgb, var(--bad) 7%, transparent); }
.op-cron tr.tre td { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.op-cot { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.op-cot-o { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.op-cot-o i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--accent); opacity: .85; }
.op-cot-o:hover i { opacity: 1; }
.op-cot-o span { font-size: 11px; color: var(--muted); }
@media (max-width: 1100px) { .op-mangs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .op-luoi2, .op-da-luoi { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .op-mangs { grid-template-columns: minmax(0, 1fr); } .op-may { grid-template-columns: minmax(0, 1fr); } }
.op-ds.nho li { flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; } .op-ds.nho .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .op-da { overflow-wrap: anywhere; }
