

<?php $__env->startSection('title', __('Companies')); ?>

<?php $__env->startSection('content'); ?>
    <div class="d-flex justify-content-between align-items-center mb-4">
        <div>
            <h4 class="mb-0"><?php echo e(__('Companies')); ?></h4>
            <nav aria-label="breadcrumb">
                <ol class="breadcrumb mb-0">
                    <li class="breadcrumb-item"><a href="<?php echo e(url('/')); ?>"><?php echo e(__('Dashboard')); ?></a></li>
                    <li class="breadcrumb-item active"><?php echo e(__('Companies')); ?></li>
                </ol>
            </nav>
        </div>
        <a href="<?php echo e(route('companies.create')); ?>" class="btn btn-primary px-4">
            <i class="bi bi-plus-lg me-2"></i> <?php echo e(__('Add Company')); ?>

        </a>
    </div>

    <!-- Quick Stats -->
    <div class="row g-4 mb-4">
        <div class="col-md-4">
            <div class="card border-0 shadow-sm p-4">
                <div class="d-flex align-items-center gap-3">
                    <div class="stat-icon bg-primary-subtle text-primary rounded-3 d-flex align-items-center justify-content-center" style="width: 48px; height: 48px;">
                        <i class="bi bi-buildings fs-4"></i>
                    </div>
                    <div>
                        <h6 class="text-muted mb-0 small"><?php echo e(__('Total Companies')); ?></h6>
                        <h4 class="mb-0 fw-bold"><?php echo e($companies->total()); ?></h4>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card border-0 shadow-sm p-4">
                <div class="d-flex align-items-center gap-3">
                    <div class="stat-icon bg-success-subtle text-success rounded-3 d-flex align-items-center justify-content-center" style="width: 48px; height: 48px;">
                        <i class="bi bi-building-check fs-4"></i>
                    </div>
                    <div>
                        <h6 class="text-muted mb-0 small"><?php echo e(__('Active Entities')); ?></h6>
                        <h4 class="mb-0 fw-bold"><?php echo e($companies->where('status', 'active')->count()); ?></h4>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card border-0 shadow-sm p-4">
                <div class="d-flex align-items-center gap-3">
                    <div class="stat-icon bg-info-subtle text-info rounded-3 d-flex align-items-center justify-content-center" style="width: 48px; height: 48px;">
                        <i class="bi bi-geo-alt fs-4"></i>
                    </div>
                    <div>
                        <h6 class="text-muted mb-0 small"><?php echo e(__('Involved Nodes')); ?></h6>
                        <h4 class="mb-0 fw-bold">384+</h4>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="card border-0 shadow-sm">
        <div class="card-body p-0">
            <div class="table-responsive">
                <table class="table table-hover align-middle mb-0">
                    <thead class="bg-light">
                        <tr>
                            <th class="ps-4"><?php echo e(__('Company Name')); ?></th>
                            <th><?php echo e(__('Address')); ?></th>
                            <th><?php echo e(__('VAT Number')); ?></th>
                            <th><?php echo e(__('Status')); ?></th>
                            <th class="text-end pe-4"><?php echo e(__('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>
                                <td class="ps-4">
                                    <div class="d-flex align-items-center gap-3">
                                        <div class="avatar bg-primary-subtle text-primary rounded d-flex align-items-center justify-content-center"
                                            style="width: 40px; height: 40px;">
                                            <?php echo e(substr($company->name, 0, 1)); ?>

                                        </div>
                                        <span class="fw-semibold"><?php echo e($company->name); ?></span>
                                    </div>
                                </td>
                                <td><?php echo e($company->address ?? '-'); ?></td>
                                <td><?php echo e($company->vat_number ?? '-'); ?></td>
                                <td>
                                    <?php if($company->status == 'active'): ?>
                                        <span
                                            class="badge bg-success-subtle text-success border border-success-subtle"><?php echo e(__('Active')); ?></span>
                                    <?php else: ?>
                                        <span
                                            class="badge bg-secondary-subtle text-secondary border border-secondary-subtle"><?php echo e(__('Inactive')); ?></span>
                                    <?php endif; ?>
                                </td>
                                <td class="text-end pe-4">
                                    <div class="dropdown">
                                        <button class="btn btn-light btn-sm rounded-circle" data-bs-toggle="dropdown">
                                            <i class="bi bi-three-dots-vertical"></i>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-end shadow-sm border-0">
                                            <li><a class="dropdown-item" href="<?php echo e(route('companies.edit', $company->id)); ?>"><i
                                                        class="bi bi-pencil me-2"></i> <?php echo e(__('Edit')); ?></a></li>
                                            <li><a class="dropdown-item" href="<?php echo e(route('companies.show', $company->id)); ?>"><i
                                                        class="bi bi-eye me-2"></i> <?php echo e(__('View')); ?></a></li>
                                            <li>
                                                <hr class="dropdown-divider">
                                            </li>
                                            <li>
                                                <form action="<?php echo e(route('companies.destroy', $company->id)); ?>" method="POST"
                                                    onsubmit="return confirm('<?php echo e(__('Are you sure?')); ?>')">
                                                    <?php echo csrf_field(); ?>
                                                    <?php echo method_field('DELETE'); ?>
                                                    <button type="submit" class="dropdown-item text-danger"><i
                                                            class="bi bi-trash me-2"></i> <?php echo e(__('Delete')); ?></button>
                                                </form>
                                            </li>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="5" class="text-center py-5 text-muted"><?php echo e(__('No companies found.')); ?></td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
        <?php if($companies->hasPages()): ?>
            <div class="card-footer bg-transparent border-top-0">
                <?php echo e($companies->links()); ?>

            </div>
        <?php endif; ?>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\laragon\www\production\resources\views/companies/index.blade.php ENDPATH**/ ?>