<aside class="flex w-64 shrink-0 flex-col border-r border-slate-800 bg-slate-900 text-slate-100">
    <div class="border-b border-slate-800 px-6 py-5">
        <a href="{{ route('dashboard') }}" class="text-lg font-semibold tracking-tight text-white">
            ImóvelZapAi
        </a>
        <p class="mt-1 text-xs text-slate-400">Corretor digital</p>
    </div>

    <nav class="flex-1 px-3 py-4" aria-label="Menu principal">
        <ul class="space-y-1">
            <li>
                <a
                    href="{{ route('dashboard') }}"
                    @class([
                        'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                        'bg-emerald-600 text-white' => request()->routeIs('dashboard'),
                        'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('dashboard'),
                    ])
                >
                    Dashboard
                </a>
            </li>

            @auth
                @if (auth()->user()->hasAnyRole(['Admin', 'Gestor', 'Corretor']))
                    <li>
                        <a
                            href="{{ route('properties.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('properties.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('properties.*'),
                            ])
                        >
                            Imóveis
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('publishing.center') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('publishing.center'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('publishing.center'),
                            ])
                        >
                            Publicação
                        </a>
                    </li>
                    @if (auth()->user()->hasAnyRole(['Admin', 'Gestor']))
                        <li>
                            <a
                                href="{{ route('importing.index') }}"
                                @class([
                                    'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                    'bg-emerald-600 text-white' => request()->routeIs('importing.*'),
                                    'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('importing.*'),
                                ])
                            >
                                Importação
                            </a>
                        </li>
                    @endif
                    <li>
                        <a
                            href="{{ route('people.inbox') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('people.inbox'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('people.inbox'),
                            ])
                        >
                            Caixa de entrada
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('people.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('people.index', 'people.show', 'handoff.*') && ! request()->routeIs('people.inbox'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('people.index', 'people.show', 'handoff.*') || request()->routeIs('people.inbox'),
                            ])
                        >
                            Pessoas
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('visits.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('visits.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('visits.*'),
                            ])
                        >
                            Visitas
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('sales.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('sales.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('sales.*'),
                            ])
                        >
                            Oportunidades
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('owners.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('owners.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('owners.*'),
                            ])
                        >
                            Proprietários
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('client-portals.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('client-portals.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('client-portals.*'),
                            ])
                        >
                            Portais
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('documents.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('documents.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('documents.*'),
                            ])
                        >
                            Documentos
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('signatures.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('signatures.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('signatures.*'),
                            ])
                        >
                            Assinaturas
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('financial.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('financial.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('financial.*'),
                            ])
                        >
                            Financeiro
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('automation.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('automation.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('automation.*'),
                            ])
                        >
                            Automações
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('analytics.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('analytics.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('analytics.*'),
                            ])
                        >
                            Indicadores
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('whatsapp.settings') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('whatsapp.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('whatsapp.*'),
                            ])
                        >
                            WhatsApp
                        </a>
                    </li>
                    <li>
                        <a
                            href="{{ route('settings.index') }}"
                            @class([
                                'flex items-center rounded-lg px-3 py-2 text-sm font-medium transition',
                                'bg-emerald-600 text-white' => request()->routeIs('settings.*', 'organizations.*', 'billing.*', 'users.*', 'brokers.*', 'permissions.*'),
                                'text-slate-300 hover:bg-slate-800 hover:text-white' => ! request()->routeIs('settings.*', 'organizations.*', 'billing.*', 'users.*', 'brokers.*', 'permissions.*'),
                            ])
                        >
                            Configurações
                        </a>
                    </li>
                @endif
            @endauth
        </ul>
    </nav>
</aside>
