.operations-page {
  background: var(--bg);
}

.operations-shell {
  margin: 0 auto;
  max-width: 1440px;
  min-height: 100vh;
  padding: 24px;
}

.operations-topbar,
.operations-actions,
.overall-state {
  align-items: center;
  display: flex;
}

.operations-topbar {
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.operations-actions {
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.auto-refresh-control {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
}

.auto-refresh-control input {
  accent-color: var(--blue);
  height: 16px;
  margin: 0;
  width: 16px;
}

.operations-overview {
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--line-strong);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2.2fr);
  min-height: 112px;
}

.operations-overview[data-status="healthy"] {
  border-left-color: var(--green);
}

.operations-overview[data-status="degraded"] {
  border-left-color: var(--amber);
}

.operations-overview[data-status="unavailable"],
.operations-overview[data-status="error"] {
  border-left-color: var(--red);
}

.overall-state {
  gap: 14px;
  padding: 20px;
}

.overall-indicator {
  background: var(--line-strong);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(185, 197, 208, 0.25);
  flex: 0 0 auto;
  height: 12px;
  width: 12px;
}

[data-status="healthy"] .overall-indicator {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(29, 125, 90, 0.14);
}

[data-status="degraded"] .overall-indicator {
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(154, 106, 20, 0.14);
}

[data-status="unavailable"] .overall-indicator,
[data-status="error"] .overall-indicator {
  background: var(--red);
  box-shadow: 0 0 0 6px rgba(178, 58, 58, 0.14);
}

.overall-state span,
.operations-summary dt,
.panel-header p,
.component-facts,
.issue-item small,
.metric-list dt,
.response-row span {
  color: var(--muted);
  font-size: 12px;
}

.overall-state strong {
  display: block;
  font-size: 22px;
  margin-top: 5px;
}

