:root {
  --bg: #0f1115;
  --card: #171a21;
  --border: #2a2e38;
  --text: #e8eaf0;
  --muted: #8b93a3;
  --accent: #4f8cff;
  --danger: #ff5c5c;
  --success: #35c98f;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
}
.hidden { display: none !important; }

/* Login */
#login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card h1 { font-size: 1.4rem; margin-bottom: 20px; }
.login-card input { width: 100%; margin-bottom: 12px; }
.error { color: var(--danger); font-size: 0.85rem; min-height: 1em; }

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

/* Inputs & buttons */
input, select, textarea {
  background: #0c0e12; border: 1px solid var(--border); color: var(--text);
  padding: 12px; border-radius: 8px; font-size: 1rem; width: 100%;
}
button {
  background: var(--accent); color: white; border: none; border-radius: 8px;
  padding: 12px 16px; font-size: 1rem; cursor: pointer; width: 100%;
}
button.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
button.danger { background: var(--danger); }
button:disabled { opacity: 0.5; }

/* App shell */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--bg); z-index: 10;
}
.brand { font-weight: 600; }
.logout-btn { width: auto; padding: 8px 12px; background: transparent; border: 1px solid var(--border); font-size: 0.85rem; }

.tabbar {
  display: flex; overflow-x: auto; border-bottom: 1px solid var(--border);
  position: sticky; top: 53px; background: var(--bg); z-index: 9;
}
.tab {
  flex: 1 0 auto; background: none; border: none; color: var(--muted);
  padding: 12px 14px; border-bottom: 2px solid transparent; width: auto; white-space: nowrap;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

main#content { padding-bottom: 40px; }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 12px; }
.stat-box { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.stat-box .label { color: var(--muted); font-size: 0.8rem; }
.stat-box .value { font-size: 1.4rem; font-weight: 600; margin-top: 4px; }
.bar { height: 6px; background: #0c0e12; border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.bar-fill.warn { background: #ffb020; }
.bar-fill.danger { background: var(--danger); }

/* List rows */
.row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.badge { font-size: 0.75rem; padding: 3px 8px; border-radius: 999px; }
.badge.running, .badge.success { background: rgba(53,201,143,0.15); color: var(--success); }
.badge.exited, .badge.failure { background: rgba(255,92,92,0.15); color: var(--danger); }

.muted { color: var(--muted); font-size: 0.85rem; }
.section-title { padding: 16px 16px 4px; font-size: 0.9rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
