/**
 * DEGORO AI CORPORATE HQ — CLEAN & FRIENDLY VISUAL OFFICE UI
 * Giao diện tối giản chữ, tập trung vào hình ảnh nhân sự 3D trực quan, thoáng đãng và thân thiện
 */

:root {
  --bg-app: #0f172a;
  --bg-stage: #eef2f6;
  --panel-bg: #ffffff;
  --border-subtle: #e2e8f0;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --brand-blue: #0284c7;
  --brand-green: #10b981;
  --brand-amber: #f59e0b;
  --brand-crimson: #ef4444;
}

*,
*::before,
*::after,
button,
input,
select,
textarea {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Be Vietnam Pro', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Be Vietnam Pro', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.48;
  background: var(--bg-stage);
  color: var(--text-dark);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ══════════ 1. THANH HEADER DUY NHẤT (GỌN, SẠCH, DỄ NHÌN) ══════════ */
.top-command-bar {
  height: 60px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 14px;
  flex-shrink: 0;
  z-index: 50;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-emblem {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #ffffff;
  padding: 2px;
  border: 1.5px solid #28F76B;
}

.brand-wordmark {
  height: 19px;
  width: auto;
  object-fit: contain;
}

.project-switcher {
  display: flex;
  align-items: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.project-switcher::-webkit-scrollbar {
  display: none;
}

.proj-btn {
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}

.proj-btn:hover {
  color: #ffffff;
}

.proj-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

/* Cụm 4 bước siêu gọn trên Header */
.QuickStepsBar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid #334155;
  padding: 4px 8px;
  border-radius: 999px;
}

.qstep-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s;
  white-space: nowrap;
}

.qstep-pill:hover,
.qstep-pill.active {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}

.qstep-pill.highlight {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.qstep-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #334155;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qstep-pill.active .qstep-num {
  background: #0284c7;
}

.qstep-pill.highlight .qstep-num {
  background: #10b981;
}

.qstep-sep {
  color: #64748b;
  font-size: 14px;
  font-weight: 900;
}

/* Cụm nút bên phải Header */
.top-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.tool-pill {
  border: 1px solid #334155;
  background: #1e293b;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
  white-space: nowrap;
}

.tool-pill:hover {
  background: #334155;
}

.tool-pill.gold-cta {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

.tool-pill.active-blue {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

/* ══════════ 2. BỐ CỤC 3 CỘT THOÁNG ĐÃNG ══════════ */
.main-viewport {
  flex: 1;
  display: grid;
  grid-template-columns: 310px 1fr 340px;
  background: var(--bg-stage);
  position: relative;
  overflow: hidden;
}

/* ── CỘT TRÁI: BÀI CHỜ DUYỆT (ÍT CHỮ, RÕ RÀNG) ── */
.left-overview-panel {
  background: #ffffff;
  border-right: 1px solid #dbe2ea;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.panel-header {
  padding: 16px 16px 10px;
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.sprint-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.kpi-counter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 16px 12px;
}

.kpi-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.kpi-box:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
}

.kpi-num {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
}

.kpi-num.amber { color: #d97706; }
.kpi-num.green { color: #10b981; }
.kpi-num.red { color: #ef4444; }

.kpi-lbl {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  margin-top: 3px;
}

.c5-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 14px 10px;
}

.c5-chip {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.c5-chip.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.task-queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.18s;
}

.task-card:hover {
  border-color: #0284c7;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.1);
}

.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.task-proj-badge {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.task-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.task-status-badge.pending {
  background: #fef3c7;
  color: #b45309;
}

.task-status-badge.approved,
.task-status-badge.scheduled {
  background: #dcfce7;
  color: #15803d;
}

.task-status-badge.needs_fix {
  background: #fee2e2;
  color: #b91c1c;
}

.task-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 8px;
}

.task-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
}

.task-open-link {
  color: #0284c7;
  font-weight: 700;
}

.panel-footer-cta {
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.btn-approve-all {
  width: 100%;
  border: none;
  background: #10b981;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.16s;
}

.btn-approve-all:hover {
  background: #059669;
}

/* ══════════ TRUNG TÂM: SƠ ĐỒ TÒA NHÀ 4 TẦNG TRỰC QUAN ══════════ */
.building-center-stage {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #eef2f6;
}

.floor-elevator-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: #ffffff;
  border-bottom: 1px solid #dbe2ea;
  flex-shrink: 0;
  gap: 8px;
}

.elevator-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.elev-btn {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s;
}

.elev-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.elev-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.elev-btn.highlight-mkt.active {
  background: #059669;
  border-color: #059669;
}

.btn-log-mini {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.corporate-building-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* MỖI TẦNG TRONG TÒA NHÀ — SÁNG SỦA, HIỆN ĐẠI, THOÁNG ĐÃNG */
.building-floor-section {
  background: #ffffff;
  border: 1.5px solid #dbe2ea;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  overflow: visible;
  flex-shrink: 0;
}

.building-floor-section.floor-3 {
  border: 2px solid #10b981;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.08);
}

.floor-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 16px 16px 0 0;
}

.building-floor-section.floor-3 .floor-header-banner {
  background: #ecfdf5;
  border-bottom-color: #a7f3d0;
}

.floor-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.floor-number-badge {
  background: #0f172a;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  line-height: 1.35;
}

.building-floor-section.floor-3 .floor-number-badge {
  background: #059669;
}

.floor-dept-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.btn-run-floor {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.35;
  transition: all 0.16s;
}

.btn-run-floor:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* LƯỚI NHÂN SỰ TRÊN TẦNG — DẠNG AVATAR TRỰC QUAN, KHÔNG NHỒI CHỮ */
.floor-workstations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
  padding: 16px 18px;
  background: #ffffff;
  border-radius: 0 0 16px 16px;
}

.floor-workstations-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.floor-3-subgroup-wrap {
  padding: 12px 18px 16px;
  background: #ffffff;
  border-radius: 0 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.floor-3-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #10b981;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.floor-3-row-header.channel-row {
  border-left-color: #0284c7;
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

.workstation-desk-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.workstation-desk-card:hover {
  background: #ffffff;
  border-color: #0284c7;
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(2, 132, 199, 0.14);
  z-index: 45;
}

.workstation-desk-card.selected {
  background: #f0f9ff;
  border: 2px solid #0284c7;
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.16);
}

.workstation-desk-card.working-burst {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
}

/* ══════════ BONG BÓNG BÁO CÁO SẾP KHI RÀ CHUỘT (HOVER SPEECH POPOVER) ══════════ */
.boss-hover-report-bubble {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 8px) scale(0.95);
  width: 256px;
  background: #0f172a;
  color: #ffffff;
  border: 1.5px solid #38bdf8;
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.48;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.2s;
  z-index: 95;
}

.boss-hover-report-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}

