<?php $__env->startSection('title', 'Corporate Bulk Applications'); ?>

<?php $__env->startSection('content'); ?>
<div class="space-y-6" x-data="{ modal: false }">
    <div class="flex items-center justify-between">
        <div>
            <h1 class="text-xl font-bold text-slate-900 dark:text-white">Corporate Bulk Applications Batch Processing</h1>
            <p class="text-xs text-slate-500">Generate individual trackable service applications for corporate client employee groups.</p>
        </div>
        <button @click="modal = true" class="px-4 py-2 bg-sky-600 text-white font-bold text-xs rounded-xl shadow-sm">+ Launch Bulk Application Batch</button>
    </div>

    <!-- Batches Directory (Requirements 95-98) -->
    <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs">
        <?php $__currentLoopData = $batches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $batch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="bg-white dark:bg-slate-800 rounded-3xl p-5 border border-slate-200 dark:border-slate-700/60 shadow-sm space-y-3">
                <div class="flex items-center justify-between border-b border-slate-100 dark:border-slate-700 pb-2">
                    <div>
                        <span class="font-mono font-extrabold text-sky-600 text-sm block"><?php echo e($batch->batch_number); ?></span>
                        <span class="text-[10px] text-slate-400 font-bold uppercase"><?php echo e($batch->company ? $batch->company->name_en : 'Company'); ?></span>
                    </div>
                    <span class="px-2.5 py-0.5 rounded-full text-[10px] font-bold uppercase bg-emerald-100 text-emerald-700">
                        <?php echo e($batch->status); ?>

                    </span>
                </div>

                <div class="flex justify-between items-center text-slate-600 dark:text-slate-300">
                    <span>Service: <strong><?php echo e($batch->service ? $batch->service->name_en : 'Service'); ?></strong></span>
                    <span class="font-mono font-bold text-slate-900 dark:text-white"><?php echo e($batch->completed_count); ?> / <?php echo e($batch->employee_count); ?> Created</span>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>

    <!-- Launch Batch Modal -->
    <div x-show="modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 flex items-center justify-center p-4" x-cloak>
        <div class="bg-white dark:bg-slate-800 rounded-3xl max-w-md w-full p-6 border border-slate-200 dark:border-slate-700 shadow-2xl space-y-4 text-xs">
            <h3 class="text-sm font-bold text-slate-900 dark:text-white uppercase tracking-wider">Launch Corporate Employee Bulk Batch</h3>
            <form action="<?php echo e(route('app.applications.bulk.store')); ?>" method="POST" class="space-y-3">
                <?php echo csrf_field(); ?>
                <div>
                    <label class="block font-semibold mb-1">Select Corporate Client Company *</label>
                    <select name="company_id" required class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl font-bold">
                        <?php $__currentLoopData = $companies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $comp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($comp->id); ?>"><?php echo e($comp->name_en); ?> (Code: <?php echo e($comp->company_code); ?>)</option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>

                <div>
                    <label class="block font-semibold mb-1">Select Service to Batch *</label>
                    <select name="service_id" required class="w-full px-3 py-2 bg-slate-50 dark:bg-slate-900 border border-slate-300 dark:border-slate-700 rounded-xl font-bold">
                        <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $srv): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($srv->id); ?>"><?php echo e($srv->name_en); ?> (Starting AED <?php echo e(number_format($srv->total_price, 2)); ?>)</option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>

                <div class="flex justify-end space-x-2 rtl:space-x-reverse pt-2">
                    <button type="button" @click="modal = false" class="px-4 py-2 bg-slate-200 dark:bg-slate-700 text-slate-700 dark:text-slate-200 font-bold rounded-xl">Cancel</button>
                    <button type="submit" class="px-5 py-2 bg-sky-600 text-white font-bold rounded-xl">Generate Batch</button>
                </div>
            </form>
        </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\applications\bulk.blade.php ENDPATH**/ ?>