<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <title>Admin Panel - SPMB</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {{-- Bootstrap 5 CDN --}}
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">

    {{-- Font Awesome --}}
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">

    <style>
        body {
            background: #f4f6fb;
        }
        .sidebar {
            min-height: 100vh;
            background: linear-gradient(180deg, #4e73df, #021755);
            color: #fff;
        }
        .sidebar a {
            color: #fff;
            text-decoration: none;
            padding: 12px 15px;
            display: block;
            border-radius: 8px;
            margin-bottom: 5px;
        }
        .sidebar a:hover {
            background: rgba(84, 6, 219, 0.28);
        }
        .content {
            padding: 30px;
        }
        .navbar {
            background: #fff;
            box-shadow: 0 5px 15px rgba(6, 25, 203, 0.05);
        }
    </style>
</head>
<body>

<div class="container-fluid">
    <div class="row">

        {{-- SIDEBAR --}}
        <div class="col-md-2 sidebar p-3">
            <h5 class="text-center fw-bold mb-4">
                SPMB ADMIN
            </h5>

            <a href="{{ route('admin.dashboard') }}">
                <i class="fa fa-home me-2"></i> Dashboard
            </a>

            <a href="{{ route('admin.pendaftaran.index') }}">
                <i class="fa fa-users me-2"></i> Data Pendaftaran
            </a>

            @if(Auth::user()->role === 'admin')
           <a href="{{ route('admin.grafik-pendaftaran') }}" class="btn btn-primary mb-3">
    Lihat Data Pendaftaran per Jurusan
</a>
            @endif

            <hr class="text-white">

            <form action="{{ route('logout') }}" method="POST">
                @csrf
                <button class="btn btn-danger w-100">
                    <i class="fa fa-sign-out-alt me-1"></i> Logout
                </button>
            </form>
        </div>

        {{-- CONTENT --}}
        <div class="col-md-10 p-0">

            {{-- NAVBAR --}}
            <nav class="navbar navbar-expand-lg">
                <div class="container-fluid">
                    <span class="navbar-text fw-semibold">
                        Login sebagai: {{ Auth::user()->name }} ({{ Auth::user()->role }})
                    </span>
                </div>
            </nav>

            <div class="content">
                @yield('content')
            </div>

        </div>

    </div>
</div>

{{-- Bootstrap JS CDN --}}
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>



</body>
</html>