.boss-hover-report-bubble.bubble-below {
  bottom: auto;
  top: calc(100% + 10px);
}

.boss-hover-report-bubble.bubble-below::after {
  top: auto;
  bottom: 100%;
  border-color: transparent transparent #0f172a transparent;
}

.boss-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 4px;
}

.workstation-desk-card:hover .boss-hover-report-bubble,
.workstation-desk-card.collab-talking .boss-hover-report-bubble {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

/* ══════════ AVATAR 3D MẶC TRANG PHỤC NỀN TẢNG + HIỆU ỨNG MẤP MÁY MÔI BÁO CÁO ══════════ */
.staff-portrait-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 2px;
}

.staff-portrait-frame {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 22px;
  background: #ffffff;
  border: 2.5px solid #e2e8f0;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.workstation-desk-card:hover .staff-portrait-frame,
.workstation-desk-card.collab-talking .staff-portrait-frame {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.22), 0 8px 18px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
}

.agent-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  display: block;
}

/* Sóng âm thanh báo cáo tự nhiên khi rà chuột (giữ 100% nét mặt nguyên bản) */
.talking-voice-wave-pill {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  color: #34d399;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 2.5px;
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 4;
  white-space: nowrap;
  border: 1px solid rgba(52, 211, 153, 0.45);
}

.workstation-desk-card:hover .talking-voice-wave-pill,
.workstation-desk-card.collab-talking .talking-voice-wave-pill,
.insp-profile-card:hover .talking-voice-wave-pill {
  opacity: 1;
}

