{% extends 'buybackprogram/base.html' %}
{% load i18n %}
{% load humanize %}
{% load price_formats %}

{% block details %}

<div class="card" style="margin-bottom:10px;">
    <div class="card-header">{% trans "Summary" %}</div>
    <div class="card-body">
        <div class="row g-3">
            <div class="col-md-3">
                <div class="card border-0 bg-light text-center p-3">
                    <div class="fs-4 fw-bold text-primary">{{ values.outstanding_count }}</div>
                    <div class="small text-muted">{% trans "Outstanding Contracts" %}</div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card border-0 bg-light text-center p-3">
                    <div class="fs-4 fw-bold text-warning">{{ values.outstanding|custom_number_format:2|price }}</div>
                    <div class="small text-muted">{% trans "Outstanding Value" %}</div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card border-0 bg-light text-center p-3">
                    <div class="fs-4 fw-bold text-success">{{ values.finished_count }}</div>
                    <div class="small text-muted">{% trans "Completed Contracts" %}</div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="card border-0 bg-light text-center p-3">
                    <div class="fs-4 fw-bold text-success">{{ values.finished|custom_number_format:2|price }}</div>
                    <div class="small text-muted">{% trans "Total Bought" %}</div>
                </div>
            </div>
            {% if BUYBACKPROGRAM_TRACK_PREFILL_CONTRACTS and values.untracked_count > 0 %}
            <div class="col-md-3">
                <div class="card border-0 bg-light text-center p-3">
                    <div class="fs-4 fw-bold text-danger">{{ values.untracked_count }}</div>
                    <div class="small text-muted">{% trans "Untracked Contracts" %}</div>
                </div>
            </div>
            {% endif %}
        </div>
    </div>
</div>

{% if funded_programs %}
<div class="card" style="margin-bottom:10px;">
    <div class="card-header">{% trans "Corporate Funding Wallets" %}</div>
    <div class="card-body p-0">
        {% include "buybackprogram/partials/stats/tabs/wallet_overview.html" %}
    </div>
</div>
{% endif %}

{% if values.untracked_count > 0 %}
<div class="card" style="margin-bottom:10px;">
    <div class="card-header">{% trans "Notes" %}</div>
    <div class="card-body">
        {% include "buybackprogram/partials/stats/warning.html" %}
    </div>
</div>
{% endif %}

<div class="card">
    <div class="card-header">{% trans "Contracts" %}</div>
    <div class="card-body">
        {% include "buybackprogram/partials/stats/tabs/tabs-navigation.html" %}
        <div class="tab-content" id="nav-tabContent">
            {% include "buybackprogram/partials/stats/tabs/outstanding.html" %}
            {% include "buybackprogram/partials/stats/tabs/finished.html" %}
            {% include "buybackprogram/partials/stats/tabs/untracked.html" %}
        </div>
    </div>
</div>

{% endblock %}

{% block extra_javascript %}
{% endblock %}

{% block extra_css %}
{% include "buybackprogram/bundles/buybackprogram-css-light.html" %}
{% endblock %}

{% block extra_script %}
{% endblock %}
