/* ── Riego Dashboard ── */

/* Grid variants */
.grid.four {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.grid.three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Stat cards */
.stat-card {
  text-align: center;
  padding: 1.2rem 1rem;
}
.stat-card .label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .4rem;
}
.stat-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}
.stat-card .sub {
  font-size: .75rem;
  color: var(--muted);
  margin-top: .25rem;
}

/* Hero status dot */
.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  vertical-align: middle;
}
.dot.online {
  background: #10b981;
  box-shadow: 0 0 8px #10b98166;
  animation: pulse 2s ease-in-out infinite;
}
.dot.offline {
  background: #ef4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Form elements */
.form-row {
  margin-bottom: .75rem;
}
.form-row label {
  display: block;
  margin-bottom: .25rem;
}
.btn-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.feedback {
  margin-top: .5rem;
  min-height: 1.2em;
}

/* Pill states */
.pill.ok { background: #10b98122; color: #10b981; }
.pill.warn { background: #f59e0b22; color: #f59e0b; }
.pill.danger { background: #ef444422; color: #ef4444; }

/* Chart box */
.chart-box {
  width: 100%;
  height: 280px;
  margin-top: .5rem;
}

/* Routebar section links */
.routebar-link.active {
  font-weight: 600;
}

/* Pill buttons for chart range */
.pill-grid {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}
.pill-btn {
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .8rem;
  transition: all .15s;
}
.pill-btn:hover { border-color: var(--accent); color: var(--accent); }
.pill-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Warnings banner */
#warnings-bar {
  margin-bottom: 1rem;
}
#warnings-bar ul {
  margin: 0;
  padding-left: 1.2rem;
}

/* Table */
.table th, .table td { white-space: nowrap; }
.table .mono { font-family: 'JetBrains Mono', monospace; font-size: .82rem; }

/* Topbar extras */
.topbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.mono { font-family: 'JetBrains Mono', monospace; }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0 1rem;
}

/* Disabled buttons */
.btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Offline banner */
.alert-danger {
  background: #ef444415;
  border: 1px solid #ef444444;
  color: #ef4444;
  padding: .75rem 1rem;
  border-radius: .5rem;
  margin-bottom: 1rem;
  font-size: .875rem;
}

/* Responsive */
@media (max-width: 640px) {
  .grid.four { grid-template-columns: repeat(2, 1fr); }
  .grid.three { grid-template-columns: 1fr; }
  .stat-card .value { font-size: 1.4rem; }
  .chart-box { height: 220px; }
}
