:root {
  --bg-main: #081622;
  --bg-panel: rgba(11, 28, 42, 0.78);
  --bg-card: rgba(20, 41, 60, 0.88);
  --line: rgba(122, 154, 179, 0.22);
  --text-main: #e8f0f6;
  --text-dim: #aac2d6;
  --accent: #eb8a3d;
  --accent-soft: #ffb37a;
  --ok: #4ecf8b;
  --danger: #ff5d5d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text-main);
  background:
    linear-gradient(130deg, #06111b 0%, #0b1e2d 45%, #122334 100%),
    var(--bg-main);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(8px);
}

.orb-a {
  width: 320px;
  height: 320px;
  right: -90px;
  top: -70px;
  background: radial-gradient(circle at center, rgba(235, 138, 61, 0.34), rgba(235, 138, 61, 0));
}

.orb-b {
  width: 260px;
  height: 260px;
  left: -80px;
  bottom: 20px;
  background: radial-gradient(circle at center, rgba(89, 190, 255, 0.22), rgba(89, 190, 255, 0));
}

.dashboard {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 16px 28px;
}

.topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  animation: reveal 0.45s ease-out;
}

.title-with-shield {
  display: flex;
  align-items: center;
  gap: 14px;
}

.shield {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0;
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 600;
}

h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  line-height: 1.1;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 0.98rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-family: "IBM Plex Sans", sans-serif;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn-primary {
  border-color: rgba(255, 180, 126, 0.45);
  background: linear-gradient(135deg, #c96720 0%, #ef8d3f 100%);
  color: #fffdf8;
}

.btn-secondary {
  border-color: rgba(138, 179, 212, 0.42);
  background: rgba(20, 41, 60, 0.88);
  color: var(--text-main);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-secondary:hover {
  border-color: rgba(255, 179, 122, 0.5);
  background: rgba(24, 48, 69, 0.95);
}

.btn:focus-visible {
  outline: 2px solid rgba(255, 179, 122, 0.7);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.status-grid {
  display: grid;
  grid-template-columns: minmax(0, 420px);
  gap: 12px;
  margin-bottom: 16px;
  animation: reveal 0.55s ease-out;
}

.status-card {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  border-radius: 14px;
  padding: 12px 14px;
  backdrop-filter: blur(3px);
}

.status-label {
  margin: 0 0 6px;
  color: var(--text-dim);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

h2 {
  margin: 0;
  font-size: 1.2rem;
  font-family: "Sora", sans-serif;
}

.panel {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  animation: reveal 0.65s ease-out;
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg-card);
  padding: 13px;
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(235, 138, 61, 0.45);
}

.card.missing {
  opacity: 0.58;
}

.card .value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-family: "Sora", sans-serif;
}

.card .unit {
  margin-left: 6px;
  font-size: 1.25rem;
  color: var(--accent-soft);
  font-weight: 700;
  font-family: "Sora", sans-serif;
  line-height: 1;
}

.card .label-top {
  margin-top: 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 600;
}

.error {
  margin-bottom: 14px;
  border-radius: 10px;
  padding: 11px 12px;
  color: #fff7f7;
  border: 1px solid rgba(255, 129, 129, 0.45);
  background: rgba(150, 26, 26, 0.7);
}

.hidden {
  display: none;
}

.history-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-controls label {
  color: var(--text-dim);
  font-size: 0.86rem;
  font-weight: 600;
}

.history-controls select {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(13, 29, 43, 0.9);
  color: var(--text-main);
  padding: 8px 12px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.94rem;
}

.history-chart {
  width: 100%;
  height: 340px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 19, 30, 0.7);
}

.site-footer {
  border-top: 1px solid rgba(122, 154, 179, 0.2);
  background: rgba(6, 18, 28, 0.9);
  padding: 18px 12px;
}

.footer-logos {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.footer-logos img {
  width: auto;
  max-width: 100%;
  max-height: 76px;
  height: auto;
  display: block;
}

details > summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-dim);
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .title-with-shield {
    align-items: flex-start;
  }
  .shield {
    width: 62px;
    height: 62px;
  }
  .actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
  .history-chart {
    height: 280px;
  }
  .footer-logos {
    gap: 12px;
  }
  .footer-logos img {
    max-height: 64px;
  }
}

@media (max-width: 560px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
