<div class="mx-auto max-w-7xl"><div class="mb-6"><h2 class="font-display text-2xl font-extrabold"><?= esc($heading) ?></h2><p class="mt-2 max-w-3xl text-sm leading-6 text-slate-500"><?= esc($intro) ?></p></div>
<div class="overflow-hidden rounded-2xl border border-slate-100 bg-white shadow-card"><?php if(!$rows): ?><div class="px-6 py-16 text-center"><span class="mx-auto grid h-12 w-12 place-items-center rounded-2xl bg-slate-50 text-slate-300"><i data-lucide="inbox" class="h-5 w-5"></i></span><h3 class="mt-4 font-display font-bold text-navy">Nothing to show yet</h3><p class="mx-auto mt-2 max-w-md text-sm text-slate-400">This module is ready and will populate as TibaLeta records are created.</p></div><?php else: $columns=array_slice(array_keys($rows[0]),0,7); ?><div class="overflow-x-auto"><table class="data-table w-full min-w-[760px]"><thead><tr class="border-b border-slate-100 bg-slate-50"><?php foreach($columns as $c): ?><th class="px-5 py-3 text-left"><?= esc(ucwords(str_replace('_',' ',$c))) ?></th><?php endforeach; ?></tr></thead><tbody><?php foreach($rows as $row): ?><tr class="border-b border-slate-50 hover:bg-slate-50/60"><?php foreach($columns as $c): $val=$row[$c] ?? ''; if(is_string($val) && strlen($val)>80)$val=substr($val,0,77).'…'; ?><td class="safe-wrap max-w-xs px-5 py-4"><?= esc((string)$val) ?></td><?php endforeach; ?></tr><?php endforeach; ?></tbody></table></div><?php endif; ?></div></div>
