<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ __('Expense Report') }}</title>
    <style>
        body { font-family: Arial, sans-serif; font-size: 12px; }
        .header { text-align: center; margin-bottom: 20px; }
        .table { width: 100%; border-collapse: collapse; }
        .table th, .table td { border: 1px solid #ccc; padding: 8px; }
        .table th { background: #f5f5f5; }
        .totals { margin-top: 20px; }
    </style>
</head>
<body>
    <div class="header">
        <h2>{{ __('Expense Report') }}</h2>
        <p>{{ $from }} - {{ $to }}</p>
    </div>
    <table class="table">
        <thead>
            <tr>
                <th>{{ __('Date') }}</th>
                <th>{{ __('Category') }}</th>
                <th>{{ __('Amount') }}</th>
                <th>{{ __('Frequency') }}</th>
                <th>{{ __('Notes') }}</th>
            </tr>
        </thead>
        <tbody>
            @foreach($expenses as $expense)
                <tr>
                    <td>{{ $expense->expense_date->format('Y-m-d') }}</td>
                    <td>{{ ucfirst($expense->category) }}</td>
                    <td>{{ number_format($expense->amount, 2) }}</td>
                    <td>{{ ucfirst($expense->frequency) }}</td>
                    <td>{{ $expense->notes }}</td>
                </tr>
            @endforeach
        </tbody>
    </table>
    <div class="totals">
        <table>
            <tr>
                <td><strong>{{ __('Total Expenses') }}:</strong></td>
                <td>{{ number_format($expenses->sum('amount'), 2) }}</td>
            </tr>
        </table>
    </div>
</body>
</html>
