/* ==========================================================================
   KPI & BSC MODULE STYLES (ENTERPRISE PERFORMANCE MANAGEMENT)
   ========================================================================== */

.kpi-center-page {
  padding: 24px;
  background: #f8fafc;
  min-height: 100%;
}

.kpi-center-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.kpi-center-head h3 {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin: 4px 0 0 0;
}

.kpi-center-head p {
  font-size: 14px;
  color: #64748b;
  margin: 4px 0 0 0;
}

.kpi-center-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kpi-center-tabs button {
  background: none;
  border: none;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.kpi-center-tabs button:hover {
  color: #0f172a;
}

.kpi-center-tabs button.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* Metric Cards */
.kpi-overview-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-metric-card {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.kpi-metric-card span {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.kpi-metric-card strong {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  margin: 8px 0;
}

.kpi-metric-card small {
  font-size: 12px;
  color: #94a3b8;
}

.kpi-metric-card.is-green strong { color: #16a34a; }
.kpi-metric-card.is-amber strong { color: #d97706; }
.kpi-metric-card.is-red strong { color: #dc2626; }
.kpi-metric-card.is-blue strong { color: #2563eb; }

/* Panels Grid */
.kpi-overview-panels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .kpi-overview-panels {
    grid-template-columns: 1fr;
  }
}

.kpi-panel-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kpi-panel-header {
  margin-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.kpi-panel-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.kpi-panel-header p {
  font-size: 12px;
  color: #64748b;
  margin: 4px 0 0 0;
}

/* Attention List */
.kpi-attention-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kpi-attention-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  transition: background 0.2s;
  border: 1px solid #f1f5f9;
}

.kpi-attention-row:hover {
  background: #f1f5f9;
}

/* Rankings & Badges */
.kpi-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kpi-ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.kpi-ranking-row:last-child {
  border-bottom: none;
}

.rank-number {
  width: 24px;
  height: 24px;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.kpi-ranking-row:nth-child(1) .rank-number {
  background: #fef3c7;
  color: #d97706;
}

/* Strategy Map */
.strategy-map-viewport {
  width: 100%;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 24px;
  min-height: 500px;
}

.strategy-map-canvas {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 1000px;
  transition: transform 0.2s ease;
}

.strategy-perspective-lane {
  display: grid;
  grid-template-columns: 240px 1fr;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.strategy-perspective-lane-header {
  padding: 16px;
  background: #f1f5f9;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.strategy-perspective-lane-header h5 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.strategy-perspective-lane-header p {
  font-size: 11px;
  color: #64748b;
  margin: 4px 0 0 0;
}

.strategy-objectives-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  align-content: center;
}

.strategy-objective-node {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  width: 220px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.strategy-objective-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.strategy-objective-node.is-green { border-color: #16a34a; background: #f0fdf4; }
.strategy-objective-node.is-blue { border-color: #2563eb; background: #eff6ff; }
.strategy-objective-node.is-amber { border-color: #d97706; background: #fffbeb; }

.strategy-objective-node-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}

.strategy-node-kpis {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 6px;
  margin-top: 2px;
}

.strategy-node-kpis small {
  font-size: 10px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress bar inside tables */
.kpi-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.kpi-progress-bar {
  height: 6px;
  background: #2563eb;
  border-radius: 3px;
}

/* Status badge */
.kpi-status-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  text-align: center;
}

.kpi-status-badge.is-green { background: #dcfce7; color: #16a34a; }
.kpi-status-badge.is-blue { background: #dbeafe; color: #2563eb; }
.kpi-status-badge.is-amber { background: #fef3c7; color: #d97706; }
.kpi-status-badge.is-red { background: #fee2e2; color: #dc2626; }

/* KPI Detail Drawer */
.kpi-detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  animation: slide-in 0.25s ease-out;
}

@keyframes slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.kpi-detail-drawer-header {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kpi-detail-drawer-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 4px 0 0 0;
}

.kpi-drawer-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
}

.kpi-drawer-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.kpi-drawer-block {
  margin-bottom: 24px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
}

.kpi-drawer-block h4 {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.kpi-info-grid div {
  display: flex;
  flex-direction: column;
}

.kpi-info-grid small {
  font-size: 11px;
  color: #94a3b8;
}

.kpi-info-grid span {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

/* Timeline */
.kpi-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 2px solid #e2e8f0;
  padding-left: 16px;
  margin-left: 8px;
}

.kpi-timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -21px;
  top: 4px;
  width: 8px;
  height: 8px;
  background: #2563eb;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.kpi-timeline-item p {
  font-size: 12px;
  color: #64748b;
  margin: 4px 0 0 0;
}

/* Comments */
.kpi-comment-bubble {
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #f1f5f9;
}

.kpi-comment-bubble p {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #334155;
}

/* Heatmap */
.kpi-heatmap-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.kpi-heatmap-box {
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
}

.kpi-heatmap-box.is-green { background: #f0fdf4; color: #16a34a; border: 1.5px solid #16a34a; }
.kpi-heatmap-box.is-blue { background: #eff6ff; color: #2563eb; border: 1.5px solid #2563eb; }
.kpi-heatmap-box.is-amber { background: #fffbeb; color: #d97706; border: 1.5px solid #d97706; }

/* Theme Customization UI */
.account-settings-theme-panel {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.account-settings-theme-panel strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.theme-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.theme-option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.2s ease;
}

.theme-option-btn:hover {
  background: var(--surface);
  border-color: var(--subtle);
}

.theme-option-btn.is-active {
  border-color: var(--brand);
  background: var(--sidebar-soft);
  color: var(--brand);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}

.theme-option-btn.is-green.is-active {
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

.theme-option-btn.is-orange.is-active {
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15);
}

.theme-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}


