{% extends 'school/base.html.twig' %}

{% block title %}{{ title }} | SALSABIL Madrassas{% endblock %}

{% block content %}
    <style>
        .expense-form-shell{max-width:980px}
        .expense-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem}
        .expense-form-grid .form-row-full{grid-column:1/-1}
        .expense-form-shell label{font-weight:700;color:#183835;margin-bottom:.35rem}
        .expense-form-shell input,.expense-form-shell select,.expense-form-shell textarea{width:100%;border:1px solid rgba(15,92,69,.16);border-radius:12px;padding:.78rem .9rem;background:#fff}
        .expense-form-actions{display:flex;gap:.75rem;flex-wrap:wrap;justify-content:flex-end;margin-top:1.2rem}
    </style>
    <div class="admin-page-stack expense-form-shell">
        <section class="admin-page-header">
            <div>
                <p class="admin-eyebrow">DÉPENSES</p>
                <h1 class="admin-page-title">{{ title }}</h1>
                <p>Une dépense validée crée une sortie de caisse automatiquement.</p>
            </div>
        </section>

        <section class="admin-card">
            {{ form_start(form) }}
                <div class="expense-form-grid">
                    <div>{{ form_row(form.anneeScolaire) }}</div>
                    <div>{{ form_row(form.categorie) }}</div>
                    <div>{{ form_row(form.montant) }}</div>
                    <div>{{ form_row(form.dateDepense) }}</div>
                    <div>{{ form_row(form.beneficiaire) }}</div>
                    <div>{{ form_row(form.modePaiement) }}</div>
                    <div>{{ form_row(form.reference) }}</div>
                    <div>{{ form_row(form.justificatifPath) }}</div>
                    <div class="form-row-full">{{ form_row(form.description) }}</div>
                </div>
                <div class="expense-form-actions">
                    <a class="admin-btn admin-btn-light" href="{{ depense.id ? path('school_depense_show', {id: depense.id}) : path('school_depense_index') }}">Annuler</a>
                    <button class="admin-btn admin-btn-primary" type="submit">Enregistrer</button>
                </div>
            {{ form_end(form) }}
        </section>
    </div>
{% endblock %}
