Detailed Statistics for {selectedPeriod.label.toLowerCase()}

{#each exercises as { key, config }} {@const totalValue = workoutSummary[key]} {@const dailyAverage = getAveragePerDay(totalValue, workoutSummary)} {@const goalProgress = getGoalProgress(totalValue, config.dailyGoal, workoutSummary)}
(selectedExercise = selectedExercise === key ? null : key)} onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); selectedExercise = selectedExercise === key ? null : key; } }} >
{config.icon}

{config.name}

{config.formatter(totalValue)}
Total
Daily Average: {config.formatter(Number(dailyAverage.toFixed(2)))}
{goalProgress.toFixed(0)}%
Goal: {config.formatter(config.dailyGoal)}/day
{#if goalProgress >= 100}
✅ Goal achieved!
{:else if goalProgress >= 80}
🎯 Close to goal
{:else if totalValue > 0}
Keep going!
{/if}
{#if selectedExercise === key}
{/if}
{/each}