<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>سجل نشاط: <?= e($employee->full_name_ar) ?><?php $__template->endSection(); ?>
<?php $__template->section('page_actions'); ?>
<a href="/users/<?= (int) $employee->id ?>" class="btn btn-outline">← عودة للملف</a>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div class="card">
    <div class="table-responsive">
        <table class="data-table">
            <thead>
                <tr>
                    <th>التاريخ</th>
                    <th>IP</th>
                    <th>النتيجة</th>
                    <th>السبب</th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($attempts as $a): ?>
                <tr>
                    <td style="font-size:13px;"><?= e($a['attempted_at']) ?></td>
                    <td style="direction:ltr;text-align:right;"><?= e($a['ip_address']) ?></td>
                    <td>
                        <?php if ($a['success']): ?>
                            <span style="color:#059669;font-weight:600;">نجح</span>
                        <?php else: ?>
                            <span style="color:#DC2626;font-weight:600;">فشل</span>
                        <?php endif; ?>
                    </td>
                    <td style="color:#6B7280;"><?= e($a['failure_reason'] ?? '—') ?></td>
                </tr>
                <?php endforeach; ?>
                <?php if (empty($attempts)): ?>
                <tr><td colspan="4" style="text-align:center;padding:40px;color:#6B7280;">لا يوجد سجل</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>
<?php $__template->endSection(); ?>