/* =============================================
   CRM B2B GHN - Page Specific Styles
   ============================================= */

/* ---------- Dashboard ---------- */
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: var(--space-6); }
.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.chart-card { background: var(--card-bg); border-radius: var(--radius-xl); border: 1px solid rgba(0,0,0,0.04); padding: 16px; box-shadow: var(--shadow-card); transition: all var(--transition-base); }
.chart-card:hover { box-shadow: var(--shadow-md); }
.chart-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-900);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-50);
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 4px solid var(--primary-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chart-wrapper { position: relative; height: 280px; }

@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
}

/* ---------- Welcome Banner ---------- */
.welcome-banner {
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-xl);
  padding: 16px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-card);
}
.welcome-content { flex: 1; }
.welcome-greeting {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-900);
  margin-bottom: var(--space-1);
}
.welcome-summary {
  font-size: var(--font-size-sm);
  color: var(--neutral-500);
}

/* ---------- Premium Stat Cards ---------- */
.stat-card-premium {
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-card);
  background: var(--card-bg);
}
.stat-card-premium:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--neutral-300);
}
.stat-card-premium .stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-card-premium .stat-card-info { flex: 1; min-width: 0; }
.stat-card-premium .stat-card-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-900);
  line-height: 1.2;
}
.stat-card-premium .stat-card-label {
  font-size: var(--font-size-sm);
  color: var(--neutral-600);
  margin-top: 2px;
}
.stat-card-premium .stat-card-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.6);
  color: var(--neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.stat-card-premium .stat-card-badge.good {
  background: rgba(76,175,80,0.15);
  color: var(--success-dark);
}
.stat-card-premium .stat-card-alert {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: rgba(244,67,54,0.15);
  color: var(--danger-dark);
  text-transform: uppercase;
  animation: reminderPulse 2s ease-in-out infinite;
}
.stat-blue .stat-card-icon { background: var(--info-light); color: var(--info); }
.stat-green .stat-card-icon { background: var(--success-light); color: var(--success-dark); }
.stat-amber .stat-card-icon { background: var(--warning-light); color: var(--warning-dark); }
.stat-red .stat-card-icon { background: var(--danger-light); color: var(--danger-dark); }

/* Progress Ring */
.stat-card-ring {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(0,0,0,0.08); stroke-width: 3; }
.ring-fill { fill: none; stroke: var(--success); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 1s ease; }
.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  color: var(--success-dark);
}

/* ---------- Team Performance ---------- */
.team-perf-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  /* Scrollbar styles — always visible */
  scrollbar-width: thin;
  scrollbar-color: var(--neutral-300) var(--neutral-100);
}
.team-perf-list::-webkit-scrollbar {
  width: 6px;
}
.team-perf-list::-webkit-scrollbar-track {
  background: var(--neutral-100);
  border-radius: 4px;
}
.team-perf-list::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 4px;
}
.team-perf-list::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}
.team-perf-item { display: flex; align-items: center; gap: var(--space-3); }
.team-perf-info { min-width: 140px; flex-shrink: 0; }
.team-perf-name { font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); color: var(--neutral-800); display: block; }
.team-perf-stat { font-size: var(--font-size-xs); color: var(--neutral-500); }
.team-perf-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.team-perf-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  transition: width 1s ease;
}
.team-perf-pct {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-700);
  min-width: 36px;
  text-align: right;
}

/* ---------- Pipeline Summary ---------- */
.pipeline-summary { display: flex; flex-direction: column; gap: var(--space-3); }
.pipeline-row { display: flex; align-items: center; gap: var(--space-3); }
.pipeline-step-label {
  font-size: var(--font-size-sm);
  color: var(--neutral-600);
  min-width: 80px;
  flex-shrink: 0;
}
.pipeline-bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.pipeline-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}
.pipeline-count {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-700);
  min-width: 24px;
  text-align: center;
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  padding: 1px 8px;
}

/* ---------- Activity Timeline ---------- */
.activity-timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  position: relative;
}
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 28px;
  bottom: -4px;
  width: 2px;
  background: var(--neutral-200);
}
.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 3px solid;
}
.timeline-dot.create { border-color: var(--success); background: var(--success-light); }
.timeline-dot.update { border-color: var(--primary-500); background: var(--primary-50); }
.timeline-dot.delete { border-color: var(--danger); background: var(--danger-light); }
.timeline-content { flex: 1; min-width: 0; }
.timeline-title {
  font-size: var(--font-size-sm);
  color: var(--neutral-800);
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
}
.timeline-meta {
  font-size: var(--font-size-xs);
  color: var(--neutral-500);
  margin-top: 2px;
}

/* ---------- Contract Alerts ---------- */
.contract-alerts { display: flex; flex-direction: column; gap: var(--space-3); }
.alert-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.alert-item:hover { transform: translateX(4px); }
.alert-item.danger { background: var(--danger-light); border-left: 3px solid var(--danger); }
.alert-item.warning { background: var(--warning-light); border-left: 3px solid var(--warning); }
.alert-badge {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  white-space: nowrap;
  flex-shrink: 0;
}
.alert-badge.danger { background: rgba(244,67,54,0.15); color: var(--danger-dark); }
.alert-badge.warning { background: rgba(255,152,0,0.15); color: var(--warning-dark); }
.alert-info { flex: 1; min-width: 0; }
.alert-company { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); color: var(--neutral-800); }
.alert-detail { font-size: var(--font-size-xs); color: var(--neutral-500); }

/* ---------- Onboarding Badges in Customer List ---------- */
.ob-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  margin-top: 4px;
}
.ob-pending {
  background: var(--warning-light);
  color: var(--warning-dark);
}
.ob-progress {
  background: var(--primary-100);
  color: var(--primary-700);
}
.ob-done {
  background: var(--success-light);
  color: var(--success-dark);
}

/* ---------- Onboarding Flow Pipeline ---------- */
.flow-pipeline-header {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}
.flow-step-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  opacity: 0.5;
  transition: all var(--transition-base);
}
.flow-step-indicator.has-items { opacity: 1; }
.flow-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.flow-step-info { min-width: 0; }
.flow-step-name {
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  color: var(--neutral-800);
  white-space: nowrap;
}
.flow-step-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--neutral-500);
}
.flow-step-arrow {
  font-size: 18px;
  color: var(--neutral-300);
  margin: 0 var(--space-2);
  flex-shrink: 0;
}

/* Kanban Grid */
.kanban-flow-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  gap: 12px;
  min-width: 1080px;
}
.kanban-column-premium {
  background: var(--neutral-50);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
  border-top: 3px solid var(--step-color);
}
.kanban-column-premium:hover {
  box-shadow: var(--shadow-md);
}
.kanban-col-header {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--neutral-200);
}
.kanban-col-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  color: #fff;
}
.kanban-col-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-700);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-col-count {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-0);
  background: var(--step-color);
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.kanban-col-body {
  padding: 12px;
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Premium Kanban Cards */
.kanban-card-premium {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.04);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}
.kanban-card-premium:hover {
  border-color: var(--step-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.kanban-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.kanban-card-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--neutral-100);
}
.kanban-card-info { flex: 1; min-width: 0; }
.kanban-card-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-card-owner {
  font-size: 13px;
  color: var(--neutral-500);
}
.kanban-card-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.kanban-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.kanban-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}
.kanban-progress-text {
  font-size: 13px;
  font-weight: var(--font-weight-bold);
  color: var(--neutral-500);
  flex-shrink: 0;
}
.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.kanban-card-date {
  font-size: 13px;
  color: var(--neutral-400);
}
.kanban-card-service {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--primary-50);
  color: var(--primary-700);
}

/* Empty state */
.kanban-empty {
  text-align: center;
  color: var(--neutral-400);
  font-size: 12px;
  padding: var(--space-6) var(--space-3);
}
.kanban-empty-icon {
  font-size: 24px;
  margin-bottom: var(--space-2);
  opacity: 0.5;
}

/* ---------- Reminders ---------- */
.reminder-list { display: flex; flex-direction: column; gap: var(--space-3); }
.reminder-item {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4);
  background: var(--card-bg); border-radius: var(--radius-xl); border: 1px solid rgba(0,0,0,0.04);
  transition: all var(--transition-fast); cursor: pointer;
}
.reminder-item:hover { box-shadow: var(--shadow-card); }
.reminder-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.reminder-icon.danger { background: var(--danger-light); }
.reminder-icon.warning { background: var(--warning-light); }
.reminder-icon.info { background: var(--info-light); }
.reminder-info { flex: 1; }
.reminder-title { font-size: var(--font-size-base); font-weight: var(--font-weight-medium); color: var(--neutral-900); }
.reminder-sub { font-size: var(--font-size-sm); color: var(--neutral-500); }
.reminder-date { font-size: var(--font-size-sm); color: var(--neutral-500); white-space: nowrap; }