.wave-bar {
  display: inline-block;
  width: 2px;
  height: 7px;
  background: #34d399;
  border-radius: 2px;
  animation: voiceWavePulse 0.32s infinite ease-in-out alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; height: 10px; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; height: 6px; }

@keyframes voiceWavePulse {
  0% { transform: scaleY(0.45); }
  100% { transform: scaleY(1.15); }
}

.staff-online-dot {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #6ee7b7 0%, #10b981 55%, #059669 100%);
  border: 3px solid #ffffff;
  z-index: 8;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.staff-online-dot:hover {
  transform: scale(1.22);
}

.staff-full-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}

.staff-role-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  color: #ffffff;
  line-height: 1.35;
  white-space: nowrap;
}

/* Bong bóng trạng thái 1 dòng ngắn gọn, không cắt dấu tiếng Việt */
.staff-bubble-short {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #334155;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nút bấm gọn dưới chân thẻ nhân sự */
.desk-action-row {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
}

.btn-desk-act {
  flex: 1;
  border: 1px solid #dbe2ea;
  background: #ffffff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 6px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.35;
  transition: all 0.15s;
}

.btn-desk-act.primary {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.btn-desk-act.primary:hover {
  background: #0369a1;
}

/* ══════════ CỘT PHẢI: HỒ SƠ NHÂN SỰ & CÔNG CỤ (THOÁNG, DỄ BẤM) ══════════ */
.right-inspector-panel {
  background: #ffffff;
  border-left: 1px solid #dbe2ea;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.insp-tab-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  padding: 13px 6px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.35;
  border-bottom: 2.5px solid transparent;
}

.insp-tab-btn.active {
  color: #0284c7;
  border-bottom-color: #0284c7;
  background: #ffffff;
}

.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insp-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px;
}

.insp-avatar-lg {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 18px;
  overflow: hidden;
  border: 2.5px solid #0284c7;
  background: #ffffff;
  flex-shrink: 0;
}

.insp-name {
  font-size: 15.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.insp-role {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
  line-height: 1.4;
}

.insp-dept {
  font-size: 11.5px;
  color: #0284c7;
  font-weight: 700;
  margin-top: 3px;
  line-height: 1.4;
}

.insp-status-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #166534;
  line-height: 1.45;
}

.insp-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-insp-main {
  border: none;
  background: #0284c7;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.btn-insp-sub {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.insp-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clean-tools-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clean-tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
}

.clean-tool-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.clean-tool-badge {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.btn-use-tool {
  border: none;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11.5px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-use-tool:hover {
  background: #0284c7;
  color: #ffffff;
}

/* Progress bar kho hàng */
.inventory-progress-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
}

.inv-bar-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0;
}

.inv-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #0284c7);
  border-radius: 999px;
}

/* ══════════ TOAST & LOG DRAWER ══════════ */
.skill-toast-stack {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.skill-toast {
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.25);
}

.activity-log-drawer {
  position: absolute;
  bottom: 0;
  left: 310px;
  right: 340px;
  height: 230px;
  background: #0f172a;
  color: #f8fafc;
  border-top: 2px solid #38bdf8;
  z-index: 80;
  display: none;
  flex-direction: column;
}

.activity-log-drawer.open {
  display: flex;
}

.log-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #1e293b;
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
}

