:root {
  --bg: #0a0e17;
  --card: #131a29;
  --card-inner: #0f1420;
  --border: #1e2837;
  --text: #f1f5f9;
  --text-muted: #8b96a8;
  --orange: #ef7912;
  --orange-light: #ffa94d;
  --orange-dark: #d76a0a;
  --blue: #3b82f6;
  --purple: #a855f7;
  --green: #22c55e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

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

.brand img {
  height: 44px;
  width: auto;
  display: block;
}

.history-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.history-link:hover {
  color: var(--text);
}

.history-link svg {
  width: 18px;
  height: 18px;
}

/* ---------- main grid ---------- */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  margin-top: 8px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
}

/* ---------- gauge card ---------- */
.gauge-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gauge-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
}

.gauge-wrap > svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gauge-track {
  fill: none;
  stroke: var(--card-inner);
  stroke-width: 22;
  stroke-linecap: round;
}

.gauge-fill {
  fill: none;
  stroke: url(#gaugeGradient);
  stroke-width: 22;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear;
}

.gauge-tick {
  fill: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
}

.gauge-center {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 52%;
}

.gauge-wifi {
  width: 18px;
  height: 18px;
  color: var(--orange);
  margin-bottom: 2px;
}

.gauge-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.gauge-title .accent {
  color: var(--orange);
  display: block;
}

.gauge-status {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  min-height: 16px;
}

.unit-toggle {
  display: flex;
  justify-content: center;
  background: var(--card-inner);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-top: 6px;
  transition: opacity 0.15s ease;
}

.gauge-card.is-running .unit-toggle {
  opacity: 0;
  pointer-events: none;
  height: 0;
  padding: 0;
  margin-top: 0;
  overflow: hidden;
  border: none;
}

.unit-pill {
  background: rgba(239, 121, 18, 0.12);
  color: var(--orange);
  border: 1px solid var(--orange);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 22px;
  border-radius: 999px;
}

.start-btn {
  margin-top: 20px;
  width: 100%;
  max-width: 340px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 16px 24px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(239, 121, 18, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(239, 121, 18, 0.36);
}

.start-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

/* ---------- stats column ---------- */
.stats-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  padding: 20px 24px;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-badge svg {
  width: 18px;
  height: 18px;
}

.icon-orange { background: rgba(239, 121, 18, 0.14); color: var(--orange); }
.icon-blue { background: rgba(59, 130, 246, 0.14); color: var(--blue); }
.icon-purple { background: rgba(168, 85, 247, 0.14); color: var(--purple); }
.icon-green { background: rgba(34, 197, 94, 0.14); color: var(--green); }

.stat-unit-pill {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.stat-value-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 6px;
  gap: 16px;
}

.stat-value {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-value-unit {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
}

.sparkline {
  flex: 1;
  height: 64px;
  min-width: 0;
}

.sparkline svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.small-stat .stat-value {
  font-size: 32px;
}

.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 18px 24px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-item:first-child {
  border-right: 1px solid var(--border);
}

.info-text-label {
  font-weight: 700;
  font-size: 14px;
}

.info-text-value {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* ---------- feature cards ---------- */
.features {
  margin-top: 20px;
  padding: 26px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 900px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.feature-item h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 800;
}

.feature-item p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- footer ---------- */
.rextel-dash-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding: 28px 0 32px;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

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

.footer-brand img {
  height: 40px;
  width: auto;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 260px;
  line-height: 1.5;
}

.footer-tagline strong {
  color: var(--text);
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-contact a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-contact a:hover {
  color: var(--orange-light);
}

.footer-contact svg {
  width: 15px;
  height: 15px;
}

.footer-copy {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 20px;
}

@media (max-width: 700px) {
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }
  .dual-row {
    grid-template-columns: 1fr;
  }
  .info-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .info-item:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
  }
}
