/* ═══════════════════════════════════════════════════════
   HR KPI SCORECARD PANEL — ChronoForge Pulse
   Matches existing Supply Chain panel UI patterns
   ═══════════════════════════════════════════════════════ */

/* Toggle button in chat settings bar */
.hr-toggle {
  margin-left: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border, #2a2f3a);
  border-radius: 6px;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.68rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.hr-toggle:hover,
.hr-toggle.active {
  border-color: #a78bfa;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.06);
}

.hr-toggle .hr-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted, #64748b);
  transition: background 0.3s;
}

/* Main panel */
.hr-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-bottom 0.2s;
  border-bottom: 0 solid transparent;
  background: var(--bg-card, #111827);
}

.hr-panel.open {
  max-height: 400px;
  border-bottom: 1px solid var(--border, #2a2f3a);
  overflow-y: auto;
}

.hr-panel::-webkit-scrollbar { width: 4px; }
.hr-panel::-webkit-scrollbar-thumb { background: rgba(167, 139, 250, 0.25); border-radius: 4px; }

/* Panel header */
.hr-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border, #2a2f3a);
  position: sticky;
  top: 0;
  background: var(--bg-card, #111827);
  z-index: 2;
}

.hr-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.68rem;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.hr-panel-actions {
  display: flex;
  gap: 4px;
}

.hr-panel-actions button {
  background: none;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.hr-panel-actions button:hover {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
}

/* Panel body */
.hr-panel-body {
  padding: 10px 12px;
}

/* Upload zone */
.hr-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px;
  border: 1.5px dashed var(--border, #2a2f3a);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.hr-upload-zone:hover,
.hr-upload-zone.dragover {
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.04);
}

.hr-upload-icon { color: var(--text-muted, #64748b); margin-bottom: 2px; }
.hr-upload-zone strong {
  font-size: 0.78rem;
  color: var(--text-primary, #e2e8f0);
  font-family: var(--font-body);
}
.hr-upload-zone p {
  font-size: 0.68rem;
  color: var(--text-muted, #64748b);
  margin: 0;
}

/* Rankings */
.hr-rank-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-secondary, #1e293b);
  margin-bottom: 6px;
  transition: background 0.15s;
}

.hr-rank-card:hover { background: rgba(167, 139, 250, 0.06); }

.hr-rank-card.hr-rank-top {
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.05);
}

.hr-rank-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(167, 139, 250, 0.12);
  color: #a78bfa;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.hr-rank-top .hr-rank-badge {
  background: rgba(167, 139, 250, 0.2);
}

.hr-rank-info { flex: 1; min-width: 0; }

.hr-rank-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr-rank-meta {
  font-size: 0.62rem;
  color: var(--text-muted, #64748b);
  font-family: var(--font-mono);
}

.hr-rank-pct {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.hr-pct-good { color: #34d399; }
.hr-pct-ok { color: #fbbf24; }
.hr-pct-low { color: #f87171; }

/* Detail rows */
.hr-details-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 10px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border, #2a2f3a);
}

.hr-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  font-size: 0.7rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.hr-detail-kpi {
  flex: 1;
  color: var(--text-primary, #e2e8f0);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr-detail-entity {
  font-size: 0.62rem;
  color: var(--text-muted, #64748b);
  font-family: var(--font-mono);
  min-width: 60px;
}

.hr-detail-pct {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 50px;
  text-align: right;
}

/* Loading */
.hr-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
}

.hr-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(167, 139, 250, 0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: hr-spin 0.6s linear infinite;
}

@keyframes hr-spin { to { transform: rotate(360deg); } }

/* Chat shortcuts */
.hr-chat-shortcuts {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #2a2f3a);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.hr-shortcuts-label {
  font-size: 0.6rem;
  color: var(--text-muted, #64748b);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.hr-shortcut-btn {
  padding: 3px 8px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 4px;
  background: transparent;
  color: #a78bfa;
  font-size: 0.62rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.hr-shortcut-btn:hover {
  background: rgba(167, 139, 250, 0.1);
  border-color: #a78bfa;
}
