:root {
  --bg: #0b1220;
  --panel: #121a2b;
  --panel-2: #18233a;
  --text: #e8eefc;
  --muted: #9eb0d1;
  --accent: #4da3ff;
  --border: #263552;
  --shadow: 0 10px 30px rgba(0,0,0,.28);
}

/* RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* BODY */
body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #0b1220 0%, #0e1628 100%);
  color: var(--text);
  line-height: 1.5;
}

/* LINKS */
a {
  color: #8ec5ff;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* LAYOUT */
.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: rgba(18,26,43,.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.title-wrap h3 {
  font-size: 24px;
  font-weight: 700;
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-link {
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}

/* CONTROLS */
.controls {
  margin: 18px 0 12px;
  padding: 14px 16px;
  background: rgba(18,26,43,.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.controls form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

select {
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
}

.cluster-link {
  font-size: 13px;
  color: #b7ceef;
}

/* CARD */
.card {
  overflow-x: auto;
  background: rgba(18,26,43,.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(38,53,82,.8);
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}

th {
  background: rgba(24,35,58,.95);
  color: #f3f7ff;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:hover td {
  background: rgba(255,255,255,.02);
}

/* FOOTER TEXT */
.foot {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.stale {
  color: #ff8d8d;
  font-weight: 700;
  font-size: 18px;
}

/* SEPARATOR */
.sep {
  margin: 18px 0 12px;
  border: 0;
  border-top: 1px dashed var(--border);
}

/* TOOLTIP */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  opacity: 0;

  position: absolute;
  z-index: 1000;

  bottom: 125%;
  left: 0;
  margin-left: 0;

  min-width: 260px;
  max-width: min(900px, calc(100vw - 40px));
  max-height: 70vh;

  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;

  background: #0b1220;
  color: #fff;
  text-align: left;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: opacity .2s ease;
  line-height: 1.4;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* COLLAPSIBLE */
.collapsible {
  width: 100%;
  text-align: left;
  background: linear-gradient(180deg, #223456, #1a2944);
  color: #fff;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid #35507c;
  border-radius: 8px;
  outline: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.collapsible:hover,
.collapsible.active {
  background: linear-gradient(180deg, #28406a, #203252);
}

.content {
  padding: 2px 6px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
  background: rgba(255,255,255,.02);
  border-radius: 0 0 10px 10px;
  margin-top: 3px;
}

.content .tooltip {
  display: block;
  margin-bottom: 4px;
}

/* STATUS COLORS */
.blue {
  background: rgba(50, 95, 165, .18);
  color: #dce9ff;
  font-weight: 700;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .tooltip .tooltiptext {
    width: 260px;
    margin-left: -130px;
  }
}

.hw-item {
  margin: 10px 0 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.hw-title {
  margin-bottom: 8px;
  color: #f3f7ff;
  font-weight: 700;
}

.hw-body {
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.link-like {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: normal;
  color: #8ec5ff;
  cursor: pointer;
  text-align: left;
}

.link-like:hover {
  text-decoration: underline;
}
