{{define "layout"}}<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>{{.Title}} · lk-emulator</title>
<style>
:root { --bg:#0c1320; --card:#162032; --border:#27334a; --text:#dde6f4; --muted:#7d8aa0; --accent:#6bb5ff; --ok:#3fbf6c; --warn:#e8b13a; --err:#e85a5a; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, 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; background: #0a0f1a; }
header h1 { margin: 0; font-size: 18px; font-weight: 600; }
header h1 .small { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 8px; }
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: 1100px; 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: 18px; margin-bottom: 16px; }
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(107,181,255,0.05); }
a { color: var(--accent); }
code { background: var(--border); padding: 2px 6px; border-radius: 3px; font-size: 12px; }
.muted { color: var(--muted); font-size: 13px; }
form { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 200px 1fr; gap: 12px; align-items: center; }
input[type=text], input[type=number], select { width: 100%; padding: 8px 10px; background: #0a0f1a; border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 14px; }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.btn { background: var(--accent); color: #0a0f1a; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 600; }
.btn:hover { opacity: .85; }
.btn-secondary { background: var(--border); color: var(--text); }
.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(107,181,255,0.15); color: var(--accent); }
.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); }
.notice { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; background: rgba(63,191,108,0.1); border-left: 3px solid var(--ok); }
.notice.error { background: rgba(232,90,90,0.1); border-left-color: var(--err); }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 4px 16px; font-size: 14px; }
.kv > div:nth-child(odd) { color: var(--muted); }
pre { background: #0a0f1a; border: 1px solid var(--border); border-radius: 4px; padding: 12px; font-size: 12px; overflow: auto; max-height: 400px; }
</style>
</head>
<body>
<header>
  <h1>lk-emulator <span class="small">имитация ЛК ESIA Finance</span></h1>
  <nav>
    <a href="/" class="{{if eq .Active "home"}}active{{end}}">Мои заявки</a>
    <a href="/new" class="{{if eq .Active "new"}}active{{end}}">Подать новую</a>
    <a href="{{.GatewayURL}}/admin/help" target="_blank" rel="noopener">Инструкции →</a>
  </nav>
  <span class="muted" style="margin-left:auto">gateway: <code>{{.GatewayURL}}</code></span>
</header>
<main>
{{template "content" .}}
</main>
<script>
{{if .AutoRefresh}}
setTimeout(() => location.reload(), 3000);
{{end}}
</script>
</body>
</html>
{{end}}
