<?php
require_once __DIR__ . '/_admin.php';
$pdo = pdoOrFail();
$counts = [];
foreach (['contact_leads','branches','blog_posts','services'] as $table) {
    $counts[$table] = (int)$pdo->query("SELECT COUNT(*) FROM {$table}")->fetchColumn();
}
adminHeader('Dashboard');
?>
<div class="admin-grid">
<?php foreach ($counts as $label => $count): ?><div class="admin-card"><span><?= e(str_replace('_', ' ', $label)) ?></span><strong><?= e((string)$count) ?></strong></div><?php endforeach; ?>
</div>
<div class="admin-card"><h2>Hizli durum</h2><p>Lead formlari MySQLe kaydedilir. Sube, hizmet ve blog icerikleri buradan duzenlenebilir; cPanele tasimada ayni dosya yapisi korunabilir.</p></div>
<?php adminFooter(); ?>
