* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: Monaco, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 12px;
  background: rgba(240,240,250,1);
  color: #333;
  line-height: 1.5;
}

a { color: lightblue; text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

.stat {
  display: flex;
  gap: 4px;
  align-items: center;
}

.stat .label { color: #888; }
.stat .value { font-weight: 600; }

.stat .healthy { color: #2a7; }
.stat .warning { color: #d80; }
.stat .critical { color: #c33; }
.stat .stopped { color: #999; }

main { padding: 12px 16px; }

section { margin-bottom: 16px; }

section h2 {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
}

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

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 8px 10px;
  cursor: default;
  transition: background 0.1s;
}

.card:hover { background: rgba(93,90,90,0.05); }

.card .name {
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .status {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card .status.online, .card .status.running, .card .status.healthy { color: #2a7; }
.card .status.stopped, .card .status.stopping { color: #999; }
.card .status.errored, .card .status.exited { color: #c33; }
.card .status.launching { color: #d80; }

.card .metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
  margin-top: 4px;
  font-size: 11px;
  color: #555;
}

.card .metrics .label { color: #999; }

#alerts-section {
  max-height: 400px;
  overflow-y: auto;
}

.alert-list { list-style: none; }

.alert-item {
  display: flex;
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
  align-items: flex-start;
  font-size: 11px;
}

.alert-item:hover { background: rgba(93,90,90,0.05); }

.alert-item.acknowledged { opacity: 0.5; }

.badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.badge.critical { background: #fdd; color: #c33; }
.badge.warning { background: #fec; color: #a60; }
.badge.info { background: #def; color: #369; }

.alert-time { color: #999; flex-shrink: 0; white-space: nowrap; }
.alert-source { color: #888; flex-shrink: 0; }
.alert-msg { flex: 1; word-break: break-word; }

.alert-ack {
  background: none;
  border: 1px solid #ccc;
  border-radius: 2px;
  padding: 0 4px;
  font-size: 9px;
  cursor: pointer;
  color: #888;
  flex-shrink: 0;
}
.alert-ack:hover { background: #eee; }

.alert-solution {
  margin-top: 3px;
  padding: 3px 6px;
  background: rgba(93,90,90,0.05);
  border-left: 2px solid #aad;
  color: #556;
  font-size: 10px;
  line-height: 1.4;
}

.sensor-card .fields {
  margin-top: 4px;
  font-size: 11px;
  color: #555;
}

.sensor-card .field-row {
  display: flex;
  justify-content: space-between;
}

.sensor-card .field-name { color: #999; }

.sparkline {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

.conn-status {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 2px;
}
.conn-status.connected { color: #2a7; }
.conn-status.disconnected { color: #c33; }

.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}

.tab {
  padding: 4px 12px;
  background: #eee;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  color: #666;
}
.tab.active { background: #fff; color: #333; font-weight: 600; }

.tab-content { display: none; }
.tab-content.active { display: block; }
