<?php $__env->startSection('title', 'Duplicate Review Center'); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-4xl mx-auto space-y-6">
    <div>
        <h1 class="text-xl font-bold text-slate-900 dark:text-white">Duplicate Records Review Center</h1>
        <p class="text-xs text-slate-500">Review candidate duplicate customer profiles and perform controlled merging with audit history.</p>
    </div>

    <!-- Candidate Cards (Requirements 56-60) -->
    <div class="space-y-4 text-xs">
        <?php $__empty_1 = true; $__currentLoopData = $candidates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $can): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div class="bg-white dark:bg-slate-800 rounded-3xl p-6 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-4">
                <div class="flex items-center justify-between border-b border-slate-100 dark:border-slate-700 pb-3">
                    <span class="font-bold text-slate-900 dark:text-white uppercase text-xs">Match Reason: <?php echo e(str_replace('_', ' ', $can->match_type)); ?></span>
                    <span class="px-2.5 py-0.5 rounded-full bg-amber-100 text-amber-800 font-bold text-[10px]">Confidence: <?php echo e($can->confidence_score); ?>%</span>
                </div>

                <div class="grid grid-cols-2 gap-4">
                    <div class="p-4 rounded-2xl bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 space-y-1">
                        <span class="font-bold text-sky-600 block text-xs">Record A (Primary)</span>
                        <div class="font-bold text-slate-900 dark:text-white"><?php echo e($can->customerA->full_name_en); ?></div>
                        <div class="text-[11px] text-slate-400 font-mono">Code: <?php echo e($can->customerA->customer_code); ?></div>
                    </div>

                    <div class="p-4 rounded-2xl bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 space-y-1">
                        <span class="font-bold text-rose-600 block text-xs">Record B (Duplicate)</span>
                        <div class="font-bold text-slate-900 dark:text-white"><?php echo e($can->customerB->full_name_en); ?></div>
                        <div class="text-[11px] text-slate-400 font-mono">Code: <?php echo e($can->customerB->customer_code); ?></div>
                    </div>
                </div>

                <!-- Merge Action Form -->
                <form action="<?php echo e(route('app.customers.merge')); ?>" method="POST" class="flex items-center justify-end space-x-2 rtl:space-x-reverse pt-2 border-t border-slate-100 dark:border-slate-700">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" name="primary_id" value="<?php echo e($can->customerA->id); ?>">
                    <input type="hidden" name="source_id" value="<?php echo e($can->customerB->id); ?>">
                    <input type="text" name="reason" required placeholder="Reason for merging..." class="px-3 py-2 bg-slate-50 dark:bg-slate-900 border rounded-xl w-64 text-xs">
                    <button type="submit" class="px-5 py-2 bg-rose-600 hover:bg-rose-700 text-white font-bold text-xs rounded-xl shadow-sm">Merge into Record A</button>
                </form>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <div class="bg-white dark:bg-slate-800 rounded-3xl p-8 border border-slate-200 dark:border-slate-700 text-center text-slate-400 font-semibold">
                🎉 No duplicate customer candidate records pending review.
            </div>
        <?php endif; ?>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\typingcenter\resources\views\tenant\customers\duplicates\index.blade.php ENDPATH**/ ?>