.compare-periods {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 16px;
  flex-wrap: wrap;
}
.compare-period-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.compare-period-box label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
}
.compare-period-box select {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  min-width: 160px;
}
.compare-custom-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.compare-custom-dates input {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
}
.compare-vs {
  font-weight: 700;
  color: #9ca3af;
  font-size: 14px;
  align-self: center;
  margin-top: 20px;
}
.kpi-compare-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding: 16px;
}
.kpi-compare-card {
  background: #f9fafb;
  border-radius: 10px;
  padding: 14px;
  border: 1px solid #e5e7eb;
}
.kpi-compare-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.kpi-compare-values {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.kpi-compare-a, .kpi-compare-b {
  font-size: 20px;
  font-weight: 700;
}
.kpi-compare-delta {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  display: inline-block;
}
.delta-up { color: #166534; }
.delta-down { color: #991b1b; }
.delta-flat { color: #6b7280; }

/* Value color-coding for period comparison (higher vs lower) */
.val-green { color: #166534 !important; }
.val-red { color: #991b1b !important; }
.val-neutral { color: #1a1a2e; }

.kpi-compare-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.kpi-compare-period-tag {
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 6px;
}

.kpi-compare-divider {
  width: 2px;
  background: #e5e7eb;
  align-self: stretch;
  margin: 0 4px;
}

/* Big two-column split for KPI comparison (one continuous divider) */
.kpi-compare-split {
  display: flex;
  align-items: stretch;
  padding: 16px;
}
.kpi-compare-column {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.kpi-compare-column-title {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
}
.kpi-compare-column-title span {
  font-size: 11px;
  font-weight: 400;
  color: #9ca3af;
}
.kpi-compare-column-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.kpi-compare-metric {
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  text-align: center;
}
.kpi-compare-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
}
.kpi-compare-big-divider {
  width: 3px;
  background: #d1d5db;
  margin: 0 24px;
  border-radius: 2px;
}

.compare-add-btn {
  background: #f5f3ff;
  color: #534AB7;
  border: 2px dashed #534AB7;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-self: center;
  margin-top: 20px;
  transition: background 0.15s;
}
.compare-add-btn:hover { background: #ede9fe; }
.compare-remove-btn {
  background: transparent;
  color: #991b1b;
  border: none;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 4px;
  padding: 0;
}

.compare-agent-list-title {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  margin-top: 18px;
  margin-bottom: 8px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}
.compare-agent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid #f3f4f6;
}
.compare-agent-name {
  font-weight: 600;
  color: #1a1a2e;
}
.compare-agent-stats {
  color: #6b7280;
  white-space: nowrap;
}

.ai-analysis-text {
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: #1a1a2e;
}
.ai-analysis-text h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 14px 0 6px;
  color: #534AB7;
}
.ai-analysis-text h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0 4px;
  color: #1a1a2e;
}
