/* ============================================================
   RBM (Results-Based Management) — Shared Styles
   ============================================================ */

/* Result Level Indicators */
.result-level-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 0.25rem;
}

.result-level-impact {
  border-left: 4px solid #6f42c1;
}
.result-level-outcome {
  border-left: 4px solid #0d6efd;
}
.result-level-output {
  border-left: 4px solid #198754;
}

.badge-impact  { background-color: #6f42c1; color: #fff; }
.badge-outcome { background-color: #0d6efd; color: #fff; }
.badge-output  { background-color: #198754; color: #fff; }

/* KPI Cards */
.rbm-kpi-card {
  border-radius: 0.5rem;
  border: 1px solid rgba(0,0,0,.1);
  transition: box-shadow 0.15s ease;
}
.rbm-kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.rbm-kpi-card .kpi-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}
.rbm-kpi-card .kpi-label {
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.rbm-kpi-card .kpi-change {
  font-size: 0.8rem;
}

/* Achievement Progress Bars */
.achievement-bar .progress {
  height: 8px;
  border-radius: 4px;
}
.achievement-bar .progress-label {
  font-size: 0.75rem;
  color: #6c757d;
  min-width: 3.5rem;
  text-align: right;
}

/* Status colour helpers */
.status-on-track    { color: #198754; }
.status-at-risk     { color: #fd7e14; }
.status-off-track   { color: #dc3545; }
.status-not-started { color: #6c757d; }

.bg-on-track    { background-color: #198754 !important; }
.bg-at-risk     { background-color: #fd7e14 !important; }
.bg-off-track   { background-color: #dc3545 !important; }

/* Validation Status Badges */
.badge-pending   { background-color: #ffc107; color: #000; }
.badge-verified  { background-color: #198754; color: #fff; }
.badge-rejected  { background-color: #dc3545; color: #fff; }
.badge-flagged   { background-color: #6f42c1; color: #fff; }

/* Results Hierarchy Tree */
.results-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}
.results-tree li {
  position: relative;
  padding: 0.5rem 0.75rem 0.5rem 1.25rem;
  border-radius: 0.375rem;
  margin-bottom: 0.25rem;
  background: #f8f9fa;
  font-size: 0.875rem;
}
.results-tree li:hover {
  background: #e9ecef;
  cursor: pointer;
}

/* Validation Queue Panel */
.validation-queue-item {
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: border-color 0.1s, background-color 0.1s;
}
.validation-queue-item:hover,
.validation-queue-item.active {
  border-left-color: #0d6efd;
  background-color: #f0f4ff;
}
.validation-queue-item .item-meta {
  font-size: 0.75rem;
  color: #6c757d;
}

/* Audit Trail Timeline */
.audit-timeline {
  position: relative;
  padding-left: 1.5rem;
}
.audit-timeline::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6;
}
.audit-entry {
  position: relative;
  margin-bottom: 1rem;
}
.audit-entry::before {
  content: '';
  position: absolute;
  left: -1.1rem;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0d6efd;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #0d6efd;
}
.audit-entry .audit-time {
  font-size: 0.75rem;
  color: #6c757d;
}

/* Indicator Detail Panel */
.detail-panel {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.detail-field {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.detail-field .field-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s infinite;
  border-radius: 0.25rem;
  min-height: 1rem;
}
@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: #6c757d;
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

/* Print optimisations */
@media print {
  .rbm-kpi-card { box-shadow: none !important; }
  .no-print { display: none !important; }
}
