<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <!-- Header -->
    <div class="flex items-center mb-6">
        <a href="<?php echo e(route('accounts.index')); ?>" class="text-slate-400 hover:text-teal-600 mr-3 sm:mr-4 transition">
            <i class="fas fa-arrow-left text-lg sm:text-xl"></i>
        </a>
        <div>
            <h2 class="text-xl sm:text-2xl font-bold text-slate-800">Tambah Akun Baru</h2>
            <p class="text-slate-500 mt-1 text-sm">Buat rekening, dompet, atau kartu kredit</p>
        </div>
    </div>

    <div class="w-full max-w-3xl">
        <div class="bg-white border border-slate-100 rounded-xl sm:rounded-2xl p-4 sm:p-6 shadow-sm">
            <form action="<?php echo e(route('accounts.store')); ?>" method="POST">
                <?php echo csrf_field(); ?>

                <div class="space-y-6">
                    <!-- Account Name -->
                    <div>
                        <label for="name" class="block text-sm font-medium text-slate-700 mb-2">Nama Akun</label>
                        <input type="text" id="name" name="name" value="<?php echo e(old('name')); ?>" required autofocus
                               placeholder="contoh: BCA Tabungan, Dompet Tunai"
                               class="w-full bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500 placeholder-slate-400">
                        <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p class="mt-1 text-sm text-rose-500"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    <!-- Account Type -->
                    <div>
                        <label for="type" class="block text-sm font-medium text-slate-700 mb-2">Tipe Akun</label>
                        <select id="type" name="type" required
                                class="w-full bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
                            <option value="">Pilih tipe...</option>
                            <?php $__currentLoopData = $accountTypes ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($value); ?>" <?php echo e(old('type') === $value ? 'selected' : ''); ?>>
                                    <?php echo e($label); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                        <?php $__errorArgs = ['type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p class="mt-1 text-sm text-rose-500"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>

                    <div class="grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6">
                        <!-- Currency -->
                        <div>
                            <label for="currency_id" class="block text-sm font-medium text-slate-700 mb-2">Mata Uang</label>
                            <select id="currency_id" name="currency_id" required
                                    class="w-full bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
                                <?php $__currentLoopData = $currencies ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($currency->id); ?>" <?php echo e(old('currency_id', $defaultCurrency?->id ?? '') == $currency->id ? 'selected' : ''); ?>>
                                        <?php echo e($currency->code); ?> - <?php echo e($currency->name); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                            <?php $__errorArgs = ['currency_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p class="mt-1 text-sm text-rose-500"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <!-- Initial Balance -->
                        <div>
                            <label for="initial_balance" class="block text-sm font-medium text-slate-700 mb-2">Saldo Awal</label>
                            <input type="number" id="initial_balance" name="initial_balance" step="1" value="<?php echo e(old('initial_balance', 0)); ?>" required
                                   class="w-full bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
                            <?php $__errorArgs = ['initial_balance'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> <p class="mt-1 text-sm text-rose-500"><?php echo e($message); ?></p> <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                    </div>

                    <!-- Credit Card Specific Fields -->
                    <div id="creditCardFields" class="hidden space-y-6">
                        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6">
                            <div>
                                <label for="credit_limit" class="block text-sm font-medium text-slate-700 mb-2">Limit Kredit</label>
                                <input type="number" id="credit_limit" name="credit_limit" step="1" value="<?php echo e(old('credit_limit')); ?>"
                                       class="w-full bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
                            </div>
                            <div>
                                <label for="interest_rate" class="block text-sm font-medium text-slate-700 mb-2">Suku Bunga (%)</label>
                                <input type="number" id="interest_rate" name="interest_rate" step="0.01" value="<?php echo e(old('interest_rate')); ?>"
                                       class="w-full bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
                            </div>
                        </div>
                    </div>

                    <!-- Bank Name -->
                    <div>
                        <label for="bank_name" class="block text-sm font-medium text-slate-700 mb-2">Nama Bank/Institusi (Opsional)</label>
                        <input type="text" id="bank_name" name="bank_name" value="<?php echo e(old('bank_name')); ?>"
                               placeholder="contoh: Bank Central Asia"
                               class="w-full bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500 placeholder-slate-400">
                    </div>

                    <!-- Icon & Color -->
                    <div class="grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6">
                        <div>
                            <label for="icon" class="block text-sm font-medium text-slate-700 mb-2">Icon</label>
                            <select id="icon" name="icon"
                                    class="w-full bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
                                <option value="wallet" <?php echo e(old('icon') === 'wallet' ? 'selected' : ''); ?>>💳 Wallet</option>
                                <option value="university" <?php echo e(old('icon') === 'university' ? 'selected' : ''); ?>>🏦 Bank</option>
                                <option value="credit-card" <?php echo e(old('icon') === 'credit-card' ? 'selected' : ''); ?>>💳 Credit Card</option>
                                <option value="piggy-bank" <?php echo e(old('icon') === 'piggy-bank' ? 'selected' : ''); ?>>🐷 Tabungan</option>
                                <option value="coins" <?php echo e(old('icon') === 'coins' ? 'selected' : ''); ?>>🪙 Koin</option>
                                <option value="money-bill" <?php echo e(old('icon') === 'money-bill' ? 'selected' : ''); ?>>💵 Uang</option>
                            </select>
                        </div>
                        <div>
                            <label for="color" class="block text-sm font-medium text-slate-700 mb-2">Warna</label>
                            <input type="color" id="color" name="color" value="<?php echo e(old('color', '#14b8a6')); ?>"
                                   class="w-full h-11 bg-slate-50 border-slate-200 rounded-xl cursor-pointer">
                        </div>
                    </div>

                    <!-- Description -->
                    <div>
                        <label for="description" class="block text-sm font-medium text-slate-700 mb-2">Catatan (Opsional)</label>
                        <textarea id="description" name="description" rows="3"
                                  placeholder="Tambahkan catatan tentang akun ini..."
                                  class="w-full bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500 placeholder-slate-400"><?php echo e(old('description')); ?></textarea>
                    </div>
                </div>

                <!-- Actions -->
                <div class="flex items-center justify-end space-x-4 mt-8 pt-6 border-t border-slate-100">
                    <a href="<?php echo e(route('accounts.index')); ?>" class="px-5 py-2.5 text-slate-600 hover:text-slate-800 font-medium rounded-xl transition">
                        Batal
                    </a>
                    <button type="submit" class="px-6 py-2.5 bg-gradient-to-r from-teal-500 to-emerald-500 hover:from-teal-600 hover:to-emerald-600 text-white font-medium rounded-xl transition shadow-lg shadow-teal-500/30">
                        <i class="fas fa-save mr-2"></i>
                        Simpan Akun
                    </button>
                </div>
            </form>
        </div>
    </div>

    <?php $__env->startPush('scripts'); ?>
    <script>
        document.getElementById('type').addEventListener('change', function() {
            const creditCardFields = document.getElementById('creditCardFields');
            if (this.value === 'credit_card') {
                creditCardFields.classList.remove('hidden');
            } else {
                creditCardFields.classList.add('hidden');
            }
        });
    </script>
    <?php $__env->stopPush(); ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\mymoney-app\resources\views\accounts\create.blade.php ENDPATH**/ ?>