:root {
  --bg: #0b1020;
  --bg2: #0e1630;
  --card: rgba(255,255,255,0.06);
  --card2: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.10);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);
  --accent: #7c5cff;
  --ok: #2ae98a;
  --warn: #ffcc4d;
  --bad: #ff5c7a;
  --shadow: 0 14px 40px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background: radial-gradient(1200px 700px at 20% 10%, rgba(124,92,255,0.22), transparent 60%),
              radial-gradient(900px 500px at 80% 0%, rgba(42,233,138,0.16), transparent 55%),
              linear-gradient(180deg, var(--bg), var(--bg2));
}

a { color: inherit; text-decoration: none; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  background: rgba(10,16,32,0.72);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(124,92,255,0.8), rgba(124,92,255,0.25));
  border: 1px solid rgba(124,92,255,0.35);
  box-shadow: var(--shadow);
}

.brand-title {
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: 10px;
}

.nav-link {
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
}
.nav-link:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255,255,255,0.04);
}

.user {
  text-align: right;
}
.user-name {
  font-weight: 700;
  font-size: 13px;
}
.user-role {
  font-size: 12px;
  color: var(--muted);
}

.content {
  width: min(1100px, 94%);
  margin: 24px auto;
  flex: 1;
}

.footer {
  width: min(1100px, 94%);
  margin: 0 auto 24px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

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

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.card h2 {
  margin: 0;
  font-size: 16px;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.16);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  border-color: rgba(124,92,255,0.35);
  background: linear-gradient(135deg, rgba(124,92,255,0.85), rgba(124,92,255,0.35));
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.flash {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}
.flash.success { border-color: rgba(42,233,138,0.35); }
.flash.error { border-color: rgba(255,92,122,0.35); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.2px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}
.badge.running { border-color: rgba(42,233,138,0.35); }
.badge.stopped { border-color: rgba(255,204,77,0.35); }
.badge.unknown { border-color: rgba(255,255,255,0.18); }
.badge.loading, .badge.working { border-color: rgba(124,92,255,0.35); }

@media (max-width: 720px) {
  .user { display: none; }
  .nav { gap: 6px; }
  .nav-link { padding: 8px 8px; }
}
