
<?php $__env->startSection('title', 'Activity Log'); ?>
<?php $__env->startSection('breadcrumb'); ?>
    <span class="current">Activity Log</span>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="page-header">
    <h1 class="page-title">
        <span class="title-icon"><i data-lucide="activity" style="width:20px;height:20px;"></i></span>
        Activity Log
    </h1>
    <p class="page-subtitle">System-wide audit trail of administrative actions</p>
</div>

<div class="admin-table-wrap">
    <div class="admin-table-header">
        <div class="admin-table-title">
            <i data-lucide="activity" class="icon" style="width:14px;height:14px;"></i>
            Recent Activity
        </div>
        <form method="GET" style="display:flex;gap:8px;">
            <select name="action" class="form-control" style="width:140px;">
                <option value="">All Actions</option>
                <option value="login" <?php echo e(request('action') === 'login' ? 'selected' : ''); ?>>Login</option>
                <option value="logout" <?php echo e(request('action') === 'logout' ? 'selected' : ''); ?>>Logout</option>
                <option value="create" <?php echo e(request('action') === 'create' ? 'selected' : ''); ?>>Create</option>
                <option value="update" <?php echo e(request('action') === 'update' ? 'selected' : ''); ?>>Update</option>
                <option value="delete" <?php echo e(request('action') === 'delete' ? 'selected' : ''); ?>>Delete</option>
            </select>
            <button type="submit" class="btn btn-secondary btn-sm">
                <i data-lucide="filter" style="width:12px;height:12px;"></i>
            </button>
        </form>
    </div>
    <div class="table-responsive">
        <table class="admin-table">
            <thead>
                <tr>
                    <th>Time</th>
                    <th>User</th>
                    <th>Action</th>
                    <th>Subject</th>
                    <th>Description</th>
                    <th>IP Address</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; ?>
                    <?php
                        $actionColors = [
                            'login'  => 'badge-green',  'logout' => 'badge-gray',
                            'create' => 'badge-blue',   'update' => 'badge-orange',
                            'delete' => 'badge-red',    'view'   => 'badge-teal',
                        ];
                        $actionIcons = [
                            'login'  => 'log-in',   'logout' => 'log-out',
                            'create' => 'plus',     'update' => 'pencil',
                            'delete' => 'trash-2',  'view'   => 'eye',
                        ];
                    ?>
                    <tr>
                        <td style="font-size:11px;color:var(--vsc-text-secondary);white-space:nowrap;">
                            <?php echo e($log->created_at->format('d M Y H:i')); ?>

                        </td>
                        <td>
                            <div style="display:flex;align-items:center;gap:8px;">
                                <div class="avatar avatar-sm avatar-blue">
                                    <?php echo e(strtoupper(substr($log->user?->name ?? 'S', 0, 1))); ?>

                                </div>
                                <span style="font-size:12px;color:var(--vsc-text-primary);"><?php echo e($log->user?->name ?? 'System'); ?></span>
                            </div>
                        </td>
                        <td>
                            <span class="badge <?php echo e($actionColors[$log->action] ?? 'badge-gray'); ?>">
                                <i data-lucide="<?php echo e($actionIcons[$log->action] ?? 'zap'); ?>" style="width:9px;height:9px;"></i>
                                <?php echo e(ucfirst($log->action)); ?>

                            </span>
                        </td>
                        <td style="font-size:12px;color:var(--vsc-text-secondary);"><?php echo e($log->subject_type ?? '—'); ?></td>
                        <td style="font-size:12px;color:var(--vsc-text-primary);max-width:280px;">
                            <?php echo e(Str::limit($log->description, 60)); ?>

                        </td>
                        <td style="font-size:11px;font-family:monospace;color:var(--vsc-text-secondary);"><?php echo e($log->ip_address ?? '—'); ?></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="6" style="text-align:center;padding:48px;color:var(--vsc-text-secondary);">
                            <i data-lucide="activity" style="width:32px;height:32px;display:block;margin:0 auto 12px;opacity:0.3;"></i>
                            No activity recorded yet
                        </td>
                    </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <?php if(isset($logs) && method_exists($logs, 'links') && $logs->hasPages()): ?>
        <?php echo e($logs->links('vendor.pagination.admin')); ?>

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

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp_lite_8_4\www\landfeasibility\resources\views/admin/activity-log.blade.php ENDPATH**/ ?>