<div class="wo-table-shell">
  <table class="wo-table">
    <thead>
      <tr>
        <th>SL</th>
        <th>মেম্বার</th>
        <th>রেফার কোড</th>
        <th>মোবাইল</th>
        <th>আপলাইন</th>
        <th>ভেরিফাই হয়েছে</th>
        <th>ভেরিফাই source</th>
        <th>রেজিস্ট্রেশন</th>
      </tr>
    </thead>
    <tbody>
      @forelse($members as $member)
        @php
          $verifiedAt = $member->welcome_offer_verified_at ?? null;
          $joinedAt = $member->welcome_offer_joined_at ?? $member->created_at ?? null;
        @endphp
        <tr>
          <td>{{ ($members->firstItem() ?? 0) + $loop->index }}</td>
          <td>
            <div class="wo-cell-main">{{ $member->name }}</div>
            <div class="wo-cell-sub">ID: {{ $member->id }}</div>
          </td>
          <td>
            <div class="wo-cell-main">{{ $member->referral_code ?: '—' }}</div>
          </td>
          <td>
            <div class="wo-cell-main">{{ $member->mobile ?: '—' }}</div>
          </td>
          <td>
            <div class="wo-cell-main">{{ $member->welcome_offer_upline_name ?: '—' }}</div>
            <div class="wo-cell-sub">{{ $member->welcome_offer_upline_referral ?: '—' }}</div>
          </td>
          <td>
            <div class="wo-cell-main">{{ $verifiedAt ? $verifiedAt->format('d M Y') : '—' }}</div>
            <div class="wo-cell-sub">{{ $verifiedAt ? $verifiedAt->format('h:i A') : 'No timestamp' }}</div>
          </td>
          <td>
            <div class="wo-cell-main">{{ $member->welcome_offer_verified_via ?: '—' }}</div>
          </td>
          <td>
            <div class="wo-cell-main">{{ $joinedAt ? $joinedAt->format('d M Y') : '—' }}</div>
            <div class="wo-cell-sub">{{ $joinedAt ? $joinedAt->format('h:i A') : '' }}</div>
          </td>
        </tr>
      @empty
        <tr>
          <td colspan="8" class="wo-empty">এই level-এ এখনো কোনো verified member পাওয়া যায়নি।</td>
        </tr>
      @endforelse
    </tbody>
  </table>
</div>

@if(method_exists($members, 'links'))
  <div class="mt-4">
    {{ $members->links() }}
  </div>
@endif
