@php
    $is = fn ($pattern) => request()->routeIs($pattern);
@endphp
<div class="dlabnav">
    <div class="dlabnav-scroll">
        <ul class="metismenu" id="menu">
            <li class="{{ $is('admin.dashboard') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.dashboard') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-home"></i>
                    <span class="nav-text">Dashboard</span>
                </a>
            </li>




            <li class="{{ $is('admin.notifications.*') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.notifications.index') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-bell"></i>
                    <span class="nav-text">Bildirim Merkezi</span>
                    @php
                        try {
                            $dwUnreadNotificationCount = app(\App\Services\Notifications\NotificationCenterService::class)->unreadCount();
                        } catch (\Throwable $e) {
                            $dwUnreadNotificationCount = 0;
                        }
                    @endphp
                    @if($dwUnreadNotificationCount > 0)
                        <span class="badge badge-danger ml-2">{{ $dwUnreadNotificationCount > 99 ? '99+' : $dwUnreadNotificationCount }}</span>
                    @endif
                </a>
            </li>

            <li class="{{ $is('admin.operations.*') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.operations.index') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-network"></i>
                    <span class="nav-text">Operasyon Merkezi</span>
                </a>
            </li>



            <li class="{{ $is('admin.management-reports.*') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.management-reports.index') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-list"></i>
                    <span class="nav-text">Ajans KPI Raporu</span>
                </a>
            </li>

            <li class="{{ $is('admin.health-scores.*') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.health-scores.index') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-heart"></i>
                    <span class="nav-text">Sağlık Skoru</span>
                </a>
            </li>

            <li class="{{ $is('admin.task-board.*') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.task-board.index') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-check"></i>
                    <span class="nav-text">Görev Panosu</span>
                </a>
            </li>

            <li class="{{ $is('admin.clients.*') || $is('admin.onboarding.*') || $is('admin.first-report.*') ? 'mm-active' : '' }}">
                <a class="has-arrow ai-icon" href="javascript:void(0);" aria-expanded="false">
                    <i class="flaticon-381-user-7"></i>
                    <span class="nav-text">Müşteriler</span>
                </a>
                <ul aria-expanded="false">
                    <li><a href="{{ route('admin.clients.index') }}">Müşteri Listesi</a></li>
                    <li><a href="{{ route('admin.clients.create') }}">Yeni Müşteri</a></li>
                    <li><a href="{{ route('admin.onboarding.index') }}">Onboarding Sihirbazı</a></li>
                    <li><a href="{{ route('admin.onboarding.start') }}">Hızlı Kurulum Başlat</a></li>
                    <li><a href="{{ route('admin.first-report.index') }}">İlk Rapor Sihirbazı</a></li>
                </ul>
            </li>

            <li class="{{ $is('admin.accounts.*') ? 'mm-active' : '' }}">
                <a class="has-arrow ai-icon" href="javascript:void(0);" aria-expanded="false">
                    <i class="flaticon-381-link"></i>
                    <span class="nav-text">Reklam Hesapları</span>
                </a>
                <ul aria-expanded="false">
                    <li><a href="{{ route('admin.accounts.google-ads.index') }}">Google Ads</a></li>
                    <li><a href="{{ route('admin.accounts.meta-ads.index') }}">Meta Ads</a></li>
                    <li><a href="{{ route('admin.accounts.search-console.index') }}">Search Console</a></li>
                    <li><a href="{{ route('admin.accounts.ga4.index') }}">GA4</a></li>
                </ul>
            </li>

            <li class="{{ $is('admin.integrations.discovery.*') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.integrations.discovery.index') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-search-2"></i>
                    <span class="nav-text">Hesap Keşfi</span>
                </a>
            </li>

            <li class="{{ $is('admin.integrations.preview.*') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.integrations.preview.index') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-list"></i>
                    <span class="nav-text">Veri Önizleme</span>
                </a>
            </li>

            <li class="{{ $is('admin.sync.*') ? 'mm-active' : '' }}">
                <a class="has-arrow ai-icon" href="javascript:void(0);" aria-expanded="false">
                    <i class="flaticon-381-refresh"></i>
                    <span class="nav-text">Veri İşlemleri</span>
                </a>
                <ul aria-expanded="false">
                    <li><a href="{{ route('admin.sync.index') }}">Veri Senkronizasyonu</a></li>
                    <li><a href="{{ route('admin.sync.quality') }}">Veri Kalite Kontrolü</a></li>
                </ul>
            </li>

            <li class="{{ $is('admin.performance.*') ? 'mm-active' : '' }}">
                <a class="has-arrow ai-icon" href="javascript:void(0);" aria-expanded="false">
                    <i class="flaticon-381-chart"></i>
                    <span class="nav-text">Performans</span>
                </a>
                <ul aria-expanded="false">
                    <li><a href="{{ route('admin.performance.index') }}">Genel Özet</a></li>
                    <li><a href="{{ route('admin.performance.platform', 'google_ads') }}">Google Ads</a></li>
                    <li><a href="{{ route('admin.performance.platform', 'meta_ads') }}">Meta Ads</a></li>
                    <li><a href="{{ route('admin.performance.platform', 'search_console') }}">Search Console</a></li>
                    <li><a href="{{ route('admin.performance.platform', 'ga4') }}">GA4</a></li>
                </ul>
            </li>

            <li class="{{ $is('admin.reports.*') || $is('admin.report-templates.*') || $is('admin.brand-kits.*') ? 'mm-active' : '' }}">
                <a class="has-arrow ai-icon" href="javascript:void(0);" aria-expanded="false">
                    <i class="flaticon-381-notepad"></i>
                    <span class="nav-text">Raporlar</span>
                </a>
                <ul aria-expanded="false">
                    <li><a href="{{ route('admin.reports.index') }}">Rapor Listesi</a></li>
                    <li><a href="{{ route('admin.reports.create') }}">Rapor Oluştur</a></li>
                    <li><a href="{{ route('admin.reports.archive') }}">Rapor Arşivi</a></li>
                    <li><a href="{{ route('admin.report-templates.index') }}">Rapor Şablonları</a></li>
                    <li><a href="{{ route('admin.brand-kits.index') }}">Marka Kitleri</a></li>
                </ul>
            </li>

            <li class="{{ $is('admin.report-schedules.*') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.report-schedules.index') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-time"></i>
                    <span class="nav-text">Zamanlama</span>
                </a>
            </li>

            <li class="{{ $is('admin.alert-rules.*') || $is('admin.alert-logs.*') ? 'mm-active' : '' }}">
                <a class="has-arrow ai-icon" href="javascript:void(0);" aria-expanded="false">
                    <i class="flaticon-381-warning"></i>
                    <span class="nav-text">Uyarılar</span>
                </a>
                <ul aria-expanded="false">
                    <li><a href="{{ route('admin.alert-rules.index') }}">Uyarı Kuralları</a></li>
                    <li><a href="{{ route('admin.alert-logs.index') }}">Uyarı Geçmişi</a></li>
                </ul>
            </li>

            <li class="{{ $is('admin.ai.*') ? 'mm-active' : '' }}">
                <a href="{{ route('admin.ai.settings') }}" class="ai-icon" aria-expanded="false">
                    <i class="flaticon-381-idea"></i>
                    <span class="nav-text">AI Yorumları</span>
                </a>
            </li>

            <li class="{{ $is('admin.mail.*') ? 'mm-active' : '' }}">
                <a class="has-arrow ai-icon" href="javascript:void(0);" aria-expanded="false">
                    <i class="flaticon-381-send"></i>
                    <span class="nav-text">Mail</span>
                </a>
                <ul aria-expanded="false">
                    <li><a href="{{ route('admin.mail.settings') }}">SMTP Ayarları</a></li>
                    <li><a href="{{ route('admin.mail.logs') }}">Gönderim Logları</a></li>
                </ul>
            </li>

            <li class="{{ $is('admin.system.*') ? 'mm-active' : '' }}">
                <a class="has-arrow ai-icon" href="javascript:void(0);" aria-expanded="false">
                    <i class="flaticon-381-settings-2"></i>
                    <span class="nav-text">Sistem</span>
                </a>
                <ul aria-expanded="false">
                    <li><a href="{{ route('admin.system.health') }}">Kurulum Kontrolü</a></li>
                    <li><a href="{{ route('admin.system.settings') }}">Genel Ayarlar</a></li>
                    <li><a href="{{ route('admin.system.queue') }}">Cron / Queue</a></li>
                    <li><a href="{{ route('admin.system.token-vault') }}">Token Kasası</a></li>
                    <li><a href="{{ route('admin.system.api-sdk') }}">API SDK Durumu</a></li>
                    <li><a href="{{ route('admin.system.logs') }}">Loglar</a></li>
                </ul>
            </li>
        </ul>

        <div class="copyright">
            <p><strong>DW Ads Reporter</strong> © {{ date('Y') }}</p>
            <p>Datweb reklam raporlama paneli</p>
        </div>
    </div>
</div>
