<!DOCTYPE html>
<html lang="{{ t["lang"] }}">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ t["raw_title"] }}</title>
    <link rel="stylesheet" href="/static/style.css">
</head>
<body>
    <div class="header">
        <h1>{{ t["nav_title"] }}</h1>
        <nav>
            <a href="/" class="nav-link">{{ t["nav_keys"] }}</a>
            <a href="/config" class="nav-link">{{ t["nav_config"] }}</a>
            <a href="/config/raw" class="nav-link active">{{ t["nav_raw_edit"] }}</a>
            <a href="/backup" class="nav-link">{{ t["nav_backup_all"] }}</a>
        </nav>
    </div>

    <div class="main" style="max-width:900px;margin:0 auto;">
        <a href="/config" style="color:#1565c0;text-decoration:none;">{{ t["raw_back"] }}</a>

        {% match flash %}
        {% when Some with (msg) %}
        <div class="flash {% if flash_is_error %}flash-error{% else %}flash-success{% endif %}" style="margin-top:12px;">{{ msg }}</div>
        {% when None %}
        {% endmatch %}

        <h2 style="margin:16px 0;">{{ t["raw_heading"] }}</h2>
        <p style="color:#666;margin-bottom:12px;">{{ t["raw_warning"] }}</p>

        <form method="post" action="/config/raw/save">
            <textarea name="content" style="width:100%;height:500px;font-family:monospace;font-size:13px;padding:12px;border:1px solid #ccc;border-radius:4px;tab-size:4;white-space:pre;resize:vertical;">{{ content }}</textarea>
            <div class="form-actions" style="margin-top:12px;">
                <button type="submit" class="btn btn-primary">{{ t["raw_save"] }}</button>
                <a href="/config" class="btn btn-secondary">{{ t["raw_cancel"] }}</a>
            </div>
        </form>
    </div>
</body>
</html>
