/* === Stats Page: Stats Grid, Segmented Control, Stat Cards === */

.stats-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

.segmented-control {
  margin-bottom: 20px;
}

.segment-track {
  display: flex;
  background: var(--color-surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  padding: 4px;
  position: relative;
}

.segment-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(33.333% - 2.67px);
  height: calc(100% - 8px);
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-smooth);
  z-index: 0;
}

.segment-btn {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color var(--transition-base);
  border-radius: var(--radius-full);
}

.segment-btn.active {
  color: #000;
}

/* --- Stats Grid --- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.stats-grid > .stat-card.top-row {
  grid-column: span 2;
}
.stats-grid > .stat-card.bottom-row {
  grid-column: span 3;
}

@media (max-width: 767px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats-grid > .stat-card.top-row {
    grid-column: span 1;
  }
  .stats-grid > .stat-card.bottom-row {
    grid-column: span 1;
  }
  .stats-grid > .stat-card.bottom-row:last-child {
    grid-column: span 2;
  }
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, background 0.2s ease;
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.stat-arrow {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover .stat-arrow {
  background: var(--color-primary);
  color: #000;
  transform: scale(1.1) rotate(5deg);
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-badge.positive {
  background: rgba(52, 199, 89, 0.15);
  color: var(--color-success);
}

.stat-badge.negative {
  background: rgba(255, 69, 58, 0.15);
  color: var(--color-danger);
}
