/* ─── STAT CARDS ────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px 18px;
  display: flex; align-items: flex-start; justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: transform .18s, box-shadow .18s;
  cursor: default;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); margin-top: 4px; line-height: 1; }
.stat-sub   { font-size: 11px; color: var(--muted); margin-top: 5px; }
.stat-icon  { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }

/* ─── PIPELINE PROGRESS ─────────────────────────────── */
.pipeline-wrap {
  display: flex; align-items: stretch; gap: 0;
  position: relative;
}

/* Continuous flow track behind all steps */
.pipeline-flow-track {
  position: absolute;
  top: 50%; left: 2%; right: 2%;
  height: 2px;
  background: #E2E8F0;
  transform: translateY(-50%);
  z-index: 0;
  border-radius: 2px;
  pointer-events: none;
}
.pipeline-flow-fill {
  height: 100%;
  background: linear-gradient(90deg, #48BB78, #48BB78 calc(var(--fill-pct, 0%) - 1%), var(--blue) var(--fill-pct, 0%));
  border-radius: 2px;
  width: 0;
  transition: width 1.4s cubic-bezier(.4,0,.2,1);
}

/* Step wrapper */
.pipeline-step {
  flex: 1; position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
}

/* Status dot above each step */
.pipeline-status-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; flex-shrink: 0;
  position: relative; z-index: 2;
  border: 2px solid #E2E8F0;
  background: var(--card);
  transition: background .4s, border-color .4s, box-shadow .4s;
}
.pipeline-step.done .pipeline-status-dot {
  background: #48BB78; border-color: #48BB78;
  box-shadow: 0 0 0 4px rgba(72,187,120,.15);
}
.pipeline-step.active .pipeline-status-dot {
  background: var(--blue); border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0,100,164,.15);
  animation: pulse-active 2s ease-in-out infinite;
}
.pipeline-step.idle .pipeline-status-dot { background: #EDF2F7; }

@keyframes pulse-active {
  0%,100% { box-shadow: 0 0 0 4px rgba(0,100,164,.15); }
  50%      { box-shadow: 0 0 0 8px rgba(0,100,164,.08); }
}

/* Step card */
.pipeline-step-inner {
  background: #F7FAFC; border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  width: 100%;
  position: relative; overflow: hidden;
  transition: background .4s, border-color .4s, box-shadow .4s;
}
.pipeline-step.done .pipeline-step-inner {
  background: #F0FFF4; border-color: #9AE6B4;
}
.pipeline-step.active .pipeline-step-inner {
  background: #EBF8FF; border-color: #90CDF4;
  box-shadow: 0 2px 12px rgba(0,100,164,.10);
}

/* Step gap */
.pipeline-step + .pipeline-step { margin-left: 6px; }

/* Header row */
.pipeline-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center;
}
.pipeline-pct { font-size: 11px; font-weight: 700; }
.pipeline-step.done   .pipeline-pct { color: #38A169; }
.pipeline-step.active .pipeline-pct { color: var(--blue); }
.pipeline-step.idle   .pipeline-pct { color: var(--muted); }

/* Progress track */
.prog-track {
  height: 5px; background: #E2E8F0; border-radius: 3px;
  overflow: hidden; position: relative;
}
.prog-fill {
  height: 100%; border-radius: 3px;
  width: 0; /* animated by JS */
  transition: width 1.1s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.pipeline-step.done   .prog-fill { background: #48BB78; }
.pipeline-step.active .prog-fill { background: var(--blue); }
.pipeline-step.idle   .prog-fill { background: #CBD5E0; }

/* Shimmer sweep on active bar */
.pipeline-step.active .prog-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,.55) 45%,
    rgba(255,255,255,.75) 55%,
    transparent 100%
  );
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: 3px;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

.pipeline-count {
  font-size: 10.5px; color: var(--muted); margin-top: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── DUAL CHARTS ROW ───────────────────────────────── */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }

/* Donut chart */
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-svg-wrap { position: relative; flex-shrink: 0; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-val  { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.donut-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.legend-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.legend-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-name { font-size: 13px; flex: 1; color: var(--text); }
.legend-count { font-size: 12px; color: var(--muted); }
.legend-pct  { font-size: 12px; font-weight: 600; width: 36px; text-align: right; }

/* ─── ACTIVITY ──────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: #F7FAFC;
  border-radius: 10px; border: 1px solid var(--border);
  transition: background .15s;
}
.activity-item:hover { background: #EDF2F7; }
.activity-badge {
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
  white-space: nowrap;
}
.badge-green  { background: #C6F6D5; color: #276749; }
.badge-yellow { background: #FEFCBF; color: #744210; }
.badge-red    { background: #FED7D7; color: #822727; }
.badge-blue   { background: #BEE3F8; color: #1A365D; }
.activity-text { flex: 1; font-size: 13px; color: var(--text); }
.activity-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ─── CAMERA STATUS ─────────────────────────────────── */
.cameras-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.camera-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  transition: all .18s;
}
.camera-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-1px); }
.camera-name { font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 10px; }
.camera-stat { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.camera-stat-label { font-size: 11px; color: var(--muted); }
.camera-stat-val   { font-size: 12px; font-weight: 600; color: var(--text); }
.camera-sync {
  margin-top: 10px; padding: 4px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px;
}
.sync-ok      { background: #C6F6D5; color: #276749; }
.sync-pending { background: #FEFCBF; color: #744210; }

