{{define "layout"}}<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>{{.Title}} · lk-gateway</title>
<style>
:root { --bg:#0f1115; --card:#1a1d24; --border:#2a2f3a; --text:#e8eaed; --muted:#8b94a3; --accent:#5b9dff; --ok:#3fbf6c; --warn:#e8b13a; --err:#e85a5a; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }
header { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 24px; }
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
header nav a { color: var(--muted); text-decoration: none; margin-right: 16px; font-size: 14px; }
header nav a:hover, header nav a.active { color: var(--text); }
main { padding: 24px; max-width: 1280px; margin: 0 auto; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 6px; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 22px; font-weight: 600; margin-top: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: rgba(91,157,255,0.05); }
a { color: var(--accent); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge.draft, .badge.validated, .badge.submitted_to_nsd { background: rgba(91,157,255,0.15); color: #5b9dff; }
.badge.awaiting_decision { background: rgba(232,177,58,0.15); color: var(--warn); }
.badge.confirmed, .badge.awaiting_sub16, .badge.done { background: rgba(63,191,108,0.15); color: var(--ok); }
.badge.rejected, .badge.timed_out { background: rgba(232,90,90,0.15); color: var(--err); }
.badge.manual_approval { background: rgba(232,177,58,0.15); color: var(--warn); }
code { background: var(--border); padding: 2px 6px; border-radius: 3px; font-size: 12px; }
.muted { color: var(--muted); font-size: 13px; }
pre { background: #0a0c10; border: 1px solid var(--border); border-radius: 4px; padding: 12px; font-size: 12px; overflow: auto; max-height: 400px; }
button, .btn { background: var(--accent); color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; }
button:hover, .btn:hover { opacity: .9; }
</style>
</head>
<body>
<header>
  <h1>lk-gateway</h1>
  <nav>
    <a href="/admin/" class="{{if eq .Active "home"}}active{{end}}">Дашборд</a>
    <a href="/admin/wizard" class="{{if eq .Active "wizard"}}active{{end}}">Мастер настройки</a>
    <a href="/admin/setup" class="{{if eq .Active "setup"}}active{{end}}">Настройка</a>
    <a href="/admin/news" class="{{if eq .Active "news"}}active{{end}}">Новости</a>
    <a href="/admin/claims" class="{{if eq .Active "claims"}}active{{end}}">Заявки</a>
    <a href="/admin/status" class="{{if eq .Active "status"}}active{{end}}">Статус системы</a>
    <a href="/admin/help" class="{{if eq .Active "help"}}active{{end}}">Инструкции</a>
  </nav>
  <span class="muted" style="margin-left:auto">{{.Now}}</span>
</header>
<main>
{{template "content" .}}
</main>
</body>
</html>
{{end}}
