:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --border: #2a2e37;
  --text: #e8eaed;
  --text-dim: #9aa0ab;
  --green: #3ecf7e;
  --red: #f0576a;
  --yellow: #e6b450;
  --accent: #5b8cff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 24px 32px 64px;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.top-nav {
  margin-left: auto;
}

.top-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.top-nav a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 22px;
  margin: 0;
  font-weight: 600;
}

h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  margin: 0 0 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
}

.section-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.refresh-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.refresh-btn:hover {
  border-color: var(--accent);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.updated-at {
  font-size: 13px;
  color: var(--text-dim);
}

main {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
}

.dot.up { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.down { background: var(--red); box-shadow: 0 0 8px var(--red); }

.card-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin: -4px 0 10px;
  line-height: 1.4;
}

.card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
  padding: 3px 0;
}

.card-row span:first-child {
  flex-shrink: 0;
}

.card-row span:last-child {
  text-align: right;
}

.card-row span:last-child {
  color: var(--text);
}

.metric-value {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  margin-top: 8px;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.bar-fill.warn { background: var(--yellow); }
.bar-fill.crit { background: var(--red); }

.empty {
  color: var(--text-dim);
  font-size: 13px;
}

.warning-banner {
  background: rgba(240, 87, 106, 0.12);
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.dot.warn { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.dot.unknown { background: var(--text-dim); }
.dot.info { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.processes-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.proc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.proc-list li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.proc-list li:last-child {
  border-bottom: none;
}

.proc-name {
  color: var(--text-dim);
}

.log-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}

.log-box .log-line {
  color: var(--text);
  padding: 2px 0;
}

.log-box .log-line .dot {
  margin-right: 6px;
}
