.system-status-window {
  --system-bg: #080c12;
  --system-panel: #0f151d;
  --system-raised: #151d27;
  --system-border: #24303d;
  --system-border-soft: #1b2530;
  --system-text: #eaf1f7;
  --system-muted: #8796a5;
  --system-accent: #57a6ff;
  --system-good: #45d48a;
  --system-warn: #e8b653;
  --system-bad: #ff747c;
  container-name: system-status;
  container-type: inline-size;
  height: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at 10% -10%, #17345280, transparent 33%),
    radial-gradient(circle at 92% 2%, #173a334d, transparent 25%),
    var(--system-bg);
  color: var(--system-text);
  font-size: 12px;
}

.system-status-hero {
  display: grid;
  min-height: 126px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #293848;
  background: linear-gradient(110deg, #111d2aeb, #0d171feb);
  padding: 22px 28px;
}

.system-overall {
  --state: #7c8792;
  position: relative;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
}

.system-overall[data-state="HEALTHY"] {
  --state: var(--system-good);
}

.system-overall[data-state="DEGRADED"] {
  --state: var(--system-warn);
}

.system-overall[data-state="UNAVAILABLE"] {
  --state: var(--system-bad);
}

.system-overall-orbit {
  position: absolute;
  inset: 1px;
  border: 1px solid color-mix(in srgb, var(--state), transparent 62%);
  border-radius: 50%;
  background: color-mix(in srgb, var(--state), transparent 93%);
}

.system-overall-orbit::before,
.system-overall-orbit::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.system-overall-orbit::before {
  inset: 8px;
  border: 1px solid color-mix(in srgb, var(--state), transparent 78%);
}

.system-overall-orbit::after {
  top: -2px;
  left: 28px;
  width: 5px;
  height: 5px;
  background: var(--state);
  box-shadow: 0 0 12px var(--state);
}

.system-overall-dot {
  width: 16px;
  height: 16px;
  border: 4px solid color-mix(in srgb, var(--state), #fff 16%);
  border-radius: 50%;
  background: var(--state);
  box-shadow: 0 0 18px color-mix(in srgb, var(--state), transparent 35%);
}

.system-status-window.is-loading .system-overall-orbit {
  animation: system-spin 1.7s linear infinite;
}

@keyframes system-spin {
  to {
    transform: rotate(360deg);
  }
}

.system-kicker {
  color: var(--system-accent);
  font:
    750 9px/1.2 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 0.12em;
}

.system-hero-title {
  display: flex;
  align-items: center;
  gap: 11px;
}

.system-hero-title h2 {
  margin: 3px 0 2px;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.system-hero-title > span {
  border: 1px solid #ffffff20;
  border-radius: 999px;
  background: #ffffff0a;
  padding: 3px 8px;
  color: #c5d1dc;
  font-size: 10px;
  font-weight: 700;
}

.system-hero-copy > p {
  max-width: 700px;
  margin: 4px 0 8px;
  color: #a9b7c4;
  line-height: 1.45;
}

.system-observation {
  display: flex;
  gap: 7px;
  color: #718292;
  font:
    10px/1.2 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}

.system-observation span + span::before {
  margin-right: 7px;
  content: "·";
}

.system-observation [data-stale="true"] {
  color: var(--system-warn);
}

.system-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: #32465b;
  background: #152231;
  padding: 8px 12px;
  color: #c9d9e8;
  font-weight: 650;
}

.system-tabs {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  min-height: 43px;
  align-items: end;
  gap: 3px;
  border-bottom: 1px solid var(--system-border);
  background: #0c1219eb;
  padding: 0 26px;
  backdrop-filter: blur(12px);
}

.system-tabs button {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
  color: var(--system-muted);
  font-size: 11px;
  font-weight: 680;
}

.system-tabs button:hover,
.system-tabs button[aria-selected="true"] {
  color: var(--system-text);
}

.system-tabs button[aria-selected="true"] {
  border-bottom-color: var(--system-accent);
}

.system-tabs button span {
  min-width: 18px;
  border-radius: 999px;
  background: #ffffff0d;
  padding: 2px 5px;
  color: #9fadb9;
  font:
    9px/1.2 ui-monospace,
    monospace;
  text-align: center;
}

.system-inline-message {
  margin: 16px 26px -2px;
  border: 1px solid #8d6b2e;
  border-radius: 7px;
  background: #332712;
  padding: 10px 13px;
  color: #f4cf83;
}

.system-inline-message[data-kind="error"] {
  border-color: #7d3940;
  background: #321a1e;
  color: #ffb6bb;
}

.system-status-content {
  display: grid;
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 26px 30px;
}

.system-status-content > section {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.system-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.system-metric {
  --state: #7c8792;
  position: relative;
  display: grid;
  min-height: 96px;
  align-content: center;
  gap: 3px;
  overflow: hidden;
  border: 1px solid var(--system-border);
  border-radius: 9px;
  background: linear-gradient(145deg, #141d27, #0f151d);
  padding: 15px 17px;
}

.system-metric::before {
  position: absolute;
  top: 16px;
  right: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--state);
  box-shadow: 0 0 12px color-mix(in srgb, var(--state), transparent 30%);
  content: "";
}

.system-metric[data-state="HEALTHY"] {
  --state: var(--system-good);
}

.system-metric[data-state="DEGRADED"] {
  --state: var(--system-warn);
}

.system-metric[data-state="UNAVAILABLE"] {
  --state: var(--system-bad);
}

.system-metric-label {
  color: var(--system-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.system-metric strong {
  overflow: hidden;
  margin-top: 3px;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-metric small {
  overflow: hidden;
  color: #758596;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-surface-card,
.system-operation {
  min-width: 0;
  border: 1px solid var(--system-border);
  border-radius: 10px;
  background: #0e141cdb;
  box-shadow: 0 14px 30px #0000001f;
}

.system-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--system-border-soft);
  padding: 15px 17px 13px;
}

.system-panel-heading h3 {
  margin: 2px 0;
  font-size: 14px;
}

.system-panel-heading p {
  margin: 0;
  color: var(--system-muted);
  font-size: 10px;
}

.system-topology-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 17px;
}

.system-topology-zone {
  position: relative;
  min-width: 0;
  border: 1px solid #23303d;
  border-radius: 8px;
  background: #0b1118;
  padding: 12px;
}

.system-topology-zone:not(:last-child)::after {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -20px;
  display: grid;
  width: 25px;
  height: 25px;
  transform: translateY(-50%);
  place-items: center;
  border: 1px solid #2b4964;
  border-radius: 50%;
  background: #101d29;
  color: var(--system-accent);
  content: "›";
  font-size: 20px;
}

.system-topology-zone > header {
  display: grid;
  min-height: 45px;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
}

.system-zone-index {
  grid-row: 1 / 3;
  color: #52687b;
  font:
    10px/1.3 ui-monospace,
    monospace;
}

.system-topology-zone > header strong {
  font-size: 11px;
}

.system-topology-zone > header small {
  overflow: hidden;
  color: #66798a;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-topology-nodes {
  display: grid;
  gap: 7px;
}

.system-topology-node {
  --state: #7c8792;
  display: grid;
  min-height: 47px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #253444;
  border-left: 2px solid var(--state);
  border-radius: 6px;
  background: #131b24;
  padding: 7px 8px;
}

.system-topology-node[data-state="HEALTHY"],
.system-flow-row[data-state="HEALTHY"] {
  --state: var(--system-good);
}

.system-topology-node[data-state="DEGRADED"],
.system-flow-row[data-state="DEGRADED"] {
  --state: var(--system-warn);
}

.system-topology-node[data-state="UNAVAILABLE"],
.system-flow-row[data-state="UNAVAILABLE"] {
  --state: var(--system-bad);
}

.system-node-glyph,
.system-action-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #30465a;
  border-radius: 6px;
  background: #172432;
  color: #8fc7f7;
  font:
    750 9px/1 ui-monospace,
    monospace;
}

.system-node-copy {
  display: grid;
  min-width: 0;
}

.system-node-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-node-copy small {
  overflow: hidden;
  color: #6f8191;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-state {
  --state: #7c8792;
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--state), transparent 60%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--state), transparent 90%);
  padding: 4px 8px;
  color: color-mix(in srgb, var(--state), #fff 22%);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.system-state.is-compact {
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 8px;
}

.system-state[data-state="HEALTHY"] {
  --state: var(--system-good);
}

.system-state[data-state="DEGRADED"] {
  --state: var(--system-warn);
}

.system-state[data-state="UNAVAILABLE"] {
  --state: var(--system-bad);
}

.system-state-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--state);
  box-shadow: 0 0 7px color-mix(in srgb, var(--state), transparent 35%);
}

