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

{% block content %}
    {% if request.isApproved %}
        <h2 style="color:#198754;">Indisponibilité acceptée</h2>
        <p>Bonjour {{ request.agent.firstName }},</p>
        <p>Votre demande d'indisponibilité a été <strong>acceptée</strong>.</p>
    {% else %}
        <h2 style="color:#dc3545;">Indisponibilité refusée</h2>
        <p>Bonjour {{ request.agent.firstName }},</p>
        <p>Votre demande d'indisponibilité a été <strong>refusée</strong>.
           La vacation reste à votre planning.</p>
    {% endif %}

    <table cellpadding="6" cellspacing="0" border="1" style="border-collapse:collapse; margin-top:1em;">
        <tr><td><strong>Date</strong></td><td>{{ request.entryDate|date('d/m/Y') }}</td></tr>
        {% if request.entryStartTime %}
        <tr><td><strong>Horaire</strong></td>
            <td>{{ request.entryStartTime|date('H:i') }} → {{ request.entryEndTime|date('H:i') }}</td></tr>
        {% endif %}
        <tr><td><strong>Motif</strong></td><td>{{ request.motifLabel }}</td></tr>
    </table>

    {% if request.adminComment %}
        <p style="margin-top:1em;"><strong>Commentaire :</strong><br>{{ request.adminComment|nl2br }}</p>
    {% endif %}
{% endblock %}
