{%load i18n %}
{# -------------------------------------------------------------------------- #}
    {# STATS CARDS SECTION (12 KPIs) #}
    {# -------------------------------------------------------------------------- #}
    <div class="stats">
        
        {# GLOBAL - 1. Total Jobs (System) #}
        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-list stat-icon"></i> {% trans "Total Jobs" %}</h3>
            </div>
            <div class="stat-value">{{ total_jobs_global }}</div>
            <div class="stat-caption">{% trans "All Active & Drafted Positions" %}</div>
        </div>

        {# SCOPED - 2. Total Active Jobs #}
        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-briefcase stat-icon"></i> {% trans "Active Jobs" %}</h3>
            </div>
            <div class="stat-value">{{ total_active_jobs }}</div>
            <div class="stat-caption">{% trans "Currently Open Requisitions" %}</div>
        </div>

        {# SCOPED - 3. Total Candidates #}
        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-users stat-icon"></i> {% trans "Total Candidates" %}</h3>
            </div>
            <div class="stat-value">{{ total_candidates }}</div>
            <div class="stat-caption">{% trans "Total applications" %}</div>
        </div>

        {# SCOPED - 4. Open Positions #}
        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-th-list stat-icon"></i> {% trans "Open Positions" %}</h3>
            </div>
            <div class="stat-value">{{ total_open_positions }}</div>
            <div class="stat-caption">{% trans "Total Slots to be Filled " %}</div>
        </div>
        
        {# GLOBAL - 5. Total Participants #}
        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-address-book stat-icon"></i> {% trans "Total Participants" %}</h3>
            </div>
            <div class="stat-value">{{ total_participants }}</div>
            <div class="stat-caption">{% trans "Total Recruiters/Interviewers" %}</div>
        </div>

        {# GLOBAL - 6. Total LinkedIn Posts #}
        {% comment %} <div class="card">
            <div class="card-header">
                <h3><i class="fab fa-linkedin stat-icon"></i> {% trans "LinkedIn Posts" %}</h3>
            </div>
            <div class="stat-value">{{ total_jobs_posted_linkedin }}</div>
            <div class="stat-caption">{% trans "Total Job Posts Sent to LinkedIn (Global)" %}</div>
        </div>

        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-chart-line stat-icon"></i> {% trans "New Apps (7 Days)" %}</h3>
            </div>
            <div class="stat-value">{{ new_candidates_7days }}</div>
            <div class="stat-caption">{% trans "Incoming applications last week" %}</div>
        </div>
         {% endcomment %}
        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-cogs stat-icon"></i> {% trans "Avg. Apps per Job" %}</h3>
            </div>
            <div class="stat-value">{{ average_applications|floatformat:1 }}</div>
            <div class="stat-caption">{% trans "Average Applications per Job" %}</div>
        </div>

        {# --- Efficiency & Quality Metrics --- #}

        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-clock stat-icon"></i> {% trans "Time-to-Hire" %}</h3>
            </div>
            <div class="stat-value">{{ avg_time_to_hire_days }}</div>
            <div class="stat-caption">{% trans "Average Days" %}</div>
        </div>

        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-star stat-icon"></i> {% trans "Avg. Match Score" %}</h3>
            </div>
            <div class="stat-value">{{ avg_match_score|floatformat:1 }}</div>
            <div class="stat-caption">{% trans "Average AI Score " %}</div>
        </div>
        
        <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-trophy stat-icon"></i> {% trans "High Potential" %}</h3>
            </div>
            <div class="stat-value">{{ high_potential_count }}</div>
            <div class="stat-caption">{% trans "Score ≥ 75% Profiles" %} ({{ high_potential_ratio|floatformat:1 }}%)</div>
        </div>

        {% comment %} <div class="card">
            <div class="card-header">
                <h3><i class="fas fa-calendar-alt stat-icon"></i> {% trans "Meetings This Week" %}</h3>
            </div>
            <div class="stat-value">{{ meetings_scheduled_this_week }}</div>
            <div class="stat-caption">{% trans "Scheduled Interviews (Current Week)" %}</div>
        </div> {% endcomment %}

    </div>