.system-flow-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 17px 17px;
}

.system-flow-row {
  --state: #7c8792;
  display: grid;
  gap: 8px;
  border: 1px solid #202d39;
  border-left: 2px solid var(--state);
  border-radius: 7px;
  background: #0b1118;
  padding: 10px 12px;
}

.system-flow-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.system-flow-heading strong {
  font-size: 10px;
}

.system-flow-path {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.system-flow-chip {
  overflow: hidden;
  border: 1px solid #283745;
  border-radius: 4px;
  background: #131c25;
  padding: 3px 6px;
  color: #9cabb8;
  font:
    8px/1.2 ui-monospace,
    monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-flow-arrow {
  color: #4f789b;
}

.system-table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--system-border-soft);
  padding: 9px 13px;
}

.system-filter-group {
  display: flex;
  gap: 3px;
}

.system-filter-group button {
  border-color: transparent;
  background: transparent;
  padding: 5px 8px;
  color: var(--system-muted);
  font-size: 9px;
}

.system-filter-group button[aria-pressed="true"] {
  border-color: #32465b;
  background: #172432;
  color: #dbe8f3;
}

.system-service-search {
  width: min(230px, 35%);
  height: 28px;
  margin-left: auto;
  border-color: #2b3947;
  background: #090e14;
  font-size: 10px;
}

