<?php $__env->startSection('content'); ?>
<div class="bg-gray-100 min-h-[calc(100vh-130px)] p-4 flex flex-col">
    <!-- Header Tab -->
    <div class="bg-[#ff9800] text-white px-4 py-2 font-bold flex items-center shadow-sm">
        <i class="fa-solid fa-list-ul mr-2"></i> 
        <span>List of Company</span>
    </div>

    <!-- Main Container -->
    <div class="bg-white shadow-sm flex-1 border border-gray-200 border-t-0 flex flex-col justify-between">
        
        <!-- Table Area -->
        <div class="flex-1 p-0 m-0">
            <table class="w-full text-left border-collapse">
                <thead>
                    <tr class="bg-white border-b border-gray-200 text-[#ff9800]">
                        <th class="p-3 text-sm font-semibold w-24">Select</th>
                        <th class="p-3 text-sm font-semibold border-l border-gray-200 w-1/4">Company</th>
                        <th class="p-3 text-sm font-semibold border-l border-gray-200 w-1/4">Phone No</th>
                        <th class="p-3 text-sm font-semibold border-l border-gray-200 w-1/4">Email Address</th>
                        <th class="p-3 text-sm font-semibold border-l border-gray-200">Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $companies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $company): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="border-b border-gray-100 hover:bg-gray-50">
                            <td class="p-3 text-sm text-center">
                                <input type="checkbox" name="company_ids[]" value="<?php echo e($company->id); ?>" class="cursor-pointer">
                            </td>
                            <td class="p-3 text-sm text-gray-800 border-l border-gray-200"><?php echo e($company->company_name ?? 'Demo'); ?></td>
                            <td class="p-3 text-sm text-gray-800 border-l border-gray-200"><?php echo e($company->phone ?? ''); ?></td>
                            <td class="p-3 text-sm text-gray-800 border-l border-gray-200"><?php echo e($company->email ?? ''); ?></td>
                            <td class="p-3 text-sm text-center border-l border-gray-200 flex space-x-2 justify-center">
                                <a href="<?php echo e(route('company.edit', $company->id)); ?>" class="bg-blue-500 hover:bg-blue-600 text-white px-3 py-1 rounded text-xs font-semibold">Edit</a>
                                <form action="<?php echo e(route('company.destroy', $company->id)); ?>" method="POST" onsubmit="return confirm('Are you sure you want to delete this company and all its branches/logins?');">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit" class="bg-red-500 hover:bg-red-600 text-white px-3 py-1 rounded text-xs font-semibold">Delete</button>
                                </form>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="5" class="p-8 text-center text-gray-500">No company details found.</td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>

        <!-- Action Buttons -->
        <div class="flex justify-center items-center space-x-2 py-6">
            <a href="<?php echo e(route('company.create')); ?>" class="bg-[#4caf50] hover:bg-[#43a047] text-white px-6 py-1.5 rounded shadow text-sm font-semibold">Add</a>
            <button class="bg-[#f44336] hover:bg-[#e53935] text-white px-6 py-1.5 rounded shadow text-sm font-semibold">Delete</button>
            <a href="<?php echo e(route('admin.dashboard')); ?>" class="bg-[#f44336] hover:bg-[#e53935] text-white px-6 py-1.5 rounded shadow text-sm font-semibold">Close</a>
        </div>

    </div>
</div>
<?php $__env->stopSection(); ?>

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