<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <title>Transactions Wallet</title>
    <link rel="icon" type="image/svg+xml" href="{{ asset('favicon.svg') }}">
    <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
    <style>
        body { font-family: Arial, sans-serif; }
        table { width: 100%; border-collapse: collapse; }
        th, td { border: 1px solid #ccc; padding: 8px; font-size: 12px; }
        th { background: #f4f6fb; text-align: left; }
    </style>
</head>
<body>
    <h3>Transactions du portefeuille</h3>
    <p>Solde actuel: {{ number_format($wallet->balance ?? 0, 0, ',', ' ') }} XOF</p>
    <table>
        <thead>
            <tr>
                <th>Date</th>
                <th>Type</th>
                <th>Description</th>
                <th>Montant</th>
                <th>Statut</th>
            </tr>
        </thead>
        <tbody>
            @foreach($rows as $tx)
                <tr>
                    <td>{{ optional($tx->created_at)->format('d/m/Y H:i') }}</td>
                    <td>{{ $tx->amount > 0 ? 'Crédit' : 'Débit' }}</td>
                    <td>{{ $tx->description }}</td>
                    <td>{{ number_format($tx->amount, 0, ',', ' ') }} XOF</td>
                    <td>{{ $tx->status }}</td>
                </tr>
            @endforeach
        </tbody>
    </table>
</body>
</html>
