<div class="row">
    <div class="col-lg-8">
        <div class="card glass-card">
            <div class="card-header"><h5 class="card-title">Issue Gift Card</h5></div>
            <div class="card-body">
                <form method="POST" action="<?= url('loyalty/giftcards/store') ?>" class="needs-validation" novalidate>
                    <?= csrf_field() ?>
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Customer</label>
                            <select name="customer_id" class="form-select select2">
                                <option value="">Walk-in (No 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">Initial Value <span class="text-danger">*</span></label>
                            <input type="number" step="0.01" name="initial_value" class="form-control" required min="1">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Expiration Date</label>
                            <input type="date" name="expires_at" class="form-control">
                        </div>
                    </div>
                    <button type="submit" class="btn btn-gold"><i class="fas fa-save me-1"></i>Issue Gift Card</button>
                    <a href="<?= url('loyalty/giftcards') ?>" class="btn btn-ghost ms-2">Cancel</a>
                </form>
            </div>
        </div>
    </div>
</div>
