/* Public live stats dashboard – scoped only under #publicStatsSection */
#publicStatsSection {
  margin: 1.75rem 0 2rem;
  font-family: 'Tajawal', sans-serif;
}

#publicStatsSection .ps-shell {
  background: #fff;
  border: 1px solid rgba(26, 58, 92, 0.08);
  border-radius: 18px;
  padding: 1.5rem 1.4rem 1.35rem;
  box-shadow: 0 10px 28px rgba(15, 39, 64, 0.06);
  position: relative;
  overflow: hidden;
}

#publicStatsSection .ps-shell::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: #1a3a5c;
}

#publicStatsSection .ps-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

#publicStatsSection .ps-title {
  margin: 0;
  color: #1a3a5c;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

#publicStatsSection .ps-sub {
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.7;
}

#publicStatsSection .ps-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

#publicStatsSection .ps-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: psPulse 1.4s ease-in-out infinite;
}

@keyframes psPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

#publicStatsSection .ps-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

#publicStatsSection .ps-kpi {
  border-radius: 14px;
  padding: 1.1rem 1rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#publicStatsSection .ps-kpi.is-total {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

#publicStatsSection .ps-kpi.is-reject {
  background: #fff1f2;
  border-color: #fecdd3;
}

#publicStatsSection .ps-kpi.is-proposal {
  background: #fffbeb;
  border-color: #fde68a;
}

#publicStatsSection .ps-kpi-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #475569;
  line-height: 1.5;
}

#publicStatsSection .ps-kpi.is-reject .ps-kpi-label { color: #9f1239; }
#publicStatsSection .ps-kpi.is-proposal .ps-kpi-label { color: #92400e; }

#publicStatsSection .ps-kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: #0f2740;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.2s ease;
}

#publicStatsSection .ps-kpi.is-reject .ps-kpi-value { color: #be123c; }
#publicStatsSection .ps-kpi.is-proposal .ps-kpi-value { color: #b45309; }

#publicStatsSection .ps-kpi-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

#publicStatsSection .ps-dept-title {
  margin: 0 0 0.85rem;
  color: #1a3a5c;
  font-size: 0.95rem;
  font-weight: 800;
}

#publicStatsSection .ps-dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

#publicStatsSection .ps-dept {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.9rem 0.95rem;
  background: #fff;
}

#publicStatsSection .ps-dept-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.55rem;
}

#publicStatsSection .ps-dept-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

#publicStatsSection .ps-dept-count {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1a3a5c;
  font-variant-numeric: tabular-nums;
}

#publicStatsSection .ps-dept-meta {
  font-size: 0.72rem;
  color: #64748b;
  text-align: left;
  line-height: 1.45;
}

#publicStatsSection .ps-bar {
  margin-top: 0.65rem;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

#publicStatsSection .ps-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #2563eb;
  transition: width 0.45s ease;
}

#publicStatsSection .ps-foot {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: #94a3b8;
  font-size: 0.75rem;
}

#publicStatsSection .ps-loading .ps-kpi-value,
#publicStatsSection .ps-loading .ps-dept-count {
  opacity: 0.35;
}

@media (max-width: 760px) {
  #publicStatsSection .ps-kpis {
    grid-template-columns: 1fr;
  }
  #publicStatsSection .ps-kpi-value {
    font-size: 1.75rem;
  }
}
