<div class="row">
    <div class="col-lg-8">
        <div class="card glass-card">
            <div class="card-header"><h5 class="card-title">Add Loyalty Points</h5></div>
            <div class="card-body">
                <form method="POST" action="<?= url('loyalty/loyalty/store') ?>" class="needs-validation" novalidate>
                    <?= csrf_field() ?>
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Customer <span class="text-danger">*</span></label>
                            <select name="customer_id" class="form-select select2" required>
                                <option value="">Select Customer</option>
                                <?php foreach ($customers as $c): ?>
                                    <option value="<?= $c->id ?>"><?= e($c->first_name . ' ' . $c->last_name) ?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Points <span class="text-danger">*</span></label>
                            <input type="number" name="points" class="form-control" required min="1">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Type</label>
                            <select name="type" class="form-select">
                                <option value="earned">Earned</option>
                                <option value="redeemed">Redeemed</option>
                                <option value="expired">Expired</option>
                            </select>
                        </div>
                        <div class="col-12 mb-3">
                            <label class="form-label">Notes</label>
                            <textarea name="notes" class="form-control" rows="2"></textarea>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-gold"><i class="fas fa-save me-1"></i>Add Points</button>
                    <a href="<?= url('loyalty/loyalty') ?>" class="btn btn-ghost ms-2">Cancel</a>
                </form>
            </div>
        </div>
    </div>
</div>
