<x-filament-widgets::widget>
    <x-filament::section>
        <div class="space-y-4">
            @foreach($poles as $pole)
                <div class="border rounded-lg p-4">
                    <div class="flex items-center justify-between mb-2">
                        <h3 class="text-lg font-semibold">{{ $pole->libellefr }}</h3>
                        <div class="flex gap-4 text-sm">
                            <span class="text-blue-600">Wilayas: {{ $pole->regions_count }}</span>
                            <span class="text-green-600">Établissements: {{ $pole->etablissements_count }}</span>
                            <span class="text-orange-600">Professeurs: {{ $pole->professeurs_count }}</span>
                        </div>
                    </div>
                    
                    @if($pole->regions_count > 0)
                        <div class="ml-4 space-y-2">
                            @foreach($pole->regions as $region)
                                <div class="border-l-2 border-gray-300 pl-4">
                                    <div class="flex items-center justify-between">
                                        <span class="font-medium">{{ $region->libellefr }}</span>
                                        <div class="flex gap-4 text-sm">
                                            <span class="text-gray-600">Moughataas: {{ $region->moughataas_count ?? 0 }}</span>
                                            <span class="text-gray-600">Établissements: {{ $region->etablissements_count ?? 0 }}</span>
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                        </div>
                    @endif
                </div>
            @endforeach
        </div>
    </x-filament::section>
</x-filament-widgets::widget>
