<?php $__template->layout('Layout.print'); ?>
<?php $__template->section('title'); ?><?= e($definition['name_ar']) ?><?php $__template->endSection(); ?>
<?php $__template->section('content'); ?>
<h2 style="text-align:center;color:#1e3a5f;margin-bottom:5px;"><?= e($definition['name_ar']) ?></h2>
<p style="text-align:center;color:#6B7280;margin-bottom:20px;font-size:12px;">تاريخ الطباعة: <?= e(date('Y-m-d H:i')) ?> — إجمالي: <?= (int) ($data['total'] ?? 0) ?> سجل</p>
<table style="width:100%;border-collapse:collapse;font-size:12px;">
    <thead><tr style="background:#1e3a5f;color:#fff;"><?php foreach (($data['columns'] ?? []) as $label): ?><th style="padding:8px 6px;text-align:right;border:1px solid #ccc;"><?= e($label) ?></th><?php endforeach; ?></tr></thead>
    <tbody><?php foreach (($data['rows'] ?? []) as $i => $row): ?><tr style="background:<?= $i % 2 ? '#F9FAFB' : '#fff' ?>;"><?php foreach (array_keys($data['columns'] ?? []) as $key): ?><td style="padding:6px;border:1px solid #E5E7EB;"><?= e((string) ($row[$key] ?? '')) ?></td><?php endforeach; ?></tr><?php endforeach; ?></tbody>
</table>
<?php $__template->endSection(); ?>