<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Metro Drop - Admin Dashboard</title>
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap" rel="stylesheet">
    <style>
        :root { --primary: #FFB300; --bg: #0A0A0A; --card: #151515; --sidebar: #0F0F0F; }
        body { font-family: 'Outfit', sans-serif; background: var(--bg); color: #fff; margin: 0; display: flex; }
        aside { width: 280px; background: var(--sidebar); height: 100vh; border-right: 1px solid #222; padding: 30px; box-sizing: border-box; }
        main { flex: 1; padding: 40px; box-sizing: border-box; overflow-y: auto; height: 100vh; }
        .logo { font-weight: 800; font-size: 24px; color: var(--primary); margin-bottom: 40px; }
        .nav-link { display: block; padding: 15px; color: #888; text-decoration: none; border-radius: 12px; margin-bottom: 10px; transition: 0.3s; font-weight: 600; }
        .nav-link.active { background: var(--primary); color: #000; }
        .nav-link:hover:not(.active) { color: #fff; background: #222; }
        
        .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
        .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
        .stat-card { background: var(--card); padding: 25px; border-radius: 20px; border: 1px solid #222; }
        .stat-value { font-size: 32px; font-weight: 800; color: var(--primary); margin: 5px 0; }
        .stat-label { color: #888; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

        .content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
        .card { background: var(--card); border-radius: 25px; border: 1px solid #222; padding: 30px; }
        h3 { margin-top: 0; font-size: 18px; margin-bottom: 25px; }
        table { width: 100%; border-collapse: collapse; text-align: left; }
        th { color: #555; font-size: 10px; text-transform: uppercase; padding-bottom: 20px; }
        td { padding: 15px 0; font-size: 14px; border-top: 1px solid #222; }
        .status { padding: 5px 10px; border-radius: 8px; font-size: 10px; font-weight: 800; }
        .status-completed { background: rgba(0,255,0,0.1); color: #00ff00; }
        .status-ongoing { background: rgba(0,0,255,0.1); color: #4d4dff; }
        .logout-btn { background: none; border: 1px solid #333; color: #888; padding: 10px 20px; border-radius: 10px; cursor: pointer; transition: 0.3s; }
        .logout-btn:hover { border-color: #ff4d4d; color: #ff4d4d; }
    </style>
</head>
<body>
    <aside>
        <div class="logo">METRO DROP</div>
        <a href="#" class="nav-link active">Dashboard</a>
        <a href="#" class="nav-link">Riders</a>
        <a href="#" class="nav-link">Drivers</a>
        <a href="#" class="nav-link">Ride History</a>
        <a href="#" class="nav-link">Wallets</a>
    </aside>

    <main>
        <div class="header">
            <div>
                <h1 style="margin:0; font-weight:800; font-size:28px">Platform Insights</h1>
                <p style="color:#555; margin:5px 0 0">Real-time status of the METRO DROP ecosystem</p>
            </div>
            <form action="<?php echo e(route('admin.logout')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <button type="submit" class="logout-btn">DISCONNECT session</button>
            </form>
        </div>

        <div class="stats-grid">
            <div class="stat-card">
                <div class="stat-label">Total Registered Users</div>
                <div class="stat-value"><?php echo e($stats['total_users']); ?></div>
            </div>
            <div class="stat-card">
                <div class="stat-label">Active Drivers Online</div>
                <div class="stat-value"><?php echo e($stats['total_drivers']); ?></div>
            </div>
            <div class="stat-card">
                <div class="stat-label">Total Rides Booked</div>
                <div class="stat-value"><?php echo e($stats['total_rides']); ?></div>
            </div>
            <div class="stat-card">
                <div class="stat-label">Ecosystem Balance</div>
                <div class="stat-value">$<?php echo e(number_format($stats['ecosystem_balance'], 2)); ?></div>
            </div>
        </div>

        <div class="content-grid">
            <div class="card">
                <h3>Monitor Recent Rides</h3>
                <table>
                    <thead>
                        <tr>
                            <th>Ride ID</th>
                            <th>Rider</th>
                            <th>Driver</th>
                            <th>Fare</th>
                            <th>Status</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $recentRides; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ride): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td style="font-family: monospace; color:#888">#<?php echo e(substr($ride->id, 0, 8)); ?></td>
                            <td><?php echo e($ride->rider->name ?? 'User'); ?></td>
                            <td><?php echo e($ride->driver->name ?? 'Assigning...'); ?></td>
                            <td>$<?php echo e($ride->fare); ?></td>
                            <td><span class="status status-<?php echo e($ride->status); ?>"><?php echo e(strtoupper($ride->status)); ?></span></td>
                        </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
            <div class="card">
                <h3>New User Registrations</h3>
                <table>
                    <?php $__currentLoopData = $recentUsers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td>
                            <div style="font-weight:600"><?php echo e($user->name); ?></div>
                            <div style="font-size:10px; color:#555"><?php echo e(strtoupper($user->user_type)); ?> • <?php echo e($user->created_at->diffForHumans()); ?></div>
                        </td>
                        <td style="text-align:right">
                            <span style="color:var(--primary); font-family:monospace; font-weight:bold; font-size:12px">ACTIVE</span>
                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </table>
            </div>
        </div>
    </main>
</body>
</html>
<?php /**PATH D:\Antigravity\metrodrop\backend\resources\views/admin/dashboard.blade.php ENDPATH**/ ?>