<?php $__env->startSection('title', 'Planes de suscripción'); ?>

<?php $__env->startSection('content'); ?>
<div class="page-head">
    <div>
        <h1>Planes de suscripción</h1>
        <div class="crumb"><a href="<?php echo e(route('admin.dashboard')); ?>">Panel</a> · Planes</div>
    </div>
    <a href="<?php echo e(route('admin.planes.create')); ?>" class="btn btn-primary"><i class="fa-solid fa-plus"></i> Nuevo plan</a>
</div>

<?php
    $estilos = [
        ['grad' => 'grad-cyan', 'icon' => 'fa-seedling'],
        ['grad' => 'grad-violet', 'icon' => 'fa-rocket'],
        ['grad' => 'grad-amber', 'icon' => 'fa-crown'],
        ['grad' => 'grad-teal', 'icon' => 'fa-gem'],
        ['grad' => 'grad-rose', 'icon' => 'fa-star'],
        ['grad' => 'grad-blue', 'icon' => 'fa-bolt'],
    ];
?>
<div class="plan-grid">
    <?php $__empty_1 = true; $__currentLoopData = $planes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $plan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <?php $e = $plan->destacado ? ['grad' => 'grad-violet', 'icon' => 'fa-rocket'] : $estilos[$loop->index % count($estilos)]; ?>
        <div class="plan-card <?php echo e($plan->destacado ? 'plan-featured' : ''); ?>">
            <div class="plan-top <?php echo e($e['grad']); ?>">
                <?php if($plan->destacado): ?><div class="plan-badge"><i class="fa-solid fa-star"></i> Más popular</div><?php endif; ?>
                <div class="plan-ic"><i class="fa-solid <?php echo e($e['icon']); ?>"></i></div>
                <div class="plan-name"><?php echo e($plan->nombre); ?></div>
                <div class="plan-price">S/ <?php echo e(number_format($plan->precio_mensual, 0)); ?><span>/mes</span></div>
                <div class="plan-anual">o S/ <?php echo e(number_format($plan->precio_anual, 0)); ?> al año · ahorra <?php echo e($plan->precio_mensual > 0 ? round((1 - $plan->precio_anual / ($plan->precio_mensual * 12)) * 100) : 0); ?>%</div>
            </div>
            <div class="plan-body">
                <p class="plan-desc"><?php echo e($plan->descripcion); ?></p>
                <ul class="plan-features">
                    <?php $__currentLoopData = $plan->lista_caracteristicas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $f): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li><i class="fa-solid fa-circle-check"></i> <?php echo e($f); ?></li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
                <div class="plan-meta">
                    <div class="chip"><i class="fa-solid fa-users"></i> <?php echo e($plan->limite_usuarios > 0 ? $plan->limite_usuarios : '∞'); ?> usuarios</div>
                    <div class="chip"><i class="fa-solid fa-clipboard-list"></i> <?php echo e($plan->limite_ordenes > 0 ? $plan->limite_ordenes : '∞'); ?> órdenes/mes</div>
                </div>
                <div class="plan-foot">
                    <span class="badge-pill b-primary"><i class="fa-solid fa-shop"></i> <?php echo e($plan->talleres_count); ?> talleres</span>
                    <div class="row-actions">
                        <a href="<?php echo e(route('admin.planes.edit', $plan)); ?>" class="ico-btn" title="Editar"><i class="fa-solid fa-pen"></i></a>
                        <form method="POST" action="<?php echo e(route('admin.planes.destroy', $plan)); ?>" onsubmit="return confirm('¿Eliminar el plan <?php echo e($plan->nombre); ?>?');">
                            <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                            <button type="submit" class="ico-btn ico-danger" title="Eliminar"><i class="fa-solid fa-trash"></i></button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <div class="panel" style="grid-column:1/-1;"><div class="placeholder-box">
            <div class="ph-icon"><i class="fa-solid fa-tags"></i></div>
            <h2>Aún no hay planes</h2>
            <p>Crea tu primer plan de suscripción para empezar a captar talleres.</p>
            <a href="<?php echo e(route('admin.planes.create')); ?>" class="btn btn-primary" style="margin-top:16px;">Crear plan</a>
        </div></div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\SAAS\saas_taller-automotriz\resources\views/admin/planes/index.blade.php ENDPATH**/ ?>