<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ __('Sales 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; }
        .totals td { padding: 4px 8px; }
    </style>
</head>
<body>
    <div class="header">
        <h2>{{ __('Sales Report') }}</h2>
        <p>{{ $from }} - {{ $to }}</p>
    </div>
    <table class="table">
        <thead>
            <tr>
                <th>{{ __('Invoice') }}</th>
                <th>{{ __('Date') }}</th>
                <th>{{ __('Customer') }}</th>
                <th>{{ __('Payment Type') }}</th>
                <th>{{ __('Amount') }}</th>
                <th>{{ __('Status') }}</th>
            </tr>
        </thead>
        <tbody>
            @foreach($sales as $sale)
                <tr>
                    <td>{{ $sale->invoice_number }}</td>
                    <td>{{ $sale->sale_date->format('Y-m-d') }}</td>
                    <td>{{ $sale->customer?->name ?? __('Walk-in') }}</td>
                    <td>{{ ucfirst($sale->payment_type) }}</td>
                    <td>{{ number_format($sale->total_amount, 2) }}</td>
                    <td>{{ ucfirst($sale->status) }}</td>
                </tr>
            @endforeach
        </tbody>
    </table>
    <div class="totals">
        <table>
            <tr>
                <td><strong>{{ __('Total Sales') }}:</strong></td>
                <td>{{ number_format($sales->sum('total_amount'), 2) }}</td>
            </tr>
        </table>
    </div>
</body>
</html>
