/* ===== DEVOPS DASHBOARD SECTION ===== */

#dashboard { background: var(--bg); }

.dashboard-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.dashboard-live {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .75rem; color: var(--accent3);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 6px var(--accent3);
  animation: pulse-dot 1.5s ease infinite;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.7); }
}

/* ── TOP ROW — big metric cards ── */
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dash-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative; overflow: hidden;
  transition: border-color .3s;
}
.dash-metric:hover { border-color: rgba(0,229,255,.3); }

/* subtle gradient top border on hover */
.dash-metric::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0; transition: opacity .3s;
}
.dash-metric:hover::after { opacity: 1; }

.dm-label {
  font-family: var(--font-mono); font-size: .68rem;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: .6rem;
}
.dm-value {
  font-family: var(--font-mono); font-size: 1.9rem;
  font-weight: 700; line-height: 1; color: var(--accent);
  transition: color .3s;
}
.dm-value.warn   { color: var(--yellow); }
.dm-value.danger { color: var(--red); }
.dm-value.ok     { color: var(--accent3); }

.dm-sub {
  font-family: var(--font-mono); font-size: .7rem;
  color: var(--text-muted); margin-top: .4rem;
}
.dm-delta {
  position: absolute; top: 1.1rem; right: 1.1rem;
  font-family: var(--font-mono); font-size: .7rem;
  padding: .15rem .45rem; border-radius: 4px;
}
.dm-delta.up   { color: var(--accent3); background: rgba(16,185,129,.1); }
.dm-delta.down { color: var(--red);     background: rgba(239,68,68,.1); }
.dm-delta.same { color: var(--text-muted); background: rgba(100,116,139,.1); }

/* sparkline canvas inside metric */
.dm-spark {
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 40px;
  opacity: .25;
}

/* ── BOTTOM ROW ── */
.dash-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 1rem;
}

/* Panel base */
.dash-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: border-color .3s;
}
.dash-panel:hover { border-color: rgba(0,229,255,.2); }

.dp-title {
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: space-between;
}

/* Services status */
.svc-list { display: flex; flex-direction: column; gap: .55rem; }
.svc-row {
  display: flex; align-items: center; gap: .65rem;
  font-family: var(--font-mono); font-size: .78rem;
}
.svc-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.svc-dot.online  { background: var(--accent3); box-shadow: 0 0 5px var(--accent3); }
.svc-dot.warn    { background: var(--yellow);  box-shadow: 0 0 5px var(--yellow); animation: pulse-dot 1s infinite; }
.svc-dot.offline { background: var(--red);     box-shadow: 0 0 5px var(--red); }
.svc-name  { flex: 1; color: var(--text-dim); }
.svc-ping  { color: var(--text-muted); font-size: .7rem; }
.svc-state { font-size: .7rem; }
.svc-state.online  { color: var(--accent3); }
.svc-state.warn    { color: var(--yellow); }

/* Pipelines */
.pipe-list { display: flex; flex-direction: column; gap: .6rem; }
.pipe-row {
  display: flex; align-items: center; gap: .65rem;
  font-family: var(--font-mono); font-size: .75rem;
}
.pipe-icon { font-size: .85rem; flex-shrink: 0; }
.pipe-info { flex: 1; min-width: 0; }
.pipe-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-time { font-size: .65rem; color: var(--text-muted); }
.pipe-badge {
  font-size: .65rem; padding: .15rem .5rem;
  border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}
.pipe-badge.success { background: rgba(16,185,129,.15); color: var(--accent3); border: 1px solid rgba(16,185,129,.3); }
.pipe-badge.running { background: rgba(0,229,255,.1);   color: var(--accent);  border: 1px solid rgba(0,229,255,.25); animation: pulse-dot 1.5s infinite; }
.pipe-badge.failed  { background: rgba(239,68,68,.1);   color: var(--red);     border: 1px solid rgba(239,68,68,.25); }

/* Activity log */
.log-list { display: flex; flex-direction: column; gap: .4rem; }
.log-entry {
  display: flex; gap: .75rem;
  font-family: var(--font-mono); font-size: .72rem;
  line-height: 1.4; align-items: flex-start;
}
.log-time { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; font-size: .67rem; margin-top: .05rem; }
.log-icon { flex-shrink: 0; }
.log-msg  { color: var(--text-dim); }
.log-msg .hl { color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 1000px) {
  .dash-metrics { grid-template-columns: repeat(2, 1fr); }
  .dash-bottom  { grid-template-columns: 1fr 1fr; }
  .dash-bottom .dash-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .dash-metrics { grid-template-columns: repeat(2, 1fr); }
  .dash-bottom  { grid-template-columns: 1fr; }
  .dm-value     { font-size: 1.5rem; }
}
