:root {
  --bg: #10151b;
  --bg-2: #161d25;
  --surface: #1c2530;
  --line: #2a3542;
  --text: #e8eef4;
  --muted: #8b98a8;
  --accent: #3c9b78;
  --accent-2: #2f7d60;
  --danger: #c85a4e;
  --warn: #c9a227;
  --ok: #3c9b78;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  --sidebar: 248px;
  --radius: 12px;
  --font: "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar);
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px rgba(60, 155, 120, 0.12);
}
.brand-name { font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { color: var(--muted); font-size: 12px; }

.nav { padding: 12px 10px; overflow: auto; flex: 1; }
.nav-item {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active {
  background: rgba(60, 155, 120, 0.14);
  color: var(--text);
  font-weight: 600;
}

.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid var(--line); }
.phase-pill {
  font-size: 12px;
  color: var(--accent);
  border: 1px solid rgba(60, 155, 120, 0.35);
  border-radius: 999px;
  padding: 6px 10px;
  text-align: center;
}

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 28px 8px;
}
.topbar-title h1 { margin: 0; font-size: 22px; font-weight: 650; }
.topbar-title p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.topbar-meta { margin-left: auto; text-align: right; color: var(--muted); font-size: 13px; }
.env-badge {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 6px;
}
.menu-btn {
  display: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 36px;
  height: 36px;
}

.content { padding: 12px 28px 40px; }
.banner {
  background: rgba(60, 155, 120, 0.1);
  border: 1px solid rgba(60, 155, 120, 0.28);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  color: #cfe8dc;
  font-size: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.metric-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.metric strong { font-size: 24px; font-weight: 650; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
}
.panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-h h2 { margin: 0; font-size: 15px; font-weight: 650; }

.health-grid { display: grid; gap: 8px; }
.health-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.health-row:last-child { border-bottom: 0; }

.dot {
  font-size: 12px;
  border-radius: 999px;
  padding: 3px 8px;
  text-transform: lowercase;
}
.dot.ok { background: rgba(60,155,120,.16); color: #7dcfb0; }
.dot.error { background: rgba(200,90,78,.16); color: #f0a199; }
.dot.degraded, .dot.pending { background: rgba(201,162,39,.14); color: #e6cc6a; }

.actions { margin: 0; padding-left: 18px; color: #d5deE7; }
.actions li { margin: 8px 0; }
.empty { color: var(--muted); margin: 8px 0 0; }
.muted { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.hidden { display: none; }

.btn, .linkish {
  background: var(--accent-2);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.linkish { background: transparent; color: var(--accent); padding: 0; }
.btn:hover { background: var(--accent); }

.log {
  background: #0d1217;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 88px;
  white-space: pre-wrap;
  font-size: 12px;
  color: #c9d6e2;
  overflow: auto;
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

@media (max-width: 980px) {
  .metrics, .grid-2 { grid-template-columns: 1fr 1fr; }
  .sidebar {
    position: fixed;
    z-index: 20;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-block; }
}
@media (max-width: 640px) {
  .metrics, .grid-2 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
.brand-row { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input, select, textarea, .field {
  width: 100%;
  background: #0d1217;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}
.login-card .btn { width: 100%; padding: 10px; }
.error { color: #f0a199; min-height: 1.2em; margin: 0; font-size: 13px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid .wide { grid-column: 1 / -1; }
.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; }
.status-chip {
  display: inline-block;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255,255,255,.06);
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.later { color: var(--muted); }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
}
