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

:root {
  --bg:       #0d1117;
  --surface:  #161b22;
  --border:   #30363d;
  --text:     #c9d1d9;
  --muted:    #8b949e;
  --accent:   #58a6ff;
  --green:    #3fb950;
  --red:      #f85149;
  --yellow:   #d29922;
  --radius:   6px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Login ---------- */
.login-wrap {
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
}

.login-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form label { color: var(--muted); font-size: 12px; }
.login-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  font-size: 14px;
  width: 100%;
}
.login-form input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.error {
  color: var(--red);
  font-size: 12px;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
}

/* ---------- Dashboard ---------- */
body:has(.dashboard) {
  align-items: flex-start;
  justify-content: flex-start;
}

.dashboard {
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.dash-title { font-size: 18px; font-weight: 600; color: var(--text); }
.dash-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ---------- Table ---------- */
.services-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.services-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.services-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}
.services-table tr:last-child td { border-bottom: none; }
.svc-label   { font-weight: 500; }
.svc-domain  { color: var(--muted); font-size: 11px; margin-top: 2px; }
.svc-machine { color: var(--muted); font-size: 12px; }
.svc-address { color: var(--muted); font-size: 12px; font-family: ui-monospace, monospace; }
.svc-link    { color: var(--text); text-decoration: none; }
.svc-link:hover { color: var(--accent); text-decoration: underline; }
.uptime-text { color: var(--muted); font-size: 12px; }

.machine-uptime { color: var(--muted); font-size: 12px; }

.dashboard { max-width: 960px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.2s, color 0.2s;
}
.badge-active   { background: #1a3a24; color: var(--green); border: 1px solid #2ea043; }
.badge-inactive { background: #2a1a1a; color: var(--red);   border: 1px solid #6e2a2a; }
.badge-failed   { background: #3a1a10; color: #ff7b72;      border: 1px solid var(--red); }
.badge-unknown  { background: #1e2228; color: var(--muted);  border: 1px solid var(--border); }

/* ---------- Buttons ---------- */
.btn {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: opacity 0.15s;
}
.btn:hover   { opacity: 0.8; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-sm      { padding: 0.3rem 0.65rem; font-size: 12px; }
.btn-danger  { background: #3a1a1a; color: var(--red); border-color: #6e2a2a; }
.btn-secondary { color: var(--muted); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
}
.modal-card h2 { margin-bottom: 0.75rem; font-size: 16px; }
.modal-card p  { color: var(--muted); margin-bottom: 1.5rem; }
.modal-card p span { color: var(--yellow); font-weight: 700; font-size: 18px; }
.modal-buttons { display: flex; gap: 0.75rem; justify-content: center; }
