/* ============================================
   Dashboard styles for live data pages
   ============================================ */

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.dash-header h1 {
  font-size: 1.8rem;
  color: var(--color-primary-dark);
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: 0.5rem;
}

.dash-updated {
  font-size: 0.85rem;
  color: var(--color-text-light);
  background: var(--color-bg-card);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.dash-updated span {
  font-weight: 600;
}

/* Stat cards */
.stat-card {
  background: var(--color-bg-card);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--color-border-light);
  border-top: 3px solid var(--color-accent);
}

.stat-card h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}

.stat-hero {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-sub {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* Stat rows inside cards */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.9rem;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: var(--color-text-light);
}

.stat-value {
  font-weight: 600;
  color: var(--color-text);
}

/* Badges */
.stat-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
}

.stat-on {
  background: #e8f5e9;
  color: #2e7d32;
}

.stat-off {
  background: #f5f5f5;
  color: #999;
}

.stat-warn {
  background: #fff3e0;
  color: #e65100;
}

.stat-active {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  vertical-align: middle;
}

/* Dashboard grid */
.dash-grid {
  display: grid;
  gap: 1rem;
}

.dash-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.dash-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.dash-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Note box */
.dash-note {
  background: #fff8e1;
  border-left: 4px solid var(--color-accent);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
  border-radius: 0 4px 4px 0;
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .dash-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-grid-3 {
    grid-template-columns: 1fr;
  }

  .dash-grid-2 {
    grid-template-columns: 1fr;
  }

  .stat-hero {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .dash-grid-4 {
    grid-template-columns: 1fr;
  }
}
