/* ===========================================
   Progress, meters and status indicators (design §D.16)

   Bars read their fill from a custom property written by the style-vars
   Stimulus controller (CSP blocks inline style attributes), always with a
   0% fallback. Owners give each bar role="progressbar" or role="meter" and
   its aria-value* attributes.
   =========================================== */

.progress-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.progress-inline__bar {
  display: block;
  width: 48px;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--color-surface-elevated);
}

.progress-inline__fill {
  display: block;
  width: var(--progress-pct, 0%);
  height: 100%;
  background: var(--color-primary);
}

.progress-inline__fill--complete { background: var(--color-success); }
.progress-inline__fill--warning { background: var(--color-warning); }
.progress-inline__fill--error { background: var(--color-danger); }

.progress-inline__text {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.progress-inline--sm .progress-inline__bar { width: 36px; height: 4px; }
.progress-inline--lg .progress-inline__bar { width: 80px; height: 8px; }

/* ===========================================
   Status indicator: a dot plus a word (merged from components/messages.css,
   where it wrapped a status badge in the task sidebar).
   =========================================== */

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--color-success);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

/* As a wrapper (task sidebar): the badge and its details stack. */
.status-indicator:has(> .status-badge) {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-sm);
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.status-indicator__dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

.status-indicator--pending { color: var(--color-warning); }
.status-indicator--active { color: var(--color-info); }
.status-indicator--error { color: var(--color-danger); }
.status-indicator--inactive { color: var(--color-text-muted); }

@media (forced-colors: active) {
  .status-indicator__dot {
    forced-color-adjust: none;
  }
}