/* ---------- Onboarding Detail Modal ---------- */
.onboard-steps { display: flex; flex-direction: column; gap: var(--space-4); }
.onboard-step {
  border: 1px solid rgba(0,0,0,0.04); border-radius: var(--radius-xl); overflow: hidden;
}
.onboard-step-header {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  background: var(--neutral-50); cursor: pointer; transition: background var(--transition-fast);
}
.onboard-step-header:hover { background: var(--neutral-100); }
.onboard-step-header .step-status { width: 24px; height: 24px; border-radius: var(--radius-full); border: 2px solid var(--neutral-300); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.onboard-step-header .step-status.done { background: var(--success); border-color: var(--success); color: var(--neutral-0); }
.onboard-step-header .step-status.active { border-color: var(--primary-500); }
.onboard-step-header .step-name { font-size: var(--font-size-base); font-weight: var(--font-weight-medium); }
.onboard-step-header .step-date { font-size: var(--font-size-xs); color: var(--neutral-500); margin-left: auto; }
.onboard-step-body { padding: var(--space-4); border-top: 1px solid var(--neutral-200); display: none; }
.onboard-step-body.open { display: block; }
.onboard-step-actions { display: flex; gap: var(--space-3); margin-top: var(--space-3); }

/* ---------- Premium Checklist ---------- */
.premium-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.checklist-item:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
}
.checklist-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--neutral-300);
  border-radius: 6px;
  background-color: var(--neutral-0);
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.checklist-item input[type="checkbox"]:hover {
  border-color: var(--primary-400);
}
.checklist-item input[type="checkbox"]:checked {
  background-color: var(--primary-500);
  border-color: var(--primary-500);
  transform: scale(1.05);
}
.checklist-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  top: 40%;
  left: 50%;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: translate(-50%, -50%) rotate(45deg);
}
.checklist-item-content {
  flex: 1;
}
.checklist-item-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--neutral-800);
}
.checklist-item-sub {
  font-size: 11px;
  color: var(--neutral-500);
  margin-top: 2px;
}
.checklist-item:has(input[type="checkbox"]:checked) {
  background: var(--primary-50);
  border-color: var(--primary-400);
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.1);
  transform: translateY(-1px);
}
.checklist-item:has(input[type="checkbox"]:checked) .checklist-item-text {
  color: var(--primary-700);
}
.checklist-item:has(input[type="checkbox"]:checked) .checklist-item-sub {
  color: var(--primary-600);
}

/* ---------- Customer Row Highlighting ---------- */
.data-table tr.row-signed td {
  background: rgba(76, 175, 80, 0.08);
  border-left-color: transparent;
}
.data-table tr.row-signed td:first-child {
  border-left: 4px solid var(--success);
  padding-left: calc(var(--space-4) - 3px);
}
.data-table tr.row-signed:hover td {
  background: rgba(76, 175, 80, 0.14);
}

.data-table tr.row-unsigned td {
  background: rgba(255, 152, 0, 0.08);
  border-left-color: transparent;
}
.data-table tr.row-unsigned td:first-child {
  border-left: 4px solid var(--warning);
  padding-left: calc(var(--space-4) - 3px);
}
.data-table tr.row-unsigned:hover td {
  background: rgba(255, 152, 0, 0.15);
}

/* ---------- Contract Cell & Reminder ---------- */
.contract-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.contract-reminder {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  cursor: help;
  background: var(--warning-light);
  color: var(--warning-dark);
  white-space: nowrap;
  animation: reminderPulse 2.5s ease-in-out infinite;
  position: relative;
}
.contract-reminder .cr-icon {
  font-size: 13px;
  line-height: 1;
}
.contract-reminder .cr-text {
  font-size: 11px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.contract-reminder.warn-file {
  background: var(--info-light);
  color: var(--primary-700);
  animation: reminderPulseBlue 2.5s ease-in-out infinite;
}

@keyframes reminderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}
@keyframes reminderPulseBlue {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

/* Tooltip on hover */
.contract-reminder:hover {
  animation: none;
  transform: scale(1.08);
  box-shadow: var(--shadow-card);
}
.contract-reminder::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--neutral-800);
  color: var(--neutral-0);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: var(--font-weight-normal);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  pointer-events: none;
  z-index: 10;
  text-transform: none;
  letter-spacing: 0;
}
.contract-reminder:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ---------- NSR Cell ---------- */
.nsr-cell {
  font-weight: var(--font-weight-semibold);
  color: var(--primary-800);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Backup Page ---------- */
.backup-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-5);
}
.backup-alert p { font-size: var(--font-size-sm); margin-top: 4px; opacity: 0.85; }
.backup-alert strong { font-weight: var(--font-weight-semibold); }
.backup-alert-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 2px; }
.backup-alert.danger { background: var(--danger-light); color: var(--danger-dark); border: 1px solid rgba(244,67,54,0.2); }
.backup-alert.warning { background: var(--warning-light); color: var(--warning-dark); border: 1px solid rgba(255,152,0,0.2); }
.backup-alert.success { background: var(--success-light); color: var(--success-dark); border: 1px solid rgba(76,175,80,0.2); }

.backup-stats { margin-top: var(--space-4); }
.backup-stat-header {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-700);
  margin-bottom: var(--space-3);
}
.backup-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
.backup-stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  background: var(--neutral-50);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}
.backup-stat-label { color: var(--neutral-600); }
.backup-stat-count {
  font-weight: var(--font-weight-bold);
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
}
.backup-stat-total {
  margin-top: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--neutral-600);
  text-align: right;
}

.backup-import-zone {
  border: 2px dashed var(--neutral-300);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--neutral-50);
}
.backup-import-zone:hover,
.backup-import-zone.dragover {
  border-color: var(--primary-500);
  background: var(--primary-50);
  transform: scale(1.01);
}
.import-zone-icon { font-size: 3rem; margin-bottom: var(--space-3); opacity: 0.6; }
.import-zone-title { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); color: var(--neutral-700); margin-bottom: var(--space-1); }
.import-zone-sub { font-size: var(--font-size-sm); color: var(--neutral-500); }

/* =============================================
   Permissions Matrix Page
   ============================================= */

/* Matrix Table */
.perm-matrix-card { overflow: hidden; }
.perm-matrix-table { border-collapse: separate; border-spacing: 0; }
.perm-matrix-table thead th {
  background: var(--neutral-50);
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--neutral-200);
  font-size: var(--font-size-sm);
}
.perm-th-label {
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-700);
}

/* Role Header in TH */
.perm-role-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.perm-role-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.perm-role-name {
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  color: var(--neutral-700);
}

/* Group Row */
.perm-group-row td {
  background: linear-gradient(90deg, var(--neutral-100), var(--neutral-50)) !important;
  padding: var(--space-2) var(--space-4) !important;
}
.perm-group-cell {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.perm-group-icon {
  margin-right: var(--space-2);
}

/* Permission Row */
.perm-row td {
  padding: 4px 8px !important;
  border-bottom: 1px solid var(--neutral-100);
  vertical-align: middle;
}
.perm-row:hover td {
  background: var(--primary-50) !important;
}
.perm-label-cell {
  min-width: 180px;
}
.perm-label-name {
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-800);
}
.perm-label-desc {
  font-size: 10px;
  color: var(--neutral-500);
  margin-top: 2px;
  line-height: 1.2;
}

/* Custom Toggle Checkbox */
.perm-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}
.perm-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.perm-toggle-visual {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1.5px solid var(--neutral-300);
  background: var(--neutral-50);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.perm-toggle-check {
  font-size: 12px;
  font-weight: bold;
  color: transparent;
  transition: all 0.2s ease;
  transform: scale(0);
}

/* Checked state */
.perm-toggle input:checked + .perm-toggle-visual {
  background: var(--primary-600);
  border-color: var(--primary-600);
  box-shadow: 0 2px 4px rgba(13, 148, 136, 0.2);
  transform: scale(1.05);
}
.perm-toggle input:checked + .perm-toggle-visual .perm-toggle-check {
  color: #fff;
  transform: scale(1);
}

/* Hover */
.perm-toggle:hover .perm-toggle-visual {
  border-color: var(--primary-400);
  background: var(--primary-50);
}
.perm-toggle input:checked + .perm-toggle-visual:hover {
  background: var(--primary-700);
  border-color: var(--primary-700);
}

/* Locked (HEAD_BD) */
.perm-toggle.perm-locked {
  cursor: not-allowed;
}
.perm-toggle.perm-locked .perm-toggle-visual {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  border-color: #14b8a6;
  opacity: 0.85;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}
.perm-toggle.perm-locked .perm-toggle-check {
  color: #fff;
  transform: scale(1);
}
.perm-toggle.perm-locked:hover .perm-toggle-visual {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  border-color: #14b8a6;
}

/* Role Summary Cards */
.perm-role-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
@media (max-width: 1200px) {
  .perm-role-cards { grid-template-columns: repeat(2, 1fr); }
}
.perm-role-summary-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0,0,0,0.04);
  padding: var(--space-4);
  transition: all var(--transition-base);
  border-top: 3px solid var(--role-color);
}
.perm-role-summary-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.perm-summary-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.perm-summary-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.perm-summary-name {
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  color: var(--neutral-800);
}
.perm-summary-desc {
  font-size: 11px;
  color: var(--neutral-500);
  margin-top: 2px;
  line-height: 1.3;
}
.perm-summary-bar-wrap {
  height: 6px;
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.perm-summary-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}
.perm-summary-stat {
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-600);
  text-align: right;
}