.log-drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.log-item {
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.log-item .time {
  color: #94a3b8;
  margin-right: 6px;
}

.log-item .agent {
  color: #38bdf8;
  font-weight: 700;
  margin-right: 6px;
}

/* ══════════ MODALS (GỌN GÀNG, HIỆN ĐẠI) ══════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-window {
  background: #ffffff;
  border-radius: 18px;
  width: 100%;
  max-width: 940px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #0f172a;
  color: #ffffff;
}

.modal-topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 800;
}

.modal-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
}

.modal-content-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 18px;
  padding: 18px 20px;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: #0f172a;
  font-family: inherit;
}

.advanced-meta-details {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #475569;
}

.advanced-meta-details summary {
  cursor: pointer;
  font-weight: 700;
}

.gatekeeper-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.v7-cover-preview {
  background: linear-gradient(165deg, #0f172a 0%, #1e293b 55%, #064e3b 100%);
  border-radius: 14px;
  padding: 18px 14px;
  color: #ffffff;
  text-align: center;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 12px;
}

.v7-kicker {
  font-size: 10px;
  letter-spacing: 2px;
  color: #cbd5e1;
}

.v7-callout {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid #fde047;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 11px;
  color: #fde047;
  font-weight: 700;
}

.v7-l1 {
  font-size: 13px;
  color: #fde68a;
  font-weight: 700;
}

.v7-l2 {
  font-size: 21px;
  font-weight: 900;
  color: #ffffff;
}

.v7-l3 {
  font-size: 22px;
  font-weight: 900;
  color: #fde047;
}

.v7-payoff {
  font-size: 11.5px;
  color: #e2e8f0;
  font-style: italic;
}

.critic-scorecard {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
}

.critic-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.modal-footer-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.btn-modal {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 15px;
  border-radius: 10px;
  cursor: pointer;
}

.btn-modal.approve {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.btn-modal.rewrite {
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
}

.btn-modal.copy {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0369a1;
}

.tools-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.tool-hub-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.ug-console-output {
  background: #0f172a;
  color: #38bdf8;
  font-family: Consolas, monospace;
  font-size: 12px;
  padding: 12px;
  border-radius: 10px;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ══════════ KHÔNG GIAN CHAT LỚN TẦNG 4 & CỔNG ĐÀO TẠO AGENT OPENCLAW ══════════ */
.floor-4-command-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 14px;
  background: #ffffff;
  align-items: stretch;
  border-radius: 0 0 16px 16px;
}

.floor-4-executives-pair {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  align-items: stretch;
  height: 100%;
}

.floor-4-executives-pair .workstation-desk-card {
  min-width: 0;
  width: 100%;
  flex: 1;
  padding: 10px 10px 9px;
  gap: 5px;
  justify-content: space-between;
}

.floor-4-executives-pair .staff-portrait-wrap {
  width: 76px;
  height: 76px;
  margin: 0 auto 3px;
}

.floor-4-executives-pair .staff-portrait-frame {
  width: 76px;
  height: 76px;
  border-radius: 18px;
}

.floor-4-executives-pair .staff-full-name {
  font-size: 13px;
  margin-top: 2px;
}

.floor-4-executives-pair .staff-bubble-short {
  padding: 4px 8px;
  font-size: 10.5px;
}

.executive-meeting-room {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
  border: 1.5px solid #bae6fd;
  border-radius: 16px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  height: 100%;
}

.executive-meeting-room.training-mode {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border-color: #c4b5fd;
}

.floor4-mode-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
}

.floor4-tab-group {
  display: inline-flex;
  align-items: center;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 10px;
  gap: 4px;
  flex-wrap: nowrap;
}

.floor4-tab-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.16s;
}

.floor4-tab-btn.active.gm-tab {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.28);
}

.floor4-tab-btn.active.train-tab {
  background: #7c3aed;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.28);
}

.floor4-agent-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 1px 6px;
  margin-left: 2px;
}

.floor4-agent-select-wrap.direct-active {
  border-color: #059669;
  background: #ecfdf5;
}

.floor4-agent-chat-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  outline: none;
  cursor: pointer;
  padding: 3px 1px;
  max-width: 175px;
}

.meeting-room-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.meeting-room-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-uniform-pill {
  background: #d1fae5;
  color: #047857;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}

.meeting-table-stage {
  background: #ffffff;
  border: 2px solid #a7f3d0;
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  box-shadow: inset 0 2px 8px rgba(16, 185, 129, 0.08);
  position: relative;
}

.meeting-seats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 8px;
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  border-radius: 999px;
}

.meeting-seat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid #10b981;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
  transition: all 0.35s ease;
  position: relative;
}

.meeting-seat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meeting-live-status {
  width: 100%;
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 14px;
  line-height: 1.45;
}

.meeting-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-meeting-act {
  border: 1px solid #10b981;
  background: #10b981;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-meeting-act:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-meeting-act.secondary {
  background: #ffffff;
  color: #047857;
}

