<!-- resources/views/admin/dashboard.blade.php -->
@extends('layouts.admin')

@section('content')
<div class="max-w-7xl mx-auto space-y-6">
    
    <!-- Welcome Section -->
    <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-8">
        <div>
            <h1 class="text-3xl font-black text-gray-900">Dashboard</h1>
            <p class="text-gray-500 font-bold mt-1">Here is what's happening with Instafix24 today.</p>
        </div>
        <button class="bg-gray-900 hover:bg-black text-white px-6 py-3 rounded-xl font-black flex items-center gap-2 shadow-lg transition-transform hover:scale-105">
            <i data-lucide="plus" class="w-5 h-5"></i> Assign New Booking
        </button>
    </div>

    <!-- Power Stats Cards (All Clickable) -->
    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
        
        <!-- 1. Clickable Revenue Card -->
        <a href="/admin/earnings" class="block bg-white p-6 rounded-2xl border border-gray-100 shadow-sm border-b-4 border-b-[#109E38] hover:bg-gray-50 transition-transform hover:scale-105 cursor-pointer">
            <div class="flex justify-between items-start">
                <div>
                    <p class="text-xs font-black text-gray-400 uppercase tracking-wider mb-1">Today's Revenue</p>
                    <h3 class="text-3xl font-black text-gray-900">₹12,450</h3>
                </div>
                <div class="bg-green-50 p-3 rounded-xl"><i data-lucide="indian-rupee" class="w-6 h-6 text-[#109E38]"></i></div>
            </div>
        </a>
        
        <!-- 2. Clickable Active Jobs Card -->
        <a href="/admin/jobs" class="block bg-white p-6 rounded-2xl border border-gray-100 shadow-sm border-b-4 border-b-blue-500 hover:bg-gray-50 transition-transform hover:scale-105 cursor-pointer">
            <div class="flex justify-between items-start">
                <div>
                    <p class="text-xs font-black text-gray-400 uppercase tracking-wider mb-1">Active Jobs</p>
                    <h3 class="text-3xl font-black text-gray-900">18</h3>
                </div>
                <div class="bg-blue-50 p-3 rounded-xl"><i data-lucide="briefcase" class="w-6 h-6 text-blue-500"></i></div>
            </div>
        </a>

        <!-- 3. Clickable Payouts Card (Naya Add Kiya Hua) -->
        <a href="/admin/payouts" class="block bg-white p-6 rounded-2xl border border-gray-100 shadow-sm border-b-4 border-b-red-500 hover:bg-gray-50 transition-transform hover:scale-105 cursor-pointer">
            <div class="flex justify-between items-start">
                <div>
                    <p class="text-xs font-black text-gray-400 uppercase tracking-wider mb-1">Tech Payouts Pending</p>
                    <h3 class="text-3xl font-black text-red-600">₹22,500</h3>
                </div>
                <div class="bg-red-50 p-3 rounded-xl"><i data-lucide="alert-circle" class="w-6 h-6 text-red-500"></i></div>
            </div>
        </a>

        <!-- 4. Clickable Live Tracking Card -->
        <a href="/admin/tracking" class="block bg-white p-6 rounded-2xl border border-gray-100 shadow-sm border-b-4 border-b-purple-500 hover:bg-gray-50 transition-transform hover:scale-105 cursor-pointer">
            <div class="flex justify-between items-start">
                <div>
                    <p class="text-xs font-black text-gray-400 uppercase tracking-wider mb-1">Live Tracking</p>
                    <h3 class="text-3xl font-black text-gray-900">12 Techs</h3>
                </div>
                <div class="bg-purple-50 p-3 rounded-xl"><i data-lucide="map" class="w-6 h-6 text-purple-500"></i></div>
            </div>
        </a>
    </div>

    <!-- Live Operations Table -->
    <div class="bg-white rounded-2xl border border-gray-100 shadow-sm overflow-hidden mt-8">
        <div class="px-6 py-5 border-b border-gray-100 flex justify-between items-center bg-gray-50/50">
            <h3 class="text-lg font-black text-gray-900">Live Operations Tracker</h3>
            <a href="/admin/jobs" class="text-sm font-bold text-[#109E38] hover:underline">View All</a>
        </div>
        <div class="overflow-x-auto">
            <table class="w-full text-left border-collapse">
                <thead>
                    <tr class="bg-white border-b border-gray-100 text-xs font-black text-gray-400 uppercase tracking-wider">
                        <th class="px-6 py-4">Job ID</th>
                        <th class="px-6 py-4">Customer & Service</th>
                        <th class="px-6 py-4">Technician</th>
                        <th class="px-6 py-4">Status</th>
                        <th class="px-6 py-4 text-right">Amount</th>
                    </tr>
                </thead>
                <tbody class="text-sm font-bold divide-y divide-gray-50">
                    <!-- Ongoing Booking -->
                    <tr class="hover:bg-gray-50 transition-colors">
                        <td class="px-6 py-4 text-gray-900">#IFX-9021</td>
                        <td class="px-6 py-4">
                            <p class="text-gray-900">Deep Cleaning</p>
                            <p class="text-xs text-gray-500 mt-0.5">Laxmi Nagar</p>
                        </td>
                        <td class="px-6 py-4">
                            <div class="flex items-center gap-2">
                                <div class="w-6 h-6 rounded-full bg-[#109E38] text-white flex items-center justify-center text-[10px]">R</div>
                                <span>Rahul Tech</span>
                            </div>
                        </td>
                        <td class="px-6 py-4">
                            <span class="bg-blue-50 text-blue-600 px-3 py-1 rounded-full text-xs font-black border border-blue-100">Ongoing</span>
                        </td>
                        <td class="px-6 py-4 text-right text-gray-900">₹499</td>
                    </tr>
                    <!-- Pending Booking -->
                    <tr class="hover:bg-gray-50 transition-colors">
                        <td class="px-6 py-4 text-gray-900">#IFX-8924</td>
                        <td class="px-6 py-4">
                            <p class="text-gray-900">Gas Refill (R32)</p>
                            <p class="text-xs text-gray-500 mt-0.5">Geeta Colony</p>
                        </td>
                        <td class="px-6 py-4">
                            <span class="text-gray-400 italic">Unassigned</span>
                        </td>
                        <td class="px-6 py-4">
                            <span class="bg-yellow-50 text-yellow-600 px-3 py-1 rounded-full text-xs font-black border border-yellow-100">Pending</span>
                        </td>
                        <td class="px-6 py-4 text-right text-gray-900">₹2,200</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

</div>
@endsection