:root {
  --bg: #090d16;
  --card: #131a2a;
  --card-border: #232f48;
  --muted: #4e5f7e;
  --text-muted: #8b9bb4;
  --accent: #00b4d8;
  --text: #e2e8f0;
  --text-bright: #ffffff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

header {
  background: #0f172a;
  border-bottom: 1px solid var(--card-border);
  padding: 24px 20px;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.system-tag {
  display: inline-block;
  background: rgba(0, 180, 216, 0.15);
  color: #00b4d8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
}

header p {
  color: var(--text-muted);
  font-size: 14px;
}

.backend-config {
  font-size: 12px;
  color: var(--text-muted);
}

.backend-config label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.input-inline {
  display: flex;
  gap: 8px;
}

.input-inline input {
  background: #0b1120;
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  width: 260px;
}

.input-inline button {
  background: var(--accent);
  color: #090d16;
  border: none;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
}

main {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.card h2 {
  font-size: 18px;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.metro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.chip {
  background: #192238;
  border: 1px solid #2b3956;
  color: #cbd5e1;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  background: #23304e;
  border-color: #3b4d75;
}

.chip.active {
  background: rgba(0, 180, 216, 0.2);
  border-color: #00b4d8;
  color: #38bdf8;
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input {
  background: #0b1120;
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-color: var(--accent);
}

.btn-primary {
  margin-top: 16px;
  background: #0284c7;
  color: #ffffff;
  border: none;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: fit-content;
}

.btn-primary:hover {
  background: #0369a1;
}

.result {
  margin-top: 20px;
  padding: 18px;
  background: #0b1120;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  display: none;
}

.telemetry-display {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.kpi-tile {
  background: #131b2e;
  border: 1px solid #1f2b45;
  border-radius: 8px;
  padding: 14px;
}

.kpi-tile-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.kpi-tile-value {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-good { background: #166534; color: #86efac; }
.badge-moderate { background: #854d0e; color: #fde047; }
.badge-poor { background: #9a3412; color: #fdba74; }
.badge-unhealthy { background: #991b1b; color: #fca5a5; }
.badge-very-unhealthy { background: #6b21a8; color: #f0abfc; }
.badge-hazardous { background: #450a0a; color: #fecaca; border: 1px solid #dc2626; }

.hvac-card {
  margin-top: 14px;
  background: #141f36;
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
}

.hvac-title {
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

footer {
  text-align: center;
  padding: 30px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--card-border);
}
