<?php $__env->startSection('title', 'Assinaturas'); ?>
<?php $__env->startSection('page-title', 'Assinaturas'); ?>
<?php $__env->startSection('content'); ?>
    <p class="mb-4 text-sm text-slate-600">Past due: <strong><?php echo e($pastDueCount); ?></strong></p>
    <div class="overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-sm">
        <table class="min-w-full text-left text-sm">
            <thead class="bg-slate-50 text-xs uppercase tracking-wide text-slate-500">
                <tr>
                    <th class="px-4 py-3">Cliente</th>
                    <th class="px-4 py-3">Plano</th>
                    <th class="px-4 py-3">Preço mensal</th>
                    <th class="px-4 py-3">Status</th>
                    <th class="px-4 py-3">Ciclo</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $subscriptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sub): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php
                        $monthly = (int) ($sub->plan?->price_monthly_cents ?? 0);
                        if (($sub->billing_cycle?->value ?? $sub->billing_cycle) === 'yearly') {
                            $monthly = (int) round(((int) ($sub->plan?->price_yearly_cents ?? 0)) / 12);
                        }
                    ?>
                    <tr class="border-t border-slate-100">
                        <td class="px-4 py-3"><?php echo e($sub->tenant?->name ?? $sub->tenant_id); ?></td>
                        <td class="px-4 py-3"><?php echo e($sub->plan?->name); ?></td>
                        <td class="px-4 py-3">R$ <?php echo e(number_format($monthly / 100, 2, ',', '.')); ?></td>
                        <td class="px-4 py-3"><?php echo e($sub->status?->label() ?? $sub->status); ?></td>
                        <td class="px-4 py-3"><?php echo e($sub->billing_cycle?->value ?? $sub->billing_cycle); ?></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>
    <div class="mt-4"><?php echo e($subscriptions->links()); ?></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.superadmin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/backend/resources/views/super-admin/billing/subscriptions.blade.php ENDPATH**/ ?>