/* pipeline status page styles */

/* ==========================================================================
   Pipeline Status Page
   ========================================================================== */

.pipeline-status-layout {
  max-width: 70rem;
}

.pipeline-status-pull-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  align-items: center;
}

.pipeline-status-pull-meta > span:not(.pipeline-refresh-indicator) {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 82%, var(--card));
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.pipeline-status-pull-meta > span:not(.pipeline-refresh-indicator) > span {
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pipeline-status-pull-meta > span:not(.pipeline-refresh-indicator) > strong {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.pipeline-status-pull-meta > span[data-stale="true"] {
  border-color: color-mix(in srgb, var(--stale) 42%, var(--border));
  background: color-mix(in srgb, var(--stale) 9%, var(--card));
}

.pipeline-status-pull-meta > span[data-stale="true"] > strong {
  color: var(--stale);
}

.pipeline-refresh-indicator,
.pipeline-refresh-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.pipeline-refresh-indicator {
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0 0.7rem;
}

.pipeline-refresh-indicator .ph-bold.ph-spinner-gap {
  display: inline-grid;
  width: 0.82rem;
  height: 0.82rem;
  place-items: center;
  font-size: 0.82rem;
  line-height: 1;
}

.pipeline-refresh-indicator[data-state="idle"] .ph-bold.ph-spinner-gap {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .pipeline-refresh-indicator .ph-spin {
    animation: none;
  }
}

.pipeline-refresh-badge {
  min-height: 1.45rem;
  margin-bottom: 0.25rem;
  padding: 0 0.45rem;
}

.pipeline-refresh-indicator[data-state="idle"],
.pipeline-refresh-badge[data-state="idle"],
.pipeline-refresh-badge[data-state="checked"] {
  border-color: color-mix(in srgb, var(--good) 45%, var(--border));
  background: color-mix(in srgb, var(--good) 10%, var(--surface-soft));
  color: var(--good);
}

.pipeline-refresh-indicator[data-state="updating"],
.pipeline-refresh-indicator[data-state="loading"],
.pipeline-refresh-badge[data-state="updating"],
.pipeline-refresh-badge[data-state="queued"] {
  border-color: color-mix(in srgb, var(--muted) 42%, var(--border));
  background: color-mix(in srgb, var(--muted) 11%, var(--surface-soft));
  color: var(--muted);
}

.pipeline-refresh-indicator[data-state="degraded"] {
  border-color: color-mix(in srgb, var(--degraded) 48%, var(--border));
  background: color-mix(in srgb, var(--degraded) 10%, var(--surface-soft));
  color: var(--degraded);
}

.pipeline-status-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.6rem;
}

.pipeline-status-summary-item {
  display: grid;
  gap: 0.15rem;
  min-height: 4.2rem;
  align-content: center;
  padding: 0.75rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

button.pipeline-status-summary-item {
  width: 100%;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

button.pipeline-status-summary-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--text) 24%, var(--border));
}

button.pipeline-status-summary-item:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.pipeline-status-summary-item[data-active="true"] {
  border-color: color-mix(in srgb, var(--text) 34%, var(--border));
  background: color-mix(in srgb, var(--text) 5%, var(--surface-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 16%, transparent);
}

.pipeline-status-summary-item[data-status="fresh"][data-active="true"] {
  background: color-mix(in srgb, var(--good) 8%, var(--surface-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 34%, transparent);
}

.pipeline-status-summary-item[data-status="stale"][data-active="true"] {
  background: color-mix(in srgb, var(--stale) 8%, var(--surface-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stale) 34%, transparent);
}

.pipeline-status-summary-item[data-status="degraded"][data-active="true"] {
  background: color-mix(in srgb, var(--degraded) 8%, var(--surface-soft));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--degraded) 34%, transparent);
}

.pipeline-status-summary-item strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1;
}

.pipeline-status-summary-item span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pipeline-status-summary-item[data-status="fresh"] {
  border-color: color-mix(in srgb, var(--good) 32%, var(--border));
}

