<div id="sidebar" class="active">
    <div class="sidebar-wrapper active">
        {{-- Modern Minimalist Brand Header (No bulky box, clean SVG emblem + typography) --}}
        <div class="sidebar-header pb-2 pt-4 px-4">
            <div class="d-flex justify-content-between align-items-center">
                <a href="{{ auth()->user()?->isAdmin() ? route('admin.dashboard') : route('employee.dashboard') }}" class="d-flex align-items-center text-decoration-none gap-2">
                    {{-- Clean Geometric Vector Logo --}}
                    <div class="brand-svg-icon text-primary d-flex align-items-center justify-content-center">
                        <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
                            <path d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z"/>
                            <path d="M12 6v6l4 2"/>
                            <circle cx="12" cy="12" r="2" fill="currentColor"/>
                        </svg>
                    </div>
                    <div>
                        <div class="d-flex align-items-center gap-1">
                            <span class="fs-5 fw-extrabold text-dark tracking-tight" style="font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif; font-weight: 800; letter-spacing: -0.6px; line-height: 1.1;">PRESENSI</span>
                            <span class="badge bg-primary text-white py-0 px-1 rounded" style="font-size: 0.65rem; font-weight: 700;">PRO</span>
                        </div>
                        <small class="text-muted d-block" style="font-size: 0.7rem; font-weight: 600; letter-spacing: 0.5px;">SISTEM GEOLOKASI</small>
                    </div>
                </a>
                <div class="toggler">
                    <a href="#" class="sidebar-hide d-xl-none d-block text-secondary fs-4"><i class="bi bi-x"></i></a>
                </div>
            </div>
        </div>

        <div class="sidebar-menu">
            <ul class="menu px-2">
                @if(auth()->user()?->isAdmin())
                    <li class="sidebar-title">MENU UTAMA</li>
                    <li class="sidebar-item {{ request()->routeIs('admin.dashboard') ? 'active' : '' }}">
                        <a href="{{ route('admin.dashboard') }}" class="sidebar-link">
                            <i class="bi bi-grid-1x2-fill"></i>
                            <span>Dashboard</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('admin/attendance*') ? 'active' : '' }}">
                        <a href="{{ url('/admin/attendance') }}" class="sidebar-link">
                            <i class="bi bi-calendar2-check-fill"></i>
                            <span>Data Kehadiran</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('admin/employees*') ? 'active' : '' }}">
                        <a href="{{ url('/admin/employees') }}" class="sidebar-link">
                            <i class="bi bi-people-fill"></i>
                            <span>Data Karyawan</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('admin/shifts*') || request()->is('admin/schedules*') ? 'active' : '' }}">
                        <a href="{{ url('/admin/shifts') }}" class="sidebar-link">
                            <i class="bi bi-clock-fill"></i>
                            <span>Jadwal & Shift</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('admin/office-locations*') ? 'active' : '' }}">
                        <a href="{{ url('/admin/office-locations') }}" class="sidebar-link">
                            <i class="bi bi-geo-alt-fill"></i>
                            <span>Lokasi Kantor</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('admin/qr-attendance*') ? 'active' : '' }}">
                        <a href="{{ url('/admin/qr-attendance') }}" class="sidebar-link">
                            <i class="bi bi-qr-code-scan"></i>
                            <span>QR Code Absensi</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('admin/leave-requests*') ? 'active' : '' }}">
                        <a href="{{ url('/admin/leave-requests') }}" class="sidebar-link">
                            <i class="bi bi-file-earmark-check-fill"></i>
                            <span>Izin & Cuti</span>
                        </a>
                    </li>

                    <li class="sidebar-title">LAPORAN & REKAP</li>
                    <li class="sidebar-item {{ request()->is('admin/reports/monthly*') ? 'active' : '' }}">
                        <a href="{{ url('/admin/reports/monthly') }}" class="sidebar-link">
                            <i class="bi bi-bar-chart-fill"></i>
                            <span>Rekap Bulanan</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('admin/reports*') && !request()->is('admin/reports/monthly*') ? 'active' : '' }}">
                        <a href="{{ url('/admin/reports') }}" class="sidebar-link">
                            <i class="bi bi-file-earmark-spreadsheet-fill"></i>
                            <span>Laporan Kehadiran</span>
                        </a>
                    </li>

                    @if(auth()->user()?->isSuperAdmin())
                        <li class="sidebar-title">KONFIGURASI SISTEM</li>
                        <li class="sidebar-item {{ request()->is('admin/settings/attendance*') ? 'active' : '' }}">
                            <a href="{{ url('/admin/settings/attendance') }}" class="sidebar-link">
                                <i class="bi bi-sliders"></i>
                                <span>Pengaturan Absensi</span>
                            </a>
                        </li>
                        <li class="sidebar-item {{ request()->is('admin/whatsapp*') ? 'active' : '' }}">
                            <a href="{{ url('/admin/whatsapp') }}" class="sidebar-link">
                                <i class="bi bi-whatsapp"></i>
                                <span>WhatsApp Gateway</span>
                            </a>
                        </li>
                        <li class="sidebar-item {{ request()->is('admin/notification-logs*') ? 'active' : '' }}">
                            <a href="{{ url('/admin/notification-logs') }}" class="sidebar-link">
                                <i class="bi bi-bell-fill"></i>
                                <span>Log Notifikasi</span>
                            </a>
                        </li>
                        <li class="sidebar-item {{ request()->is('admin/audit-logs*') ? 'active' : '' }}">
                            <a href="{{ url('/admin/audit-logs') }}" class="sidebar-link">
                                <i class="bi bi-shield-lock-fill"></i>
                                <span>Audit Log</span>
                            </a>
                        </li>
                    @endif

                @else
                    {{-- Employee Portal Menu --}}
                    <li class="sidebar-title">PORTAL KARYAWAN</li>
                    <li class="sidebar-item {{ request()->routeIs('employee.dashboard') ? 'active' : '' }}">
                        <a href="{{ route('employee.dashboard') }}" class="sidebar-link">
                            <i class="bi bi-grid-1x2-fill"></i>
                            <span>Dashboard Saya</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('employee/scan-qr*') ? 'active' : '' }}">
                        <a href="{{ url('/employee/scan-qr') }}" class="sidebar-link">
                            <i class="bi bi-qr-code-scan"></i>
                            <span>Scan QR Presensi</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('employee/attendance/history*') ? 'active' : '' }}">
                        <a href="{{ url('/employee/attendance/history') }}" class="sidebar-link">
                            <i class="bi bi-clock-history"></i>
                            <span>Riwayat Presensi</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('employee/leave-requests*') ? 'active' : '' }}">
                        <a href="{{ url('/employee/leave-requests') }}" class="sidebar-link">
                            <i class="bi bi-file-earmark-check-fill"></i>
                            <span>Pengajuan Izin / Cuti</span>
                        </a>
                    </li>
                    <li class="sidebar-item {{ request()->is('employee/profile*') ? 'active' : '' }}">
                        <a href="{{ url('/employee/profile') }}" class="sidebar-link">
                            <i class="bi bi-person-fill"></i>
                            <span>Profil Saya</span>
                        </a>
                    </li>
                @endif

                <li class="sidebar-title">AKUN</li>
                <li class="sidebar-item">
                    <form method="POST" action="{{ route('logout') }}" id="sidebar-logout-form">
                        @csrf
                        <a href="#" onclick="event.preventDefault(); document.getElementById('sidebar-logout-form').submit();" class="sidebar-link text-danger">
                            <i class="bi bi-box-arrow-left text-danger"></i>
                            <span>Keluar (Logout)</span>
                        </a>
                    </form>
                </li>
            </ul>
        </div>
        <button class="sidebar-toggler btn x"><i data-feather="x"></i></button>
    </div>
</div>
