:root {
  color-scheme: dark;
  --bg: #111418;
  --panel: #181d23;
  --panel-2: #20262e;
  --line: #313944;
  --text: #e9edf2;
  --muted: #9aa6b2;
  --accent: #4ea1ff;
  --good: #46c37b;
  --warn: #e6ad4f;
  --bad: #e35d6a;
  --button: #2b6fb8;
  --button-2: #33404e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  font-size: 14px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: #15191e;
}

.brand {
  font-weight: 700;
  letter-spacing: .2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav form {
  margin: 0;
}

.content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px;
}

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

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

.card h2,
.card h3,
.page-title {
  margin: 0 0 12px;
}

.page-title {
  font-size: 24px;
}

.muted {
  color: var(--muted);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.row:last-child {
  border-bottom: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status.active .dot,
.status.ok .dot {
  background: var(--good);
}

.status.warn .dot {
  background: var(--warn);
}

.status.bad .dot {
  background: var(--bad);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

button,
.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--button);
  color: #fff;
  padding: 9px 12px;
  font-weight: 650;
  cursor: pointer;
  min-height: 38px;
}

button.secondary,
.button.secondary {
  background: var(--button-2);
  border-color: var(--line);
}

button.danger {
  background: #a53946;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1318;
  color: var(--text);
  padding: 10px 11px;
  font: inherit;
}

textarea {
  min-height: 180px;
  resize: vertical;
  font-family: Consolas, ui-monospace, monospace;
  font-size: 13px;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 650;
}

.flash {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #1e2b38;
}

.flash.error {
  background: #351d24;
  border-color: #71313d;
}

.log {
  overflow: auto;
  max-height: 520px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07090c;
  color: #dbe4ee;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.45 Consolas, ui-monospace, monospace;
}

.blacklist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.blacklist-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.blacklist-list code {
  flex: 1;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1318;
  color: #dbe4ee;
  padding: 7px 9px;
  font: 12px/1.35 Consolas, ui-monospace, monospace;
}

.login {
  max-width: 430px;
  margin: 80px auto 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .split {
    grid-template-columns: 1fr;
  }
}
