/* Dashboard — component styles */

/* Dashboard-specific layout: narrow sidebar + full-width main */
.sidebar { width: 200px; min-width: 200px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

.kpi-card {
  background: #fff;
  border: 1px solid #E4E4E7;
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #71717A;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: #18181B;
  line-height: 1.1;
}
.kpi-sub {
  font-size: 0.76rem;
  color: #71717A;
  margin-top: 0.2rem;
}
.kpi-accent-blue  { border-left: 4px solid #5B5BD6; }
.kpi-accent-green { border-left: 4px solid #30A46C; }
.kpi-accent-red   { border-left: 4px solid #E5484D; }
.kpi-accent-orange{ border-left: 4px solid #F97316; }

.section-card {
  background: #fff;
  border: 1px solid #E4E4E7;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #71717A;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
}

/* Horizontal bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 0.5rem; }
.bar-row { display: flex; align-items: center; gap: 0.6rem; }
.bar-label { width: 90px; font-size: 0.76rem; font-weight: 600; color: #3F3F46; flex-shrink: 0; }
.bar-track { flex: 1; height: 18px; background: #F3F4F6; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.bar-count { width: 32px; text-align: right; font-size: 0.76rem; font-weight: 700; color: #18181B; flex-shrink: 0; }

.fill-plan      { background: #9CA3AF; }
.fill-released  { background: #5B5BD6; }
.fill-started   { background: #F97316; }
.fill-completed { background: #30A46C; }
.fill-closed    { background: #E5484D; }

/* Equipment status badges */
.eq-badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.76rem; font-weight: 700; }
.eq-active   { background: #D1FAE5; color: #065F46; }
.eq-maint    { background: #FEF3C7; color: #92400E; }
.eq-inactive { background: #F3F4F6; color: #6B7280; }

.wo-badge { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.7rem; font-weight: 700; }
.wo-plan       { background: #F3F4F6; color: #4B5563; }
.wo-released   { background: #EEF0FF; color: #5B5BD6; }
.wo-started    { background: #FFF7ED; color: #C2410C; }
.wo-completed  { background: #D1FAE5; color: #065F46; }
.wo-closed     { background: #FFE4E6; color: #9F1239; }

.refresh-btn {
  width: 100%; padding: 0.5rem; background: #5B5BD6; color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 0.82rem;
  font-weight: 600; margin-bottom: 0.5rem;
}
.refresh-btn:hover { background: #4747b5; }

.last-updated {
  font-size: 0.72rem; color: #A1A1AA; text-align: center; margin-top: 0.3rem;
}

.main-scroll { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }

.spinner-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.08);
  align-items: center; justify-content: center; z-index: 100;
}
.spinner-overlay.show { display: flex; }
