/* ==================== KPI Cards ==================== */
.kpi-card {
  background: #fff;
  border-left: 4px solid #ccc;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  height: 100%;
}

.kpi-card.success {
  border-left-color: #2eca6a;
}

.kpi-card.info {
  border-left-color: #4154f1;
}

.kpi-card.danger {
  border-left-color: #e74c3c;
}

.kpi-card.warning {
  border-left-color: #ffc107;
}

.kpi-card.dns-good {
  border-left-color: #2eca6a;
}

.kpi-card.dns-bad {
  border-left-color: #e74c3c;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 12px;
  color: #6c757d;
}

.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* ==================== Filters ==================== */
.report-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  margin-bottom: 1rem;
  position: sticky;
  top: 60px;
  z-index: 100;
}

/* ==================== Button group toggle ==================== */
.btn-group-toggle .btn.active {
  background-color: #4154f1;
  border-color: #4154f1;
  color: #fff;
}

/* ==================== Chart Cards ==================== */
.chart-card {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.25rem;
}

.chart-card .card-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 0.75rem;
}

/* ==================== Map ==================== */
#connectivityMap {
  height: 400px;
  z-index: 1;
  border-radius: 0 0 0.5rem 0.5rem;
}

#signalMap,
#bandwidthMap,
#deadZoneClusterMap {
  z-index: 1;
  border-radius: 0 0 0.5rem 0.5rem;
}

/* ==================== Map tab buttons ==================== */
.map-tab-btn {
  font-size: 0.78rem;
  padding: 0.25rem 0.75rem;
}

.map-tab-btn.active {
  font-weight: 600;
}

/* ==================== Map Legend ==================== */
#mapLegend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#mapLegend .legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* ==================== Timeline ==================== */
.timeline-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f8f9fa;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 0.6rem 1rem;
}

.timeline-container input[type="range"] {
  flex: 1;
}

/* ==================== Quality Badges ==================== */
.badge-excellent {
  background-color: #2eca6a;
  color: #fff;
}

.badge-good {
  background-color: #8bc34a;
  color: #fff;
}

.badge-fair,
.badge-acceptable {
  background-color: #ffc107;
  color: #212529;
}

.badge-poor {
  background-color: #ff8c00;
  color: #fff;
}

.badge-critical {
  background-color: #e74c3c;
  color: #fff;
}

.badge-offline {
  background-color: #6c757d;
  color: #fff;
}

/* ==================== Trend indicators ==================== */
.trend-up {
  color: #2eca6a;
}

.trend-down {
  color: #e74c3c;
}

/* ==================== Chart states ==================== */
.chart-loading,
.chart-nodata {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  color: #6c757d;
  font-size: 0.875rem;
}

.chart-loading .spinner-border {
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.5rem;
}

/* ==================== Report Tables ==================== */
.report-table {
  font-size: 13px;
  width: 100%;
  margin-bottom: 0;
}

.report-table thead th {
  background-color: #f1f3fa;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #555;
  border-bottom: 2px solid #dee2e6;
  white-space: nowrap;
}

.report-table tbody tr:hover {
  background-color: #f8f9ff;
}

/* ==================== Progress Bar (Agent Performance) ==================== */
.bar-bg {
  background: #e9ecef;
  border-radius: 4px;
  height: 18px;
  width: 100%;
  min-width: 80px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
  min-width: 2px;
}

/* ==================== Executive Report ==================== */
.exec-section {
  margin-bottom: 1.25rem;
}

.exec-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #4154f1;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exec-section-title .exec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #4154f1;
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.exec-narrative {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #333;
}

.exec-issues-table .severity-critical {
  color: #e74c3c;
  font-weight: 700;
}

.exec-issues-table .severity-high {
  color: #ff8c00;
  font-weight: 700;
}

.exec-issues-table .severity-medium {
  color: #ffc107;
  font-weight: 600;
}

.exec-issues-table .severity-low {
  color: #8bc34a;
  font-weight: 600;
}

.exec-agent-status {
  font-weight: 600;
  font-size: 0.8rem;
}

.exec-agent-status.st-excellent { color: #2eca6a; }
.exec-agent-status.st-good { color: #8bc34a; }
.exec-agent-status.st-acceptable { color: #ffc107; }
.exec-agent-status.st-poor { color: #ff8c00; }
.exec-agent-status.st-critical { color: #e74c3c; }
.exec-agent-status.st-offline { color: #6c757d; }

.exec-actions-table .priority-p0 {
  background: #e74c3c;
  color: #fff;
}

.exec-actions-table .priority-p1 {
  background: #ff8c00;
  color: #fff;
}

.exec-actions-table .priority-p2 {
  background: #ffc107;
  color: #212529;
}

.exec-actions-table .priority-p3 {
  background: #8bc34a;
  color: #fff;
}

/* ==================== Insight Box ==================== */
.insight-box {
  border-left: 4px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.insight-box.insight-critical {
  border-left-color: #e74c3c;
}

.insight-box.insight-warning {
  border-left-color: #ffc107;
}

.insight-box.insight-success {
  border-left-color: #2eca6a;
}

.insight-box.insight-info {
  border-left-color: #4154f1;
}

/* ==================== AI Summary ==================== */
.ai-summary-executive {
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  border-left: 4px solid #4154f1;
  padding: 1rem;
  border-radius: 0.375rem;
}

.ai-summary-technical {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 0.375rem;
}

.ai-summary-text {
  line-height: 1.7;
  color: #333;
}

.ai-issue-item,
.ai-recommendation-item {
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
}

.ai-issue-item:last-child,
.ai-recommendation-item:last-child {
  border-bottom: none;
}

.ai-summary-highlights {
  padding-left: 1.2rem;
  margin-bottom: 0;
}

.ai-summary-highlights li {
  padding: 0.15rem 0;
}

.ai-summary-meta {
  border-top: 1px solid #eee;
  padding-top: 0.5rem;
}

.bi.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* ==================== Zone Map Labels ==================== */
.zone-label {
  background: none;
  border: none;
  box-shadow: none;
}

.zone-label span {
  font-size: 11px;
  font-weight: 600;
  color: #333;
  text-shadow: 1px 1px 2px #fff, -1px -1px 2px #fff, 1px -1px 2px #fff, -1px 1px 2px #fff;
  white-space: nowrap;
}

#zoneMap {
  z-index: 1;
  border-radius: 0.5rem;
}

#zoneMapLegend .legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 3px;
}
