<!-- templates/base.html -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}SBMS Connect Sistem Kasir{% endblock %}</title>

    <!-- Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>

    {% block extra_css %}{% endblock %}
</head>

<body class="bg-gray-100">
    <!-- Navbar -->
    <nav class="bg-white shadow-lg">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16">
                <div class="flex">
                    <!-- Logo -->
                    <div class="flex-shrink-0 flex flex-col self-center">
                        <span class="text-xl font-bold text-gray-800">SBMS Connect</span>
                        <span class="text-sm font-medium text-gray-700">Sistem Kasir</span>
                    </div>

                    <!-- Navigation Links -->
                    <div class="hidden sm:ml-12 sm:flex sm:space-x-8">
                        <a href="{% url 'admin:transaction_transaction_changelist' %}"
                            class="inline-flex items-center px-1 pt-1 text-sm font-medium text-gray-900">
                            Admin Panel
                        </a>
                        <a href="{% url 'report' %}"
                            class="inline-flex items-center px-1 pt-1 text-sm font-medium text-gray-900">
                            Report
                        </a>
                        {% if perms.transaction.add_transaction or perms.transaction.change_transaction %}
                        <a href="{% url 'cashier' %}"
                            class="inline-flex items-center px-1 pt-1 text-sm font-medium text-gray-900">
                            Cashier
                        </a>
                        {% endif %}
                        <!-- Add more navigation links as needed -->
                    </div>
                </div>

                <!-- User Menu -->
                <div class="flex items-center">
                    {% if user.is_authenticated %}
                    <span class="text-sm text-gray-700">Hai {{ user.username }}</span>

                    <!-- Logout Form -->
                    <form action="{% url 'admin:logout' %}" method="post" style="display: inline;">
                        {% csrf_token %}
                        <button type="submit" class="ml-4 text-sm font-medium text-gray-700 hover:text-gray-900">
                            Logout
                        </button>
                    </form>
                    {% endif %}
                </div>

            </div>
        </div>
    </nav>

    <!-- Main Content -->
    <main>
        {% block content %}{% endblock %}
    </main>

    <!-- Footer -->
    <footer class="bg-white shadow-lg mt-8">
        <div class="max-w-7xl mx-auto py-4 px-4 sm:px-6 lg:px-8">
            <p class="text-center text-sm text-gray-500">
                © {% now "Y" %} SBMS Connect. All rights reserved.
            </p>
        </div>
    </footer>

    {% block extra_js %}{% endblock %}
</body>

</html>