:root {
  --bg: #0f1420;
  --panel: #171f2e;
  --panel-2: #1d2740;
  --text: #e6ebf5;
  --muted: #8a94a8;
  --ok: #2ecc71;
  --degraded: #f1c40f;
  --critical: #e74c3c;
  --unknown: #9b59b6;
  --offline: #5d6b85;
  --accent: #3aa7ff;
  --border: #26324a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-weight: 700; font-size: 18px; }
.topbar-right { display: flex; gap: 12px; align-items: center; }

main { padding: 22px; max-width: 1200px; margin: 0 auto; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.card .num { font-size: 30px; font-weight: 700; }
.card .label { color: var(--muted); font-size: 13px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--panel-2); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #0b0f18;
}
.badge.OK { background: var(--ok); }
.badge.DEGRADED { background: var(--degraded); }
.badge.CRITICAL { background: var(--critical); color: #fff; }
.badge.UNKNOWN { background: var(--unknown); color: #fff; }
.badge.OFFLINE { background: var(--offline); color: #fff; }
.badge.NOT_DEPLOYED { background: #5a7; color: #0b0f18; }

.muted { color: var(--muted); }
.hidden { display: none; }
.inline-form { display: inline; }

button {
  background: var(--accent);
  border: none;
  color: #04121f;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button:hover { filter: brightness(1.08); }

.detail {
  margin-top: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

table.subtable { width: 100%; border-collapse: collapse; margin: 8px 0 18px; }
table.subtable th, table.subtable td {
  border: 1px solid var(--border);
  padding: 6px 9px;
  font-size: 13px;
  text-align: left;
}
table.subtable th { color: var(--muted); }

section h3 { color: var(--accent); margin: 18px 0 6px; }
pre.klog {
  background: #0b0f18;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px;
  width: 340px;
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card label { display: block; margin: 14px 0; color: var(--muted); font-size: 13px; }
.login-card input {
  width: 100%;
  margin-top: 6px;
  padding: 9px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}
.login-card button { width: 100%; margin-top: 10px; }
.error { color: var(--critical); font-size: 13px; margin: 8px 0; }

.chart { width: 100%; height: 120px; background: #0b0f18; border: 1px solid var(--border); border-radius: 8px; }

.token-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.token-row input {
  flex: 1;
  min-width: 220px;
  padding: 9px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.dl-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.dl-link {
  display: inline-block;
  padding: 9px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.dl-link:hover { border-color: var(--accent); }

.cmd-wrap { position: relative; margin: 12px 0; }
.cmd {
  background: #0b0f18;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}
.copy {
  padding: 4px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }
.cmd-wrap .copy { position: absolute; top: 8px; right: 8px; }

.dl-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dl-arch {
  min-width: 64px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  color: var(--accent);
}
.dl-list .copy { flex: none; }
