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

:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface-2:    #1c2128;
  --border:       #30363d;
  --accent:       #58a6ff;
  --accent-dim:   rgba(88, 166, 255, 0.12);
  --accent-glow:  rgba(88, 166, 255, 0.25);
  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --text-dim:     #6e7681;
  --success:      #3fb950;
  --warning:      #d29922;
  --danger:       #f85149;
  --radius-sm:    6px;
  --radius:       12px;
  --radius-lg:    16px;
  --shadow:       0 1px 0 rgba(255,255,255,0.04), 0 4px 20px rgba(0,0,0,0.5);
  --transition:   180ms cubic-bezier(0.4, 0, 0.2, 1);
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
  font-weight: 600;
}
.btn-primary:hover { background: #79b8ff; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #262d36; border-color: #444c56; }

.btn-danger {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.3);
}
.btn-danger:hover { background: rgba(248, 81, 73, 0.25); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Badges ──────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 500;
}
.badge-tech {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.25);
}

/* ── Status dot ──────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.stopped { background: var(--text-dim); }
.status-dot.error, .status-dot.errored { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.status-dot.launching { background: var(--warning); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Spinner ─────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 1000;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { border-color: var(--success); color: var(--success); }
#toast.error   { border-color: var(--danger);  color: var(--danger); }
