<?php $__env->startSection('title', 'Admin - Activity Log'); ?>
<?php $__env->startSection('breadcrumb'); ?>
    <a href="<?php echo e(route('admin.index')); ?>">Admin</a>
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="width:14px;height:14px;"><polyline points="9 18 15 12 9 6"></polyline></svg>
    <span style="font-weight:600;color:var(--text-primary);">Activity Log</span>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="page-header">
        <h1>📋 Activity Log</h1>
    </div>

    
    <div class="card mb-4">
        <div class="card-body" style="padding:16px 20px;">
            <form method="GET" style="display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;">
                <div class="form-group" style="min-width:160px;">
                    <label class="form-label text-xs">User</label>
                    <select name="user" class="form-control">
                        <option value="">All Users</option>
                        <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($user->id); ?>" <?php echo e(request('user') == $user->id ? 'selected' : ''); ?>><?php echo e($user->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                <div class="form-group" style="min-width:140px;">
                    <label class="form-label text-xs">Action</label>
                    <select name="action" class="form-control">
                        <option value="">All Actions</option>
                        <?php $__currentLoopData = $actionTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $action): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($action); ?>" <?php echo e(request('action') == $action ? 'selected' : ''); ?>><?php echo e(ucfirst(str_replace('_', ' ', $action))); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                <div class="form-group" style="min-width:140px;">
                    <label class="form-label text-xs">From</label>
                    <input type="date" name="from" class="form-control" value="<?php echo e(request('from')); ?>">
                </div>
                <div class="form-group" style="min-width:140px;">
                    <label class="form-label text-xs">To</label>
                    <input type="date" name="to" class="form-control" value="<?php echo e(request('to')); ?>">
                </div>
                <button type="submit" class="btn btn-primary btn-sm">Filter</button>
                <a href="<?php echo e(route('admin.activity-log')); ?>" class="btn btn-ghost btn-sm">Clear</a>
            </form>
        </div>
    </div>

    
    <div class="card">
        <div class="card-header">
            <h3 class="card-header-title">Events</h3>
            <span class="badge badge-secondary"><?php echo e($activities->total()); ?> total</span>
        </div>
        <div class="card-body" style="padding:20px 24px;">
            <?php if($activities->count()): ?>
            <div class="activity-timeline">
                <?php $__currentLoopData = $activities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="activity-timeline-item">
                        <div class="activity-timeline-connector">
                            <div class="activity-timeline-dot" style="background:<?php echo e($activity->color); ?>1a;color:<?php echo e($activity->color); ?>;border-color:<?php echo e($activity->color); ?>33;">
                                <?php echo $activity->svg_icon; ?>

                            </div>
                            <?php if(!$loop->last): ?>
                                <div class="activity-timeline-line"></div>
                            <?php endif; ?>
                        </div>
                        <div class="activity-timeline-content">
                            <div class="activity-timeline-text">
                                <strong><?php echo e($activity->causer->name ?? 'System'); ?></strong>
                                <span><?php echo e($activity->description); ?></span>
                            </div>
                            <div class="activity-timeline-meta">
                                <span class="activity-timeline-badge" style="background:<?php echo e($activity->color); ?>1a;color:<?php echo e($activity->color); ?>;"><?php echo e(ucfirst(str_replace('_', ' ', $activity->action))); ?></span>
                                <span class="activity-timeline-time"><?php echo e($activity->created_at->format('M j, Y H:i')); ?></span>
                            </div>
                        </div>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
            <?php else: ?>
                <div class="empty-state">
                    <div class="empty-state-icon">
                        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg>
                    </div>
                    <div class="empty-state-title">No activity found</div>
                    <div class="empty-state-text">Try adjusting your filters.</div>
                </div>
            <?php endif; ?>
        </div>
    </div>
    <?php if($activities->hasPages()): ?>
        <div class="pagination"><?php echo e($activities->withQueryString()->links()); ?></div>
    <?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Applications/XAMPP/xamppfiles/htdocs/asana/resources/views/admin/activity-log.blade.php ENDPATH**/ ?>