<div class="row">
    <div class="col-12">
        <div class="card glass-card">
            <div class="card-header"><h5 class="card-title">Services 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>Service</th><th>Category</th><th class="text-center">Bookings</th><th class="text-end">Revenue</th><th class="text-end">Avg. Price</th></tr>
                        </thead>
                        <tbody>
                            <?php if (empty($data)): ?>
                            <tr><td colspan="5" 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->category_name ?? '-') ?></td>
                                    <td class="text-center"><?= $row->total_bookings ?></td>
                                    <td class="text-end"><?= currency($row->total_revenue) ?></td>
                                    <td class="text-end"><?= currency($row->avg_price) ?></td>
                                </tr>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
