/* ============================================
   Chart & Gauge Components
   ============================================ */

/* === Gauge (circular score) === */
.gauge {
  position: relative;
  width: 160px;
  height: 160px;
}

.gauge__svg {
  transform: rotate(-90deg);
}

.gauge__track {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 6;
}

.gauge__fill {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 6;
  stroke-linecap: butt;
  transition: stroke-dashoffset 1.5s ease;
}

.gauge__value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.gauge__score {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-thin);
  color: var(--color-accent);
  letter-spacing: var(--ls-tight);
  line-height: 1;
}

.gauge__label {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  margin-top: var(--sp-1);
}

/* === Bar Chart (horizontal) === */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.bar-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.bar-item__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.bar-item__label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

.bar-item__value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-accent);
}

.bar-item__track {
  height: 6px;
  background: var(--color-border);
  overflow: hidden;
}

.bar-item__fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 1.2s ease;
}

.bar-item__fill--critical { background: var(--color-critical); }
.bar-item__fill--warning { background: var(--color-warning); }
.bar-item__fill--success { background: var(--color-success); }

/* === Score Badge === */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  border: 1px solid;
}

.score-badge--critical {
  color: var(--color-critical);
  border-color: var(--color-critical);
  background: var(--color-critical-bg);
}

.score-badge--warning {
  color: var(--color-warning);
  border-color: var(--color-warning);
  background: var(--color-warning-bg);
}

.score-badge--success {
  color: var(--color-success);
  border-color: var(--color-success);
  background: var(--color-success-bg);
}

/* === Timeline === */
.timeline {
  position: relative;
  padding-left: var(--sp-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(
    180deg,
    var(--bp-line) 0px,
    var(--bp-line) 4px,
    transparent 4px,
    transparent 8px
  );
}

.timeline__item {
  position: relative;
  padding-bottom: var(--sp-6);
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-8) + 8px);
  top: 4px;
  width: 10px;
  height: 10px;
  border: 1px solid var(--color-accent);
  background: white;
  transform: rotate(45deg);
}

.timeline__item--active::before {
  background: var(--color-accent);
}

.timeline__agent {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-1);
}

.timeline__content {
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}

/* === Progress Steps === */
.progress-steps {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.progress-step--active {
  color: var(--color-accent);
}

.progress-step--done {
  color: var(--color-success);
}

.progress-step__dot {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.progress-step--active .progress-step__dot,
.progress-step--done .progress-step__dot {
  background: currentColor;
}

.progress-step__line {
  width: 24px;
  height: 1px;
  background: var(--color-border);
}

/* === Loading Animation === */
.loading-dots {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border: 1px solid var(--color-accent);
  transform: rotate(45deg);
  animation: loadDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadDot {
  0%, 80%, 100% {
    background: transparent;
    opacity: 0.3;
  }
  40% {
    background: var(--color-accent);
    opacity: 1;
  }
}
