<?php $__template->layout('Layout.main'); ?>
<?php $__template->section('title'); ?>الفرع: <?= e($branch->name_ar) ?><?php $__template->endSection(); ?>
<?php $__template->section('page_actions'); ?>
<a href="/branches/<?= (int) $branch->id ?>/edit" class="btn btn-outline">تعديل</a>
<?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:20px;">
    <div class="card" style="padding:20px;">
        <h3 style="margin-bottom:15px;color:#0D7377;">بيانات الفرع</h3>
        <table style="width:100%;font-size:14px;">
            <tr><td style="padding:8px 0;color:#6B7280;width:40%;">كود الفرع</td><td style="padding:8px 0;font-weight:600;"><?= e($branch->branch_code) ?></td></tr>
            <tr><td style="padding:8px 0;color:#6B7280;">الاسم بالعربي</td><td style="padding:8px 0;"><?= e($branch->name_ar) ?></td></tr>
            <tr><td style="padding:8px 0;color:#6B7280;">الاسم بالإنجليزي</td><td style="padding:8px 0;"><?= e($branch->name_en ?? '—') ?></td></tr>
            <tr><td style="padding:8px 0;color:#6B7280;">العنوان</td><td style="padding:8px 0;"><?= e($branch->address ?? '—') ?></td></tr>
            <tr><td style="padding:8px 0;color:#6B7280;">الهاتف</td><td style="padding:8px 0;"><?= e($branch->phone ?? '—') ?></td></tr>
            <tr><td style="padding:8px 0;color:#6B7280;">المدير</td><td style="padding:8px 0;"><?= e($branch->manager_name ?? '—') ?></td></tr>
            <tr><td style="padding:8px 0;color:#6B7280;">الحالة</td><td style="padding:8px 0;"><?= $branch->is_active ? '<span style="color:#059669;">● نشط</span>' : '<span style="color:#DC2626;">● معطل</span>' ?></td></tr>
        </table>
    </div>
    <div class="card" style="padding:20px;">
        <h3 style="margin-bottom:15px;color:#0D7377;">إحصائيات</h3>
        <div style="display:grid;grid-template-columns:1fr 1fr;gap:15px;">
            <div style="background:#F0FDF4;padding:15px;border-radius:8px;text-align:center;">
                <div style="font-size:28px;font-weight:700;color:#059669;"><?= $empCount ?></div>
                <div style="color:#6B7280;font-size:13px;">موظفون</div>
            </div>
            <div style="background:#EFF6FF;padding:15px;border-radius:8px;text-align:center;">
                <div style="font-size:28px;font-weight:700;color:#0284C7;"><?= $memCount ?></div>
                <div style="color:#6B7280;font-size:13px;">أعضاء</div>
            </div>
        </div>
    </div>
</div>
<?php $__template->endSection(); ?>