/* Avatar nhân sự di chuyển trực tiếp giữa các bàn & lên phòng họp */
.walking-agent-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 850;
  overflow: hidden;
}

.walking-agent-token {
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.97);
  border: 2px solid #10b981;
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
  will-change: transform;
}

.walking-agent-token img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #059669;
}

.walking-agent-speech {
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.workstation-desk-card.collab-talking {
  border-color: #10b981 !important;
  background: #ecfdf5 !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25) !important;
}

/* ══════════ THẺ DỰ ÁN ĐỘC LẬP (+ DỰ ÁN MỚI) ══════════ */
.top-pill.add-proj-btn {
  background: rgba(16, 185, 129, 0.16);
  border: 1px dashed #34d399;
  color: #6ee7b7;
  font-weight: 800;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.18s;
}

.top-pill.add-proj-btn:hover {
  background: #10b981;
  color: #ffffff;
  border-style: solid;
}

/* ══════════ ĐỒNG HỒ DEADLINE & ĐO KPI CHO MỖI PHÒNG BAN (TẦNG) & MỖI AGENT ══════════ */
.floor-kpi-deadline-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.floor-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  border: 1.5px solid #34d399;
  color: #065f46;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.floor-kpi-mini-bar {
  width: 44px;
  height: 6px;
  background: #a7f3d0;
  border-radius: 999px;
  overflow: hidden;
}

.floor-kpi-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #10b981);
  border-radius: 999px;
}

.floor-deadline-clock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fffbeb;
  border: 1.5px solid #fbbf24;
  color: #b45309;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Dải đo KPI & Đồng hồ đếm ngược Deadline trên từng thẻ Agent */
.agent-kpi-timer-strip {
  width: 100%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-kpi-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  color: #334155;
  line-height: 1.25;
}

.agent-kpi-val {
  color: #047857;
  font-weight: 800;
}

.agent-deadline-timer {
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.agent-kpi-bar-track {
  width: 100%;
  height: 5px;
  background: #cbd5e1;
  border-radius: 999px;
  overflow: hidden;
}

.agent-kpi-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* ══════════ KHUNG CHAT TỰ NHIÊN BOSS <-> GIÁM ĐỐC MINH QUÂN (TELEGRAM & TRUYỀN LỆNH UI) ══════════ */
.boss-gm-chat-panel {
  background: #ffffff;
  border: 1.5px solid #bae6fd;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  height: 100%;
}

.executive-meeting-room.training-mode .boss-gm-chat-panel {
  border-color: #ddd6fe;
}

.boss-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 8px;
}

.boss-chat-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.telegram-sync-badge {
  font-size: 11px;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 3px 10px;
  border-radius: 999px;
}

.boss-chat-messages {
  flex: 1;
  min-height: 245px;
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.boss-chat-welcome-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd;
  border-radius: 11px;
  padding: 12px 14px;
}

.boss-chat-welcome-card.trainer-welcome {
  background: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
  border-color: #ddd6fe;
}

.boss-chat-msg {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
}

.boss-chat-msg.from-boss {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  align-self: flex-end;
  max-width: 88%;
}

.boss-chat-msg.from-gm {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #064e3b;
  align-self: flex-start;
  max-width: 94%;
}

.boss-chat-msg.from-trainer {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: #4c1d95;
  align-self: flex-start;
  max-width: 94%;
}

.boss-chat-relay-line {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #6ee7b7;
  font-size: 11px;
  font-weight: 700;
  color: #047857;
}

.boss-chat-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.boss-chat-input {
  flex: 1;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  color: #0f172a;
  font-family: inherit;
  outline: none;
}

.boss-chat-input:focus {
  border-color: #10b981;
}

