{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}AGRO LINK CENTER{% endblock %}</title>
    
    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Roboto:wght@400;500&display=swap" rel="stylesheet">
    
    <!-- Bootstrap 5 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <!-- Custom CSS -->
    <link rel="stylesheet" href="{% static 'css/custom.css' %}">
    
    {% block head %}{% endblock %}
</head>
<body>

    <!-- Sidebar -->
    <nav class="sidebar">
        <div class="sidebar-brand">
            <i class="fas fa-leaf"></i>
            <span>AGRO LINK</span>
        </div>
        <div class="d-flex flex-column py-3">
            <a href="{% url 'dashboard' %}" class="nav-link {% if request.resolver_match.url_name == 'dashboard' %}active{% endif %}">
                <i class="fas fa-th-large"></i> Dashboard
            </a>
            
            <div class="text-uppercase small text-muted px-4 mt-3 mb-2">Management Modules</div>
            
            <a href="#" class="nav-link">
                <i class="fas fa-id-card"></i> Registration & KYC
            </a>
            <a href="#" class="nav-link">
                <i class="fas fa-tractor"></i> Farm Licenses
            </a>
            <a href="#" class="nav-link">
                <i class="fas fa-chart-pie"></i> Quota Mgmt
            </a>
            <a href="#" class="nav-link">
                <i class="fas fa-ship"></i> Trade (Imp/Exp)
            </a>
            <a href="#" class="nav-link">
                <i class="fas fa-seedling"></i> E-Phytosanitary
            </a>
            <a href="#" class="nav-link">
                <i class="fas fa-industry"></i> Processing Plants
            </a>
             <a href="#" class="nav-link">
                <i class="fas fa-tree"></i> Forest Mgmt
            </a>
            
            <div class="mt-auto px-4 pb-4">
                 <div class="p-3 bg-light rounded text-center">
                    <small class="d-block text-muted">Logged in as</small>
                    <strong>Admin</strong>
                    <a href="#" class="d-block small text-danger mt-1">Logout</a>
                 </div>
            </div>
        </div>
    </nav>

    <!-- Main Content -->
    <main class="main-content">
        <!-- Header -->
        <header class="d-flex justify-content-between align-items-center mb-4 pb-3 border-bottom">
            <div>
                <h2 class="h4 mb-0">{% block page_title %}Overview{% endblock %}</h2>
                <small class="text-muted">Welcome to Agro Link Center Management System</small>
            </div>
            <div class="d-flex align-items-center gap-3">
                <button class="btn btn-light position-relative">
                    <i class="fas fa-bell"></i>
                    <span class="position-absolute top-0 start-100 translate-middle p-1 bg-danger border border-light rounded-circle"></span>
                </button>
                 <a href="/admin/" class="btn btn-outline-secondary btn-sm">
                    <i class="fas fa-cogs"></i> System Admin
                </a>
            </div>
        </header>

        <!-- Messages -->
        {% if messages %}
            {% for message in messages %}
                <div class="alert alert-{{ message.tags }} alert-dismissible fade show" role="alert">
                    {{ message }}
                    <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                </div>
            {% endfor %}
        {% endif %}

        {% block content %}
        {% endblock %}
    </main>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    {% block scripts %}{% endblock %}
</body>
</html>