:root {
  --bg: #0b0d10;
  --panel: #141a22;
  --panel2: #1a222d;
  --border: #2a3544;
  --text: #e7eef7;
  --muted: #93a4b8;
  --accent: #6ec6ff;
  --ok: #3dd68c;
  --warn: #f0b429;
  --danger: #ff6b6b;
  --input: #0f141b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, "Segoe UI", sans-serif; }
a { color: var(--accent); }
header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11,13,16,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
}
header h1 { font-size: 16px; margin: 0; font-weight: 650; }
header .sub { color: var(--muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button, .btn {
  appearance: none; border: 1px solid var(--border); background: var(--panel2);
  color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer;
}
button.primary { background: #1b3a55; border-color: #2d6ea3; color: #d7efff; }
button.ok { background: #163528; border-color: #2f8f5b; color: #d8ffea; }
button:hover { filter: brightness(1.08); }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 64px); }
nav {
  border-right: 1px solid var(--border); padding: 12px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto;
}
nav button {
  width: 100%; text-align: left; margin-bottom: 6px; background: transparent;
}
nav button.active { background: var(--panel2); border-color: #3d5673; color: var(--accent); }
main { padding: 16px 18px 80px; max-width: 1100px; }
.section { display: none; }
.section.active { display: block; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 6px; font-size: 16px; }
.card h3 { margin: 14px 0 8px; font-size: 14px; color: #cfe3f7; }
.hint { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.field input, label.field select, textarea {
  background: var(--input); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font: inherit;
}
textarea { width: 100%; min-height: 90px; resize: vertical; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: left; }
th { color: var(--muted); font-weight: 600; }
td input { width: 100%; max-width: 110px; background: var(--input); border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 8px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.toast {
  position: fixed; right: 16px; bottom: 16px; background: #163528; border: 1px solid #2f8f5b;
  color: #d8ffea; padding: 10px 14px; border-radius: 10px; display: none; z-index: 50;
}
.toast.show { display: block; }
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 40; padding: 16px;
}
.modal-bg.show { display: flex; }
.modal {
  width: min(720px, 100%); max-height: 80vh; overflow: auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
}
.modal pre {
  white-space: pre-wrap; word-break: break-word; background: var(--input); padding: 12px; border-radius: 8px; font-size: 12px;
}
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  nav { position: relative; top: 0; height: auto; display: flex; gap: 6px; overflow: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  nav button { width: auto; white-space: nowrap; }
}
