{% extends "base.html" %}

{% block head %}
<style>
  :root {
    --bg: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --surface: #ffffff;
    --border: #e2e8f0;
    --primary: #ea580c;
  }

  * {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    font-family: Inter, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
  }

  .layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
  }

  .sidebar {
    background: #0f172a;
    color: #f8fafc;
    padding: 1.25rem 1rem;
  }

  .brand {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 1rem;
  }

  .menu a {
    display: block;
    text-decoration: none;
    color: #cbd5e1;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.4rem;
  }

  .menu a.active,
  .menu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
  }

  .content-wrap {
    padding: 1.25rem;
  }

  .topbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
  }

  .topbar h1 {
    margin: 0;
    font-size: 1.2rem;
  }

  .logout {
    text-decoration: none;
    background: #fff7ed;
    color: var(--primary);
    border: 1px solid #fdba74;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
  }

  .grid {
    display: grid;
    gap: 1rem;
  }

  .cards-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
  }

  .label {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
  }

  .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
  }

  table {
    width: 100%;
    border-collapse: collapse;
  }

  th,
  td {
    text-align: left;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0.4rem;
    font-size: 0.92rem;
  }

  @media (max-width: 900px) {
    .layout {
      grid-template-columns: 1fr;
    }

    .cards-3 {
      grid-template-columns: 1fr;
    }
  }
</style>
{% endblock %}

{% block content %}
<div class="layout">
  <aside class="sidebar">
    <p class="brand">Ethio-gebeya</p>
    <nav class="menu">
      <a href="{% url 'buyer_dashboard' %}" class="{% if active_tab == 'buyer' %}active{% endif %}">Buyer Dashboard</a>
      <a href="{% url 'seller_dashboard' %}" class="{% if active_tab == 'seller' %}active{% endif %}">Seller Dashboard</a>
      <a href="{% url 'home' %}">Home</a>
    </nav>
  </aside>
  <main class="content-wrap">
    <header class="topbar">
      <h1>{{ dashboard_title }}</h1>
      <a class="logout" href="{% url 'logout' %}">Sign Out</a>
    </header>
    {% block dashboard_content %}{% endblock %}
  </main>
</div>
{% endblock %}
