{# Stats widget template #}
<div class="{{ widget.card_classes }}" id="{{ widget.widget_id }}">
    <div class="card-body">
        <div class="row align-items-center">
            <div class="col">
                <h6 class="card-title text-uppercase text-white-50 mb-2">
                    {{ widget.title }}
                </h6>
                <span class="h2 text-white mb-0">
                    {{ widget.value }}
                </span>
                {% if subtitle %}
                <p class="card-text mt-1 mb-0">
                    <small class="text-white-50">{{ widget.subtitle }}</small>
                </p>
                {% endif %}
            </div>
            {% if icon %}
            <div class="col-auto">
                <i class="fas fa-{{ widget.icon }} fa-2x text-white-50"></i>
            </div>
            {% endif %}
        </div>

        {% if trend %}
        <div class="mt-2">
            <span class="badge bg-{{ widget.trend_color }} bg-opacity-20 text-{{ widget.trend_color }}">
                <i class="fas fa-{{ widget.trend_icon }} me-1"></i>
                {{ widget.trend_value|default(trend) }}
            </span>
        </div>
        {% endif %}
    </div>
</div>