/* =============================================
   DUAL VIEW — View Toggle + Kanban Board
   Phase 1: CSS Foundation (v13)
   ============================================= */

/* ---------- Step Color Tokens (Monochromatic Teal) ---------- */
:root {
  --step1-color: #134e4a;  /* Tạo TK — Teal 900 */
  --step2-color: #115e59;  /* Bảng giá — Teal 800 */
  --step3-color: #0f766e;  /* Hợp đồng — Teal 700 */
  --step4-color: #0d9488;  /* Công nợ — Teal 600 */
  --step5-color: #14b8a6;  /* Vận hành — Teal 500 */
  --step6-color: #2dd4bf;  /* Bàn giao — Teal 400 */
  --step7-color: #5eead4;  /* Go-live — Teal 300 */
}

/* ---------- View Toggle (Segmented Control) ---------- */
.view-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.view-toggle-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-900);
}
.view-toggle-group {
  display: inline-flex;
  background: var(--neutral-100);
  border-radius: var(--radius-xl);
  padding: 3px;
  gap: 2px;
}
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--neutral-500);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.view-toggle-btn:hover { color: var(--neutral-800); }
.view-toggle-btn.active {
  background: var(--card-bg);
  color: var(--neutral-900);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ---------- BD Filter Bar ---------- */
.dual-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: var(--space-4);
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  position: relative;
  z-index: 50;
}
.dual-filter-bar .search-box { 
  flex: 1; min-width: 160px; max-width: 240px; position: relative; display: flex; align-items: center; 
}
.dual-filter-bar .search-input {
  width: 100%; padding: 0 36px 0 32px; border: 1px solid var(--neutral-300); border-radius: 12px;
  font-size: 13px; color: var(--neutral-800); background: #fff;
  height: 38px;
  font-weight: 500;
  transition: all var(--transition-fast); outline: none;
}
.dual-filter-bar .search-input:focus { border-color: var(--primary-400); box-shadow: 0 0 0 3px rgba(20,184,166,0.1); }
.dual-filter-bar .search-icon { position: absolute; left: 10px; color: var(--primary-600); font-size: 13px; pointer-events: none; }
.dual-filter-bar .search-kbd {
  position: absolute; right: 10px; padding: 2px 5px; border-radius: 4px;
  background: var(--neutral-100); color: var(--neutral-500); font-size: 13px;
  font-weight: 700; font-family: monospace; pointer-events: none; z-index: 1;
}
/* ---------- Outline Select (Material Design style) ---------- */
.outline-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.outline-select-wrapper .dual-filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #fff;
  border: 1px solid var(--neutral-300);
  border-radius: 12px;
  padding: 0 32px 0 12px;
  height: 38px;
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-800);
  outline: none;
  cursor: pointer;
  min-width: 140px;
  max-width: 180px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.outline-select-wrapper .dual-filter-select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 1px var(--primary-500);
}
.outline-select-wrapper .outline-label {
  display: none;
}
  background-color: #fff;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-500);
  pointer-events: none;
  transition: color 0.2s;
  z-index: 1;
}
.outline-select-wrapper .dual-filter-select:focus ~ .outline-label {
  color: var(--primary-600);
}
/* Dropdown Arrow */
.outline-select-wrapper::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  background-color: var(--neutral-500);
  clip-path: polygon(100% 0%, 0 0%, 50% 100%);
  pointer-events: none;
}
/* Fix for search box inside dual filter bar */
.dual-filter-bar .search-box {
  margin-top: 8px; /* align with select wrapper */
}
.dual-filter-bar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Compact buttons inside filter bar */
.dual-filter-bar .btn {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.summary-chips {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-sm);
  color: var(--neutral-600);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  white-space: nowrap;
}
.summary-chip-label { color: var(--neutral-500); }
.summary-chip-value {
  font-weight: var(--font-weight-bold);
  color: var(--neutral-900);
}
.summary-chip-value.danger { color: #C0392B; }
.summary-chip-value.success { color: var(--success-dark); }

/* ---------- SLA Row (List View) ---------- */
.sla-violation-row td { background: rgba(229, 115, 115, 0.06) !important; }
.sla-violation-row:hover td { background: rgba(229, 115, 115, 0.12) !important; }
.sla-days-warn { color: #C0392B; font-weight: var(--font-weight-semibold); font-size: var(--font-size-xs); }

/* ---------- 7-Segment Progress Bar ---------- */
.seg-bar {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.seg-bar-cell {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--neutral-200);
  flex-shrink: 0;
  transition: background 0.3s ease;
}
.seg-bar-cell.filled { background: var(--neutral-700); }
/* Step-colored fills */
.seg-bar.step-1 .seg-bar-cell.filled { background: var(--step1-color); }
.seg-bar.step-2 .seg-bar-cell.filled { background: var(--step2-color); }
.seg-bar.step-3 .seg-bar-cell.filled { background: var(--step3-color); }
.seg-bar.step-4 .seg-bar-cell.filled { background: var(--step4-color); }
.seg-bar.step-5 .seg-bar-cell.filled { background: var(--step5-color); }
.seg-bar.step-6 .seg-bar-cell.filled { background: var(--step6-color); }
.seg-bar.step-7 .seg-bar-cell.filled { background: var(--step7-color); }

/* ---------- Kanban Board Container ---------- */
.kanban-board-wrap {
  overflow-x: auto;
  padding-bottom: var(--space-4);
  margin: 0 -4px;
}
.kanban-board {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  min-width: max-content;
  padding: 4px;
}

/* Full-width mode — dùng cho board 3 cột (Khách Hàng) */
.kanban-board-wrap.kanban-fill {
  overflow-x: visible;
}
.kanban-board.kanban-board-fill {
  min-width: unset;
  width: 100%;
  align-items: stretch;
}
.kanban-board.kanban-board-fill .kb-col {
  flex: 1;
  width: auto;
  flex-shrink: 1;
  min-width: 180px;
}
.kanban-board.kanban-board-fill .kb-col-header {
  width: 100%;
  box-sizing: border-box;
}
.kanban-board.kanban-board-fill .kb-card {
  width: 100%;
  box-sizing: border-box;
}

/* ---------- Kanban Column ---------- */
.kb-col {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* 7-column Onboarding: narrower */
.kb-col.kb-col-sm { width: 196px; }


.kb-col-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.kb-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kb-col-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-800);
  white-space: nowrap;
}
.kb-col-count {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-500);
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  min-width: 20px;
  text-align: center;
}
.kb-col-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  padding-bottom: var(--space-2);
  /* Custom scrollbar — always visible */
  scrollbar-width: thin;
  scrollbar-color: var(--neutral-300) var(--neutral-100);
}
.kb-col-cards::-webkit-scrollbar {
  width: 6px;
}
.kb-col-cards::-webkit-scrollbar-track {
  background: var(--neutral-100);
  border-radius: 4px;
}
.kb-col-cards::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 4px;
}
.kb-col-cards::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}


