{% extends "base_shell.html" %}

{# Child templates override 'title' block directly #}

{% block sidebar_subtitle %}Admin Panel{% endblock %}

{% block sidebar_nav %}
    {% set menu_items = [
        ('dashboard', '/admin', 'gauge', 'Dashboard'),
        ('mcp-servers', '/admin/mcp-servers', 'server', 'MCP Servers'),
        ('mcp-activity', '/admin/mcp-activity', 'activity', 'MCP Activity'),
        ('users', '/admin/users', 'users', 'Users'),
        ('oauth-clients', '/admin/oauth-clients', 'key-round', 'OAuth Clients'),
        ('logs', '/admin/logs', 'clock', 'Auth Logs'),
        ('security-logs', '/admin/security-logs', 'shield-alert', 'Security Events'),
        ('mcp-audit', '/admin/mcp-audit', 'shield-check', 'Security Audit'),
        ('settings', '/admin/settings', 'settings', 'Settings')
    ] %}

    {% for page_id, url, icon, label in menu_items %}
    <a
        href="{{ url }}"
        @click="mobileMenuOpen = false"
        class="flex items-center px-3 py-3 rounded-lg transition-all group
               {% if active_page == page_id %}
               bg-white/20 shadow-lg
               {% else %}
               hover:bg-white/10
               {% endif %}"
    >
        <i data-lucide="{{ icon }}" class="w-5 h-5 min-w-[20px]"></i>
        <span x-show="sidebarOpen" class="ml-3 font-medium slide-in">{{ label }}</span>
        {% if active_page == page_id %}
        <span x-show="sidebarOpen" class="ml-auto w-1.5 h-1.5 bg-white rounded-full"></span>
        {% endif %}
    </a>
    {% endfor %}
{% endblock %}

{% block logout_url %}/admin/logout{% endblock %}
