:root {
  --bg: #12141a;
  --surface: #1a1d25;
  --surface-alt: #21252f;
  --border: #2c313d;
  --text: #e7e5e0;
  --text-muted: #8b92a3;
  --accent: #e8a33d;
  --accent-dim: #7a5a26;
  --success: #4caf7d;
  --error: #e2685a;
  --radius: 6px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar .brand {
  font-weight: 600;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar .brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.topbar a.logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
}
.topbar a.logout:hover { color: var(--text); }

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px;
}

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 12px; color: var(--text); }
p.lede { color: var(--text-muted); margin: 0 0 24px; font-size: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: none; }
tr:last-child td { border-bottom: none; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; }
.status.on .dot { background: var(--success); }
.status.off .dot { background: var(--text-muted); }
.status.error .dot { background: var(--error); }

a.botlink { color: var(--text); text-decoration: none; font-weight: 500; }
a.botlink:hover { color: var(--accent); }

form.inline { display: inline; }

button, input[type=submit] {
  background: var(--accent);
  color: #1a1206;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
button:hover { opacity: 0.9; }

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
button.ghost:hover { color: var(--text); border-color: var(--text-muted); }

button.danger { background: var(--error); color: #2a0f0c; }

input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--sans);
}
textarea { min-height: 80px; resize: vertical; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 5px; }

.row { display: flex; gap: 12px; }
.row .field { flex: 1; }

.mono { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }

.empty {
  color: var(--text-muted);
  font-size: 14px;
  padding: 20px 0;
  text-align: center;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.login-box h1 { font-size: 18px; margin-bottom: 18px; }
.error-msg { color: var(--error); font-size: 13px; margin: 10px 0 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
