/* Dashboard Layout */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.dashboard__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.dashboard__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
}

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

.dashboard__section {
  min-width: 0;
}

/* Stat Cards */
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: var(--transition-all);
}

.stat-card:hover {
  border-color: var(--color-gray-300);
  box-shadow: var(--shadow-sm);
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card__icon--primary {
  background: var(--color-primary-50);
  color: var(--color-primary-600);
}

.stat-card__icon--success {
  background: var(--color-success-50);
  color: var(--color-success-600);
}

.stat-card__icon--info {
  background: var(--color-info-50);
  color: var(--color-info-600);
}

.stat-card__icon--warning {
  background: var(--color-warning-50);
  color: var(--color-warning-600);
}

.stat-card__content {
  flex: 1;
  min-width: 0;
}

.stat-card__title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-gray-600);
  margin: 0 0 var(--spacing-xs) 0;
}

.stat-card__value {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-gray-900);
  margin: 0;
  line-height: 1.2;
}

/* Test Runs List */
.test-runs-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.test-run-item {
  padding: var(--spacing-md);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  transition: var(--transition-all);
}

.test-run-item:hover {
  border-color: var(--color-gray-300);
  background: var(--color-gray-50);
}

.test-run-item__main {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.test-run-item__header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--spacing-md);
}

.test-run-item__title {
  font-size: var(--text-base);
  font-weight: 500;
  margin: 0;
}

.test-run-item__date {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.test-run-item__content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.test-run-item__model {
  font-size: var(--text-sm);
  margin: 0;
}

.test-run-item__error {
  font-size: var(--text-sm);
  color: var(--color-danger-600);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
}

.empty-state p {
  margin-bottom: var(--spacing-md);
}

/* Dashboard Table Enhancements */
.dashboard__section .table-container {
  border: none;
  box-shadow: none;
  background: transparent;
}

.dashboard__section .table {
  background: transparent;
}

.dashboard__section .table__row {
  border-bottom: 1px solid var(--color-gray-100);
}

.dashboard__section .table__row:hover {
  background-color: var(--color-gray-50);
}

.dashboard__section .table__cell {
  padding: var(--spacing-md) var(--spacing-sm);
}

.dashboard__section .table__cell:first-child {
  padding-left: 0;
}

.dashboard__section .table__cell:last-child {
  padding-right: 0;
}

.dashboard__section .table__cell--header {
  padding-top: 0;
  padding-bottom: var(--spacing-sm);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-500);
}

.dashboard__section .table__action {
  font-weight: 500;
  color: var(--color-gray-900);
}

.dashboard__section .table__action:hover {
  color: var(--color-primary-600);
}

/* Metrics Dashboard */
.metrics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.metrics-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  transition: var(--transition-all);
}

.metrics-card:hover {
  border-color: var(--color-gray-300);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.metrics-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-primary-50);
  color: var(--color-primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metrics-card__icon svg {
  width: 28px;
  height: 28px;
}

.metrics-card__content {
  flex: 1;
  min-width: 0;
}

.metrics-card__label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-600);
  margin: 0 0 var(--spacing-xs) 0;
}

.metrics-card__value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0;
  line-height: 1.2;
}

/* Chart Grid */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

@media (max-width: 900px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
  padding: var(--spacing-sm);
}

.chart-container--small {
  height: 250px;
}

.chart-container canvas {
  max-width: 100%;
}

/* Metrics-specific text colors */
.text-warning {
  color: var(--color-warning);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .metrics-summary {
    grid-template-columns: 1fr;
  }
  
  .metrics-card {
    padding: var(--spacing-md);
  }
  
  .metrics-card__icon {
    width: 48px;
    height: 48px;
  }
  
  .metrics-card__icon svg {
    width: 24px;
    height: 24px;
  }
  
  .metrics-card__value {
    font-size: var(--font-size-xl);
  }
  
  .chart-container {
    height: 250px;
  }
}