:root {
  --bg: #0f1420;
  --panel: #1a2132;
  --panel-2: #212a3f;
  --border: #2c3650;
  --text: #e8ecf4;
  --text-dim: #9aa5bd;
  --accent: #5b8def;
  --accent-2: #37c9a1;
  --danger: #e2607a;
  --warn: #e2b74f;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

a { color: var(--accent); }

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.top h1 {
  font-size: 18px;
  margin: 0;
}

header.top nav a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}
header.top nav a.active { color: var(--text); font-weight: 600; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card h2 {
  margin: 0 0 12px 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin: 10px 0 4px;
}

input, select, textarea {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}

textarea { resize: vertical; min-height: 60px; }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  margin-top: 12px;
}
button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); }

.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
ul.list li:last-child { border-bottom: none; }
ul.list li .meta { color: var(--text-dim); font-size: 12px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge.ok { background: rgba(55,201,161,0.15); color: var(--accent-2); }
.badge.warn { background: rgba(226,183,79,0.15); color: var(--warn); }
.badge.danger { background: rgba(226,96,122,0.15); color: var(--danger); }

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat .value { font-size: 28px; font-weight: 700; }
.stat .label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

.icon-btn {
  background: transparent;
  color: var(--text-dim);
  padding: 2px 8px;
  margin: 0;
  font-size: 16px;
}
.icon-btn:hover { color: var(--danger); }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}
.login-card h1 { font-size: 18px; margin-bottom: 20px; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 16px; }
