<?php include 'views/layout/header.php'; ?>

<h1 style="margin-bottom: 24px;">Dashboard Overview</h1>

<div class="grid">
    <div class="stat-card">
        <div class="stat-title">Total Medicines</div>
        <div class="stat-value" style="color: var(--primary);">
            <?php
            // Example static fetch for MVP, ideal to pass from Controller
            $db = Database::getConnection();
            $stmt = $db->prepare('SELECT COUNT(*) FROM medicines WHERE tenant_id = ?');
            $stmt->execute([$_SESSION['tenant_id']]);
            echo $stmt->fetchColumn();
            ?>
        </div>
    </div>
    
    <div class="stat-card">
        <div class="stat-title">Total Stock Entries</div>
        <div class="stat-value" style="color: var(--secondary);">
            <?php
            $stmt = $db->prepare('SELECT COUNT(*) FROM stock_entries WHERE tenant_id = ?');
            $stmt->execute([$_SESSION['tenant_id']]);
            echo $stmt->fetchColumn();
            ?>
        </div>
    </div>
    
    <div class="stat-card">
        <div class="stat-title">Low Stock Alerts</div>
        <div class="stat-value" style="color: var(--warning);">0</div>
    </div>

    <div class="stat-card">
        <div class="stat-title">Expiring Soon</div>
        <div class="stat-value" style="color: var(--danger);">0</div>
    </div>
</div>

<div class="stat-card" style="margin-bottom: 32px;">
    <h3 style="margin-bottom: 16px;">Recent Activity</h3>
    <p style="color: var(--text-muted);">No recent activity found.</p>
</div>

<?php include 'views/layout/footer.php'; ?>
