<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{% block title %}MoMoLedger{% endblock %}</title>
  <meta name="description" content="{% block meta_description %}{{ meta_description|default:project_description }}{% endblock %}">
  {% if project_image_url %}
  <meta property="og:image" content="{{ project_image_url }}">
  <meta property="twitter:image" content="{{ project_image_url }}">
  {% endif %}
  <meta name="author" content="MoMoLedger">
  <meta name="keywords" content="momo, mobile money, cash-in, cash-out, wallet report">
  <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;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
  {% load static %}
  <link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
  {% block head %}{% endblock %}
</head>
<body>
  <div class="page-shell">
    <header class="site-header sticky-top">
      <nav class="navbar navbar-expand-lg navbar-dark px-3 px-lg-4 py-3 momo-nav">
        <div class="container-fluid px-0">
          <a class="navbar-brand d-flex align-items-center gap-3" href="{% url 'home' %}">
            <span class="brand-badge">M</span>
            <span>
              <span class="brand-name">MoMoLedger</span>
              <small class="brand-subtitle d-block">Agent cashflow cockpit</small>
            </span>
          </a>
          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="mainNav">
            <ul class="navbar-nav ms-auto align-items-lg-center gap-lg-2">
              <li class="nav-item"><a class="nav-link" href="{% url 'home' %}">Home</a></li>
              <li class="nav-item"><a class="nav-link" href="{% url 'transaction_list' %}">Transactions</a></li>
              <li class="nav-item"><a class="nav-link" href="{% url 'reports' %}">Reports</a></li>
              <li class="nav-item"><a class="nav-link" href="{% url 'profile' %}">Business setup</a></li>
              <li class="nav-item"><a class="nav-link" href="/admin/">Admin</a></li>
              {% if request.user.is_authenticated %}
              <li class="nav-item ms-lg-3"><a class="btn btn-momo-ghost" href="{% url 'logout' %}">Log out</a></li>
              {% else %}
              <li class="nav-item ms-lg-3"><a class="btn btn-momo-ghost" href="{% url 'login' %}">Log in</a></li>
              <li class="nav-item"><a class="btn btn-momo-primary" href="{% url 'signup' %}">Sign up</a></li>
              {% endif %}
            </ul>
          </div>
        </div>
      </nav>
    </header>

    <main>
      <div class="container py-4 py-lg-5">
        {% if messages %}
        <div class="message-stack mb-4">
          {% for message in messages %}
          <div class="alert alert-{{ message.tags|default:'info' }} shadow-sm border-0" role="alert">{{ message }}</div>
          {% endfor %}
        </div>
        {% endif %}
        {% block content %}{% endblock %}
      </div>
    </main>
  </div>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
  {% block scripts %}{% endblock %}
</body>
</html>
