:root {
  --bg: #0b0e14;
  --card: #12161f;
  --border: #1f2530;
  --text: #e6e9ef;
  --muted: #8b93a3;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --gray: #2a3040;
  --accent: #3b82f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.status-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 28px;
}

.status-banner.operational { background: rgba(34,197,94,0.12); color: var(--green); }
.status-banner.degraded { background: rgba(234,179,8,0.12); color: var(--yellow); }
.status-banner.outage { background: rgba(239,68,68,0.12); color: var(--red); }
.status-banner.unknown { background: rgba(139,147,163,0.12); color: var(--muted); }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 5px currentColor22;
}

.uptime-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 20px;
  text-align: center;
}

.uptime-big {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.uptime-label {
  color: var(--muted);
  font-size: 14px;
}

.uptime-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.uptime-stat {
  text-align: center;
}

.uptime-stat .val {
  font-size: 20px;
  font-weight: 600;
}

.uptime-stat .lbl {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.bars-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.bars-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
}

.bars {
  display: flex;
  gap: 2px;
  height: 40px;
  align-items: stretch;
}

.bar {
  flex: 1;
  border-radius: 2px;
  background: var(--gray);
  min-width: 2px;
}

.bar.g { background: var(--green); }
.bar.y { background: var(--yellow); }
.bar.r { background: var(--red); }

.bars-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

.footer {
  text-align: center;
  margin-top: 32px;
  color: var(--muted);
  font-size: 12px;
}

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

/* ---- Admin ---- */

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

.admin-nav .brand { font-weight: 700; }

.btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

.btn:hover { opacity: 0.9; }
.btn.secondary { background: var(--gray); }
.btn.danger { background: var(--red); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.admin-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.up { background: rgba(34,197,94,0.15); color: var(--green); }
.badge.down { background: rgba(239,68,68,0.15); color: var(--red); }
.badge.unknown, .badge.pending { background: rgba(139,147,163,0.15); color: var(--muted); }
.badge.installing, .badge.installed_waiting { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge.failed { background: rgba(239,68,68,0.15); color: var(--red); }
.badge.active { background: rgba(34,197,94,0.15); color: var(--green); }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-row input, .form-row select {
  width: 100%;
  background: #0b0e14;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}

.login-box {
  max-width: 380px;
  margin: 80px auto;
  padding: 0 20px;
}

.error-msg { color: var(--red); font-size: 13px; margin-top: 8px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px; max-width: 440px; width: 92%; max-height: 85vh; overflow-y: auto;
}
.modal h2 { margin-top: 0; font-size: 18px; }

pre.log {
  background: #05070b; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; font-size: 12px; max-height: 260px; overflow-y: auto; white-space: pre-wrap;
}

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