<div class="row">
    <div class="col-12">
        <div class="card glass-card">
            <div class="card-header"><h5 class="card-title">Marketing Report</h5></div>
            <div class="card-body">
                <?php $this->include('Reports/partials/filter_date') ?>
                <div class="table-responsive mt-3">
                    <table class="table table-hover">
                        <thead>
                            <tr><th>Campaign</th><th>Type</th><th class="text-center">Sent</th><th class="text-center">Opened</th><th class="text-center">Clicked</th><th class="text-center">Conv.</th></tr>
                        </thead>
                        <tbody>
                            <?php if (empty($data)): ?>
                            <tr><td colspan="6" class="text-center py-4 text-muted">No data available.</td></tr>
                            <?php else: ?>
                                <?php foreach ($data as $row): ?>
                                <tr>
                                    <td><?= e($row->name) ?></td>
                                    <td><?= e($row->type) ?></td>
                                    <td class="text-center"><?= $row->sent_count ?></td>
                                    <td class="text-center"><?= $row->opened_count ?></td>
                                    <td class="text-center"><?= $row->clicked_count ?></td>
                                    <td class="text-center"><?= $row->conversion_rate ?>%</td>
                                </tr>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