.system-visible-count {
  min-width: 45px;
  color: #6f8191;
  font:
    9px/1.2 ui-monospace,
    monospace;
  text-align: right;
}

.system-table-wrap {
  overflow: auto;
}

.system-service-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.system-service-table th,
.system-service-table td {
  overflow: hidden;
  border-bottom: 1px solid #1b2530;
  padding: 9px 10px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-service-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #101720;
  color: #6f8191;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.system-service-table td {
  color: #aebbc7;
  font-size: 9px;
}

.system-service-table tbody tr:hover {
  background: #131d27;
}

.system-service-table th:nth-child(1) {
  width: 15%;
}

.system-service-table th:nth-child(2) {
  width: 16%;
}

.system-service-table th:nth-child(3) {
  width: 12%;
}

.system-service-table th:nth-child(4),
.system-service-table th:nth-child(5),
.system-service-table th:nth-child(6) {
  width: 9%;
}

.system-service-table th:nth-child(7) {
  width: 18%;
}

.system-service-table th:nth-child(8) {
  width: 12%;
}

.system-service-name {
  display: grid;
}

.system-service-name strong {
  color: #e3ebf2;
  font-size: 10px;
}

.system-service-name small {
  color: #5f7181;
  font:
    8px/1.3 ui-monospace,
    monospace;
}

.system-mono,
.system-image {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.system-image {
  color: #718494 !important;
  font-size: 8px !important;
}

.system-table-action {
  text-align: right !important;
}

.system-row-action {
  border-color: #2e465c;
  background: #142231;
  padding: 4px 7px;
  color: #a8cdea;
  font-size: 8px;
}

.system-action-warning {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #59471f;
  background: #2c2414;
  padding: 10px 16px;
  color: #d9bd7c;
}

.system-action-warning > span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #856c34;
  border-radius: 50%;
  font-weight: 800;
}

.system-action-warning p {
  margin: 0;
  font-size: 9px;
  line-height: 1.45;
}

.system-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
}

.system-action-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #26323e;
  border-radius: 8px;
  background: #111821;
  padding: 11px;
}

.system-action-card[data-eligible="false"] {
  opacity: 0.62;
}

.system-action-card .system-state {
  align-self: start;
}

.system-action-card > button {
  grid-column: 2 / 4;
  width: max-content;
}

.system-action-copy {
  min-width: 0;
}

