<?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 flex-col sm:flex-row sm:items-center sm:justify-between mb-6 animate-fade-in">
        <div>
            <h2 class="text-xl sm:text-2xl font-bold text-slate-800">Transaksi</h2>
            <p class="text-slate-500 mt-1 text-sm">Riwayat pemasukan dan pengeluaran</p>
        </div>
        <a href="<?php echo e(route('transactions.create')); ?>" class="mt-3 sm:mt-0 inline-flex items-center justify-center w-full sm:w-auto px-5 py-2.5 bg-gradient-to-r from-teal-500 to-emerald-500 hover:from-teal-600 hover:to-emerald-600 text-white text-sm font-medium rounded-xl transition shadow-lg shadow-teal-500/30">
            <i class="fas fa-plus mr-2"></i>
            Tambah Transaksi
        </a>
    </div>

    <!-- Summary Cards -->
    <div class="grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-4 mb-6 animate-slide-up animation-delay-100">
        <div class="bg-white border border-slate-100 rounded-xl sm:rounded-2xl p-4 sm:p-5 shadow-sm hover:shadow-md transition">
            <div class="flex items-center justify-between">
                <div>
                    <p class="text-xs sm:text-sm text-slate-500">Pemasukan</p>
                    <p class="text-lg sm:text-2xl font-bold text-emerald-600 mt-1">Rp <?php echo e(number_format($totals['income'] ?? 0, 0, ',', '.')); ?></p>
                </div>
                <div class="w-10 h-10 sm:w-12 sm:h-12 bg-emerald-100 rounded-xl flex items-center justify-center">
                    <i class="fas fa-arrow-down text-emerald-600 text-base sm:text-xl"></i>
                </div>
            </div>
        </div>
        <div class="bg-white border border-slate-100 rounded-xl sm:rounded-2xl p-4 sm:p-5 shadow-sm hover:shadow-md transition">
            <div class="flex items-center justify-between">
                <div>
                    <p class="text-xs sm:text-sm text-slate-500">Pengeluaran</p>
                    <p class="text-lg sm:text-2xl font-bold text-rose-600 mt-1">Rp <?php echo e(number_format($totals['expense'] ?? 0, 0, ',', '.')); ?></p>
                </div>
                <div class="w-10 h-10 sm:w-12 sm:h-12 bg-rose-100 rounded-xl flex items-center justify-center">
                    <i class="fas fa-arrow-up text-rose-600 text-base sm:text-xl"></i>
                </div>
            </div>
        </div>
        <div class="bg-white border border-slate-100 rounded-xl sm:rounded-2xl p-4 sm:p-5 shadow-sm hover:shadow-md transition">
            <div class="flex items-center justify-between">
                <div>
                    <p class="text-xs sm:text-sm text-slate-500">Saldo Bersih</p>
                    <p class="text-lg sm:text-2xl font-bold text-teal-600 mt-1">Rp <?php echo e(number_format(($totals['income'] ?? 0) - ($totals['expense'] ?? 0), 0, ',', '.')); ?></p>
                </div>
                <div class="w-10 h-10 sm:w-12 sm:h-12 bg-teal-100 rounded-xl flex items-center justify-center">
                    <i class="fas fa-balance-scale text-teal-600 text-base sm:text-xl"></i>
                </div>
            </div>
        </div>
    </div>

    <!-- Filters -->
    <div class="bg-white border border-slate-100 rounded-xl sm:rounded-2xl p-4 mb-6 shadow-sm animate-slide-up animation-delay-200">
        <form action="<?php echo e(route('transactions.index')); ?>" method="GET" class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 sm:gap-4">
            <div>
                <label class="block text-xs font-medium text-slate-500 mb-1">Tipe</label>
                <select name="type" class="w-full text-sm bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
                    <option value="">Semua Tipe</option>
                    <option value="income" <?php echo e(request('type') === 'income' ? 'selected' : ''); ?>>Pemasukan</option>
                    <option value="expense" <?php echo e(request('type') === 'expense' ? 'selected' : ''); ?>>Pengeluaran</option>
                </select>
            </div>

            <div>
                <label class="block text-xs font-medium text-slate-500 mb-1">Akun</label>
                <select name="account_id" class="w-full text-sm bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
                    <option value="">Semua Akun</option>
                    <?php $__currentLoopData = $accounts ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($account->id); ?>" <?php echo e(request('account_id') == $account->id ? 'selected' : ''); ?>>
                            <?php echo e($account->name); ?>

                        </option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>

            <div>
                <label class="block text-xs font-medium text-slate-500 mb-1">Kategori</label>
                <select name="category_id" class="w-full text-sm bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
                    <option value="">Semua Kategori</option>
                    <?php $__currentLoopData = $categories ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($category->id); ?>" <?php echo e(request('category_id') == $category->id ? 'selected' : ''); ?>>
                            <?php echo e($category->name); ?>

                        </option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>

            <div>
                <label class="block text-xs font-medium text-slate-500 mb-1">Dari</label>
                <input type="date" name="date_from" value="<?php echo e(request('date_from')); ?>"
                       class="w-full text-sm bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
            </div>

            <div>
                <label class="block text-xs font-medium text-slate-500 mb-1">Sampai</label>
                <input type="date" name="date_to" value="<?php echo e(request('date_to')); ?>"
                       class="w-full text-sm bg-slate-50 border-slate-200 text-slate-800 rounded-xl focus:border-teal-500 focus:ring-teal-500">
            </div>

            <div class="flex items-end space-x-2">
                <button type="submit" class="flex-1 px-4 py-2.5 bg-teal-500 hover:bg-teal-600 text-white text-sm font-medium rounded-xl transition">
                    <i class="fas fa-search mr-1"></i> Filter
                </button>
                <a href="<?php echo e(route('transactions.index')); ?>" class="px-4 py-2.5 bg-slate-100 hover:bg-slate-200 text-slate-600 text-sm font-medium rounded-xl transition">
                    <i class="fas fa-times"></i>
                </a>
            </div>
        </form>
    </div>

    <!-- Transactions List -->
    <div class="bg-white border border-slate-100 rounded-2xl shadow-sm overflow-hidden animate-slide-up animation-delay-300">
        <?php $__empty_1 = true; $__currentLoopData = $transactions ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div class="flex flex-col sm:flex-row sm:items-center justify-between p-4 border-b border-slate-50 hover:bg-slate-50/50 transition group">
                <div class="flex items-center">
                    <div class="w-10 h-10 sm:w-12 sm:h-12 rounded-xl flex items-center justify-center flex-shrink-0 <?php echo e($transaction->type === 'income' ? 'bg-emerald-100 text-emerald-600' : 'bg-rose-100 text-rose-600'); ?>">
                        <i class="fas fa-<?php echo e($transaction->category->icon ?? ($transaction->type === 'income' ? 'arrow-down' : 'arrow-up')); ?> text-lg"></i>
                    </div>
                    <div class="ml-3 sm:ml-4 min-w-0">
                        <p class="font-semibold text-slate-800 truncate"><?php echo e($transaction->description ?: $transaction->category->name ?? 'Transaksi'); ?></p>
                        <div class="flex flex-wrap items-center gap-1 sm:gap-2 text-sm text-slate-500 mt-1">
                            <span class="inline-flex items-center px-2 py-0.5 rounded-lg text-xs font-medium <?php echo e($transaction->type === 'income' ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'); ?>">
                                <?php echo e($transaction->type === 'income' ? 'Pemasukan' : 'Pengeluaran'); ?>

                            </span>
                            <span class="hidden sm:inline mx-1">&bull;</span>
                            <span><?php echo e($transaction->date ? $transaction->date->format('d M Y') : '-'); ?></span>
                            <?php if($transaction->time): ?>
                                <span class="text-slate-400 text-xs"><?php echo e(\Carbon\Carbon::parse($transaction->time)->format('H:i:s')); ?></span>
                            <?php endif; ?>
                            <?php if($transaction->account): ?>
                                <span class="hidden sm:inline mx-1">&bull;</span>
                                <span class="hidden sm:inline"><?php echo e($transaction->account->name); ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
                <div class="flex items-center justify-between sm:justify-end mt-3 sm:mt-0 ml-13 sm:ml-0 space-x-4">
                    <span class="text-lg font-bold <?php echo e($transaction->type === 'income' ? 'text-emerald-600' : 'text-rose-600'); ?>">
                        <?php echo e($transaction->type === 'income' ? '+' : '-'); ?>Rp <?php echo e(number_format($transaction->amount, 0, ',', '.')); ?>

                    </span>
                    <div class="flex items-center space-x-1 sm:opacity-0 sm:group-hover:opacity-100 transition">
                        <a href="<?php echo e(route('transactions.edit', $transaction)); ?>" class="p-2 text-slate-400 hover:text-teal-600 hover:bg-teal-50 rounded-lg transition">
                            <i class="fas fa-edit"></i>
                        </a>
                        <form action="<?php echo e(route('transactions.destroy', $transaction)); ?>" method="POST" class="inline" onsubmit="return confirm('Hapus transaksi ini?')">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('DELETE'); ?>
                            <button type="submit" class="p-2 text-slate-400 hover:text-rose-600 hover:bg-rose-50 rounded-lg transition">
                                <i class="fas fa-trash"></i>
                            </button>
                        </form>
                    </div>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <?php if (isset($component)) { $__componentOriginal074a021b9d42f490272b5eefda63257c = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal074a021b9d42f490272b5eefda63257c = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.empty-state','data' => ['icon' => 'exchange-alt','title' => 'Belum ada transaksi','description' => 'Mulai catat transaksi keuangan Anda','action' => 'Tambah Transaksi','actionUrl' => ''.e(route('transactions.create')).'']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('empty-state'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['icon' => 'exchange-alt','title' => 'Belum ada transaksi','description' => 'Mulai catat transaksi keuangan Anda','action' => 'Tambah Transaksi','actionUrl' => ''.e(route('transactions.create')).'']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal074a021b9d42f490272b5eefda63257c)): ?>
<?php $attributes = $__attributesOriginal074a021b9d42f490272b5eefda63257c; ?>
<?php unset($__attributesOriginal074a021b9d42f490272b5eefda63257c); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal074a021b9d42f490272b5eefda63257c)): ?>
<?php $component = $__componentOriginal074a021b9d42f490272b5eefda63257c; ?>
<?php unset($__componentOriginal074a021b9d42f490272b5eefda63257c); ?>
<?php endif; ?>
        <?php endif; ?>
    </div>

    <!-- Pagination -->
    <?php if(isset($transactions) && $transactions->hasPages()): ?>
        <div class="mt-6">
            <?php echo e($transactions->links()); ?>

        </div>
    <?php endif; ?>
 <?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\transactions\index.blade.php ENDPATH**/ ?>