<div class="row justify-content-center"><div class="col-lg-6"><div class="card">
    <div class="card-header"><h5 class="mb-0"><?= $carnetType ? lang('cards.edit_carnet_type') : lang('cards.create_carnet_type') ?></h5></div>
    <div class="card-body">
        <form method="POST" action="<?= $formAction ?>" data-ajax="true"><?= csrf_field() ?>
            <div class="row g-3">
                <div class="col-md-6"><label class="form-label">Code *</label><input type="text" name="type_code" class="form-control" value="<?= e($carnetType['type_code'] ?? '') ?>" required><div class="invalid-feedback" data-field="type_code"></div></div>
                <div class="col-md-6"><label class="form-label">Name (EN) *</label><input type="text" name="name_en" class="form-control" value="<?= e($carnetType['name_en'] ?? '') ?>" required></div>
                <div class="col-md-6"><label class="form-label">Name (AR) *</label><input type="text" name="name_ar" class="form-control" value="<?= e($carnetType['name_ar'] ?? '') ?>" required></div>
                <div class="col-md-6"><label class="form-label">Max Entries *</label><input type="number" name="max_entries" class="form-control" value="<?= e($carnetType['max_entries'] ?? '') ?>" required min="1"></div>
                <div class="col-md-6"><label class="form-label">Validity (days)</label><input type="number" name="validity_days" class="form-control" value="<?= e($carnetType['validity_days'] ?? '') ?>"><small class="text-muted">Leave empty for unlimited</small></div>
                <div class="col-md-6"><label class="form-label">Price *</label><input type="number" step="0.01" name="price" class="form-control" value="<?= e($carnetType['price'] ?? '0') ?>" required></div>
                <div class="col-md-12"><div class="d-flex gap-4">
                    <div class="form-check"><input type="checkbox" name="is_transferable" class="form-check-input" id="transfer" <?= checked(1, $carnetType['is_transferable'] ?? 0) ?>><label class="form-check-label" for="transfer">Transferable</label></div>
                    <div class="form-check"><input type="checkbox" name="is_active" class="form-check-input" id="active" <?= checked(1, $carnetType['is_active'] ?? 1) ?>><label class="form-check-label" for="active">Active</label></div>
                </div></div>
            </div>
            <div class="mt-4 d-flex gap-2"><button type="submit" class="btn btn-primary"><i class="fas fa-save me-1"></i><?= lang('common.save') ?></button><a href="/carnet-types" class="btn btn-secondary"><?= lang('common.cancel') ?></a></div>
        </form>
    </div>
</div></div></div>