.system-action-risk {
  color: #75899b;
  font:
    7px/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.08em;
}

.system-action-copy h4 {
  margin: 3px 0;
  font-size: 11px;
}

.system-action-copy p {
  margin: 0;
  color: #8293a2;
  font-size: 9px;
  line-height: 1.35;
}

.system-action-button,
.system-danger-button {
  border-color: #2d5876;
  background: #153047;
  padding: 6px 9px;
  color: #b8ddf7;
  font-size: 9px;
  font-weight: 700;
}

.system-danger-button {
  border-color: #7d4248;
  background: #402126;
  color: #ffc0c4;
}

.system-operation {
  border-color: #2c5f83;
  background: linear-gradient(110deg, #102437, #111820);
  padding: 14px 17px;
}

.system-operation-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
}

.system-operation-heading .system-kicker {
  grid-column: 1 / 3;
}

.system-operation-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 13px;
}

.system-operation-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #627484;
}

.system-operation-stage::before {
  position: absolute;
  top: 5px;
  right: 50%;
  left: -50%;
  height: 1px;
  background: #2a3a48;
  content: "";
}

.system-operation-stage:first-child::before {
  display: none;
}

.system-operation-stage > span {
  z-index: 1;
  width: 11px;
  height: 11px;
  border: 2px solid #405363;
  border-radius: 50%;
  background: #111b24;
}

.system-operation-stage.is-reached {
  color: #aed4ef;
}

.system-operation-stage.is-reached::before,
.system-operation-stage.is-reached > span {
  border-color: var(--system-accent);
  background: var(--system-accent);
}

.system-operation-stage.is-failed > span {
  border-color: var(--system-bad);
  background: var(--system-bad);
}

.system-operation-error,
.system-dialog-error {
  color: #ff9ea4;
}

.system-action-dialog {
  width: min(510px, calc(100vw - 30px));
  border: 1px solid #354657;
  border-radius: 11px;
  outline: 0;
  background: #0e151e;
  padding: 0;
  color: var(--system-text);
  box-shadow: 0 28px 90px #000d;
}

.system-action-dialog::backdrop {
  background: #03070bc9;
  backdrop-filter: blur(4px);
}

.system-action-form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.system-action-form h2 {
  margin: 4px 0;
  font-size: 18px;
}

.system-action-form header p,
.system-action-form label small {
  margin: 0;
  color: var(--system-muted);
  font-size: 9px;
}

.system-action-preflight {
  border: 1px solid #28415a;
  border-radius: 7px;
  background: #101f2d;
  padding: 11px 13px;
}

.system-action-preflight strong {
  font-size: 10px;
}

.system-action-preflight ul {
  margin: 7px 0 0;
  padding-left: 17px;
  color: #91a6b8;
  font-size: 9px;
  line-height: 1.6;
}

.system-action-form textarea,
.system-action-form select {
  width: 100%;
  background: #090e14;
}

.system-confirm-check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  border-top: 1px solid #26313c;
  padding-top: 13px;
}

.system-confirm-check input {
  margin: 1px 0 0;
}

.system-action-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.system-dialog-error {
  margin: 0;
  font-size: 10px;
}

.system-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed #2b3946;
  border-radius: 9px;
  color: #718292;
}

.system-empty.is-compact {
  min-height: 70px;
}

@container system-status (max-width: 880px) {
  .system-metric-grid,
  .system-topology-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-topology-zone::after {
    display: none !important;
  }

  .system-flow-list,
  .system-action-grid {
    grid-template-columns: 1fr;
  }

  .system-service-table {
    min-width: 880px;
  }
}

@container system-status (max-width: 560px) {
  .system-status-hero {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 18px;
  }

  .system-refresh {
    grid-column: 1 / 3;
    justify-content: center;
  }

  .system-status-content {
    padding: 14px;
  }

  .system-tabs {
    padding: 0 10px;
  }

  .system-metric-grid,
  .system-topology-grid {
    grid-template-columns: 1fr;
  }

  .system-table-tools {
    flex-wrap: wrap;
  }

  .system-service-search {
    width: 100%;
    margin-left: 0;
    order: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .system-status-window.is-loading .system-overall-orbit {
    animation: none;
  }
}