.pipeline-status-summary-item[data-status="stale"] {
  border-color: color-mix(in srgb, var(--stale) 42%, var(--border));
}

.pipeline-status-summary-item[data-status="degraded"] {
  border-color: color-mix(in srgb, var(--degraded) 42%, var(--border));
}

.pipeline-status-controls {
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem);
  align-items: end;
}

.pipeline-status-controls label {
  display: grid;
  gap: 0.4rem;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pipeline-status-controls input,
.pipeline-status-controls select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
}

.pipeline-status-controls select {
  padding-right: 2.35rem;
}

.pipeline-status-card {
  padding: 0;
  overflow: hidden;
}

.pipeline-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  align-items: center;
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pipeline-status-legend span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  white-space: nowrap;
}

.pipeline-status-legend i {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--muted);
}

.pipeline-status-legend i[data-status="fresh"] {
  background: var(--good);
}

.pipeline-status-legend i[data-status="stale"] {
  background: var(--stale);
}

.pipeline-status-legend i[data-status="degraded"] {
  background: var(--degraded);
}

.pipeline-status-legend i[data-status="updating"],
.pipeline-status-legend i[data-status="disabled"] {
  background: var(--muted);
}

.pipeline-status-table-wrap {
  position: relative;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.pipeline-status-table-wrap::after {
  position: sticky;
  right: 0;
  display: block;
  width: 3rem;
  height: 0;
  margin-left: auto;
  content: "";
  pointer-events: none;
  box-shadow: inset -1.35rem 0 1.2rem -1rem color-mix(in srgb, var(--card) 92%, transparent);
}

.pipeline-status-table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.pipeline-status-table th,
.pipeline-status-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.pipeline-status-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pipeline-status-table tbody tr:last-child th,
.pipeline-status-table tbody tr:last-child td {
  border-bottom: 0;
}

.pipeline-status-table tbody tr[data-status="degraded"] {
  background: color-mix(in srgb, var(--degraded) 8%, var(--card));
}

.pipeline-status-table tbody tr[data-status="fresh"] {
  background: color-mix(in srgb, var(--good) 5%, var(--card));
}

.pipeline-status-table tbody tr[data-status="stale"] {
  background: color-mix(in srgb, var(--stale) 8%, var(--card));
}

.pipeline-status-table th[scope="row"],
.pipeline-status-table td {
  min-width: 0;
}

.pipeline-status-table th[scope="row"] {
  width: 11rem;
}

.pipeline-status-table th[scope="row"] strong,
.pipeline-status-table td strong {
  display: block;
  color: var(--text);
  font-weight: 800;
}

.pipeline-status-table th[scope="row"] span,
.pipeline-status-table td span {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.pipeline-status-table .pipeline-refresh-badge {
  display: inline-flex;
  margin-top: 0;
  line-height: 1;
}

.pipeline-status-table a {
  color: var(--text);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.pipeline-status-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 1.55rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.pipeline-status-badge .pipeline-status-badge-label {
  display: block;
  margin: 0;
  color: inherit;
  font: inherit;
  line-height: inherit;
  transform: translateY(0.09rem);
}

.pipeline-status-badge[data-status="fresh"] {
  border-color: color-mix(in srgb, var(--good) 45%, var(--border));
  background: color-mix(in srgb, var(--good) 10%, var(--surface-soft));
  color: var(--good);
}

.pipeline-status-badge[data-status="stale"] {
  border-color: color-mix(in srgb, var(--stale) 48%, var(--border));
  background: color-mix(in srgb, var(--stale) 10%, var(--surface-soft));
  color: var(--stale);
}

.pipeline-status-badge[data-status="degraded"] {
  border-color: color-mix(in srgb, var(--degraded) 48%, var(--border));
  background: color-mix(in srgb, var(--degraded) 10%, var(--surface-soft));
  color: var(--degraded);
}

.pipeline-status-badge[data-status="disabled"] {
  color: var(--muted);
}
