<div class="bg-white rounded-[24px] shadow-[0_10px_30px_rgba(15,23,42,0.05)] p-6 border border-white hover:shadow-md transition-all flex items-start justify-between">
    <div class="flex items-start gap-4">
        <div class="w-14 h-14 rounded-2xl bg-purple-50 flex items-center justify-center text-purple-500 shrink-0">
            <svg class="w-7 h-7" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8">
                <path stroke-linecap="round" stroke-linejoin="round" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" />
            </svg>
        </div>
        <div class="flex flex-col">
            <span class="text-[13px] font-bold text-gray-400 uppercase tracking-wider mb-2">User nhận nhiều nhất</span>
            @if(isset($topReceivedUsers) && $topReceivedUsers->isNotEmpty())
                <div class="flex flex-col gap-3">
                    @foreach($topReceivedUsers as $user)
                        <div class="flex flex-col leading-tight">
                            <span class="text-[16px] font-extrabold text-[#1a2b49]">{{ $user->name }}</span>
                            <div class="text-[12px] text-gray-500 font-semibold mt-0.5 flex flex-wrap gap-x-2 gap-y-0.5">
                                <span>MSNV: {{ $user->msnv }}</span>
                                @if($user->mail)
                                    <span class="text-gray-300">•</span>
                                    <span>Email: {{ $user->mail }}</span>
                                @endif
                            </div>
                        </div>
                    @endforeach
                </div>
            @else
                <span class="text-[15px] font-semibold text-gray-400">Không có dữ liệu</span>
            @endif
        </div>
    </div>
    <div class="text-right shrink-0">
        <span class="text-[36px] font-extrabold text-purple-600 leading-none">{{ isset($topReceivedUsers) && $topReceivedUsers->isNotEmpty() ? $topReceivedUsers->first()->total_received : 0 }}</span>
        <span class="block text-[11px] text-gray-400 font-bold uppercase mt-1">Thẻ Nhận</span>
    </div>
</div>

<div class="bg-white rounded-[24px] shadow-[0_10px_30px_rgba(15,23,42,0.05)] p-6 border border-white hover:shadow-md transition-all flex items-start justify-between">
    <div class="flex items-start gap-4">
        <div class="w-14 h-14 rounded-2xl bg-blue-50 flex items-center justify-center text-blue-500 shrink-0">
            <svg class="w-7 h-7 transform -rotate-45" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8">
                <path stroke-linecap="round" stroke-linejoin="round" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
            </svg>
        </div>
        <div class="flex flex-col">
            <span class="text-[13px] font-bold text-gray-400 uppercase tracking-wider mb-2">User gửi nhiều nhất</span>
            @if(isset($topSentUsers) && $topSentUsers->isNotEmpty())
                <div class="flex flex-col gap-3">
                    @foreach($topSentUsers as $user)
                        <div class="flex flex-col leading-tight">
                            <span class="text-[16px] font-extrabold text-[#1a2b49]">{{ $user->name }}</span>
                            <div class="text-[12px] text-gray-500 font-semibold mt-0.5 flex flex-wrap gap-x-2 gap-y-0.5">
                                <span>MSNV: {{ $user->msnv }}</span>
                                @if($user->mail)
                                    <span class="text-gray-300">•</span>
                                    <span>Email: {{ $user->mail }}</span>
                                @endif
                            </div>
                        </div>
                    @endforeach
                </div>
            @else
                <span class="text-[15px] font-semibold text-gray-400">Không có dữ liệu</span>
            @endif
        </div>
    </div>
    <div class="text-right shrink-0">
        <span class="text-[36px] font-extrabold text-blue-600 leading-none">{{ isset($topSentUsers) && $topSentUsers->isNotEmpty() ? $topSentUsers->first()->total_sent : 0 }}</span>
        <span class="block text-[11px] text-gray-400 font-bold uppercase mt-1">Thẻ Gửi</span>
    </div>
</div>