.boss-chat-send-btn {
  border: none;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.boss-quick-prompts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.boss-prompt-chip {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.boss-prompt-chip:hover {
  background: #ecfdf5;
  border-color: #10b981;
  color: #047857;
}

/* ══════════ HỆ THỐNG 4 MÀU TRẠNG THÁI CÔNG VIỆC (XANH LÁ - XANH DƯƠNG - CAM - ĐỎ) & AVATAR NGỦ ══════════ */
.workload-legend-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.wl-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.wl-legend-item.wl-green {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.wl-legend-item.wl-blue {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #7dd3fc;
}

.wl-legend-item.wl-orange {
  background: #fffbeb;
  color: #b45309;
  border-color: #fcd34d;
}

.wl-legend-item.wl-red {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.wl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.wl-dot.green { background: #10b981; }
.wl-dot.blue { background: #0284c7; }
.wl-dot.orange { background: #f59e0b; }
.wl-dot.red { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

/* Đèn LED 4 màu gắn trực tiếp ngay góc Avatar (Bấm vào đèn để đổi trạng thái) */
.staff-online-dot.state-idle {
  background: radial-gradient(circle at 35% 35%, #6ee7b7 0%, #10b981 55%, #059669 100%) !important;
  box-shadow: 0 0 0 2px #a7f3d0, 0 0 10px rgba(16, 185, 129, 0.75);
}

.staff-online-dot.state-light {
  background: radial-gradient(circle at 35% 35%, #7dd3fc 0%, #0284c7 55%, #0369a1 100%) !important;
  box-shadow: 0 0 0 2px #bae6fd, 0 0 10px rgba(2, 132, 199, 0.8);
}

.staff-online-dot.state-busy {
  background: radial-gradient(circle at 35% 35%, #fde68a 0%, #f59e0b 55%, #d97706 100%) !important;
  box-shadow: 0 0 0 2px #fde68a, 0 0 11px rgba(245, 158, 11, 0.85);
}

.staff-online-dot.state-kpi_rush {
  background: radial-gradient(circle at 35% 35%, #fca5a5 0%, #ef4444 55%, #b91c1c 100%) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4), 0 0 14px rgba(239, 68, 68, 0.95);
  animation: pulseRedKpiDot 1.1s infinite ease-in-out;
}

@keyframes pulseRedKpiDot {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35), 0 0 10px rgba(239, 68, 68, 0.8); }
  50% { transform: scale(1.2); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.45), 0 0 16px rgba(239, 68, 68, 1); }
}

/* Viền khung Avatar đồng bộ 4 màu đèn LED */
.staff-portrait-frame.state-idle {
  border-color: #10b981 !important;
}

.staff-portrait-frame.state-light {
  border-color: #0284c7 !important;
}

.staff-portrait-frame.state-busy {
  border-color: #f59e0b !important;
}

.staff-portrait-frame.state-kpi_rush {
  border-color: #ef4444 !important;
}

/* Viền thẻ nhân sự & Thanh KPI theo 4 màu */
.workstation-desk-card.state-idle {
  background: #f8fafc;
  border: 1.5px dashed #a7f3d0;
}

.workstation-desk-card.state-light {
  background: #ffffff;
  border-color: #7dd3fc;
}

.workstation-desk-card.state-busy {
  background: #ffffff;
  border-color: #fbbf24;
}

.workstation-desk-card.state-kpi_rush {
  background: #fffafa;
  border: 1.5px solid #f87171;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.12);
}

.agent-kpi-bar-fill.state-idle {
  background: linear-gradient(90deg, #10b981, #34d399) !important;
}

.agent-kpi-bar-fill.state-light {
  background: linear-gradient(90deg, #0284c7, #38bdf8) !important;
}

.agent-kpi-bar-fill.state-busy {
  background: linear-gradient(90deg, #d97706, #f59e0b) !important;
}

.agent-kpi-bar-fill.state-kpi_rush {
  background: linear-gradient(90deg, #dc2626, #ef4444) !important;
}

/* Nút bấm chính trên mỗi bàn làm việc theo đúng 4 màu: Xanh lá - Xanh dương - Cam - Đỏ */
.btn-desk-act.primary.state-idle {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}
.btn-desk-act.primary.state-idle:hover {
  background: #059669 !important;
}

.btn-desk-act.primary.state-light {
  background: #0284c7 !important;
  border-color: #0369a1 !important;
  color: #ffffff !important;
}
.btn-desk-act.primary.state-light:hover {
  background: #0369a1 !important;
}

.btn-desk-act.primary.state-busy {
  background: #f59e0b !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
}
.btn-desk-act.primary.state-busy:hover {
  background: #d97706 !important;
}

.btn-desk-act.primary.state-kpi_rush {
  background: #ef4444 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}
.btn-desk-act.primary.state-kpi_rush:hover {
  background: #dc2626 !important;
}

/* Trạng thái Avatar Ngủ (Sleeping Avatar) khi Agent đang rảnh không có việc trong dự án */
.staff-portrait-frame.is-sleeping {
  border-color: #6ee7b7 !important;
  background: #e2e8f0;
}

.staff-portrait-frame.is-sleeping .agent-avatar-img {
  filter: saturate(0.55) brightness(0.88) contrast(0.95);
  transition: filter 0.25s ease;
}

.workstation-desk-card:hover .staff-portrait-frame.is-sleeping .agent-avatar-img {
  filter: saturate(0.85) brightness(0.96);
}

.sleeping-pill-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.86);
  color: #6ee7b7;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid #10b981;
  z-index: 4;
  pointer-events: none;
}

.sleeping-zzz-cloud {
  position: absolute;
  top: -8px;
  right: -10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 6;
}

.sleeping-zzz-cloud span {
  font-weight: 900;
  color: #059669;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.95);
  line-height: 1;
  animation: floatZzzBubble 2.4s infinite ease-in-out;
}

.sleeping-zzz-cloud span:nth-child(1) {
  font-size: 13px;
  margin-left: 8px;
  animation-delay: 0s;
}

.sleeping-zzz-cloud span:nth-child(2) {
  font-size: 11px;
  margin-left: 2px;
  animation-delay: 0.6s;
}

.sleeping-zzz-cloud span:nth-child(3) {
  font-size: 9px;
  margin-left: -4px;
  animation-delay: 1.2s;
}

@keyframes floatZzzBubble {
  0%, 100% { transform: translateY(0) scale(0.95); opacity: 0.65; }
  50% { transform: translateY(-4px) scale(1.1); opacity: 1; }
}

/* ══════════ THANH CHAT ĐA NĂNG TẦNG 4 (PHONG CÁCH ANTIGRAVITY / ZALO GỌN ĐẸP + GỬI FILE & GHI ÂM) ══════════ */
.boss-chat-composer-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 20px;
  padding: 5px 8px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.zalo-agy-composer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.boss-chat-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.boss-chat-composer-tools-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.boss-chat-composer-wrap:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.boss-chat-composer-wrap.training-composer:focus-within {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.boss-chat-tool-btn {
  border: 1px solid transparent;
  background: #f1f5f9;
  color: #334155;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.boss-chat-tool-btn:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0284c7;
  transform: translateY(-1px);
}

.boss-chat-tool-btn.listening {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
  animation: pulseRedKpiDot 1s infinite;
}

.boss-chat-textarea {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  color: #0f172a;
  resize: none;
  min-height: 28px;
  max-height: 72px;
  padding: 5px 6px;
}

/* Nút Gửi Icon tròn đơn giản chuẩn Antigravity / Zalo */
.zalo-agy-send-icon-btn {
  border: none;
  background: linear-gradient(135deg, #0284c7, #059669);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.28);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.zalo-agy-send-icon-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 5px 12px rgba(2, 132, 199, 0.38);
}

.zalo-agy-send-icon-btn.trainer-btn {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 3px 8px rgba(124, 58, 237, 0.28);
}

.zalo-agy-send-icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.boss-chat-send-action-btn {
  border: none;
  background: linear-gradient(135deg, #0284c7, #059669);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}

.boss-chat-send-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(2, 132, 199, 0.35);
}

.boss-chat-send-action-btn.trainer-btn {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.28);
}

/* Dải hiển thị File / Bản ghi âm đính kèm trước khi gửi */
.chat-attachment-preview-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 6px 2px;
  border-bottom: 1px dashed #e2e8f0;
}

.chat-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  max-width: 260px;
}

.chat-att-chip.audio-chip {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.chat-att-chip-remove {
  cursor: pointer;
  font-weight: 900;
  opacity: 0.7;
  margin-left: 2px;
}

.chat-att-chip-remove:hover {
  opacity: 1;
}

/* Thanh trạng thái đang ghi âm trực tiếp */
.chat-voice-recorder-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 800;
  color: #b91c1c;
}

/* Bong bóng hiển thị File & Audio Player trong lịch sử Chat */
.chat-msg-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.chat-audio-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 10px;
  max-width: 340px;
}

.chat-audio-bubble audio {
  height: 28px;
  max-width: 220px;
}

.chat-file-bubble {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  width: fit-content;
}

.chat-file-bubble:hover {
  border-color: #0284c7;
  color: #0284c7;
}

.chat-emoji-picker-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 6px;
  width: 310px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
  z-index: 120;
  display: none;
}

.chat-emoji-picker-popover.open {
  display: block;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.emoji-item-btn {
  border: none;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 17px;
  padding: 5px 0;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}

.emoji-item-btn:hover {
  background: #e0f2fe;
  transform: scale(1.18);
}

.auto-meeting-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #15803d;
  user-select: none;
}

.auto-meeting-toggle-pill.off {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

/* ══════════ POPUP PHÒNG HỌP: BỘ CHỌN TRIỆU TẬP AGENT TÙY Ý HOẶC CẢ CÔNG TY ══════════ */
.meeting-summon-control-box {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meeting-scope-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.meeting-scope-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.meeting-scope-btn:hover {
  border-color: #0284c7;
  color: #0284c7;
}

.meeting-scope-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.meeting-agent-selector-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.meeting-agent-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  transition: all 0.14s;
  user-select: none;
}

.meeting-agent-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.meeting-agent-chip.selected {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.15);
}

.meeting-boss-directive-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #0284c7;
  border-radius: 12px;
  padding: 6px 10px;
  margin-bottom: 12px;
}

/* ══════════ THANH QUẢN LÝ CHIẾN DỊCH THEO THỜI ĐIỂM TRONG DỰ ÁN ══════════ */
.project-campaign-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  background: linear-gradient(90deg, #f8fafc 0%, #f0fdf4 100%);
  border-bottom: 1px solid #cbd5e1;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.campaign-pills-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.camp-strip-label {
  font-size: 11px;
  font-weight: 800;
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.camp-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.camp-pill-btn:hover {
  border-color: #059669;
  color: #065f46;
}

.camp-pill-btn.active {
  background: #059669;
  border-color: #047857;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.camp-add-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px dashed #059669;
  background: #ecfdf5;
  color: #047857;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.camp-add-action-btn:hover {
  background: #059669;
  color: #ffffff;
  border-style: solid;
}

/* ══════════ TRUNG TÂM TÀI CHÍNH CFO & KẾ TOÁN TỔNG HỢP ══════════ */
.cfo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.cfo-kpi-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cfo-kpi-card .kpi-lbl,
.cfo-kpi-title {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
}

.cfo-kpi-card .kpi-val,
.cfo-kpi-value {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
}

.cfo-kpi-card .kpi-val.positive {
  color: #047857;
}

.cfo-kpi-card .kpi-val.negative {
  color: #dc2626;
}

.cfo-kpi-card .kpi-val.warning {
  color: #d97706;
}

.cfo-kpi-card .kpi-sub,
.cfo-kpi-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
}

.cfo-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #e2e8f0;
}

.cfo-tab-btn {
  padding: 6px 11px;
  border-radius: 9px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s;
}

.cfo-tab-btn:hover {
  border-color: #047857;
  color: #047857;
}

.cfo-tab-btn.active {
  background: #047857;
  border-color: #064e3b;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(4, 120, 87, 0.22);
}

.cfo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.cfo-table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 800;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1.5px solid #cbd5e1;
  font-size: 11.5px;
}

.cfo-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.cfo-table tr.row-subtotal td {
  background: #f8fafc;
  font-weight: 800;
}

.cfo-table tr.row-highlight td {
  background: #ecfdf5;
  font-weight: 900;
  color: #065f46;
}

.cfo-table tr.row-net_profit td {
  background: linear-gradient(90deg, #064e3b, #047857);
  color: #ffffff;
  font-weight: 900;
  font-size: 13px;
}


