{{-- 고객 상세 모달 내용 --}}
<div class="p-6 max-h-[80vh] overflow-y-auto">
    <!-- 헤더 -->
    <div class="flex justify-between items-start mb-6">
        <div>
            <h2 class="text-xl font-bold text-gray-800">{{ $prospect->company_name }}</h2>
            <p class="text-sm text-gray-500 mt-1">
                <span class="px-2 py-1 text-xs font-medium rounded-full {{ $prospect->status_color }}">
                    {{ $prospect->status_label }}
                </span>
                <span class="ml-2">{{ $prospect->business_number }}</span>
            </p>
        </div>
        <button type="button" data-close-modal class="text-gray-400 hover:text-gray-600">
            <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
            </svg>
        </button>
    </div>

    <div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
        <!-- 회사 정보 -->
        <div class="bg-gray-50 rounded-lg p-4">
            <h3 class="text-sm font-semibold text-gray-800 mb-3">회사 정보</h3>
            <dl class="space-y-2 text-sm">
                <div class="flex justify-between">
                    <dt class="text-gray-500">사업자번호</dt>
                    <dd class="font-medium text-gray-900">{{ $prospect->business_number }}</dd>
                </div>
                <div class="flex justify-between">
                    <dt class="text-gray-500">회사명</dt>
                    <dd class="font-medium text-gray-900">{{ $prospect->company_name }}</dd>
                </div>
                <div class="flex justify-between">
                    <dt class="text-gray-500">대표자</dt>
                    <dd class="font-medium text-gray-900">{{ $prospect->ceo_name ?? '-' }}</dd>
                </div>
                <div class="flex justify-between">
                    <dt class="text-gray-500">연락처</dt>
                    <dd class="font-medium text-gray-900">{{ $prospect->contact_phone ?? '-' }}</dd>
                </div>
                <div class="flex justify-between">
                    <dt class="text-gray-500">이메일</dt>
                    <dd class="font-medium text-gray-900">{{ $prospect->contact_email ?? '-' }}</dd>
                </div>
                @if($prospect->address)
                <div class="flex justify-between">
                    <dt class="text-gray-500">주소</dt>
                    <dd class="font-medium text-gray-900 text-right text-xs">{{ $prospect->address }}</dd>
                </div>
                @endif
            </dl>
        </div>

        <!-- 영업권 정보 -->
        <div class="bg-gray-50 rounded-lg p-4">
            <h3 class="text-sm font-semibold text-gray-800 mb-3">영업권 정보</h3>
            <dl class="space-y-2 text-sm">
                <div class="flex justify-between">
                    <dt class="text-gray-500">등록자</dt>
                    <dd class="font-medium text-gray-900">{{ $prospect->registeredBy?->name ?? '-' }}</dd>
                </div>
                <div class="flex justify-between">
                    <dt class="text-gray-500">등록일</dt>
                    <dd class="font-medium text-gray-900">{{ $prospect->registered_at->format('Y-m-d H:i') }}</dd>
                </div>
                <div class="flex justify-between">
                    <dt class="text-gray-500">만료일</dt>
                    <dd class="font-medium {{ $prospect->isActive() ? 'text-blue-600' : 'text-gray-500' }}">
                        {{ $prospect->expires_at->format('Y-m-d') }}
                        @if($prospect->isActive())
                        <span class="text-xs">(D-{{ $prospect->remaining_days }})</span>
                        @endif
                    </dd>
                </div>
                @if($prospect->isConverted())
                <div class="flex justify-between">
                    <dt class="text-gray-500">계약일</dt>
                    <dd class="font-medium text-green-600">{{ $prospect->converted_at?->format('Y-m-d') }}</dd>
                </div>
                <div class="flex justify-between">
                    <dt class="text-gray-500">계약 처리자</dt>
                    <dd class="font-medium text-gray-900">{{ $prospect->convertedBy?->name ?? '-' }}</dd>
                </div>
                @endif
            </dl>
        </div>
    </div>

    <!-- 첨부 이미지 -->
    @if($prospect->hasBusinessCard())
    <div class="mt-4 bg-gray-50 rounded-lg p-4">
        <h3 class="text-sm font-semibold text-gray-800 mb-3">명함 이미지</h3>
        <a href="{{ $prospect->business_card_url }}" target="_blank" class="block">
            <img src="{{ $prospect->business_card_url }}" alt="명함 이미지" class="max-h-32 rounded-lg shadow hover:shadow-lg transition">
        </a>
    </div>
    @endif

    <!-- 메모 -->
    @if($prospect->memo)
    <div class="mt-4 bg-gray-50 rounded-lg p-4">
        <h3 class="text-sm font-semibold text-gray-800 mb-2">메모</h3>
        <p class="text-sm text-gray-700 whitespace-pre-line">{{ $prospect->memo }}</p>
    </div>
    @endif

    <!-- 상태별 안내 -->
    <div class="mt-4">
        @if($prospect->isActive())
        <div class="bg-blue-50 border border-blue-200 rounded-lg p-3">
            <p class="text-sm text-blue-700">
                <strong>영업권 유효:</strong> {{ $prospect->expires_at->format('Y-m-d') }}까지 (D-{{ $prospect->remaining_days }})
            </p>
        </div>
        @elseif($prospect->isConverted())
        <div class="bg-green-50 border border-green-200 rounded-lg p-3">
            <p class="text-sm text-green-700">
                <strong>계약 완료:</strong> {{ $prospect->converted_at?->format('Y-m-d') }}에 계약되었습니다.
            </p>
        </div>
        @elseif($prospect->isInCooldown())
        <div class="bg-yellow-50 border border-yellow-200 rounded-lg p-3">
            <p class="text-sm text-yellow-700">
                <strong>재등록 대기:</strong> {{ $prospect->cooldown_ends_at->format('Y-m-d') }} 이후 재등록 가능
            </p>
        </div>
        @else
        <div class="bg-gray-50 border border-gray-200 rounded-lg p-3">
            <p class="text-sm text-gray-700">
                <strong>영업권 만료:</strong> 재등록이 가능합니다.
            </p>
        </div>
        @endif
    </div>

    <!-- 푸터 버튼 -->
    <div class="mt-6 flex justify-end gap-3">
        <button type="button" data-close-modal
                class="px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition text-sm">
            닫기
        </button>
        @if(!$prospect->isConverted())
        <button type="button" onclick="window.openProspectEditModal({{ $prospect->id }})"
                class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition text-sm">
            수정
        </button>
        @endif
    </div>
</div>
