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

<?php $__env->startSection('content'); ?>
    <div class="page-heading">
        <div><span class="eyebrow">CENTRO OPERACIONAL</span><h1>Bom trabalho, <?php echo e(explode(' ', auth()->user()->name)[0]); ?>.</h1><p><?php echo e($activeBranch?->name ?? 'Visão consolidada de todas as filiais'); ?> · <?php echo e(now()->translatedFormat('l, d \d\e F \d\e Y')); ?></p></div>
        <span class="phase-pill"><i></i> Fase 1 · Fundação</span>
    </div>

    <section class="metric-grid">
        <?php $__currentLoopData = [
            ['filiais', 'Filiais activas', 'Rede organizacional', 'orange'],
            ['departamentos', 'Departamentos', 'Estrutura aprovada', 'blue'],
            ['utilizadores', 'Utilizadores activos', 'Com acesso ao sistema', 'green'],
            ['perfis', 'Perfis de acesso', 'Controlo granular', 'violet'],
        ]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as [$key, $label, $detail, $colour]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <article class="metric-card <?php echo e($colour); ?>"><div class="metric-top"><span><?php echo e($label); ?></span><i></i></div><strong><?php echo e(number_format($metrics[$key], 0, ',', '.')); ?></strong><small><?php echo e($detail); ?></small></article>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </section>

    <div class="dashboard-grid">
        <section class="panel">
            <div class="panel-heading"><div><span class="eyebrow">ESTADO DO PROJECTO</span><h2>Construção modular</h2></div><span class="status-badge active">Em execução</span></div>
            <div class="phase-list">
                <?php $__currentLoopData = [
                    ['Fundação', 36, 'Organização, acessos, auditoria e dados-base'],
                    ['Operação comercial e cliente', 0, 'Leads, clientes, contratos e tickets'],
                    ['Operação técnica e inventário', 0, 'Agenda, GPS, SIM e stock'],
                    ['Financeiro e cobrança', 0, 'Renovações, pagamentos e cobrança'],
                ]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => [$name, $progress, $detail]): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="phase-row"><span class="phase-number"><?php echo e(str_pad($index + 1, 2, '0', STR_PAD_LEFT)); ?></span><div class="phase-content"><div><strong><?php echo e($name); ?></strong><small><?php echo e($detail); ?></small></div><span><?php echo e($progress); ?>%</span><div class="progress"><i style="width: <?php echo e($progress); ?>%"></i></div></div></div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </section>

        <section class="panel">
            <div class="panel-heading"><div><span class="eyebrow">AUDITORIA</span><h2>Actividade recente</h2></div><?php if(auth()->user()->hasPermission('audit.view')): ?><a href="<?php echo e(route('foundation')); ?>#auditoria">Ver estrutura</a><?php endif; ?></div>
            <div class="activity-list">
                <?php $__empty_1 = true; $__currentLoopData = $recentActivity; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <div class="activity-item"><span class="activity-dot"></span><div><strong><?php echo e($activity->description); ?></strong><small><?php echo e($activity->actor?->name ?? 'Sistema'); ?> · <?php echo e($activity->created_at?->diffForHumans()); ?></small></div></div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <div class="empty-state">A actividade começará a aparecer aqui.</div>
                <?php endif; ?>
            </div>
        </section>
    </div>
<?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/dashboard.blade.php ENDPATH**/ ?>