<?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([]); ?>
     <?php $__env->slot('header', null, []); ?> 
        <div class="flex items-center justify-between">
            <div>
                <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight flex items-center">
                    <i class="fas fa-couch mr-2 text-amber-500"></i>
                    Dashboard Furnitur
                </h2>
                <p class="text-sm text-gray-500 dark:text-gray-400 mt-1">Temukan furniture impian untuk rumah Anda</p>
            </div>
            <div class="hidden md:block">
                <span class="text-xs bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400 px-3 py-1 rounded-full font-medium">
                    <i class="fas fa-gem mr-1"></i> Member Premium
                </span>
            </div>
        </div>
     <?php $__env->endSlot(); ?>

    <div class="py-8 bg-gradient-to-b from-gray-50 to-white dark:from-gray-900 dark:to-gray-800 min-h-screen">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 space-y-8">

            
            <div class="relative overflow-hidden bg-gradient-to-r from-amber-600 to-amber-700 rounded-2xl shadow-xl">
                <div class="relative z-10 p-8">
                    <div class="flex items-start justify-between">
                        <div>
                            <div class="inline-flex items-center bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full border border-white/30 mb-4">
                                <span class="flex h-2 w-2 rounded-full bg-emerald-400 mr-2 animate-pulse"></span>
                                <span class="text-[10px] font-bold text-white uppercase tracking-wider">Selamat Datang</span>
                            </div>
                            <h3 class="text-2xl md:text-3xl font-bold text-white tracking-tight">
                                <?php echo e($greeting); ?>, <?php echo e(explode(' ', $userName)[0]); ?>! 🪑
                            </h3>
                            <p class="mt-2 text-amber-100 text-sm max-w-2xl leading-relaxed">
                                Temukan furniture terbaik untuk rumah impianmu. Jelajahi koleksi kami mulai dari sofa,
                                meja, kursi hingga lemari berkualitas dengan harga terbaik.
                            </p>
                        </div>
                        <div class="hidden md:block">
                            <div class="w-16 h-16 bg-white/20 rounded-2xl flex items-center justify-center backdrop-blur-sm border border-white/20">
                                <i class="fas fa-couch text-2xl text-white"></i>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="absolute -right-10 -top-10 w-40 h-40 bg-white/10 rounded-full blur-3xl"></div>
                <div class="absolute -left-10 -bottom-10 w-40 h-40 bg-white/10 rounded-full blur-3xl"></div>
            </div>

            
            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                
                <div class="group relative overflow-hidden bg-gradient-to-br from-amber-500 to-orange-600 rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-1">
                    <div class="p-6">
                        <div class="flex justify-between items-start mb-4">
                            <div class="p-3 bg-white/20 rounded-xl backdrop-blur-sm group-hover:scale-110 transition-transform">
                                <i class="fas fa-couch text-2xl text-white"></i>
                            </div>
                            <span class="text-xs bg-white/30 px-3 py-1 rounded-full text-white font-semibold">Koleksi</span>
                        </div>
                        <h4 class="text-xl font-bold text-white mb-2">Koleksi Furniture</h4>
                        <p class="text-sm text-white/80 mb-6 leading-relaxed">
                            Lihat berbagai furniture modern dan minimalis untuk kenyamanan rumah Anda.
                        </p>
                        <a href="<?php echo e(route('products.index')); ?>"
                            class="inline-flex items-center gap-2 bg-white text-amber-600 px-5 py-2.5 rounded-xl text-sm font-bold hover:bg-gray-100 transition shadow-md group-hover:shadow-lg">
                            Lihat Produk
                            <i class="fas fa-arrow-right text-xs transition-transform group-hover:translate-x-1"></i>
                        </a>
                    </div>
                </div>

                
                <div class="group relative overflow-hidden bg-gradient-to-br from-emerald-500 to-teal-600 rounded-2xl shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-1">
                    <div class="p-6">
                        <div class="flex justify-between items-start mb-4">
                            <div class="p-3 bg-white/20 rounded-xl backdrop-blur-sm group-hover:scale-110 transition-transform">
                                <i class="fas fa-tags text-2xl text-white"></i>
                            </div>
                            <span class="text-xs bg-white/30 px-3 py-1 rounded-full text-white font-semibold">Kategori</span>
                        </div>
                        <h4 class="text-xl font-bold text-white mb-2">Jelajahi Kategori</h4>
                        <p class="text-sm text-white/80 mb-6 leading-relaxed">
                            Temukan furniture yang spesifik berdasarkan kategori ruangan dan kebutuhan Anda.
                        </p>
                        <a href="<?php echo e(route('categories.index')); ?>"
                            class="inline-flex items-center gap-2 bg-white text-emerald-600 px-5 py-2.5 rounded-xl text-sm font-bold hover:bg-gray-100 transition shadow-md group-hover:shadow-lg">
                            Lihat Kategori
                            <i class="fas fa-arrow-right text-xs transition-transform group-hover:translate-x-1"></i>
                        </a>
                    </div>
                </div>
            </div>

            <?php if(Auth::user()->role == 'customer'): ?>
                <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
                    
                    <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col">
                        <div class="px-6 py-4 bg-gray-50/50 dark:bg-gray-700/30 border-b border-gray-200 dark:border-gray-700">
                            <div class="flex items-center justify-between">
                                <h3 class="font-bold text-gray-800 dark:text-white flex items-center">
                                    <i class="fas fa-shopping-cart mr-2 text-amber-500"></i> Keranjang Belanja
                                </h3>
                                <a href="<?php echo e(route('cart.index')); ?>" class="text-xs font-semibold text-amber-600 hover:text-amber-700 flex items-center gap-1">
                                    Lihat Semua <i class="fas fa-arrow-right text-[10px]"></i>
                                </a>
                            </div>
                        </div>
                        
                        <div class="p-6 flex-1">
                            <?php
                                $cartItems = \App\Models\Cart::with('product')->where('user_id', auth()->id())->take(3)->get();
                                $cartTotal = $cartItems->sum(fn($item) => $item->product->base_price * $item->quantity);
                            ?>

                            <?php if($cartItems->isNotEmpty()): ?>
                                <div class="space-y-4">
                                    <?php $__currentLoopData = $cartItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="flex items-center justify-between p-3 bg-gray-50 dark:bg-gray-700/50 rounded-xl hover:bg-gray-100 dark:hover:bg-gray-700 transition border border-transparent hover:border-amber-200 dark:hover:border-amber-900/50">
                                            <div class="flex items-center gap-4">
                                                <div class="w-12 h-12 bg-amber-100 dark:bg-amber-900/30 rounded-xl flex items-center justify-center flex-shrink-0">
                                                    <i class="fas fa-couch text-amber-600"></i>
                                                </div>
                                                <div>
                                                    <p class="font-bold text-gray-800 dark:text-white text-sm line-clamp-1"><?php echo e($item->product->name); ?></p>
                                                    <p class="text-xs text-gray-500 mt-0.5"><?php echo e($item->quantity); ?> x Rp <?php echo e(number_format($item->product->base_price, 0, ',', '.')); ?></p>
                                                </div>
                                            </div>
                                            <p class="font-bold text-amber-600 text-sm whitespace-nowrap">Rp <?php echo e(number_format($item->product->base_price * $item->quantity, 0, ',', '.')); ?></p>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    
                                    <div class="mt-6 pt-4 border-t border-gray-200 dark:border-gray-700">
                                        <div class="flex justify-between items-center mb-4">
                                            <span class="text-sm font-medium text-gray-600 dark:text-gray-400">Total Estimasi</span>
                                            <span class="text-xl font-black text-amber-600">Rp <?php echo e(number_format($cartTotal, 0, ',', '.')); ?></span>
                                        </div>
                                        <a href="<?php echo e(route('cart.index')); ?>" class="block w-full bg-amber-500 hover:bg-amber-600 text-white text-center font-bold py-3.5 rounded-xl transition shadow-md hover:shadow-lg">
                                            <i class="fas fa-credit-card mr-2"></i> Checkout Sekarang
                                        </a>
                                    </div>
                                </div>
                            <?php else: ?>
                                <div class="text-center py-8">
                                    <div class="w-16 h-16 bg-gray-100 dark:bg-gray-700 rounded-full flex items-center justify-center mx-auto mb-4">
                                        <i class="fas fa-shopping-cart text-2xl text-gray-400"></i>
                                    </div>
                                    <p class="text-gray-500 dark:text-gray-400 font-medium">Keranjang belanja kosong</p>
                                    <a href="<?php echo e(route('products.index')); ?>" class="mt-4 inline-flex items-center gap-2 text-amber-600 hover:text-amber-700 font-bold text-sm">
                                        Mulai Belanja <i class="fas fa-arrow-right text-xs"></i>
                                    </a>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>

                    
                    <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col">
                        <div class="px-6 py-4 bg-gray-50/50 dark:bg-gray-700/30 border-b border-gray-200 dark:border-gray-700">
                            <div class="flex items-center justify-between">
                                <h3 class="font-bold text-gray-800 dark:text-white flex items-center">
                                    <i class="fas fa-truck mr-2 text-amber-500"></i> Pesanan Terbaru
                                </h3>
                                <a href="<?php echo e(route('orders.index')); ?>" class="text-xs font-semibold text-amber-600 hover:text-amber-700 flex items-center gap-1">
                                    Riwayat Lengkap <i class="fas fa-arrow-right text-[10px]"></i>
                                </a>
                            </div>
                        </div>

                        <div class="p-6 flex-1">
                            <?php
                                $recentOrders = \App\Models\Order::where('user_id', auth()->id())->latest()->take(3)->get();
                                $statusMap = [
                                    'pending'   => ['bg-amber-100 text-amber-700', 'fa-clock', 'Menunggu'],
                                    'paid'      => ['bg-blue-100 text-blue-700', 'fa-credit-card', 'Dibayar'],
                                    'confirmed' => ['bg-cyan-100 text-cyan-700', 'fa-check', 'Dikonfirmasi'],
                                    'shipping'  => ['bg-purple-100 text-purple-700', 'fa-truck', 'Dikirim'],
                                    'completed' => ['bg-emerald-100 text-emerald-700', 'fa-check-circle', 'Selesai'],
                                    'cancelled' => ['bg-rose-100 text-rose-700', 'fa-times', 'Dibatalkan'],
                                ];
                            ?>

                            <?php if($recentOrders->isNotEmpty()): ?>
                                <div class="space-y-3">
                                    <?php $__currentLoopData = $recentOrders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php $s = $statusMap[$order->status] ?? ['bg-gray-100 text-gray-700', 'fa-question', $order->status]; ?>
                                        <div class="flex items-center justify-between p-4 bg-gray-50 dark:bg-gray-700/50 rounded-xl border border-transparent hover:border-gray-200 dark:hover:border-gray-600 transition">
                                            <div>
                                                <div class="flex items-center gap-2 mb-1">
                                                    <span class="font-mono text-xs font-bold text-amber-600">#<?php echo e($order->order_number); ?></span>
                                                    <span class="text-[10px] text-gray-400"><?php echo e($order->created_at->diffForHumans()); ?></span>
                                                </div>
                                                <p class="text-sm font-bold text-gray-800 dark:text-white">Rp <?php echo e(number_format($order->total_price, 0, ',', '.')); ?></p>
                                            </div>
                                            <span class="inline-flex items-center gap-1.5 text-[10px] font-bold px-2.5 py-1 rounded-full <?php echo e($s[0]); ?>">
                                                <i class="fas <?php echo e($s[1]); ?>"></i> <?php echo e($s[2]); ?>

                                            </span>
                                        </div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            <?php else: ?>
                                <div class="text-center py-8">
                                    <div class="w-16 h-16 bg-gray-100 dark:bg-gray-700 rounded-full flex items-center justify-center mx-auto mb-4">
                                        <i class="fas fa-box-open text-2xl text-gray-400"></i>
                                    </div>
                                    <p class="text-gray-500 dark:text-gray-400 font-medium">Belum ada pesanan</p>
                                    <a href="<?php echo e(route('products.index')); ?>" class="mt-4 inline-flex items-center gap-2 text-amber-600 hover:text-amber-700 font-bold text-sm">
                                        Belanja Sekarang <i class="fas fa-arrow-right text-xs"></i>
                                    </a>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>
            <?php endif; ?>

            
            <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden">
                <div class="px-6 py-5 bg-gray-50/50 dark:bg-gray-700/30 border-b border-gray-200 dark:border-gray-700">
                    <div class="flex items-center justify-between">
                        <h3 class="text-lg font-bold text-gray-800 dark:text-white">
                            <i class="fas fa-th-large mr-2 text-amber-500"></i> Kategori Populer
                        </h3>
                        <a href="<?php echo e(route('categories.index')); ?>" class="text-xs font-semibold text-amber-600 hover:underline">Lihat Semua</a>
                    </div>
                </div>

                <div class="p-6">
                    <div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4">
                        <?php $__empty_1 = true; $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <a href="<?php echo e(route('categories.show', $category->id)); ?>"
                               class="group flex flex-col items-center p-5 bg-gray-50 dark:bg-gray-700/50 rounded-2xl border-2 border-transparent hover:border-amber-500 hover:bg-white dark:hover:bg-gray-700 transition-all duration-300">
                                
                                <div class="w-14 h-14 bg-gradient-to-br from-amber-100 to-amber-200 dark:from-amber-900/30 dark:to-amber-800/30 text-amber-600 dark:text-amber-300 rounded-2xl flex items-center justify-center mb-3 group-hover:scale-110 group-hover:rotate-6 transition-all duration-300 shadow-sm">
                                    <?php
                                        $icon = match(strtolower($category->name)) {
                                            'kursi', 'chair' => 'fa-chair',
                                            'meja', 'table' => 'fa-table',
                                            'lemari', 'cabinet' => 'fa-archive',
                                            'tempat tidur', 'bed' => 'fa-bed',
                                            'sofa' => 'fa-couch',
                                            'laci', 'drawer' => 'fa-drawer',
                                            'rak', 'shelf' => 'fa-layer-group',
                                            default => 'fa-tree'
                                        };
                                    ?>
                                    <i class="fas <?php echo e($icon); ?> text-xl"></i>
                                </div>

                                <span class="text-sm font-bold text-gray-700 dark:text-gray-200 group-hover:text-amber-600 transition"><?php echo e($category->name); ?></span>
                                <span class="text-[10px] text-gray-400 mt-1 uppercase tracking-tighter"><?php echo e($category->products_count ?? $category->products->count() ?? 0); ?> Produk</span>
                            </a>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <div class="col-span-full text-center py-8">
                                <i class="fas fa-folder-open text-3xl text-gray-300 mb-2"></i>
                                <p class="text-gray-500 text-sm">Belum ada kategori</p>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>

            
            <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden">
                <div class="px-6 py-5 bg-gray-50/50 dark:bg-gray-700/30 border-b border-gray-200 dark:border-gray-700 font-bold text-gray-800 dark:text-white">
                    <i class="fas fa-bolt mr-2 text-amber-500"></i> Aksi Cepat
                </div>
                <div class="p-6">
                    <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
                        <?php
                            $actions = [
                                ['route' => 'profile.edit', 'icon' => 'fa-user', 'label' => 'Profil Saya'],
                                ['route' => 'products.index', 'icon' => 'fa-couch', 'label' => 'Katalog'],
                                ['route' => 'cart.index', 'icon' => 'fa-shopping-cart', 'label' => 'Keranjang'],
                                ['route' => 'orders.index', 'icon' => 'fa-truck', 'label' => 'Pesanan'],
                            ];
                        ?>
                        <?php $__currentLoopData = $actions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $action): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <a href="<?php echo e(route($action['route'])); ?>"
                               class="group bg-gray-50 dark:bg-gray-700/50 p-4 rounded-xl text-center hover:bg-amber-500 transition-all border border-gray-100 dark:border-gray-600 shadow-sm hover:shadow-md">
                                <div class="w-12 h-12 bg-white dark:bg-gray-600 rounded-xl flex items-center justify-center mx-auto mb-3 group-hover:bg-white/20 transition shadow-sm">
                                    <i class="fas <?php echo e($action['icon']); ?> text-amber-600 text-lg group-hover:text-white"></i>
                                </div>
                                <span class="text-xs font-bold text-gray-700 dark:text-gray-300 group-hover:text-white uppercase tracking-wider"><?php echo e($action['label']); ?></span>
                            </a>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
                </div>
            </div>

            
            <?php if(isset($recommendedProducts) && $recommendedProducts->isNotEmpty()): ?>
                <div class="bg-white dark:bg-gray-800 rounded-2xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden">
                    <div class="px-6 py-5 bg-gray-50/50 dark:bg-gray-700/30 border-b border-gray-200 dark:border-gray-700">
                        <div class="flex items-center justify-between">
                            <h3 class="text-lg font-bold text-gray-800 dark:text-white">
                                <i class="fas fa-star mr-2 text-amber-500"></i> Rekomendasi Untuk Anda
                            </h3>
                        </div>
                    </div>
                    <div class="p-6">
                        <div class="grid grid-cols-2 md:grid-cols-4 gap-6">
                            <?php $__currentLoopData = $recommendedProducts->take(4); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <a href="<?php echo e(route('products.show', $product->id)); ?>" 
                                   class="group bg-white dark:bg-gray-800 rounded-2xl overflow-hidden border border-gray-100 dark:border-gray-700 hover:shadow-xl transition-all hover:-translate-y-1">
                                    <div class="aspect-square bg-gray-50 dark:bg-gray-900 flex items-center justify-center relative overflow-hidden">
                                        <i class="fas fa-couch text-4xl text-gray-200 group-hover:scale-110 transition-transform duration-500"></i>
                                        <div class="absolute inset-0 bg-gradient-to-t from-black/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"></div>
                                    </div>
                                    <div class="p-4">
                                        <h4 class="font-bold text-gray-800 dark:text-white text-sm truncate group-hover:text-amber-600 transition"><?php echo e($product->name); ?></h4>
                                        <p class="text-amber-600 font-black text-sm mt-1">Rp <?php echo e(number_format($product->base_price, 0, ',', '.')); ?></p>
                                    </div>
                                </a>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                </div>
            <?php endif; ?>

        </div>
    </div>
 <?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:\laragon\www\LokaFurniture\resources\views/dashboard/customer.blade.php ENDPATH**/ ?>