<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{{ page_title|default("") }}{% if page_title %} · {% endif %}{{ site_title }}{% endblock %}</title>
{# Inline theme bootstrap. Sets data-rio-theme before CSS is applied
# so the chosen mode lands on the first paint — no flash-of-light on
# dark, no flash-of-dark on light. Reads localStorage["rio-theme"]
# written by admin.js's toggle. Absent / invalid → "system" (no
# attribute set), letting prefers-color-scheme decide. #}
<script>(function(){try{var t=localStorage.getItem("rio-theme");if(t==="light"||t==="dark"){document.documentElement.setAttribute("data-rio-theme",t);}}catch(_){}})();</script>
<link rel="stylesheet" href="/static/admin.css">
{# _theme.html MUST come after admin.css — project token overrides
# win cascade ties on source order without needing !important. #}
{% include "admin/_theme.html" %}
{% block extra_head %}{% endblock %}
</head>
<body class="rio-shell{% if is_demo_session %} rio-shell--demo{% endif %}">
{% if is_demo_session %}
<div class="rio-banner rio-banner--demo" role="status">
DEMO USER{% if demo_label %} ({{ demo_label }}){% endif %} — actions are visible to other operators.
</div>
{% endif %}
{% block topbar %}{% include "admin/_topbar.html" %}{% endblock %}
<div class="rio-layout">
{% block sidebar %}{% if identity %}{% include "admin/_sidebar.html" %}{% endif %}{% endblock %}
<main class="rio-main" id="main">
{% if flash %}
<div class="rio-flash rio-flash--{{ flash.kind }}" role="status">{{ flash.message }}</div>
{% endif %}
{% block content %}{% endblock %}
</main>
</div>
<footer class="rio-footer">{{ footer_copyright }}</footer>
<script src="/static/admin.js" defer></script>
</body>
</html>