:root {
  color: #172026;
  background: #f4f6f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f4f6f8;
}

button,
input,
select {
  font: inherit;
}

.ops-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.ops-header {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.ops-header p,
.ops-detail-head p {
  color: #66717b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.ops-header h1,
.ops-detail-head h2 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

.ops-actions {
  display: flex;
  gap: 8px;
}

.ops-actions button,
.ops-rule-form button {
  background: #ffffff;
  border: 1px solid #c8d0d8;
  border-radius: 6px;
  color: #172026;
  cursor: pointer;
  min-height: 36px;
  padding: 0 14px;
}

.ops-rule-form button {
  background: #146c94;
  border-color: #146c94;
  color: #ffffff;
}

.ops-error {
  background: #fff2f0;
  border: 1px solid #efb6ad;
  border-radius: 6px;
  color: #9b2c20;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.ops-kpis,
.ops-grid,
.ops-lower {
  display: grid;
  gap: 12px;
}

.ops-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.ops-kpis article,
.ops-panel {
  background: #ffffff;
  border: 1px solid #dce2e8;
  border-radius: 8px;
}

.ops-kpis article {
  min-height: 84px;
  padding: 16px;
}

.ops-kpis span,
.ops-metrics span {
  color: #66717b;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.ops-kpis strong {
  font-size: 28px;
}

.ops-grid {
  grid-template-columns: 360px minmax(0, 1fr);
  margin-bottom: 12px;
}

.ops-panel {
  padding: 14px;
}

.ops-section-title {
  color: #3a4650;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.ops-target {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 12px minmax(0, 1fr) 52px;
  min-height: 54px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.ops-target.active {
  background: #edf6fa;
}

.ops-target strong,
.ops-target small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-target small {
  color: #66717b;
  margin-top: 3px;
}

.ops-dot {
  border-radius: 50%;
  display: block;
  height: 10px;
  width: 10px;
}

.ops-dot.ok,
.ops-pill.ok,
.ops-pill.dry_run {
  background: #dff3e6;
  color: #17623a;
}

.ops-dot.warning,
.ops-pill.warning {
  background: #fff1c7;
  color: #7a5300;
}

.ops-dot.critical,
.ops-pill.critical,
.ops-pill.failed {
  background: #ffe0dc;
  color: #9b2c20;
}

.ops-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
}

.ops-detail-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ops-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-metrics > div {
  border: 1px solid #e4e9ee;
  border-radius: 6px;
  min-height: 108px;
  padding: 14px;
}

.ops-metrics strong {
  display: block;
  font-size: 24px;
  margin-bottom: 12px;
}

.ops-bar {
  background: #e8edf2;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.ops-bar i {
  display: block;
  height: 100%;
}

.green {
  background: #38a169;
}

.blue {
  background: #2b6cb0;
}

.amber {
  background: #d69e2e;
}

.red {
  background: #e53e3e;
}

.ops-lower {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.8fr);
  margin-bottom: 12px;
}

.ops-table {
  display: grid;
  gap: 6px;
}

.ops-row {
  align-items: center;
  border: 1px solid #e4e9ee;
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: 72px minmax(160px, 1fr) minmax(180px, 1.1fr) 130px;
  min-height: 42px;
  padding: 8px 10px;
}

.ops-row span,
.ops-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-rule-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-rule-form label {
  color: #4d5963;
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
  text-transform: uppercase;
}

.ops-rule-form input,
.ops-rule-form select {
  border: 1px solid #c8d0d8;
  border-radius: 6px;
  min-height: 36px;
  min-width: 0;
  padding: 0 10px;
}

.ops-rule-form label:first-child,
.ops-rule-form button {
  grid-column: 1 / -1;
}

.ops-empty {
  color: #66717b;
  border: 1px dashed #c8d0d8;
  border-radius: 6px;
  padding: 12px;
}

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

  .ops-header,
  .ops-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ops-kpis,
  .ops-grid,
  .ops-lower,
  .ops-metrics {
    grid-template-columns: 1fr;
  }

  .ops-row {
    grid-template-columns: 68px minmax(0, 1fr);
  }
}
