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

<?php $__env->startSection('content'); ?>
    <div class="row g-4">
        <div class="col-sm-6 col-xl-4">
            <div class="stat-card">
                <div class="stat-icon bg-primary-subtle text-primary"><i class="bi bi-grid-1x2"></i></div>
                <div>
                    <div class="stat-value"><?php echo e($stats['services']); ?></div>
                    <div class="stat-label">Services</div>
                </div>
            </div>
        </div>
        <div class="col-sm-6 col-xl-4">
            <div class="stat-card">
                <div class="stat-icon bg-success-subtle text-success"><i class="bi bi-building"></i></div>
                <div>
                    <div class="stat-value"><?php echo e($stats['projects']); ?></div>
                    <div class="stat-label">Projects</div>
                </div>
            </div>
        </div>
        <div class="col-sm-6 col-xl-4">
            <div class="stat-card">
                <div class="stat-icon bg-info-subtle text-info"><i class="bi bi-people"></i></div>
                <div>
                    <div class="stat-value"><?php echo e($stats['clients']); ?></div>
                    <div class="stat-label">Clients</div>
                </div>
            </div>
        </div>
        <div class="col-sm-6 col-xl-4">
            <div class="stat-card">
                <div class="stat-icon bg-warning-subtle text-warning"><i class="bi bi-award"></i></div>
                <div>
                    <div class="stat-value"><?php echo e($stats['certifications']); ?></div>
                    <div class="stat-label">Certifications</div>
                </div>
            </div>
        </div>
        <div class="col-sm-6 col-xl-4">
            <div class="stat-card">
                <div class="stat-icon bg-secondary-subtle text-secondary"><i class="bi bi-download"></i></div>
                <div>
                    <div class="stat-value"><?php echo e($stats['downloads']); ?></div>
                    <div class="stat-label">Downloads</div>
                </div>
            </div>
        </div>
        <div class="col-sm-6 col-xl-4">
            <a href="<?php echo e(route('admin.messages.index')); ?>" class="text-decoration-none">
                <div class="stat-card">
                    <div class="stat-icon <?php echo e($stats['unreadMessages'] > 0 ? 'bg-danger-subtle text-danger' : 'bg-secondary-subtle text-secondary'); ?>"><i class="bi bi-envelope"></i></div>
                    <div>
                        <div class="stat-value"><?php echo e($stats['unreadMessages']); ?><span class="fs-6 text-muted">/<?php echo e($stats['totalMessages']); ?></span></div>
                        <div class="stat-label">Unread Messages</div>
                    </div>
                </div>
            </a>
        </div>
    </div>

    <div class="card mt-4">
        <div class="card-header bg-white">
            <h6 class="mb-0"><i class="bi bi-clock-history me-2"></i>Recent Contact Messages</h6>
        </div>
        <div class="card-body p-0">
            <table class="table table-hover align-middle mb-0">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Email</th>
                        <th>Subject</th>
                        <th>Date</th>
                        <th>Status</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $recentMessages; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $message): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td class="fw-semibold"><?php echo e($message->name); ?></td>
                            <td><?php echo e($message->email); ?></td>
                            <td><?php echo e(Str::limit($message->subject ?: '—', 30)); ?></td>
                            <td><?php echo e($message->created_at->diffForHumans()); ?></td>
                            <td>
                                <?php if($message->is_read): ?>
                                    <span class="badge bg-secondary">Read</span>
                                <?php else: ?>
                                    <span class="badge bg-danger">Unread</span>
                                <?php endif; ?>
                            </td>
                            <td><a href="<?php echo e(route('admin.messages.show', $message)); ?>" class="btn btn-sm btn-outline-primary">View</a></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="6" class="text-center text-muted py-4">No contact messages yet.</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
<?php $__env->stopSection(); ?>

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