{{-- 파트너별 수당 건 상세 목록 (HTMX partial) --}}
@if ($commissions->isEmpty())
    <div class="px-8 py-4 text-sm text-gray-500">해당 파트너의 승인 완료 건이 없습니다.</div>
@else
<div class="px-8 py-3">
    <table class="min-w-full divide-y divide-gray-200 border border-gray-100 rounded">
        <thead class="bg-gray-100">
            <tr>
                <th class="px-3 py-2 text-left text-xs font-medium text-gray-500">고객사</th>
                <th class="px-3 py-2 text-left text-xs font-medium text-gray-500">입금구분</th>
                <th class="px-3 py-2 text-right text-xs font-medium text-gray-500">입금액</th>
                <th class="px-3 py-2 text-right text-xs font-medium text-gray-500">파트너수당</th>
                <th class="px-3 py-2 text-right text-xs font-medium text-gray-500">매니저수당</th>
                <th class="px-3 py-2 text-right text-xs font-medium text-gray-500">유치수당</th>
                <th class="px-3 py-2 text-left text-xs font-medium text-gray-500">지급예정일</th>
                <th class="px-3 py-2 text-left text-xs font-medium text-gray-500">매니저</th>
            </tr>
        </thead>
        <tbody class="divide-y divide-gray-100 bg-white">
            @foreach ($commissions as $c)
            <tr class="hover:bg-blue-50">
                <td class="px-3 py-2 text-sm text-gray-900">
                    {{ $c->management?->tenant?->name ?? '-' }}
                </td>
                <td class="px-3 py-2 text-sm">
                    @if ($c->payment_type === 'deposit')
                        <span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800">계약금</span>
                    @else
                        <span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800">잔금</span>
                    @endif
                </td>
                <td class="px-3 py-2 text-sm text-right text-gray-900">{{ number_format($c->payment_amount) }}원</td>
                <td class="px-3 py-2 text-sm text-right text-gray-900">{{ number_format($c->partner_commission) }}원</td>
                <td class="px-3 py-2 text-sm text-right text-gray-900">{{ number_format($c->manager_commission) }}원</td>
                <td class="px-3 py-2 text-sm text-right text-gray-900">{{ number_format($c->referrer_commission ?? 0) }}원</td>
                <td class="px-3 py-2 text-sm text-gray-600">{{ $c->scheduled_payment_date?->format('Y-m-d') ?? '-' }}</td>
                <td class="px-3 py-2 text-sm text-gray-600">{{ $c->manager?->name ?? '-' }}</td>
            </tr>
            @endforeach
        </tbody>
    </table>
</div>
@endif
