*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--r1);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}

button:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  padding: var(--s3) var(--s6);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  padding: var(--s2) var(--s4);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border); background: var(--surface-hi); }

.btn-danger {
  background: var(--offline-bg);
  color: var(--offline);
  padding: var(--s2) var(--s4);
}
.btn-danger:hover:not(:disabled) { background: var(--offline); color: var(--bg); }

input, select, textarea {
  font-family: var(--font-ui);
  font-size: 14px;
  background: var(--surface-hi);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r1);
  padding: var(--s2) var(--s3);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

label {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: var(--s1);
}

.field { display: flex; flex-direction: column; gap: var(--s1); }
.field + .field { margin-top: var(--s4); }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--online); }
.status-dot.warn    { background: var(--warn); }
.status-dot.offline { background: var(--offline); }

/* Toast notifications */
#toast-root {
  position: fixed;
  bottom: var(--s6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--surface-top);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: var(--s2) var(--s4);
  border-radius: var(--r2);
  white-space: nowrap;
  animation: toastIn 0.2s ease-out, toastOut 0.3s ease-in 2.5s forwards;
}
.toast.success { color: var(--online);  border-color: var(--online-bg); }
.toast.error   { color: var(--offline); border-color: var(--offline-bg); }
.toast.warn    { color: var(--warn);    border-color: var(--warn-bg); }

@keyframes toastIn  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(-4px); } }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
