.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stats-row-full {
  grid-template-columns: 1fr;
}

.stats-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.stats-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-item {
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.stats-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.stats-item-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.stats-item-label img {
  width: 20px;
  height: 14px;
  border-radius: 2px;
}

.stats-item-value {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.stats-item-bar-bg {
  width: 100%;
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  overflow: hidden;
}

.stats-item-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* Reliability colors */
.reliability-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.reliability-badge.high {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.reliability-badge.medium {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.reliability-badge.low {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.reliability-high {
  background: var(--success) !important;
}

.reliability-medium {
  background: #f59e0b !important;
}

.reliability-low {
  background: var(--error) !important;
}

/* Response time colors */
.response-time-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.response-time-badge.fast {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.response-time-badge.medium {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.response-time-badge.slow {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.response-fast {
  background: var(--success) !important;
}

.response-medium {
  background: #f59e0b !important;
}

.response-slow {
  background: var(--error) !important;
}

/* Trend chart */
.trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 180px;
  padding: 16px 0 0;
  gap: 8px;
}

.trend-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.trend-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
  min-height: 16px;
}

.trend-bar {
  width: 100%;
  max-width: 60px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.6s ease;
}

.trend-label {
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-top: 8px;
  font-weight: 500;
}

.trend-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
  font-size: 0.9rem;
}

/* Query items */
.query-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.query-domain {
  font-weight: 500;
  color: var(--text-primary);
}

.query-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.query-type {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.query-result {
  display: flex;
  gap: 8px;
}

.query-success {
  color: var(--success);
}

.query-fail {
  color: var(--error);
}

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

  .stats-row {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 1.8rem;
  }

  .trend-chart {
    height: 140px;
  }
}
