<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Daily Management Report</title>
</head>
<body style="margin:0;background:#f4f6f8;font-family:Arial,Helvetica,sans-serif;color:#1f2937;">
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="background:#f4f6f8;padding:24px 12px;">
    <tr>
        <td align="center">
            <table role="presentation" width="680" cellspacing="0" cellpadding="0" style="max-width:680px;width:100%;background:#ffffff;border-radius:10px;overflow:hidden;border:1px solid #e5e7eb;">
                <tr>
                    <td style="padding:26px 30px;background:#17324d;color:#ffffff;">
                        <div style="font-size:22px;font-weight:700;">Daily Management Report</div>
                        <div style="font-size:14px;margin-top:6px;color:#dbe7f1;">All Solicitors &middot; {{ $report['cutoff']->format('l j F Y') }}</div>
                    </td>
                </tr>
                <tr>
                    <td style="padding:28px 30px;">
                        <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="border-collapse:collapse;font-size:14px;">
                            <thead>
                            <tr>
                                <th align="left" style="padding:12px;border-bottom:2px solid #17324d;color:#4b5563;">Metric</th>
                                <th align="center" style="padding:12px;border-bottom:2px solid #17324d;color:#4b5563;">Day</th>
                                <th align="center" style="padding:12px;border-bottom:2px solid #17324d;color:#4b5563;">Week So Far</th>
                                <th align="center" style="padding:12px;border-bottom:2px solid #17324d;color:#4b5563;">Month So Far</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($report['rows'] as $row)
                                <tr>
                                    <td style="padding:13px 12px;border-bottom:1px solid #e5e7eb;font-weight:600;">{{ $row['label'] }}</td>
                                    @foreach(['day', 'week', 'month'] as $period)
                                        <td align="center" style="padding:13px 12px;border-bottom:1px solid #e5e7eb;">
                                            <div style="font-size:17px;font-weight:700;">{{ $report['values'][$period][$row['key']] }}</div>
                                            <div style="margin-top:4px;color:#6b7280;font-size:10px;line-height:1.4;">
                                                ({{ collect($report['breakdown'][$period][$row['key']])->map(fn($value, $name) => $name . ': ' . $value)->implode(', ') }})
                                            </div>
                                        </td>
                                    @endforeach
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        <p style="margin:20px 0 0;color:#6b7280;font-size:12px;line-height:1.5;">
                            Day, week and month figures are measured up to {{ $report['cutoff']->format('H:i') }} Europe/London.
                            The week begins on Monday.
                        </p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</body>
</html>
