{{-- resources/views/layouts/navigation.blade.php --}}

<aside class="sb" id="sidebar">

    {{-- ── LOGO HEADER ── --}}
    <div class="sb-head">
        <div class="sb-logo">
            <img src="{{ asset('images/logo tirta sanjiwani.png') }}" alt="logo tirta sanjiwani"
                 style="width:36px; height:36px; object-fit:contain; filter: brightness(0) invert(1);">
        </div>
        <div class="sb-wordmark">
            <div class="sb-wordmark-main">SIPDAM</div>
            <div class="sb-wordmark-sub">Tirta Sanjiwani</div>
        </div>
    </div>

    {{-- ── NAVIGATION ── --}}
    <ul class="sb-nav">

        {{-- Dashboard --}}
        <li>
            <a href="{{ route('dashboard') }}"
               class="{{ request()->routeIs('dashboard') ? 'active' : '' }}">
                <i class="fas fa-th-large"></i>
                <span>Dashboard</span>
            </a>
        </li>

        {{-- ── TEKNISI ── --}}
        <li class="menu-section">Teknisi</li>

        <li class="menu-toggle {{ request()->routeIs('teknisi.*') || request()->routeIs('akun-teknisi.*') || request()->routeIs('absensi.*') ? 'active' : '' }}">
            <a href="javascript:void(0)" class="menu-parent">
                <i class="fas fa-users"></i>
                <span>Kelola Teknisi</span>
                <i class="fas fa-chevron-down toggle-icon"></i>
            </a>
            <ul class="submenu">
                <li>
                    <a href="{{ route('teknisi.index') }}"
                       class="{{ request()->routeIs('teknisi.index') ? 'active' : '' }}">
                        <i class="fas fa-id-badge" style="color:#0d9488;"></i>
                        <span>Data Teknisi</span>
                    </a>
                </li>
                <li>
                    <a href="{{ route('akun-teknisi.index') }}"
                       class="{{ request()->routeIs('akun-teknisi.*') ? 'active' : '' }}">
                        <i class="fas fa-user-shield" style="color:#7c3aed;"></i>
                        <span>Akun Teknisi</span>
                    </a>
                </li>
                <li>
                    <a href="{{ route('absensi.index') }}"
                       class="{{ request()->routeIs('absensi.*') ? 'active' : '' }}">
                        <i class="fas fa-fingerprint" style="color:#2563eb;"></i>
                        <span>Absensi</span>
                    </a>
                </li>
            </ul>
        </li>

        {{-- ── PEKERJAAN ── --}}
        <li class="menu-section">Pekerjaan</li>

        <li class="menu-toggle {{ request()->routeIs('pekerjaan.*') ? 'active' : '' }}">
            <a href="javascript:void(0)" class="menu-parent">
                <i class="fas fa-briefcase"></i>
                <span>Kelola Pekerjaan</span>
                <i class="fas fa-chevron-down toggle-icon"></i>
            </a>
            <ul class="submenu">
                <li>
                    <a href="{{ route('pekerjaan.penugasan.index') }}"
                       class="{{ request()->routeIs('pekerjaan.penugasan.*') ? 'active' : '' }}">
                        <i class="fas fa-tasks" style="color:#1a7a4a;"></i>
                        <span>Data Penugasan</span>
                    </a>
                </li>
                <li>
                    <a href="{{ route('pekerjaan.monitoring') }}"
                       class="{{ request()->routeIs('pekerjaan.monitoring') ? 'active' : '' }}">
                        <i class="fas fa-chart-line" style="color:#d97706;"></i>
                        <span>Monitoring Progres</span>
                    </a>
                </li>
            </ul>
        </li>

        {{-- ── KEUANGAN ── --}}
        <li class="menu-section">Keuangan</li>

        <li class="menu-toggle {{ request()->routeIs('gaji.*') || request()->routeIs('penggajian.*') || request()->routeIs('kasbon.*') ? 'active' : '' }}">
            <a href="javascript:void(0)" class="menu-parent">
                <i class="fas fa-money-bill-wave"></i>
                <span>Gaji & Kasbon</span>
                <i class="fas fa-chevron-down toggle-icon"></i>
            </a>
            <ul class="submenu">
                <li>
                    <a href="{{ route('penggajian.index') }}"
                       class="{{ request()->routeIs('penggajian.*') ? 'active' : '' }}">
                        <i class="fas fa-calculator" style="color:#d97706;"></i>
                        <span>Perhitungan Gaji</span>
                    </a>
                </li>
                <li>
                    <a href="{{ route('kasbon.index') }}"
                       class="{{ request()->routeIs('kasbon.*') ? 'active' : '' }}">
                        <i class="fas fa-hand-holding-usd" style="color:#dc2626;"></i>
                        <span>Data Kasbon</span>
                    </a>
                </li>
            </ul>
        </li>

        <li>
            <a href="{{ route('laporan.index') }}"
               class="{{ request()->routeIs('laporan.*') ? 'active' : '' }}">
                <i class="fas fa-chart-bar" style="color:#0ea5e9;"></i>
                <span>Laporan</span>
            </a>
        </li>



    </ul>

    {{-- ── USER PROFILE BOTTOM ── --}}
    <div class="sb-bottom">
        <a href="{{ route('profile.edit') }}" class="sb-user" style="text-decoration: none; cursor: pointer;">
            <div class="sb-avatar" style="padding: 2px; background: #fff; border: 2px solid var(--pug-border);">
                <img src="https://ui-avatars.com/api/?name={{ urlencode(Auth::user()->name) }}&background=0d9488&color=fff&rounded=true&bold=true" alt="Profile" style="width: 100%; height: 100%; object-fit: cover;">
            </div>
            <div class="sb-user-info">
                <div class="sb-user-name">{{ Auth::user()->name }}</div>
                <div class="sb-user-email">{{ Auth::user()->email }}</div>
            </div>
        </a>
        <form method="POST" action="{{ route('logout') }}">
            @csrf
            <button type="submit" class="sb-logout-btn">
                <i class="fas fa-sign-out-alt"></i>
                <span>Logout</span>
            </button>
        </form>
    </div>

</aside>