<div class="stat-grid">
    <a class="stat-card" href="<?= e(url('admin/kategoriler')) ?>">
        <span class="stat-ic">☰</span>
        <span class="stat-num"><?= (int)$stats['categories'] ?></span>
        <span class="stat-label">Kategori</span>
    </a>
    <a class="stat-card" href="<?= e(url('admin/urunler')) ?>">
        <span class="stat-ic">🍽</span>
        <span class="stat-num"><?= (int)$stats['products'] ?></span>
        <span class="stat-label">Ürün</span>
    </a>
    <a class="stat-card" href="<?= e(url('admin/etkinlikler')) ?>">
        <span class="stat-ic">★</span>
        <span class="stat-num"><?= (int)$stats['events'] ?></span>
        <span class="stat-label">Etkinlik</span>
    </a>
    <div class="stat-card">
        <span class="stat-ic">✨</span>
        <span class="stat-num"><?= (int)$stats['featured'] ?></span>
        <span class="stat-label">Öne Çıkan</span>
    </div>
</div>

<div class="quick-actions">
    <a class="btn-primary" href="<?= e(url('admin/urun/ekle')) ?>">+ Ürün Ekle</a>
    <a class="btn-ghost" href="<?= e(url('admin/kategori/ekle')) ?>">+ Kategori Ekle</a>
    <a class="btn-ghost" href="<?= e(url('admin/etkinlik/ekle')) ?>">+ Etkinlik Ekle</a>
    <a class="btn-ghost" href="<?= e(url('admin/ayarlar')) ?>">⚙ Tema & Ayarlar</a>
</div>

<div class="panel">
    <div class="panel-head"><h2>Son Eklenen Ürünler</h2></div>
    <div class="table-scroll">
    <table class="data-table">
        <thead><tr><th>Ürün</th><th>Kategori</th><th>Fiyat</th><th>Kalori</th><th></th></tr></thead>
        <tbody>
        <?php foreach ($recent as $r): ?>
            <tr>
                <td><?= e($r['name']) ?></td>
                <td><?= e($r['category_name'] ?? '—') ?></td>
                <td><?= e(money($r['price'], setting('currency','₺'))) ?></td>
                <td><?= $r['calories'] ? (int)$r['calories'].' kcal' : '—' ?></td>
                <td><a class="mini-btn" href="<?= e(url('admin/urun/duzenle/'.$r['id'])) ?>">Düzenle</a></td>
            </tr>
        <?php endforeach; ?>
        <?php if (empty($recent)): ?><tr><td colspan="5" class="muted">Henüz ürün yok.</td></tr><?php endif; ?>
        </tbody>
    </table>
    </div>
</div>
