.server-health {
  --server-accent: #35d8ff;
  --server-good: #63f6a5;
  --server-warning: #ffbd55;
  --server-error: #ff5d70;
  color: #eef8ff;
}

.server-health-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 6px 0 18px;
}

.server-health-heading h2 { margin: 5px 0 4px; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.server-health-heading p { margin: 0; color: #9fc2df; }
.server-health-kicker { color: #61d9ff; font-size: .68rem; font-weight: 800; letter-spacing: .18em; }
.server-health-actions { display: flex; align-items: center; gap: 12px; color: #8eafc9; font-size: .75rem; }
.server-health-actions button {
  padding: 9px 14px;
  border: 1px solid rgba(73, 202, 255, .72);
  border-radius: 10px;
  background: rgba(7, 55, 99, .86);
  color: #fff;
  cursor: pointer;
}
.server-health-actions button:disabled { opacity: .55; cursor: wait; }

.server-health-overview { display: grid; grid-template-columns: minmax(220px, .78fr) minmax(0, 2.4fr); gap: 17px; }
.server-health-orbit {
  position: relative;
  display: grid;
  min-height: 292px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(62, 204, 255, .64);
  border-radius: 19px;
  background: radial-gradient(circle at 50% 45%, rgba(10, 112, 176, .24), transparent 48%), rgba(2, 20, 47, .86);
  box-shadow: inset 0 0 36px rgba(41, 158, 228, .12);
  text-align: center;
}

.server-health-orbit > div:last-child { position: relative; z-index: 2; display: grid; gap: 6px; place-items: center; }
.server-health-orbit span { color: #8fc8e9; font-size: .67rem; font-weight: 800; letter-spacing: .19em; }
.server-health-orbit strong { font-size: 1.15rem; letter-spacing: .08em; }
.server-health-orbit small { max-width: 190px; color: #9ebbd2; line-height: 1.35; }
.server-health-radar { position: absolute; width: 205px; height: 205px; border: 1px solid rgba(54, 216, 255, .34); border-radius: 50%; }
.server-health-radar::before,
.server-health-radar::after,
.server-health-radar i { content: ''; position: absolute; inset: 18%; border: 1px solid rgba(54, 216, 255, .24); border-radius: 50%; }
.server-health-radar::after { inset: 36%; }
.server-health-radar i:first-child { inset: 50% -12%; border: 0; border-top: 1px solid rgba(54, 216, 255, .22); border-radius: 0; }
.server-health-radar i:nth-child(2) { inset: -12% 50%; border: 0; border-left: 1px solid rgba(54, 216, 255, .22); border-radius: 0; }
.server-health-radar i:last-child {
  inset: 50%;
  width: 50%;
  height: 1px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, var(--server-accent), transparent);
  transform-origin: left center;
  animation: server-radar-sweep 5s linear infinite;
}

.server-health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.server-health-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 140px;
  padding: 15px;
  overflow: hidden;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 8px 11px;
  border: 1px solid rgba(61, 190, 245, .42);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(5, 39, 77, .88), rgba(2, 21, 49, .94));
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.server-health-card:hover,
.server-health-card:focus-visible,
.server-health-card.is-selected { border-color: var(--server-accent); outline: none; box-shadow: 0 0 18px rgba(42, 198, 255, .25), inset 0 0 24px rgba(41, 151, 226, .08); transform: translateY(-1px); }
.server-health-card::after { content: ''; position: absolute; top: 0; left: 0; width: 46px; height: 2px; background: currentColor; box-shadow: 0 0 10px currentColor; }
.server-health-card-icon,
.server-health-detail-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(80, 207, 255, .52);
  border-radius: 10px;
  background: rgba(7, 59, 105, .75);
  color: var(--server-accent);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.server-health-card-copy { display: grid; min-width: 0; gap: 4px; align-content: center; }
.server-health-card-copy small { color: #94bad5; font-size: .6rem; font-weight: 800; letter-spacing: .12em; }
.server-health-card-copy strong { overflow: hidden; font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.server-health-card-note { grid-column: 1 / -1; align-self: end; overflow: hidden; color: #86a9c4; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.server-health-gauge { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(91, 149, 184, .19); }
.server-health-gauge i { display: block; width: 0; height: 100%; border-radius: inherit; background: currentColor; box-shadow: 0 0 9px currentColor; transition: width .25s ease; }
.server-health-signal,
.server-health-bars { display: flex; grid-column: 1 / -1; height: 22px; align-items: flex-end; gap: 5px; }
.server-health-signal i { flex: 1; height: 2px; background: currentColor; box-shadow: 0 0 7px currentColor; }
.server-health-signal i:nth-child(2) { height: 8px; }
.server-health-signal i:nth-child(3) { height: 16px; }
.server-health-signal i:nth-child(4) { height: 7px; }
.server-health-signal i:nth-child(5) { height: 12px; }
.server-health-bars i { flex: 1; height: 32%; background: currentColor; opacity: .72; box-shadow: 0 0 6px currentColor; }
.server-health-bars i:nth-child(2), .server-health-bars i:nth-child(5) { height: 78%; }
.server-health-bars i:nth-child(3) { height: 54%; }
.server-health-bars i:nth-child(4) { height: 100%; }
.server-health-bars i:nth-child(6) { height: 66%; }
.server-health-pulse { grid-column: 1 / -1; height: 21px; background: linear-gradient(135deg, transparent 42%, currentColor 43% 47%, transparent 48% 55%, currentColor 56% 60%, transparent 61%); opacity: .74; }

.server-health-card.health-healthy,
.server-health-orbit.health-healthy { color: var(--server-good); }
.server-health-card.health-standby,
.server-health-orbit.health-standby { color: #86a9c4; border-color: rgba(134, 169, 196, .58); }
.server-health-card.health-warning,
.server-health-orbit.health-warning { color: var(--server-warning); border-color: rgba(255, 189, 85, .74); }
.server-health-card.health-error,
.server-health-orbit.health-error { color: var(--server-error); border-color: rgba(255, 93, 112, .78); }
.server-health-card.health-unknown,
.server-health-orbit.health-unknown { color: #70b9df; }
.server-health-card-copy,
.server-health-card-note,
.server-health-orbit > div:last-child { color: #eef8ff; }

.server-health-popover-layer {
  position: fixed;
  inset: 0;
  z-index: 2200;
  pointer-events: none;
}
.server-health-popover {
  position: fixed;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  width: min(380px, calc(100vw - 24px));
  max-height: min(380px, calc(100svh - 24px));
  padding: 17px 42px 17px 18px;
  overflow: auto;
  border: 2px solid #68cfee;
  border-radius: 16px;
  background: #f4f9fd;
  box-shadow: 0 20px 48px rgba(0, 4, 17, .72), 0 0 0 1px rgba(255, 255, 255, .72);
  color: #0a2742;
  pointer-events: auto;
}
.server-health-popover-close { position: absolute; top: 7px; right: 9px; width: 28px; height: 28px; border: 1px solid #39779f; border-radius: 50%; color: #fff; background: #123d60; cursor: pointer; }
.server-health-popover-close:focus-visible { outline: 2px solid #087fa8; outline-offset: 2px; }
.server-health-popover small { color: #20799d; font-size: .61rem; font-weight: 800; letter-spacing: .15em; }
.server-health-popover h3 { margin: 4px 0; font-size: 1rem; }
.server-health-popover p { margin: 0; color: #3c5d75; font-size: .78rem; line-height: 1.4; }
.server-health-popover > strong { color: currentColor; font-size: 1.12rem; white-space: nowrap; }
.server-health-popover.health-healthy { border-color: #22a566; }
.server-health-popover.health-healthy > strong { color: #087a42; }
.server-health-popover.health-standby { border-color: #7899b4; }
.server-health-popover.health-standby > strong { color: #4f718b; }
.server-health-popover.health-warning { border-color: #d78300; }
.server-health-popover.health-warning > strong { color: #a55d00; }
.server-health-popover.health-error { border-color: #d83b50; }
.server-health-popover.health-error > strong { color: #ba263b; }
.server-health-popover.health-unknown { border-color: #5b91ad; }
.server-health-popover.health-unknown > strong { color: #416e87; }
.server-health-popover[data-placement="left-lane"] { grid-template-columns: auto minmax(0, 1fr); }
.server-health-popover[data-placement="left-lane"] > strong { grid-column: 2; }
.server-health-footnote { margin: 10px 4px 0; color: #7798b2; font-size: .69rem; line-height: 1.45; }

.server-health-grid { display: grid; grid-template-columns: 1fr; gap: 15px; }
.server-health-category { min-width: 0; padding: 12px; border: 1px solid rgba(62, 190, 245, .18); border-radius: 16px; background: rgba(2, 17, 40, .48); }
.server-health-category > h3 { margin: 0 0 10px; color: #75cef4; font-size: .62rem; letter-spacing: .15em; }
.server-health-category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.server-health-card { min-height: 112px; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto auto; }
.server-health-card-value { grid-column: 1 / -1; overflow: hidden; color: currentColor; font-size: 1.04rem; font-style: normal; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.server-health-state { align-self: start; padding: 4px 6px; border: 1px solid currentColor; border-radius: 999px; font-size: .5rem; font-style: normal; font-weight: 900; letter-spacing: .09em; }
.server-health-card-note { grid-column: 1 / -1; }
.server-alert-center { margin-top: 16px; padding: 17px; border: 1px solid rgba(63, 192, 247, .35); border-radius: 16px; background: rgba(2, 20, 45, .82); }
.server-alert-center > header { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.server-alert-center h3 { margin: 4px 0 0; }
#server-alert-count { color: #9abbd5; font-size: .76rem; }
.server-alert-list { display: grid; gap: 8px; }
.server-alert-empty { margin: 0; color: #8fb2cd; }
.server-alert-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 11px; border: 1px solid rgba(70, 197, 246, .22); border-radius: 11px; background: rgba(4, 26, 56, .72); }
.server-alert-row > i { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--server-good); box-shadow: 0 0 11px currentColor; color: var(--server-good); }
.server-alert-row.health-warning > i { color: var(--server-warning); background: var(--server-warning); }
.server-alert-row.health-error > i { color: var(--server-error); background: var(--server-error); }
.server-alert-row.is-resolved { opacity: .72; }
.server-alert-row strong { display: block; }
.server-alert-row p { margin: 4px 0; color: #b4cee2; font-size: .73rem; line-height: 1.4; }
.server-alert-row small { color: #7f9fba; }
.server-alert-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.server-alert-actions button { padding: 7px 9px; border: 1px solid #46c8ff; border-radius: 8px; color: #fff; background: rgba(8, 57, 100, .9); cursor: pointer; }
.server-alert-actions .server-alert-ai { border-color: #aa8cff; background: rgba(74, 48, 127, .72); }
.server-alert-actions button:disabled { cursor: wait; opacity: .6; }
.server-alert-history { margin-top: 12px; border: 1px solid rgba(63, 192, 247, .28); border-radius: 14px; background: rgba(2, 18, 42, .78); }
.server-alert-history > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 17px; cursor: pointer; list-style: none; }
.server-alert-history > summary::-webkit-details-marker { display: none; }
.server-alert-history > summary::after { content: "⌄"; color: #66d7ff; font-size: 1.15rem; transition: transform .16s ease; }
.server-alert-history[open] > summary::after { transform: rotate(180deg); }
.server-alert-history > summary > span:first-child { display: grid; gap: 3px; margin-right: auto; }
.server-alert-history > summary small { color: #67cfee; font-size: .58rem; font-weight: 800; letter-spacing: .15em; }
.server-alert-history > summary strong { font-size: .95rem; }
#server-alert-history-count { color: #9abbd5; font-size: .73rem; }
.server-alert-history-body { padding: 0 17px 17px; border-top: 1px solid rgba(70, 197, 246, .16); }
.server-alert-history-filters { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)) auto; gap: 9px; align-items: end; padding: 13px 0; }
.server-alert-history-filters label { display: grid; gap: 5px; color: #9dbbd2; font-size: .68rem; }
.server-alert-history-filters select,
.server-alert-history-filters input,
.server-alert-history-filters button,
.server-alert-history-more { min-height: 36px; padding: 7px 9px; border: 1px solid rgba(70, 197, 246, .46); border-radius: 8px; color: #effaff; background: rgba(5, 42, 78, .9); }
.server-alert-history-filters button,
.server-alert-history-more { cursor: pointer; }
.server-alert-history-status { margin: 0 0 10px; color: #86a9c4; font-size: .7rem; }
.server-alert-history-more { display: block; margin: 12px auto 0; }
.server-alert-history-more:disabled { cursor: wait; opacity: .6; }
.server-ai-diagnostic { margin-top: 12px; padding: 16px; border: 1px solid rgba(170, 140, 255, .58); border-radius: 14px; background: linear-gradient(145deg, rgba(49, 31, 92, .72), rgba(3, 22, 49, .92)); }
.server-ai-diagnostic h3 { margin: 0 0 8px; color: #d8c7ff; }
.server-ai-diagnostic p, .server-ai-diagnostic li { color: #c7d8e8; font-size: .78rem; line-height: 1.5; }
.server-ai-diagnostic small { color: #a98cff; }

@keyframes server-radar-sweep { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .server-health-overview { grid-template-columns: 1fr; }
  .server-health-orbit { min-height: 225px; }
  .server-health-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .server-health-heading { display: grid; align-items: start; }
  .server-health-actions { flex-wrap: wrap; justify-content: space-between; }
  .server-health-grid { grid-template-columns: 1fr; }
  .server-health-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-alert-history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-alert-history-filters button { grid-column: 1 / -1; }
}

@media (max-width: 430px) {
  .server-health-grid { grid-template-columns: 1fr; }
  .server-health-category-grid { grid-template-columns: 1fr; }
  .server-alert-row { grid-template-columns: auto minmax(0, 1fr); }
  .server-alert-actions { grid-column: 2; justify-content: start; }
  .server-health-popover { grid-template-columns: auto minmax(0, 1fr); padding-right: 38px; }
  .server-health-popover > strong { grid-column: 2; }
  .server-alert-history-filters { grid-template-columns: 1fr; }
  .server-alert-history-filters button { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .server-health-radar i:last-child { animation: none; }
  .server-health-card { transition: none; }
}
