<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <style>
        body { font-family: DejaVu Sans, sans-serif; font-size: 12px; color: #222; }
        h2 { margin: 0 0 8px 0; }
        .meta { margin-bottom: 12px; color: #666; font-size: 11px; }
        table { width: 100%; border-collapse: collapse; }
        th, td { border: 1px solid #ccc; padding: 6px; text-align: left; vertical-align: top; }
        th { background: #f2f2f2; }
    </style>
</head>
<body>
    <h2>Workflow Report</h2>
    <div class="meta">Generated: {{ now()->format('Y-m-d H:i:s') }}</div>

    <table>
        <thead>
            <tr>
                <th>Name</th>
                <th>Status</th>
                <th>Created By</th>
                <th>Created At</th>
            </tr>
        </thead>
        <tbody>
            @forelse($workflows as $workflow)
                <tr>
                    <td>{{ $workflow->name }}</td>
                    <td>{{ ucfirst($workflow->status) }}</td>
                    <td>{{ $workflow->createdBy->first_name ?? '-' }} {{ $workflow->createdBy->last_name ?? '' }}</td>
                    <td>{{ $workflow->created_at ? $workflow->created_at->format('Y-m-d H:i') : '-' }}</td>
                </tr>
            @empty
                <tr>
                    <td colspan="4">No workflows found</td>
                </tr>
            @endforelse
        </tbody>
    </table>
</body>
</html>
