<?php $__env->startSection('title', 'Filiais'); ?>
<?php $__env->startSection('content'); ?>
    <div class="page-heading"><div><span class="eyebrow">ADMINISTRAÇÃO · ORGANIZAÇÃO</span><h1>Filiais</h1><p>Gestão da sede, unidades existentes e expansão nacional.</p></div><a class="primary-link" href="<?php echo e(route('admin.branches.create')); ?>">+ Nova filial</a></div>
    <section class="panel"><div class="table-wrap"><table class="management-table"><thead><tr><th>Unidade</th><th>Código</th><th>Localização</th><th>Hierarquia</th><th>Estado</th><th></th></tr></thead><tbody>
        <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><tr class="<?php echo e($branch->trashed() ? 'archived-row' : ''); ?>"><td><strong><?php echo e($branch->name); ?></strong><small><?php echo e($branch->email ?: 'Sem email registado'); ?></small></td><td><code><?php echo e($branch->code); ?></code></td><td><?php echo e($branch->province); ?> · <?php echo e($branch->municipality); ?></td><td><?php echo e($branch->is_headquarters ? 'Sede principal' : ($branch->parent?->name ?? 'Filial')); ?></td><td><span class="status-badge <?php echo e(!$branch->trashed() && $branch->is_active ? 'active' : ''); ?>"><?php echo e($branch->trashed() ? 'Arquivada' : ($branch->is_active ? 'Activa' : 'Inactiva')); ?></span></td><td class="row-actions"><?php if (! ($branch->trashed())): ?><a href="<?php echo e(route('admin.branches.edit', $branch)); ?>">Editar</a><form method="POST" action="<?php echo e(route('admin.branches.destroy', $branch)); ?>" data-confirm="Arquivar esta filial? O histórico será preservado."><?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?><button type="submit">Arquivar</button></form><?php endif; ?></td></tr><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </tbody></table></div></section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\Joe B\.codex\.chatgpt-projects\g-p-6a6ce038586481919be04257dc687fef\nestab-ops\resources\views/admin/branches/index.blade.php ENDPATH**/ ?>