<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <?php
        $statusBadge = fn($s) => match($s) {
            'pending'     => 'bg-warning text-dark',
            'in_progress' => 'bg-primary',
            'completed'   => 'bg-success',
            'approved'    => 'bg-success',
            'rejected'    => 'bg-danger',
            default       => 'bg-secondary',
        };
    ?>

    <!-- Stat Cards -->
    <div class="row row-cols-1 row-cols-sm-2 row-cols-xl-4 g-4 mb-4">
        <div class="col">
            <div class="card shadow-sm border-0 h-100">
                <div class="card-body d-flex align-items-center justify-content-between">
                    <div>
                        <p class="text-muted small mb-1">My Open Requests</p>
                        <p class="fs-2 fw-bold mb-0"><?php echo e($myOpenRequests); ?></p>
                    </div>
                    <div class="p-3 bg-primary bg-opacity-10 rounded-3">
                        <i class="bi bi-file-earmark-text fs-4 text-primary"></i>
                    </div>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="card shadow-sm border-0 h-100">
                <div class="card-body d-flex align-items-center justify-content-between">
                    <div>
                        <p class="text-muted small mb-1">Pending My Approval</p>
                        <p class="fs-2 fw-bold mb-0"><?php echo e($pendingMyApproval); ?></p>
                    </div>
                    <div class="p-3 bg-warning bg-opacity-10 rounded-3">
                        <i class="bi bi-hourglass-split fs-4 text-warning"></i>
                    </div>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="card shadow-sm border-0 h-100">
                <div class="card-body d-flex align-items-center justify-content-between">
                    <div>
                        <p class="text-muted small mb-1">Completed This Month</p>
                        <p class="fs-2 fw-bold mb-0"><?php echo e($completedThisMonth); ?></p>
                    </div>
                    <div class="p-3 bg-success bg-opacity-10 rounded-3">
                        <i class="bi bi-check-circle fs-4 text-success"></i>
                    </div>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="card shadow-sm border-0 h-100">
                <div class="card-body d-flex align-items-center justify-content-between">
                    <div>
                        <p class="text-muted small mb-1">Rejected</p>
                        <p class="fs-2 fw-bold mb-0"><?php echo e($rejected); ?></p>
                    </div>
                    <div class="p-3 bg-danger bg-opacity-10 rounded-3">
                        <i class="bi bi-x-circle fs-4 text-danger"></i>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row g-4">
        <!-- Recent Activity -->
        <div class="col-lg-8">
            <div class="card shadow-sm border-0">
                <div class="card-header bg-white fw-semibold border-0 pt-4 pb-0 px-4">
                    Recent Activity
                </div>
                <div class="card-body px-4 pt-3">
                    <?php $__empty_1 = true; $__currentLoopData = $recentActivity; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $token): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <div class="d-flex align-items-center justify-content-between p-3 bg-light rounded-3 mb-2 hover-bg-white">
                            <div class="flex-grow-1 me-3 min-w-0">
                                <p class="fw-medium mb-0 text-truncate"><?php echo e($token->title); ?></p>
                                <p class="text-muted small mb-0 mt-1">
                                    <?php echo e($token->category->name); ?> &bull; <?php echo e($token->created_at->diffForHumans()); ?>

                                </p>
                            </div>
                            <div class="d-flex align-items-center gap-2 flex-shrink-0">
                                <span class="badge <?php echo e($statusBadge($token->status)); ?>">
                                    <?php echo e(ucfirst(str_replace('_', ' ', $token->status))); ?>

                                </span>
                                <a href="<?php echo e(route('tokens.show', $token)); ?>" class="btn btn-outline-primary btn-sm">View</a>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <p class="text-muted text-center py-4 mb-0">No recent activity</p>
                    <?php endif; ?>
                </div>
            </div>
        </div>

        <!-- Pending Approvals -->
        <div class="col-lg-4">
            <div class="card shadow-sm border-0">
                <div class="card-header bg-white fw-semibold border-0 pt-4 pb-0 px-4">
                    Pending Approvals
                </div>
                <div class="card-body px-4 pt-3">
                    <?php $__empty_1 = true; $__currentLoopData = $pendingApprovals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $token): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <a href="<?php echo e(route('tokens.show', $token)); ?>"
                           class="d-block p-3 bg-primary bg-opacity-10 border border-primary border-opacity-25 rounded-3 mb-2 text-decoration-none">
                            <p class="fw-medium text-dark mb-1 small text-truncate"><?php echo e(Str::limit($token->title, 35)); ?></p>
                            <p class="text-muted mb-1" style="font-size:.75rem">by <?php echo e($token->creator->name); ?></p>
                            <p class="text-primary mb-0" style="font-size:.75rem;font-weight:500"><?php echo e($token->created_at->format('M d, Y')); ?></p>
                        </a>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <p class="text-muted text-center py-4 mb-0 small">No pending approvals</p>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH C:\laragon\www\approval\resources\views/dashboard.blade.php ENDPATH**/ ?>