/* ---------- Kanban Card (White, No Color) ---------- */
.kb-card {
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-lg);
  padding: 8px 10px;
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kb-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.kb-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.kb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--neutral-200);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  text-transform: uppercase;
}
.kb-company {
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.kb-owner {
  font-size: var(--font-size-xs);
  color: var(--neutral-500);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-card-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.kb-progress-fraction {
  font-size: 13px;
  color: var(--neutral-400);
  white-space: nowrap;
  flex-shrink: 0;
}
.kb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(0,0,0,0.04);
}

/* ---------- Kanban Card KH — gộp thông tin về 1 dòng ---------- */
/* Tên Team dời lên nằm cạnh mã KH (chỗ trống sẵn, không tốn thêm chiều cao) */
.kb-sub-team {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 10px;
  font-weight: 600;
  color: var(--neutral-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Hàng gộp: BD · CS · tiến độ · Go-live ····· trạng thái HĐ. Luôn giữ đúng 1 dòng. */
.kb-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  min-width: 0;
  flex-wrap: nowrap;
}
/* Mặc định mọi thứ KHÔNG co (số liệu: tiến độ, ngày Go-live, badge HĐ) */
.kb-card-meta > * { flex-shrink: 0; }
/* Chip người (BD/CS) được phép co lại — BD co trước, hẹp quá thì còn mỗi icon */
.kb-card-meta .kb-meta-chip { min-width: 30px; overflow: hidden; flex-shrink: 3; }
.kb-card-meta .kb-meta-chip.is-cs { flex-shrink: 2; }
.kb-meta-chip .kb-meta-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Khoảng đệm đẩy badge hợp đồng sang mép phải */
.kb-card-meta .kb-meta-grow { flex: 1 1 0; min-width: 0; }
.kb-meta-frac { font-size: 11px; font-weight: 700; color: var(--neutral-400); white-space: nowrap; }
/* Lưới an toàn: cửa sổ nhỏ hơn 1300px thì cho xuống hàng thay vì cắt mất số liệu.
   Laptop 14" (1366px) vẫn nằm trên ngưỡng này nên vẫn giữ đúng 1 dòng. */
@media (max-width: 1300px) {
  .kb-card-meta { flex-wrap: wrap; }
}
.kb-days {
  font-size: var(--font-size-xs);
  color: var(--neutral-400);
}
.kb-days.sla-warn {
  color: #C0392B;
  font-weight: var(--font-weight-semibold);
}
.kb-team {
  font-size: 13px;
  color: var(--neutral-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-golive {
  font-size: 13px;
  color: var(--neutral-500);
}
.kb-done-check {
  font-size: var(--font-size-xs);
  color: var(--success-dark);
  font-weight: var(--font-weight-semibold);
}
.kb-expiry-warn {
  font-size: var(--font-size-xs);
  color: #C0392B;
  font-weight: var(--font-weight-semibold);
}

/* Empty column */
.kb-col-empty {
  text-align: center;
  padding: var(--space-6) var(--space-3);
  color: var(--neutral-400);
  font-size: var(--font-size-xs);
  background: var(--card-bg);
  border: 1px dashed var(--neutral-200);
  border-radius: var(--radius-xl);
}

/* Step dot colors for column headers */
.kb-dot-step1 { background: var(--step1-color); }
.kb-dot-step2 { background: var(--step2-color); }
.kb-dot-step3 { background: var(--step3-color); }
.kb-dot-step4 { background: var(--step4-color); }
.kb-dot-step5 { background: var(--step5-color); }
.kb-dot-step6 { background: var(--step6-color); }
.kb-dot-step7 { background: var(--step7-color); }
/* Customer kanban dots — semantic (MUST KEEP) */
.kb-dot-onboarding { background: var(--primary-500); }
.kb-dot-active     { background: var(--success-dark); }
.kb-dot-expiring   { background: var(--danger); }
.kb-dot-inactive   { background: var(--neutral-400); }

/* ---------- Colored Column Headers (Onboarding steps) ---------- */
.kb-col-header.hdr-step1 {
  background: rgba(19,78,74,0.06);
}
.kb-col-header.hdr-step1 .kb-col-name { color: #134e4a; }
.kb-col-header.hdr-step1 .kb-col-count { background: rgba(19,78,74,0.15); color: #134e4a; }

.kb-col-header.hdr-step2 {
  background: rgba(17,94,89,0.06);
}
.kb-col-header.hdr-step2 .kb-col-name { color: #115e59; }
.kb-col-header.hdr-step2 .kb-col-count { background: rgba(17,94,89,0.15); color: #115e59; }

.kb-col-header.hdr-step3 {
  background: rgba(15,118,110,0.06);
}
.kb-col-header.hdr-step3 .kb-col-name { color: #0f766e; }
.kb-col-header.hdr-step3 .kb-col-count { background: rgba(15,118,110,0.15); color: #0f766e; }

.kb-col-header.hdr-step4 {
  background: rgba(13,148,136,0.06);
}
.kb-col-header.hdr-step4 .kb-col-name { color: #0d9488; }
.kb-col-header.hdr-step4 .kb-col-count { background: rgba(13,148,136,0.15); color: #0d9488; }

.kb-col-header.hdr-step5 {
  background: rgba(20,184,166,0.06);
}
.kb-col-header.hdr-step5 .kb-col-name { color: #0f766e; }
.kb-col-header.hdr-step5 .kb-col-count { background: rgba(20,184,166,0.15); color: #0f766e; }

.kb-col-header.hdr-step6 {
  background: rgba(45,212,191,0.06);
}
.kb-col-header.hdr-step6 .kb-col-name { color: #0d9488; }
.kb-col-header.hdr-step6 .kb-col-count { background: rgba(45,212,191,0.15); color: #0d9488; }

.kb-col-header.hdr-step7 {
  background: rgba(94,234,212,0.06);
}
.kb-col-header.hdr-step7 .kb-col-name { color: #115e59; }
.kb-col-header.hdr-step7 .kb-col-count { background: rgba(94,234,212,0.15); color: #115e59; }

/* ---------- Colored Column Headers (Customers) ---------- */
.kb-col-header.hdr-onboarding {
  border-top: 3px solid var(--primary-500);
  background: rgba(20,184,166,0.06);
}
.kb-col-header.hdr-onboarding .kb-col-name { color: var(--primary-700); }
.kb-col-header.hdr-onboarding .kb-col-count { background: rgba(20,184,166,0.15); color: var(--primary-700); }

.kb-col-header.hdr-active {
  border-top: 3px solid var(--primary-600);
  background: rgba(13,148,136,0.06);
}
.kb-col-header.hdr-active .kb-col-name { color: var(--primary-800); }
.kb-col-header.hdr-active .kb-col-count { background: rgba(13,148,136,0.15); color: var(--primary-800); }

.kb-col-header.hdr-expiring {
  border-top: 3px solid var(--neutral-600);
  background: rgba(97,97,97,0.06);
}
.kb-col-header.hdr-expiring .kb-col-name { color: var(--neutral-700); }
.kb-col-header.hdr-expiring .kb-col-count { background: rgba(97,97,97,0.15); color: var(--neutral-700); }

.kb-col-header.hdr-inactive {
  border-top: 3px solid var(--neutral-400);
  background: rgba(189,189,189,0.06);
}
.kb-col-header.hdr-inactive .kb-col-name { color: var(--neutral-600); }
.kb-col-header.hdr-inactive .kb-col-count { background: rgba(189,189,189,0.15); color: var(--neutral-600); }


/* =============================================
   Performance Dashboard — Apple-inspired
   ============================================= */

/* ---------- Filter Bar ---------- */
.perf-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.perf-filter-select {
  padding: 8px 16px;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--radius-full);
  background: var(--card-bg);
  font-size: var(--font-size-sm);
  font-family: 'Inter', sans-serif;
  color: var(--neutral-700);
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  height: 38px;
  min-width: 140px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239E9E9E' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.perf-filter-select:hover { border-color: var(--primary-300); }
.perf-filter-select:focus { border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.08); }

/* ---------- KPI Cards ---------- */
.perf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.perf-kpi-card {
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.04);
  padding: 10px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.perf-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}
.perf-kpi-card.kpi-total::before { background: linear-gradient(90deg, #0d9488, #14b8a6); }
.perf-kpi-card.kpi-khm::before { background: linear-gradient(90deg, #e11d48, #f43f5e); }
.perf-kpi-card.kpi-khc::before { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.perf-kpi-card.kpi-golive::before { background: linear-gradient(90deg, #424242, #757575); }
.perf-kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
  border-color: var(--neutral-300);
}
.perf-kpi-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.perf-kpi-main-icon {
  font-size: 16px;
  line-height: 1;
}
.perf-kpi-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-total .perf-kpi-label { color: #0d9488; }
.kpi-khm .perf-kpi-label { color: #e11d48; }
.kpi-khc .perf-kpi-label { color: #2563eb; }
.kpi-golive .perf-kpi-label { color: #e11d48; }

.perf-kpi-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.perf-kpi-value {
  font-size: 23px;
  font-weight: 800;
  color: var(--neutral-900);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.perf-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.perf-kpi-trend.up { background: rgba(76,175,80,0.12); color: #2E7D32; }
.perf-kpi-trend.down { background: rgba(244,67,54,0.12); color: #C62828; }
.perf-kpi-subtext {
  font-size: 11.5px;
  color: var(--neutral-500);
}
.perf-kpi-ring {
  position: absolute;
  right: 12px;
  bottom: 12px;
  opacity: 0.12;
  font-size: 32px;
}

@media (max-width: 1250px) { .perf-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .perf-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .perf-kpi-grid { grid-template-columns: 1fr; } }

/* ---------- Section Wrapper ---------- */
.perf-section {
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.04);
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow var(--transition-base);
  overflow: hidden;
}
.perf-section:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.perf-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.perf-section-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-900);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.perf-section-badge {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-50);
  color: var(--primary-700);
}

.perf-premium-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.1), rgba(255,255,255,0));
  padding: 16px 20px;
  border-radius: 12px;
  border-left: 4px solid var(--primary-500);
}
.perf-premium-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-900);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.perf-premium-icon {
  font-size: 20px;
  background: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.perf-premium-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--primary-600);
  color: #fff;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* 2-column layout */
.perf-grid-2 {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.perf-grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}
@media (max-width: 1024px) {
  .perf-grid-2, .perf-grid-equal { grid-template-columns: 1fr; }
}

/* ---------- Leaderboard (Top 10 BD) ---------- */
.perf-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 310px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  /* Scrollbar styles — always visible */
  scrollbar-width: thin;
  scrollbar-color: var(--neutral-300) var(--neutral-100);
}
.perf-leaderboard::-webkit-scrollbar {
  width: 6px;
}
.perf-leaderboard::-webkit-scrollbar-track {
  background: var(--neutral-100);
  border-radius: 4px;
}
.perf-leaderboard::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 4px;
}
.perf-leaderboard::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}
.perf-lb-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px var(--space-4);
  border-radius: var(--radius-xl);
  transition: all var(--transition-fast);
  cursor: pointer;
  border-bottom: 1px solid var(--neutral-100);
}
.perf-lb-row:last-child { border-bottom: none; }
.perf-lb-row:hover {
  background: var(--primary-50);
  transform: translateX(4px);
}
.perf-lb-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  background: var(--neutral-100);
  color: var(--neutral-600);
}
.perf-lb-rank.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA000); color: #fff; box-shadow: 0 2px 8px rgba(255,215,0,0.3); font-size: 16px; }
.perf-lb-rank.rank-2 { background: linear-gradient(135deg, #C0C0C0, #9E9E9E); color: #fff; box-shadow: 0 2px 8px rgba(192,192,192,0.3); font-size: 16px; }
.perf-lb-rank.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; box-shadow: 0 2px 8px rgba(205,127,50,0.3); font-size: 16px; }
.perf-lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}
.perf-lb-info { flex: 1; min-width: 0; }
.perf-lb-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perf-lb-team {
  font-size: 11px;
  color: var(--neutral-500);
}
.perf-lb-bar-wrap {
  flex: 1;
  max-width: 200px;
  height: 8px;
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.perf-lb-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  transition: width 1s ease;
}
.perf-lb-value {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-800);
  min-width: 70px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.perf-lb-arrow {
  color: var(--neutral-300);
  font-size: 14px;
  transition: color var(--transition-fast);
}
.perf-lb-row:hover .perf-lb-arrow { color: var(--primary-500); }

/* ---------- Top 5 Teams ---------- */
.perf-team-list { display: flex; flex-direction: column; gap: var(--space-4); }
.perf-team-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.perf-team-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
  background: var(--neutral-100);
  color: var(--neutral-600);
}
.perf-team-rank.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA000); color: #fff; box-shadow: 0 2px 6px rgba(255,215,0,0.25); }
.perf-team-rank.rank-2 { background: linear-gradient(135deg, #C0C0C0, #9E9E9E); color: #fff; }
.perf-team-rank.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }
.perf-team-info { min-width: 120px; flex-shrink: 0; }
.perf-team-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-800);
}
.perf-team-count {
  font-size: 11px;
  color: var(--neutral-500);
}
.perf-team-bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--neutral-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.perf-team-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}
.perf-team-value {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-800);
  min-width: 70px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Team bar colors */
.perf-team-bar.team-1 { background: linear-gradient(90deg, #0d9488, #14b8a6); }
.perf-team-bar.team-2 { background: linear-gradient(90deg, #e11d48, #f43f5e); }
.perf-team-bar.team-3 { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.perf-team-bar.team-4 { background: linear-gradient(90deg, #424242, #616161); }
.perf-team-bar.team-5 { background: linear-gradient(90deg, #616161, #9e9e9e); }

/* ---------- Chart Card ---------- */
.perf-chart-wrapper {
  position: relative;
  height: 280px;
}

/* ---------- GoLive Table ---------- */
.perf-golive-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.perf-golive-table thead th {
  background: var(--neutral-50);
  padding: 10px var(--space-4);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--neutral-200);
  text-align: left;
  white-space: nowrap;
}
.perf-golive-table tbody td {
  padding: 12px var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--neutral-800);
  border-bottom: 1px solid var(--neutral-100);
  vertical-align: middle;
}
.perf-golive-table tbody tr {
  transition: background var(--transition-fast);
}
.perf-golive-table tbody tr:hover {
  background: rgba(20,184,166,0.04);
}
.perf-golive-customer {
  font-weight: var(--font-weight-semibold);
  color: var(--primary-700);
  cursor: pointer;
  transition: color var(--transition-fast);
}
.perf-golive-customer:hover { color: var(--primary-500); text-decoration: underline; }
.perf-golive-icon {
  display: inline-block;
  margin-right: 4px;
}
.perf-golive-revenue {
  font-weight: var(--font-weight-bold);
  color: var(--success-dark);
  font-variant-numeric: tabular-nums;
}

/* ---------- BD Summary Table ---------- */
.perf-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
.perf-summary-table thead th {
  background: rgba(13, 148, 136, 0.06);
  padding: 10px var(--space-3);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-800);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(13, 148, 136, 0.2);
  text-align: left;
  white-space: nowrap;
}
.perf-summary-table thead th:nth-child(n+3) { text-align: right; }
.perf-summary-table tbody td {
  padding: 10px var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--neutral-800);
  border-bottom: 1px solid var(--neutral-100);
  vertical-align: middle;
}
.perf-summary-table tbody td:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.perf-summary-table tbody tr { transition: background var(--transition-fast); }
.perf-summary-table tbody tr:hover { background: rgba(20,184,166,0.04); }
.perf-summary-table tfoot td {
  padding: 12px var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-900);
  border-top: 2px solid var(--neutral-300);
  background: var(--neutral-50);
}
.perf-summary-table tfoot td:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }

/* Target Progress */
.perf-target-ring {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.perf-target-ring svg {
  width: 28px;
  height: 28px;
  transform: rotate(-90deg);
}
.perf-target-ring .ring-bg { fill: none; stroke: var(--neutral-200); stroke-width: 3; }
.perf-target-ring .ring-fill { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 1s ease; }
.perf-target-pct {
  font-size: 12px;
  font-weight: var(--font-weight-bold);
}
.perf-target-pct.good { color: #2E7D32; }
.perf-target-pct.warn { color: #E65100; }
.perf-target-pct.bad { color: #C62828; }

/* Trend indicators */
.perf-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
}
.perf-trend.up { color: #2E7D32; }
.perf-trend.down { color: #C62828; }
.perf-trend-icon { font-size: 13px; }

/* BD name in summary */
.perf-bd-name {
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-900);
}
.perf-bd-clickable {
  cursor: pointer;
  transition: color var(--transition-fast);
}
.perf-bd-clickable:hover {
  color: var(--primary-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.perf-bd-team {
  font-size: 11px;
  color: var(--neutral-500);
  display: block;
}

/* ---------- Drill-down Modal ---------- */
.perf-drill-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--neutral-200);
}
.perf-drill-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  flex-shrink: 0;
}
.perf-drill-info { flex: 1; }
.perf-drill-name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-900);
}
.perf-drill-role {
  font-size: var(--font-size-sm);
  color: var(--neutral-500);
}
.perf-drill-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.perf-drill-kpi {
  padding: var(--space-3) var(--space-4);
  background: var(--neutral-50);
  border-radius: var(--radius-xl);
  text-align: center;
}
.perf-drill-kpi-value {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}
.perf-drill-kpi-label {
  font-size: 11px;
  color: var(--neutral-500);
  margin-top: 2px;
}

/* ---------- Empty State ---------- */
.perf-empty {
  text-align: center;
  padding: var(--space-10) var(--space-6);
  color: var(--neutral-400);
}
.perf-empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-3);
  opacity: 0.5;
}
.perf-empty-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--neutral-600);
  margin-bottom: var(--space-2);
}

/* ---------- Animations ---------- */
@keyframes perfFadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.perf-animate {
  animation: perfFadeInUp 0.5s ease-out both;
}
.perf-animate-delay-1 { animation-delay: 0.1s; }
.perf-animate-delay-2 { animation-delay: 0.2s; }
.perf-animate-delay-3 { animation-delay: 0.3s; }
.perf-animate-delay-4 { animation-delay: 0.4s; }
.perf-animate-delay-5 { animation-delay: 0.5s; }

/* Full-width section margin */
.perf-full-section {
  margin-bottom: var(--space-4);
  min-width: 0;
  overflow: hidden;
}

.perf-golive-table-wrap {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--neutral-300) var(--neutral-100);
}
.perf-golive-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.perf-golive-table-wrap::-webkit-scrollbar-track {
  background: var(--neutral-100);
  border-radius: 4px;
}
.perf-golive-table-wrap::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 4px;
}
.perf-golive-table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

.active-missing-table-wrap {
  max-height: 280px; /* roughly 5 rows */
  overflow-y: auto;
  overflow-x: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--neutral-300) var(--neutral-100);
}
.active-missing-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.active-missing-table-wrap::-webkit-scrollbar-track {
  background: var(--neutral-100);
  border-radius: 4px;
}
.active-missing-table-wrap::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 4px;
}
.active-missing-table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--neutral-400);
}

/* ---- GoLive Highlight Section ---- */
.perf-golive-highlight {
  border: 2px solid #bbf7d0;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}
.perf-golive-highlight .perf-premium-header {
  background: linear-gradient(90deg, rgba(16,185,129,0.10), rgba(255,255,255,0));
  border-left-color: #10b981;
}

/* ---- GoLive Cards (horizontal scroll) ---- */
.perf-golive-cards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.perf-golive-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid #d1fae5;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all var(--transition-base);
  width: 100%;            /* vua o luoi, truoc day dat cung 280px nen bi tran va cat mat so tien */
  min-width: 0;
  box-shadow: 0 1px 4px rgba(16,185,129,0.04);
}
.perf-golive-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(16,185,129,0.1);
  border-color: #6ee7b7;
}
.perf-golive-card-rank { font-size: 15px; font-weight: 600; flex-shrink: 0; min-width: 20px; text-align: center; }
.perf-golive-card-body { flex: 1; min-width: 0; }
.perf-golive-card-name {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--neutral-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}
.perf-golive-card-meta {
  font-size: 11px;
  color: var(--neutral-500);
  margin-top: 0px;
  line-height: 1.3;
}
.perf-golive-card-rev {
  font-size: 14px;
  font-weight: 700;
  color: #059669;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;         /* khong bao gio bi ep cho den muc cat chu */
}

/* ---- KPI Target Progress Bar ---- */
.perf-kpi-target-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--neutral-100);
  border-radius: 4px;
  overflow: hidden;
}
.perf-kpi-target-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}
.perf-kpi-target-bar.good { background: linear-gradient(90deg, #16a34a, #22c55e); }
.perf-kpi-target-bar.warn { background: linear-gradient(90deg, #d97706, #f59e0b); }
.perf-kpi-target-bar.bad  { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* ---- RR Grid (BD + Team side-by-side) ---- */
.perf-rr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  min-width: 0;
}
@media (max-width: 900px) { .perf-rr-grid { grid-template-columns: 1fr; } }

/* ---- Scrollable RR table wrapper (max ~7 rows) ---- */
.perf-rr-table-wrap {
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.04);
  scrollbar-width: thin;
  scrollbar-color: var(--neutral-300) var(--neutral-100);
}
.perf-rr-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.perf-rr-table-wrap::-webkit-scrollbar-track { background: var(--neutral-100); border-radius: 4px; }
.perf-rr-table-wrap::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 4px; }
.perf-rr-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); }

/* Sticky header inside scrollable wrapper */
.perf-sticky-thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0faf9 !important;
  box-shadow: 0 2px 0 rgba(13,148,136,0.15);
}

/* animate delay 6 */
.perf-animate-delay-6 { animation-delay: 0.6s; }

/* Fixed-layout RR table: columns stay within container width */
.perf-rr-fixed {
  table-layout: fixed;
  width: 100%;
}
.perf-rr-fixed th, .perf-rr-fixed td {
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}
.perf-rr-fixed th {
  font-size: 13px;
  line-height: 1.3;
}
.perf-rr-fixed td:nth-child(n+2) { text-align: right; }

/* Remove white-space:nowrap from summary table header in fixed mode */
.perf-summary-table.perf-rr-fixed thead th {
  white-space: normal;
}


/* ========== CUSTOM DROPDOWN FILTER ========== */
.custom-filter-dropdown {
  position: relative;
  display: inline-block;
  font-family: inherit;
}
.custom-filter-btn {
  background: #ffffff;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--neutral-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  height: 32px;
  white-space: nowrap;
  flex-shrink: 0;
}
.custom-filter-btn:hover {
  border-color: var(--neutral-400);
  background: var(--neutral-50);
}
.custom-filter-btn svg {
  color: var(--neutral-500);
  margin-left: 2px;
}
.custom-filter-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  min-width: 220px;
  z-index: 1000;
  display: none;
  overflow: hidden;
}
.custom-filter-menu.active {
  display: block;
}
.custom-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--neutral-100);
}
.custom-filter-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.custom-filter-actions {
  display: flex;
  gap: 8px;
}
.custom-filter-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-600);
  cursor: pointer;
}
.custom-filter-action:hover {
  text-decoration: underline;
}
.custom-filter-body {
  max-height: 250px;
  overflow-y: auto;
  padding: 6px 0;
}
.custom-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.custom-filter-item:hover {
  background: var(--neutral-50);
}
.custom-filter-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--neutral-300);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: all 0.2s;
  flex-shrink: 0;
}
.custom-filter-item.selected .custom-filter-checkbox {
  background: var(--primary-600);
  border-color: var(--primary-600);
}
.custom-filter-item.selected .custom-filter-checkbox::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}
.custom-filter-label {
  font-size: 13px;
  color: var(--neutral-700);
  user-select: none;
}

