/* ============================================================================
   RTM OS · Dashboard theo BU (js/rtm-bu-dash.js) + BU switcher ở thanh trên.
   Dùng LẠI design-system RTM (rtm-card / rtm-table / rtm-subtab / rtm-chip) —
   ở đây chỉ khai những thứ RTM chưa có. KHÔNG chế token màu mới.
   Màu nhấn của màn = màu chính của BU đang xem, truyền qua --bu.
   ========================================================================== */

/* ── BU switcher (thanh công cụ chung, rtm-os.js › renderShell) ─────────── */
#workspace-rtm-os .rtm-buwrap {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding-left: 8px; border-left: 1px solid #e2e8f0; margin-left: 2px;
}
#workspace-rtm-os .rtm-budot {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid #cbd5e1; background: transparent; transition: background .12s, border-color .12s;
}
#workspace-rtm-os #rtm-bu { font-weight: 600; min-width: 150px; }

/* Tooltip giới thiệu, chỉ hiện 1 lần */
#workspace-rtm-os .rtm-butip {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
  width: 300px; padding: 12px 14px; border-radius: 10px;
  background: #0f172a; color: #f1f5f9; box-shadow: 0 12px 32px rgba(15, 23, 42, .28);
  font-size: 12.5px; line-height: 1.5;
}
#workspace-rtm-os .rtm-butip::before {
  content: ''; position: absolute; top: -6px; left: 22px;
  border: 6px solid transparent; border-top: 0; border-bottom-color: #0f172a;
}
#workspace-rtm-os .rtm-butip b { display: block; margin-bottom: 4px; font-size: 13px; }
#workspace-rtm-os .rtm-butip p { margin: 0 0 10px; color: #cbd5e1; }
#workspace-rtm-os .rtm-butip .rtm-btn { padding: 5px 12px; font-size: 12px; }

/* Banner khoá ô chỉ tiêu khi đang lọc theo BU */
#workspace-rtm-os .rtm-bugate { display: block; margin: 8px 0 4px; }

/* ── Màn Dashboard theo BU ──────────────────────────────────────────────── */
#workspace-rtm-os .rbd { --bu: #0073EA; }
#workspace-rtm-os .rbd-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bu); vertical-align: baseline;
}
#workspace-rtm-os .rbd-code { margin-left: 8px; font-size: 11.5px; font-weight: 500; color: #94a3b8; }
#workspace-rtm-os .rbd-subs { margin: 10px 0 12px; }
#workspace-rtm-os .rbd-subs .rtm-subtab.active { border-color: var(--bu); color: var(--bu); }

/* Ô "chưa có nguồn" — gạch ngang mờ + gạch chân chấm để thấy là CÓ tooltip.
   Đây là quy ước trung thực dữ liệu: — nghĩa là KHÔNG BIẾT, không phải bằng 0. */
#workspace-rtm-os .rbd-nd {
  color: #94a3b8; border-bottom: 1px dotted #cbd5e1; cursor: help;
}
#workspace-rtm-os .rbd-sub { display: block; font-size: 10.5px; color: #94a3b8; font-weight: 400; }
#workspace-rtm-os .rbd-wh {
  display: inline-block; padding: 1px 6px; margin: 1px 2px 1px 0; border-radius: 4px;
  background: #f1f5f9; font-size: 11px; color: #475569; white-space: nowrap;
}
#workspace-rtm-os .rbd-note {
  margin: 0 0 10px; padding: 8px 12px; border-radius: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0; font-size: 12px; color: #475569; line-height: 1.55;
}
#workspace-rtm-os .rbd-warn { display: block; margin: 0 0 10px; }
#workspace-rtm-os .rbd-src { margin-top: 6px; font-size: 11px; color: #64748b; line-height: 1.5; }
#workspace-rtm-os .rbd-foot { margin-top: 12px; font-size: 11px; color: #94a3b8; }
#workspace-rtm-os .rbd-foot code, #workspace-rtm-os .rbd-src code,
#workspace-rtm-os .rbd-note code { font-size: 10.5px; background: #eef2f7; padding: 1px 4px; border-radius: 3px; }

#workspace-rtm-os .rbd-pnl td:first-child { font-weight: 500; }
#workspace-rtm-os .rbd-strong td { font-weight: 700; background: #f8fafc; }

#workspace-rtm-os .rbd-3col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1180px) { #workspace-rtm-os .rbd-3col { grid-template-columns: 1fr; } }
#workspace-rtm-os .rbd-panel {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px 12px; background: #fff; min-width: 0;
}
#workspace-rtm-os .rbd-panel .rtm-sec { margin-top: 0; }
#workspace-rtm-os .rbd-panel table { width: 100%; }

/* ── Nút bật/tắt BU ở "Danh mục BU" ─────────────────────────────────────── */
#workspace-rtm-os .rtmbu-tg {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 3px 9px 3px 5px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  border: 1px solid #e2e8f0; background: #f8fafc; color: #64748b;
}
#workspace-rtm-os .rtmbu-tg i {
  width: 26px; height: 15px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .14s;
}
#workspace-rtm-os .rtmbu-tg i::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px;
  border-radius: 50%; background: #fff; transition: transform .14s;
}
#workspace-rtm-os .rtmbu-tg.on { border-color: #99f6e4; background: #f0fdfa; color: #0f766e; }
#workspace-rtm-os .rtmbu-tg.on i { background: #0d9488; }
#workspace-rtm-os .rtmbu-tg.on i::after { transform: translateX(11px); }
#workspace-rtm-os .rtmbu-tg:disabled { cursor: not-allowed; opacity: .55; }