.operations-summary {
  border-left: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.operations-summary div {
  align-content: center;
  border-right: 1px solid var(--line);
  display: grid;
  min-width: 0;
  padding: 18px;
}

.operations-summary div:last-child {
  border-right: 0;
}

.operations-summary dd {
  font-size: 19px;
  font-weight: 800;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.operations-notice {
  color: var(--muted);
  font-size: 12px;
  min-height: 34px;
  padding: 9px 2px;
}

.operations-notice.error {
  color: var(--red);
}

.operations-layout {
  display: grid;
  gap: 16px;
  grid-template-areas:
    "deployment deployment"
    "components release"
    "components issues"
    "evaluation evaluation"
    "metrics responses";
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
}

.operations-layout > .panel {
  min-width: 0;
}

.operations-components-panel,
.operations-issues-panel,
.operations-metrics-panel,
.operations-responses-panel,
.operations-evaluation-panel {
  align-self: start;
  overflow: hidden;
}

.operations-components-panel {
  grid-area: components;
}

.operations-deployment-panel {
  grid-area: deployment;
  overflow: hidden;
}

.operations-release-panel {
  grid-area: release;
}

.operations-evaluation-panel {
  grid-area: evaluation;
}

.operations-issues-panel {
  grid-area: issues;
}

.operations-metrics-panel {
  grid-area: metrics;
}

.operations-responses-panel {
  grid-area: responses;
}

.panel-header p {
  margin-top: 4px;
}

.component-count,
.issue-count {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  min-width: 36px;
  padding: 5px 9px;
  text-align: center;
}

.component-row {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1.55fr) auto;
  padding: 16px;
}

.component-name {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.component-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  line-height: 1.55;
  min-width: 0;
}

.component-facts span {
  overflow-wrap: anywhere;
}

.state-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.state-badge.healthy {
  border-color: rgba(29, 125, 90, 0.35);
  color: var(--green);
}

.state-badge.degraded {
  border-color: rgba(154, 106, 20, 0.35);
  color: var(--amber);
}

.state-badge.unavailable {
  border-color: rgba(178, 58, 58, 0.35);
  color: var(--red);
}

.issue-item {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}

.issue-item strong,
.issue-item small {
  display: block;
}

.issue-item small {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.empty-operations-state {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  padding: 24px 16px;
  text-align: center;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.metric-list div {
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  min-width: 0;
  padding: 14px 16px;
}

.metric-list div:nth-child(2n) {
  border-right: 0;
}

.metric-list dd {
  font-size: 16px;
  font-weight: 800;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.response-distribution {
  border-top: 1px solid var(--line);
  padding: 15px 16px;
}

.release-issues {
  border-top: 1px solid var(--line);
}

.release-issues .issue-item {
  padding: 11px 16px;
}

.deployment-stage-list {
  border-top: 1px solid var(--line);
}

.deployment-stage-row {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px 16px;
  grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1.8fr) auto;
  padding: 14px 16px;
}

.deployment-stage-row:first-child {
  border-top: 0;
}

.deployment-stage-title strong,
.deployment-stage-title small {
  display: block;
}

.deployment-stage-title strong {
  font-size: 14px;
}

.deployment-stage-title small,
.deployment-stage-blockers,
.deployment-evidence-summary {
  color: var(--muted);
  font-size: 12px;
}

.deployment-stage-title small {
  margin-top: 5px;
}

.deployment-stage-blockers {
  line-height: 1.6;
  margin: 0;
  overflow-wrap: anywhere;
}

.deployment-stage-blockers summary {
  cursor: pointer;
  font-weight: 700;
}

.deployment-stage-blockers ul {
  display: grid;
  gap: 4px 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 8px 0 0;
  padding-left: 18px;
}

.deployment-evidence-summary {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
}

.operations-evaluation-grid {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr) minmax(240px, 0.9fr);
}

.operations-evaluation-grid > div {
  min-width: 0;
  padding: 15px 16px;
}

.operations-evaluation-grid > div + div {
  border-left: 1px solid var(--line);
}

.operations-evaluation-grid h3 {
  font-size: 13px;
  margin: 0 0 11px;
}

.job-status-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.job-status-count {
  border-top: 1px solid var(--line);
  min-width: 0;
  padding: 9px 10px 8px 0;
}

.job-status-count:nth-child(-n + 3) {
  border-top: 0;
}

.job-status-count span,
.operations-active-job small {
  color: var(--muted);
  display: block;
  font-size: 11px;
}

.job-status-count strong {
  display: block;
  font-size: 18px;
  margin-top: 4px;
}

.operations-active-job {
  min-height: 72px;
}

.operations-active-job strong,
.operations-active-job p {
  display: block;
  overflow-wrap: anywhere;
}

.operations-active-job p {
  font-size: 12px;
  line-height: 1.5;
  margin: 5px 0 0;
}

.operations-progress-track {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 9px;
  margin-top: 11px;
  overflow: hidden;
}

.operations-progress-bar {
  background: var(--blue);
  height: 100%;
  transition: width 180ms ease;
}

.evaluation-budget-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.evaluation-budget-list div {
  padding: 9px 10px 8px 0;
}

.evaluation-budget-list dd {
  font-size: 15px;
}

.release-metric-list dd {
  font-size: 18px;
}

.response-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 46px minmax(0, 1fr) 42px;
  margin-bottom: 11px;
}

.response-row:last-child {
  margin-bottom: 0;
}

.response-row strong {
  font-size: 12px;
  text-align: right;
}

.response-track {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.response-bar {
  background: var(--blue);
  height: 100%;
  min-width: 0;
}

.response-row[data-status-class="2xx"] .response-bar {
  background: var(--green);
}

.response-row[data-status-class="4xx"] .response-bar {
  background: var(--amber);
}

.response-row[data-status-class="5xx"] .response-bar,
.response-row[data-status-class="other"] .response-bar {
  background: var(--red);
}

@media (max-width: 980px) {
  .operations-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .operations-actions {
    justify-content: flex-start;
  }

  .operations-overview,
  .operations-layout {
    grid-template-columns: 1fr;
  }

  .operations-layout {
    grid-template-areas:
      "deployment"
      "release"
      "components"
      "issues"
      "evaluation"
      "metrics"
      "responses";
  }

  .operations-evaluation-grid {
    grid-template-columns: 1fr 1fr;
  }

  .operations-evaluation-grid > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
  }

  .operations-summary {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

}

@media (max-width: 620px) {
  .operations-shell {
    padding: 14px;
  }

  .operations-actions,
  .operations-actions > * {
    width: 100%;
  }

  .operations-actions .button-link,
  .operations-actions button {
    justify-content: center;
    text-align: center;
  }

  .operations-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .operations-summary div:nth-child(2) {
    border-right: 0;
  }

  .operations-summary div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .component-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .deployment-stage-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .deployment-stage-blockers {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .deployment-stage-blockers ul {
    grid-template-columns: 1fr;
  }

  .component-facts {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .operations-evaluation-grid {
    grid-template-columns: 1fr;
  }

  .operations-evaluation-grid > div + div,
  .operations-evaluation-grid > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-column: auto;
  }
}
