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

<?php $__env->startSection('content'); ?>
    <section class="card">
        <div class="page-header">
            <p class="eyebrow">Audit Trail</p>
            <h1>Everything important is logged</h1>
            <p class="muted">Authentication, website changes, backups, and agent sync activity land here for accountability.</p>
        </div>

        <form method="get" class="form-grid" style="grid-template-columns: 1fr 2fr auto;">
            <label>
                <span>Category</span>
                <select class="field" name="category">
                    <option value="">All categories</option>
                    <?php $__currentLoopData = ['auth', 'website', 'backup', 'agent', 'settings', 'database']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($category); ?>" <?php if(($filters['category'] ?? '') === $category): echo 'selected'; endif; ?>><?php echo e(str($category)->headline()); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </label>

            <label>
                <span>Search</span>
                <input class="field" type="search" name="search" value="<?php echo e($filters['search'] ?? ''); ?>" placeholder="Action, description, website">
            </label>

            <div style="display: flex; align-items: end;">
                <button class="button secondary" type="submit">Filter</button>
            </div>
        </form>
    </section>

    <section class="card">
        <div class="table-wrap">
            <table>
                <thead>
                    <tr>
                        <th>User</th>
                        <th>Action</th>
                        <th>Website</th>
                        <th>IP</th>
                        <th>Timestamp</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $logs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($log->user?->name ?? 'System'); ?></td>
                            <td>
                                <strong><?php echo e(str($log->action)->headline()); ?></strong>
                                <div class="muted"><?php echo e($log->description); ?></div>
                            </td>
                            <td><?php echo e($log->website?->name ?? 'System'); ?></td>
                            <td><?php echo e($log->ip_address ?? 'N/A'); ?></td>
                            <td><?php echo e($log->occurred_at->format('M d, Y H:i')); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="5" class="muted">No activity found.</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>

        <?php echo e($logs->links()); ?>

    </section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.panel', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\contol\resources\views/activity-logs/index.blade.php ENDPATH**/ ?>