/* History (Audit Log) Table Optimization */
#history-table td {
  white-space: nowrap;
}
#history-table td:nth-child(6) {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#history-table td:last-child {
  max-width: 350px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════ ONBOARDING — Giao diện bước gọn (revamp 24/08/2026) ═══════════
   Thay các banner nền màu to bằng dòng tiêu đề mảnh, tiết kiệm chiều cao. */
.ob-hd {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px; padding-bottom: 7px;
  border-bottom: 1px solid var(--neutral-200);
}
.ob-hd-t { font-size: 13.5px; font-weight: 800; color: var(--neutral-900); letter-spacing: -0.01em; }
.ob-hd-s { font-size: 11.5px; color: var(--neutral-500); flex: 1; min-width: 140px; }
.ob-hd-tag {
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 9999px; padding: 2px 8px; white-space: nowrap;
  background: var(--neutral-100); color: var(--neutral-600);
}
.ob-hd-tag.warn { background: var(--warning-light); color: var(--warning-dark); }

/* Thẻ việc nhỏ trong một bước — viền mảnh, padding gọn */
.ob-task {
  border: 1px solid var(--neutral-200); border-radius: 10px;
  padding: 11px 12px; margin-bottom: 8px; background: #fff;
}
.ob-task-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ob-task-n {
  width: 19px; height: 19px; border-radius: 9999px; flex-shrink: 0;
  background: var(--neutral-200); color: var(--neutral-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800;
}
.ob-task-n.on { background: var(--primary-600); color: #fff; }
.ob-task-n.ok { background: var(--success); color: #fff; }
.ob-task-t { font-size: 13px; font-weight: 700; color: var(--neutral-800); }
.ob-task-s { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--neutral-400); }

/* Hàng nút hành động cuối bước */
.ob-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.ob-actions .btn { flex: 1; min-width: 150px; }
.ob-actions .btn.btn-ghost { flex: 0 0 auto; min-width: 0; }

/* Ghi chú mảnh, không nền màu */
.ob-note { font-size: 11.5px; color: var(--neutral-500); line-height: 1.55; margin-top: 5px; }
.ob-note.warn { color: var(--warning-dark); }

/* Trợ lý AI — bản gọn: viền mảnh thay vì khối gradient dày */
.ob-ai {
  border: 1px solid var(--primary-200); border-left: 3px solid var(--primary-500);
  background: var(--primary-50); border-radius: 0 10px 10px 0;
  padding: 11px 13px; margin-bottom: 12px;
}
.ob-ai-hd { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.ob-ai-t { font-size: 12.5px; font-weight: 800; color: var(--primary-700); }

/* Dấu hỏi giải thích khi rê chuột — dùng trong các bước Onboarding */
.ob-help {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 9999px; flex-shrink: 0;
  background: var(--primary-600); color: #fff;
  font-size: 10px; font-weight: 800; cursor: help; user-select: none;
}
.ob-help-tip {
  /* Neo mép phải: dấu ? luôn nằm sát mép phải của hàng nên căn giữa sẽ bị khung cắt mất chữ */
  position: absolute; bottom: calc(100% + 8px); right: -2px; left: auto; transform: none;
  width: 250px;
  background: var(--neutral-900); color: #fff;
  font-size: 11.5px; font-weight: 500; line-height: 1.6; text-align: left;
  border-radius: 8px; padding: 9px 11px;
  opacity: 0; visibility: hidden; transition: opacity .15s ease;
  z-index: 20; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.ob-help-tip::after {
  content: ''; position: absolute; top: 100%; right: 6px; left: auto; transform: none;
  border: 5px solid transparent; border-top-color: var(--neutral-900);
}
.ob-help:hover .ob-help-tip,
.ob-help:focus .ob-help-tip,
.ob-help:focus-visible .ob-help-tip,
.ob-help.on .ob-help-tip { opacity: 1; visibility: visible; }
/* Màn hình hẹp: thu nhỏ tooltip thay vì dùng vw (vw có thể = 0 ở một số ngữ cảnh) */
@media (max-width: 420px) { .ob-help-tip { width: 200px; } }

/* ═══════ Thẻ Kanban Onboarding — bản gọn 2 dòng (24/08/2026) ═══════ */
.kb-card.kb-card-slim { padding: 8px 10px; }
.kb-slim-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.kb-avatar.kb-avatar-xs {
  width: 20px; height: 20px; min-width: 20px; border-radius: 6px;
  font-size: 9px; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kb-company.kb-company-slim {
  flex: 1; min-width: 0;
  font-size: 12.5px; font-weight: 700; color: var(--neutral-900); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-slim-days {
  flex-shrink: 0; font-size: 10.5px; font-weight: 800;
  border-radius: 5px; padding: 1px 5px;
  background: var(--neutral-100); color: var(--neutral-600);
  font-variant-numeric: tabular-nums;
}
.kb-slim-days.warn { background: var(--danger-light); color: var(--danger-dark); }
.kb-slim-done {
  flex-shrink: 0; font-size: 11px; font-weight: 800;
  color: var(--success-dark); background: var(--success-light);
  border-radius: 5px; padding: 1px 6px;
}
.kb-slim-meta {
  display: flex; align-items: center; gap: 4px; flex-wrap: nowrap;
  margin-top: 4px; min-width: 0;
  font-size: 10.5px; color: var(--neutral-500);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kb-slim-task { font-weight: 800; color: var(--primary-700); flex-shrink: 0; }
.kb-slim-sep { color: var(--neutral-300); flex-shrink: 0; }

/* ==========================================================================
   TAB KẾ HOẠCH N2 — bản gọn (11/2026)
   ========================================================================== */
.n2-gon { font-size: 13px; }
.n2-lbl { font-size: 10.5px; font-weight: 800; color: var(--neutral-500); text-transform: uppercase; letter-spacing: .5px; }
.n2-muted { color: var(--neutral-500); font-weight: 600; font-size: 11.5px; }
.n2-hint { font-size: 11px; font-weight: 700; color: var(--neutral-600); background: var(--neutral-100); border-radius: 9999px; padding: 3px 10px; white-space: nowrap; }
.n2-c-rr { color: #4338ca; } .n2-c-ob { color: var(--primary-700); } .n2-c-kh { color: #9333ea; } .n2-c-do { color: var(--danger-dark); }
.n2-uoc { color: var(--neutral-400); font-style: italic; font-weight: 700; }

/* 1. Thanh kỳ xem — dính trên cùng khi cuộn */
.n2-bar { position: sticky; top: 0; z-index: 20; background: #fff; border: 1px solid var(--neutral-200); border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(15,23,42,.05); }
.n2-nam { display: inline-flex; align-items: center; gap: 4px; }
.n2-nam button { border: 1px solid var(--neutral-200); background: #fff; border-radius: 7px; width: 26px; height: 28px; font-weight: 900; color: var(--neutral-700); cursor: pointer; font-family: inherit; }
.n2-nam b { font-size: 13.5px; min-width: 38px; text-align: center; }
.n2-select { height: 30px; border: 1px solid var(--neutral-200); border-radius: 8px; padding: 0 10px; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--neutral-900); background: #fff; cursor: pointer; }
.n2-seg { display: inline-flex; background: var(--neutral-100); border-radius: 9999px; padding: 3px; gap: 2px; }
.n2-seg button { border: none; background: transparent; padding: 4px 12px; border-radius: 9999px; font-size: 12px; font-weight: 800; color: var(--neutral-500); cursor: pointer; font-family: inherit; }
.n2-seg button.on { background: #fff; color: var(--primary-700); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.n2-han { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fffbeb; border: 1px solid #fde68a; border-radius: 9999px; padding: 5px 6px 5px 13px; font-size: 12.5px; font-weight: 700; color: #78350f; position: relative; }
.n2-han b { color: var(--danger-dark); }
.n2-cachtinh { border: none; background: #fde68a; color: #78350f; border-radius: 9999px; padding: 3px 10px; font-size: 11.5px; font-weight: 800; cursor: pointer; font-family: inherit; }
.n2-pop { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-width: 90vw; background: #fff; border: 1px solid var(--neutral-200); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.15); padding: 12px 14px; font-size: 12.5px; font-weight: 500; color: var(--neutral-700); line-height: 1.6; z-index: 30; }
.n2-pop.mo { display: block; }
.n2-btn-o { border: 1.5px solid var(--neutral-300); background: #fff; border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 800; color: var(--neutral-700); cursor: pointer; font-family: inherit; white-space: nowrap; }
.n2-btn-o:hover, .n2-btn-o.on { border-color: var(--primary-500); color: var(--primary-700); background: var(--primary-50); }

/* 2. Số tổng + Cần xử lý */
.n2-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 12px; }
.n2-kpi { background: #fff; border: 1px solid var(--neutral-200); border-radius: 12px; padding: 11px 15px; text-align: left; }
.n2-kpi .v { font-size: 23px; font-weight: 900; line-height: 1.15; margin-top: 3px; }
.n2-kpi .s { font-size: 11.5px; color: var(--neutral-500); font-weight: 600; margin-top: 2px; }
.n2-canhbao { border-color: #fcd34d; font-size: 13px; font-weight: 800; color: #78350f; cursor: pointer; font-family: inherit; }
.n2-canhbao:hover { background: #fffbeb; }
.n2-viec-ds { display: none; background: #fff; border: 1px solid #fcd34d; border-radius: 12px; margin: -2px 0 12px; overflow: hidden; }
.n2-viec-ds.mo { display: block; }
.n2-viec { display: flex; align-items: center; gap: 12px; padding: 10px 15px; border-bottom: 1px solid var(--neutral-100); font-size: 12.5px; }
.n2-viec:last-child { border-bottom: none; }
.n2-viec .ic { font-size: 18px; }
.n2-viec .t { flex: 1; min-width: 220px; }
.n2-viec .t b { display: block; font-size: 13px; }
.n2-viec .t span { color: var(--neutral-600); font-weight: 600; }

/* 3. Thẻ, bảng */
.n2-card { background: #fff; border: 1px solid var(--neutral-200); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.n2-ch { padding: 10px 15px; border-bottom: 1px solid var(--neutral-100); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.n2-ch h3 { margin: 0; font-size: 14px; font-weight: 800; }
.n2-ch .sub { font-size: 12px; color: var(--neutral-500); font-weight: 600; }
.n2-tbl { width: 100%; border-collapse: collapse; }
.n2-tbl th { padding: 8px 10px; font-size: 10.5px; font-weight: 800; color: var(--neutral-500); text-transform: uppercase; letter-spacing: .4px; text-align: left; background: var(--neutral-50); border-bottom: 1px solid var(--neutral-200); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.n2-tbl th small { display: block; font-size: 9.5px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--neutral-400); }
.n2-tbl th.chon { background: var(--primary-100); color: var(--primary-700); }
.n2-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--neutral-100); font-size: 12.5px; vertical-align: middle; }
.n2-tbl .r { text-align: right; } .n2-tbl .c { text-align: center; }
.n2-tbl td.n2-ten { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.n2-tbl tr.on td { background: var(--primary-50); }
.n2-tbl tr.mo td { opacity: .45; }
.n2-tbl tr.tong td, .n2-tbl tfoot td { background: var(--primary-50); font-weight: 800; border-top: 2px solid var(--primary-200); }
.n2-bdten { cursor: pointer; white-space: nowrap; }
.n2-bdten:hover b { color: var(--primary-700); text-decoration: underline; }
.n2-prog { display: flex; align-items: center; gap: 7px; min-width: 150px; }
.n2-track { flex: 1; height: 8px; background: var(--neutral-100); border-radius: 9999px; position: relative; overflow: hidden; }
.n2-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 9999px; }
.n2-fill.dk { opacity: .3; }
.n2-prog .pct { font-weight: 900; font-size: 12.5px; width: 42px; text-align: right; }
.n2-tag { display: inline-block; padding: 1px 8px; border-radius: 9999px; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.n2-tag.xanh { background: #dcfce7; color: #15803d; } .n2-tag.do { background: #fee2e2; color: #b91c1c; }
.n2-tag.xam { background: var(--neutral-100); color: var(--neutral-600); } .n2-tag.cam { background: #ffedd5; color: #9a3412; }
.n2-tag.vang { background: #fef3c7; color: #92400e; } .n2-tag.xanhduong { background: #e0f2fe; color: #0369a1; }
.n2-tag.xanhla { background: #ccfbf1; color: #0f766e; } .n2-tag.tim { background: #e0e7ff; color: #4338ca; }
.n2-locchip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-100); color: var(--primary-700); border-radius: 9999px; padding: 3px 6px 3px 11px; font-size: 12px; font-weight: 800; }
.n2-locchip button { border: none; background: var(--primary-600); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; line-height: 1; cursor: pointer; }
.n2-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 15px; border-top: 1px solid var(--neutral-100); font-size: 11.5px; color: var(--neutral-500); font-weight: 600; align-items: center; }

/* Ô tháng bấm được trong bảng BD */
.n2-mbtn { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; border: 1.5px solid var(--neutral-200); background: #fff; border-radius: 9px; padding: 5px 9px 5px 10px; min-width: 125px; text-align: right; cursor: pointer; font-family: inherit; transition: .12s; }
.n2-mbtn:hover { border-color: var(--primary-500); background: var(--primary-50); box-shadow: 0 2px 8px rgba(13,148,136,.15); }
.n2-mbtn .r1 { display: flex; align-items: center; gap: 7px; width: 100%; justify-content: flex-end; }
.n2-mbtn .v { font-size: 14px; font-weight: 900; color: var(--neutral-900); }
.n2-mbtn .dem { background: var(--primary-100); color: var(--primary-700); border-radius: 9999px; padding: 0 7px; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.n2-mbtn .s { font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.n2-mbtn.nay { border-color: var(--primary-200); }
.n2-mbtn.chon { border-color: var(--primary-500); box-shadow: 0 0 0 2px var(--primary-100); }
.n2-mbtn.trong { border-style: dashed; color: var(--neutral-300); cursor: default; min-height: 34px; justify-content: center; }
.n2-mbtn.trong:hover { border-color: var(--neutral-200); background: #fff; box-shadow: none; }

/* 4. Tab tra cứu */
.n2-tabs { display: flex; gap: 4px; padding: 0 10px; border-bottom: 1px solid var(--neutral-200); flex-wrap: wrap; }
.n2-tabs button { border: none; background: transparent; padding: 11px 14px; font-size: 13px; font-weight: 800; color: var(--neutral-500); border-bottom: 2.5px solid transparent; margin-bottom: -1px; cursor: pointer; font-family: inherit; }
.n2-tabs button.on { color: var(--primary-700); border-bottom-color: var(--primary-600); }
.n2-tabs .cnt { display: inline-block; background: var(--neutral-100); color: var(--neutral-500); border-radius: 9999px; padding: 0 7px; font-size: 11px; margin-left: 5px; }
.n2-tabs button.on .cnt { background: var(--primary-100); color: var(--primary-700); }
.n2-tabdesc { padding: 8px 15px 0; font-size: 12px; color: var(--neutral-600); font-weight: 600; line-height: 1.5; }
.n2-tools { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; padding: 10px 15px; }
.n2-chips { display: inline-flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.n2-chipn { border: 1.5px solid var(--neutral-200); background: #fff; border-radius: 9999px; padding: 3px 11px; font-size: 12px; font-weight: 800; color: var(--neutral-700); cursor: pointer; font-family: inherit; }
.n2-chipn small { color: var(--neutral-400); font-weight: 700; margin-left: 4px; }
.n2-chipn.on { border-color: var(--primary-600); background: var(--primary-50); color: var(--primary-700); }
.n2-chipn.rong { opacity: .5; }
.n2-input { height: 30px; border: 1px solid var(--neutral-200); border-radius: 8px; padding: 0 11px; font-family: inherit; font-size: 12.5px; width: 220px; }
.n2-o-vang { background: #fffbeb; border: 1px solid #fde68a; border-radius: 4px; padding: 0 5px; }
.n2-o { height: 26px; font-size: 11.5px; width: 100%; background: #fffbeb; border: 1.5px solid #fde68a; border-radius: 6px; padding: 0 6px; font-family: inherit; font-weight: 600; }
.n2-o.so { text-align: right; }
.n2-o.trong { background: #fff1f2; }
.n2-o.canhbao { border-color: #fca5a5; color: var(--danger-dark); }
.n2-icon { border: none; background: transparent; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; line-height: 1; }
.n2-icon:hover { background: var(--neutral-100); }
.n2-nhom td { background: var(--neutral-50); font-size: 11px; font-weight: 800; color: var(--neutral-600); text-transform: uppercase; letter-spacing: .4px; padding: 6px 10px; }
.n2-nhom.xanh td { color: #15803d; background: #f0fdf4; }
.n2-nhom.do td { color: #b91c1c; background: #fef2f2; }
.n2-nhom.xam td { color: var(--neutral-500); }

/* Ngăn kéo chi tiết bên phải */
.n2-ngankeo { position: fixed; inset: 0; z-index: 9990; }
.n2-nk-nen { position: absolute; inset: 0; background: rgba(15,23,42,.35); opacity: 0; transition: opacity .18s; }
.n2-nk-than { position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: #fff; box-shadow: -10px 0 30px rgba(15,23,42,.2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s; }
.n2-ngankeo.mo .n2-nk-nen { opacity: 1; }
.n2-ngankeo.mo .n2-nk-than { transform: none; }
.n2-nk-dau { padding: 14px 18px; border-bottom: 1px solid var(--neutral-200); display: flex; align-items: flex-start; gap: 10px; }
.n2-nk-dau h4 { margin: 0 0 2px; font-size: 16px; font-weight: 900; }
.n2-nk-x { margin-left: auto; border: none; background: var(--neutral-100); border-radius: 8px; width: 30px; height: 30px; font-size: 15px; font-weight: 900; color: var(--neutral-700); cursor: pointer; flex-shrink: 0; }
.n2-dstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 18px; }
.n2-dstat { background: var(--neutral-50); border-radius: 10px; padding: 8px 12px; }
.n2-dstat .v { font-size: 19px; font-weight: 900; margin-top: 2px; }
.n2-nk-bang { flex: 1; overflow: auto; padding: 0 18px 18px; }
.n2-nk-bang .n2-tbl th { background: #fff; }
.n2-src { font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 9999px; white-space: nowrap; }
.n2-src.he { background: #e0e7ff; color: #4338ca; } .n2-src.tay { background: #fef3c7; color: #92400e; }
.n2-src.ob { background: var(--primary-100); color: var(--primary-700); } .n2-src.kh { background: #faf5ff; color: #9333ea; }
.n2-prog2 { display: flex; align-items: center; gap: 7px; }
.n2-prog2 + .n2-prog2 { margin-top: 4px; }
.n2-prog2 .nhan { font-size: 10.5px; font-weight: 700; color: var(--neutral-500); width: 64px; flex-shrink: 0; white-space: nowrap; }
.n2-prog2 .tien { font-weight: 700; font-size: 11.5px; color: var(--neutral-700); min-width: 50px; text-align: right; white-space: nowrap; }
.n2-prog2 .n2-track { height: 7px; }
.n2-prog2 .pct { font-weight: 900; font-size: 12px; width: 42px; text-align: right; }
.n2-kb { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; font-size: 12.5px; }
.n2-kb span { font-size: 10.5px; font-weight: 700; color: var(--neutral-500); }
.n2-kb.lon { justify-content: flex-start; margin-top: 4px; }
.n2-kb.lon span { width: 82px; }
.n2-kb.lon b { font-size: 17px; font-weight: 900; }
.n2-kb.lon small { font-size: 11px; color: var(--neutral-500); font-weight: 600; }
.n2-dstats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.n2-nk-than { width: min(780px, 100%); }
.n2-nk-nhom { border-left: 3px solid var(--neutral-300); border-radius: 4px; margin-bottom: 16px; }
.n2-nk-nhom-dau { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 6px 10px; background: var(--neutral-50); font-size: 12.5px; }
.n2-nk-nhom-dau span { font-size: 12px; font-weight: 700; color: var(--neutral-600); }

/* ---- Tab Kế hoạch N2: bản gọn (11/2026) ---- */
.n2-kpis { gap: 8px; margin-bottom: 10px; grid-template-columns: minmax(150px,.75fr) minmax(150px,.75fr) minmax(320px,1.4fr) minmax(280px,1.4fr) auto; }
@media (max-width: 1200px) { .n2-kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.n2-kpis .n2-kpi { padding: 7px 13px; }
.n2-kpis .n2-kpi .v { font-size: 19px; margin-top: 1px; display: inline-block; margin-right: 8px; }
.n2-kpis .n2-kpi .s { display: inline-block; font-size: 11px; margin-top: 0; }
.n2-kb-hang { display: flex; gap: 14px; flex-wrap: wrap; }
.n2-kb-hang .n2-kb.lon { margin-top: 1px; gap: 5px; }
.n2-kb-hang .n2-kb.lon span { width: auto; }
.n2-kb-hang .n2-kb.lon b { font-size: 16px; }
#n2-bang-bd th { padding: 5px 8px; }
#n2-bang-bd td { padding: 3px 8px; }
#n2-bang-bd .n2-mbtn { padding: 3px 8px; min-height: 0; }
#n2-bang-bd .n2-mbtn .dem { margin-right: auto; }
#n2-bang-bd .n2-muted { font-size: 11px; line-height: 1.3; }
#n2-bang-bd .n2-prog2 + .n2-prog2 { margin-top: 1px; }
#n2-bang-bd .n2-prog2 { line-height: 1.25; }
#n2-bang-bd .n2-prog2 .n2-track { height: 6px; }
.n2-them-kh { font-size: 10px !important; font-weight: 700; color: #a855f7 !important; white-space: nowrap; }
