{% extends "base.html" %}

{% block title %}İstatistik & Raporlar - FaturaYol{% endblock %}
{% block page_title %}İstatistik & Raporlar{% endblock %}

{% block content %}
<div class="row mb-4">
    <div class="col-md-6">
        <div class="card h-100 border-0 shadow-sm">
            <div class="card-body">
                <h5 class="fw-bold mb-4">Aylık Harcama Trendi</h5>
                <div class="table-responsive">
                    <table class="table table-sm">
                        <thead>
                            <tr>
                                <th>Ay</th>
                                <th>Fatura Adedi</th>
                                <th class="text-end">Toplam Tutar</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for harcama in aylik_harcama %}
                            <tr>
                                <td>{{ harcama.tarih__month }}. Ay</td>
                                <td>{{ harcama.adet }}</td>
                                <td class="text-end fw-bold">{{ harcama.toplam }} ₺</td>
                            </tr>
                            {% empty %}
                            <tr>
                                <td colspan="3" class="text-center py-4">Veri bulunamadı</td>
                            </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    
    <div class="col-md-6">
        <div class="card h-100 border-0 shadow-sm">
            <div class="card-body">
                <h5 class="fw-bold mb-4">KDV Özeti</h5>
                <div class="p-4 bg-light rounded-4 text-center mb-4">
                    <small class="text-muted d-block mb-1">Toplam Ödenen KDV</small>
                    <h2 class="fw-bold text-success mb-0">{{ kdv_ozet.toplam_kdv|default:0 }} ₺</h2>
                </div>
                <div class="p-4 bg-light rounded-4 text-center">
                    <small class="text-muted d-block mb-1">Fatura Başı Ortalama KDV</small>
                    <h2 class="fw-bold text-primary mb-0">{{ kdv_ozet.ortalama_kdv|default:0|floatformat:2 }} ₺</h2>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-12">
        <div class="card border-0 shadow-sm">
            <div class="card-body py-5 text-center">
                <i class="bi bi-graph-up-arrow text-primary opacity-25" style="font-size: 4rem;"></i>
                <h4 class="mt-3 fw-bold">Gelişmiş Raporlama Yakında</h4>
                <p class="text-muted">Grafikler, Excel dışa aktarma ve kategori bazlı analizler bir sonraki güncellemede eklenecektir.</p>
            </div>
        </div>
    </div>
</div>
{% endblock %}
