* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top left, #142230 0%, #0a0e14 60%);
  color: #e6edf3;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px 56px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #22d3ee, #4ade80);
  color: #0a0e14;
  font-weight: 800;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.03em;
}

h1 {
  font-size: 2rem;
  margin: 0;
  letter-spacing: 0.04em;
}

.subtitle {
  color: #9fb0c0;
  font-size: 1rem;
  margin-top: 2px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-size: 1.4rem;
  color: #9fb0c0;
  font-weight: 600;
}

.status {
  font-size: 1rem;
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 600;
}
.status-ok { background: #123d24; color: #4ade80; }
.status-connecting { background: #3d3312; color: #facc15; }
.status-error { background: #3d1212; color: #f87171; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 48px;
}

.card {
  background: linear-gradient(160deg, #16202b 0%, #10161f 100%);
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border: 3px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.card-warn {
  border-color: #facc15;
  background: linear-gradient(160deg, #2a230c 0%, #1c1608 100%);
}

.card-danger {
  border-color: #f87171;
  background: linear-gradient(160deg, #2d1414 0%, #1c0d0d 100%);
  animation: pulse-danger 1.5s ease-in-out infinite;
}

@keyframes pulse-danger {
  0%, 100% { border-color: #f87171; }
  50% { border-color: #7f1d1d; }
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.card-label {
  font-size: 1.2rem;
  color: #9fb0c0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-value {
  font-size: 4.2rem;
  font-weight: 700;
  margin-top: 18px;
  line-height: 1;
}

.unit {
  font-size: 1.8rem;
  color: #9fb0c0;
  margin-left: 8px;
}

.sparkline {
  display: block;
  width: 100%;
  height: 64px;
  margin-top: 22px;
}

footer {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  color: #9fb0c0;
  font-size: 1.05rem;
}

@media (max-width: 700px) {
  body {
    padding: 20px 20px;
  }

  header {
    flex-wrap: wrap;
    gap: 16px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  .header-right {
    gap: 12px;
  }

  .clock {
    font-size: 1.1rem;
  }

  .status {
    font-size: 0.85rem;
    padding: 6px 14px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
  }

  .card {
    padding: 20px 22px;
  }

  .card-value {
    font-size: 2.8rem;
  }

  .unit {
    font-size: 1.3rem;
  }

  footer {
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    padding-top: 20px;
  }
}
