<?php $__env->startSection('title', 'Customer CRM Dashboard'); ?>

<?php $__env->startSection('content'); ?>
<div class="space-y-6">

    <!-- Header (Requirements 2-3) -->
    <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4">
        <div>
            <h1 class="text-xl font-bold text-slate-900 dark:text-white">Customer & Corporate CRM Dashboard</h1>
            <p class="text-xs text-slate-500">Real-time stats across individual customers, families, corporate accounts, and document expiries.</p>
        </div>

        <div class="flex items-center space-x-2 rtl:space-x-reverse">
            <a href="<?php echo e(route('app.customers.search')); ?>" class="px-4 py-2 bg-sky-600 hover:bg-sky-700 text-white font-bold text-xs rounded-xl shadow-sm flex items-center space-x-1.5 rtl:space-x-reverse">
                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/></svg>
                <span>Phone-First Search</span>
            </a>
            <a href="<?php echo e(route('app.customers.create')); ?>" class="px-4 py-2 bg-slate-900 dark:bg-slate-700 text-white font-bold text-xs rounded-xl shadow-sm">
                + New Customer
            </a>
        </div>
    </div>

    <!-- KPI Metric Cards Grid (Requirement 3) -->
    <div class="grid grid-cols-2 md:grid-cols-4 gap-4 text-xs font-medium">
        <div class="p-5 rounded-3xl bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-1">
            <span class="text-slate-400 font-bold uppercase tracking-wider text-[10px]">Total Customers</span>
            <div class="text-2xl font-extrabold text-slate-900 dark:text-white font-mono"><?php echo e(number_format($stats['total_customers'])); ?></div>
            <span class="text-emerald-500 text-[10px] font-bold">Active Records</span>
        </div>

        <div class="p-5 rounded-3xl bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-1">
            <span class="text-slate-400 font-bold uppercase tracking-wider text-[10px]">Corporate Clients</span>
            <div class="text-2xl font-extrabold text-sky-600 dark:text-sky-400 font-mono"><?php echo e(number_format($stats['corporate_companies'])); ?></div>
            <span class="text-slate-500 text-[10px] font-bold"><?php echo e(number_format($stats['corporate_employees'])); ?> Employees</span>
        </div>

        <div class="p-5 rounded-3xl bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-1">
            <span class="text-slate-400 font-bold uppercase tracking-wider text-[10px]">Documents Expiring</span>
            <div class="text-2xl font-extrabold text-amber-600 dark:text-amber-400 font-mono"><?php echo e(number_format($stats['documents_expiring'])); ?></div>
            <span class="text-amber-500 text-[10px] font-bold">Next 60 Days</span>
        </div>

        <div class="p-5 rounded-3xl bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-1">
            <span class="text-slate-400 font-bold uppercase tracking-wider text-[10px]">Duplicates Review</span>
            <div class="text-2xl font-extrabold text-rose-600 dark:text-rose-400 font-mono"><?php echo e(number_format($stats['duplicate_records'])); ?></div>
            <a href="<?php echo e(route('app.customers.duplicates')); ?>" class="text-sky-600 hover:underline text-[10px] font-bold">Review Candidates ➔</a>
        </div>
    </div>

    <!-- Analytics & Quick Links (Requirement 3) -->
    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
        <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 text-xs">
            <h3 class="font-bold text-slate-900 dark:text-white uppercase tracking-wider text-xs border-b border-slate-100 dark:border-slate-700 pb-2">Customer Distribution Overview</h3>
            <div class="space-y-3 font-semibold text-slate-700 dark:text-slate-300">
                <div class="flex justify-between items-center">
                    <span>Individual Customers</span>
                    <span class="font-mono font-bold"><?php echo e($stats['individual_customers']); ?></span>
                </div>
                <div class="flex justify-between items-center">
                    <span>VIP & VVIP Customers</span>
                    <span class="font-mono font-bold text-amber-500"><?php echo e($stats['vip_customers']); ?></span>
                </div>
                <div class="flex justify-between items-center">
                    <span>Corporate Client Employees</span>
                    <span class="font-mono font-bold text-sky-500"><?php echo e($stats['corporate_employees']); ?></span>
                </div>
            </div>
        </div>

        <div class="bg-gradient-to-r from-slate-950 to-sky-950 rounded-3xl p-6 border border-slate-800 text-white shadow-xl space-y-4 text-xs">
            <h3 class="font-bold uppercase tracking-wider text-sky-400 text-xs">Receptionist Quick Lookup</h3>
            <p class="text-slate-300">Lookup any customer by mobile number, passport, Emirates ID, or visa file number with instant phone normalization.</p>
            <a href="<?php echo e(route('app.customers.search')); ?>" class="inline-block px-6 py-2.5 bg-sky-600 hover:bg-sky-500 text-white font-extrabold rounded-xl shadow-lg">
                Open Front Desk Search ➔
            </a>
        </div>
    </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\dashboard.blade.php ENDPATH**/ ?>