:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #d29922;
  --good: #3fb950;
  --bad: #f85149;
}

* { box-sizing: border-box; }

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

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

h1 { font-size: 18px; margin: 0; letter-spacing: 0.5px; }

.btn {
  background: var(--accent);
  color: #1a1300;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.add-server {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}
.add-server input {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
}
#addHost { flex: 2; }
#addPort { flex: 1; }
#addLabel { flex: 2; }

main { padding: 16px 24px; overflow-x: auto; }

table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; cursor: pointer; }
tbody tr:hover { background: var(--panel); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.online { background: var(--good); }
.status-dot.offline { background: var(--bad); }

.empty { color: var(--muted); text-align: center; padding: 24px; }

.row-connect {
  background: var(--accent);
  color: #1a1300;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
}
.row-remove {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 6px;
}

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  width: 420px;
  max-width: 90vw;
}
.modal-box h2 { margin-top: 0; }
.modal-box label { display: block; margin: 10px 0; }
.modal-box input[type="text"] {
  width: 100%;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px;
  border-radius: 6px;
}
.custom-fields.hidden { display: none; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.4; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 8px;
}
.toast.hidden { display: none; }
