<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Tree Export</title>
    <style>
        body { font-family: DejaVu Sans, sans-serif; font-size: 12px; color: #111; }
        h1 { font-size: 16px; margin-bottom: 10px; }
        table { width: 100%; border-collapse: collapse; margin-top: 12px; }
        th, td { border: 1px solid #e2e8f0; padding: 6px; text-align: left; }
        th { background: #f8fafc; }
    </style>
</head>
<body>
    <h1>Tree Export ({{ ucfirst($mode) }})</h1>
    <div>Member: {{ $member->member_code }} - {{ $member->name }}</div>
    <div>Left BV: {{ number_format($legTotals['left'], 2) }} | Right BV: {{ number_format($legTotals['right'], 2) }}</div>

    <table>
        <thead>
            <tr>
                <th>Leg</th>
                <th>Member</th>
                <th>Status</th>
            </tr>
        </thead>
        <tbody>
            @foreach($directs as $child)
                <tr>
                    <td>{{ $child->path_leg }}</td>
                    <td>{{ $child->member_code }} - {{ $child->name }}</td>
                    <td>{{ $child->status }}</td>
                </tr>
            @endforeach
        </tbody>
    </table>
</body>
</html>
