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

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.dashboard {
  max-width: 920px;
  width: 100%;
}

h1 {
  text-align: center;
  font-weight: 300;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #6b7280;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.primary-cards {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.primary-cards:empty {
  display: none;
}

.card-primary {
  flex: 1;
  background: linear-gradient(135deg, #1a1d27 0%, #1e2230 100%);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.card-primary:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-primary.selected {
  border-color: #54a0ff;
  background: linear-gradient(135deg, #1e2230 0%, #232840 100%);
}

.card-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--temp-color, #6b7280);
  opacity: 0.8;
}

.card-primary__name {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  margin-bottom: 1rem;
  font-weight: 600;
}

.card-primary__row {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
}

.card-primary__metric {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-primary__label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b5563;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.card-primary__value {
  font-size: 3.2rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.02em;
}

.card-primary__value--humi {
  color: #4ecdc4;
  text-shadow: 0 0 30px rgba(78, 205, 196, 0.2);
}

.card-primary__unit {
  font-size: 0.75rem;
  color: #4b5563;
  margin-top: 0.3rem;
  font-weight: 500;
}

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

.cards:empty {
  display: none;
}

.card {
  background: #16181f;
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.card.selected {
  border-color: #54a0ff;
  background: #1a1d27;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--temp-color, #6b7280);
  opacity: 0.6;
}

.card__name {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4b5563;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.card__row {
  display: flex;
  justify-content: space-around;
  align-items: baseline;
}

.card__metric {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card__value {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
}

.card__value--humi {
  color: #4ecdc4;
}

.card__unit {
  font-size: 0.6rem;
  color: #374151;
  margin-top: 0.15rem;
  font-weight: 500;
}

.chart-container {
  background: #16181f;
  border-radius: 14px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 1rem;
  display: none;
}

.chart-container.visible {
  display: block;
}

canvas {
  width: 100%;
  height: 350px;
  display: block;
}

.status {
  text-align: center;
  font-size: 0.75rem;
  color: #374151;
  letter-spacing: 0.03em;
}

.status--error {
  color: #ef4444;
}

@media (max-width: 480px) {
  .primary-cards {
    flex-direction: column;
  }

  .card-primary__value {
    font-size: 2.4rem;
  }

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

  .card__value {
    font-size: 1.1rem;
  }
}
