/* Analytics dashboard styles */
.dashboard {
  display: grid;
  gap: var(--space-lg);
}

.dashboard-row {
  display: grid;
  gap: var(--space-lg);
}

.dashboard-row-2 { grid-template-columns: 1fr 1fr; }
.dashboard-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.dashboard-row-wide { grid-template-columns: 2fr 1fr; }

.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.chart-title {
  font-size: var(--text-base);
  font-weight: 600;
}

.chart-filters {
  display: flex;
  gap: var(--space-xs);
}

.chart-filter-btn {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: transparent;
  transition: all var(--transition-fast);
}

.chart-filter-btn:hover { color: var(--text-primary); }
.chart-filter-btn.active {
  background: var(--accent-primary);
  color: white;
}

.chart-canvas {
  width: 100%;
  height: 250px;
}

/* Radar chart (cognitive profile) */
.radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radar-canvas {
  width: 300px;
  height: 300px;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
}

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

.stat-card-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

.stat-card-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

.stat-card-delta {
  font-size: var(--text-xs);
  margin-top: var(--space-xs);
  font-weight: 600;
}

.stat-delta-positive { color: var(--success); }
.stat-delta-negative { color: var(--danger); }

/* Insights panel */
.insights-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
}

.insight-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
}

.insight-item:last-child { border-bottom: none; }

.insight-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-sm);
}

.insight-positive { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.insight-neutral { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.insight-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.insight-text {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Calendar heatmap */
.heatmap-container {
  overflow-x: auto;
}

.heatmap {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
}

.heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--bg-tertiary);
}

.heatmap-1 { background: rgba(99, 102, 241, 0.2); }
.heatmap-2 { background: rgba(99, 102, 241, 0.4); }
.heatmap-3 { background: rgba(99, 102, 241, 0.6); }
.heatmap-4 { background: rgba(99, 102, 241, 0.8); }
.heatmap-5 { background: var(--accent-primary); }

/* History list */
.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.history-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: background var(--transition-fast);
}

.history-item:hover { background: var(--bg-hover); }

.history-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-icon-session { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.history-icon-test { background: rgba(16, 185, 129, 0.15); color: var(--success); }

.history-item-info { flex: 1; }

.history-item-title {
  font-weight: 500;
  font-size: var(--text-sm);
}

.history-item-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.history-item-score {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-primary);
}

@media (max-width: 768px) {
  .dashboard-row-2,
  .dashboard-row-3,
  .dashboard-row-wide {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
